@jant/core 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/commands/site/import.js +2 -1
- package/dist/{app-CbOZ2Irh.js → app-BuzORSgm.js} +1441 -686
- package/dist/client/.vite/manifest.json +72 -83
- package/dist/client/_assets/chunks/{confirm-CMe01lne.js → confirm-BQebcuNB.js} +1 -1
- package/dist/client/_assets/chunks/{create-editor-hWapNE40.js → create-editor-B8KuszlS.js} +38 -38
- package/dist/client/_assets/chunks/footnote-rail-DUrqz0Py.js +2 -0
- package/dist/client/_assets/chunks/{jant-locale-picker-2L4rkDaz.js → jant-locale-picker-CLq0iKDH.js} +1 -1
- package/dist/client/_assets/chunks/lit-BN4mrI3j.js +2 -0
- package/dist/client/_assets/chunks/{settings-paths-BBVT8zKj.js → settings-paths-_fry4yWW.js} +1 -1
- package/dist/client/_assets/chunks/{slug-format-BuCPjSrB.js → slug-format-bcJ2ozr4.js} +1 -1
- package/dist/client/_assets/chunks/{sortable-list-DJXwkaOv.js → sortable-list-Bz2Na2E9.js} +2 -2
- package/dist/client/_assets/chunks/{unsafe-html-CWos3v6N.js → unsafe-html-OJ9m154w.js} +1 -1
- package/dist/client/_assets/chunks/unsafe-svg-DVJ4NPcb.js +1 -0
- package/dist/client/_assets/client-CStDm2xD.js +354 -0
- package/dist/client/_assets/{client-D8Rrsd73.css → client-CoNHvipV.css} +1 -1
- package/dist/client/_assets/{client-auth-CsUGM718.js → client-auth-D53R-Wby.js} +99 -129
- package/dist/client/_assets/client-author-2WYBkgni.css +2 -0
- package/dist/client/_assets/{client-compose-BB4U7Wz0.js → client-compose-DYtDlYm-.js} +248 -244
- package/dist/client/_assets/{client-manage-CI9-eh-8.js → client-manage-BODyYP5Z.js} +157 -157
- package/dist/client/_assets/{client-settings-BnGPuqwc.js → client-settings-DDpe_tXJ.js} +166 -166
- package/dist/client/_assets/client-share-B9OsXx9p.js +149 -0
- package/dist/{constants-DEgyqWDl.js → constants-C2CdWAqt.js} +55 -5
- package/dist/index.js +1 -1
- package/dist/node.js +2 -2
- package/package.json +2 -1
- package/src/client/components/compose-types.ts +5 -1
- package/src/client/components/jant-compose-dialog.ts +25 -4
- package/src/client/components/jant-media-lightbox.ts +18 -3
- package/src/client/components/jant-nav-manager.ts +2 -0
- package/src/client/components/jant-post-menu.ts +42 -89
- package/src/client/components/nav-manager-types.ts +2 -0
- package/src/client/components/settings-types.ts +1 -1
- package/src/client/list-views.ts +382 -0
- package/src/client/media-lightbox-events.ts +12 -0
- package/src/client/runtime-paths.ts +12 -0
- package/src/client/share-capture.ts +63 -0
- package/src/client/share-launch.ts +36 -9
- package/src/client/tiptap/create-editor.ts +4 -0
- package/src/client/tiptap/embed-node.ts +3 -1
- package/src/client/tiptap/html-block-node.ts +3 -1
- package/src/client/tiptap/image-node.ts +3 -1
- package/src/client/view-confirm.ts +32 -4
- package/src/client.ts +1 -0
- package/src/db/migrations/0037_round_post.sql +16 -0
- package/src/db/migrations/0038_flashy_changeling.sql +15 -0
- package/src/db/migrations/0039_mixed_sister_grimm.sql +1 -0
- package/src/db/migrations/meta/0037_snapshot.json +2932 -0
- package/src/db/migrations/meta/0038_snapshot.json +2924 -0
- package/src/db/migrations/meta/0039_snapshot.json +2931 -0
- package/src/db/migrations/meta/_journal.json +21 -0
- package/src/db/migrations/pg/0035_flimsy_outlaw_kid.sql +3 -0
- package/src/db/migrations/pg/0036_milky_wolverine.sql +5 -0
- package/src/db/migrations/pg/0037_fuzzy_hammerhead.sql +1 -0
- package/src/db/migrations/pg/meta/0035_snapshot.json +3773 -0
- package/src/db/migrations/pg/meta/0036_snapshot.json +3766 -0
- package/src/db/migrations/pg/meta/0037_snapshot.json +3772 -0
- package/src/db/migrations/pg/meta/_journal.json +21 -0
- package/src/db/pg/schema.ts +1 -0
- package/src/db/post-visibility.ts +37 -6
- package/src/db/schema.ts +5 -2
- package/src/i18n/locales/glossary.zh-Hans.yml +4 -0
- package/src/i18n/locales/glossary.zh-Hant.yml +4 -0
- package/src/i18n/locales/public/en.po +21 -90
- package/src/i18n/locales/public/en.ts +1 -1
- package/src/i18n/locales/public/zh-Hans.po +20 -89
- package/src/i18n/locales/public/zh-Hans.ts +1 -1
- package/src/i18n/locales/public/zh-Hant.po +20 -89
- package/src/i18n/locales/public/zh-Hant.ts +1 -1
- package/src/i18n/locales/settings/en.po +84 -0
- package/src/i18n/locales/settings/en.ts +1 -1
- package/src/i18n/locales/settings/zh-Hans.po +130 -46
- package/src/i18n/locales/settings/zh-Hans.ts +1 -1
- package/src/i18n/locales/settings/zh-Hant.po +124 -40
- package/src/i18n/locales/settings/zh-Hant.ts +1 -1
- package/src/lib/api-public-posts.ts +10 -0
- package/src/lib/feed-policy.ts +2 -2
- package/src/lib/feed.ts +17 -1
- package/src/lib/filter-dimensions.ts +11 -4
- package/src/lib/hugo-markdown.ts +7 -0
- package/src/lib/icons.ts +2 -0
- package/src/lib/link-preview.ts +499 -0
- package/src/lib/list-views.ts +117 -0
- package/src/lib/markdown-manager.ts +40 -1
- package/src/lib/navigation.ts +1 -1
- package/src/lib/share-card.ts +4 -3
- package/src/lib/thread-query.ts +6 -2
- package/src/lib/timeline.ts +12 -11
- package/src/lib/url-fetch.ts +291 -74
- package/src/lib/view-buffer.ts +2 -2
- package/src/lib/view-counting.ts +7 -6
- package/src/lib/view-token.ts +29 -7
- package/src/lib/view.ts +17 -0
- package/src/middleware/view-counter.ts +10 -5
- package/src/preset.css +5 -3
- package/src/routes/api/search.ts +1 -1
- package/src/routes/dash/settings.tsx +1 -1
- package/src/routes/feed/sitemap.ts +1 -1
- package/src/routes/pages/archive.tsx +25 -19
- package/src/routes/pages/collection.tsx +3 -3
- package/src/routes/pages/page.tsx +16 -4
- package/src/routes/pages/search.tsx +3 -3
- package/src/routes/pages/subscribe.tsx +19 -3
- package/src/routes/view-confirm.ts +23 -15
- package/src/services/collection.ts +1 -1
- package/src/services/export-theme/assets/client-site.js +19 -19
- package/src/services/export-theme/layouts/archive/list.html +4 -2
- package/src/services/export-theme/layouts/partials/collection-members.html +4 -3
- package/src/services/export-theme/layouts/partials/featured-members.html +3 -3
- package/src/services/export-theme/layouts/partials/head.html +2 -0
- package/src/services/export-theme/layouts/partials/latest-members.html +4 -4
- package/src/services/export-theme/layouts/partials/post-card.html +1 -9
- package/src/services/export-theme/layouts/partials/reply.html +1 -9
- package/src/services/export-theme/layouts/partials/smart-collection-members.html +4 -3
- package/src/services/export-theme/layouts/post/list.html +1 -9
- package/src/services/export-theme/styles/main.css +2 -26
- package/src/services/export.ts +10 -3
- package/src/services/mcp.ts +5 -5
- package/src/services/navigation.ts +9 -4
- package/src/services/post.ts +102 -112
- package/src/services/search.ts +22 -7
- package/src/services/smart-collection.ts +3 -3
- package/src/services/stats.ts +12 -5
- package/src/services/thread.ts +6 -2
- package/src/styles/components-author.css +69 -7
- package/src/styles/tokens.css +28 -29
- package/src/styles/ui-author.css +140 -353
- package/src/styles/ui.css +34 -32
- package/src/types/constants.ts +68 -4
- package/src/types/entities.ts +1 -0
- package/src/types/views.ts +2 -0
- package/src/ui/compose/ComposeDialog.tsx +20 -1
- package/src/ui/dash/StatusBadge.tsx +11 -0
- package/src/ui/dash/appearance/FontThemeContent.tsx +1 -1
- package/src/ui/dash/appearance/NavigationContent.tsx +8 -0
- package/src/ui/dash/settings/StatsContent.tsx +29 -29
- package/src/ui/feed/LinkCard.tsx +19 -2
- package/src/ui/feed/PostStatusBadges.tsx +19 -3
- package/src/ui/feed/TimelineFeed.tsx +3 -0
- package/src/ui/font-themes.ts +32 -15
- package/src/ui/pages/ArchivePage.tsx +1 -0
- package/src/ui/pages/SubscribePage.tsx +9 -1
- package/src/ui/shared/PostFooter.tsx +1 -22
- package/src/ui/shared/custom-icons.ts +5 -5
- package/dist/client/_assets/chunks/footnote-rail-9zwl6jtV.js +0 -2
- package/dist/client/_assets/chunks/lit-Bw_voPoW.js +0 -2
- package/dist/client/_assets/chunks/runtime-paths-y0_gHowM.js +0 -1
- package/dist/client/_assets/chunks/unsafe-svg-CUrgo4Xg.js +0 -1
- package/dist/client/_assets/client-BO8GOFfT.js +0 -354
- package/dist/client/_assets/client-author-QPm1whbO.css +0 -2
- package/dist/client/_assets/client-share-C59mOLJ1.js +0 -149
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import{i as e,n as t,o as n,p as r,t as i,u as a}from"./chunks/lit-BN4mrI3j.js";import{n as o}from"./chunks/unsafe-html-OJ9m154w.js";var s=Object.defineProperty,c=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},l=(e,t)=>{for(var n in t)s(e,n,{get:t[n],enumerable:!0})};function u(e){return e===!1||typeof e==`string`&&e.toLowerCase().trim()===`disabled`?`disabled`:`soft`}function d(e=`soft`){e===`disabled`&&(p.computedStyle=new WeakMap,p.measureHints=new WeakMap,p.baseStyle=new f(50),p.defaultStyle=new f(64),p.image=new f(100),p.background=new f(100),p.resource=new f(150),p.compress=new f(50))}var f,p,m=c(()=>{f=class extends Map{constructor(e=100,...t){super(...t),this._maxSize=e}set(e,t){if(this.size>=this._maxSize&&!this.has(e)){let e=this.keys().next().value;e!==void 0&&this.delete(e)}return super.set(e,t)}},p={image:new f(100),background:new f(100),resource:new f(150),defaultStyle:new f(64),baseStyle:new f(50),compress:new f(50),computedStyle:new WeakMap,measureHints:new WeakMap,warnedReconcile:!1}});function h(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith(`#`)?null:n}function g(e){let t=[],n=0,r=0,i=``;for(let a=0;a<e.length;a++){let o=e[a];if(o===`\\`){a++;continue}i?o===i&&(i=``):o===`"`||o===`'`?i=o:o===`(`?r++:o===`)`?r--:o===`,`&&r===0&&(t.push(e.slice(n,a)),n=a+1)}return t.push(e.slice(n)),t}function _(e,t=1){let n=e.match(/^\s*-?(?:webkit-)?image-set\(([\s\S]*)\)\s*$/i);if(!n)return null;let r=[];for(let e of g(n[1])){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)continue;let n=e.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(n&&!A.test(n[1].trim()))continue;let i=e.replace(/url\((['"]?)[\s\S]*?\1\)/,` `).match(/(\d+(?:\.\d+)?)\s*(x|dpi|dppx)\b/i),a=1;if(i){let e=parseFloat(i[1]);a=/dpi/i.test(i[2])?e/96:e}r.push({url:t[2].trim(),dppx:a})}return r.length?(r.sort((e,t)=>e.dppx-t.dppx),(r.find(e=>e.dppx>=t)||r[r.length-1]).url):null}function v(e){if(!e||e===`none`)return``;let t=e.replace(/translate[XY]?\([^)]*\)/g,``);return t=t.replace(/matrix\(([^)]+)\)/g,(e,t)=>{let n=t.split(`,`).map(e=>e.trim());return n.length===6?(n[4]=`0`,n[5]=`0`,`matrix(${n.join(`, `)})`):`matrix(${t})`}),t=t.replace(/matrix3d\(([^)]+)\)/g,(e,t)=>{let n=t.split(`,`).map(e=>e.trim());return n.length===16?(n[12]=`0`,n[13]=`0`,`matrix3d(${n.join(`, `)})`):`matrix3d(${t})`}),t.trim().replace(/\s{2,}/g,` `)}function y(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function b(e,t){if(!e||/^(data|blob|about|#)/i.test(e.trim()))return e;try{let n=t||typeof document<`u`&&(document.baseURI||document.location?.href)||`http://localhost/`;return new URL(e,n).href}catch{return e}}function x(e){return!!e&&e.tagName===`INPUT`&&(e.getAttribute(`type`)||``).toLowerCase()===`password`}function S(e){return`•`.repeat(String(e??``).length)}function C(e,t){return e?.nodeType===1&&e.localName===t}function w(e){return e?.nodeType===1&&e.namespaceURI===j}function T(e){return e?.nodeType===1&&e.namespaceURI===M}function E(e){return e?.nodeType===11&&!!e.host}function D(e){let t=e?.parentNode;return t?.nodeType===11?t.host:null}function O(e){return e?.nodeType===9}var k,A,j,M,N=c(()=>{k=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,A=k,j=`http://www.w3.org/1999/xhtml`,M=`http://www.w3.org/2000/svg`});function ee(e=`[SnapDOM]`,{ttlMs:t=3e5,maxEntries:n=12}={}){let r=new Map,i=0;function a(a,o,s){if(i>=n)return;let c=Date.now();(r.get(o)||0)>c||(r.set(o,c+t),i++,a===`warn`&&console&&console.warn?console.warn(`${e} ${s}`):console&&console.error&&console.error(`${e} ${s}`))}return{warnOnce(e,t){a(`warn`,e,t)},errorOnce(e,t){a(`error`,e,t)},reset(){r.clear(),i=0}}}function P(e,t,n){if(R.size>=le){let e=Date.now();for(let[t,n]of R)n.until<=e&&R.delete(t);for(;R.size>=le;)R.delete(R.keys().next().value)}R.set(e,{until:Date.now()+n,result:t})}function F(e){return/^data:|^blob:|^about:blank$/i.test(e)}function te(e,t){try{let n=typeof location<`u`&&location.href?location.href:`http://localhost/`,r=t.split(/\{url(?:Raw)?\}/)[0],i=new URL(r||`.`,n);if(new URL(e,n).origin===i.origin)return!0}catch{}return!1}function ne(e,t){if(!t||F(e)||te(e,t))return!1;try{let t=typeof location<`u`&&location.href?location.href:`http://localhost/`,n=new URL(e,t);return typeof location<`u`?n.origin!==location.origin:!0}catch{return!!t}}function re(e,t){return t?/\{url(?:Raw)?\}/.test(t)?t.replace(`{urlRaw}`,()=>y(e)).replace(`{url}`,()=>encodeURIComponent(e)):/[?&]url=?$/.test(t)?`${t}${encodeURIComponent(e)}`:t.endsWith(`?`)?`${t}url=${encodeURIComponent(e)}`:t.endsWith(`/`)?`${t}${y(e)}`:`${t}${t.includes(`?`)?`&`:`?`}url=${encodeURIComponent(e)}`:e}function ie(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||``).replace(/^data:[^,]*/,e=>e.replace(/\s+/g,``))),r.onerror=()=>n(Error(`read_failed`)),r.readAsDataURL(e)})}function I(e,t){return new Headers(t.headers||{}).keys().next().done?JSON.stringify([t.as||`blob`,t.timeout??3e3,t.useProxy||``,t.errorTTL??8e3,t.credentials||``,e]):null}function ae(e){try{return new URL(e,globalThis.location?.href||`http://localhost/`).origin}catch{return`invalid-url`}}function oe(e,t){try{e.onError?.(t)}catch{}}async function L(e,t={}){let n=t.as??`blob`,r=t.timeout??3e3,i=t.useProxy||``,a=t.errorTTL??8e3,o=t.headers||{},s=!!t.debug;if(/^data:/i.test(e))try{if(n===`text`)return{ok:!0,data:String(e),status:200,url:e,fromCache:!1};if(n===`dataURL`)return{ok:!0,data:String(e),status:200,url:e,fromCache:!1,mime:String(e).slice(5).split(`;`)[0]||``};let[,t=``,r=``]=String(e).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(t)?atob(r):decodeURIComponent(r),a=new Uint8Array([...i].map(e=>e.charCodeAt(0))),o=new Blob([a],{type:(t||``).split(`;`)[0]||``});return{ok:!0,data:o,status:200,url:e,fromCache:!1,mime:o.type||``}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:`special_url_error`}}if(/^blob:/i.test(e))try{let t=await fetch(e);if(!t.ok)return{ok:!1,data:null,status:t.status,url:e,fromCache:!1,reason:`http_error`};let r=await t.blob(),i=r.type||t.headers.get(`content-type`)||``;return n===`dataURL`?{ok:!0,data:await ie(r),blob:r,status:t.status,url:e,fromCache:!1,mime:i}:n===`text`?{ok:!0,data:await r.text(),status:t.status,url:e,fromCache:!1,mime:i}:{ok:!0,data:r,status:t.status,url:e,fromCache:!1,mime:i}}catch{return{ok:!1,data:null,status:0,url:e,fromCache:!1,reason:`network`}}if(/^about:blank$/i.test(e))return n===`dataURL`?{ok:!0,data:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==`,status:200,url:e,fromCache:!1,mime:`image/png`}:{ok:!0,data:n===`text`?``:new Blob([]),status:200,url:e,fromCache:!1};let c;try{c=I(e,{as:n,timeout:r,useProxy:i,errorTTL:a,credentials:t.credentials,headers:o})}catch{let n={ok:!1,data:null,status:0,url:e,fromCache:!1,reason:`network`};return oe(t,n),n}let l=R.get(c);if(l&&l.until>Date.now())return{...l.result,fromCache:!0};l&&R.delete(c);let u=ce.get(c);if(u)return u;let d=ne(e,i)?re(e,i):e,f=t.credentials;if(!f)try{let t=typeof location<`u`&&location.href?location.href:`http://localhost/`,n=new URL(e,t);f=typeof location<`u`&&n.origin===location.origin?`include`:`omit`}catch{f=`omit`}let p=new AbortController,m=setTimeout(()=>p.abort(`timeout`),r),h=(async()=>{try{let r=await fetch(d,{signal:p.signal,credentials:f,headers:o});if(!r.ok){let i={ok:!1,data:null,status:r.status,url:d,fromCache:!1,reason:`http_error`};if(c!==null&&a>0&&P(c,i,a),s){let t=`${r.status} ${r.statusText||``}`.trim();se.warnOnce(`http:${r.status}:${n}:${ae(e)}`,`Couldn't load ${e} (HTTP ${t}).`)}return oe(t,i),i}if(n===`text`)return{ok:!0,data:await r.text(),status:r.status,url:d,fromCache:!1};let i=await r.blob(),l=i.type||r.headers.get(`content-type`)||``;return n===`dataURL`?{ok:!0,data:await ie(i),blob:i,status:r.status,url:d,fromCache:!1,mime:l}:{ok:!0,data:i,status:r.status,url:d,fromCache:!1,mime:l}}catch(i){let o=p.signal.aborted?p.signal.reason===`timeout`?`timeout`:`abort`:i&&typeof i==`object`&&i.name===`AbortError`?`abort`:`network`,l={ok:!1,data:null,status:0,url:d,fromCache:!1,reason:o};if(c!==null&&!/^blob:/i.test(e)&&a>0&&P(c,l,a),s){let t=`${o}:${n}:${ae(e)}`,i=o===`timeout`?`Timed out loading ${e} after ${r}ms. Raise the timeout option or set useProxy.`:o===`abort`?`Loading ${e} was cancelled.`:`Couldn't load ${e} (network or CORS). Try the useProxy option.`;se.errorOnce(t,i)}return oe(t,l),l}finally{clearTimeout(m),ce.delete(c)}})();return c!==null&&ce.set(c,h),h}var se,ce,le,R,z=c(()=>{N(),se=ee(`[SnapDOM]`,{ttlMs:18e4,maxEntries:10}),ce=new Map,le=50,R=new Map});async function ue(e,t={}){if(/^\s*url\(\s*['"]?data:/i.test(e)||/^((repeating-)?(linear|radial|conic)-gradient)\(/i.test(e)||e.trim()===`none`)return e;let n=_(e,typeof devicePixelRatio<`u`&&devicePixelRatio||1)??h(e);if(!n)return e;let r=y(b(n)),i=(t.useProxy||``)+`|`+r;if(p.background.has(i)){let e=p.background.get(i);return e?`url("${e}")`:`none`}try{let e=await L(r,{as:`dataURL`,useProxy:t.useProxy,debug:t.debug});return e.ok?(p.background.set(i,e.data),`url("${e.data}")`):(p.background.set(i,null),`none`)}catch{return p.background.set(i,null),`none`}}var de=c(()=>{m(),N(),z()});function fe(e,t){if(Ce.has(t))e.add(t);else if(t.startsWith(`transform-origin-`))e.add(`transform-origin`);else return!1;return!0}function pe(e){let t=e.replace(Me,``).trim();return t?t.replace(/(^|,)(\s*)(?=,|$)/g,`$1$2*`):`*`}function me(e,t,n,r){for(let i=0;i<e.length;i++){if(--r.budget<0)return!1;let a=e[i],o=a.style,s=!1,c=!1;if(o){let e=!!a.selectorText&&Oe.test(a.selectorText);for(let n=0;n<o.length;n++){let i=o[n];if(t.add(i),r.svgGeometry&&(fe(r.svgGeometry,i)?s=!0:we.test(i)&&(c=!0)),e&&r.pseudoProps.add(i),o.getPropertyPriority(i)&&r.importantProps.add(i),i.length>5&&(i[0]===`m`||i[0]===`p`)){let e=i.startsWith(`margin`)?`marginUnstable`:i.startsWith(`padding`)?`paddingUnstable`:null;e&&!r[e]&&Ae.test(o.getPropertyValue(i))&&(r[e]=!0)}}}let l=a.selectorText;if(l&&l.includes(`:has(`)&&(r.usesHas=!0),l&&/[+~]|:has\(|:nth-(?:last-)?child\([^)]*\bof\b/i.test(l)&&(r.leaksAcrossSubtrees=!0),o&&(o.counterReset||o.counterIncrement||o.counterSet||o.content&&o.content.includes(`counter`))&&(r.leaksAcrossSubtrees=!0),l&&l.includes(`&`))for(let e=a.parentRule;e&&l.includes(`&`);e=e.parentRule)e.selectorText&&(l=l.replace(/&/g,`:is(${e.selectorText})`));if(l&&(r.inContainer||Ne.test(l)||l.includes(`+`)||l.includes(`~`)))for(let e of B(l,`,`)){let t=e.trim();t&&(r.inContainer||Ne.test(t)||t.includes(`+`)||t.includes(`~`))&&r.shareUnsafeSels.add(t)}if((s||c)&&he(a,l,s,r),l&&l.includes(`:`))for(let e in je)je[e].test(l)&&n[e].push(pe(l));if(a.styleSheet){if(!ge(a.styleSheet,t,n,r))return!1}else if(a.cssRules&&a.cssRules.length){let e=a.constructor?.name===`CSSContainerRule`,i=a.constructor?.name===`CSSScopeRule`;e&&r.inContainer++,i&&(r.inScope=(r.inScope||0)+1);let o=me(a.cssRules,t,n,r);if(e&&r.inContainer--,i&&r.inScope--,!o)return!1}}return!0}function he(e,t,n,r){if(n&&e.constructor?.name===`CSSKeyframeRule`){r.svgKeyframes=!0;return}if(!t||r.inScope){n&&(r.svgGeometryAll=!0);return}let i=n?r.svgGeometrySels:r.svgAnimSels;for(let e of B(t,`,`)){let t=e.trim();t&&i.add(Oe.test(t)?pe(t):t)}}function ge(e,t,n,r){let i;try{i=e.cssRules}catch{i=r.crossOriginRules?.(e)}return i?me(i,t,n,r):!1}function _e(e,t){for(let n of e){let e=n.effect?.getKeyframes?.()||[];for(let n of e)for(let e of Object.keys(n))e===`offset`||e===`easing`||e===`composite`||e===`computedOffset`||t.add(e.replace(/[A-Z]/g,e=>`-`+e.toLowerCase()))}}function ve(e){let t=new Set;return ge(e,t,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:ke,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set})?t:null}function B(e,t){if(!e.includes(t))return[e];let n=[],r=0,i=null,a=0;for(let o=0;o<e.length;o++){let s=e[o];if(s===`\\`){o++;continue}if(i){s===i&&(i=null);continue}s===`"`||s===`'`?i=s:s===`(`||s===`[`?r++:s===`)`||s===`]`?r--:r===0&&s===t&&(n.push(e.slice(a,o)),a=o+1)}return n.push(e.slice(a)),n}function ye(e){let t=0,n=null,r=0;for(let i=0;i<e.length;i++){let a=e[i];if(n){a===n&&e[i-1]!==`\\`&&(n=null);continue}a===`"`||a===`'`?n=a:a===`(`||a===`[`?t++:a===`)`||a===`]`?t--:t===0&&(a===` `||a===`>`||a===`+`||a===`~`)&&(r=i+1)}let i=``,a=0;for(let t of e.slice(r))t===`(`||t===`[`?a++:t===`)`||t===`]`?a--:a===0&&(i+=t);let o=e=>!e||/\\[0-9a-fA-F]/.test(e)?null:e.replace(/\\(.)/g,`$1`),s=o((i.match(/\.((?:\\.|[\w-])+)/)||[])[1]);if(s)return`c`+s;let c=o((i.match(/#((?:\\.|[\w-])+)/)||[])[1]);if(c)return`i`+c;let l=(i.match(/^([a-zA-Z][\w-]*)/)||[])[1];return l?`t`+l.toLowerCase():null}function be(e,t){if(!t.length)return``;if(t.some(e=>e.includes(`&`)))return null;let n=t.join(`,`);try{return e.matches(n),n}catch{return null}}function xe(e,t){let n=e.createElement(`div`),r={};for(let e in t){let i=t[e];(e===`before`||e===`after`)&&i.push(`q`),r[e]=be(n,i)}return r}function Se(e,t){let n={universe:null,pseudoUniverse:null,svgGeometry:null,svgGeometrySel:null,usesHas:!0,leaksAcrossSubtrees:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let r=new Set(Te),i={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},a={budget:ke,usesHas:!1,leaksAcrossSubtrees:!1,shareUnsafeSels:new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:new Set,pseudoProps:new Set,svgGeometry:new Set,svgGeometrySels:new Set,svgAnimSels:new Set,svgKeyframes:!1,svgGeometryAll:!1,inScope:0,crossOriginRules:t};for(let t of e.styleSheets)if(!ge(t,r,i,a))return n;let o=e.adoptedStyleSheets;if(Array.isArray(o)){for(let e of o)if(!ge(e,r,i,a))return n}if(typeof e.getAnimations==`function`){let t=new Set;_e(e.getAnimations(),t);for(let e of t)r.add(e),fe(a.svgGeometry,e)&&(a.svgGeometryAll=!0)}if(a.svgKeyframes)for(let e of a.svgAnimSels)a.svgGeometrySels.add(e);let s=a.svgGeometryAll?null:Array.from(a.svgGeometrySels).join(`,`),c=Array.from(a.shareUnsafeSels),l=be(e.createElement(`div`),c)===null?null:c.map(e=>({sel:e,key:ye(e)})),u=new Set(De);for(let e of Ee)r.has(e)&&u.add(e);for(let e of a.pseudoProps)u.add(e);return(a.pseudoProps.has(`transform`)||a.pseudoProps.has(`rotate`)||a.pseudoProps.has(`scale`))&&u.add(`transform-origin`),a.pseudoProps.has(`perspective`)&&u.add(`perspective-origin`),{universe:r,pseudoUniverse:u,svgGeometry:a.svgGeometry,svgGeometrySel:s,pseudoGates:xe(e,i),usesHas:a.usesHas,leaksAcrossSubtrees:a.leaksAcrossSubtrees,shareGate:l,marginUnstable:a.marginUnstable,paddingUnstable:a.paddingUnstable,importantProps:a.importantProps}}catch{return n}}var Ce,we,Te,Ee,De,Oe,ke,Ae,je,Me,Ne,Pe=c(()=>{Ce=new Set([`r`,`cx`,`cy`,`rx`,`ry`,`x`,`y`,`width`,`height`,`d`,`transform`,`translate`,`rotate`,`scale`,`transform-origin`,`transform-box`,`vector-effect`]),we=/^(?:animation|transition)/,Te=`display.position.top.right.bottom.left.float.clear.z-index.box-sizing.width.height.min-width.min-height.max-width.max-height.margin-top.margin-right.margin-bottom.margin-left.padding-top.padding-right.padding-bottom.padding-left.overflow-x.overflow-y.visibility.opacity.content-visibility.vertical-align.border-top-width.border-right-width.border-bottom-width.border-left-width.border-top-style.border-right-style.border-bottom-style.border-left-style.border-top-color.border-right-color.border-bottom-color.border-left-color.border-top-left-radius.border-top-right-radius.border-bottom-right-radius.border-bottom-left-radius.flex-direction.flex-wrap.flex-grow.flex-shrink.flex-basis.order.align-items.align-self.align-content.justify-content.justify-items.justify-self.row-gap.column-gap.grid-template-columns.grid-template-rows.grid-auto-flow.grid-auto-columns.grid-auto-rows.grid-column-start.grid-column-end.grid-row-start.grid-row-end.color.font-family.font-size.font-weight.font-style.font-stretch.line-height.letter-spacing.word-spacing.white-space.text-align.text-transform.text-indent.text-overflow.text-shadow.direction.unicode-bidi.writing-mode.text-orientation.word-break.overflow-wrap.tab-size.list-style-type.list-style-position.list-style-image.counter-reset.counter-increment.counter-set.background-color.background-image.background-size.background-position.background-repeat.background-clip.background-origin.background-attachment.box-shadow.outline-width.outline-style.outline-color.outline-offset.transform.transform-origin.rotate.scale.translate.filter.mix-blend-mode.clip-path.object-fit.object-position.border-collapse.border-spacing.table-layout.caption-side.empty-cells`.split(`.`),Ee=`color.font-family.font-size.font-weight.font-style.font-stretch.font-variant.font-kerning.font-feature-settings.font-variation-settings.line-height.letter-spacing.word-spacing.white-space.text-align.text-align-last.text-indent.text-transform.text-shadow.text-rendering.direction.unicode-bidi.word-break.overflow-wrap.writing-mode.text-orientation.hyphens.tab-size.visibility.list-style-type.list-style-position.list-style-image.border-collapse.border-spacing.caption-side.empty-cells.quotes.color-scheme.-webkit-text-fill-color.-webkit-font-smoothing.image-rendering`.split(`.`),De=[`display`,`width`,`height`,`min-width`,`min-height`],Oe=/::?(?:before|after|first-letter|first-line|marker)/,ke=2e4,Ae=/%|\bauto\b|calc\(|var\(/i,je={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Me=/::?(?:before|after|first-letter|first-line|marker)\b/g,Ne=/:(nth-|first-child|last-child|only-|first-of-type|last-of-type|empty|hover|focus|active|target|checked|indeterminate|disabled|enabled|read-only|read-write|placeholder-shown|autofill|valid|invalid|user-valid|user-invalid|in-range|out-of-range|required|optional|default|link|any-link|scope|defined|modal|fullscreen|picture-in-picture|playing|paused|dir\(|lang\(|has\()/});function V(e){return Ie.add(e),e.setAttribute(`data-snapdom-internal`,``),e}function Fe(e){return Ie.has(e)}var Ie,Le=c(()=>{Ie=new WeakSet});function Re(e){if(e=String(e).toLowerCase(),Ze.has(e)){let t={};return p.defaultStyle.set(e,t),t}if(p.defaultStyle.has(e))return p.defaultStyle.get(e);let t=[...document.querySelectorAll(`#snapdom-sandbox`)].find(Fe);t||(t=document.createElement(`div`),V(t),t.id=`snapdom-sandbox`,t.setAttribute(`data-snapdom-sandbox`,`true`),t.setAttribute(`aria-hidden`,`true`),t.style.position=`absolute`,t.style.left=`-9999px`,t.style.top=`-9999px`,t.style.width=`0px`,t.style.height=`0px`,t.style.overflow=`hidden`,document.body.appendChild(t));let n=document.createElement(e.includes(`-`)?`span`:e);n.style.all=`initial`,t.appendChild(n);let r=getComputedStyle(n),i={};for(let e of r)ze(e)||(i[e]=r.getPropertyValue(e));for(let e of Te)!(e in i)&&!ze(e)&&(i[e]=r.getPropertyValue(e));return t.removeChild(n),p.defaultStyle.set(e,i),i}function ze(e){let t=tt.get(e);if(t===void 0){let n=String(e).toLowerCase();t=et.has(n)||$e.test(n)||Qe.test(n),tt.set(e,t)}return t}function Be(e,t){let n=ct.get(e);if(n===void 0||t[n]!==t[e])return!1;let r=t[`writing-mode`];if(r&&r!==`horizontal-tb`)return!1;let i=t.direction;return!(i&&i!==`ltr`)}function Ve(e,t){return!it.has(e)&&(t===`inline`||nt.has(e)||rt.has(e))}function He(e,t,n){let r=(t.display||``).toLowerCase();if(r===`inline`||rt.has(e))return!1;if(n)return!0;if((t.float||`none`).toLowerCase()!==`none`)return!1;let i=(t.position||`static`).toLowerCase();return i===`absolute`||i===`fixed`?!1:!ut.has(r)}function Ue(e,t,n=!0,r=!1){if(t=String(t||``).toLowerCase(),Ze.has(t))return``;let i=[],a=Re(t),o=(e.display||``).toLowerCase(),s=o===`inline`,c=Ve(t,o),l=e[`text-wrap-mode`]||e[`white-space`]||``,u=l===`nowrap`||l===`pre`,d=c&&n&&!(c&&n&&!s&&u),f=!1;for(let n in e){if(ze(n)||Be(n,e))continue;let r=e[n];if(!(at.has(n)&&ot.has(t))){if(d){if(at.has(n))continue;if(st.has(n)){r&&r!==a[n]&&(i.push(`${n}:${r}`),r!==`auto`&&(f=!0));continue}}if(r&&r!==a[n]){if((n===`height`||n===`block-size`||!u&&(n===`width`||n===`inline-size`))&&r.endsWith(`px`)&&r.includes(`.`)){let e=parseFloat(r);if(Number.isFinite(e)){i.push(`${n}:${(e+lt).toFixed(3)}px`);continue}}i.push(`${n}:${r}`)}}}if(d&&!s&&!r&&!f){let t=e.width;t&&t!==`auto`&&t!==a.width&&i.push(`min-width:${t}`)}return i.sort(),i.join(`;`)}function We(e){let t=new Set;return e.nodeType!==Node.ELEMENT_NODE&&e.nodeType!==Node.DOCUMENT_FRAGMENT_NODE?[]:(e.tagName&&t.add(e.tagName.toLowerCase()),typeof e.querySelectorAll==`function`&&e.querySelectorAll(`*`).forEach(e=>t.add(e.tagName.toLowerCase())),Array.from(t))}function Ge(e,t=null){let n=new Map;for(let r of e){let e=Re(r);if(!e)continue;let i=(t?Object.entries(e).filter(([e])=>t.has(e)):Object.entries(e)).filter(([t])=>!Be(t,e)).map(([e,t])=>`${e}:${t};`).sort(),a=i.join(``);a&&(n.has(a)||n.set(a,{tagList:[],declarations:i}),n.get(a).tagList.push(r))}let r=[...n.values()],i=null;for(let{declarations:e}of r){let t=new Set(e);if(!i){i=t;continue}for(let e of i)t.has(e)||i.delete(e)}i??=new Set;let a=``;if(i.size&&r.length>1){let e=r.flatMap(e=>e.tagList);a+=`${e.join(`,`)} { ${[...i].join(``)} }
|
|
2
|
+
`}for(let{tagList:e,declarations:t}of r){let n=r.length>1?t.filter(e=>!i.has(e)):t;if(!n.length)continue;let o=n.join(``);a+=`${e.join(`,`)} { ${o} }
|
|
3
|
+
`}return a}function Ke(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=new Map,r=1;for(let e of t)n.set(e,`c${r++}`);return n}function qe(e){try{let t=e?.ownerDocument;if(!t)return typeof window<`u`?window:null;let n=t.defaultView;if(n&&typeof n.getComputedStyle==`function`)return n;if(typeof window<`u`&&window.frames)for(let e=0;e<window.frames.length;e++)try{if(window.frames[e]?.document===t)return window.frames[e]}catch{}}catch{}return typeof window<`u`?window:null}function H(e,t=null){let n=()=>{let e={length:0,getPropertyValue:()=>``,item:()=>``};return e[Symbol.iterator]=function*(){},e};if(e?.nodeType!==1){let r=typeof window<`u`?window:null;if(r&&typeof r.getComputedStyle==`function`)try{return r.getComputedStyle(e,t)||n()}catch{return n()}return n()}let r=p.computedStyle.get(e);r||(r=new Map,p.computedStyle.set(e,r));let i=r.get(t);if(!i){let a=qe(e),o=null;try{o=a&&typeof a.getComputedStyle==`function`?a.getComputedStyle(e,t):null}catch{}if(!o&&typeof window<`u`&&typeof window.getComputedStyle==`function`)try{e.ownerDocument===document&&(o=window.getComputedStyle(e,t))}catch{}i=o||n(),r.set(t,i)}return i}function Je(e,t=null){let n={};for(let r of t||e){let t=e.getPropertyValue(r);t&&(n[r]=t)}for(let e of dt){let t=n[`border-${e}-style`],r=n[`border-${e}-width`];(t===`none`||t===`hidden`||r===`0px`)&&(delete n[`border-${e}-style`],delete n[`border-${e}-width`],delete n[`border-${e}-color`])}return n}function Ye(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&n++,a===`)`&&n--,a===`,`&&n===0&&(t.push(e.slice(r,i).trim()),r=i+1)}return t.push(e.slice(r).trim()),t}var Xe,Ze,Qe,$e,et,tt,nt,rt,it,at,ot,st,ct,lt,ut,dt,ft=c(()=>{m(),Pe(),Le(),Xe=new Set([`meta`,`script`,`noscript`,`title`,`link`,`template`]),Ze=new Set(`meta.link.style.title.noscript.script.template.g.defs.use.marker.mask.clipPath.pattern.symbol.path.polygon.polyline.line.circle.ellipse.rect.filter.lineargradient.radialgradient.stop`.split(`.`)),Qe=/(?:^|-)(animation|transition)(?:-|$)/i,$e=/^(--.+|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,et=new Set([`cursor`,`pointer-events`,`touch-action`,`user-select`,`print-color-adjust`,`speak`,`reading-flow`,`reading-order`,`anchor-name`,`anchor-scope`,`container-name`,`container-type`,`timeline-scope`,`zoom`,`stroke-color`]),tt=new Map,nt=new Set([`span`,`small`,`em`,`strong`,`b`,`i`,`u`,`s`,`code`,`cite`,`mark`,`sub`,`sup`]),rt=new Set([`table`,`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`]),it=new Set([`img`,`video`,`canvas`,`svg`,`iframe`,`embed`,`object`,`input`,`textarea`,`select`]),at=new Set([`width`,`max-width`,`inline-size`,`max-inline-size`]),ot=new Set([`mi`,`mn`,`mo`,`ms`,`mtext`]),st=new Set([`min-width`,`min-inline-size`]),ct=new Map(Object.entries({"block-size":`height`,"inline-size":`width`,"min-block-size":`min-height`,"min-inline-size":`min-width`,"max-block-size":`max-height`,"max-inline-size":`max-width`,"margin-block-start":`margin-top`,"margin-block-end":`margin-bottom`,"margin-inline-start":`margin-left`,"margin-inline-end":`margin-right`,"padding-block-start":`padding-top`,"padding-block-end":`padding-bottom`,"padding-inline-start":`padding-left`,"padding-inline-end":`padding-right`,"inset-block-start":`top`,"inset-block-end":`bottom`,"inset-inline-start":`left`,"inset-inline-end":`right`,"border-block-start-width":`border-top-width`,"border-block-start-style":`border-top-style`,"border-block-start-color":`border-top-color`,"border-block-end-width":`border-bottom-width`,"border-block-end-style":`border-bottom-style`,"border-block-end-color":`border-bottom-color`,"border-inline-start-width":`border-left-width`,"border-inline-start-style":`border-left-style`,"border-inline-start-color":`border-left-color`,"border-inline-end-width":`border-right-width`,"border-inline-end-style":`border-right-style`,"border-inline-end-color":`border-right-color`,"border-start-start-radius":`border-top-left-radius`,"border-start-end-radius":`border-top-right-radius`,"border-end-start-radius":`border-bottom-left-radius`,"border-end-end-radius":`border-bottom-right-radius`,"overflow-block":`overflow-y`,"overflow-inline":`overflow-x`,"overscroll-behavior-block":`overscroll-behavior-y`,"overscroll-behavior-inline":`overscroll-behavior-x`,"contain-intrinsic-block-size":`contain-intrinsic-height`,"contain-intrinsic-inline-size":`contain-intrinsic-width`})),lt=.001,ut=new Set([`inline-block`,`inline-flex`,`inline-grid`,`inline-table`,`inline-flow-root`,`table`]),dt=[`top`,`right`,`bottom`,`left`]});function pt(e=1e3){return typeof requestAnimationFrame!=`function`||typeof document<`u`&&document.visibilityState===`hidden`?Promise.resolve():new Promise(t=>{let n=!1,r=()=>{n||(n=!0,t())};try{requestAnimationFrame(r)}catch{r();return}setTimeout(r,e)})}function mt(e){if(e!==!1&&e!==`auto`)return null;let t=performance.now()+(e===`auto`?vt:_t),n=null,r={yielded:!1,due:()=>performance.now()>=t,pause:()=>n||=new Promise(e=>{let i=()=>{n=null,r.yielded=!0,t=performance.now()+_t,e()},a=new MessageChannel;a.port1.onmessage=i,a.port2.postMessage(0)})};return r}function ht(){if(typeof navigator>`u`)return!1;if(navigator.userAgentData)return navigator.userAgentData.platform===`iOS`;let e=navigator.userAgent||``,t=/iPhone|iPad|iPod/.test(e),n=navigator.maxTouchPoints>2&&/Macintosh/.test(e);return t||n}function U(){if(typeof navigator>`u`)return!1;let e=navigator.userAgent||``,t=e.toLowerCase(),n=t.includes(`safari`)&&!t.includes(`chrome`)&&!t.includes(`crios`)&&!t.includes(`fxios`)&&!t.includes(`android`),r=/applewebkit/i.test(e),i=/mobile/i.test(e),a=!/safari/i.test(e),o=r&&i&&a,s=/(micromessenger|wxwork|wecom|windowswechat|macwechat)/i.test(e),c=/(baiduboxapp|baidubrowser|baidusearch|baiduboxlite)/i.test(t),l=/ipad|iphone|ipod/.test(t)&&r;return n||o||s||c||l}function gt(){return typeof navigator>`u`?!1:(navigator.userAgent||``).toLowerCase().includes(`firefox`)}var _t,vt,W=c(()=>{_t=16,vt=40});function G(e,t,n){let r=e&&typeof e==`object`&&(e.options||e);r&&r.debug&&(n===void 0?console.warn(`[SnapDOM]`,t):console.warn(`[SnapDOM]`,t,n))}function K(e,t,n,r){let i=e&&e.warnings;i&&i.length<yt&&i.push(r===void 0?{code:t,message:n}:{code:t,message:n,detail:r})}var yt,q=c(()=>{yt=50}),J=c(()=>{de(),ft(),W(),N(),q()}),bt={};l(bt,{MAX_RASTER_AREA:()=>Jt,MAX_RASTER_SIDE:()=>qt,WEBP_MAX_SIDE:()=>Yt,__setDecodeFrameIdleMs:()=>Bt,cropSvgText:()=>St,decodeSvgFromDataURL:()=>Tt,encodeSvgToDataURL:()=>Dt,fixSafariShadows:()=>It,peekSvgHeader:()=>Et,toCanvas:()=>Kt});function xt(e,t){let n=t.__session;try{let r=e.match(/<svg\b[^>]*>/i);if(!r)return e;let i=r[0],a=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),o=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(a)||!Number.isFinite(o)||a<=0||o<=0)return e;let s=Math.min(1,qt/a,qt/o,Math.sqrt(Jt/(a*o)));if(s>=1)return e;let c=Math.max(1,Math.floor(a*s)),l=Math.max(1,Math.floor(o*s));return K(n,`raster-clamp`,`capture ${Math.round(a)}x${Math.round(o)}px exceeds decode limits; downscaled to ${c}x${l}px`),G(t,`${Math.round(a)}\xD7${Math.round(o)}px is too large for the browser to draw; scaled down to ${c}\xD7${l}px. For full size, export ${typeof CompressionStream==`function`?`a PNG or JPEG`:`a JPEG`} blob, an SVG, or crop.`),e.replace(i,i.replace(/(\bwidth=")[\d.]+/i,`$1${c}`).replace(/(\bheight=")[\d.]+/i,`$1${l}`))}catch{return e}}function St(e,t,{shiftContent:n=U()}={}){let r=[`x`,`y`,`width`,`height`].map(e=>Number(t?.[e]));if(!r.every(Number.isFinite)||r[2]<=0||r[3]<=0)throw RangeError(`[SnapDOM] crop needs finite x/y and a positive width/height.`);let i=e.match(/<svg\b[^>]*>/i);if(!i)throw Error(`[SnapDOM] Only SVG captures can be cropped.`);let a=i[0],o=(a.match(/\bviewBox="([^"]+)"/i)||[])[1],s=String(o||``).trim().split(/[\s,]+/).map(Number);if(s.length!==4||!s.every(Number.isFinite)||s[2]<=0||s[3]<=0)throw Error(`[SnapDOM] Can't crop: the SVG has no valid viewBox.`);let[c,l,u,d]=s,f=Math.max(c,r[0]),p=Math.max(l,r[1]),m=Math.min(c+u,r[0]+r[2]),h=Math.min(l+d,r[1]+r[3]);if(!(m>f)||!(h>p))throw RangeError(`[SnapDOM] The crop area does not intersect the capture.`);let g=parseFloat((a.match(/\bwidth="([\d.]+)/i)||[])[1]),_=parseFloat((a.match(/\bheight="([\d.]+)/i)||[])[1]),v=Number.isFinite(g)&&g>0?g/u:1,y=Number.isFinite(_)&&_>0?_/d:1,b=Math.max(1,(m-f)*v),x=Math.max(1,(h-p)*y),S=a.replace(/(\bwidth=")[^"]*/i,`$1${b}`).replace(/(\bheight=")[^"]*/i,`$1${x}`),C=n?Ct(e,a,f,p):null;if(C)return S.replace(/(\bviewBox=")[^"]*/i,(e,t)=>`${t}0 0 ${m-f} ${h-p}`)+C.slice(a.length);let w=S.replace(/(\bviewBox=")[^"]*/i,`$1${f} ${p} ${m-f} ${h-p}`);return e.replace(a,w)}function Ct(e,t,n,r){if(!e.startsWith(t))return null;let i=/^\s*<foreignObject\b[^>]*>/i.exec(e.slice(t.length,t.length+2048));if(!i)return null;let a=i[0],o=(e,t,n)=>{let r=RegExp(`(\\s${t}=")([^"]*)`),i=e.match(r),a=i?parseFloat(i[2]):0;return Number.isFinite(a)?i?e.replace(r,(e,t)=>`${t}${a-n}`):e.replace(/^(\s*<foreignObject\b)/i,(e,r)=>`${r} ${t}="${-n}"`):null},s=o(a,`x`,n),c=s&&o(s,`y`,r);return c?t+c+e.slice(t.length+a.length):null}function wt(e){return typeof e==`string`&&/^data:image\/svg\+xml/i.test(e)}function Tt(e){let t=e.indexOf(`,`);return t>=0?decodeURIComponent(e.slice(t+1)):``}function Et(e){let t=e.indexOf(`,`);if(t<0)return``;let n=e.slice(t+1,t+1201).replace(/%[0-9A-Fa-f]?$/,``);try{return decodeURIComponent(n)}catch{return``}}function Dt(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function Ot(e){let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&r++,a===`)`&&(r=Math.max(0,r-1)),a===`;`&&r===0?(t.push(n),n=``):n+=a}return n.trim()&&t.push(n),t.map(e=>e.trim()).filter(Boolean)}function kt(e){let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`&&r++,a===`)`&&(r=Math.max(0,r-1)),a===`,`&&r===0?(t.push(n.trim()),n=``):n+=a}n.trim()&&t.push(n.trim());let i=[];for(let e of t){if(/\binset\b/i.test(e))continue;let[t=`0px`,n=`0px`,r=`0px`]=e.match(/-?\d+(?:\.\d+)?px/gi)||[];r=`${parseFloat(r)/2}px`;let a=e.replace(/-?\d+(?:\.\d+)?px/gi,``).replace(/\binset\b/gi,``).trim().replace(/\s{2,}/g,` `),o=!!a&&a!==`,`;i.push(`drop-shadow(${t} ${n} ${r}${o?` ${a}`:``})`)}return i.join(` `)}function At(e){let t=Ot(e),n=null,r=null,i=null,a=[];for(let e of t){let t=e.indexOf(`:`);if(t<0)continue;let o=e.slice(0,t).trim().toLowerCase(),s=e.slice(t+1).trim();o===`box-shadow`?i=s:o===`filter`?n=s:o===`-webkit-filter`?r=s:a.push([o,s])}if(i){let e=kt(i);e&&(n=n?`${n} ${e}`:e,r=r?`${r} ${e}`:e)}let o=[...a];return n&&o.push([`filter`,n]),r&&o.push([`-webkit-filter`,r]),o.map(([e,t])=>`${e}:${t}`).join(`;`)}function jt(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,n)=>`${t}{${At(n)}}`)}function Mt(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,jt(t))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,n)=>`style=${t}${At(n)}${t}`),e}function Nt(){return Xt||(Xt=(async()=>{try{let e=new Image;e.decoding=`sync`,e.src=`data:image/svg+xml;charset=utf-8,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%228%22%20height%3D%2220%22%3E%3CforeignObject%20width%3D%228%22%20height%3D%2220%22%3E%3Cdiv%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%20style%3D%22width%3A4px%3Bheight%3A4px%3Bmargin-top%3A8px%3Bbackground%3A%23000%3Bbox-shadow%3A0%208px%200%200%20%23000%22%3E%3C%2Fdiv%3E%3C%2FforeignObject%3E%3C%2Fsvg%3E`,await e.decode();let t=document.createElement(`canvas`);t.width=8,t.height=20;let n=t.getContext(`2d`,{willReadFrequently:!0});n.drawImage(e,0,0);let r=n.getImageData(2,18,1,1).data[3]>128,i=n.getImageData(2,2,1,1).data[3]>128;return{native:r||i,flippedY:i&&!r}}catch{return{native:!1,flippedY:!1}}})(),Xt)}function Pt(e){let t=[],n=0,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?n++:a===`)`?n=Math.max(0,n-1):a===`,`&&n===0&&(t.push(e.slice(r,i)),r=i+1)}return t.push(e.slice(r)),t.map(e=>{let t=0,n=0,r=``,i=0;for(;i<e.length;){let a=e[i];if(a===`(`?t++:a===`)`&&(t=Math.max(0,t-1)),t===0&&(i===0||e[i-1]===` `)){let t=/^-?\d*\.?\d+px/.exec(e.slice(i));if(t){n++,r+=n===2?`${-parseFloat(t[0])}px`:t[0],i+=t[0].length;continue}}r+=a,i++}return r}).join(`,`)}function Ft(e,t){let n=e=>Ot(e).map(e=>{let n=e.indexOf(`:`);if(n<0)return e;let r=e.slice(0,n).trim().toLowerCase();return r===`text-shadow`||t&&r===`box-shadow`?`${r}:${Pt(e.slice(n+1))}`:e}).join(`;`);return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,t.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,r)=>`${t}{${n(r)}}`))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,r)=>`style=${t}${n(r)}${t}`),e}async function It(e){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(e))return{svg:e,naturalOnly:!1};let{native:t,flippedY:n}=await Nt();try{let r=e;return t||(r=Mt(r)),n&&(r=Ft(r,t)),{svg:r,naturalOnly:!0}}catch{return{svg:e,naturalOnly:!0}}}function Lt(e,t,n){let r=e.naturalWidth,i=e.naturalHeight,a=Math.min(8,i),o=document.createElement(`canvas`);o.width=Math.max(1,Math.ceil(r*t)),o.height=Math.max(1,Math.ceil(a*6*n));let s=o.getContext(`2d`,{willReadFrequently:!0});return!s||!(r>0&&i>0)?null:()=>{s.clearRect(0,0,o.width,o.height);for(let o=0;o<6;o++){let c=Math.floor((i-a)*o/5);s.drawImage(e,0,c,r,a,0,o*a*n,r*t,a*n)}let c=s.getImageData(0,0,o.width,o.height).data,l=!1,u=0;for(let e=3;e<c.length;e+=4)c[e]>0&&(l=!0),u=u*31+c[e-3]+c[e-2]*7+c[e-1]*13+c[e]|0;return{ink:l,sig:u}}}async function Rt(e,t,n){V(e),e.style.cssText=`position:fixed;left:-99999px;top:-99999px;pointer-events:none`,document.body.appendChild(e);try{if(!n)return await Zt(),await Zt(),!1;let e=performance.now()+(t?600:150),r=null;for(;;){let i;try{i=n()}catch{return!1}if(i.ink&&(!t||i.sig===r))return!0;if(r=i.sig,performance.now()>e)return i.ink;await Zt()}}finally{try{e.remove()}catch{}}}function zt(){clearTimeout(on),en?.remove(),en=null,tn=0}function Bt(e){an=e??$t}function Vt(e){if(typeof document>`u`||!document.body)return new Image;if(clearTimeout(on),en&&!en.contentDocument&&zt(),en&&tn>Qt&&nn===0&&zt(),!en){let e=document.createElement(`iframe`);V(e),e.setAttribute(`aria-hidden`,`true`),e.style.cssText=`position:absolute;left:-9999px;top:0;width:0;height:0;border:0;visibility:hidden;pointer-events:none`;try{document.body.appendChild(e)}catch{}if(e.contentDocument)en=e,tn=0;else{try{e.remove()}catch{}return new Image}}tn+=e.length,nn+=1;let t=en.contentDocument.createElement(`img`);return t.__snapdomDecodeFrame=!0,t}function Ht(e,t=!1){!e||!e.__snapdomDecodeFrame||(e.__snapdomDecodeFrame=!1,nn=Math.max(0,nn-1),t&&(rn=!0),!(nn>0)&&(rn?(rn=!1,zt()):on=setTimeout(zt,an)))}function Ut(e,t){return e.loading=`eager`,e.decoding=`sync`,e.crossOrigin=`anonymous`,e.src=t,e.decode()}function Wt(e){if(typeof e!=`string`)return!1;let t=e.indexOf(`,`)+1,n=Math.max(48,Math.floor((e.length-t)/200)),r=0,i=0;for(let a=t;a+48<=e.length;a+=n){let t=e.slice(a,a+48);r++,un.some(e=>t.includes(e))||i++}return i*2>r}function Gt(e,t,n,r,i){if(!t.naturalWidth){e.drawImage(t,0,0,n,r);return}let a=n*r,o=a>sn&&!Wt(i)?Math.min(ln,Math.ceil(a/cn)):1;if(o===1){e.drawImage(t,0,0,n,r);return}let s=t.naturalWidth,c=t.naturalHeight/r;for(let i=0;i<o;i++){let a=Math.round(i*r/o),l=i===o-1?r:Math.round((i+1)*r/o);e.drawImage(t,0,a*c,s,(l-a)*c,0,a,n,l-a)}}async function Kt(e,t){let{width:n,height:r,scale:i=1,dpr:a=1,meta:o={},backgroundColor:s,crop:c=null}=t,l=typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement?e:null,u=e,d=!1,f=!1;if(c&&!wt(e))throw RangeError(`[SnapDOM] Only SVG captures can be cropped.`);if(wt(e)){let n=(Et(e).match(/<svg\b[^>]*>/i)||[])[0]||``,r=parseFloat((n.match(/\bwidth="([\d.]+)/i)||[])[1]),i=parseFloat((n.match(/\bheight="([\d.]+)/i)||[])[1]),a=Number.isFinite(r)&&Number.isFinite(i)&&r>0&&i>0&&Math.min(1,qt/r,qt/i,Math.sqrt(Jt/(r*i)))<1;if(c||a||U())try{let n=Tt(e);if(c&&(n=St(n,c)),U()){let e=await It(n);n=e.svg,d=e.naturalOnly,f=/@font-face|data:image\//i.test(n)}(a||c)&&(n=xt(n,t)),u=Dt(n)}catch(t){if(c)throw t;u=e}}let p=l||Vt(u);try{l||await Ut(p,u)}catch(e){if(!p.__snapdomDecodeFrame)throw e;let n=p;p=Vt(u),Ht(n);try{await Ut(p,u)}catch(e){throw Ht(p,t.__releaseDecodeFrame),e}}try{!l&&!U()&&!gt()&&wt(u)&&/(?:%40|@)font-face/i.test(u)&&await new Promise(e=>{let t=new MessageChannel;t.port1.onmessage=()=>{t.port1.close(),t.port2.close(),e()},t.port2.postMessage(0)});let e=l?l.width:p.naturalWidth,m=l?l.height:p.naturalHeight,h=c?e:Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:e,g=c?m:Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:m,_,v,y=Number.isFinite(n),b=Number.isFinite(r);if(y&&b)_=Math.max(1,n),v=Math.max(1,r);else if(y){let e=n/Math.max(1,h);_=n,v=g*e}else if(b){let e=r/Math.max(1,g);v=r,_=h*e}else{let t=l&&Number.isFinite(o.vbW)&&Number.isFinite(o.vbH);_=t?o.vbW:e,v=t?o.vbH:m}!y&&!b&&(_*=i,v*=i);let x=_*a,S=v*a,T=Math.max(x/qt,S/qt,Math.sqrt(x*S/Jt)),E=t.__encodeFormat===`webp`?Math.max(x,S)/Yt:0,D=Math.max(T,E);if(D>1){let e=T<=1;K(t.__session,`canvas-clamp`,`output ${Math.round(x)}x${Math.round(S)}px exceeds ${e?`WebP`:`canvas`} limits; downscaled`),G(t,e?`${Math.round(x)}\xD7${Math.round(S)}px is larger than WebP can encode (${Yt}px per side); scaled down. For full size, export a PNG, an SVG, or crop.`:`${Math.round(x)}\xD7${Math.round(S)}px is larger than a canvas allows; scaled down. For full size, export ${typeof CompressionStream==`function`?`a PNG or JPEG`:`a JPEG`} blob, an SVG, or crop.`),_/=D,v/=D}let O=w(t.canvas)&&C(t.canvas,`canvas`)?t.canvas:document.createElement(`canvas`);O.width=Math.max(1,_*a),O.height=Math.max(1,v*a),O.style.width=`${_}px`,O.style.height=`${v}px`;let k=O.getContext(`2d`);if(!k)throw Error(`[SnapDOM] The canvas you passed has no 2D context (is it already used for WebGL?).`);let A=null,j=t.__layoutZoom||1;if(!l&>()){let e=j*h/(_*a),t=Math.round(_*a*e),n=Math.round(v*a*e);e>1.01&&t<=qt&&n<=qt&&t*n<=Jt&&(A={w:t,h:n})}let M=d&&(Math.round(_*a)!==e||Math.round(v*a)!==m),N=M?e:A?A.w:_*a,ee=M?m:A?A.h:v*a,P=U()&&!l?Lt(p,N/Math.max(1,e),ee/Math.max(1,m)):null,F=!1;P&&(F=await Rt(p,f,P));let te=()=>{if(k.save(),a!==1&&k.scale(a,a),s&&(k.save(),k.fillStyle=s,k.fillRect(0,0,_,v),k.restore()),M){let t=document.createElement(`canvas`);t.width=e,t.height=m,Gt(t.getContext(`2d`),p,e,m,u),k.drawImage(t,0,0,_,v)}else{if(k.save(),k.setTransform(1,0,0,1,0,0),A){let e=document.createElement(`canvas`);for(e.width=A.w,e.height=A.h,Gt(e.getContext(`2d`),p,A.w,A.h,u);e.width>_*a*2;){let t=document.createElement(`canvas`);t.width=Math.ceil(e.width/2),t.height=Math.ceil(e.height/2),t.getContext(`2d`).drawImage(e,0,0,t.width,t.height),e=t}k.imageSmoothingQuality=`high`,k.drawImage(e,0,0,_*a,v*a)}else Gt(k,p,_*a,v*a,u);k.restore()}k.restore()};if(te(),P&&F&&f){let e=!0;try{e=P().ink}catch{}if(!e){let t=performance.now()+600;do{await Zt();try{e=P().ink}catch{break}}while(!e&&performance.now()<t);O.width=O.width,te()}}return O}finally{Ht(p,t.__releaseDecodeFrame)}}var qt,Jt,Yt,Xt,Zt,Qt,$t,en,tn,nn,rn,an,on,sn,cn,ln,un,dn=c(()=>{W(),q(),N(),Le(),qt=U()?16384:32767,Jt=268435456,Yt=16383,Xt=null,Zt=()=>new Promise(e=>{requestAnimationFrame(e),setTimeout(e,50)}),Qt=25165824,$t=5e3,en=null,tn=0,nn=0,rn=!1,an=$t,on=0,sn=4e6,cn=2e6,ln=8,un=[`%3C`,`%3E`,`%20`,`%7B`,`%7D`,`%3B`]}),fn={};l(fn,{rasterize:()=>pn});async function pn(e,t){let n=await Kt(e,{...t,__encodeFormat:t.format}),r=n.width*n.height<=2e6?n.toDataURL(`image/${t.format}`,t.quality):await new Promise(e=>{let r=()=>e(n.toDataURL(`image/${t.format}`,t.quality));try{n.toBlob(t=>{if(!t)return r();let n=new FileReader;n.onload=()=>e(String(n.result||``)),n.onerror=r,n.readAsDataURL(t)},`image/${t.format}`,t.quality)}catch{r()}}),i=new Image;return i.src=r,U()?await i.decode():await new Promise((e,t)=>{if(i.complete&&i.naturalWidth)return e();i.onload=e,i.onerror=t}),i.style.width=`${n.width/t.dpr}px`,i.style.height=`${n.height/t.dpr}px`,i}var mn=c(()=>{dn(),W()}),hn={};l(hn,{toImg:()=>gn,toSvg:()=>gn});async function gn(e,t){let{scale:n=1,width:r,height:i,meta:a={}}=t,o=Number.isFinite(r),s=Number.isFinite(i),c=Number.isFinite(n)&&n!==1||o||s;if(U()&&c)try{let{svg:t}=await It(Tt(e)),c=(t.match(/<svg\b[^>]*>/i)||[])[0]||``,l=parseFloat((c.match(/\bwidth="([\d.]+)/i)||[])[1]),u=parseFloat((c.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(l)||!Number.isFinite(u))throw Error(`The SVG has no size.`);let d=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:l,f=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:u,p,m;o&&s?(p=r,m=i):o?(p=r,m=Math.max(1,Math.round(r/Math.max(1,d)*f))):s?(m=i,p=Math.max(1,Math.round(i/Math.max(1,f)*d))):(p=Math.max(1,Math.round(l*n)),m=Math.max(1,Math.round(u*n)));let h=t.replace(/width="[^"]*"/,`width="${p}"`).replace(/height="[^"]*"/,`height="${m}"`),g=new Image;return g.decoding=`sync`,g.loading=`eager`,g.src=Dt(h),await g.decode(),g.style.width=`${p}px`,g.style.height=`${m}px`,g}catch(n){return K(t.__session,`safari-png-fallback`,`Safari vector toImg failed; using PNG`,n),G(t,`Safari couldn't show the SVG; used a PNG.`,n),pn(e,{...t,format:`png`,quality:1,meta:a})}let l=e,u=!1;if(!o&&!s&&n!==1&&typeof e==`string`&&e.startsWith(`data:image/svg+xml`))try{let t=Tt(e),r=(t.match(/<svg\b[^>]*>/i)||[])[0]||``,i=Number((r.match(/\bwidth="([\d.]+)"/i)||[])[1]),a=Number((r.match(/\bheight="([\d.]+)"/i)||[])[1]);if(i>0&&a>0){let e=r.replace(/\bwidth="[^"]*"/i,`width="${Math.max(1,Math.round(i*n))}"`).replace(/\bheight="[^"]*"/i,`height="${Math.max(1,Math.round(a*n))}"`);l=Dt(t.replace(r,e)),u=!0}}catch{}let d=new Image;d.decoding=`sync`,d.loading=`eager`,d.src=l;try{await d.decode()}catch(t){if(!u)throw t;d.src=e,u=!1,await d.decode()}if(o&&s)d.style.width=`${r}px`,d.style.height=`${i}px`;else if(o){let e=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:d.naturalWidth,t=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:d.naturalHeight,n=r/Math.max(1,e);d.style.width=`${r}px`,d.style.height=`${Math.max(1,Math.round(t*n))}px`}else if(s){let e=Number.isFinite(a.vbW)?a.vbW:Number.isFinite(a.w0)?a.w0:d.naturalWidth,t=Number.isFinite(a.vbH)?a.vbH:Number.isFinite(a.h0)?a.h0:d.naturalHeight,n=i/Math.max(1,t);d.style.height=`${i}px`,d.style.width=`${Math.max(1,Math.round(e*n))}px`}else{let r=Math.max(1,Math.round(d.naturalWidth*(u?1:n))),i=Math.max(1,Math.round(d.naturalHeight*(u?1:n)));if(d.style.width=`${r}px`,d.style.height=`${i}px`,!u&&n!==1&&typeof e==`string`&&e.startsWith(`data:image/svg+xml`))try{let t=decodeURIComponent(e.split(`,`)[1]).replace(/width="[^"]*"/,`width="${r}"`).replace(/height="[^"]*"/,`height="${i}"`);d.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(t)}`,await d.decode()}catch(n){G(t,`Couldn't size the SVG image.`,n),d.src!==e&&(d.src=e,await d.decode().catch(()=>{}))}}return d}var _n=c(()=>{J(),q(),mn(),dn()}),vn={};l(vn,{encodePng:()=>bn});function yn(e,t=new Uint8Array){let n=new Uint8Array(t.length+12),r=new DataView(n.buffer);r.setUint32(0,t.length);for(let t=0;t<4;t++)n[t+4]=e.charCodeAt(t);n.set(t,8);let i=4294967295;for(let e=4;e<n.length-4;e++)i=xn[(i^n[e])&255]^i>>>8;return r.setUint32(n.length-4,(i^4294967295)>>>0),n}async function bn(e,t,n){if(![e,t].every(e=>Number.isInteger(e)&&e>0&&e<=2147483647))throw RangeError(`[SnapDOM] PNG dimensions must be integers from 1 to 2147483647`);let r=new Uint8Array(13),i=new DataView(r.buffer);i.setUint32(0,e),i.setUint32(4,t),r[8]=8,r[9]=6;let a=[new Uint8Array([137,80,78,71,13,10,26,10]),yn(`IHDR`,r),yn(`sRGB`,new Uint8Array([0]))],o=e*4,s=Math.max(1,Math.floor(65536/(o+1))),c=new Uint8Array(o),l=0,u=new CompressionStream(`deflate`),d=u.writable.getWriter(),f=u.readable.getReader(),p,m=(async()=>{try{for(;;){let{done:e,value:t}=await f.read();if(e)return;a.push(yn(`IDAT`,t))}}catch(e){p=e,await d.abort(e).catch(()=>{})}})();try{for await(let e of n){if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)||!e.length||e.length%o)throw RangeError(`[SnapDOM] PNG input must contain complete RGBA rows`);let n=e.length/o;if(l+n>t)throw RangeError(`[SnapDOM] PNG input exceeds the declared height`);for(let t=0;t<n;t+=s){let r=Math.min(n,t+s),i=new Uint8Array((r-t)*(o+1));for(let n=t;n<r;n++){let r=e.subarray(n*o,(n+1)*o),a=(n-t)*(o+1),s=0,l=0;for(let e=0;e<o;e++){let t=r[e]-(e<4?0:r[e-4])&255,n=r[e]-c[e]&255;s+=Math.min(t,256-t),l+=Math.min(n,256-n),i[a+e+1]=n}if(i[a]=l<=s?2:1,s<l)for(let e=0;e<o;e++)i[a+e+1]=r[e]-(e<4?0:r[e-4]);c=r}await d.write(i)}c=c.slice(),l+=n}if(l!==t)throw RangeError(`[SnapDOM] PNG input does not match the declared height`);if(await d.close(),await m,p)throw p;return a.push(yn(`IEND`)),new Blob(a,{type:`image/png`})}catch(e){throw await Promise.allSettled([d.abort(e),f.cancel(e)]),await m,e}finally{d.releaseLock(),f.releaseLock()}}var xn,Sn=c(()=>{xn=new Uint32Array(256);for(let e=0;e<256;e++){let t=e;for(let e=0;e<8;e++)t=t&1?3988292384^t>>>1:t>>>1;xn[e]=t}}),Cn={};l(Cn,{encodeJpeg:()=>Dn});function wn(e){let t=[0,240];for(let e=0;e<16;e++)for(let n=1;n<=10;n++)t.push(e<<4|n);return e.concat(t.filter(t=>!e.includes(t)).sort((e,t)=>e-t))}function Tn(e){for(let t=0;t<64;t+=8)En(e,t,1);for(let t=0;t<8;t++)En(e,t,8)}function En(e,t,n){let r=e[t]+e[t+7*n],i=e[t]-e[t+7*n],a=e[t+n]+e[t+6*n],o=e[t+n]-e[t+6*n],s=e[t+2*n]+e[t+5*n],c=e[t+2*n]-e[t+5*n],l=e[t+3*n]+e[t+4*n],u=e[t+3*n]-e[t+4*n],d=r+l,f=r-l,p=a+s,m=a-s;e[t]=d+p,e[t+4*n]=d-p;let h=(m+f)*.707106781;e[t+2*n]=f+h,e[t+6*n]=f-h,d=u+c,p=c+o,m=o+i;let g=(d-m)*.382683433,_=.5411961*d+g,v=1.306562965*m+g,y=p*.707106781,b=i+y,x=i-y;e[t+5*n]=x+_,e[t+3*n]=x-_,e[t+n]=b+v,e[t+7*n]=b-v}async function Dn(e,t,n,r){if(![e,t].every(e=>Number.isInteger(e)&&e>0&&e<=65535))throw RangeError(`[SnapDOM] JPEG dimensions must be integers from 1 to 65535`);let i=Math.min(100,Math.max(1,Math.round((typeof r==`number`&&r>=0&&r<=1?r:.92)*100))),a=i<50?5e3/i:200-i*2,o=+(i<90),s=8<<o,c=[0],l=[kn,An].map((e,t)=>{let n=new Uint8Array(64),r=new Float32Array(64);for(let t=0;t<64;t++){let i=Math.min(255,Math.max(1,Math.floor((e[t]*a+50)/100)));n[On[t]]=i,r[t]=1/(i*jn[t>>3]*jn[t&7]*8)}return c.push(...t?[1]:[],...n),r}),u=(e,t)=>[255,e,t.length+2>>8,t.length+2&255,...t],d=[255,216,...u(224,[74,70,73,70,0,1,1,0,0,1,0,1,0,0]),...u(219,c),...u(192,[8,t>>8,t&255,e>>8,e&255,3,1,o?34:17,0,2,17,1,3,17,1]),...u(196,Nn.flatMap(([e,,t,n])=>[e,...t,...n])),...u(218,[3,1,0,2,17,3,17,0,63,0])],f=[new Uint8Array(d)],p=new Uint8Array(65536),m=0,h=0,g=0;function _(e,t){for(h=h<<t|e,g+=t;g>=8;){g-=8;let e=h>>>g&255;m>=p.length-1&&(f.push(p.subarray(0,m)),p=new Uint8Array(65536),m=0),p[m++]=e,e===255&&(p[m++]=0)}h&=(1<<g)-1}let v=new Float32Array(64),y=new Int32Array(64),b=[0,0,0];function x(e,t){let n=l[t];Tn(v);for(let e=0;e<64;e++)y[On[e]]=Math.round(v[e]*n[e]);let r=Pn[t*2],i=Pn[t*2+1],a=y[0]-b[e];b[e]=y[0];let o=a?32-Math.clz32(Math.abs(a)):0;_(r[o][0],r[o][1]),o&&_((a<0?a-1:a)&(1<<o)-1,o);let s=0;for(let e=1;e<64;e++){if(a=y[e],!a){s++;continue}for(;s>15;s-=16)_(i[240][0],i[240][1]);o=32-Math.clz32(Math.abs(a));let t=i[s<<4|o];_(t[0],t[1]),_((a<0?a-1:a)&(1<<o)-1,o),s=0}s&&_(i[0][0],i[0][1])}let S=e*4,C=new Uint8Array(S*s),w=new Float32Array(s*s),T=new Float32Array(64),E=new Float32Array(64),D=o?.25:1;function O(t){for(let n=0;n<e;n+=s){T.fill(0),E.fill(0);for(let r=0;r<s;r++){let i=Math.min(r,t-1)*S;for(let t=0;t<s;t++){let a=i+Math.min(n+t,e-1)*4,c=C[a],l=C[a+1],u=C[a+2];w[r*s+t]=.299*c+.587*l+.114*u-128;let d=(r>>o)*8+(t>>o);T[d]+=(-.168736*c-.331264*l+.5*u)*D,E[d]+=(.5*c-.418688*l-.081312*u)*D}}for(let e=0;e<(o?4:1);e++){let t=(e>>1)*128+(e&1)*8;for(let e=0;e<64;e++)v[e]=w[t+(e>>3)*s+(e&7)];x(0,0)}v.set(T),x(1,1),v.set(E),x(2,1)}}let k=0,A=0;for await(let e of n){if(!(e instanceof Uint8Array||e instanceof Uint8ClampedArray)||!e.length||e.length%S)throw RangeError(`[SnapDOM] JPEG input must contain complete RGBA rows`);let n=e.length/S;if(k+n>t)throw RangeError(`[SnapDOM] JPEG input exceeds the declared height`);for(let t=0;t<n;){let r=Math.min(s-A,n-t);C.set(e.subarray(t*S,(t+r)*S),A*S),A+=r,t+=r,A===s&&(O(s),A=0)}k+=n}if(k!==t)throw RangeError(`[SnapDOM] JPEG input does not match the declared height`);return A&&O(A),g&&_((1<<8-g)-1,8-g),f.push(p.subarray(0,m),new Uint8Array([255,217])),new Blob(f,{type:`image/jpeg`})}var On,kn,An,jn,Mn,Nn,Pn,Fn=c(()=>{On=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],kn=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],An=Array.from({length:64},(e,t)=>(t&7)<4&&t<32?[17,18,24,47,18,21,26,66,24,26,56,99,47,66,99,99][(t>>3)*4+(t&7)]:99),jn=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],Mn=[0,1,2,3,4,5,6,7,8,9,10,11],Nn=[[0,0,[0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],Mn],[16,0,[0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],wn([1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130])],[1,1,[0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],Mn],[17,1,[0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],wn([0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241])]],Pn=Nn.map(([,,e,t])=>{let n=[],r=0,i=0;for(let a=1;a<=16;a++,r<<=1)for(let o=0;o<e[a-1];o++)n[t[i++]]=[r++,a];return n})});function In(e,t,n){if(typeof e!=`string`||!e.startsWith(`data:image/svg+xml`))return null;let r=Et(e).match(/<svg\b[^>]*>/i)?.[0];if(!r)return null;let i=t.crop?St(r,t.crop):r,a=parseFloat(i.match(/\bwidth="([^"]+)/i)?.[1]),o=parseFloat(i.match(/\bheight="([^"]+)/i)?.[1]),s=(i.match(/\bviewBox="([^"]+)/i)?.[1]||``).trim().split(/[\s,]+/).map(Number);if(!(a>0&&o>0)||s.length!==4||!s.every(Number.isFinite)||!(s[2]>0&&s[3]>0))return null;let c=Number.isFinite(t.width),l=Number.isFinite(t.height),u=t.meta||{},d=Math.max(1,Math.floor(a)),f=Math.max(1,Math.floor(o)),p=t.crop?d:Number.isFinite(u.vbW)?u.vbW:Number.isFinite(u.w0)?u.w0:d,m=t.crop?f:Number.isFinite(u.vbH)?u.vbH:Number.isFinite(u.h0)?u.h0:f,h=t.dpr??1,g=t.scale??1,_=(c&&l?Math.max(1,t.width):c?t.width:l?t.height*p/Math.max(1,m):d*g)*h,v=(c&&l?Math.max(1,t.height):l?t.height:c?t.width*m/Math.max(1,p):f*g)*h;if(Math.max(a,o,_,v)<=qt&&a*o<=Jt&&_*v<=Jt||(n===`png`?typeof CompressionStream!=`function`:Math.max(_,v)>=65536))return null;return y();async function y(){let c=Math.max(1,Math.floor(_)),l=Math.max(1,Math.floor(v)),u=Tt(e),p=u.slice(u.indexOf(r)+r.length,u.lastIndexOf(`</svg>`)),m=i.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||`xMidYMid meet`,h=a/s[2],g=o/s[3],y=0,b=0;/\bnone\b/.test(m)||(h=g=/\bslice\b/.test(m)?Math.max(h,g):Math.min(h,g),y=(a-s[2]*h)*(/xMin/.test(m)?0:/xMax/.test(m)?1:.5),b=(o-s[3]*g)*(/YMin/.test(m)?0:/YMax/.test(m)?1:.5)),y-=s[0]*h,b-=s[1]*g;let x=i.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,``).slice(0,-1),S=U()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(u),C=a/_,w=o/v,T=Math.max(1,Math.min(8192,Math.floor(4194304/c),S?Math.floor(2046/w):8192)),E=Math.max(1,Math.min(8192,c,S?Math.floor(2046/C):8192));async function*D(){for(let e=0;e<l;e+=T){let n=Math.min(T,l-e),r=new Uint8Array(c*n*4);for(let i=0;i<c;i+=E){let a=Math.min(E,c-i),o=S?Math.max(0,Math.floor(i*C)-1):i*C,l=S?Math.max(0,Math.floor(e*w)-1):e*w,u=S?Math.min(d,Math.ceil((i+a)*C)+1)-o:a,m=S?Math.min(f,Math.ceil((e+n)*w)+1)-l:n,_=u/s[2],v=m/s[3],T=S?1:1/C,D=S?1:1/w,O=`matrix(${h*T/_},0,0,${g*D/v},${(y-o)*T/_+s[0]},${(b-l)*D/v+s[1]})`,k=await Kt(Dt(`${x} width="${u}" height="${m}" preserveAspectRatio="none"><g style="all:unset!important;transform:${O}!important;transform-origin:0 0!important">${p}</g></svg>`),{width:u,height:m,dpr:1,backgroundColor:S?null:t.backgroundColor,__session:t.__session,__releaseDecodeFrame:!0}),A=k;try{if(S){A=document.createElement(`canvas`),A.width=a,A.height=n;let r=A.getContext(`2d`);t.backgroundColor&&(r.fillStyle=t.backgroundColor,r.fillRect(0,0,a,n)),r.drawImage(k,i*C-o,e*w-l,a*C,n*w,0,0,a,n)}let s=A.getContext(`2d`).getImageData(0,0,a,n).data;for(let e=0;e<n;e++)r.set(s.subarray(e*a*4,(e+1)*a*4),(e*c+i)*4)}finally{k.width=k.height=0,A!==k&&(A.width=A.height=0)}}yield r}}return n===`png`?(await Promise.resolve().then(()=>(Sn(),vn))).encodePng(c,l,D()):(await Promise.resolve().then(()=>(Fn(),Cn))).encodeJpeg(c,l,D(),t.quality)}}var Ln=c(()=>{dn(),W()}),Rn={};l(Rn,{toBlob:()=>zn});async function zn(e,t){let n=t.format||t.type||`svg`;if(n===`svg`){if(typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement)throw Error(`[SnapDOM] html-in-canvas makes a raster capture, not an SVG; ask for png, jpeg or webp.`);let t=decodeURIComponent(e.split(`,`)[1]);return new Blob([t],{type:`image/svg+xml`})}let r=n===`jpg`?`jpeg`:n,i=(r===`png`||r===`jpeg`)&&In(e,t,r);if(i)return i;let a=await Kt(e,{...t,__encodeFormat:r});return new Promise(e=>a.toBlob(t=>e(t),`image/${r}`,t.quality))}var Bn=c(()=>{dn(),Ln()}),Vn={};l(Vn,{download:()=>Un});async function Hn(e,t){let n=new File([e],t,{type:e.type});if(!navigator.canShare?.({files:[n]}))return!1;try{await navigator.share({files:[n],title:t})}catch(e){if(e.name!==`AbortError`)return!1}return!0}async function Un(e,t){let n=new Set([`png`,`jpeg`,`jpg`,`webp`,`svg`]),r=(t?.type||``).toLowerCase(),i=n.has(r)?r:``,a=(t?.format||i||``).toLowerCase(),o=a===`jpg`?`jpeg`:a||`png`,s=t?.filename||`snapdom`,c=/\.(png|jpe?g|webp|svg)$/i.test(s)?s:`${s}.${o}`,l={...t||{},format:o,type:o};l.dpr=1;let u=ht(),d=(o===`png`||o===`jpeg`)&&In(e,l,o);if(o===`svg`||d){let t=d?await d:await zn(e,{...l,type:`svg`});if(u&&await Hn(t,c))return;let n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=c,document.body.appendChild(r),r.click(),setTimeout(()=>URL.revokeObjectURL(n),1e3),r.remove();return}let f=await Kt(e,{...l,__encodeFormat:o});if(u){let e=`image/${o}`,n=await new Promise(n=>f.toBlob(n,e,t?.quality));if(n&&await Hn(n,c))return}let p=document.createElement(`a`);p.href=f.toDataURL(`image/${o}`,t?.quality),p.download=c,document.body.appendChild(p),p.click(),p.remove()}var Wn=c(()=>{Bn(),dn(),Ln(),W()});J(),J(),W(),m(),Pe(),Le(),z();var Gn=new WeakMap,Kn=[`margin-top`,`margin-right`,`margin-bottom`,`margin-left`,`margin-block-start`,`margin-block-end`,`margin-inline-start`,`margin-inline-end`],qn=new Map,Jn=2e3,Yn=0;function Xn(){Yn++}function Zn(e){let t=e&&(e.nodeType===1?e:e.parentElement);for(;t;){if(Fe(t))return!0;t=t.parentElement?t.parentElement:D(t)}return!1}function Qn(e){for(let t of e)if($n(t))return!0;return!1}function $n(e){if(Zn(e.target))return!1;if(e.type===`childList`){let t=!0;for(let n of e.addedNodes)if(!Zn(n)){t=!1;break}if(t){for(let n of e.removedNodes)if(!Zn(n)){t=!1;break}}if(t)return!1}return!0}var er=new WeakMap;function tr(e){for(let t of e){if(!$n(t))continue;let e=t.target.ownerDocument||document;er.set(e,(er.get(e)||0)+1);let n=t.target.nodeType===1?t.target:t.target.parentElement||t.target.host;for(;n;n=n.parentElement||D(n))er.set(n,(er.get(n)||0)+1)}}function nr(e){let t=e.ownerDocument||document;return Er(t),(er.get(t)||0)-(er.get(e)||0)}var Y=0;function rr(e=document){return Er(e),Y}function ir(){return Er(),Yn}function ar(e){return e?(Er(e.ownerDocument||document),pr(e,mr(e))):0}function or(){Xn(),Y++}var sr=new WeakMap,cr=0,lr=0;function ur(e){sr.set(e,++cr)}function dr(e){if(!e||e.nodeType!==1)return;cr++,sr.set(e,cr);let t=e.querySelectorAll(`*`);for(let e=0;e<t.length;e++)sr.set(t[e],cr)}function fr(e){dr(e.parentElement||e);for(let t=e.parentElement;t;t=t.parentElement)ur(t)}function pr(e,t=null){let n=sr.get(e)||0;if(t)for(let e of t)n=Math.max(n,sr.get(e)||0);return lr*1e9+n}function mr(e){let t=e.getRootNode?.();if(!t?.host)return null;let n=[];for(;t?.host;)t.mode===`open`&&xr(t),n.push(t.host),t=t.host.getRootNode?.();return n}var hr=new WeakMap;function gr(e){e||=document;let t=hr.get(e);if(!t||t.env!==Y){let n=!0;try{n=Rr(e).usesHas}catch{}t={env:Y,usesHas:n},hr.set(e,t)}return!t.usesHas}function _r(e){let t=e=>e?.nodeType===1&&(e.matches?.(`style,link`)||e.querySelector?.(`style,link`));for(let n of e){let e=n.target,r=e&&(e.nodeType===1?e:e.parentElement);if(r&&(r.tagName===`STYLE`||r.tagName===`LINK`))return r.ownerDocument||document;for(let e of n.addedNodes)if(t(e))return e.ownerDocument||document;for(let r of n.removedNodes)if(t(r))return r.ownerDocument||e&&e.ownerDocument||document}return null}var vr=new WeakSet,yr=[];function br(e){if(!Qn(e))return;tr(e),Xn();let t=new Set;for(let n of e){if(!$n(n))continue;let e=n.target.getRootNode&&n.target.getRootNode();if(!e||e.nodeType!==11||t.has(e))continue;t.add(e),e.host?dr(e.host):cr++;let r=e.querySelectorAll(`*`);for(let e=0;e<r.length;e++)sr.set(r[e],cr)}}function xr(e){if(e&&!vr.has(e)){vr.add(e);try{let t=new MutationObserver(br);t.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),yr.push({o:t,root:e})}catch{}}}function Sr(e){if(!Qn(e))return;tr(e),Xn();let t=_r(e);if(t){hr.delete(t),Y++,lr++;return}let n=new Set;for(let t of e){if(!$n(t))continue;let e=t.target.nodeType===1?t.target:t.target.parentElement;if(!e)continue;let r=e.ownerDocument||document;if(!gr(r)){lr++;return}if(e===r.documentElement||e===r.body){lr++;return}let i=e.parentElement||e;n.has(i)||(n.add(i),fr(e))}}var Cr=new WeakSet,wr=null,Tr=[];function Er(e=document){if(e===wr||!e||e.nodeType!==9)return;if(Cr.has(e)){wr=e;return}Cr.add(e),wr=e;let t=e.defaultView,n=e=>{Qn(e)&&(Xn(),Y++)},r=()=>{Xn(),Y++};try{let t=new MutationObserver(Sr);t.observe(e.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Tr.push({o:t,env:!1,doc:e})}catch{}try{let t=new MutationObserver(n);t.observe(e.head,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Tr.push({o:t,env:!0,doc:e})}catch{}try{t?.addEventListener(`resize`,r,{passive:!0})}catch{}try{let n=t=>{Xn();let n=t.composedPath?.()[0]||t.target;n&&n.nodeType===1&&!Zn(n)&&gr(n.ownerDocument||e)?fr(n):lr++};e.addEventListener(`focusin`,n,{capture:!0,passive:!0}),e.addEventListener(`focusout`,n,{capture:!0,passive:!0}),e.addEventListener(`change`,n,{capture:!0,passive:!0}),e.addEventListener(`pointerdown`,n,{capture:!0,passive:!0}),e.addEventListener(`pointerup`,n,{capture:!0,passive:!0}),e.addEventListener(`pointercancel`,n,{capture:!0,passive:!0}),e.addEventListener(`keydown`,n,{capture:!0,passive:!0}),e.addEventListener(`keyup`,n,{capture:!0,passive:!0}),e.addEventListener(`beforetoggle`,n,{capture:!0,passive:!0}),e.addEventListener(`toggle`,n,{capture:!0,passive:!0}),t?.addEventListener(`hashchange`,()=>{Xn(),lr++},{passive:!0})}catch{}try{let t=e.fonts;t&&(t.addEventListener?.(`loadingdone`,r),t.status===`loading`&&t.ready?.then(r).catch(()=>{}))}catch{}}var Dr=new WeakMap;function Or(e,t){if(!e?.querySelectorAll)return;let n;try{n=Array.from(e.querySelectorAll(`:hover`))}catch{return}let r=Dr.get(e)||[];if(r.length===n.length&&r.every((e,t)=>e===n[t]))return;if(Dr.set(e,n),Xn(),e.nodeType===11){e.host?dr(e.host):cr++;for(let t of e.querySelectorAll(`*`))sr.set(t,cr);return}let i=r.filter(e=>!n.includes(e)).concat(n.filter(e=>!r.includes(e)));for(let e of i)if(e.isConnected){if(gr(t))fr(e);else{lr++;return}}}function kr(e,t=null){if(!e)return;Or(e,e);let n=t||yr.filter(({root:e})=>e.host?.isConnected).map(({root:e})=>e);for(let t of n)Or(t,e)}function Ar(){Er();try{for(let e=Tr.length-1;e>=0;e--){let{o:t,env:n,doc:r}=Tr[e];if(r!==document&&!r.defaultView){try{t.disconnect()}catch{}Cr.delete(r),wr===r&&(wr=null),Tr.splice(e,1);continue}let i=t.takeRecords();i.length&&(n?Qn(i)&&(Xn(),Y++):Sr(i))}for(let e=yr.length-1;e>=0;e--){let{o:t,root:n}=yr[e];if(!n.host||!n.host.isConnected){try{t.disconnect()}catch{}vr.delete(n),yr.splice(e,1);continue}let r=t.takeRecords();r.length&&br(r)}}catch{}}function jr(e){if(e&&e.nodeType===1){Gn.delete(e);try{let t=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();)Gn.delete(t.currentNode)}catch{}}}var Mr=[`mask`,`mask-image`,`-webkit-mask`,`-webkit-mask-image`,`mask-source`,`mask-box-image-source`,`mask-border-source`,`-webkit-mask-box-image-source`,`border-image`,`border-image-source`];function Nr(e){let t=Gn.get(e);if(t&&fi(t,e)){let e=t.snapshot&&t.snapshot.__needsBgInline;if(e!==void 0)return e}return!0}function Pr(e){let t=Gn.get(e);if(!t||!fi(t,e))return null;let n=t.snapshot;return!n||n.__bgClipTextFix?null:n}var Fr=new WeakMap,Ir=new Map;function Lr(e){let t=e.href;return!t||typeof CSSStyleSheet!=`function`?null:Ir.has(t)?Ir.get(t):(Ir.set(t,null),L(t,{as:`text`}).then(e=>{if(!e.ok||typeof e.data!=`string`||/@import/i.test(e.data))return;let n=new CSSStyleSheet;n.replaceSync(e.data),Ir.set(t,n.cssRules),Xn(),Y++}).catch(()=>{}),null)}function Rr(e){let t=Fr.get(e);if(!t||t.epoch!==Yn){let n=t&&t.universe;t={epoch:Yn,...Se(e,Lr)};let r=t.universe;if(n&&r&&n.size===r.size){let e=!0;for(let t of r)if(!n.has(t)){e=!1;break}e&&(t.universe=n)}Fr.set(e,t)}return t}function zr(e){return Rr(e).leaksAcrossSubtrees}function Br(e){try{let t=Rr(e.ownerDocument||document).shareGate;if(t===null)return!1;if(!t.length)return!0;let n=new Set,r=e=>{n.add(`t`+e.localName),e.id&&n.add(`i`+e.id);let t=e.classList;for(let e=0;e<t.length;e++)n.add(`c`+t[e])};r(e);for(let t of e.querySelectorAll(`*`))r(t);let i=[];for(let{sel:e,key:r}of t)(r===null||n.has(r))&&i.push(e);if(!i.length)return!0;let a=i.join(`,`);return!e.matches(a)&&e.querySelector(a)===null}catch{return!1}}function Vr(e){let t=e.ownerDocument||document;return e.getRootNode&&e.getRootNode()!==t?null:Rr(t).importantProps}function Hr(e,t){let n=e.ownerDocument||document,r=e.getRootNode?e.getRootNode():n;return r===n?Rr(n).universe:t&&E(r)?Wr(e,r,n,t):null}var Ur=new WeakMap;function Wr(e,t,n,r){let i=r.__shadowUniverse;if(i===null)return null;if(!i){let e=Rr(n).universe;if(!e)return r.__shadowUniverse=null;i=r.__shadowUniverse={universe:new Set(e),roots:new Set}}let a=e=>{for(;E(e)&&!i.roots.has(e);e=e.host.getRootNode()){i.roots.add(e);for(let t of[...e.styleSheets,...e.adoptedStyleSheets||[]]){let e=Ur.get(t);if((!e||e.epoch!==Yn)&&Ur.set(t,e={epoch:Yn,props:ve(t)}),!e.props)return!1;for(let t of e.props)i.universe.add(t)}_e(e.getAnimations(),i.universe)}return!0},o=a(t)&&(!e.shadowRoot||a(e.shadowRoot));for(let t=e.assignedSlot;o&&t;t=t.assignedSlot)o=a(t.getRootNode());return o?i.universe:r.__shadowUniverse=null}function Gr(e){let t=e.ownerDocument||document;return e.getRootNode&&e.getRootNode()!==t?null:Rr(t).pseudoUniverse}function Kr(e){let t=e.ownerDocument||document;return e.getRootNode&&e.getRootNode()!==t?null:Rr(t).svgGeometry}function qr(e){let t=Rr(e.ownerDocument||document).svgGeometrySel;if(t==null)return!0;if(!t)return!1;try{return e.matches(t)}catch{return!0}}var Jr={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function Yr(e){let t=e.ownerDocument||document;return e.getRootNode&&e.getRootNode()!==t?Jr:Rr(t).pseudoGates}function Xr(e,t={},n=null,r=null){let i={},a=t.excludeStyleProps,o=t=>{if(i[t]!==void 0||ze(t)||a&&(a instanceof RegExp&&a.test(t)||typeof a==`function`&&a(t)))return;let n=e.getPropertyValue(t);n&&((t===`background-image`||t===`content`)&&n.includes(`url(`)&&!n.includes(`data:`)&&(n=`none`),i[t]=n)};if(r){for(let e of r)o(e);let e=n&&n.style;if(e&&e.length)for(let t=0;t<e.length;t++)o(e[t])}else for(let t=0;t<e.length;t++)o(e[t]);for(let t of[`text-decoration-line`,`text-decoration-color`,`text-decoration-style`,`text-decoration-thickness`,`text-underline-offset`,`text-decoration-skip-ink`])if(!i[t])try{let n=e.getPropertyValue(t);n&&(i[t]=n)}catch{}for(let t of[`-webkit-text-stroke`,`-webkit-text-stroke-width`,`-webkit-text-stroke-color`,`paint-order`])if(!i[t])try{let n=e.getPropertyValue(t);n&&(i[t]=n)}catch{}if(t.embedFonts){for(let t of[`font-feature-settings`,`font-variation-settings`,`font-kerning`,`font-variant`,`font-variant-ligatures`,`font-optical-sizing`])if(!i[t])try{let n=e.getPropertyValue(t);n&&(i[t]=n)}catch{}}try{(i[`content-visibility`]||e.getPropertyValue(`content-visibility`))===`hidden`&&(i[`content-visibility`]=`hidden`)}catch{}Object.defineProperty(i,"__needsBgInline",{value:ri(e),enumerable:!1});let s=parseFloat(e.getPropertyValue(`border-top-width`)||0)||0,c=parseFloat(e.getPropertyValue(`border-right-width`)||0)||0,l=parseFloat(e.getPropertyValue(`border-bottom-width`)||0)||0,u=parseFloat(e.getPropertyValue(`border-left-width`)||0)||0;if(s===0&&c===0&&l===0&&u===0){let t=(e.getPropertyValue(`border-image-source`)||``).trim(),n=t&&t!==`none`;for(let e of`border.border-top.border-right.border-bottom.border-left.border-width.border-style.border-color.border-top-width.border-top-style.border-top-color.border-right-width.border-right-style.border-right-color.border-bottom-width.border-bottom-style.border-bottom-color.border-left-width.border-left-style.border-left-color.border-block.border-block-width.border-block-style.border-block-color.border-inline.border-inline-width.border-inline-style.border-inline-color.border-block-start.border-block-start-width.border-block-start-style.border-block-start-color.border-block-end.border-block-end-width.border-block-end-style.border-block-end-color.border-inline-start.border-inline-start-width.border-inline-start-style.border-inline-start-color.border-inline-end.border-inline-end-width.border-inline-end-style.border-inline-end-color`.split(`.`))delete i[e];n||(i.border=`none`)}return Zr(i),i}function Zr(e){if(!gt())return;let t=e[`background-clip`]||e[`-webkit-background-clip`];if(!t||!t.includes(`text`))return;let n=e=>e===`transparent`||e===`rgba(0, 0, 0, 0)`,r=e[`-webkit-text-fill-color`];if(!n(r===void 0?e.color:r))return;let i=ni(e[`background-image`],e[`background-color`]);i&&(n(e.color)&&(e.color=i),r!==void 0&&(e[`-webkit-text-fill-color`]=i),e[`background-image`]=`none`,e[`background-color`]=`transparent`,delete e[`background-clip`],delete e[`-webkit-background-clip`],Object.defineProperty(e,"__bgClipTextFix",{value:i,enumerable:!1}))}function Qr(e,t,n){let r=n.textShadow;if(!r||r===`none`||!(parseFloat(n.webkitTextStrokeWidth)>0)||e.firstElementChild||n.backgroundImage!==`none`||n.boxShadow!==`none`||ti(n.backgroundColor)[3]!==0||[`Top`,`Right`,`Bottom`,`Left`].some(e=>parseFloat(n[`border${e}Width`])>0)||r.replace(/\([^)]*\)/g,``).includes(`,`))return;let i=(r.match(/(?:rgba?|hsla?|color|oklch|oklab|lab|lch)\([^)]*\)|#[\da-f]+|\b[a-z]+\b/i)||[])[0],[a=0,o=0,s=0]=(r.match(/-?[\d.]+px/g)||[]).map(parseFloat);if(!i)return;let c=n.filter&&n.filter!==`none`?`${n.filter} `:``;t.style.setProperty(`text-shadow`,`none`,`important`),t.style.setProperty(`filter`,`${c}drop-shadow(${a}px ${o}px ${s/2}px ${i})`,`important`)}var $r=/(?:rgba?|hsla?|oklch|oklab|lab|lch|color)\([^()]*\)/g,ei;function ti(e){if(!ei){let e=document.createElement(`canvas`);e.width=e.height=1,ei=e.getContext(`2d`,{willReadFrequently:!0})}return ei.clearRect(0,0,1,1),ei.fillStyle=`transparent`,ei.fillStyle=e,ei.fillRect(0,0,1,1),ei.getImageData(0,0,1,1).data}function ni(e,t){let n=e=>{let t=[];for(let n of(e||``).match($r)||[]){let[e,r,i,a]=ti(n);a>13&&t.push([e,r,i])}return t},r=n(e);if(r.length||(r=n(t)),!r.length)return null;let i=[0,0,0];for(let[e,t,n]of r)i[0]+=e,i[1]+=t,i[2]+=n;return`rgb(${i.map(e=>Math.round(e/r.length)).join(`, `)})`}function ri(e){let t=e.getPropertyValue(`background-image`);if(t&&t!==`none`)return!0;let n=e.getPropertyValue(`background-color`);if(n&&n!==`rgba(0, 0, 0, 0)`&&n!==`transparent`)return!0;for(let t of Mr){let n=e.getPropertyValue(t);if(n&&n!==`none`)return!0}let r=e.getPropertyValue(`background`);return!!(r&&/url\s*\(/i.test(r))}function ii(e){for(let t=e.firstChild;t;t=t.nextSibling){if(t.nodeType===3&&/\S/.test(t.nodeValue||``))return!0;if(t.nodeType===1){let e=H(t).position;if(e!==`absolute`&&e!==`fixed`)return!0}}return!1}function ai(e,t,n){try{if(typeof e.computedStyleMap==`function`){let t=e.computedStyleMap().get(`width`);if(t!=null)return!si(String(t).trim().toLowerCase())}}catch{}let r=e.style&&(e.style.width||e.style.inlineSize);return r&&!si(String(r).trim().toLowerCase())?!0:ci(e,t)?n||li(e,t):!1}var oi=new Set([`auto`,`min-content`,`max-content`,`stretch`,`fill-available`,`-webkit-fill-available`]);function si(e){return oi.has(e)||e.startsWith(`fit-content`)}function ci(e,t){let n=e.getBoundingClientRect().width-(parseFloat(t.paddingLeft)||0)-(parseFloat(t.paddingRight)||0)-(parseFloat(t.borderLeftWidth)||0)-(parseFloat(t.borderRightWidth)||0);if(!(n>0))return!1;let r=1/0,i=-1/0,a=null;for(let t=e.firstChild;t;t=t.nextSibling){let e;if(t.nodeType===3){if(!/\S/.test(t.nodeValue||``)||(a||=document.createRange(),a.selectNode(t),e=a.getBoundingClientRect(),!e.width&&!e.height))continue}else if(t.nodeType===1){let n=H(t);if(n.display===`none`||n.position===`absolute`||n.position===`fixed`)continue;e=t.getBoundingClientRect()}else continue;e.left<r&&(r=e.left),e.right>i&&(i=e.right)}return i!==-1/0&&i-r<n-.5}function li(e,t){let n=e.parentElement;if(!n)return!1;let r=H(n),i=n.getBoundingClientRect().width-(parseFloat(r.paddingLeft)||0)-(parseFloat(r.paddingRight)||0)-(parseFloat(r.borderLeftWidth)||0)-(parseFloat(r.borderRightWidth)||0)-(parseFloat(t.marginLeft)||0)-(parseFloat(t.marginRight)||0);return i>0&&Math.abs(e.getBoundingClientRect().width-i)>.5}var ui=new WeakMap;function di(e,t){let n=ui.get(e);if(n)return n;let r=[t];for(let t in e)r.push(t,e[t]);return n=r.join(``),ui.set(e,n),n}function fi(e,t){return e.env===Y&&e.stamp===pr(t,e.hosts)}var pi=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,mi=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,hi=new Set([`INPUT`,`TEXTAREA`,`SELECT`,`OPTION`,`OPTGROUP`,`PROGRESS`,`METER`,`BUTTON`,`DATALIST`]);function gi(e){let t=e.__styleShare;return t||=e.__styleShare={ids:new WeakMap,intern:new Map,snaps:new Map,rootSeen:!1},t}function _i(e,t){let n=t.ids.get(e);if(n!==void 0)return n;let r=e.parentElement,i;if(!r)i=`R`;else if(i=t.ids.get(r),i===void 0){if(t.rootSeen)return t.ids.set(e,-1),-1;i=`R`}if(t.rootSeen=!0,i===-1)return t.ids.set(e,-1),-1;let a=``,o=e.attributes;if(o&&o.length){if(o.length===1)a=o[0].name+`=`+o[0].value;else{let e=[];for(let t=0;t<o.length;t++)e.push(o[t].name+`=`+o[t].value);e.sort(),a=e.join(``)}}let s=i+`|`+e.tagName+`|`+a;return n=t.intern.get(s),n===void 0&&(n=t.intern.size,t.intern.set(s,n)),t.ids.set(e,n),n}function vi(e,t){let n=e.snap,r=e.snap={...n};Object.defineProperty(r,"__needsBgInline",{value:n.__needsBgInline,enumerable:!1}),n.__bgClipTextFix!==void 0&&Object.defineProperty(r,"__bgClipTextFix",{value:n.__bgClipTextFix,enumerable:!1});let i=Rr(t.ownerDocument||document),a=t.getAttribute&&t.getAttribute(`style`)||``,o=a&&mi.test(a),s=!!i.marginUnstable||o&&/margin/i.test(a),c=!!i.paddingUnstable||o&&/padding/i.test(a),l=r.display!==void 0&&r.display.includes(`grid`),u=r.transform!==void 0&&r.transform!==`none`,d=[];for(let e in r)(pi.test(e)||l&&(e===`grid-template-columns`||e===`grid-template-rows`)||u&&e===`transform`||s&&e.charCodeAt(0)===109&&e.startsWith(`margin-`)||c&&e.charCodeAt(0)===112&&e.startsWith(`padding-`))&&d.push(e);e.h&&!(`height`in r)&&d.push(`height`),e.b&&!(`block-size`in r)&&d.push(`block-size`);let f=new Set(d),p=[t.tagName.toLowerCase()];for(let e in r)f.has(e)||p.push(e,r[e]);return e.rr=d,e.sig=p.join(``)+``+d.join(``),d}function yi(e,t,n,r,i){let a=i&&i.__styleShare?r&&r.__styleShare:null,o=a?a.ids.get(e):void 0;if(o===void 0||o===-1||e.shadowRoot||e.assignedSlot)return Je(n,Gr(e));let s=o+t,c=a.pseudo||=new Map,l=c.get(s);if(l){let t={...l.snap},r=l.rr||vi(l,e);for(let e=0;e<r.length;e++){let i=n.getPropertyValue(r[e]);i?t[r[e]]=i:delete t[r[e]]}return t}let u=Je(n,Gr(e));return c.set(s,{snap:u,rr:null,sig:null,h:`height`in u,b:`block-size`in u}),u}function bi(e,t=null,n={},r=null,i=null){let a=Gn.get(e),o=!!(n&&n.embedFonts),s=n&&n.excludeStyleProps||null;if(typeof s!=`function`&&a&&fi(a,e)&&a.embedFonts===o&&a.excludeStyleProps===s)return a.snapshot;let c=t||getComputedStyle(e),l,u=null,d=r&&r.st.snaps.get(r.id);if(d){l={...d.snap};let t=d.rr||vi(d,e);u=[];for(let e=0;e<t.length;e++){let n=t[e],r=c.getPropertyValue(n);r?l[n]=r:delete l[n],u.push(r)}Object.defineProperty(l,"__needsBgInline",{value:d.snap.__needsBgInline,enumerable:!1}),d.snap.__bgClipTextFix!==void 0&&Object.defineProperty(l,"__bgClipTextFix",{value:d.snap.__bgClipTextFix,enumerable:!1})}else l=Xr(c,n,e,Hr(e,i)),r&&r.st.snaps.set(r.id,{snap:l,rr:null,sig:null,h:`height`in l,b:`block-size`in l});let f=!1;if(typeof e.computedStyleMap==`function`){let t;for(let n of Kn)if(l[n]===`0px`)try{t||=e.computedStyleMap(),t.get(n)?.toString()===`auto`&&(l[n]=`auto`,f=!0)}catch{}}Ui(e,c,l);let p=Oi(e,c,l);u!==null&&(f&&u.push(``,...Kn.map(e=>l[e])),p&&u.push(``+p),ui.set(l,d.sig+``+u.join(``)+(`height`in l?``:``)+(`block-size`in l?``:``)));let m=mr(e);return Gn.set(e,{env:Y,stamp:pr(e,m),hosts:m,snapshot:l,embedFonts:o,excludeStyleProps:s}),l}function xi(e,t){if(e&&e.session&&e.persist)return e;if(e&&(e.styleMap||e.styleCache||e.nodeMap)){let n=e.__ctx;return(!n||e.__ctxOpts!==t)&&(n={session:e,persist:{snapshotKeyCache:qn,defaultStyle:p.defaultStyle,baseStyle:p.baseStyle,image:p.image,resource:p.resource,background:p.background},options:t||{}},e.__ctx=n,e.__ctxOpts=t),n}return{session:{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},persist:{snapshotKeyCache:qn,defaultStyle:p.defaultStyle,baseStyle:p.baseStyle,image:p.image,resource:p.resource,background:p.background},options:e||t||{}}}var Si=/%|[\d.](?:em|rem|ex|ch|cap|ic|lh|rlh|v[whib]|vmin|vmax|cq[whbi]|cqmin|cqmax)\b|\b(?:calc|var|min|max|clamp|env|attr)\(|\b(?:auto|inherit|initial|unset|revert|currentcolor|-webkit-fill-available|fit-content|min-content|max-content)\b/i,Ci=e=>e.tagName===`INPUT`||e.tagName===`TEXTAREA`;function wi(e,t,n){if(!e.style||e.style.length===0)return;let r=Vr(e),i=r!=null&&!Si.test(e.getAttribute(`style`)||``),a;for(let o=0;o<e.style.length;o++){let s=e.style[o],c=s.startsWith(`border-`)&&s.endsWith(`-width`);if(i&&c&&a===void 0){let t=e.style.borderWidth,r=Gn.get(e);a=r&&fi(r,e)&&Ei.every(e=>r.snapshot[e]===t)||n.borderWidth===t}if(i&&!r.has(s)&&(!c||a)&&!(s.startsWith(`background`)&&Ci(e)))continue;let l=n.getPropertyValue(s);l&&(!c||l!==e.style.getPropertyValue(s))&&t.style.setProperty(s,l,e.style.getPropertyPriority(s))}}function X(e,t,n,r){if(e.tagName===`STYLE`)return;let i=xi(n,r),a=i.options&&i.options.cache||`soft`;a!==`disabled`&&Er(e.ownerDocument),a===`disabled`&&!i.session.__bumpedForDisabled&&(Xn(),qn.clear(),i.session.__bumpedForDisabled=!0);let{session:o,persist:s}=i;if(!o.styleCache.has(e)){let t=null;try{t=getComputedStyle(e)}catch{}o.styleCache.set(e,t||getComputedStyle((e.ownerDocument||document).documentElement))}let c=o.styleCache.get(e);e.getAttribute?.(`style`)&&wi(e,t,c);let l=c.getPropertyValue(`animation-name`);t&&t.style&&l&&l!==`none`&&t.style.setProperty(`animation`,`none`,`important`);let u=e.tagName?.toLowerCase()||`div`;if(Ze.has(u)){let n={};Object.defineProperty(n,"__needsBgInline",{value:ri(c),enumerable:!1});let r=mr(e);Gn.set(e,{env:Y,stamp:pr(e,r),hosts:r,snapshot:n,embedFonts:!!(i.options&&i.options.embedFonts),excludeStyleProps:i.options&&i.options.excludeStyleProps||null}),o.styleMap.set(t,``);return}let d=null;if(i.options&&i.options.__styleShare&&o.styleMap){let t=gi(o),n=_i(e,t),r=e.ownerDocument||document,i=r.activeElement;n!==-1&&!hi.has(e.tagName)&&!(i&&i!==r.body&&i!==r.documentElement&&i===e)&&(!e.getRootNode||e.getRootNode()===r)&&!e.shadowRoot&&!e.assignedSlot&&(d={st:t,id:n})}let f=bi(e,c,i.options,d,o);if(e.getAttribute?.(`style`))for(let e of[`top`,`right`,`bottom`,`left`]){let n=`margin-${e}`;f[n]===`auto`&&t.style.setProperty(n,`auto`,`important`)}f.__bgClipTextFix&&t&&t.style&&(t.style.setProperty(`background-image`,`none`,`important`),t.style.setProperty(`background-color`,`transparent`,`important`),t.style.setProperty(`color`,f.__bgClipTextFix,`important`),t.style.setProperty(`-webkit-text-fill-color`,f.__bgClipTextFix,`important`),(o.bgClipText||=[]).push([e,t])),U()&&Qr(e,t,c),Ti(e,c,f),t.style?.length&&f[`box-sizing`]===`border-box`&&c.getPropertyValue(`box-sizing`)!==`border-box`&&ji(e,t,f);let p=Bi(e);if(Pi(e,t,f,p,o),p){let t=c.getPropertyValue(`min-width`);if(!t||t===`auto`||t===`0px`){f[`min-width`]=`0px`;let n=c.getPropertyValue(`overflow-x`),r=e.parentElement;if(t===`auto`&&(n===`visible`||n===`clip`)&&r&&H(r).display.includes(`flex`)){let e=o.flexOverflow||=new WeakMap,t=e.get(r);if(t===void 0){if(t=r.scrollWidth>r.clientWidth,!t){let e=H(r),n=t=>parseFloat(e.getPropertyValue(t))||0,i=n(`width`)-(e.boxSizing===`border-box`?n(`padding-left`)+n(`padding-right`)+n(`border-left-width`)+n(`border-right-width`):0),a=e.flexDirection.startsWith(`row`)===(e.writingMode===`horizontal-tb`)&&e.flexWrap===`nowrap`,s=0,c=0;for(let e of r.children){o.styleCache.has(e)||o.styleCache.set(e,getComputedStyle(e));let t=o.styleCache.get(e);if(t.display===`none`||t.position===`absolute`||t.position===`fixed`)continue;let n=e=>parseFloat(t.getPropertyValue(e))||0,r=n(`width`)+n(`margin-left`)+n(`margin-right`)+(t.boxSizing===`border-box`?0:n(`padding-left`)+n(`padding-right`)+n(`border-left-width`)+n(`border-right-width`));s=a?s+r:Math.max(s,r),c++}t=s+(a?Math.max(0,c-1)*n(`column-gap`):0)>i+c/60}e.set(r,t)}t&&(f[`min-width`]=f.width)}}}let m=di(f,u),h=!0;if(Ve(u,(f.display||``).toLowerCase())){h=ii(e),h&&He(u,f,p)&&ai(e,c,p)&&(h=!1),m=`${m}${h?`|c`:``}${p?`|f`:``}`;let t=f[`text-wrap-mode`]||f[`white-space`]||``;h&&t!==`nowrap`&&t!==`pre`&&(o.reconcileRisk=(o.reconcileRisk||0)+1)}let g=s.snapshotKeyCache.get(m);g===void 0&&(g=Ue(f,u,h,p),s.snapshotKeyCache.size>=Jn&&s.snapshotKeyCache.delete(s.snapshotKeyCache.keys().next().value),s.snapshotKeyCache.set(m,g)),o.styleMap.set(t,g)}function Ti(e,t,n){let r=t.getPropertyValue(`overflow-x`),i=t.getPropertyValue(`overflow-y`);if((r===`visible`||!r)&&(i===`visible`||!i)||t.getPropertyValue(`box-sizing`)===`border-box`||typeof e.clientWidth!=`number`||!e.offsetWidth)return;let a=e=>parseFloat(e)||0,o=e.offsetWidth-e.clientWidth-a(t.getPropertyValue(`border-left-width`))-a(t.getPropertyValue(`border-right-width`)),s=e.offsetHeight-e.clientHeight-a(t.getPropertyValue(`border-top-width`))-a(t.getPropertyValue(`border-bottom-width`)),c=(e,t)=>{let r=n[e];if(!r||!r.endsWith(`px`))return;let i=parseFloat(r);Number.isFinite(i)&&(n[e]=`${Math.round((i+t)*1e3)/1e3}px`)};o>=2&&(c(`width`,o),c(`inline-size`,o)),s>=2&&(c(`height`,s),c(`block-size`,s))}var Ei=[`border-top-width`,`border-right-width`,`border-bottom-width`,`border-left-width`],Di=[`width`,`inline-size`,`height`,`block-size`];function Oi(e,t,n){if(!Ei.some(e=>n[e]?.includes(`.`))||t.getPropertyValue(`box-sizing`)===`border-box`||n.display===`inline`)return``;for(let e of[`width`,`height`]){let t=n[`min-${e}`],r=n[`max-${e}`];if(t&&t!==`0px`&&t!==`auto`||r&&r!==`none`)return``}let r=e=>parseFloat(n[e])||0,i=r(`padding-left`)+r(`padding-right`)+r(`border-left-width`)+r(`border-right-width`),a=r(`padding-top`)+r(`padding-bottom`)+r(`border-top-width`)+r(`border-bottom-width`),o=(n[`writing-mode`]||`horizontal-tb`)!==`horizontal-tb`;for(let e of Di){let t=n[e];t&&t.endsWith(`px`)&&(n[e]=`${Math.round((parseFloat(t)+(e===`width`||e===`inline-size`&&!o||e===`block-size`&&o?i:a))*1e3)/1e3}px`)}n[`box-sizing`]=`border-box`;let s=``;if(t.getPropertyValue(`overflow-x`)===`auto`){let t=e.scrollWidth<=e.clientWidth;n[`overflow-x`]=t?`hidden`:`auto`,t&&(s+=`x`)}if(t.getPropertyValue(`overflow-y`)===`auto`){let t=e.scrollHeight<=e.clientHeight;n[`overflow-y`]=t?`hidden`:`auto`,t&&(s+=`y`)}return s}var ki=[`box-sizing`,...Di,`overflow-x`,`overflow-y`],Ai=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;function ji(e,t,n){if(Ai.test(e.getAttribute(`style`)))for(let e of ki)t.style.getPropertyValue(e)&&n[e]&&t.style.setProperty(e,n[e],t.style.getPropertyPriority(e))}function Mi(e){return e.backgroundImage&&e.backgroundImage!==`none`||e.backgroundColor&&e.backgroundColor!==`rgba(0, 0, 0, 0)`&&e.backgroundColor!==`transparent`||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||`visible`)!==`visible`}var Ni=typeof CSS<`u`&&CSS.supports?.(`text-wrap-mode`,`nowrap`)?`text-wrap-mode`:`white-space`;function Pi(e,t,n,r,i){let a=n.display||``;if(!r&&!a.startsWith(`inline-`)&&(n.float||`none`)===`none`&&n.position!==`absolute`&&n.position!==`fixed`)return;let o=n[`text-wrap-mode`]||n[`white-space`]||``;if(o===`nowrap`||o===`pre`||Ni===`white-space`&&o!==`normal`||(n[`writing-mode`]||`horizontal-tb`)!==`horizontal-tb`||!t.style)return;let s=i.__oneLine||=new WeakSet;for(let t=e.parentElement;t;t=t.parentElement)if(s.has(t))return;Fi(e,n,i)&&(s.add(e),t.style.setProperty(Ni,`nowrap`))}function Fi(e,t,n){let r=e.clientHeight-(parseFloat(t[`padding-top`])||0)-(parseFloat(t[`padding-bottom`])||0);if(r>3*(parseFloat(t[`font-size`])||16)||t[`word-break`]===`normal`&&t[`overflow-wrap`]===`normal`&&/^[\w\u00C0-\u024F.,:;!?'"()%]*$/.test(e.textContent.trim()))return!1;let i=e.ownerDocument||document,a=i.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT),o=i.createRange(),s=null,c=0,l=0;for(let e=a.nextNode();e;e=a.nextNode()){if(e.nodeType===1){if(e.shadowRoot||e.localName===`br`||e.localName===`textarea`)return!1;continue}if(/\S/.test(e.data)){if(++l>64)return!1;o.selectNodeContents(e);for(let e of o.getClientRects())if(e.height){if(s||=e,Math.min(s.bottom,e.bottom)-Math.max(s.top,e.top)<Math.min(s.height,e.height)/2)return!1;c=Math.max(c,e.height)}}}if(!s)return!1;let u=zi(e,n.__axes||=new WeakMap);return u?r*(u===Ri&&e.offsetHeight?e.getBoundingClientRect().height/e.offsetHeight:1)<=2*c:!1}var Ii=0,Li=1,Ri=2;function zi(e,t){let n=t.get(e);if(n!==void 0)return n;let r=H(e),i=r.transform,a=i&&i!==`none`?i.slice(i.indexOf(`(`)+1,-1).split(`,`).map(parseFloat):null;if(r.rotate&&r.rotate!==`none`||a&&(i.startsWith(`matrix3d`)?a[1]||a[4]:a[1]||a[2]))n=Ii;else{let o=e.parentElement||D(e);n=o?zi(o,t):Li,n===Li&&(r.scale&&r.scale!==`none`||r.zoom&&r.zoom!==`1`||a&&(i.startsWith(`matrix3d`)?a[0]!==1||a[5]!==1:a[0]!==1||a[3]!==1))&&(n=Ri)}return t.set(e,n),n}function Bi(e){let t=e.parentElement;if(!t)return!1;let n=H(t).display||``;return n.includes(`flex`)||n.includes(`grid`)}function Vi(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType===3&&/\S/.test(t.nodeValue))return!0;let t=e.firstElementChild,n=e.lastElementChild;if(t&&t.tagName===`BR`||n&&n.tagName===`BR`)return!0;for(let t=e.firstElementChild;t;t=t.nextElementSibling){let e=H(t);if(e.display===`none`)continue;let n=e.position;if(n!==`absolute`&&n!==`fixed`)return!0}return!1}function Hi(e){let t=e.getBoundingClientRect().top,n=-1/0,r=null;for(let t=e.firstChild;t;t=t.nextSibling){if(t.nodeType===3){if(!/\S/.test(t.nodeValue||``))continue;r||=document.createRange(),r.selectNode(t);let e=r.getBoundingClientRect();(e.width||e.height)&&(n=Math.max(n,e.bottom));continue}if(t.nodeType!==1)continue;let e=H(t);if(e.display===`none`)continue;let i=e.position;i===`absolute`||i===`fixed`||e.float&&e.float!==`none`||(n=Math.max(n,t.getBoundingClientRect().bottom))}return n===-1/0?NaN:n-t}function Ui(e,t,n){if(w(e)&&e.style&&e.style.height)return;let r=e.tagName&&e.tagName.toLowerCase();if(!r||![`div`,`section`,`article`,`main`,`aside`,`header`,`footer`,`nav`].includes(r)||t.aspectRatio&&t.aspectRatio!==`none`&&t.aspectRatio!==`auto`)return;let i=t.display||``;if(i.includes(`flex`)||i.includes(`grid`))return;let a=t.position;if(a===`absolute`||a===`fixed`||a===`sticky`||t.transform!==`none`||Mi(t)||Bi(e))return;let o=t.overflowX||t.overflow||`visible`,s=t.overflowY||t.overflow||`visible`;if(o!==`visible`||s!==`visible`)return;let c=t.clip;if(c&&c!==`auto`&&c!==`rect(auto, auto, auto, auto)`||t.visibility===`hidden`||t.opacity===`0`||!Vi(e))return;let l=parseFloat(t.height),u=Hi(e);Number.isFinite(l)&&Number.isFinite(u)&&Math.abs(l-u)>2||(delete n.height,delete n[`block-size`])}ft();var Wi=new Set([`symbol`,`defs`]),Gi=new Set([`mask`,`clipPath`,`linearGradient`,`radialGradient`,`pattern`,`marker`,`filter`]),Ki=new WeakMap,qi=-1;function Ji(e){let t=ir();return t!==qi&&(Ki=new WeakMap,qi=t),Yi(e)}function Yi(e){let t=Ki.get(e);if(t!==void 0)return t;let n;if(e.namespaceURI===`http://www.w3.org/2000/svg`&&(Gi.has(e.localName)?n=!1:Wi.has(e.localName)&&(n=!0)),n===void 0){let t=e.parentNode;n=!!(t&&t.nodeType===1)&&Yi(t)}return Ki.set(e,n),n}function Xi(e,t){if(e?.nodeType!==1||t?.nodeType!==1||Ji(e))return;let n=e.getAttribute?.(`style`),r=!!(n&&n.includes(`var(`));if(!r&&e.attributes?.length){let t=e.attributes;for(let e=0;e<t.length;e++){let n=t[e];if(n&&typeof n.value==`string`&&!n.value.startsWith(`data:`)&&n.value.includes(`var(`)){r=!0;break}}}let i=null;if(r)try{i=getComputedStyle(e)}catch{}if(r){let n=e.style;if(n&&n.length){let e=new Set;for(let r=0;r<n.length;r++){let a=n[r];if(e.has(a))continue;e.add(a);let o=n.getPropertyValue(a);if(!o||!o.includes(`var(`))continue;let s=i&&i.getPropertyValue(a);if(s)try{t.style.setProperty(a,s.trim(),n.getPropertyPriority(a))}catch{}}}}if(r&&e.attributes?.length){let n=e.attributes;for(let e=0;e<n.length;e++){let r=n[e];if(!r||typeof r.value!=`string`||r.value.startsWith(`data:`)||!r.value.includes(`var(`))continue;let a=r.name,o=i&&i.getPropertyValue(a);if(o)try{t.style.setProperty(a,o.trim())}catch{}}}}J(),J(),m(),z(),Pe(),N();function Zi(e){return!!(!e||e.startsWith(`data:`)||e.startsWith(`blob:`))}function Qi(e,t){if(!e)return null;let n=0;try{n=t?t.getBoundingClientRect().width||t.width:0}catch{}n||=window.innerWidth||1e3;let r=[];for(let t of e.split(`,`)){let e=t.trim().split(/\s+/);if(!e[0])continue;let i=e[1]||``,a=1;/^\d*\.?\d+x$/i.test(i)?a=parseFloat(i):/^\d+w$/i.test(i)&&(a=parseInt(i,10)/n),r.push({url:e[0],d:a})}if(!r.length)return null;r.sort((e,t)=>e.d-t.d);let i=window.devicePixelRatio||1;return(r.find(e=>e.d>=i)||r[r.length-1]).url}function $i(e,t){let n=e.currentSrc||``;if(n&&!Zi(n))return n;let r=t.querySelectorAll(`source[srcset]`),i=null;for(let t of r){let n=t.getAttribute(`srcset`);if(!n||Zi(n))continue;let r=t.getAttribute(`type`);if(r&&!k.test(r.trim()))continue;let a=t.getAttribute(`media`);if(a)try{if(window.matchMedia(a).matches)return Qi(n,e)}catch{}i||=Qi(n,e)}return i}function ea(e){let t=[e.getAttribute(`data-src`),e.getAttribute(`data-lazy-src`),e.getAttribute(`data-original`),e.getAttribute(`data-hi-res-src`)];for(let e of t)if(e&&!Zi(e))return e;let n=e.getAttribute(`data-srcset`)||e.getAttribute(`data-lazy-srcset`);if(n){let e=n.split(`,`)[0].trim().split(/\s+/)[0];if(e&&!Zi(e))return e}return null}Le(),W();function ta(e,t){if(e=e.trim(),!e)return e;let n=t?`[data-sd-slotted~="${t}"]`:`[data-sd-slotted]`;return e.endsWith(`:not([data-sd-slotted])`)||e.endsWith(`:not(${n})`)?e:`${e}:not(${n})`}var na=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,ra=/^::?(?:before|after|first-letter)$/;function ia(e,t,n=!0,r){return B(e,`,`).map(e=>e.trim()).filter(Boolean).map(e=>{if(e.startsWith(`:where(`)&&e.includes(`data-sd`)||e.startsWith(`@`))return e;let i=e.match(na);if(i&&ra.test(i[0]))return`:not(*)`;let a=i?e.slice(0,i.index).trim():e;return`:where(${t} ${n?ta(a,r):a})${i?i[0]:``}`}).join(`, `)}function aa(e,t,n){return e?(e=e.replace(/:host-context\(([^)]+)\)/g,(e,n)=>`:where(:where(${n.trim()}) ${t})`),e=e.replace(/:host\(([^)]+)\)/g,(e,n)=>`:where(${t}:is(${n.trim()}))`),e=e.replace(/:host\b/g,`:where(${t})`),e=e.replace(/::slotted\(([^)]+)\)/g,(e,n)=>`:where(${t} ${n.trim()})`),e=e.replace(/(^|})(\s*)([^@}{]+){/g,(e,r,i,a)=>`${r}${i}${ia(a,t,!0,n)}{`),e):``}function oa(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function sa(e){let t=``;for(let n of e)if(n.media&&n.cssRules){let e=!1;try{e=window.matchMedia(n.conditionText||n.media.mediaText).matches}catch{}e&&(t+=sa(n.cssRules))}else if(n.constructor?.name===`CSSSupportsRule`)t+=`@supports ${n.conditionText}{${sa(n.cssRules)}}`;else if(n.cssRules&&n.cssRules.length&&/@media/i.test(n.cssText)){let e=n.cssText.slice(0,n.cssText.indexOf(`{`)+1);t+=e+(n.style?n.style.cssText:``)+sa(n.cssRules)+`}`}else t+=n.cssText+`
|
|
4
|
+
`;return t}function ca(e){let t=``;try{e.querySelectorAll(`style`).forEach(e=>{let n=null;try{n=e.sheet&&e.sheet.cssRules}catch{}t+=(n?sa(n):e.textContent||``)+`
|
|
5
|
+
`});let n=e.adoptedStyleSheets||[];for(let e of n)try{e&&e.cssRules&&(t+=sa(e.cssRules))}catch{}}catch{}return t}function la(e,t,n){if(!t)return;let r=document.createElement(`style`);r.setAttribute(`data-sd`,n),r.textContent=t,e.insertBefore(r,e.firstChild||null)}function ua(e,t,n={}){try{let r=null,i=H(e).content;if(i&&i.includes(`url(`)){let e=i.match(/url\(["']?([^"')]+)["']?\)/);e&&(r=e[1])}let a=e.closest?.(`picture`),o=e.getAttribute(`src`)||``,s=e.getAttribute(`srcset`)||``,c=r||(a?$i(e,a):!s.trim()&&o.startsWith(`data:`)?o:e.currentSrc)||Qi(s,e)||e.src||``;if((!c||Zi(c))&&n.resolvePicturePlaceholders!==!1){let t=ea(e);t&&(c=t)}if(!c)return;t.getAttribute(`src`)!==c&&t.setAttribute(`src`,c),t.removeAttribute(`srcset`),t.removeAttribute(`sizes`),t.loading=`eager`,t.decoding=`sync`}catch{}}function da(e){let t=new Set;if(!e)return t;let n=/var\(\s*(--[A-Za-z0-9_-]+)\b/g,r;for(;r=n.exec(e);)t.add(r[1]);return t}function fa(e,t){try{let n=getComputedStyle(e).getPropertyValue(t).trim();if(n)return n}catch{}try{let e=getComputedStyle(document.documentElement).getPropertyValue(t).trim();if(e)return e}catch{}return``}function pa(e,t,n){let r=[];for(let n of t){let t=fa(e,n);t&&r.push(`${n}: ${t};`)}return r.length?`${n}{${r.join(``)}}
|
|
6
|
+
`:``}function ma(e,t){if(!e)return;let n=e=>{let n=e.getAttribute(`data-sd-slotted`)||``;t?` ${n} `.includes(` ${t} `)||e.setAttribute(`data-sd-slotted`,n?`${n} ${t}`:t):e.setAttribute(`data-sd-slotted`,n)};e.nodeType===Node.ELEMENT_NODE&&n(e),e.querySelectorAll?.(`*`).forEach(n)}async function ha(e,t=3){let n=()=>{try{return e.contentDocument||e.contentWindow?.document||null}catch{return null}},r=n(),i=0;for(;i<t&&(!r||!r.body&&!r.documentElement);)await new Promise(e=>setTimeout(e,0)),r=n(),i++;return r&&(r.body||r.documentElement)?r:null}function ga(e){let t=e.getBoundingClientRect(),n=0,r=0,i=0,a=0;try{let t=getComputedStyle(e);n=parseFloat(t.borderLeftWidth)||0,r=parseFloat(t.borderRightWidth)||0,i=parseFloat(t.borderTopWidth)||0,a=parseFloat(t.borderBottomWidth)||0}catch{}return{contentWidth:Math.max(0,Math.round(t.width-(n+r))),contentHeight:Math.max(0,Math.round(t.height-(i+a))),rect:t}}function Z(e){let t=0,n=0;if(e.offsetWidth>0&&(t=e.offsetWidth),e.offsetHeight>0&&(n=e.offsetHeight),t===0||n===0)try{let r=getComputedStyle(e);if(t===0){let e=parseFloat(r.width);!isNaN(e)&&e>0&&(t=e)}if(n===0){let e=parseFloat(r.height);!isNaN(e)&&e>0&&(n=e)}}catch{}if(t===0||n===0)try{if(t===0){let n=parseFloat(e.getAttribute(`width`));!isNaN(n)&&n>0&&(t=n)}if(n===0){let t=parseFloat(e.getAttribute(`height`));!isNaN(t)&&t>0&&(n=t)}}catch{}if((t===0||n===0)&&(e.naturalWidth||e.naturalHeight))try{t===0&&e.naturalWidth>0&&(t=e.naturalWidth),n===0&&e.naturalHeight>0&&(n=e.naturalHeight)}catch{}return{width:t,height:n}}var _a=new WeakMap;function va(e,t,n){let r=e.defaultView,i=r?r.scrollX:0,a=r?r.scrollY:0,o=e.body?e.body.scrollLeft:0,s=e.body?e.body.scrollTop:0,c=e.documentElement?e.documentElement.scrollLeft:0,l=e.documentElement?e.documentElement.scrollTop:0,u=0,d=0,f=0,p=0;try{let t=r&&e.body?r.getComputedStyle(e.body):null;t&&(u=(parseFloat(t.marginTop)||0)+(parseFloat(t.paddingTop)||0),d=(parseFloat(t.marginRight)||0)+(parseFloat(t.paddingRight)||0),f=(parseFloat(t.marginBottom)||0)+(parseFloat(t.paddingBottom)||0),p=(parseFloat(t.marginLeft)||0)+(parseFloat(t.paddingLeft)||0))}catch{}let m=`html {margin: 0 !important;padding: 0 !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}body {margin: 0 !important;padding: ${u}px ${d}px ${f}px ${p}px !important;width: ${t}px !important;height: ${n}px !important;min-width: ${t}px !important;min-height: ${n}px !important;box-sizing: border-box !important;overflow: hidden !important;background-clip: border-box !important;}`,h;try{let t=_a.get(e);t||_a.set(e,t=new r.CSSStyleSheet),t.replaceSync(m),e.adoptedStyleSheets=[...e.adoptedStyleSheets,t],h=()=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(e=>e!==t)}}catch{let t=e.createElement(`style`);t.setAttribute(`data-sd-iframe-pin`,``),V(t),t.textContent=m,(e.head||e.documentElement).appendChild(t),h=()=>t.remove()}if(jr(e.documentElement),i||a)try{e.body&&(e.body.scrollLeft=i,e.body.scrollTop=a),e.documentElement&&(e.documentElement.scrollLeft||(e.documentElement.scrollLeft=i),e.documentElement.scrollTop||(e.documentElement.scrollTop=a))}catch{}return()=>{try{h()}catch{}try{r&&typeof r.scrollTo==`function`&&r.scrollTo(i,a),e.body&&(e.body.scrollLeft=o,e.body.scrollTop=s),e.documentElement&&(e.documentElement.scrollLeft=c,e.documentElement.scrollTop=l)}catch{}jr(e.documentElement)}}async function ya(e,t,n){let r=await ha(e,3);if(!r)throw Error(`The iframe document isn't ready.`);let{contentWidth:i,contentHeight:a,rect:o}=ga(e),s=n?.snap;if(!s||typeof s.toPng!=`function`)throw Error(`Iframes are only captured through snapdom(el).`);let c={...n,scale:1,clip:null,__pinned:!0},l=va(r,i,a),u;try{u=await s.toPng(r.documentElement,c)}finally{l()}u.style.display=`block`,u.style.width=`${i}px`,u.style.height=`${a}px`;let d=document.createElement(`div`);return t.nodeMap.set(d,e),X(e,d,t,n),d.style.overflow=`hidden`,d.style.display=`block`,d.style.width||(d.style.width=`${Math.round(o.width)}px`),d.style.height||(d.style.height=`${Math.round(o.height)}px`),d.appendChild(u),d}function ba(e){try{let t=e&&e.accentColor;if(t&&t!==`auto`&&t!==`none`)return t;let n=e&&e.color;if(n)return n}catch{}return`#0a6ed1`}function xa(e){let{width:t,height:n}=Z(e),r=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let a=i?parseFloat(i.width):NaN,o=i?parseFloat(i.height):NaN,s=Number.isFinite(a)&&a>0?a:t||r.width||128,c=Number.isFinite(o)&&o>0?o:n||r.height||16,l=Number.parseFloat(e.min)||0,u=Number.isFinite(Number.parseFloat(e.max))?Number.parseFloat(e.max):100,d=Number.parseFloat(e.value),f=u-l,p=f>0&&Number.isFinite(d)?Math.min(1,Math.max(0,(d-l)/f)):.5,m=`middle`;try{i&&i.verticalAlign&&(m=i.verticalAlign)}catch{}let h=document.createElement(`div`);h.setAttribute(`data-snapdom-input-replacement`,`range`),h.style.cssText=`display:inline-block;width:${s}px;height:${c}px;vertical-align:${m};flex-shrink:0;line-height:0;`;let g=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);g.setAttribute(`width`,String(s)),g.setAttribute(`height`,String(c)),g.setAttribute(`viewBox`,`0 0 ${s} ${c}`),g.style.cssText=`width:${s}px;height:${c}px;overflow:visible`,h.appendChild(g);function _(){let t=ba(i),n=!!e.disabled,r=Math.max(2,Math.min(4,c)),a=(c-r)/2,o=Math.max(10,Math.min(14,Math.max(c,10))),l=o/2,u=l+p*Math.max(0,s-o);g.innerHTML=``;let d=(e,t,n,i)=>{let o=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);o.setAttribute(`x`,String(e)),o.setAttribute(`y`,String(a)),o.setAttribute(`width`,String(Math.max(0,t))),o.setAttribute(`height`,String(r)),o.setAttribute(`rx`,String(r/2)),o.setAttribute(`fill`,n),i&&o.setAttribute(`fill-opacity`,i),g.appendChild(o)};d(0,s,`#808080`,`0.4`),d(0,u,t);let f=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`);f.setAttribute(`cx`,String(u)),f.setAttribute(`cy`,String(c/2)),f.setAttribute(`r`,String(l)),f.setAttribute(`fill`,t),g.appendChild(f),n&&g.setAttribute(`opacity`,`0.5`),h.style.setProperty(`width`,`${s}px`,`important`),h.style.setProperty(`height`,`${c}px`,`important`),h.style.setProperty(`min-width`,`${s}px`,`important`),h.style.setProperty(`min-height`,`${c}px`,`important`)}return _(),{el:h,applyVisual:_}}function Sa(e){let{width:t,height:n}=Z(e),r=e.getBoundingClientRect(),i;try{i=window.getComputedStyle(e)}catch{}let a=i?parseFloat(i.width):NaN,o=i?parseFloat(i.height):NaN,s=Math.round(t||r.width||0),c=Math.round(n||r.height||0),l=Number.isFinite(a)&&a>0?Math.round(a):Math.max(12,s||16),u=Number.isFinite(o)&&o>0?Math.round(o):Math.max(12,c||16),d=(e.type||`text`).toLowerCase()===`checkbox`,f=!!e.checked,p=!!e.indeterminate,m=Math.max(Math.min(l,u),12),h=Math.max(l,m),g=Math.max(u,m),_=`middle`;try{i&&i.verticalAlign&&(_=i.verticalAlign)}catch{}let v=document.createElement(`div`);v.setAttribute(`data-snapdom-input-replacement`,e.type||`checkbox`),v.style.cssText=`display:inline-block;width:${h}px;height:${g}px;vertical-align:${_};flex-shrink:0;line-height:0;`;let y=document.createElementNS(`http://www.w3.org/2000/svg`,`svg`);y.setAttribute(`width`,String(h)),y.setAttribute(`height`,String(g)),y.setAttribute(`viewBox`,`0 0 ${m} ${m}`),y.style.cssText=`width:${h}px;height:${g}px`,v.appendChild(y);function b(){let e=ba(i),t=m-2;if(y.innerHTML=``,d){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`);if(n.setAttribute(`x`,`1`),n.setAttribute(`y`,`1`),n.setAttribute(`width`,String(t)),n.setAttribute(`height`,String(t)),n.setAttribute(`rx`,`2`),n.setAttribute(`ry`,`2`),n.setAttribute(`fill`,f?e:`none`),n.setAttribute(`stroke`,e),n.setAttribute(`stroke-width`,`2`),y.appendChild(n),f){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`path`);e.setAttribute(`d`,`M 3 ${m/2} L ${m/2-1} ${m-1-2} L ${m-1-2} 3`),e.setAttribute(`stroke`,`white`),e.setAttribute(`stroke-width`,`2`),e.setAttribute(`fill`,`none`),e.setAttribute(`stroke-linecap`,`round`),e.setAttribute(`stroke-linejoin`,`round`),y.appendChild(e)}else if(p){let n=document.createElementNS(`http://www.w3.org/2000/svg`,`rect`),r=Math.max(6,t-4);n.setAttribute(`x`,String((m-r)/2)),n.setAttribute(`y`,String((m-2)/2)),n.setAttribute(`width`,String(r)),n.setAttribute(`height`,`2`),n.setAttribute(`fill`,e),n.setAttribute(`rx`,`1`),y.appendChild(n)}}else{let t=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`);if(t.setAttribute(`cx`,String(m/2)),t.setAttribute(`cy`,String(m/2)),t.setAttribute(`r`,String((m-2)/2)),t.setAttribute(`fill`,f?e:`none`),t.setAttribute(`stroke`,e),t.setAttribute(`stroke-width`,`2`),y.appendChild(t),f){let e=document.createElementNS(`http://www.w3.org/2000/svg`,`circle`),t=Math.max(2,(m-4)*.35);e.setAttribute(`cx`,String(m/2)),e.setAttribute(`cy`,String(m/2)),e.setAttribute(`r`,String(t)),e.setAttribute(`fill`,`white`),y.appendChild(e)}}v.style.setProperty(`width`,`${h}px`,`important`),v.style.setProperty(`height`,`${g}px`,`important`),v.style.setProperty(`min-width`,`${h}px`,`important`),v.style.setProperty(`min-height`,`${g}px`,`important`)}return b(),{el:v,applyVisual:b}}var Ca=new f(80);async function wa(e){if(p.resource?.has(e))return p.resource.get(e);if(Ca.has(e))return Ca.get(e);let t=(async()=>{let t=await L(e,{as:`dataURL`});if(!t.ok||typeof t.data!=`string`)throw Error(`Couldn't read ${e}`);return p.resource?.set(e,t.data),t.data})();Ca.set(e,t);try{let n=await t;return Ca.set(e,n),n}catch(t){throw Ca.delete(e),t}}var Ta=/\bblob:[^)"'\s]+/g;function Ea(e){return typeof e==`string`&&e.startsWith(`blob:`)}function Da(e){return(e||``).split(`,`).map(e=>e.trim()).filter(Boolean).map(e=>{let t=e.match(/^(\S+)(\s+.+)?$/);return t?{url:t[1],desc:t[2]||``}:null}).filter(Boolean)}function Oa(e){return e.map(e=>e.desc?`${e.url} ${e.desc.trim()}`:e.url).join(`, `)}function ka(e,t){let n=e.querySelectorAll?Array.from(e.querySelectorAll(t)):[];return e.matches?.(t)&&n.unshift(e),n}async function Aa(e,t=null){if(!e)return;let n=t,r=new Set,i=[],a=new Map,o=(e,t,n,o)=>{r.add(n),i.push(()=>{a.has(n)&&(e.setAttribute(t,a.get(n)),o?.())})},s=(e,t)=>{if(!e||!e.includes(`blob:`))return;let n=e.match(Ta)||[];if(n.length){for(let e of n)r.add(e);i.push(()=>{let n=e.replace(Ta,e=>a.get(e)||e);n!==e&&t(n)})}},c=ka(e,`img`);for(let e of c)try{let t=e.getAttribute(`src`)||e.currentSrc||``;Ea(t)&&o(e,`src`,t);let n=e.getAttribute(`srcset`);if(n&&n.includes(`blob:`)){let t=Da(n);for(let e of t)Ea(e.url)&&r.add(e.url);i.push(()=>{let n=!1;for(let e of t)a.has(e.url)&&(e.url=a.get(e.url),n=!0);n&&e.setAttribute(`srcset`,Oa(t))})}}catch(e){G(n,`Couldn't inline a blob: image.`,e)}let l=ka(e,`image`);for(let e of l)try{let t=`http://www.w3.org/1999/xlink`,n=e.getAttribute(`href`)||e.getAttributeNS?.(t,`href`);Ea(n)&&o(e,`href`,n,()=>e.removeAttributeNS?.(t,`href`))}catch(e){G(n,`Couldn't inline a blob: SVG image.`,e)}let u=ka(e,`[style*='blob:']`);for(let e of u)try{s(e.getAttribute(`style`),t=>e.setAttribute(`style`,t))}catch(e){G(n,`Couldn't inline blob: URLs in a style attribute.`,e)}let d=ka(e,`style`);for(let e of d)try{s(e.textContent||``,t=>{e.textContent=t})}catch(e){G(n,`Couldn't inline blob: URLs in a <style>.`,e)}for(let t of[`poster`]){let r=ka(e,`[${t}^='blob:']`);for(let e of r)try{let n=e.getAttribute(t);Ea(n)&&o(e,t,n)}catch(e){G(n,`Couldn't inline the blob: URL in ${t}.`,e)}}if(!r.size)return;let f=[...r],p=0;await Promise.all(Array.from({length:Math.min(4,f.length)},async()=>{for(;p<f.length;){let e=f[p++];try{a.set(e,await wa(e))}catch(e){G(n,`Couldn't read a blob: URL; kept it as is.`,e)}}}));for(let e of i)try{e()}catch(e){G(n,`Couldn't write an inlined blob: URL.`,e)}}var ja=[`font-family`,`font-size`,`font-style`,`font-weight`,`font-stretch`,`font-variant`,`font-feature-settings`,`font-variation-settings`,`font-kerning`,`letter-spacing`,`text-transform`],Ma=new Set([`text`,`search`,`email`,`url`,`tel`,`number`,`submit`,`reset`,`button`]),Na=/[^\s\uD800-\uDFFF]{2,}/;function Pa(e,t=document){let n=t.defaultView||window;if(!gt()||!t.body||!(n.visualViewport?.scale<1||n.screen.width<t.documentElement.clientWidth))return;let r=V(t.createElement(`div`));r.style.cssText=`position:absolute;left:0;top:0;width:0;height:0;overflow:hidden;visibility:hidden`;let i=[];for(let[a,o]of e){if(a.nodeType!==1||o.nodeType!==1)continue;let e=n.getComputedStyle(o),s=o.localName===`textarea`||o.localName===`input`&&Ma.has(o.type)?La(o,e,t):Ia(o,e.textAlign===`justify`||e.textAlignLast===`justify`);if(!s)continue;let c=o.getBoundingClientRect(),l=o.offsetWidth&&c.width?c.width/o.offsetWidth:1,u=t.createElement(`span`);u.style.whiteSpace=`pre`;for(let t of ja)u.style.setProperty(t,e.getPropertyValue(t));u.textContent=s.word,r.appendChild(u),i.push({clone:a,cs:e,span:u,live:s.distance/l,centers:s.centers,height:s.height})}if(i.length){t.body.appendChild(r);try{for(let{clone:e,cs:n,span:r,live:a,centers:o,height:s}of i){let i=r.firstChild,c=(parseFloat(n.letterSpacing)||0)*(o?i.length-1:i.length),l=s?t.createRange():null;l&&l.selectNodeContents(r);let u=s?l.getBoundingClientRect().height:o?Math.abs(Fa(i,i.length-1)-Fa(i,0)):r.getBoundingClientRect().width,d=(a-(s?0:c))/(u-(s?0:c));if(d>1.005&&Number.isFinite(d)){if(s){let e=[];for(let t of[!1,!0]){let i=parseFloat(n.fontSize),o=i*(d+1);for(let e=0;e<10;e++){let e=(i+o)/2;r.style.fontSize=`${e}px`;let n=l.getBoundingClientRect().height;(t?n>a:n>=a)?o=e:i=e}e.push((i+o)/2)}d=(e[0]+e[1])/2/parseFloat(n.fontSize)}e.style.setProperty(`font-size`,`${parseFloat(n.fontSize)*d}px`),n.lineHeight!==`normal`&&e.style.setProperty(`line-height`,`${parseFloat(n.lineHeight)*d}px`)}}}finally{r.remove()}}}function Fa(e,t){let n=e.ownerDocument.createRange();n.setStart(e,t),n.setEnd(e,t+1);let r=n.getBoundingClientRect();return r.left+r.width/2}function Ia(e,t=!1){for(let n=e.firstChild;n;n=n.nextSibling){if(n.nodeType!==3)continue;let r=/\S+/.exec(n.data);if(!r)continue;let i=e.ownerDocument.createRange();i.setStart(n,r.index),i.setEnd(n,r.index+r[0].length);let a=i.getClientRects();return a.length===1?{word:r[0],distance:t?a[0].height:a[0].width,centers:!1,height:t}:null}return null}function La(e,t,n){let r=Na.exec(e.value.split(`
|
|
7
|
+
`)[0]);if(!r||e.scrollLeft||e.scrollTop||!n.caretPositionFromPoint)return null;let i=e.getBoundingClientRect(),a=e.localName===`textarea`?i.top+(parseFloat(t.borderTopWidth)||0)+(parseFloat(t.paddingTop)||0)+3:i.top+i.height/2,o=t=>{let r=n.caretPositionFromPoint(t,a);return r&&r.offsetNode===e?r.offset:-1},s=i.width/16,c=e=>{let t=i.left;for(;t<=i.right&&o(t)<e;)t+=s;if(t>i.right)return NaN;let n=t-s;for(let r=0;r<16;r++){let r=(n+t)/2;o(r)>=e?t=r:n=r}return t},l=Math.abs(c(r.index+r[0].length)-c(r.index+1));return Number.isFinite(l)?{word:r[0],distance:l,centers:!0}:null}W();var Ra=new Set([`rgba(0, 0, 0, 0)`,`transparent`]),za=`Highlight`;function Ba(e){let t=(e.ownerDocument||document).getSelection?.();if(!t||t.isCollapsed||t.rangeCount===0)return null;let n=[];for(let r=0;r<t.rangeCount;r+=1){let i=t.getRangeAt(r);if(!i.collapsed)try{i.intersectsNode(e)&&n.push(i)}catch{}}return n.length?{ranges:n,styles:new Map}:null}function Va(e,t){if(t.styles.has(e))return t.styles.get(e);let n;try{let r=getComputedStyle(e);if(r.userSelect===`none`||r.webkitUserSelect===`none`||r.getPropertyValue(`-webkit-user-select`)===`none`)return t.styles.set(e,null),null;let i=getComputedStyle(e,`::selection`),a=[],o=i.backgroundColor,s=o&&!Ra.has(o)&&o!==r.backgroundColor;a.push(`background-color:${s?o:za}`),i.color&&i.color!==r.color&&a.push(`color:${i.color}`,`-webkit-text-fill-color:${i.color}`),i.textShadow&&i.textShadow!==r.textShadow&&a.push(`text-shadow:${i.textShadow}`),i.textDecorationLine&&i.textDecorationLine!==`none`&&i.textDecorationLine!==r.textDecorationLine&&a.push(`text-decoration:${i.textDecorationLine} ${i.textDecorationStyle||`solid`} ${i.textDecorationColor||`currentcolor`}`),n=a.join(`;`)}catch{n=`background-color:${za}`}return t.styles.set(e,n),n}function Ha(e,t){let n=e.data;if(!n)return null;let r=e.parentElement;if(!r)return null;let i=[];for(let r of t.ranges){let t=!1;try{t=r.intersectsNode(e)}catch{}if(!t)continue;let a=r.startContainer===e?r.startOffset:0,o=r.endContainer===e?r.endOffset:n.length;o>a&&i.push([a,o])}if(i.length===0)return null;let a=Va(r,t);if(!a)return null;i.sort((e,t)=>e[0]-t[0]);let o=e.ownerDocument||document,s=o.createDocumentFragment(),c=0;for(let[e,t]of i){e>c&&s.append(o.createTextNode(n.slice(c,e)));let r=o.createElement(`span`);r.setAttribute(`data-snapdom-selection`,``),r.setAttribute(`style`,`all:unset;${a}`),r.textContent=n.slice(e,t),s.append(r),c=t}return c<n.length&&s.append(o.createTextNode(n.slice(c))),s}var Ua=e=>Number.parseFloat(e)||0,Wa=[`font-family`,`font-size`,`font-weight`,`font-style`,`font-variant`,`font-stretch`,`letter-spacing`,`word-spacing`,`text-transform`,`text-indent`,`text-align`,`line-height`,`tab-size`,`direction`];function Ga(e,t){try{let n=getComputedStyle(e,`::selection`).backgroundColor;if(n&&!Ra.has(n)&&n!==t.backgroundColor)return n}catch{}return za}function Ka(e,t){let n=e.ownerDocument||document;if(n.activeElement!==e)return;let r=null,i=null;try{r=e.selectionStart,i=e.selectionEnd}catch{return}if(r==null||i==null||r===i)return;let a=e.value||``;if(e.localName===`input`&&e.type===`password`&&(a=`•`.repeat(a.length)),!a)return;let o=getComputedStyle(e),s=e.localName===`textarea`,c=Ua(o.paddingLeft),l=Ua(o.paddingTop),u=e.clientWidth-c-Ua(o.paddingRight),d=e.clientHeight-l-Ua(o.paddingBottom),f=n.createElement(`div`);f.style.cssText=`position:absolute;top:0;left:-99999px;visibility:hidden;margin:0;border:0;padding:0;box-sizing:content-box;`;for(let e of Wa)f.style.setProperty(e,o.getPropertyValue(e));s?(f.style.whiteSpace=`pre-wrap`,f.style.overflowWrap=`break-word`,f.style.width=`${Math.max(0,u)}px`):f.style.whiteSpace=`pre`;let p=n.createElement(`span`);p.textContent=a.slice(r,i),f.append(n.createTextNode(a.slice(0,r)),p,n.createTextNode(a.slice(i))),n.body.appendChild(f);let m=[];try{let t=f.getBoundingClientRect(),n=-e.scrollLeft,r=-e.scrollTop;if(!s){r+=Math.max(0,(d-t.height)/2);let e=o.direction===`rtl`,i=o.textAlign;i===`start`?i=e?`right`:`left`:i===`end`&&(i=e?`left`:`right`);let a=u-t.width;a>0&&(i===`right`?n+=a:i===`center`&&(n+=a/2))}for(let e of p.getClientRects())e.width<=0||e.height<=0||m.push({x:c+(e.left-t.left)+n,y:l+(e.top-t.top)+r,width:e.width,height:e.height})}finally{f.remove()}if(m.length===0)return;let h=Ga(e,o);t.__snapdomFieldSelection={images:m.map(()=>`linear-gradient(${h},${h})`),positions:m.map(e=>`${e.x}px ${e.y}px`),sizes:m.map(e=>`${e.width}px ${e.height}px`),repeats:m.map(()=>`no-repeat`),origins:m.map(()=>`padding-box`),clips:m.map(()=>`padding-box`),base:{image:o.backgroundImage,position:o.backgroundPosition,size:o.backgroundSize,repeat:o.backgroundRepeat,origin:o.backgroundOrigin,clip:o.backgroundClip}}}function qa(e){for(let t of e.keys()){let e=t.__snapdomFieldSelection;if(!e)continue;delete t.__snapdomFieldSelection;let{images:n,positions:r,sizes:i,repeats:a,origins:o,clips:s,base:c}=e,l=t.style.backgroundImage||c.image;l&&l!==`none`?(n.push(l),r.push(t.style.backgroundPosition||c.position),i.push(t.style.backgroundSize||c.size),a.push(t.style.backgroundRepeat||c.repeat),o.push(t.style.backgroundOrigin||c.origin),s.push(t.style.backgroundClip||c.clip)):(n.push(`linear-gradient(transparent,transparent)`),r.push(`0% 0%`),i.push(`auto`),a.push(`repeat`),o.push(c.origin||`padding-box`),s.push(c.clip||`border-box`)),t.style.backgroundImage=n.join(`,`),t.style.backgroundPosition=r.join(`,`),t.style.backgroundSize=i.join(`,`),t.style.backgroundRepeat=a.join(`,`),t.style.backgroundOrigin=o.join(`,`),t.style.backgroundClip=s.join(`,`)}}Le(),q();var Ja=[`transform`,`translate`,`rotate`,`scale`,`transform-origin`,`transform-box`],Ya={circle:[`cx`,`cy`,`r`,`vector-effect`],ellipse:[`cx`,`cy`,`rx`,`ry`,`vector-effect`],rect:[`x`,`y`,`width`,`height`,`rx`,`ry`,`vector-effect`],path:[`d`,`vector-effect`],line:[`vector-effect`],polyline:[`vector-effect`],polygon:[`vector-effect`],use:[`x`,`y`,`width`,`height`,`vector-effect`],g:[],clipPath:[]},Xa={r:`0px`,cx:`0px`,cy:`0px`,x:`0px`,y:`0px`,rx:`auto`,ry:`auto`,width:`auto`,height:`auto`,d:`none`,"vector-effect":`none`,transform:`none`,translate:`none`,rotate:`none`,scale:`none`,"transform-origin":`0px 0px`,"transform-box":`view-box`},Za=new Set([`transform`,`translate`,`rotate`,`scale`]),Qa=new WeakMap,$a=new Map;function eo(e){let t=e.localName,n=Ya[t];if(!n)return null;let r=Kr(e);if(r&&(r.size===0||!qr(e)))return null;let i=r?Qa.get(r):$a;i||Qa.set(r,i=new Map);let a=i.get(t);return a||(a=[...n,...Ja].filter(e=>!r||r.has(e)),i.set(t,a)),a.length?a:null}var to=/^-?(?:\d+\.?\d*|\.\d+)(?:e[+-]?\d+)?(?:px)?$/i;function no(e,t){let n=e.trim();if(!to.test(n)||!to.test(t))return!1;let r=parseFloat(n);return Math.abs(r-parseFloat(t))<=1e-4*Math.max(1,Math.abs(r))}function ro(e){let t=e.transform?.baseVal;if(!t?.numberOfItems)return null;let n=new DOMMatrix;for(let e=0;e<t.numberOfItems;e++){let r=t.getItem(e).matrix;n=n.multiply(new DOMMatrix([r.a,r.b,r.c,r.d,r.e,r.f]))}return n}function io(e,t){let n=ro(e),r=t===`none`?[1,0,0,1,0,0]:t.startsWith(`matrix(`)?t.slice(7,-1).split(`,`).map(Number):null;if(!r||r.length!==6)return!1;if(!n)return r.join()===`1,0,0,1,0,0`;let i=[n.a,n.b,n.c,n.d,n.e,n.f];for(let e=0;e<6;e++)if(Math.abs(i[e]-r[e])>1e-4*Math.max(1,Math.abs(i[e])))return!1;return!0}function ao(e,t,n,r){let i=!1;for(let a of r){if(!i&&(a===`transform-origin`||a===`transform-box`)&&!e.hasAttribute(`transform`))continue;let r=n.getPropertyValue(a);if(!r)continue;Za.has(a)&&r!==`none`&&(i=!0);let o=Za.has(a)&&a!==`transform`?null:e.getAttribute(a);if(o!=null){if(r===o||r===o+`px`||a===`d`||a===`transform`&&(r===`none`||io(e,r))||no(o,r))continue}else if(r===Xa[a])continue;t.style.setProperty(a,r)}}var oo=new Map,so=new Set([`IFRAME`]);function co(e,t){oo.set(String(e).toUpperCase(),t)}function lo(e){let t=H(e),n=t.display;if(n===`none`)return null;let r=/^(block|inline-block|flow-root|flex|inline-flex|grid|inline-grid|list-item)$/.test(n),i=e=>parseFloat(e)||0,a=(e,n,i,a,o)=>{if(!r||!e?.endsWith(`px`))return null;let s=parseFloat(e);if(!Number.isFinite(s)||s<0)return null;if(t.boxSizing===`border-box`)return s;let c=a-o-i;return s+n+i+(c>0&&s+n<o+c/2?c:0)},[o,s,c,l]=/scroll|auto/.test(t.overflow)?[e.offsetWidth,e.clientWidth,e.offsetHeight,e.clientHeight]:[0,0,0,0],u=a(t.width,i(t.paddingLeft)+i(t.paddingRight),i(t.borderLeftWidth)+i(t.borderRightWidth),o,s),d=a(t.height,i(t.paddingTop)+i(t.paddingBottom),i(t.borderTopWidth)+i(t.borderBottomWidth),c,l);if(u===null||d===null){let{width:t,height:n}=Z(e),r=t,i=n;if(u===null&&!r||d===null&&!i){let t=e.getBoundingClientRect();r||=t.width||0,i||=t.height||0}u??=r,d??=i}let f=document.createElement(`div`);return f.style.cssText=`display:${n===`inline`?`inline-block`:n};box-sizing:border-box;width:${u}px;height:${d}px;visibility:hidden;`,f}var uo=new Set([`style`,`option`,`optgroup`]),fo=200,po=new Set([`img`,`canvas`,`video`,`iframe`,`object`,`embed`]);function mo(e){let t=0;for(let n of e.matchAll(/-?[\d.]+px/g))t+=Math.abs(parseFloat(n[0]));return t}function ho(e){let t=e.filter;return!t||t===`none`?0:t.includes(`url(`)?fo:3*mo(t)}function go(e,t){if(!e)return 0;let n=t.filterReach||=new WeakMap,r=n.get(e);return r===void 0&&(r=ho(H(e))+(e===t.root?0:go(e.parentElement,t)),n.set(e,r)),r}function _o(e,t,n){try{if(!t||!e.matches(t))return!1}catch{return!0}let r=H(e,n).content;return!!r&&r!==`none`&&r!==`normal`}function vo(e,t,n){let{before:r,after:i}=Yr(e);if(r===null||i===null||_o(e,r,`::before`)||_o(e,i,`::after`)||t.borderImageSource&&t.borderImageSource!==`none`||t.webkitBoxReflect&&t.webkitBoxReflect!==`none`)return fo;let a=parseFloat(t.fontSize)||16,o=t.outlineStyle===`none`?0:mo(t.outlineWidth)+mo(t.outlineOffset);return Math.max(a*(t.display===`list-item`?3:1),o,mo(t.boxShadow),mo(t.textShadow),ho(t))+go(e.parentElement,n)}function yo(e,t,n,r){let i=r.rect,a=Math.max(i.left-n.right,n.left-i.right,i.top-n.bottom,n.top-i.bottom);if(a<=0)return!0;if(a>fo)return!1;let o=r.inkReach||=new WeakMap,s=o.get(e);return s===void 0&&o.set(e,s=vo(e,t||H(e),r)),a<=s}function bo(e,t){if(e===t.root)return!1;let n;try{n=e.getBoundingClientRect()}catch{return!1}if(n.width===0&&n.height===0)return!1;let r=H(e);if(r.display===`inline`&&!po.has((e.localName||``).toLowerCase()))return!1;let i=e.scrollWidth||0,a=e.scrollHeight||0,o={left:r.direction===`rtl`?Math.min(n.left,n.right-i):n.left,top:n.top,right:Math.max(n.right,n.left+i),bottom:Math.max(n.bottom,n.top+a)},s=r.writingMode||``;if((s.startsWith(`vertical`)||s.startsWith(`sideways`))&&(o.top=Math.min(n.top,n.bottom-a),o.left=Math.min(o.left,n.right-i)),yo(e,r,o,t))return!1;let c=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;c.nextNode();){let e=c.currentNode,n=e.getBoundingClientRect();if((n.width>0||n.height>0)&&yo(e,null,n,t))return!1}return!0}function xo(e,t,n){let r=e.cloneNode(!1);e.tagName===`IMG`&&(r.removeAttribute(`src`),r.removeAttribute(`srcset`),r.removeAttribute(`sizes`)),X(e,r,t,n);let{width:i,height:a}=Z(e);i>0&&(r.style.width=`${i}px`,r.style.minWidth=`${i}px`,r.style.maxWidth=`${i}px`),a>0&&(r.style.height=`${a}px`,r.style.minHeight=`${a}px`,r.style.maxHeight=`${a}px`),r.style.visibility=`hidden`;let o=e.parentElement?H(e.parentElement).display:``,s=H(e).position;if(!/flex|grid|table/.test(o)&&(s===`static`||s===`relative`)){let t=e=>{let t=H(e);return t.display!==`none`&&t.position!==`absolute`&&t.position!==`fixed`},n=e.getBoundingClientRect(),i=e.previousElementSibling;for(;i&&!t(i);)i=i.previousElementSibling;if(i){let e=n.top-i.getBoundingClientRect().bottom;e>=0&&(r.style.marginTop=`${e}px`)}let a=e.nextElementSibling;for(;a&&!t(a);)a=a.nextElementSibling;if(a){let e=a.getBoundingClientRect().top-n.bottom;e>=0&&(r.style.marginBottom=`${e}px`)}}return r.style.boxSizing=`border-box`,r}async function So(e,t,n){if(!e)throw Error(`[SnapDOM] The element cannot be null or undefined.`);t.slicer?.due()&&await t.slicer.pause();let r=new Set,i=null,a=null;if(e.nodeType===Node.ELEMENT_NODE){let r=(e.localName||e.tagName||``).toLowerCase(),i=Fe(e);if(i&&(e.id===`snapdom-sandbox`||e.hasAttribute(`data-snapdom-sandbox`))||e!==n.element&&i||Xe.has(r))return null;if(r===`foreignobject`&&e.parentElement?.closest?.(`foreignObject`))return G(t,`Skipped a nested <foreignObject>; it can't be captured.`),null;if(r===`source`&&e.parentElement?.localName===`picture`)return null}if(e.nodeType===Node.TEXT_NODE){if(t.selection){let n=Ha(e,t.selection);if(n)return n}return e.cloneNode(!0)}if(e.nodeType!==Node.ELEMENT_NODE)return e.cloneNode(!0);if(e.getAttribute(`data-capture`)===`exclude`){if(n.excludeMode===`hide`)return lo(e);if(n.excludeMode===`remove`)return null}if(n.exclude&&Array.isArray(n.exclude))for(let t of n.exclude)try{if(e.matches?.(t)){if(n.excludeMode===`hide`)return lo(e);if(n.excludeMode===`remove`)return null}}catch{G(n,`Invalid exclude selector "${t}"; ignored.`)}if(n.excludePredicates)for(let t of n.excludePredicates)try{if(t(e))return n.excludeMode===`remove`?null:lo(e)}catch(e){G(n,`Your exclude function threw; the element was kept.`,e)}if(typeof n.filter==`function`)try{if(!n.filter(e)){if(n.filterMode===`hide`)return lo(e);if(n.filterMode===`remove`)return null}}catch(e){G(n,`Your filter function threw; the element was kept.`,e)}if(e!==n.element&&!uo.has(e.localName)&&!T(e)&&H(e).display===`none`){let r=e.cloneNode(!1);e.tagName===`IMG`&&(r.removeAttribute(`src`),r.removeAttribute(`srcset`)),r.style.setProperty(`display`,`none`,`important`);for(let i of e.querySelectorAll(`style`)){let e=await So(i,t,n);e&&r.appendChild(e)}return r}if(t.clip&&bo(e,t.clip))return xo(e,t,n);if(n.__resolveNodeHooks)for(let r of n.__resolveNodeHooks){let i;try{i=await r(e,n)}catch(e){G(t,`A plugin's resolveNode hook threw; ignored it.`,e)}if(i===null)return null;if(i?.nodeType)return i.nodeType===Node.ELEMENT_NODE&&(t.nodeMap.set(i,e),X(e,i,t,n)),i}{let r=so.has(e.tagName)&&oo.get(e.tagName);if(r){let i=await r(e,t,n);if(i!==void 0)return i}}if(e.getAttribute(`data-capture`)===`placeholder`){let r=e.cloneNode(!1);t.nodeMap.set(r,e),X(e,r,t,n);let i=document.createElement(`div`);return i.textContent=e.getAttribute(`data-placeholder-text`)||``,i.style.cssText=`color:#666;font-size:12px;text-align:center;line-height:1.4;padding:0.5em;box-sizing:border-box;`,r.appendChild(i),r}{let r=!so.has(e.tagName)&&oo.get(e.tagName);if(r){let i=await r(e,t,n);if(i!==void 0)return i}}let o;try{if(o=e.cloneNode(!1),Xi(e,o),t.nodeMap.set(o,e),e.tagName===`IMG`){ua(e,o,n);try{let t=window.getComputedStyle(e),n=parseFloat(t.width),r=parseFloat(t.height);if(!(n>0)||!(r>0)){let i=Z(e),a=e=>parseFloat(t.getPropertyValue(e))||0,o=t.getPropertyValue(`box-sizing`)===`border-box`;n>0||(n=i.width-(o?0:a(`padding-left`)+a(`padding-right`)+a(`border-left-width`)+a(`border-right-width`))),r>0||(r=i.height-(o?0:a(`padding-top`)+a(`padding-bottom`)+a(`border-top-width`)+a(`border-bottom-width`)))}let i=Math.round((n||0)*1e3)/1e3,a=Math.round((r||0)*1e3)/1e3;i&&(o.dataset.snapdomWidth=String(i)),a&&(o.dataset.snapdomHeight=String(a))}catch(e){G(t,`Couldn't measure an image; kept its own size.`,e)}try{let t=e.getAttribute(`style`)||``,n=window.getComputedStyle(e),r=e=>{let r=t.match(RegExp(`${e}\\s*:\\s*([^;]+)`,`i`)),i=r?r[1].trim():n.getPropertyValue(e);return/%|auto/i.test(String(i||``))},i=parseFloat(o.dataset.snapdomWidth||`0`)||0,a=parseFloat(o.dataset.snapdomHeight||`0`)||0,s=r(`width`)||!(i>0),c=r(`height`)||!(a>0);s&&i>0&&(o.style.width=`${i}px`),c&&a>0&&(o.style.height=`${a}px`);let l=n.getPropertyValue(`object-fit`),u=n.getPropertyValue(`object-position`);l&&l!==`fill`?(o.style.objectFit=l,u&&(o.style.objectPosition=u)):(i>0&&(o.style.minWidth=`${i}px`),a>0&&(o.style.minHeight=`${a}px`))}catch(e){G(t,`Couldn't fix the size of an image.`,e)}}}catch(t){throw G(n,`Couldn't copy this element:`,[e,t]),t}let s=null;if(C(e,`textarea`)){let{width:t,height:n}=Z(e),r=t||e.getBoundingClientRect().width||0,i=n||e.getBoundingClientRect().height||0;r&&(o.style.width=`${r}px`),i&&(o.style.height=`${i}px`),(r||i)&&(o.style.boxSizing=`border-box`)}if(C(e,`input`)){let n=(e.type||`text`).toLowerCase();if((n===`checkbox`||n===`radio`)&&(gt()||e.indeterminate)){let{el:n,applyVisual:r}=Sa(e);t.nodeMap.set(n,e),s=r,o=n}else if(n===`range`&&(gt()||U())){let{el:n,applyVisual:r}=xa(e);t.nodeMap.set(n,e),s=r,o=n}else if(n===`color`&&U()){let t=o,n=e.value||`#000000`;s=()=>{t.style.setProperty(`background-color`,n,`important`),t.style.setProperty(`color`,`transparent`,`important`),t.style.setProperty(`-webkit-text-fill-color`,`transparent`,`important`),t.style.setProperty(`appearance`,`none`,`important`),t.style.setProperty(`-webkit-appearance`,`none`,`important`)},t.removeAttribute(`value`)}else if((n===`date`||n===`time`||n===`datetime-local`)&&(gt()||U())){o.setAttribute(`type`,`text`);let t=e.value;n===`date`&&e.valueAsDate&&(t=e.valueAsDate.toLocaleDateString(void 0,{timeZone:`UTC`})),o.value=t,o.setAttribute(`value`,t)}else{let t=x(e)?S(e.value):e.value;o.value=t,o.setAttribute(`value`,t),e.checked!==void 0&&(o.checked=e.checked,e.checked?o.setAttribute(`checked`,``):o.removeAttribute(`checked`),e.indeterminate&&(o.indeterminate=e.indeterminate))}}if((C(e,`input`)||C(e,`textarea`))&&!e.value&&e.placeholder)try{let n=window.getComputedStyle(e,`::placeholder`),r=n&&n.color;r&&r!==`rgba(0, 0, 0, 0)`&&(t.__usesPlaceholder=!0,o.setAttribute(`data-sd-ph`,``),o.style.setProperty(`--sd-ph`,r),o.style.setProperty(`--sd-ph-o`,n.opacity||`1`))}catch{}if(C(e,`select`)&&(i=new Set(Array.from(e.options).filter(e=>e.selected))),C(e,`textarea`)&&(a=e.value),C(e,`input`)||C(e,`textarea`)||C(e,`select`)){e.disabled&&o.setAttribute(`disabled`,``),e.required&&o.setAttribute(`required`,``),e.readOnly&&o.setAttribute(`readonly`,``);let t=e;t.min!==void 0&&t.min!==``&&o.setAttribute(`min`,t.min),t.max!==void 0&&t.max!==``&&o.setAttribute(`max`,t.max),t.pattern!==void 0&&t.pattern!==``&&o.setAttribute(`pattern`,t.pattern);let n=e.getAttribute(`aria-invalid`);n!==null&&o.setAttribute(`aria-invalid`,n)}if(Ji(e)||X(e,o,t,n),s&&s(),n.captureSelection&&(C(e,`input`)||C(e,`textarea`)))try{Ka(e,o)}catch(e){G(t,`Couldn't copy the selection of a text field.`,e)}if(T(e)&&!Ji(e)){let t=[`fill`,`stroke`,`stroke-width`,`stroke-dasharray`,`stroke-dashoffset`,`stroke-linecap`,`stroke-linejoin`,`stroke-miterlimit`,`opacity`,`fill-opacity`,`stroke-opacity`,`fill-rule`,`clip-rule`,`marker`,`marker-start`,`marker-mid`,`marker-end`,`visibility`,`display`,`color`];try{let n=window.getComputedStyle(e);for(let e of t){let t=n.getPropertyValue(e);t&&o.style.setProperty(e,t)}e.localName===`stop`&&(o.style.setProperty(`stop-color`,n.getPropertyValue(`stop-color`)),o.style.setProperty(`stop-opacity`,n.getPropertyValue(`stop-opacity`)));let r=eo(e);r&&ao(e,o,n,r)}catch{}}if(e.shadowRoot){xr(e.shadowRoot);try{let t=e.shadowRoot.querySelectorAll(`slot`);for(let e of t){let t=e.assignedNodes?.()||[];for(let e of t)r.add(e)}}catch{}let i=oa(t),a=`[data-sd="${i}"]`;t.shadowScopes||=new WeakMap,t.shadowScopes.set(e.shadowRoot,i);try{o.setAttribute(`data-sd`,i)}catch{}let s=ca(e.shadowRoot);!t.__shadowPseudo&&/::?(?:before|after|first-l|marker)|counter/.test(s)&&(t.__shadowPseudo=!0);let c=aa(s,a,i),l=pa(e,da(s),a);la(o,l+c,i);let u=document.createDocumentFragment(),d=await Promise.all(Array.from(e.shadowRoot.childNodes).map(e=>e.nodeType===Node.ELEMENT_NODE&&e.tagName===`STYLE`?null:So(e,t,n).catch(()=>null)));u.append(...d.filter(e=>!!e)),o.appendChild(u)}if(e.tagName===`SLOT`){let r=t.shadowScopes?.get(e.getRootNode()),i=e.assignedNodes?.()||[],a=i.length?e.assignedNodes?.({flatten:!0})||i:[],o=a.length?a:Array.from(e.childNodes),s=document.createDocumentFragment(),c=await Promise.all(o.map(e=>So(e,t,n).then(e=>(e&&i.length&&ma(e,r),e||null)).catch(()=>null)));return s.append(...c.filter(e=>!!e)),s}let c=t=>r.has(t)||e.shadowRoot&&!t.assignedSlot,l=await Promise.all(Array.from(e.childNodes).map(e=>c(e)?null:So(e,t,n).catch(()=>null)));if(o.append(...l.filter(e=>!!e)),i&&C(o,`select`)){let e=!1;for(let n of o.options){let r=i.has(t.nodeMap.get(n));n.selected=r,r?n.setAttribute(`selected`,``):n.removeAttribute(`selected`),e||=r}if(!e&&!o.multiple){let e=o.ownerDocument.createElement(`option`);e.hidden=!0,e.style.setProperty(`display`,`none`,`important`),e.setAttribute(`selected`,``),e.value=``,o.appendChild(e)}}return a!==null&&C(o,`textarea`)&&(o.textContent=a),o}async function Co(e,t,n){let r=!1;try{r=!!(e.contentDocument||e.contentWindow?.document)}catch(e){G(t,`Couldn't tell if an iframe is same-origin; treated it as cross-origin.`,e)}if(r)try{return await ya(e,t,n)}catch(e){K(n.__session,`iframe-failed`,`same-origin iframe failed to rasterize`,e),G(n,`Couldn't capture an iframe, so it was left out.`,e)}if(r||(K(n.__session,`iframe-cross-origin`,`cross-origin iframe replaced by ${n.placeholders?`a placeholder`:`a spacer`}`,e),G(n,n.placeholders?`Can't capture a cross-origin iframe; showing a placeholder. Set placeholders: false to hide it.`:`Can't capture a cross-origin iframe; left it out.`,e)),n.placeholders){let{width:r,height:i}=Z(e),a=document.createElement(`div`);return a.style.cssText=`width:${r}px;height:${i}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;`,X(e,a,t,n),a}{let{width:r,height:i}=Z(e),a=document.createElement(`div`);return a.style.cssText=`display:inline-block;width:${r}px;height:${i}px;visibility:hidden;`,X(e,a,t,n),a}}function wo(e){try{let t=Math.max(1,Math.min(32,e.width)),n=Math.max(1,Math.min(32,e.height)),r=document.createElement(`canvas`);r.width=t,r.height=n;let i=r.getContext(`2d`,{willReadFrequently:!0});if(!i)return!1;i.drawImage(e,0,0,t,n);let a=i.getImageData(0,0,t,n).data;for(let e=3;e<a.length;e+=4)if(a[e]!==0)return!1;return!0}catch{return!1}}var To=.95;function Eo(e,t,n){try{let r=e.getImageData(0,0,t,n).data;for(let e=3;e<r.length;e+=4)if(r[e]!==255)return!1;return!0}catch{return!1}}function Do(e){try{let t=e.getContext(`webgl2`)||e.getContext(`webgl`);return!!t&&!t.getContextAttributes()?.preserveDrawingBuffer}catch{return!1}}async function Oo(e,t,n){let r=``;try{let t=wo(e);t?(await pt(),t=wo(e)):Do(e)&&await pt();let n=null;if(!t){n=e.getContext(`2d`,{willReadFrequently:!0});try{n&&n.getImageData(0,0,1,1)}catch{}U()&&await pt()}if(r=e.toDataURL(`image/png`),!r||r===`data:,`){try{n&&n.getImageData(0,0,1,1)}catch{}if(await pt(),r=e.toDataURL(`image/png`),!r||r===`data:,`){let t=document.createElement(`canvas`);t.width=e.width,t.height=e.height;let n=t.getContext(`2d`);n&&(n.drawImage(e,0,0),r=t.toDataURL(`image/png`))}}}catch(e){G(t,`Couldn't read the pixels of a canvas; used its fallback content.`,e)}n&&n.debug&&r&&wo(e)&&G(t,`Empty canvas; capture after its first frame`,e);let i=document.createElement(`img`);try{i.decoding=`sync`,i.loading=`eager`}catch(e){G(t,`Couldn't set image loading hints.`,e)}r&&(i.src=r),i.width=e.width,i.height=e.height;let{width:a,height:o}=Z(e);return a>0&&(i.style.width=`${a}px`),o>0&&(i.style.height=`${o}px`),t.nodeMap.set(i,e),X(e,i,t,n),i}async function ko(e,t,n){let r=``,i=e.poster&&e.paused&&!e.currentTime&&!e.played.length,a=document.createElement(`img`);try{a.decoding=`sync`,a.loading=`eager`}catch{}if(!i)try{let t=document.createElement(`canvas`);t.width=e.videoWidth||e.offsetWidth||320,t.height=e.videoHeight||e.offsetHeight||240;let n=t.getContext(`2d`);n&&(n.drawImage(e,0,0,t.width,t.height),r=t.toDataURL(Eo(n,t.width,t.height)?`image/jpeg`:`image/png`,To),(!r||r===`data:,`)&&(r=``))}catch(e){G(t,`Couldn't capture a video frame; used its poster.`,e)}r?a.src=r:e.poster&&(a.src=e.poster),a.width=e.videoWidth||e.offsetWidth||0,a.height=e.videoHeight||e.offsetHeight||0;let{width:o,height:s}=Z(e);return o>0&&(a.style.width=`${o}px`),s>0&&(a.style.height=`${s}px`),a.style.objectFit=`contain`,t.nodeMap.set(a,e),X(e,a,t,n),a}async function Ao(e,t,n){if(!e.controls)return;let{width:r,height:i}=Z(e),a=Math.round(r||e.offsetWidth||300),o=Math.round(i||e.offsetHeight||54),s=o/2,c=Math.max(4,o*.16),l=o*.34,u=a-o*.34,d=l+c+o*.55,f=Math.max(0,u-o*.7-d),p=Math.max(9,Math.round(o*.24)),m=`<svg xmlns="http://www.w3.org/2000/svg" width="${a}" height="${o}" viewBox="0 0 ${a} ${o}"><rect width="${a}" height="${o}" rx="${Math.min(o/2,10)}" fill="#f1f3f4"/><path d="M ${l} ${s-c} L ${l+c} ${s} L ${l} ${s+c} Z" fill="#5f6368"/><rect x="${d}" y="${s-1.5}" width="${f}" height="3" rx="1.5" fill="#bdc1c6"/><circle cx="${d}" cy="${s}" r="${Math.max(3,o*.09)}" fill="#5f6368"/><text x="${u}" y="${s}" fill="#5f6368" font-family="sans-serif" font-size="${p}" text-anchor="end" dominant-baseline="central">0:00</text></svg>`,h=document.createElement(`img`);try{h.decoding=`sync`,h.loading=`eager`}catch{}return h.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(m)}`,h.width=a,h.height=o,h.style.width=`${a}px`,h.style.height=`${o}px`,t.nodeMap.set(h,e),X(e,h,t,n),h}async function jo(e,t,n){let r=e.getAttribute(`data`)||e.getAttribute(`src`)||``,i=(e.getAttribute(`type`)||``).toLowerCase(),a=/^image\//.test(i)||/\.(png|jpe?g|gif|webp|avif|bmp|ico|svg)(\?|#|$)/i.test(r);if(r&&a){let i=document.createElement(`img`);try{i.decoding=`sync`,i.loading=`eager`}catch{}i.src=r;let{width:a,height:o}=Z(e);return a>0&&(i.style.width=`${a}px`),o>0&&(i.style.height=`${o}px`),t.nodeMap.set(i,e),X(e,i,t,n),i}let o=null;try{o=e.contentDocument}catch{}if(o)try{let r=await ya(e,t,n);if(r)return r}catch{}r&&(K(n.__session,`embed-fallback`,`<${e.localName}> not capturable, using its fallback content: ${r}`),G(n,`Couldn't capture <${e.localName}>${i?` (${i})`:``}; showing its fallback content.`))}co(`IFRAME`,Co),co(`CANVAS`,Oo),co(`VIDEO`,ko),co(`AUDIO`,Ao),co(`OBJECT`,jo),co(`EMBED`,jo),q(),J(),N(),ft(),m(),Le(),q();var Mo=[/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],No=Object.assign({materialIconsFilled:`https://fonts.gstatic.com/s/materialicons/v48/flUhRq6tzZclQEJ-Vdg-IuiaDsNcIhQ8tQ.woff2`,materialIconsOutlined:`https://fonts.gstatic.com/s/materialiconsoutlined/v110/gok-H7zzDkdnRel8-DQ6KAXJ69wP1tGnf4ZGhUcel5euIg.woff2`,materialIconsRound:`https://fonts.gstatic.com/s/materialiconsround/v109/LDItaoyNOAY6Uewc665JcIzCKsKc_M9flwmPq_HTTw.woff2`,materialIconsSharp:`https://fonts.gstatic.com/s/materialiconssharp/v110/oPWQ_lt5nv4pWNJpghLP75WiFR4kLh3kvmvRImcycg.woff2`},typeof window<`u`&&window.__SNAPDOM_ICON_FONTS__||{});function Po(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Fo(e,t){let n=Array.isArray(e)?e:e?[e]:[],r=[];for(let e of n)e instanceof RegExp?r.push(e):typeof e==`string`?r.push(new RegExp(Po(e),`i`)):G(t,`Ignored an iconFonts entry: use a string or a RegExp.`,e);return r}function Io(e,t){let n=typeof e==`string`?e:``;for(let e of Mo)if(e.test(n))return!0;if(t){for(let e of t)if(e instanceof RegExp&&e.test(n))return!0}return!!(/icon/i.test(n)||/glyph/i.test(n)||/symbols/i.test(n)||/feather/i.test(n)||/fontawesome/i.test(n))}function Lo(e,t){if(typeof e!=`string`||!e)return!1;let n;try{n=new URL(e,typeof location<`u`?location.href:void 0)}catch{return Io(e,t)}let r=n.searchParams.getAll(`family`).flatMap(e=>e.split(`|`)).map(e=>e.split(`:`)[0].trim()).filter(Boolean);return r.length?r.every(e=>Io(e,t)):Io(e,t)}function Ro(e=``){let t=String(e).toLowerCase();return/\bmaterial\s*icons\b/.test(t)||/\bmaterial\s*symbols\b/.test(t)}var zo=new Map;function Bo(e=``){let t=Object.create(null),n=String(e||``),r=/['"]?\s*([A-Za-z]{3,4})\s*['"]?\s*([+-]?\d+(?:\.\d+)?)\s*/g,i;for(;i=r.exec(n);)t[i[1].toUpperCase()]=Number(i[2]);return t}async function Vo(e,t,n){let r=String(e||``),i=r.toLowerCase(),a=String(t||``).toLowerCase();if(/\bmaterial\s*icons\b/.test(i)&&!/\bsymbols\b/.test(i)||!/\bmaterial\s*symbols\b/.test(i))return{familyForMeasure:r,familyForCanvas:r};let o=n&&(n.FILL??n.fill),s=`outlined`;/\brounded\b/.test(a)||/\bround\b/.test(a)?s=`rounded`:/\bsharp\b/.test(a)?s=`sharp`:/\boutlined\b/.test(a)&&(s=`outlined`);let c=o===1,l=null;if(c&&(s===`outlined`&&No.materialIconsFilled?l={url:No.materialIconsFilled,alias:`snapdom-mi-filled`}:s===`rounded`&&No.materialIconsRound?l={url:No.materialIconsRound,alias:`snapdom-mi-round`}:s===`sharp`&&No.materialIconsSharp&&(l={url:No.materialIconsSharp,alias:`snapdom-mi-sharp`})),!l)return{familyForMeasure:r,familyForCanvas:r};if(!zo.has(l.alias))try{let e=new FontFace(l.alias,`url(${l.url})`,{style:`normal`,weight:`400`});await e.load(),document.fonts.add(e),zo.set(l.alias,!0)}catch{return zo.set(l.alias,!1),{familyForMeasure:r,familyForCanvas:r}}if(zo.get(l.alias)===!1)return{familyForMeasure:r,familyForCanvas:r};let u=`"${l.alias}"`;return{familyForMeasure:u,familyForCanvas:u}}async function Ho(e=`Material Icons`,t=24){try{await Promise.all([document.fonts.load(`400 ${t}px "${String(e).replace(/["']/g,``)}"`),document.fonts.ready])}catch{}}function Uo(e){let t=e.getPropertyValue(`-webkit-text-fill-color`)?.trim()||``,n=/^transparent$/i.test(t)||/rgba?\(\s*0\s*,\s*0\s*,\s*0\s*,\s*0\s*\)/i.test(t);if(t&&!n&&t.toLowerCase()!==`currentcolor`)return t;let r=e.color?.trim();return r&&r!==`inherit`?r:`#000`}async function Wo(e,{family:t=`Material Icons`,weight:n=`normal`,fontSize:r=32,color:i=`#000`,variation:a=``,className:o=``}={}){let s=String(t||``).replace(/^['"]+|['"]+$/g,``),c=window.devicePixelRatio||1,{familyForMeasure:l,familyForCanvas:u}=await Vo(s,o,Bo(a));await Ho(u.replace(/^["']+|["']+$/g,``),r);let d=document.createElement(`span`);V(d),d.textContent=e,d.style.position=`absolute`,d.style.visibility=`hidden`,d.style.left=`-99999px`,d.style.whiteSpace=`nowrap`,d.style.fontFamily=l,d.style.fontWeight=String(n||`normal`),d.style.fontSize=`${r}px`,d.style.lineHeight=`1`,d.style.margin=`0`,d.style.padding=`0`,d.style.fontFeatureSettings=`'liga' 1`,d.style.fontVariantLigatures=`normal`,d.style.color=i,document.body.appendChild(d);let f=d.getBoundingClientRect(),p=Math.max(1,Math.ceil(f.width)),m=Math.max(1,Math.ceil(f.height));document.body.removeChild(d);let h=document.createElement(`canvas`);h.width=p*c,h.height=m*c;let g=h.getContext(`2d`);g.scale(c,c),g.font=`${n?`${n} `:``}${r}px ${u}`,g.textAlign=`left`,g.textBaseline=`top`,g.fillStyle=i;try{g.fontKerning=`normal`}catch{}return g.fillText(e,0,0),{dataUrl:h.toDataURL(),width:p,height:m}}async function Go(e,t,n=new Map){if(e?.nodeType!==1)return 0;let r=`.material-icons, [class*="material-symbols"]`,i=Array.from(e.querySelectorAll(r)).filter(e=>e&&e.textContent&&e.textContent.trim());if(e.matches?.(r)&&e.textContent&&e.textContent.trim()&&i.unshift(e),i.length===0)return 0;let a=t?.nodeType===1?Array.from(t.querySelectorAll(r)).filter(e=>e&&e.textContent&&e.textContent.trim()):[];t?.nodeType===1&&t.matches?.(r)&&t.textContent&&t.textContent.trim()&&a.unshift(t);let o=0;for(let e=0;e<i.length;e++){let t=i[e],r=n&&n.get(t)||a[e]||null;try{let e=getComputedStyle(r||t),n=e.fontFamily||`Material Icons`;if(!Ro(n))continue;let i=(r||t).textContent.trim();if(!i)continue;let a=parseInt(e.fontSize,10)||24,{dataUrl:s,width:c,height:l}=await Wo(i,{family:n,weight:e.fontWeight&&e.fontWeight!==`normal`?e.fontWeight:`normal`,fontSize:a,color:Uo(e),variation:e.fontVariationSettings&&e.fontVariationSettings!==`normal`?e.fontVariationSettings:``,className:(r||t).className||``});t.textContent=``;let u=t.ownerDocument.createElement(`img`);u.src=s,u.alt=i,u.style.height=`${a}px`,u.style.width=`${Math.max(1,Math.round(c/l*a))}px`,u.style.objectFit=`contain`,u.style.verticalAlign=getComputedStyle(t).verticalAlign||`baseline`,t.appendChild(u),o++}catch{}}return o}var Ko=/(?:^|;)font-family:([^;]*)/,qo=new WeakSet;function Jo(e,t,n,r){if(!t?.size)return 0;let i=new Map,a=new Map,o=0;for(let s of e){let e=t.get(s);if(!e||s.nodeType!==1||qo.has(s.firstChild))continue;let c=i.get(e);if(c===void 0){let t=Ko.exec(e)?.[1];i.set(e,c=!!t&&Io(t,r))}if(!c)continue;let l=s.dataset?.snapdomPseudo,u=l?n.get(s.parentNode):n.get(s);if(u?.nodeType!==1)continue;let d=getComputedStyle(u,l||null);if(d.display!==`inline`&&d.display!==`inline-block`)continue;let f=`${d.fontFamily}|${d.fontSize}|${d.fontWeight}|${d.fontStyle}|${d.fontStretch}|${d.lineHeight}`,p=a.get(f);if(p===void 0&&a.set(f,p=Xo(u.ownerDocument,d)),!p)continue;let m=s.ownerDocument.createElement(`span`);qo.add(m),m.style.cssText=`display:inline-block;width:0;height:${p.height}px;vertical-align:${-p.descent}px`,s.style.lineHeight=`0`,s.insertBefore(m,s.firstChild),m.nextSibling===null&&Yo(s,u),o++}return o}function Yo(e,t){let n=getComputedStyle(t.parentElement||t).whiteSpace;if(n!==`normal`&&n!==`nowrap`&&n!==`pre-line`)return;let r=e.previousSibling,i=e.nextSibling;r?.nodeType!==3||i?.nodeType!==3||/[ \t\n]$/.test(r.data)&&(i.data=i.data.replace(/^[ \t\n]+/,``))}function Xo(e,t){let n=e.createElement(`div`);V(n),n.style.cssText=`position:absolute;left:-9999px;top:0;visibility:hidden;white-space:nowrap;margin:0;padding:0;border:0;font-family:${t.fontFamily};font-size:${t.fontSize};font-weight:${t.fontWeight};font-style:${t.fontStyle};font-stretch:${t.fontStretch};line-height:${t.lineHeight}`;let r=e.createElement(`span`);r.style.cssText=`display:inline-block;width:0;height:0;vertical-align:baseline`,n.appendChild(r),(e.body||e.documentElement).appendChild(n);try{let e=n.getBoundingClientRect().height,t=r.getBoundingClientRect().top-n.getBoundingClientRect().top;return e>0?{height:e,descent:e-t}:null}finally{n.remove()}}z(),W(),Le(),q();async function Zo(e,t,n,r=32,i=`#000`,a=`normal`){t=t.replace(/^['"]+|['"]+$/g,``);let o=window.devicePixelRatio||1;try{await document.fonts.ready}catch{}let s=document.createElement(`span`);V(s),s.textContent=e,s.style.position=`absolute`,s.style.visibility=`hidden`,s.style.fontFamily=`"${t}"`,s.style.fontWeight=n||`normal`,s.style.fontStyle=a||`normal`,s.style.fontSize=`${r}px`,s.style.lineHeight=`1`,s.style.whiteSpace=`nowrap`,s.style.padding=`0`,s.style.margin=`0`,document.body.appendChild(s);let c=s.getBoundingClientRect(),l=Math.ceil(c.width),u=Math.ceil(c.height);document.body.removeChild(s);let d=document.createElement(`canvas`);d.width=Math.max(1,l*o),d.height=Math.max(1,u*o);let f=d.getContext(`2d`);f.scale(o,o),f.font=`${a||`normal`} ${n||`normal`} ${r}px "${t}"`,f.textAlign=`left`,f.textBaseline=`top`,f.fillStyle=i,f.fillText(e,0,0);let p=f.measureText(e).actualBoundingBoxAscent;f.textBaseline=`alphabetic`;let m=u-(f.measureText(e).actualBoundingBoxAscent-p);return{dataUrl:d.toDataURL(),width:l,height:u,advance:c.width,descent:Number.isFinite(m)?m:0}}var Qo=new Set([`serif`,`sans-serif`,`monospace`,`cursive`,`fantasy`,`system-ui`,`emoji`,`math`,`fangsong`,`ui-serif`,`ui-sans-serif`,`ui-monospace`,`ui-rounded`]),$o=[`katex`,`mathjax`,`mathml`];function es(e){if(!e)return``;for(let t of e.split(`,`)){let e=t.trim().replace(/^['"]+|['"]+$/g,``);if(e&&!Qo.has(e.toLowerCase()))return e}return``}function ts(e){if(!e)return[];let t=[];for(let n of e.split(`,`)){let e=n.trim().replace(/^['"]+|['"]+$/g,``);e&&(Qo.has(e.toLowerCase())||t.push(e))}return t}function ns(e){let t=String(e??`400`).trim().toLowerCase();if(t===`normal`)return 400;if(t===`bold`)return 700;let n=parseInt(t,10);return Number.isFinite(n)?Math.min(900,Math.max(100,n)):400}function rs(e){let t=String(e??`normal`).trim().toLowerCase();return t.startsWith(`italic`)?`italic`:t.startsWith(`oblique`)?`oblique`:`normal`}function is(e){let t=String(e??`100%`).match(/(\d+(?:\.\d+)?)\s*%/);return t?Math.max(50,Math.min(200,parseFloat(t[1]))):100}function as(e){let t=String(e||`400`).trim(),n=t.match(/^(\d{2,3})\s+(\d{2,3})$/);if(n){let e=ns(n[1]),t=ns(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=ns(t);return{min:r,max:r}}function os(e){let t=String(e||`normal`).trim().toLowerCase();return t===`italic`?{kind:`italic`}:t.startsWith(`oblique`)?{kind:`oblique`}:{kind:`normal`}}function ss(e){let t=String(e||`100%`).trim(),n=t.match(/(\d+(?:\.\d+)?)\s*%\s+(\d+(?:\.\d+)?)\s*%/);if(n){let e=parseFloat(n[1]),t=parseFloat(n[2]);return{min:Math.min(e,t),max:Math.max(e,t)}}let r=t.match(/(\d+(?:\.\d+)?)\s*%/),i=r?parseFloat(r[1]):100;return{min:i,max:i}}function cs(e){return!e||typeof e!=`string`?``:e.replace(/\s+(variable|vf|v[0-9]+)$/i,``).trim().toLowerCase().replace(/\s+/g,`-`)}function ls(e,t,n=[]){if(!e)return!1;try{let r=new URL(e,location.href);if(r.origin===location.origin)return!0;let i=r.host.toLowerCase();if([`fonts.googleapis.com`,`fonts.gstatic.com`,`use.typekit.net`,`p.typekit.net`,`kit.fontawesome.com`,`use.fontawesome.com`,`cdn.jsdelivr.net`,`unpkg.com`,`cdnjs.cloudflare.com`,`esm.sh`].some(e=>i.endsWith(e))||n.some(e=>i===e.toLowerCase()||i.endsWith(`.`+e.toLowerCase())))return!0;let a=(r.pathname+r.search).toLowerCase();if(/\bfont(s)?\b/.test(a)||/\.woff2?(\b|$)/.test(a)||$o.some(e=>a.includes(e)))return!0;for(let e of t){let t=e.toLowerCase().replace(/\s+/g,`+`),n=e.toLowerCase().replace(/\s+/g,`-`),r=cs(e);if(a.includes(t)||a.includes(n)||r&&a.includes(r))return!0}return!1}catch{return!1}}var us=``;function ds(e){return String(e).split(us)[0]}function fs(e){let t=new Set;for(let n of e||[]){let e=ds(n).trim();e&&t.add(e)}return t}function ps(e,t){return e&&e.replace(/url\(\s*(['"]?)([^)'"]+)\1\s*\)/g,(e,n,r)=>{let i=(r||``).trim();if(!i||/^data:|^blob:|^https?:|^file:|^about:/i.test(i))return e;let a=i;try{a=new URL(i,t||location.href).href}catch{}return`url("${a}")`})}var ms=/@import\s+(?:url\(\s*(['"]?)([^)"']+)\1\s*\)|(['"])([^"']+)\3)([^;]*);/g,hs=4;async function gs(e,t,n,r){if(!e)return e;let i=new Set;function a(e,t){try{return new URL(e,t||location.href).href}catch{return e}}async function o(e,t,s=0){if(s>hs)return G({debug:r},`Too many nested @import rules in ${t}; stopped at ${hs} levels.`),e;let c=``,l=0,u,d=new RegExp(ms.source,`g`);for(;u=d.exec(e);){c+=e.slice(l,u.index),l=d.lastIndex;let f=a((u[2]||u[4]||``).trim(),t);if(i.has(f)){G({debug:r},`Skipped an @import that loops back: ${f}`);continue}i.add(f);let p=``;try{let e=await L(f,{as:`text`,useProxy:n});e.ok&&typeof e.data==`string`&&(p=e.data)}catch{}p?(p=ps(p,f),p=await o(p,f,s+1),c+=`
|
|
8
|
+
/* inlined: ${f} */
|
|
9
|
+
${p}
|
|
10
|
+
`):c+=u[0]}return c+=e.slice(l),c}let s=ps(e,t||location.href);return s=await o(s,t||location.href,0),s}var _s=/url\((["']?)([^"')]+)\1\)/g,vs=/@font-face[^{}]*\{[^}]*\}/g;function ys(e,t,n=``){return(e.match(RegExp(`${t}\\s*:\\s*([^;}]+)[;}]`,`i`))?.[1]||n).trim()}function bs(e){if(!e)return[];let t=[],n=e.split(`,`).map(e=>e.trim()).filter(Boolean);for(let e of n){let n=e.match(/^U\+([0-9A-Fa-f?]+)(?:-([0-9A-Fa-f?]+))?$/);if(!n)continue;let r=n[1],i=n[2],a=e=>e.includes(`?`)?[parseInt(e.replace(/\?/g,`0`),16),parseInt(e.replace(/\?/g,`F`),16)]:parseInt(e,16);if(i){let e=a(r),n=a(i),o=Array.isArray(e)?e[0]:e,s=Array.isArray(n)?n[1]:n;t.push([Math.min(o,s),Math.max(o,s)])}else{let e=a(r);Array.isArray(e)?t.push([e[0],e[1]]):t.push([e,e])}}return t}function xs(e,t){if(!t.length||!e||e.size===0)return!0;for(let n of e)for(let[e,r]of t)if(n>=e&&n<=r)return!0;return!1}function Ss(e,t){let n=[];if(!e)return n;for(let r of e.matchAll(_s)){let e=(r[2]||``).trim();if(e&&!e.startsWith(`data:`)){if(!/^https?:/i.test(e))try{e=new URL(e,t||location.href).href}catch{}n.push(e)}}return n}async function Cs(e,t,n=``,r=!1){let i=e;for(let a of e.matchAll(_s)){let e=h(a[0]);if(!e)continue;let o=e;if(!o.startsWith(`http`)&&!o.startsWith(`data:`))try{o=new URL(o,t||location.href).href}catch{}if(p.resource?.has(o)){i=i.replace(a[0],`url(${p.resource.get(o)})`);continue}try{let e=await L(o,{as:`dataURL`,useProxy:n});if(e.ok&&typeof e.data==`string`){let t=e.data;p.resource?.set(o,t),i=i.replace(a[0],`url(${t})`)}}catch{G({debug:r},`Couldn't load font file:`,o)}}return i}function ws(e){if(!e.length)return null;let t=(t,n)=>e.some(([e,r])=>!(r<t||e>n)),n=t(0,255)||t(305,305),r=t(256,591)||t(7680,7935),i=t(880,1023),a=t(1024,1279);return t(7840,7929)||t(258,259)||t(416,417)||t(431,432)?`vietnamese`:a?`cyrillic`:i?`greek`:r?`latin-ext`:n?`latin`:null}function Ts(e={}){let t=new Set((e.families||[]).map(e=>String(e).toLowerCase())),n=new Set((e.domains||[]).map(e=>String(e).toLowerCase())),r=new Set((e.subsets||[]).map(e=>String(e).toLowerCase()));return(e,i)=>{if(t.size&&t.has(e.family.toLowerCase()))return!0;if(n.size)for(let t of e.srcUrls)try{if(n.has(new URL(t).host.toLowerCase()))return!0}catch{}if(r.size){let e=ws(i);if(e&&r.has(e))return!0}return!1}}function Es(e){if(!e)return e;let t=/@font-face[^{}]*\{[^}]*\}/gi,n=new Set,r=[];for(let i of e.match(t)||[]){let e=es(ys(i,`font-family`)),t=ys(i,`font-weight`,`400`),a=ys(i,`font-style`,`normal`),o=ys(i,`font-stretch`,`100%`),s=ys(i,`unicode-range`),c=ys(i,`src`),l=Ss(c,location.href),u=l.length?l.map(e=>String(e).toLowerCase()).sort().join(`|`):c.toLowerCase(),d=[String(e||``).toLowerCase(),t,a,o,s.toLowerCase(),u].join(`|`);n.has(d)||(n.add(d),r.push(i))}if(r.length===0)return e;let i=0;return e.replace(t,()=>r[i++]||``)}var Ds=new WeakMap,Os=0;function ks(e){let t=Ds.get(e);return t===void 0&&(t=Os++,Ds.set(e,t)),t}function As(e,t,n,r,i,a,o,s,c){let l=Array.from(e||[]).sort().join(`|`),u=0,d=0;for(let e of o||[]){let t=Math.imul(e,2654435761);t^=t>>>15,t=Math.imul(t,2246822507),t^=t>>>13,u=u+t|0,d++}let f=t?JSON.stringify({families:(t.families||[]).map(e=>String(e).toLowerCase()).sort(),domains:(t.domains||[]).map(e=>String(e).toLowerCase()).sort(),subsets:(t.subsets||[]).map(e=>String(e).toLowerCase()).sort()}):``,p=(n||[]).map(e=>`${(e.family||``).toLowerCase()}::${e.weight||`normal`}::${e.style||`normal`}::${e.stretchPct??100}::${e.src||``}`).sort().join(`|`),m=r||``,h=(i||[]).map(e=>String(e).toLowerCase()).sort().join(`|`),g=ks(a||document),_=(s||[]).map(e=>String(e)).sort().join(`|`);return`fonts-embed-css::req=${l}::ex=${f}::lf=${p}::px=${m}::fd=${h}::doc=${g}::cp=${u}::n=${d}::ic=${_}::env=${c}`}async function js(e,t,n,r){let i=r.doc?.defaultView||window;if(e.disabled||e.media?.mediaText&&!i.matchMedia(e.media.mediaText).matches)return;let a;try{a=e.cssRules||[]}catch{return}let o=(e,t)=>{try{return new URL(e,t||location.href).href}catch{return e}};for(let e of a){if(e.type===CSSRule.IMPORT_RULE&&e.styleSheet){let i=e.href?o(e.href,t):t;if(r.depth>=hs){G(r,`Too many nested @import rules in ${i}; stopped at ${hs} levels.`);continue}if(i&&r.visitedSheets.has(i)){G(r,`Skipped an @import that loops back: ${i}`);continue}i&&r.visitedSheets.add(i);let a={...r,depth:(r.depth||0)+1};await js(e.styleSheet,i,n,a);continue}if(e.cssRules?.length){if(e.type===CSSRule.MEDIA_RULE&&!i.matchMedia(e.conditionText).matches||e.type===CSSRule.SUPPORTS_RULE&&!i.CSS.supports(e.conditionText))continue;await js(e,t,n,r);continue}if(e.type===CSSRule.FONT_FACE_RULE){let i=es((e.style.getPropertyValue(`font-family`)||``).trim());if(!i||Io(i,r.iconMatchers))continue;let a=(e.style.getPropertyValue(`font-weight`)||``).trim(),o=(e.style.getPropertyValue(`font-style`)||``).trim(),s=(e.style.getPropertyValue(`font-stretch`)||``).trim(),c=(e.style.getPropertyValue(`font-variation-settings`)||``).trim(),l=(e.style.getPropertyValue(`src`)||``).trim(),u=(e.style.getPropertyValue(`unicode-range`)||``).trim(),d=a||`400`,f=o||`normal`,p=s||`100%`,m=(o?`font-style:${o};`:``)+(a?`font-weight:${a};`:``)+(s?`font-stretch:${s};`:``)+(c?`font-variation-settings:${c};`:``)+(u?`unicode-range:${u};`:``),h=r.faceMatchesRequired(i,f,d,p);if(!h&&!r.requiredIndex.has(i.toLowerCase()))continue;let g=bs(u);if(!xs(r.usedCodepoints,g))continue;let _={family:i,weightSpec:d,styleSpec:f,stretchSpec:p,unicodeRange:u,srcRaw:l,srcUrls:Ss(l,t||location.href),href:t||location.href};if(r.simpleExcluder&&r.simpleExcluder(_,g))continue;if(!h){r.provisionalFaces.push({family:i.toLowerCase(),block:`@font-face{font-family:${i};src:${l};${m}}`,srcRaw:l,baseHref:t||location.href});continue}r.coveredFamilies.add(i.toLowerCase());let v=`"${String(i).replace(/^\s*["']|["']\s*$/g,``).replace(/(["\\])/g,`\\$1`)}"`;/url\(/i.test(l)?await n(`@font-face{font-family:${v};src:${await Cs(l,t||location.href,r.useProxy,r.debug)};${m}}`):await n(`@font-face{font-family:${v};src:${l};${m}}`)}}}async function Ms({required:e,usedCodepoints:t,exclude:n=void 0,localFonts:r=[],useProxy:i=``,fontStylesheetDomains:a=[],iconMatchers:o=[],doc:s=document,debug:c=!1}={}){e instanceof Set||(e=new Set),t instanceof Set||(t=new Set);let l=new Map;for(let t of e){let[e,n,r,i]=String(t).split(us);if(!e)continue;let a=e.toLowerCase(),o=l.get(a)||[];o.push({w:parseInt(n,10),s:r,st:parseInt(i,10)}),l.set(a,o)}function u(e,t,n,r){let i=String(e).toLowerCase();if(!l.has(i))return!1;let a=l.get(i),o=as(n),s=os(t),c=ss(r),u=o.min!==o.max,d=o.min,f=e=>s.kind===`normal`&&e===`normal`||s.kind!==`normal`&&(e===`italic`||e===`oblique`),p=!1;for(let e of a){let t=u?e.w>=o.min&&e.w<=o.max:e.w===d,n=f(rs(e.s)),r=e.st>=c.min&&e.st<=c.max;if(t&&n&&r){p=!0;break}}if(p)return!0;if(!u)for(let e of a){let t=f(rs(e.s)),n=e.st>=c.min&&e.st<=c.max;if(Math.abs(d-e.w)<=300&&t&&n)return!0}if(!u&&s.kind===`normal`&&a.some(e=>rs(e.s)!==`normal`))for(let e of a){let t=Math.abs(d-e.w)<=300,n=e.st>=c.min&&e.st<=c.max;if(t&&n)return!0}return!1}let d=Ts(n);rr(s),Ar();let f=As(e,n,r,i,a,s,t,o,rr(s));if(p.resource?.has(f))return p.resource.get(f);let m=fs(e),h=[],g=ms;for(let e of s.querySelectorAll(`style`)){let t=e.textContent||``;for(let e of t.matchAll(g)){let t=(e[2]||e[4]||``).trim();t&&!Lo(t,o)&&(s.querySelector(`link[rel="stylesheet"][href="${t}"]`)||h.push(t))}}let _=[];h.length&&await Promise.all(h.map(e=>new Promise(t=>{if(s.querySelector(`link[rel="stylesheet"][href="${e}"]`))return t(null);let n=s.createElement(`link`);n.rel=`stylesheet`,n.href=e,V(n),n.setAttribute(`data-snapdom`,`injected-import`);let r=setTimeout(()=>t(null),3e3),i=e=>{clearTimeout(r),t(e)};n.onload=()=>i(n),n.onerror=()=>i(null),s.head.appendChild(n),_.push(n)})));let v=``,y=new Set,b=[],x=Array.from(s.querySelectorAll(`link[rel="stylesheet"]`)).filter(e=>!!e.href);for(let e of _)try{e.remove()}catch{}for(let e of x)try{if(Lo(e.href,o))continue;let r=``,f=!1;try{f=new URL(e.href,location.href).origin===location.origin}catch{}if(!f){let t=Array.isArray(a)?a:[];if(!ls(e.href,m,t))continue}if(f){let t=Array.from(s.styleSheets).find(t=>t.href===e.href);if(t)try{let e=t.cssRules||[];r=Array.from(e).map(e=>e.cssText).join(``)}catch{}}if(!r){let t=await L(e.href,{as:`text`,useProxy:i,debug:c});t?.ok&&typeof t.data==`string`&&(r=t.data)}r=await gs(r,e.href,i,c);let p=``;for(let a of r.match(vs)||[]){let r=es(ys(a,`font-family`));if(!r||Io(r,o))continue;let s=ys(a,`font-weight`,`400`),f=ys(a,`font-style`,`normal`),m=ys(a,`font-stretch`,`100%`),h=ys(a,`unicode-range`),g=ys(a,`src`),_=Ss(g,e.href),v=u(r,f,s,m);if(!v&&!l.has(r.toLowerCase()))continue;let x=bs(h);if(!xs(t,x))continue;let S={family:r,weightSpec:s,styleSpec:f,stretchSpec:m,unicodeRange:h,srcRaw:g,srcUrls:_,href:e.href};if(n&&d(S,x))continue;if(!v){b.push({family:r.toLowerCase(),block:a,srcRaw:g,baseHref:e.href});continue}y.add(r.toLowerCase());let C=/url\(/i.test(g)?await Cs(a,e.href,i,c):a;p+=C}p.trim()&&(v+=p)}catch{G({debug:c},`Couldn't read stylesheet:`,e.href)}let S={doc:s,requiredIndex:l,usedCodepoints:t,faceMatchesRequired:u,coveredFamilies:y,provisionalFaces:b,simpleExcluder:n?Ts(n):null,useProxy:i,iconMatchers:o,visitedSheets:new Set,depth:0,debug:c},C=new Set([...s.styleSheets,...s.adoptedStyleSheets||[]]);for(let e of C)if(!(e.href&&x.some(t=>t.href===e.href)))try{let t=e.href||s.baseURI||location.origin+`/`;t&&S.visitedSheets.add(t),await js(e,t,async e=>{v+=e},S)}catch{}for(let e of b)y.has(e.family)||(v+=/url\(/i.test(e.srcRaw)?await Cs(e.block,e.baseHref,i,c):e.block);try{for(let e of s.fonts||[]){if(!e||!e.family||e.status!==`loaded`||!e._snapdomSrc)continue;let t=String(e.family).replace(/^['"]+|['"]+$/g,``);if(Io(t,o)||!l.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=e._snapdomSrc;if(!String(r).startsWith(`data:`)){if(p.resource?.has(e._snapdomSrc))r=p.resource.get(e._snapdomSrc);else try{let t=await L(e._snapdomSrc,{as:`dataURL`,useProxy:i});if(t.ok&&typeof t.data==`string`)r=t.data,p.resource?.set(e._snapdomSrc,r);else continue}catch{G({debug:c},`Couldn't load font file:`,e._snapdomSrc);continue}}v+=`@font-face{font-family:'${t}';src:url(${r});font-style:${e.style||`normal`};font-weight:${e.weight||`normal`};}`}}catch{}for(let e of r){if(!e||typeof e!=`object`)continue;let t=String(e.family||``).replace(/^['"]+|['"]+$/g,``);if(!t||Io(t,o)||!l.has(t.toLowerCase())||n?.families&&n.families.some(e=>String(e).toLowerCase()===t.toLowerCase()))continue;let r=e.weight==null?`normal`:String(e.weight),a=e.style==null?`normal`:String(e.style),s=e.stretchPct==null?`100%`:`${e.stretchPct}%`,u=String(e.src||``),d=u;if(!d.startsWith(`data:`)){if(p.resource?.has(u))d=p.resource.get(u);else try{let e=await L(u,{as:`dataURL`,useProxy:i});if(e.ok&&typeof e.data==`string`)d=e.data,p.resource?.set(u,d);else continue}catch{G({debug:c},`Couldn't load font file from localFonts:`,u);continue}}v+=`@font-face{font-family:'${t}';src:url(${d});font-style:${a};font-weight:${r};font-stretch:${s};}`}return v&&(v=Es(v),p.resource?.set(f,v)),v}function Ns(e,t){let n=new Set,r=new Set;if(!e)return{required:n,usedCodepoints:r};let i=e=>{if(e)for(let t of e)r.add(t.codePointAt(0))},a=e=>{let t=ts(e.fontFamily);if(t.length)for(let r of t)n.add([r,ns(e.fontWeight),rs(e.fontStyle),is(e.fontStretch)].join(us))},o=Yr(e),s=e.getRootNode(),c=e=>{a(H(e));let t=e.getRootNode()===s?o:Yr(e);for(let n of[`::before`,`::after`]){let o=n===`::before`?t.before:t.after;if(o!==null){if(o===``)continue;try{if(!e.matches(o))continue}catch{}}let s=H(e,n),c=s&&s.content;if(c&&c!==`none`&&c!==`normal`){if(a(s),/^["']/.test(c))i(c.slice(1,-1));else{let e=c.match(/\\[0-9A-Fa-f]{1,6}/g);if(e)for(let t of e)try{r.add(parseInt(t.slice(1),16))}catch{}}}}},l=[e];for(let n=0;n<l.length;n++){let r=l[n];r.nodeType===Node.ELEMENT_NODE&&c(r),r.shadowRoot&&l.push(r.shadowRoot);let a=(e.ownerDocument||document).createTreeWalker(r,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null);for(;a.nextNode();){let e=a.currentNode;if(e.nodeType===Node.TEXT_NODE){if(t&&e.parentElement&&!t(e.parentElement))continue;i(e.nodeValue||``)}else{if(t&&!t(e))continue;c(e),e.shadowRoot&&l.push(e.shadowRoot)}}}return{required:n,usedCodepoints:r}}async function Ps(e,t=2,n=document){try{await n.fonts.ready}catch{}let r=Array.from(e||[]).filter(Boolean);if(r.length===0)return;let i=()=>{let e=n.createElement(`div`);V(e),e.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;opacity:0!important;pointer-events:none!important;contain:layout size style;`;for(let t of r){let r=n.createElement(`span`);r.textContent=`AaBbGg1234ÁÉÍÓÚçñ—∞`,r.style.fontFamily=`"${t}"`,r.style.fontWeight=`700`,r.style.fontStyle=`italic`,r.style.fontSize=`32px`,r.style.lineHeight=`1`,r.style.whiteSpace=`nowrap`,r.style.margin=`0`,r.style.padding=`0`,e.appendChild(r)}n.body.appendChild(e),e.offsetWidth,n.body.removeChild(e)};for(let e=0;e<Math.max(1,t);e++)i(),await pt(),await pt()}q(),N();function Fs(e){return/\bcounter\s*\(|\bcounters\s*\(/.test(e||``)}function Is(e,t=!1){let n=``,r=Math.max(1,e);for(;r>0;)r--,n=String.fromCharCode(97+r%26)+n,r=Math.floor(r/26);return t?n.toUpperCase():n}function Ls(e,t=!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,e)),i=``;for(let[e,t]of n)for(;r>=e;)i+=t,r-=e;return t?i:i.toLowerCase()}function Rs(e,t){switch((t||`decimal`).toLowerCase()){case`decimal`:return String(e);case`decimal-leading-zero`:{let t=Math.abs(e);return(e<0?`-`:``)+(t<10?`0`:``)+String(t)}case`lower-alpha`:case`lower-latin`:return Is(e,!1);case`upper-alpha`:case`upper-latin`:return Is(e,!0);case`lower-roman`:return Ls(e,!1);case`upper-roman`:return Ls(e,!0);default:return String(e)}}function zs(e,t){let n=(e||``).trim().split(/[\s,]+/).filter(Boolean),r=[];for(let e=0;e<n.length;e++){let i=n[e];if(i===`none`)continue;let a=n[e+1],o=a!==void 0&&Number.isFinite(Number(a));r.push([i,o?Number(a):t]),o&&e++}return r}function Bs(e){let t=new WeakMap,n=O(e)?e.documentElement:e,r=e=>e&&e.tagName===`LI`,i=new WeakMap,a=e=>{let t=new Map;for(let[n,r]of e)t.set(n,r.slice());return t},o=(e,t,n)=>{let o=a(e),s;try{s=getComputedStyle(n)}catch{s=n.style}let c;try{c=s?.counterReset}catch{}if(c&&c!==`none`)for(let[e,n]of zs(c,0)){let r=t.get(e);if(r&&r.length){let t=r.slice();t.push(n),o.set(e,t)}else o.set(e,[n])}let l;try{l=s?.counterSet}catch{}if(l&&l!==`none`)for(let[e,t]of zs(l,0)){let n=o.get(e)||[];n.length===0&&n.push(0),n[n.length-1]=t,o.set(e,n)}let u;try{u=s?.counterIncrement}catch{}if(u&&u!==`none`)for(let[e,t]of zs(u,1)){let n=o.get(e)||[];n.length===0&&n.push(0),n[n.length-1]+=t,o.set(e,n)}try{if(s?.display===`list-item`&&r(n)){let e=n.parentElement,t=e&&i.get(e),r=e?.tagName===`OL`?parseInt(e.getAttribute(`start`),10):NaN,a=t===void 0?Number.isFinite(r)?r:1:t+1,s=e?.tagName===`OL`?parseInt(n.getAttribute(`value`),10):NaN;Number.isFinite(s)&&(a=s),e&&i.set(e,a);let c=o.get(`list-item`)||[];c.length===0&&c.push(0),c[c.length-1]=a,o.set(`list-item`,c)}}catch{}return o},s=(e,n,r)=>{let i=o(r,n,e);t.set(e,i);let a=i;for(let t of e.children)a=s(t,i,a);let c=new Map;for(let[e,t]of r){let n=t.length,r=a.get(e);c.set(e,r&&r.length?r.slice(0,n):t.slice())}for(let[e,t]of a)!c.has(e)&&t.length&&!n.has(e)&&c.set(e,t.slice(0,1));return c},c=new Map;return s(n,c,c),{get(e,n){let r=t.get(e)?.get(n);return r&&r.length?r[r.length-1]:0},getStack(e,n){let r=t.get(e)?.get(n);return r?r.slice():[]}}}function Vs(e,t,n){if(!e||e===`none`)return e;try{return e.replace(/\b(counter|counters)\s*\(([^)]+)\)/g,(e,r,i)=>{let a=String(i).split(`,`).map(e=>e.trim());if(r===`counter`){let e=a[0]?.replace(/^["']|["']$/g,``),r=(a[1]||`decimal`).toLowerCase();return Rs(n.get(t,e),r)}{let e=a[0]?.replace(/^["']|["']$/g,``),r=a[1]?.replace(/^["']|["']$/g,``)??``,i=(a[2]||`decimal`).toLowerCase(),o=n.getStack(t,e);return o.length?o.map(e=>Rs(e,i)).join(r):``}})}catch{return`- `}}z();var Hs=new WeakMap,Us=1e3;function Ws(e,t){let n=Ks(e);return t?(t.__pseudoPreflightFp!==n&&(Ar(),t.__pseudoPreflight=Js(e,n),t.__pseudoPreflightFp=n),!!t.__pseudoPreflight):(Ar(),Js(e,n))}function Gs(e){try{return e&&e.cssRules?e.cssRules:null}catch{return null}}function Ks(e){let t=e.querySelectorAll(`style,link[rel~="stylesheet"]`),n=`n:${t.length}|`,r=0;for(let e=0;e<t.length;e++){let i=t[e];if(i.tagName===`STYLE`){let e=i.textContent?i.textContent.length:0;n+=`S${e}|`;let t=i.sheet,a=t?Gs(t):null;a&&(r+=a.length)}else{let e=i.getAttribute(`href`)||``,t=i.getAttribute(`media`)||`all`;n+=`L${e}|m:${t}|`;let a=i.sheet,o=a?Gs(a):null;o&&(r+=o.length)}}let i=e.adoptedStyleSheets,a=0;if(Array.isArray(i))for(let e of i){let t=Gs(e);t&&(a+=t.length)}return n+=`ass:${Array.isArray(i)?i.length:0}/${a}|tr:${r}`,n}function qs(e,t,n){let r=Gs(e);if(!r)return!1;for(let e=0;e<r.length;e++){if(n.budget<=0)return!1;let i=r[e],a=i&&i.cssText?i.cssText:``;n.budget--;for(let e of t)if(a.includes(e))return!0;if(i&&i.styleSheet&&qs(i.styleSheet,t,n))return!0;if(i&&i.cssRules&&i.cssRules.length)for(let e=0;e<i.cssRules.length&&n.budget>0;e++){let r=i.cssRules[e],a=r&&r.cssText?r.cssText:``;n.budget--;for(let e of t)if(a.includes(e))return!0}if(n.budget<=0)return!1}return!1}function Js(e=document,t=Ks(e)){let n=Hs.get(e);if(n&&n.fingerprint===t)return n.result;let r=e=>(e.match(/\|ass:[^|]*/)||[``])[0];n&&r(t)!==r(n.fingerprint)&&or();let i=[`::before`,`::after`,`::first-letter`,`::marker`,`::first-line`,`:before`,`:after`,`:first-letter`,`:first-line`,`counter(`,`counters(`,`counter-increment`,`counter-reset`],a=e.querySelectorAll(`style`);for(let n=0;n<a.length;n++){let r=a[n].textContent||``;for(let n of i)if(r.includes(n))return Hs.set(e,{fingerprint:t,result:!0}),!0}let o=e.adoptedStyleSheets;if(Array.isArray(o)&&o.length){let n={budget:Us};try{for(let r of o)if(qs(r,i,n))return Hs.set(e,{fingerprint:t,result:!0}),!0}catch{}}{let n=e.querySelectorAll(`style,link[rel~="stylesheet"]`),r={budget:Us};for(let a=0;a<n.length&&r.budget>0;a++){let o=n[a],s=null;if(o.tagName,s=o.sheet||null,s&&qs(s,i,r))return Hs.set(e,{fingerprint:t,result:!0}),!0}}return e.querySelector(`[style*="counter("], [style*="counters("]`)?(Hs.set(e,{fingerprint:t,result:!0}),!0):(Hs.set(e,{fingerprint:t,result:!1}),!1)}function Ys(e){for(let t of[`Top`,`Right`,`Bottom`,`Left`]){let n=parseFloat(e[`border${t}Width`])||0,r=e[`border${t}Style`];if(n>0&&r&&r!==`none`&&r!==`hidden`)return!0}return!1}function Xs(e,t){let n=null,r=()=>{if(!n)try{n=Bs(e)}catch(e){G(t,`Couldn't compute CSS counters; list numbers may be off.`,e),n={get:()=>0,getStack:()=>[]}}return n};return{get(e,t){return r().get(e,t)},getStack(e,t){return r().getStack(e,t)}}}function Zs(e){let t=!1;for(let n=0;n<e.length;n++){let r=e[n];if(r===`"`)t=!t;else if(r===`/`&&!t)return e.slice(0,n).trim()}return e}function Qs(e){return e.replace(/\\(?:([0-9a-fA-F]{1,6})[ \t\n]?|([\s\S]))/g,(e,t,n)=>{if(t){let e=parseInt(t,16);return e===0||e>1114111?`�`:String.fromCodePoint(e)}return n===`
|
|
11
|
+
`?``:n})}function $s(e){if(!e)return``;let t=[],n=/"((?:\\[\s\S]|[^"\\])*)"|'((?:\\[\s\S]|[^'\\])*)'/g,r=0,i;for(;i=n.exec(e);){let a=e.slice(r,i.index).trim();a&&t.push(a),t.push(Qs(i[1]===void 0?i[2]:i[1])),r=n.lastIndex}let a=e.slice(r).trim();return a&&t.push(a),t.join(``)}function ec(e,t,n){let r=e.parentElement,i=r&&n?n.get(r):null;return i?{get(e,n){let r=t.get(e,n),a=i.get(n);return typeof a==`number`?Math.max(r,a):r},getStack(e,n){let r=t.getStack(e,n);if(!r.length)return r;let a=i.get(n);if(typeof a==`number`){let e=r.slice();return e[e.length-1]=Math.max(e[e.length-1],a),e}return r}}:t}function tc(e,t,n){let r=new Map,i=(e,t)=>zs(e,t).map(([e,t])=>({name:e,num:t})),a=i(t?.counterReset,0),o=i(t?.counterSet,0),s=i(t?.counterIncrement,1);function c(t){if(r.has(t))return r.get(t).slice();let i=n.getStack(e,t);i=i.length?i.slice():[];let c=a.find(e=>e.name===t);if(c){let e=Number.isFinite(c.num)?c.num:0;i=i.length?[...i,e]:[e]}let l=o.find(e=>e.name===t);if(l){let e=Number.isFinite(l.num)?l.num:0;i.length===0&&(i=[0]),i[i.length-1]=e}let u=s.find(e=>e.name===t);if(u){let e=Number.isFinite(u.num)?u.num:1;i.length===0&&(i=[0]),i[i.length-1]+=e}return r.set(t,i.slice()),i}return{get(e,t){let n=c(t);return n.length?n[n.length-1]:0},getStack(e,t){return c(t)},__incs:s}}var nc=[`color`,`-webkit-text-fill-color`,`font-family`,`font-size`,`font-weight`,`font-style`,`letter-spacing`,`line-height`],rc=[`color`,`-webkit-text-fill-color`,`font-family`,`font-size`,`font-weight`,`font-style`,`font-variant`,`letter-spacing`,`word-spacing`,`text-transform`,`text-decoration-line`,`text-decoration-color`,`text-decoration-style`,`line-height`,`background-color`,`vertical-align`];function ic(e,t,n,r,i,a){try{if(r===null){if(e.getRootNode()!==(e.ownerDocument||document))return;let t=H(e).display||``;if(i===`::marker`?!t.includes(`list-item`):t!==`block`&&t!==`flow-root`&&t!==`list-item`&&t!==`inline-block`&&t!==`table-cell`&&t!==`table-caption`)return}else if(!e.matches(r))return;if(i===`::marker`&&!(H(e).display||``).includes(`list-item`))return;let o=H(e,i),s=H(e);if(!o)return;let c=``;for(let e of a){let t=o.getPropertyValue(e);t&&t!==s.getPropertyValue(e)&&(e!==`background-color`||t!==`rgba(0, 0, 0, 0)`)&&(e!==`vertical-align`||t!==`baseline`)&&(c+=`${e}:${t};`)}if(i===`::marker`){let e=o.getPropertyValue(`content`);e&&e!==`normal`&&e!==`none`&&(c+=`content:${e};`)}if(!c)return;let l=`data-sd-p${n.__pseudoRuleSeq=(n.__pseudoRuleSeq||0)+1}`;t.setAttribute(l,``),n.__pseudoCSS=(n.__pseudoCSS||``)+`[${l}]${i}{${c}}`}catch{}}function ac(e,t){if(!/\b(?:no-)?(?:open|close)-quote\b/.test(e))return e;let n=`“`,r=`”`;try{let e=H(t).quotes;if(e===`none`)n=``,r=``;else if(e&&e!==`auto`){let t=e.match(/"[^"]*"|'[^']*'/g);t&&t.length>=2&&(n=t[0].slice(1,-1),r=t[1].slice(1,-1))}}catch{}return n=n.replace(/"/g,``),r=r.replace(/"/g,``),e.replace(/"[^"]*"|\b(no-open-quote|no-close-quote|open-quote|close-quote)\b/g,(e,t)=>t?t===`open-quote`?`"${n}"`:t===`close-quote`?`"${r}"`:`""`:e)}function oc(e,t,n,r){let i;try{i=H(e,t)}catch{}let a=i?.content;if(!a||a===`none`||a===`normal`)return{text:``,incs:[]};a=Zs(a),a=ac(a,e);let o=ec(e,n,r),s=tc(e,i,o);return{text:$s(Fs(a)?Vs(a,e,s):a),incs:s.__incs||[]}}function sc(e,t){if(t.__shadowPseudo)return!1;let n=Yr(e),r=[];for(let e of[`before`,`after`,`firstLetter`,`marker`,`firstLine`]){let t=n[e];if(t===null)return!1;t&&r.push(t)}if(!r.length)return!0;let i=r.join(`,`);try{return!e.matches(i)&&e.querySelector(i)===null}catch{return!1}}async function cc(e,t,n,r,i=!1){if(e?.nodeType!==1||t?.nodeType!==1||(n.slicer?.due()&&await n.slicer.pause(),e.tagName===`TEXTAREA`))return;let a=e.ownerDocument||document;if(!i&&!Ws(a,n)&&!n.__shadowPseudo||!i&&sc(e,n))return;n.__siblingCounters||=new WeakMap,n.__counterCtx||=Xs(e.ownerDocument||document,n);let o=n.__counterCtx,s=Yr(e);s.marker!==``&&ic(e,t,n,s.marker,`::marker`,nc),s.firstLine!==``&&ic(e,t,n,s.firstLine,`::first-line`,rc);for(let i of[`::before`,`::after`,`::first-letter`]){let a=s[i===`::before`?`before`:i===`::after`?`after`:`firstLetter`];if(a!==null){if(a===``)continue;try{if(!e.matches(a))continue}catch{}}try{let a=H(e,i);if(!a||a.content===`none`&&a.backgroundImage===`none`&&(a.backgroundColor===`transparent`||a.backgroundColor===`rgba(0, 0, 0, 0)`)&&!Ys(a)&&(!a.transform||a.transform===`none`)&&a.display===`inline`)continue;if(a.display===`none`||i!==`::first-letter`&&(a.content===`none`||a.content===`normal`)){i===`::before`&&(t.dataset.snapdomHasBefore=`1`),i===`::after`&&(t.dataset.snapdomHasAfter=`1`);continue}if(i===`::first-letter`){let r=H(e),i=(r?.display||``).toLowerCase();if(i.includes(`flex`)||i.includes(`grid`))continue;let o=e=>a[e]!==r[e]&&(parseFloat(a[e])||0)!==0;if(!(a.color!==r.color||a.fontSize!==r.fontSize||a.fontWeight!==r.fontWeight||a.fontFamily!==r.fontFamily||a.fontStyle!==r.fontStyle||a.textTransform!==r.textTransform||a.float!==r.float&&a.float!==`none`||o(`paddingTop`)||o(`paddingRight`)||o(`paddingBottom`)||o(`paddingLeft`)||o(`marginTop`)||o(`marginRight`)||o(`marginBottom`)||o(`marginLeft`)))continue;let s=Array.from(t.childNodes).find(e=>e.nodeType===Node.TEXT_NODE&&e.textContent?.trim().length>0);if(!s)continue;let c=s.textContent,l=/^\s*/.exec(c)[0],u=c.slice(l.length),d=u.match(/^([^\p{L}\p{N}\s]*[\p{L}\p{N}](?:['’])?)/u)?.[0],f=u.slice(d?.length||0);if(!d||/[\uD800-\uDFFF]/.test(d))continue;let p=document.createElement(`span`);p.textContent=d,p.dataset.snapdomPseudo=`::first-letter`;let m=Ue(Je(a,Gr(e)),`span`);n.styleMap.set(p,m);let h=document.createTextNode(f);t.replaceChild(h,s),t.insertBefore(p,h),l&&t.insertBefore(document.createTextNode(l),p);continue}let s=a.content??``,c=s===``||s===`none`||s===`normal`,{text:l,incs:u}=oc(e,i,o,n.__siblingCounters),d=a.backgroundImage,f=a.backgroundColor,p=a.fontFamily,m=parseInt(a.fontSize)||32,g=parseInt(a.fontWeight)||!1,v=a.fontStyle||`normal`,b=a.color||`#000`,x=a.transform,S=Io(p,r?.__iconMatchers),C=!c&&l!==``,w=d&&d!==`none`,T=f&&f!==`transparent`&&f!==`rgba(0, 0, 0, 0)`,E=Ys(a),D=x&&x!==`none`,O=s!==`none`&&s!==`normal`,k=/^inline-/.test(a.display||``),A=O&&((parseFloat(a.width)||0)>0||(parseFloat(a.height)||0)>0||k),j=O&&a.boxShadow&&a.boxShadow!==`none`,M=O&&a.outlineStyle&&a.outlineStyle!==`none`&&(parseFloat(a.outlineWidth)||0)>0;if(!(C||w||T||E||D||A||j||M)){if(u&&u.length&&e.parentElement){let t=n.__siblingCounters.get(e.parentElement)||new Map;for(let{name:r}of u){if(!r)continue;let a=ec(e,o,n.__siblingCounters),s=tc(e,H(e,i),a).get(e,r);t.set(r,s)}n.__siblingCounters.set(e.parentElement,t)}continue}let N=l.startsWith(`url(`)||/^-?(?:webkit-)?image-set\(/i.test(l),ee=a.display===`inline`&&a.cssFloat===`none`&&a.position!==`absolute`&&a.position!==`fixed`,P=!1;if(C&&!S&&l.length>1&&!N&&ee){let n=H(e),r=parseFloat(n.fontSize)||16,i=parseFloat(n.lineHeight);Number.isFinite(i)||(i=r*1.5),e.getBoundingClientRect().height<i*1.6&&(t.style.whiteSpace=`nowrap`,P=!0)}let F=document.createElement(`span`);F.dataset.snapdomPseudo=i,F.style.pointerEvents=`none`,P&&(F.style.whiteSpace=`nowrap`);let te=yi(e,i,a,n,r),ne=(H(e).display||``).toLowerCase(),re=ne.includes(`flex`)||ne.includes(`grid`);if(re){let e=te[`min-width`];(!e||e===`auto`||e===`0px`)&&(te[`min-width`]=`0px`)}let ie=C;ie&&!ee&&parseFloat(a.height)>=1.5*(parseFloat(a.lineHeight)||(parseFloat(a.fontSize)||16)*1.2)&&(ie=!1,F.style.whiteSpace=a.whiteSpace);let I=Ue(te,`span`,ie,re);if(n.styleMap.set(F,I),S&&l&&l.length===1){let{dataUrl:e,height:t,advance:n,descent:r}=await Zo(l,p,g,m,b,v),i=document.createElement(`img`);i.src=e,i.style=`height:${m}px;width:${n/t*m}px;object-fit:contain;vertical-align:${-r}px;`,F.appendChild(i)}else if(l&&N){let t=_(l,typeof devicePixelRatio<`u`&&devicePixelRatio||1)??h(l);if(t?.trim())try{let e=await L(y(t),{as:`dataURL`,useProxy:r.useProxy,debug:r.debug});if(e?.ok&&typeof e.data==`string`){let t=document.createElement(`img`);t.src=e.data,t.style=`width:${m}px;height:auto;object-fit:contain;`,F.appendChild(t)}}catch(t){G(r,`Couldn't draw the ${i} icon of`,[e,t])}}else!S&&C&&(F.textContent=l);F.style.backgroundImage=`none`,`maskImage`in F.style&&(F.style.maskImage=`none`),`webkitMaskImage`in F.style&&(F.style.webkitMaskImage=`none`);try{F.style.backgroundRepeat=a.backgroundRepeat,F.style.backgroundSize=a.backgroundSize,a.backgroundPositionX&&a.backgroundPositionY?(F.style.backgroundPositionX=a.backgroundPositionX,F.style.backgroundPositionY=a.backgroundPositionY):F.style.backgroundPosition=a.backgroundPosition,F.style.backgroundOrigin=a.backgroundOrigin,F.style.backgroundClip=a.backgroundClip,F.style.backgroundAttachment=a.backgroundAttachment,F.style.backgroundBlendMode=a.backgroundBlendMode}catch{}if(w)try{let e=Ye(d),t=await Promise.all(e.map(e=>ue(e,r)));F.style.backgroundImage=t.join(`, `)}catch(e){G(r,`Couldn't load the ${i} background image.`,e)}T&&(F.style.backgroundColor=f);let ae=a.maskImage||a.webkitMaskImage;if(ae&&ae!==`none`)try{let e=(await Promise.all(Ye(ae).map(e=>ue(e,r)))).join(`, `);F.style.maskImage=e,F.style.webkitMaskImage=e;for(let e of[`maskSize`,`maskRepeat`,`maskPosition`,`maskMode`,`maskComposite`,`maskOrigin`,`maskClip`])a[e]&&(F.style[e]=a[e])}catch(e){G(r,`Couldn't load the ${i} mask image.`,e)}let oe=F.childNodes.length>0||F.textContent?.trim()!==``||w||T||E||D||A||j||M;if(u&&u.length&&e.parentElement){let t=n.__siblingCounters.get(e.parentElement)||new Map,r=ec(e,o,n.__siblingCounters),a=tc(e,H(e,i),r);for(let{name:n}of u){if(!n)continue;let r=a.get(e,n);t.set(n,r)}n.__siblingCounters.set(e.parentElement,t)}if(!oe)continue;i===`::before`?(t.dataset.snapdomHasBefore=`1`,t.insertBefore(F,t.firstChild)):(t.dataset.snapdomHasAfter=`1`,t.appendChild(F))}catch(t){K(r.__session,`pseudo-failed`,`${i} could not be copied`,e),G(r,`Couldn't copy the ${i} of`,[e,t])}}let c=Array.from(t.children).filter(e=>!e.dataset.snapdomPseudo);if(n.nodeMap)for(let e of c){let t=n.nodeMap.get(e);t?.nodeType===1&&await cc(t,e,n,r,!0)}else{let t=Array.from(e.children);for(let e=0;e<Math.min(t.length,c.length);e++)await cc(t[e],c[e],n,r,!0)}}var lc=`http://www.w3.org/2000/svg`,uc=[`background-image`,`background-size`,`background-position`,`background-repeat`,`background-origin`];function dc(e){for(let[t,n]of e)try{fc(t,n)}catch{}}function fc(e,t){let n=e.ownerDocument.defaultView,r=n.getComputedStyle(e),i=[...e.getClientRects()];if(!i.length)return;let a=i[0].left+parseFloat(r.borderLeftWidth),o=i[0].top+parseFloat(r.borderTopWidth),s;if(r.display===`inline`){let e=i.reduce((e,t)=>e+t.width,0),t=0;s=i.map(n=>{let r={x:n.left-a-t,y:n.top-o,w:e,h:n.height,top:n.top,bottom:n.bottom};return t+=n.width,r})}else s=[{x:0,y:0,w:e.clientWidth||i[0].width,h:e.clientHeight||i[0].height,top:-1/0,bottom:1/0}];let c=t.ownerDocument,l=`sd-bct-${Math.random().toString(36).slice(2,9)}`,u=uc.map(e=>`${e}:${r.getPropertyValue(e)}`).join(`;`).replace(/"/g,`'`),d=``;s.forEach((e,t)=>{let n=`<svg xmlns="${lc}" width="${e.w}" height="${e.h}"><foreignObject width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml" style="width:${e.w}px;height:${e.h}px;${u}"></div></foreignObject></svg>`;d+=`<pattern id="${l}-${t}" patternUnits="userSpaceOnUse" x="${e.x}" y="${e.y}" width="${e.w}" height="${e.h}"><image width="${e.w}" height="${e.h}" preserveAspectRatio="none" href="data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}"/></pattern>`});let f=``,p=c.createElement(`canvas`).getContext(`2d`),m=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT),h=e.ownerDocument.createRange();for(let e=m.nextNode();e;e=m.nextNode()){let t=n.getComputedStyle(e.parentElement);p.font=t.font;let r=p.measureText(`X`).fontBoundingBoxAscent;if(!Number.isFinite(r))return;let i=t.font.replace(/"/g,`'`),c=s.map(()=>({xs:[],ys:[],chars:``})),u=e.data;for(let t=0;t<u.length;t++){let n=u.charCodeAt(t)>=55296&&u.charCodeAt(t)<=56319?2:1;h.setStart(e,t),h.setEnd(e,t+n);let i=h.getClientRects()[0],l=u.slice(t,t+n);if(t+=n-1,!i||!l.trim())continue;let d=(i.top+i.bottom)/2,f=s.findIndex(e=>d>=e.top&&d<=e.bottom);f<0&&(f=0),c[f].xs.push(+(i.left-a).toFixed(2)),c[f].ys.push(+(i.top-o+r).toFixed(2)),c[f].chars+=l}c.forEach((e,t)=>{if(!e.chars)return;let n=e.chars.replace(/&/g,`&`).replace(/</g,`<`);f+=`<text x="${e.xs.join(` `)}" y="${e.ys.join(` `)}" fill="url(#${l}-${t})" style="font:${i};font-kerning:none;letter-spacing:0;white-space:pre">${n}</text>`})}if(!f)return;let g=c.createElementNS(lc,`svg`);g.setAttribute(`style`,`position:absolute;left:0;top:0;width:1px;height:1px;overflow:visible;pointer-events:none`),g.innerHTML=`<defs>${d}</defs>${f}`,r.position===`static`&&t.style.setProperty(`position`,`relative`,`important`),t.style.setProperty(`color`,`transparent`,`important`),t.style.setProperty(`-webkit-text-fill-color`,`transparent`,`important`),t.insertBefore(g,t.firstChild)}N();function pc(e,t,n){if(!e||e?.nodeType!==1)return;let r=e.ownerDocument||document,i=t||r,a=T(e)&&e.localName===`svg`?[e]:Array.from(e.querySelectorAll(`svg`)),o=/url\(\s*["']?\s*#([^)"']+)/g,s=[`fill`,`stroke`,`filter`,`clip-path`,`mask`,`marker`,`marker-start`,`marker-mid`,`marker-end`],c=e=>window.CSS&&CSS.escape?CSS.escape(e):e.replace(/[^a-zA-Z0-9_-]/g,`\\$&`),l=e=>{if(!e||!e.getAttribute)return null;let t=e.getAttribute(`href`)||e.getAttribute(`xlink:href`)||(typeof e.getAttributeNS==`function`?e.getAttributeNS(`http://www.w3.org/1999/xlink`,`href`):null);if(t)return t;let n=e.attributes;if(!n)return null;for(let e=0;e<n.length;e++){let t=n[e];if(!t||!t.name)continue;if(t.name===`href`)return t.value;let r=t.name.indexOf(`:`);if(r!==-1&&t.name.slice(r+1)===`href`)return t.value}return null},u=new Set(Array.from(e.querySelectorAll(`[id]`)).map(e=>e.id)),d=new Set,f=!1,p=(e,t=null)=>{if(!e)return;o.lastIndex=0;let n;for(;n=o.exec(e);){f=!0;let e=(n[1]||``).trim();e&&(u.has(e)||(d.add(e),t&&!t.has(e)&&t.add(e)))}},m=e=>{let t=e.querySelectorAll(`use`);for(let e of t){let t=l(e);if(!t||!t.startsWith(`#`))continue;f=!0;let n=t.slice(1).trim();n&&!u.has(n)&&d.add(n)}p(e.getAttribute(`style`)||``);for(let t of s)p(e.getAttribute(t));let n=e.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 e of n){p(e.getAttribute(`style`)||``);for(let t of s)p(e.getAttribute(t))}},h=e=>{if(!e||e.nodeType!==1||!e.querySelectorAll)return;let t=!1;try{t=!!(i.querySelector&&i.querySelector(`filter[id],clipPath[id],mask[id],linearGradient[id],radialGradient[id],pattern[id]`))}catch{return}if(!t)return;let n=[`filter`,`clipPath`,`mask`,`maskImage`,`webkitMaskImage`],r=e=>{if(T(e))return;let t;try{t=getComputedStyle(e)}catch{return}for(let e of n){let n=t[e];n&&n.includes(`url(`)&&p(n)}};r(e);for(let t of e.querySelectorAll(`*`))r(t)};for(let e of a)m(e);if(h(n),!f)return;let g=e.querySelector(`svg.inline-defs-container`);g||(g=r.createElementNS(`http://www.w3.org/2000/svg`,`svg`),g.classList.add(`inline-defs-container`),g.setAttribute(`aria-hidden`,`true`),g.setAttribute(`style`,`position:absolute;width:0;height:0;overflow:hidden`),e.insertBefore(g,e.firstChild||null));let _=g.querySelector(`defs`)||null,v=t=>{if(!t||u.has(t))return null;let n=c(t),r=t=>{let n=i.querySelector(t);return n&&!e.contains(n)?n:null};return r(`svg defs > *#${n}`)||r(`svg > symbol#${n}`)||r(`*#${n}`)};if(!d.size)return;let y=new Set(d),b=new Set;for(;y.size;){let e=y.values().next().value;if(y.delete(e),!e||u.has(e)||b.has(e))continue;let t=v(e);if(!t){b.add(e);continue}_||(_=r.createElementNS(`http://www.w3.org/2000/svg`,`defs`),g.appendChild(_));let n=t.cloneNode(!0);n.id||n.setAttribute(`id`,e),_.appendChild(n),b.add(e),u.add(e);let i=[n,...n.querySelectorAll(`*`)];for(let e of i){let t=l(e);if(t&&t.startsWith(`#`)){let e=t.slice(1).trim();e&&!u.has(e)&&!b.has(e)&&y.add(e)}let n=e.getAttribute?.(`style`)||``;n&&p(n,y);for(let t of s){let n=e.getAttribute?.(t);n&&p(n,y)}}}}N();var mc=new WeakMap,hc=new WeakMap;function gc(e,t,n){let r=n.get(e),i=e.style;if(!r){let a=i.cssText,o=e.hasAttribute(`style`);r={users:0,saved:t.map(([e,t])=>{let n={property:e,value:i.getPropertyValue(e),priority:i.getPropertyPriority(e)};return i.setProperty(e,t,`important`),n.forcedValue=i.getPropertyValue(e),n}),originalCSS:a,forcedCSS:i.cssText,hadStyle:o},n.set(e,r)}r.users++;let a=!1;return()=>{if(!a&&(a=!0,!--r.users)){if(n.delete(e),i.cssText===r.forcedCSS)i.cssText=r.originalCSS;else for(let e of r.saved)i.getPropertyValue(e.property)!==e.forcedValue||i.getPropertyPriority(e.property)!==`important`||(e.value?i.setProperty(e.property,e.value,e.priority):i.removeProperty(e.property));!r.hadStyle&&!i.length&&(e.getAttribute(`style`),e.removeAttribute(`style`))}}}function _c(e){if(mc.has(e))return gc(e,[],mc);let t=getComputedStyle(e),n=t.outlineStyle,r=t.outlineWidth,i=n!==`none`&&parseFloat(r)>0,a=parseFloat(t.borderTopWidth)===0&&parseFloat(t.borderRightWidth)===0&&parseFloat(t.borderBottomWidth)===0&&parseFloat(t.borderLeftWidth)===0;if(i&&a){let t=[];for(let e of[`top`,`right`,`bottom`,`left`])t.push([`border-${e}-width`,r],[`border-${e}-style`,`solid`],[`border-${e}-color`,`transparent`]);return gc(e,t,mc)}return()=>{}}function vc(e,t=null){let n=[],r=e=>{if(!w(e))return;if(hc.has(e)){n.push(gc(e,[],hc));return}let t=getComputedStyle(e);(t.contentVisibility||t.getPropertyValue(`content-visibility`)||``)===`auto`&&n.push(gc(e,[[`content-visibility`,`visible`]],hc))};try{if(t){let n=e=>{let i;try{i=e.getBoundingClientRect()}catch{return}if(!((i.width>0||i.height>0)&&(i.right<t.left-200||i.left>t.right+200||i.bottom<t.top-200||i.top>t.bottom+200))){r(e);for(let t=e.firstElementChild;t;t=t.nextElementSibling)n(t)}};n(e)}else{for(let t of e.querySelectorAll(`*`))r(t);r(e)}}catch{}return()=>{for(let e of n)try{e()}catch{}}}J(),m(),Le(),ft(),Le();function yc(e){return xc(e.boxShadow)}function bc(e){return xc(e.textShadow)}function xc(e){if(!e||e===`none`)return{top:0,right:0,bottom:0,left:0};let t=[],n=``,r=0;for(let i=0;i<e.length;i++){let a=e[i];a===`(`?r++:a===`)`&&(r=Math.max(0,r-1)),a===`,`&&r===0?(t.push(n),n=``):n+=a}n.trim()&&t.push(n);let i=0,a=0,o=0,s=0;for(let e of t){if(/\binset\b/i.test(e))continue;let t=e.match(/-?\d+(\.\d+)?px/g)?.map(e=>parseFloat(e))||[];if(t.length<2)continue;let[n,r,c=0,l=0]=t,u=Math.abs(n)+c+l,d=Math.abs(r)+c+l;a=Math.max(a,u+Math.max(n,0)),s=Math.max(s,u+Math.max(-n,0)),o=Math.max(o,d+Math.max(r,0)),i=Math.max(i,d+Math.max(-r,0))}return{top:Math.ceil(i),right:Math.ceil(a),bottom:Math.ceil(o),left:Math.ceil(s)}}function Sc(e){let t=e.filter&&e.filter!==`none`?e.filter:e.webkitFilter||``,n=/blur\(\s*([0-9.]+)px\s*\)/gi,r=0,i;for(;i=n.exec(t);)r+=parseFloat(i[1])||0;let a=Math.ceil(r*2);return{top:a,right:a,bottom:a,left:a}}function Cc(e){if((e.outlineStyle||`none`)===`none`)return{top:0,right:0,bottom:0,left:0};let t=Math.ceil(parseFloat(e.outlineWidth||`0`)||0),n=parseFloat(e.outlineOffset||`0`)||0,r=t+Math.max(0,Math.ceil(n));return{top:r,right:r,bottom:r,left:r}}function wc(e){let t=`${e.filter||``} ${e.webkitFilter||``}`.trim();if(!t||t===`none`)return{bleed:{top:0,right:0,bottom:0,left:0},has:!1};let n=t.match(/drop-shadow\((?:[^()]|\([^()]*\))*\)/gi)||[],r=0,i=0,a=0,o=0,s=!1;for(let e of n){s=!0;let[t=0,n=0,c=0]=e.match(/-?\d+(?:\.\d+)?px/gi)?.map(e=>parseFloat(e))||[],l=Math.abs(t)+c,u=Math.abs(n)+c;i=Math.max(i,l+Math.max(t,0)),o=Math.max(o,l+Math.max(-t,0)),a=Math.max(a,u+Math.max(n,0)),r=Math.max(r,u+Math.max(-n,0))}return{bleed:{top:Q(r),right:Q(i),bottom:Q(a),left:Q(o)},has:s}}function Tc(e){let t=yc(e),n=bc(e),r=Sc(e),i=Cc(e),a=wc(e);return{top:Math.max(t.top,n.top)+r.top+i.top+a.bleed.top,right:Math.max(t.right,n.right)+r.right+i.right+a.bleed.right,bottom:Math.max(t.bottom,n.bottom)+r.bottom+i.bottom+a.bleed.bottom,left:Math.max(t.left,n.left)+r.left+i.left+a.bleed.left}}function Ec(e){return e.boxShadow&&e.boxShadow!==`none`||e.textShadow&&e.textShadow!==`none`||(e.outlineStyle||`none`)!==`none`||e.filter&&e.filter!==`none`?!0:!!e.webkitFilter&&e.webkitFilter!==`none`}function Dc(e){let t=e.overflowX||e.overflow||`visible`,n=e.overflowY||e.overflow||`visible`,r=!!e.contain&&/\b(paint|content|strict)\b/.test(e.contain)||!!e.clipPath&&e.clipPath!==`none`;return{x:r||t!==`visible`,y:r||n!==`visible`}}function Oc(e,t,n,r=1,i=1){let a=0,o=0,s=0,c=0,l=Dc(n.get(e)||H(e));if(l.x&&l.y)return{top:0,right:0,bottom:0,left:0};let u=e.getBoundingClientRect();for(let d of t.values()){if(d===e||d.nodeType!==1||d.ownerDocument!==e.ownerDocument)continue;let t=n.get(d);if(!t||!Ec(t))continue;let f=Tc(t);if(!(f.top||f.right||f.bottom||f.left))continue;let p=d.getBoundingClientRect(),m={left:p.left-f.left/r,top:p.top-f.top/i,right:p.right+f.right/r,bottom:p.bottom+f.bottom/i};for(let t=d.parentElement;t;t=t.parentElement){let r=Dc(n.get(t)||H(t));if(r.x||r.y){let e=t.getBoundingClientRect();r.x&&(m.left=Math.max(m.left,e.left),m.right=Math.min(m.right,e.right)),r.y&&(m.top=Math.max(m.top,e.top),m.bottom=Math.min(m.bottom,e.bottom))}if(t===e)break}l.x||(c=Math.max(c,(u.left-m.left)*r),o=Math.max(o,(m.right-u.right)*r)),l.y||(a=Math.max(a,(u.top-m.top)*i),s=Math.max(s,(m.bottom-u.bottom)*i))}return{top:Math.max(0,Math.ceil(a)),right:Math.max(0,Math.ceil(o)),bottom:Math.max(0,Math.ceil(s)),left:Math.max(0,Math.ceil(c))}}function kc(e,t){if(!e||!t||!t.style)return null;let n=getComputedStyle(e);try{t.style.transformOrigin=`0 0`}catch{}try{`translate`in t.style&&(t.style.translate=`none`),`rotate`in t.style&&(t.style.rotate=`none`)}catch{}let r=n.transform||`none`;if(!r||r===`none`){let n=null;try{n=Mc(e).scale}catch{}try{t.style.transform=`none`}catch{}if(!n)return{a:1,b:0,c:0,d:1};let r=Fc({scale:n});return{a:r.a,b:r.b,c:r.c,d:r.d}}function i(e,t,n,r){let i=Math.sqrt(e*e+t*t)||0,a=0,o=0;if(i>0){let s=e/i,c=t/i;a=s*n+c*r;let l=n-s*a,u=r-c*a;o=Math.sqrt(l*l+u*u)||0,o>0?a/=o:a=0}return{a:i,b:0,c:a*o,d:o}}let a=t=>{let n=Mc(e).scale;if(!n)return t;let r=Fc({scale:n,baseTransform:`matrix(${t.a},${t.b},${t.c},${t.d},0,0)`});return{a:r.a,b:r.b,c:r.c,d:r.d}},o=r.match(/^matrix\(\s*([^)]+)\)$/i);if(o){let e=o[1].split(`,`).map(e=>parseFloat(e.trim()));if(e.length===6&&e.every(Number.isFinite)){let[n,r,o,s]=e,c=i(n,r,o,s);try{t.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return a(c)}}let s=r.match(/^matrix3d\(\s*([^)]+)\)$/i);if(s){let e=s[1].split(`,`).map(e=>parseFloat(e.trim()));if(e.length===16&&e.every(Number.isFinite)){let n=e[0],r=e[1],o=e[4],s=e[5],c=i(n,r,o,s);try{t.style.transform=`matrix(${c.a}, ${c.b}, ${c.c}, ${c.d}, 0, 0)`}catch{}return a(c)}}try{let e=new DOMMatrix(r),n=i(e.a,e.b,e.c,e.d);try{t.style.transform=`matrix(${n.a}, ${n.b}, ${n.c}, ${n.d}, 0, 0)`}catch{}return a(n)}catch{return null}}function Ac(e,t,n,r,i){let a=n.a,o=n.b,s=n.c,c=n.d,l=n.e||0,u=n.f||0;function d(e,t){let n=e-r,d=t-i,f=a*n+s*d,p=o*n+c*d;return f+=r+l,p+=i+u,[f,p]}let f=[d(0,0),d(e,0),d(0,t),d(e,t)],p=1/0,m=1/0,h=-1/0,g=-1/0;for(let[e,t]of f)e<p&&(p=e),t<m&&(m=t),e>h&&(h=e),t>g&&(g=t);return{minX:p,minY:m,maxX:h,maxY:g,width:h-p,height:g-m}}function jc(e,t,n){let r=(e.transformOrigin||`0 0`).trim().split(/\s+/),[i,a]=[r[0]||`0`,r[1]||`0`],o=(e,t)=>{let n=e.toLowerCase();return n===`left`||n===`top`?0:n===`center`?t/2:n===`right`||n===`bottom`?t:n.endsWith(`px`)?parseFloat(n)||0:n.endsWith(`%`)?(parseFloat(n)||0)*t/100:/^-?\d+(\.\d+)?$/.test(n)&&parseFloat(n)||0};return{ox:o(i,t),oy:o(a,n)}}function Mc(e){let t={rotate:`0deg`,scale:null,translate:null},n=null;try{n=typeof e.computedStyleMap==`function`?e.computedStyleMap():null}catch{}if(n){let r=e=>{try{return typeof n.has==`function`&&!n.has(e)||typeof n.get!=`function`?null:n.get(e)}catch{return null}},i=r(`rotate`);if(i){if(i.angle){let e=i.angle;t.rotate=e.unit===`rad`?e.value*180/Math.PI+`deg`:e.value+e.unit,i.is2D===!1&&i.x&&i.y&&i.z&&(t.rotate=`${i.x.value} ${i.y.value} ${i.z.value} ${t.rotate}`)}else t.rotate=i.unit?i.unit===`rad`?i.value*180/Math.PI+`deg`:i.value+i.unit:String(i)}else{let n=getComputedStyle(e);t.rotate=n.rotate&&n.rotate!==`none`?n.rotate:`0deg`}let a=r(`scale`);if(a){let e=e=>e&&e.value!=null?`${e.value}${e.unit===`percent`?`%`:``}`:null;t.scale=`x`in a&&a.x?.value!=null?[e(a.x),e(a.y)??e(a.x),...a.is2D===!1?[e(a.z)??`1`]:[]].join(` `):Array.isArray(a)?a.map(e).join(` `):String(a)}else{let n=getComputedStyle(e);t.scale=n.scale&&n.scale!==`none`?n.scale:null}let o=r(`translate`);if(o){let e=e=>e&&e.value!=null?`${e.value}${e.unit===`percent`?`%`:e.unit||`px`}`:null;t.translate=`x`in o&&o.x?.value!=null?[e(o.x),e(o.y)??`0px`,...o.is2D===!1?[e(o.z)??`0px`]:[]].join(` `):Array.isArray(o)?o.map(e).join(` `):String(o)}else{let n=getComputedStyle(e);t.translate=n.translate&&n.translate!==`none`?n.translate:null}return(!t.rotate||t.rotate===`none`)&&(t.rotate=`0deg`),(!t.scale||t.scale===`none`)&&(t.scale=null),(!t.translate||t.translate===`none`)&&(t.translate=null),t}let r=getComputedStyle(e);return t.rotate=r.rotate&&r.rotate!==`none`?r.rotate:`0deg`,t.scale=r.scale&&r.scale!==`none`?r.scale:null,t.translate=r.translate&&r.translate!==`none`?r.translate:null,t}var Nc=null;function Pc(){if(Nc?.isConnected)return Nc;let e=document.createElement(`div`);return e.id=`snapdom-measure-slot`,e.setAttribute(`aria-hidden`,`true`),V(e),Object.assign(e.style,{position:`absolute`,left:`-99999px`,top:`0px`,width:`0px`,height:`0px`,overflow:`hidden`,opacity:`0`,pointerEvents:`none`,contain:`size layout style`}),document.documentElement.appendChild(e),Nc=e,e}function Fc(e){let t=e=>{let t=[],n=0,r=0,i=String(e).trim();for(let e=0;e<i.length;e++)i[e]===`(`?n++:i[e]===`)`?n--:/\s/.test(i[e])&&!n&&(e>r&&t.push(i.slice(r,e)),r=e+1);return r<i.length&&t.push(i.slice(r)),t},n=e=>e&&e!==`none`,r=[];if(n(e.translate)){let n=t(e.translate);for(let t=0;t<2&&t<n.length;t++){let r=t===0?e.width:e.height;/^[+-]?(?:\d*\.)?\d+%$/.test(n[t])&&Number.isFinite(r)&&(n[t]=`${parseFloat(n[t])*r/100}px`)}r.push(n.length>2?`translate3d(${n.join(`,`)})`:`translate(${n.join(`,`)})`)}if(n(e.rotate)&&e.rotate!==`0deg`){let n=t(e.rotate);n.length===4?r.push(`rotate3d(${n.join(`,`)})`):n.length===2&&/^[xyz]$/i.test(n[0])?r.push(`rotate${n[0].toUpperCase()}(${n[1]})`):r.push(`rotate(${n.join(` `)})`)}if(n(e.scale)){let n=t(e.scale).map(e=>/%$/.test(e)?String(parseFloat(e)/100):e);r.push(n.length>2?`scale3d(${n.join(`,`)})`:`scale(${n.join(`,`)})`)}if(n(e.baseTransform)&&r.push(e.baseTransform),!r.length)return new DOMMatrix;let i=r.join(` `);try{if(i.includes(`%`))throw Error(`Transform needs a reference box`);return new DOMMatrix(i)}catch{let t=Pc(),n=document.createElement(`div`);if(n.style.cssText=`all:initial!important;display:block!important;transform-origin:0 0!important`,n.style.setProperty(`width`,`${Number.isFinite(e.width)?e.width:0}px`,`important`),n.style.setProperty(`height`,`${Number.isFinite(e.height)?e.height:0}px`,`important`),n.style.setProperty(`transform`,i,`important`),!n.style.transform)throw Error(`[SnapDOM] Couldn't read the transform of an element.`);t.appendChild(n);try{return Lc(n)}finally{n.remove()}}}function Ic(e){let t=H(e),n=t.transform||`none`;if(n!==`none`&&!/^matrix\(\s*1\s*,\s*0\s*,\s*0\s*,\s*1\s*,\s*0\s*,\s*0\s*\)$/i.test(n))return!0;let r=t.rotate&&t.rotate!==`none`&&t.rotate!==`0deg`,i=t.scale&&t.scale!==`none`&&t.scale!==`1`,a=t.translate&&t.translate!==`none`&&t.translate!==`0px 0px`;return!!(r||i||a)}function Lc(e){let t=getComputedStyle(e).transform;if(!t||t===`none`)return new DOMMatrix;try{return new DOMMatrix(t)}catch{return new WebKitCSSMatrix(t)}}var Rc=new WeakSet;function zc(e,t){if(!t)return null;let n=e.ownerDocument||document,r=n.defaultView||window,i,a,o,s;if(t===`viewport`)i=0,a=0,o=n.documentElement?.clientWidth||r.innerWidth,s=n.documentElement?.clientHeight||r.innerHeight;else if(typeof t==`object`)i=(Number(t.x)||0)-(r.scrollX||0),a=(Number(t.y)||0)-(r.scrollY||0),o=Number(t.width),s=Number(t.height);else return null;return o>0&&s>0?{left:i,top:a,width:o,height:s,right:i+o,bottom:a+s}:null}function Bc(e){if(e.parentElement)return e.parentElement;let t=e.getRootNode&&e.getRootNode();return E(t)?t.host:null}function Vc(e,t){for(let n=t;n;n=Bc(n))if(n===e)return!0;return!1}function Hc(e,t){for(let n=Bc(e);n&&n!==t&&n?.nodeType===1;n=Bc(n)){let e=H(n);if(e.position!==`static`||Uc(e))return n}return null}function Uc(e){return e.transform&&e.transform!==`none`||e.filter&&e.filter!==`none`||e.backdropFilter&&e.backdropFilter!==`none`||e.perspective&&e.perspective!==`none`||/transform|perspective|filter/.test(e.willChange||``)||/layout|paint|strict|content/.test(e.contain||``)}var Wc=/(?:^|;)position:(absolute|fixed)(?:;|$)/;function Gc(e,t,n,r,i,a){if(e.scrollTop||e.scrollLeft)return;let o=r.get(e)||H(e);if(Uc(o))return;let s=o.position!==`static`,c=new Map;for(let[o,l]of t){let t=n.get(o);if(!t)continue;let u=c.get(t);if(u===void 0&&c.set(t,u=Wc.exec(t)?.[1]||``),!u||u===`absolute`&&s||Rc.has(o))continue;let d=!1;for(let t=Bc(l);t&&t!==e&&t.nodeType===1;t=Bc(t)){let e=r.get(t)||H(t);if(u===`absolute`&&e.position!==`static`||Uc(e)){d=!0;break}}if(d)continue;let f=r.get(l)||H(l),p=parseFloat(f.left),m=parseFloat(f.top);i&&Number.isFinite(p)&&(o.style.left=`${p+i}px`),a&&Number.isFinite(m)&&(o.style.top=`${m+a}px`)}}function Kc(e,t){try{return Fc({baseTransform:e,rotate:t?.rotate,scale:t?.scale})}catch{return null}}function qc(e,t,n,r,i){let a=e.getBoundingClientRect();w(t)&&H(e).position===`static`&&(t.style.position=`relative`);let o=[];for(let[t,s]of n){if(s?.nodeType!==1)continue;let n=t.localName===`svg`&&T(t)&&!T(s.parentNode);if(!w(t)&&!n||s===e||!Vc(e,s))continue;let c=r.get(s)||H(s),l=c.position;if(l!==`fixed`&&l!==`sticky`&&l!==`-webkit-sticky`||t.style.position===`absolute`)continue;let u=s.getBoundingClientRect();if(!(u.width>0&&u.height>0))continue;Rc.add(t);let d=c.transform&&c.transform!==`none`?c.transform:``,f=Mc(s),p=!!(d||f.rotate!==`0deg`||f.scale||f.translate),m=p?Kc(d,f):null,h=!m||!m.is2D||m.a===1&&m.b===0&&m.c===0&&m.d===1,g=u.width,_=u.height;h||(g=s.offsetWidth||u.width,_=s.offsetHeight||u.height);let v=s.getRootNode&&E(s.getRootNode()),y=a,b=e.clientLeft||0,x=e.clientTop||0;if(v){let t=Hc(s,e);t&&(y=t.getBoundingClientRect(),b=t.clientLeft||0,x=t.clientTop||0)}let S=u.left-y.left-b,C=u.top-y.top-x;if(p){if(t.style.translate=`none`,t.style.rotate=`none`,t.style.scale=`none`,h)t.style.transform=`none`;else{t.style.transform=`matrix(${m.a},${m.b},${m.c},${m.d},0,0)`;let{ox:e,oy:n}=jc(c,g,_),r=Ac(g,_,{a:m.a,b:m.b,c:m.c,d:m.d,e:0,f:0},e,n);S-=r.minX,C-=r.minY}}if(l!==`fixed`){let e=t.cloneNode(!1);e.setAttribute(`data-snap-ph`,`1`),e.style.position=`static`,e.style.visibility=`hidden`,e.style.width=`${g}px`,e.style.height=`${_}px`,e.style.boxSizing=`border-box`,t.parentElement?.insertBefore(e,t)}let D=n?g:g+2,O=_;i&&(Math.abs(C-i.y)<.5&&(--C,O+=1),Math.abs(S-i.x)<.5&&(--S,D+=1)),t.style.position=`absolute`,t.style.left=`${S}px`,t.style.top=`${C}px`,t.style.right=`auto`,t.style.bottom=`auto`,t.style.margin=`0`,t.style.width=`${D}px`,t.style.height=`${O}px`,t.style.boxSizing=`border-box`,v||o.push(t)}for(let e of o)t.appendChild(e)}function Jc(e,t,n={}){if(!e||!t||!t.style)return;let r=getComputedStyle(e);try{t.style.boxShadow=`none`}catch(e){G(n,`Couldn't remove the root box-shadow.`,e)}try{t.style.textShadow=`none`}catch(e){G(n,`Couldn't remove the root text-shadow.`,e)}try{t.style.outline=`none`}catch(e){G(n,`Couldn't remove the root outline.`,e)}let i=(r.filter||``).replace(/\bdrop-shadow\((?:[^()]|\([^()]*\))*\)\s*/gi,``).trim().replace(/\s+/g,` `);try{t.style.filter=i.length?i:`none`}catch(e){G(n,`Couldn't remove the root drop-shadow filter.`,e)}}function Yc(e,t){if(!e||!t||!t.style)return;let n=1;try{n=parseFloat(getComputedStyle(e).zoom)}catch{return}if(t.style.getPropertyValue(`zoom`)||Number.isFinite(n)&&n!==1)try{t.style.setProperty(`zoom`,`1`,`important`)}catch{}}function Xc(e){let t=e.display||``;if(t.includes(`flex`)||t.includes(`grid`)||t.startsWith(`table`)||t===`inline-block`||t===`flow-root`||e.position===`absolute`||e.position===`fixed`||e.float&&e.float!==`none`)return!0;let n=e.overflowX||e.overflow||`visible`,r=e.overflowY||e.overflow||`visible`;return!!(n!==`visible`||r!==`visible`||e.contain&&/\b(layout|content|paint|strict)\b/.test(e.contain))}function Zc(e,t){let n=Array.from(e.childNodes),r=t===`top`?n:n.reverse();for(let e of r){if(e.nodeType===Node.TEXT_NODE){if(/\S/.test(e.textContent||``))return null;continue}if(e.nodeType!==Node.ELEMENT_NODE)continue;let t=getComputedStyle(e),n=String(t.display||``);if(n!==`none`&&n!==`contents`&&t.position!==`absolute`&&t.position!==`fixed`)return t.float&&t.float!==`none`||n.startsWith(`inline`)?null:e}return null}function Qc(e,t,n){if(!e||!t||!t.style)return;let r=getComputedStyle(e);if(!Xc(r))for(let i of[`top`,`bottom`]){let a=i===`top`?`Top`:`Bottom`;if((parseFloat(r[`border${a}Width`])||0)>0||(parseFloat(r[`padding${a}`])||0)>0)continue;let o=e,s=t;for(;o&&s;){let e=Zc(o,i);if(!e)break;let t=n?Array.from(s.children).find(t=>n.get(t)===e)||null:s.children[Array.from(o.children).indexOf(e)]||null,r=getComputedStyle(e),c=parseFloat(r[`margin${a}`])||0;if(t&&t.style&&c>0&&(t.style[`margin${a}`]=`0px`),Xc(r)||(parseFloat(r[`border${a}Width`])||0)>0||(parseFloat(r[`padding${a}`])||0)>0)break;o=e,s=t}}}var $c=new Set([`xml`,`xlink`]);function el(e,t){if(e.startsWith(`*`)||e===`xmlns`||e.includes(`@`))return!0;if(e.includes(`:`)){let t=e.split(`:`,1)[0];if(!$c.has(t))return!0}return t?e.startsWith(`x-`)||e.startsWith(`v-`)||e.startsWith(`:`)||e.startsWith(`on:`)||e.startsWith(`bind:`)||e.startsWith(`let:`)||e.startsWith(`class:`):!1}var tl=/[\uD800-\uDBFF][\uDC00-\uDFFF]|[\x00-\x08\x0B\x0C\x0E-\x1F\uD800-\uDFFF\uFFFE\uFFFF]/g,nl=e=>e.replace(tl,e=>e.length===2?e:``),rl=/^data:[^,]{0,120};base64,/;function il(e,t={}){if(!e)return;let{stripFrameworkDirectives:n=!0}=t,r=e=>{for(let t of Array.from(e.attributes)){if(el(t.name,n)){e.removeAttribute(t.name);continue}if(rl.test(t.value))continue;let r=nl(t.value);if(r!==t.value)try{e.setAttribute(t.name,r)}catch{}}};e.nodeType===Node.ELEMENT_NODE&&r(e);let i=[],a=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT|NodeFilter.SHOW_COMMENT),o;for(;o=a.nextNode();)if(o.nodeType===Node.ELEMENT_NODE)r(o);else if(o.nodeType===Node.COMMENT_NODE)i.push(o);else{let e=nl(o.data);e!==o.data&&(o.data=e)}for(let e of i)e.remove()}function al(e){try{let t=e.getAttribute?.(`style`)||``;return/\b(height|width|block-size|inline-size)\s*:/.test(t)}catch{return!1}}var ol=new Set([`img`,`canvas`,`video`,`iframe`,`object`,`embed`]);function sl(e){return T(e)||ol.has(e?.localName)}function cl(e,t){if(e?.nodeType!==1||al(e)||sl(e))return!1;let n=t.position;if(n===`absolute`||n===`fixed`||n===`sticky`)return!1;let r=t.display||``;return!(r.includes(`flex`)||r.includes(`grid`)||r.startsWith(`table`)||t.transform&&t.transform!==`none`)}function ll(e,t,n=new Map,r=null){function i(e,t){if(e?.nodeType!==1||t?.nodeType!==1)return;let a=e.childElementCount>t.childElementCount,o=n.get(e)||getComputedStyle(e);if(n.has(e)||n.set(e,o),a&&cl(e,o)){t.style.height||(t.style.height=`auto`),t.style.width||(t.style.width=`auto`),t.style.removeProperty(`block-size`),t.style.removeProperty(`inline-size`),t.style.minHeight||(t.style.minHeight=`0`),t.style.minWidth||(t.style.minWidth=`0`),t.style.maxHeight||(t.style.maxHeight=`none`),t.style.maxWidth||(t.style.maxWidth=`none`);let e=o.overflowY||o.overflowBlock||`visible`,n=o.overflowX||o.overflowInline||`visible`;(e!==`visible`||n!==`visible`)&&(t.style.overflow=`visible`)}let s=Array.from(t.children);if(r)for(let e of s){let t=r.get(e);t&&t.nodeType===1&&i(t,e)}else{let t=Array.from(e.children);for(let e=0;e<Math.min(t.length,s.length);e++)i(t[e],s[e])}}i(e,t)}function ul(e){let t=getComputedStyle(e);return t.display!==`none`&&t.position!==`absolute`&&t.position!==`fixed`}function dl(e,t){if(e?.nodeType!==1)return!1;if(e.getAttribute(`data-capture`)===`exclude`)return t?.excludeMode===`remove`;if(Array.isArray(t?.exclude))for(let n of t.exclude)try{if(e.matches(n))return t.excludeMode===`remove`}catch(e){G(t,`Invalid exclude selector; ignored.`,e)}if(Array.isArray(t?.excludePredicates))for(let n of t.excludePredicates)try{if(n(e))return t.excludeMode===`remove`}catch(e){G(t,`Your exclude function threw; ignored.`,e)}if(typeof t?.filter==`function`&&t.filterMode===`remove`)try{if(!t.filter(e))return!0}catch(e){G(t,`Your filter function threw; ignored.`,e)}return!1}function fl(e,t){let n=getComputedStyle(e),r=e.getBoundingClientRect(),i=1/0,a=-1/0,o=!1,s=Array.from(e.children);for(let e of s){if(dl(e,t)||!ul(e))continue;let n=e.getBoundingClientRect(),s=n.top-r.top,c=n.bottom-r.top;c<=s||(s<i&&(i=s),c>a&&(a=c),o=!0)}let c=o?Math.max(0,a-i):0,l=parseFloat(n.borderTopWidth)||0,u=parseFloat(n.borderBottomWidth)||0,d=parseFloat(n.paddingTop)||0,f=parseFloat(n.paddingBottom)||0;return l+u+d+f+c}var Q=(e,t=3)=>Number.isFinite(e)?Math.round(e*10**t)/10**t:e;function pl(e){let t=document.implementation.createHTMLDocument(``),n=t.importNode(e,!0);for(let e of[n,...n.querySelectorAll(`*`)]){let r=e.localName.includes(`-`);if(!w(e)||!(r||e.hasAttribute(`is`)))continue;let i=t.createElement(r?`span`:e.localName);for(let t of e.attributes)t.name!==`is`&&i.setAttribute(t.name,t.value);i.append(...e.childNodes),e===n?n=i:e.replaceWith(i)}return n}function ml(e,t){try{let n=new e.ownerDocument.defaultView.CSSStyleSheet;n.replaceSync(t),e.adoptedStyleSheets=[n]}catch{let n=e.ownerDocument.createElement(`style`);n.textContent=t,e.appendChild(n)}}var hl=.75;function gl(e,t,n,r,i,a){let o=e.ownerDocument||document,s=e.getBoundingClientRect(),c=i>0&&s.width>0?s.width/i:1,l=a>0&&s.height>0?s.height/a:1;if(Math.abs(c-l)>.02)return 0;let u=o.createElement(`div`);V(u),u.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;width:`+i+`px!important;overflow:visible!important;visibility:hidden!important;`;let d=u.attachShadow({mode:`open`});ml(d,n);let f=pl(t);d.appendChild(f),o.body.appendChild(u);let p=0,m=[`paddingLeft`,`paddingRight`,`borderLeftWidth`,`borderRightWidth`],h=[`paddingTop`,`paddingBottom`,`borderTopWidth`,`borderBottomWidth`],g=(e,t,n)=>{let r=H(e),i=r.boxSizing===`border-box`,a=(e,t,n)=>{let a=parseFloat(e);if(!Number.isFinite(a))return t;let o=0;if(!i)for(let e of n)o+=parseFloat(r[e])||0;let s=a+o;return Math.abs(s-t)<=.51?s:t};return{width:a(r.width,t,m),height:a(r.height,n,h)}};try{let e=f.getBoundingClientRect(),n=f.offsetWidth||i,o=f.offsetHeight||a,s=n>0&&e.width>0?e.width/n:1,u=o>0&&e.height>0?e.height/o:1,d=(e,t,n=!1)=>{let i=e.children,a=t.children,o=Math.min(i.length,a.length);for(let e=0;e<o;e++){let t=i[e],o=a[e],f=r.get(t),m=n||Rc.has(t);if(f?.nodeType===1&&w(t)&&t.style&&f.isConnected){let e=f.getBoundingClientRect();if(e.width>0&&e.height>0){let n=o.getBoundingClientRect(),r=e.width/c,i=e.height/l,a=n.width,d=n.height,h=f.offsetWidth||r,_=f.offsetHeight||i,v=o.offsetWidth||a,y=o.offsetHeight||d,b=Math.abs(r-h)>hl||Math.abs(i-_)>hl||Math.abs(a-v)>hl||Math.abs(d-y)>hl;if(m){let e=g(o,v,y);r=a>0?r*s*e.width/a:r,i=d>0?i*u*e.height/d:i,a=e.width,d=e.height}else if(b){let e=g(f,h,_),t=g(o,v,y);r=e.width,i=e.height,a=t.width,d=t.height}let x=a-r,S=d-i;(Math.abs(x)>hl||Math.abs(S)>hl)&&(t.style.boxSizing=`border-box`,t.style.width=`${Q(r)}px`,t.style.height=`${Q(i)}px`,p++)}}d(t,o,m)}};d(t,f)}finally{u.remove()}return p}var _l=/::-(?:webkit-(?:scrollbar|meter|progress|slider)|moz-(?:meter|progress))/i;function vl(e,t=new Set){let n=``;if(!e)return n;for(let r=0;r<e.length;r++){let i=e[r];try{if(i.type===CSSRule.IMPORT_RULE&&i.styleSheet){n+=vl(i.styleSheet.cssRules,t);continue}if(i.type===CSSRule.MEDIA_RULE&&i.cssRules){let e=vl(i.cssRules,t);e&&(n+=`@media ${i.conditionText}{${e}}`);continue}if(i.type===CSSRule.STYLE_RULE){let e=i.selectorText||``;if(_l.test(e)){let e=i.cssText;e&&!t.has(e)&&(t.add(e),n+=e)}}}catch{}}return n}var yl=new WeakMap;function bl(e){let t=``;for(let n of e.styleSheets){let e=-1;try{e=n.cssRules?n.cssRules.length:-1}catch{}t+=(n.href||`inline`)+`:`+e+`|`}return t}function xl(e){if(!e||!e.styleSheets)return``;let t=bl(e),n=yl.get(e);if(n&&n.fp===t)return n.css;let r=new Set,i=``;for(let t of Array.from(e.styleSheets))try{let e=t.cssRules;e&&(i+=vl(e,r))}catch{}return yl.set(e,{fp:t,css:i}),i}function Sl(e,t){let n=We(e.clone).sort(),r=n.join(`,`),i=Hr(e.element),a=p.baseStyle.get(r),o;a&&a.universe===i?o=a.css:(o=Ge(n,i),p.baseStyle.set(r,{universe:i,css:o}));let s=xl(e.element?.ownerDocument||document);return e.fontsCSS=t,e.baseCSS=o,e.scrollbarCSS=s,{baseCSS:o,scrollbarCSS:s,fontsCSS:t}}var Cl=[[`max-width`,`x`],[`min-width`,`x`],[`max-height`,`y`],[`min-height`,`y`]];function wl(e,t,n){let r=null;for(let[i,a]of Cl){let o=n.getPropertyValue(i);if(!o.includes(`%`))continue;if(n.writingMode!==`horizontal-tb`)return;r||=Tl(e,n);let s=a===`x`?r.w:r.h,c=o.replace(/(-?\d*\.?\d+(?:e[+-]?\d+)?)%/gi,(e,t)=>`${s*t/100}px`),l=parseFloat(a===`x`?n.width:n.height);t.style.setProperty(i,Number.isFinite(l)?`${i.slice(0,3)}(${c}, ${l}px)`:c)}}function Tl(e,t){let n=e.ownerDocument,r=n.documentElement,i={w:r.clientWidth,h:r.clientHeight};if(t.position===`fixed`)return i;if(t.position===`absolute`){let t=e.offsetParent;return!t||(t===n.body||t===r)&&getComputedStyle(t).position===`static`?i:{w:t.clientWidth,h:t.clientHeight}}let a=e.parentElement;if(!a)return i;let o=getComputedStyle(a),s=e=>parseFloat(o.getPropertyValue(e))||0;return{w:a.clientWidth-s(`padding-left`)-s(`padding-right`),h:a.clientHeight-s(`padding-top`)-s(`padding-bottom`)}}W();var El=new Set,Dl=/^(?:IMG|VIDEO|CANVAS|IFRAME|EMBED|OBJECT|SVG|svg|INPUT|SELECT|TEXTAREA|BUTTON)$/,Ol=`[data-sd-ph]::placeholder{color:var(--sd-ph)!important;opacity:var(--sd-ph-o)!important;-webkit-text-fill-color:var(--sd-ph)!important}`;async function kl(e,t={}){Ar(),kr(e.ownerDocument||document);let n=t.__session||{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map},r={styleMap:n.styleMap,styleCache:n.styleCache,nodeMap:n.nodeMap,options:t,slicer:t.__slicer||null},i=null,a=null;if(t.clip&&(a=zc(e,t.clip),a&&(r.clip={rect:a,root:e})),t.captureSelection)try{r.selection=Ba(e)}catch(e){G(r,`Couldn't read the text selection.`,e)}let o,s=``,c=``;if(El.size){let t=(e,t)=>{for(let n=t;n;n=n.assignedSlot||n.parentElement||D(n))if(n===e)return!0;return!1};for(;;){let n=[...El].filter(({root:n})=>t(n,e)||t(e,n)).map(({promise:e})=>e.catch(()=>{}));if(!n.length)break;await Promise.all(n)}}if(!r.clip&&e.isConnected&&e.ownerDocument?.visibilityState!==`hidden`)try{let t=e.getBoundingClientRect(),n=e.ownerDocument?.defaultView||window,r=t.right<=0||t.bottom<=0||t.left>=n.innerWidth||t.top>=n.innerHeight,i=[];if(r&&(()=>{let t=[];e.shadowRoot&&t.push(e.shadowRoot);for(let n of e.querySelectorAll(`*`))n.shadowRoot&&t.push(n.shadowRoot);for(;t.length;){let e=t.pop(),n=e.host?.localName===`calcite-icon`;for(let r of e.querySelectorAll(`*`)){if(r.shadowRoot&&t.push(r.shadowRoot),!n||r.localName!==`svg`)continue;let e=r.querySelectorAll(`path`);if(!e.length||[...e].some(e=>e.getAttribute(`d`)?.trim()))continue;let a=r.getBoundingClientRect();a.width&&a.height&&i.push(r)}}})(),i.length){let t=(async()=>{let t=e.style,r=e.hasAttribute(`style`),a=new Map,o=(e,n)=>{a.has(e)||a.set(e,{value:t.getPropertyValue(e),priority:t.getPropertyPriority(e)}),t.setProperty(e,n,`important`);let r=a.get(e);r.forcedValue=t.getPropertyValue(e),r.forcedPriority=t.getPropertyPriority(e)};try{o(`left`,`0`),o(`top`,`0`),o(`right`,`auto`),o(`bottom`,`auto`),o(`margin-top`,`0`),o(`margin-right`,`0`),o(`margin-bottom`,`0`),o(`margin-left`,`0`),o(`transform`,`none`),o(`translate`,`none`),o(`opacity`,`0`),o(`pointer-events`,`none`);let t=e.getBoundingClientRect();if(t.right<=0||t.bottom<=0||t.left>=n.innerWidth||t.top>=n.innerHeight){let t=e.parentElement?.getBoundingClientRect(),r=t&&t.right>0&&t.left<n.innerWidth?Math.max(0,t.left):0,i=t&&t.bottom>0&&t.top<n.innerHeight?Math.max(0,t.top):0;o(`position`,`fixed`),o(`left`,`${r}px`),o(`top`,`${i}px`)}await pt(100);let r=Date.now()+1500,a=()=>i.some(e=>{if([...e.querySelectorAll(`path`)].some(e=>e.getAttribute(`d`)?.trim()))return!1;let t=e.getBoundingClientRect();return t.width&&t.height&&t.right>0&&t.bottom>0&&t.left<n.innerWidth&&t.top<n.innerHeight});for(;Date.now()<r&&a();)await new Promise(e=>setTimeout(e,25));await pt(100)}finally{for(let[e,n]of a)t.getPropertyValue(e)!==n.forcedValue||t.getPropertyPriority(e)!==n.forcedPriority||(n.value?t.setProperty(e,n.value,n.priority):t.removeProperty(e));!r&&!t.length&&e.removeAttribute(`style`),await pt(100)}})(),r={root:e,promise:t};El.add(r);try{await t}finally{El.delete(r)}}}catch{}let l=_c(e),u=vc(e,a);if(a){let t=e.getBoundingClientRect(),n=e.offsetWidth||t.width,r=e.offsetHeight||t.height,o=t.width&&Math.abs(n-t.width)>=1?n/t.width:1,s=t.height&&Math.abs(r-t.height)>=1?r/t.height:1;i={x:(a.left-t.left)*o,y:(a.top-t.top)*s,width:a.width*o,height:a.height*s}}try{o=await So(e,r,t)}catch(e){throw G(r,`Capture failed while copying the element.`,e),e}finally{u(),l()}Pa(r.nodeMap,e.ownerDocument||document),r.slicer?.due()&&await r.slicer.pause();try{pc(o,void 0,e)}catch(e){K(n,`svg-defs-failed`,`external <use> references failed to inline`,e),G(r,`Couldn't copy external SVG icons; some may be missing.`,e)}try{await cc(e,o,r,t)}catch(e){K(n,`pseudo-failed`,`::before/::after pass failed`,e),G(r,`Couldn't copy ::before/::after content; some decorations may be missing.`,e)}r.bgClipText&&dc(r.bgClipText),await Aa(o,r);for(let[e,t]of r.nodeMap.entries())if(t?.tagName===`STYLE`&&e?.tagName===`STYLE`&&!e.hasAttribute(`data-sd`))try{let n=t.sheet&&t.sheet.cssRules;n&&/@media/i.test(e.textContent||``)&&(e.textContent=sa(n))}catch{}try{let e=o.querySelectorAll(`style[data-sd]`);for(let t of e)c+=t.textContent||``,t.remove()}catch(e){G(r,`Couldn't copy shadow DOM styles.`,e)}r.slicer?.due()&&await r.slicer.pause();let d=Ke(r.styleMap);s=Array.from(d.entries()).map(([e,t])=>`.${t}{${e}}`).join(``);let f=c+`[data-snapdom-has-after]::after,[data-snapdom-has-before]::before{content:none!important;display:none!important}`+(r.__usesPlaceholder?Ol:``)+(r.__pseudoCSS||``);s=f+s;for(let[e,t]of r.styleMap.entries())jl(e,t,d);try{Al(e,o,r.nodeMap)}catch(e){G(r,`Couldn't bring an open dialog or popover into the capture.`,e)}if((r.clip||e.scrollTop||e.scrollLeft)&&o?.nodeType===1)try{let t=r.clip&&i?{x:i.x,y:i.y}:{x:0,y:0};qc(e,o,r.nodeMap,r.styleCache,t)}catch(e){G(r,`Couldn't keep fixed-position elements in place.`,e)}for(let[t,n]of r.nodeMap.entries())r.clip&&n===e&&e===e.ownerDocument.scrollingElement||Ml(t,n,r.nodeMap,r.styleCache);let p=e.ownerDocument;if((e===p.body||e===p.documentElement)&&p.documentElement.localName===`html`){let t=r.styleCache.get(p.documentElement)||H(p.documentElement);e===p.documentElement&&(o.style.overflow=`visible`);let n=e===p.body?o:o.querySelector(`body`);if(n&&t.overflowX===`visible`&&t.overflowY===`visible`&&t.contain===`none`&&!t.containerType?.includes(`size`)&&t.contentVisibility!==`auto`&&t.contentVisibility!==`hidden`){let e=r.styleCache.get(p.body)||H(p.body);e.contain===`none`&&!e.containerType?.includes(`size`)&&e.contentVisibility!==`auto`&&e.contentVisibility!==`hidden`&&e.display!==`none`&&(n.style.overflow=`visible`)}}if(e===r.nodeMap.get(o)){let t=r.styleCache.get(e)||H(e);r.styleCache.set(e,t);let n=v(t.transform);if(o.style.margin=`0`,o.style.top=`auto`,o.style.left=`auto`,o.style.right=`auto`,o.style.bottom=`auto`,o.style.animation=`none`,o.style.transition=`none`,o.style.willChange=`auto`,o.style.float=`none`,o.style.clear=`none`,o.style.transform=n||``,o.style.translate=`none`,(/^inline-/.test(t.display)||t.display===`inline`&&Dl.test(e.tagName))&&(o.style.verticalAlign=`top`),wl(e,o,t),!o.hasAttribute(`lang`)){let t=e.closest?.(`[lang]`)?.getAttribute(`lang`)??e.ownerDocument?.documentElement?.getAttribute(`lang`);t&&o.setAttribute(`lang`,t)}}for(let[e,t]of r.nodeMap.entries())t.tagName===`PRE`&&(e.style.marginTop=`0`,e.style.marginBlockStart=`0`);return{clone:o,classCSS:s,classPrefixCSS:f,styleCache:r.styleCache,nodeMap:r.nodeMap,reconcileRisk:r.reconcileRisk||0,clipWindow:i}}function Al(e,t,n){let r=[];for(let t of[`:modal`,`:popover-open`])try{r.push(...e.querySelectorAll(t))}catch{}if(!r.length)return;let i=new Map;for(let[e,t]of n.entries())i.set(t,e);let a=214748e4;for(let e of r){let n=i.get(e);if(n&&n!==t&&n.parentNode!=null){try{let n=getComputedStyle(e,`::backdrop`),r=n.backgroundColor,i=n.backgroundImage;if(r&&r!==`rgba(0, 0, 0, 0)`&&r!==`transparent`||i&&i!==`none`){let e=document.createElement(`div`);e.setAttribute(`data-sd-backdrop`,``),e.style.cssText=`position:fixed;inset:0;z-index:${a};background-color:${r};`+(i&&i!==`none`&&i.includes(`data:`)?`background-image:${i};`:``),t.appendChild(e)}}catch{}a+=1,n.style.zIndex=String(a),t.appendChild(n),a+=1}}}function jl(e,t,n){if(e.tagName===`STYLE`)return;if(e.getRootNode&&E(e.getRootNode())){e.setAttribute(`style`,t.replace(/;/g,`; `));return}let r=n.get(t);r&&e.classList.add(r);let i=e.style?.backgroundImage;i&&i!==`none`&&(e.style.backgroundImage=i)}function Ml(e,t,n,r){let i=t.scrollLeft,a=t.scrollTop;if(!(i||a)||e?.nodeType!==1||e.namespaceURI!==`http://www.w3.org/1999/xhtml`)return;e.style.overflow=`hidden`,e.style.scrollbarWidth=`none`,e.style.msOverflowStyle=`none`;try{let o=e.querySelectorAll(`*`);for(let e of o){if(e.nodeType!==1||e.namespaceURI!==`http://www.w3.org/1999/xhtml`)continue;let o=n?.get(e),s=o&&(r?.get(o)||H(o)),c=e.style.position||s?.position;if(c!==`fixed`&&c!==`absolute`)continue;let l=s&&s.position!==`absolute`&&c===`absolute`,u=null;if(o&&!l)for(let e=o.parentElement||D(o);e;e=e.parentElement||D(e)){let n=r?.get(e)||H(e);if(c===`absolute`&&n.position!==`static`||n.transform&&n.transform!==`none`||n.translate&&n.translate!==`none`||n.rotate&&n.rotate!==`none`||n.scale&&n.scale!==`none`||n.filter&&n.filter!==`none`||n.backdropFilter&&n.backdropFilter!==`none`||n.perspective&&n.perspective!==`none`||/transform|perspective|filter/.test(n.willChange||``)||/layout|paint|strict|content/.test(n.contain||``)){u=e;break}if(e===t)break}if(u){u===t&&(e.style.top=s.top,e.style.left=s.left,e.style.right=s.right,e.style.bottom=s.bottom);continue}let d=parseFloat(e.style.top||s?.top)||0,f=parseFloat(e.style.left||s?.left)||0;e.style.top=`${d+a}px`,e.style.left=`${f+i}px`,c===`fixed`&&(e.style.position=`absolute`)}}catch{}let o=document.createElement(`div`);for(o.style.all=`unset`,o.style.direction=`inherit`,o.style.transform=`translate(${-i}px, ${-a}px)`,o.style.willChange=`transform`,o.style.display=`inline-block`,o.style.width=`100%`;e.firstChild;)o.appendChild(e.firstChild);e.appendChild(o)}z(),q(),m();var Nl=`http://www.w3.org/1999/xlink`;function Pl(e){return e.getAttribute(`href`)||e.getAttribute(`xlink:href`)||(typeof e.getAttributeNS==`function`?e.getAttributeNS(Nl,`href`):null)}function Fl(e){let t=parseFloat(e.dataset?.snapdomWidth||``)||0,n=parseFloat(e.dataset?.snapdomHeight||``)||0,r=parseInt(e.getAttribute(`width`)||``,10)||0,i=parseInt(e.getAttribute(`height`)||``,10)||0,a=parseFloat(e.style?.width||``)||0,o=parseFloat(e.style?.height||``)||0;return{width:t||a||r||e.width||e.naturalWidth||100,height:n||o||i||e.height||e.naturalHeight||100}}async function Il(e,t={}){let n=Array.from(e.querySelectorAll(`img`));e.tagName===`IMG`&&n.unshift(e);let r=async e=>{if(!e.getAttribute(`src`)){let t=e.currentSrc||e.src||Qi(e.getAttribute(`srcset`),e)||``;t&&e.setAttribute(`src`,t)}if(e.removeAttribute(`srcset`),e.removeAttribute(`sizes`),(e.getAttribute(`src`)||``).startsWith(`data:`)){e.width||=e.naturalWidth||100,e.height||=e.naturalHeight||100;return}let n=e.src||``;if(!n)return;let r=p.image?.get(n);if(r){e.src=r,e.width||=e.naturalWidth||100,e.height||=e.naturalHeight||100;return}let i=await L(n,{as:`dataURL`,useProxy:t.useProxy,debug:t.debug});if(i.ok&&typeof i.data==`string`&&i.data.startsWith(`data:`)){p.image?.set(n,i.data),e.src=i.data,i.blob&&(e.__snapdomBlob=i.blob),e.width||=e.naturalWidth||100,e.height||=e.naturalHeight||100;return}let{width:a,height:o}=Fl(e),{fallbackURL:s}=t||{};if(s)try{let r=typeof s==`function`?await s({width:a,height:o,src:n,element:e}):s;if(r){let n=await L(r,{as:`dataURL`,useProxy:t.useProxy,debug:t.debug});if(n?.ok&&typeof n.data==`string`){e.src=n.data,e.width||=a,e.height||=o;return}}}catch{}if(t.placeholders!==!1){K(t.__session,`image-fallback`,`image failed to inline, using placeholder: ${n}`);let r=document.createElement(`div`);r.style.cssText=[`width:${a}px`,`height:${o}px`,`background:#ccc`,`display:inline-block`,`text-align:center`,`line-height:${o}px`,`color:#666`,`font-size:12px`,`overflow:hidden`].join(`;`),r.textContent=`img`,e.replaceWith(r)}else{let t=document.createElement(`div`);t.style.cssText=`display:inline-block;width:${a}px;height:${o}px;visibility:hidden;`,e.replaceWith(t)}};for(let e=0;e<n.length;e+=6){let t=n.slice(e,e+6).map(r);await Promise.allSettled(t)}let i=Array.from(e.querySelectorAll(`image`));e.localName===`image`&&i.unshift(e);let a=async e=>{let n=Pl(e);if(!n||n.startsWith(`data:`)||n.startsWith(`blob:`))return;let r=await L(n,{as:`dataURL`,useProxy:t.useProxy,debug:t.debug});r.ok&&typeof r.data==`string`&&r.data.startsWith(`data:`)&&(e.setAttribute(`href`,r.data),e.removeAttribute(`xlink:href`),typeof e.removeAttributeNS==`function`&&e.removeAttributeNS(Nl,`href`))};for(let e=0;e<i.length;e+=6){let t=i.slice(e,e+6).map(a);await Promise.allSettled(t)}}W(),J();var Ll=[`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`],Rl=[`mask-position`,`mask-size`,`mask-repeat`,`mask-mode`,`mask-composite`,`-webkit-mask-position`,`-webkit-mask-size`,`-webkit-mask-repeat`,`-webkit-mask-composite`,`mask-origin`,`mask-clip`,`-webkit-mask-origin`,`-webkit-mask-clip`,`-webkit-mask-position-x`,`-webkit-mask-position-y`],zl=[`background-position`,`background-position-x`,`background-position-y`,`background-size`,`background-repeat`,`background-origin`,`background-clip`,`background-attachment`,`background-blend-mode`],Bl=[`border-image-slice`,`border-image-width`,`border-image-outset`,`border-image-repeat`];async function Vl(e,t,n,r){let i=n.get(e)||H(e);n.has(e)||n.set(e,i);let a=Pr(e),o=a?e=>e in a?a[e]:``:e=>i.getPropertyValue(e),s=o(`border-image`),c=o(`border-image-source`),l=s&&s!==`none`||c&&c!==`none`,u=i.getPropertyValue(`background-image`),d=o(`background-color`),f=u&&u!==`none`||d&&d!==`rgba(0, 0, 0, 0)`&&d!==`transparent`||/url\s*\(|gradient\s*\(/i.test(i.getPropertyValue(`background`)||``),p=gt()&&(o(`background-clip`)||o(`-webkit-background-clip`)||``).includes(`text`);if(f&&!p)for(let e of zl){let n=o(e);n&&t.style.setProperty(e,n)}for(let e of Ll){if(p&&e===`background-image`)continue;let n=i.getPropertyValue(e);if(e===`background-image`&&(!n||n===`none`)){let e=i.getPropertyValue(`background`);e&&/url\s*\(/.test(e)&&(n=Ye(e).filter(e=>/url\s*\(/.test(e)).join(`, `)||n)}if(!n||n===`none`)continue;let a=Ye(n),o=await Promise.all(a.map(e=>ue(e,r)));o.some(e=>e&&e!==`none`&&!/^url\(undefined/.test(e))&&t.style.setProperty(e,o.join(`, `))}for(let e of Rl){let n=o(e);!n||n===`initial`||t.style.setProperty(e,n)}if(l)for(let e of Bl){let n=o(e);!n||n===`initial`||t.style.setProperty(e,n)}if(f&&/fixed/.test(o(`background-attachment`)||``))try{await Ul(e,t,i)}catch{}}function Hl(e,t,n,r,i){let a=(e||`auto`).trim();if(a===`cover`||a===`contain`){if(!t||!n)return{w:r,h:i};let e=a===`cover`?Math.max(r/t,i/n):Math.min(r/t,i/n);return{w:t*e,h:n*e}}let o=a.split(/\s+/),s=(e,t)=>{if(e===`auto`||e===void 0)return null;if(e.endsWith(`px`))return parseFloat(e);if(e.endsWith(`%`))return t*parseFloat(e)/100},c=s(o[0],r),l=s(o[1],i);if(c===void 0||l===void 0)return null;let u=c,d=l;return u==null&&d==null?(u=t||r,d=n||i):u==null?u=t&&n?t/n*d:r:d??=t&&n?n/t*u:i,!u||!d?null:{w:u,h:d}}async function Ul(e,t,n){let r=(n.getPropertyValue(`background-attachment`)||``).split(`,`).map(e=>e.trim()),i=ht();if(!i)for(let t=e.parentElement;t&&!i;t=t.parentElement){let e=H(t);(e.transform&&e.transform!==`none`||e.filter&&e.filter!==`none`)&&(i=!0)}if(i){t.style.setProperty(`background-attachment`,r.map(()=>`scroll`).join(`, `));return}let a=e.getBoundingClientRect(),o=e.ownerDocument?.defaultView||window,s=o.innerWidth,c=o.innerHeight,l=Ye(t.style.backgroundImage||n.getPropertyValue(`background-image`)||``),u=(t.style.backgroundSize||n.getPropertyValue(`background-size`)||`auto`).split(`,`).map(e=>e.trim()),d=(t.style.backgroundPosition||n.getPropertyValue(`background-position`)||`0% 0%`).split(`,`).map(e=>e.trim()),f=[],p=[];for(let e=0;e<l.length;e++){let t=r[e%r.length]||`scroll`,n=u[e%u.length],i=d[e%d.length];if(t!==`fixed`){f.push(n),p.push(i);continue}let o=0,m=0,h=l[e]&&l[e].match(/url\(["']?([^"')]+)["']?\)/);if(h)try{let e=new Image;e.src=h[1],await e.decode(),o=e.naturalWidth,m=e.naturalHeight}catch{f.push(n),p.push(i);continue}let g=Hl(n,o,m,s,c);if(!g){f.push(n),p.push(i);continue}let _=i.split(/\s+/),v=(e,t,n)=>{if(!e)return 0;if(e.endsWith(`px`))return parseFloat(e);if(e.endsWith(`%`))return(t-n)*parseFloat(e)/100},y=v(_[0]||`0%`,s,g.w),b=v(_[1]||_[0]||`0%`,c,g.h);if(y===void 0||b===void 0){f.push(n),p.push(i);continue}f.push(`${Wl(g.w)}px ${Wl(g.h)}px`),p.push(`${Wl(y-a.left)}px ${Wl(b-a.top)}px`)}t.style.setProperty(`background-size`,f.join(`, `)),t.style.setProperty(`background-position`,p.join(`, `)),t.style.setProperty(`background-attachment`,r.map(()=>`scroll`).join(`, `))}var Wl=e=>Math.round(e*100)/100;async function Gl(e,t,n,r={},i=new Map){if(!t)return;let a=[];e&&Nr(e)&&a.push([e,t]);let o=[t];for(;o.length;){let e=o.pop();if(e.children)for(let t of e.children){if(t.tagName===`STYLE`)continue;let e=i.get(t);e&&Nr(e)&&a.push([e,t]),o.push(t)}}for(let e=0;e<a.length;e+=6)await Promise.allSettled(a.slice(e,e+6).map(([e,t])=>Vl(e,t,n,r)))}J();function Kl(e,t,n=new Map){let r=[],i=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT);for(let e=i.currentNode;e;e=i.nextNode()){let i=n.get(e);if(i?.nodeType!==1)continue;let a=H(i),o=a.getPropertyValue(`backdrop-filter`)||a.getPropertyValue(`-webkit-backdrop-filter`);o&&o!==`none`&&e!==t&&r.push({cloneEl:e,orig:i,bf:o,path:Zl(t,e)})}if(!r.length)return;let a=e.getBoundingClientRect(),o=r.map((e,i)=>{let a=t.cloneNode(!0);Xl(a,t,e.orig.getBoundingClientRect(),n),$l(Ql(a,e.path));for(let e=0;e<i;e++){let t=Ql(a,r[e].path);t&&(t.style.setProperty(`backdrop-filter`,`none`,`important`),t.style.setProperty(`-webkit-backdrop-filter`,`none`,`important`))}return{...e,copy:a}});for(let{cloneEl:e,orig:t,bf:n,copy:r}of o)ql.has(e.tagName)||Jl(e,t,n,r,a)}var ql=new Set([`IMG`,`INPUT`,`TEXTAREA`,`SELECT`,`CANVAS`,`VIDEO`,`AUDIO`,`IFRAME`,`EMBED`,`OBJECT`,`PROGRESS`,`METER`,`HR`,`BR`]);function Jl(e,t,n,r,i){let a=t.getBoundingClientRect();if(!a.width||!a.height)return;let o=H(t),s=t.offsetWidth?a.width/t.offsetWidth:1,c=Math.abs(s-1)>.001?1/s:1;r.style.position=`absolute`,r.style.left=`${(i.left-a.left)*c}px`,r.style.top=`${(i.top-a.top)*c}px`,r.style.width=`${i.width}px`,r.style.height=`${i.height}px`,r.style.margin=`0`,r.style.filter=n,c!==1&&(r.style.transform=`scale(${c})`,r.style.transformOrigin=`top left`);let l=document.createElement(`div`);l.style.cssText=`position:absolute;inset:0;overflow:hidden;border-radius:inherit;z-index:-2`,l.appendChild(r);let u=document.createElement(`div`);u.style.cssText=`position:absolute;inset:0;border-radius:inherit;z-index:-1`,u.style.backgroundColor=o.backgroundColor,u.style.backgroundImage=e.style.backgroundImage||o.backgroundImage;for(let e of[`background-size`,`background-position`,`background-repeat`,`background-origin`,`background-clip`])u.style.setProperty(e,o.getPropertyValue(e));e.style.setProperty(`background-color`,`transparent`,`important`),e.style.setProperty(`background-image`,`none`,`important`),e.style.setProperty(`backdrop-filter`,`none`,`important`),e.style.setProperty(`-webkit-backdrop-filter`,`none`,`important`),o.position===`static`&&(e.style.position=`relative`),e.style.isolation=`isolate`,e.prepend(u),e.prepend(l)}var Yl=128;function Xl(e,t,n,r){let i=[[e,t]];for(;i.length;){let[e,t]=i.pop(),a=r.get(t);if(a?.nodeType===1){let t=a.getBoundingClientRect();(t.left>n.right+Yl||t.right<n.left-Yl||t.top>n.bottom+Yl||t.bottom<n.top-Yl)&&(e.tagName===`IMG`&&e.setAttribute(`src`,`data:image/gif;base64,R0lGODlhAQABAAAAACwAAAAAAQABAAA=`),e.style&&(e.style.backgroundImage=`none`))}let o=e.children,s=t.children;for(let e=0;e<o.length;e++)i.push([o[e],s[e]])}}function Zl(e,t){let n=[];for(let r=t;r!==e;r=r.parentElement){if(!r?.parentElement)return null;n.push([...r.parentElement.children].indexOf(r))}return n.reverse()}function Ql(e,t){if(!t)return null;let n=e;for(let e of t)if(n=n.children[e],!n)return null;return n}function $l(e){if(e)for(let t=e;t&&t.parentNode;){let n=t.parentNode;for(;t.nextSibling;)t.nextSibling.remove();t===e&&t.remove(),t=n}}J(),W(),m(),m();function eu(e){return d(e),{styleMap:new Map,styleCache:new WeakMap,nodeMap:new Map,warnings:[]}}q(),W();function tu(e,t){if(!e)return()=>{};let n=[];function r(e){if(t){let n=e.getBoundingClientRect();if(n.width>0||n.height>0){let r=Math.max(n.right,n.left+(e.scrollWidth||0)),i=Math.max(n.bottom,n.top+(e.scrollHeight||0));if(r<t.left-200||n.left>t.right+200||i<t.top-200||n.top>t.bottom+200)return}}let i=getComputedStyle(e),a=nu(e,i);a&&n.push(a);let o=ru(e,i);o&&n.push(o);for(let t of e.children||[])r(t)}return r(e),()=>n.forEach(e=>e())}function nu(e,t){if(!e)return()=>{};t||=getComputedStyle(e);let n=du(t);if(n<=0||!mu(e))return()=>{};let r=au(e),i=r.text,a=pu(t);r.write(`X`);let o=e.scrollHeight-a;r.restore();let s=o>0?o:fu(t),c=Math.round(s*n+a),l=.5*(n+1);if(e.scrollHeight<=c+l)return()=>{};let u=0,d=i.length,f=-1;for(;u<=d;){let t=u+d>>1;r.write(i.slice(0,ou(i,t))+`…`),e.scrollHeight<=c+l?(f=t,u=t+1):d=t-1}let p=(f>=0?i.slice(0,ou(i,f)):``)+`…`;return r.write(p),iu(e,p,r)}function ru(e,t){if(!e||(t||=getComputedStyle(e),t.textOverflow!==`ellipsis`)||t.whiteSpace!==`nowrap`&&t.whiteSpace!==`pre`||t.overflowX!==`hidden`&&t.overflowX!==`clip`||!mu(e)||e.scrollWidth<=e.clientWidth+.5)return()=>{};let n=au(e),r=n.text,i=uu(e,t,n.nodes),a=e=>{if(!i){let t=ou(r,e);return r.slice(0,t)+lu(r,t)+`…`}let t=su(r,r.length-e);return lu(r,t)+r.slice(t)+`…`},o=0,s=r.length,c=-1;for(;o<=s;){let t=o+s>>1;n.write(a(t)),e.scrollWidth<=e.clientWidth+.5?(c=t,o=t+1):s=t-1}let l=c>=0?a(c):`…`;return n.write(l),iu(e,l,n)}function iu(e,t,n){return()=>{e.textContent===t&&n.restore()}}function au(e){let t=[];for(let n=e.firstChild;n;n=n.nextSibling)n.nodeType===Node.TEXT_NODE&&t.push(n);let n=t.map(e=>e.data);return{nodes:t,text:n.join(``),write(e){t[0].data=e;for(let e=1;e<t.length;e++)t[e].data=``},restore(){for(let e=0;e<t.length;e++)t[e].data=n[e]}}}function ou(e,t){if(t<=0||t>=e.length)return t;let n=e.charCodeAt(t-1);return n>=55296&&n<=56319?t-1:t}function su(e,t){if(t<=0||t>=e.length)return t;let n=e.charCodeAt(t);return n>=56320&&n<=57343?t-1:t}var cu=/[\u0600-\u08FF\u1800-\u18AF\uFB50-\uFDFF\uFE70-\uFEFF]/;function lu(e,t){return t>0&&t<e.length&&cu.test(e[t-1])&&cu.test(e[t])&&!U()?``:``}function uu(e,t,n){let r=null,i=null;for(let e of n){let t=e.data.search(/\S/);t<0||(r||=[e,t],i=[e,e.data.length-e.data.trimEnd().length])}if(!r)return!1;let a=e.ownerDocument.createRange(),o=(e,t,n)=>(a.setStart(e,t),a.setEnd(e,n),a.getBoundingClientRect()),[s,c]=r,[l,u]=i,d=l.data.length-u,f=o(s,c,Math.min(s.data.length,c+1)),p=o(l,Math.max(0,d-1),d),m=e.getBoundingClientRect();if(t.direction===`rtl`){let e=m.right-(parseFloat(t.borderRightWidth)||0)-(parseFloat(t.paddingRight)||0);return Math.abs(p.right-e)<Math.abs(f.right-e)}let h=m.left+(parseFloat(t.borderLeftWidth)||0)+(parseFloat(t.paddingLeft)||0);return Math.abs(p.left-h)<Math.abs(f.left-h)}function du(e){let t=e.getPropertyValue(`-webkit-line-clamp`)||e.getPropertyValue(`line-clamp`);t=(t||``).trim();let n=parseInt(t,10);return Number.isFinite(n)&&n>0?n:0}function fu(e){let t=(e.lineHeight||``).trim(),n=parseFloat(e.fontSize)||16;return!t||t===`normal`?Math.round(n*1.2):t.endsWith(`px`)?parseFloat(t):/^\d+(\.\d+)?$/.test(t)?Math.round(parseFloat(t)*n):t.endsWith(`%`)?Math.round(parseFloat(t)/100*n):Math.round(n*1.2)}function pu(e){return(parseFloat(e.paddingTop)||0)+(parseFloat(e.paddingBottom)||0)}function mu(e){return e.childElementCount>0?!1:Array.from(e.childNodes).some(e=>e.nodeType===Node.TEXT_NODE)}var hu=[`clone`,`render`],gu={clone:0,render:1},_u=`render`;function vu(e){let t=Array.isArray(e&&e.plugins)?e.plugins:[];if(!t.length)return{stage:_u,loweredBy:[]};let n=-1,r=[];for(let e of t){if(!e||typeof e!=`object`)continue;let t=e.needs===void 0?_u:e.needs;if(!Object.prototype.hasOwnProperty.call(gu,t))throw Error(`[SnapDOM] Plugin '${e.name||`(unnamed)`}' declares needs: ${JSON.stringify(t)}, expected one of ${hu.join(`, `)}.`);r.push({name:e.name||`(unnamed)`,needs:t}),n=Math.max(n,gu[t])}if(n<0)return{stage:_u,loweredBy:[]};let i=hu[n];return{loweredBy:i===`render`?[]:r.filter(e=>e.needs===i).map(e=>e.name),stage:i}}function yu(e,t){return gu[e]>=gu[t]}function bu(e,t,n){let r=t.length?t.map(e=>`'${e}'`).join(`, `):`the attached plugins`;return Error(`[SnapDOM] No ${n}: this capture stopped at '${e}' because ${r} asked for needs: '${e}'. It is not re-captured, since that would be a different instant. Ask the plugin for needs: 'render', or capture without it.`)}var xu=[];function Su(e){if(!e)return null;if(Array.isArray(e)){let[t,n]=e;return typeof t==`function`?t(n):t}if(typeof e==`object`&&`plugin`in e){let{plugin:t,options:n}=e;return typeof t==`function`?t(n):t}return typeof e==`function`?e():e}function Cu(...e){let t=e.flat();for(let e of t){let t=Su(e);if(t){if(t.needs!==void 0&&t.needs!==`render`)throw Error(`[SnapDOM] '${t.name||`(unnamed)`}' declares needs: ${JSON.stringify(t.needs)}, so it can't be a global plugin (it would stop every capture before '${_u}'). Pass it per capture: snapdom(el, { plugins: [...] }).`);xu.some(e=>e&&e.name&&t.name&&e.name===t.name)||xu.push(t)}}}function wu(e){return e&&Array.isArray(e.plugins)?e.plugins:xu}async function Tu(e,t,n){let r=n,i=wu(t);for(let n of i){let i=n&&typeof n[e]==`function`?n[e]:null;if(!i)continue;let a=await i(t,r);typeof a<`u`&&(r=a)}return r}async function Eu(e,t,n){let r=[],i=wu(t);for(let a of i){let i=a&&typeof a[e]==`function`?a[e]:null;if(!i)continue;let o=await i(t,n);typeof o<`u`&&r.push(o)}return r}var Du=0;function Ou(e){let t=[];if(Array.isArray(e))for(let n of e){let e=Su(n);if(!e)continue;e.name||=`anonymous-${++Du}`;let r=t.findIndex(t=>t&&t.name===e.name);r>=0&&t.splice(r,1),t.push(e)}for(let e of xu)e&&e.name&&!t.some(t=>t.name===e.name)&&t.push(e);return Object.freeze(t)}function ku(e,t,n=!1){return!e||e.plugins&&!n||(e.plugins=Ou(t)),e}function Au(){return xu.slice()}var ju=[`resolveNode`,`beforeSnap`,`beforeClone`,`afterClone`,`beforeRender`,`afterRender`];function Mu(e){let t=Array.isArray(e&&e.plugins)?e.plugins:[];for(let e of t){let t=Su(e);if(t&&t.pure!==!0){for(let e of ju)if(typeof t[e]==`function`)return!0}}return!1}m(),ft();var Nu=`data-snapdom-asset`,Pu=`http://www.w3.org/1999/xlink`,Fu=0;function Iu(e,t,n,r,i,a){let o=a.__compressedAssets||=new WeakMap,s=o.get(e);s||(s={token:String(++Fu),properties:[]},o.set(e,s),e.setAttribute(Nu,s.token));let c=s.properties.find(e=>e.kind===t&&e.name===n);c?(c.compressed!==r&&(c.original=r),c.compressed=i):s.properties.push({kind:t,name:n,original:r,compressed:i})}var Lu=(e,t)=>t.kind===`style`?e.style?.getPropertyValue(t.name):e.getAttribute(t.name);function Ru(e,t){let n=new Map;if(!e||!t)return n;let r=[e,...e.querySelectorAll(`[${Nu}]`)];for(let e of r){let r=t.get(e);if(!r||e.getAttribute(Nu)!==r.token)continue;let i=r.properties.filter(t=>Lu(e,t)===t.compressed).map(e=>Object.freeze({...e}));i.length&&n.set(r.token,Object.freeze(i))}return n}function zu(e,t){if(!e||!t)return;let n=0;for(let r of[e,...e.querySelectorAll(`[${Nu}]`)]){let e=t.get(r);e&&(e.token=String(++n),r.setAttribute(Nu,e.token))}}function Bu(e,t){if(!t?.size||typeof e!=`string`||!e.startsWith(`data:image/svg+xml`))return e;let n=e.indexOf(`,`),r=new DOMParser().parseFromString(decodeURIComponent(e.slice(n+1)),`image/svg+xml`);if(r.querySelector(`parsererror`))return e;let i=!1;for(let e of r.querySelectorAll(`[${Nu}]`))for(let n of t.get(e.getAttribute(Nu))||[])Lu(e,n)===n.compressed&&(n.kind===`style`?e.style.setProperty(n.name,n.original,e.style.getPropertyPriority(n.name)):n.name===`xlink:href`?e.setAttributeNS(Pu,n.name,n.original):e.setAttribute(n.name,n.original),i=!0);return i?`data:image/svg+xml;charset=utf-8,${encodeURIComponent(new XMLSerializer().serializeToString(r))}`:e}function Vu(e){if(e.is2D===!1)return 1/0;let t=e.a*e.a+e.b*e.b+e.c*e.c+e.d*e.d,n=e.a*e.d-e.b*e.c;return Math.sqrt((t+Math.sqrt(Math.max(0,t*t-4*n*n)))/2)}function Hu(e,t){let n=t.element||e,r=n.isConnected?H(n):n.style,i=t.__compressionClip,a=(e,t)=>{try{return e[t]?.baseVal?.value||0}catch{return 0}},o=i?.width||n.offsetWidth||parseFloat(r?.width)||a(n,`width`),s=i?.height||n.offsetHeight||parseFloat(r?.height)||a(n,`height`),c=Number.isFinite(t.width),l=Number.isFinite(t.height);if(!i&&(c||l)&&o&&s)try{let e=t.outerTransforms===!1&&t.__compressionRootTransform?t.__compressionRootTransform:Fc({baseTransform:r?.transform,rotate:r?.rotate,scale:r?.scale,width:o,height:s});if(e.is2D===!1)o=0,s=0;else{let t=Math.abs(e.a)*o+Math.abs(e.c)*s,n=Math.abs(e.b)*o+Math.abs(e.d)*s;o=Math.min(o,t),s=Math.min(s,n)}}catch{o=0,s=0}let u=(c||l?Math.max(c?o?t.width/o:1/0:0,l?s?t.height/s:1/0:0):t.scale||1)*(t.dpr||1);t.__compressionDensity=u;let d=new WeakMap,f=e=>{if(!e||e.nodeType!==1)return 1;if(d.has(e))return d.get(e);let t=e.isConnected?H(e):e.style,r=1;try{t?.perspective&&t.perspective!==`none`&&(r=1/0);let i=t?.transform;if(i&&i!==`none`)r*=Vu(new DOMMatrix(i));else if(e.transform?.baseVal?.numberOfItems){let t=new DOMMatrix;for(let n=0;n<e.transform.baseVal.numberOfItems;n++){let r=e.transform.baseVal.getItem(n).matrix;t=t.multiply(new DOMMatrix([r.a,r.b,r.c,r.d,r.e,r.f]))}r*=Vu(t)}if(t?.scale&&t.scale!==`none`){let e=t.scale.trim().split(/\s+/).map(e=>parseFloat(e)/(e.endsWith(`%`)?100:1));r*=Math.max(...e.map(Math.abs))}if(e!==n&&t?.zoom&&t.zoom!==`normal`&&(r*=parseFloat(t.zoom)||1),e.localName===`svg`&&e.viewBox?.baseVal?.width>0&&e.viewBox.baseVal.height>0){let n=e.viewBox.baseVal,i=n=>/^\d+(?:\.\d+)?px$/.test(t?.[n]||``)?parseFloat(t[n]):a(e,n),o=i(`width`),s=i(`height`);r*=o>0&&s>0?Math.max(o/n.width,s/n.height):1/0}}catch{r=1/0}return Number.isFinite(r)||(r=1/0),e!==n&&(r*=f(e.parentElement||e.getRootNode?.().host)),d.set(e,r),r};return{density:u,stretch:f}}var Uu=.92,Wu=1;async function Gu(e){let t=new Image;return t.decoding=`sync`,t.src=e,typeof t.decode==`function`?(await t.decode(),t):(await new Promise((e,n)=>{t.onload=()=>e(),t.onerror=n}),t)}function Ku(e){let t=/^data:([^;,]+)/.exec(e);return t?t[1]:``}var qu=65536,Ju=33554432,Yu=new Map;function Xu(e,t,n,r){if(n.length+(r?.length||0)>Ju)return;e.set(t,{source:n,result:r});let i=0;for(let t of e.values())i+=t.source.length+(t.result?.length||0);for(;i>Ju;){let t=e.keys().next().value,n=e.get(t);i-=n.source.length+(n.result?.length||0),e.delete(t)}}function Zu(e,t){let n=e.indexOf(`,`);if(n<0||!/;base64/i.test(e.slice(0,n)))return null;let r=Math.ceil(t/3)*4,i=e.length-n-1,a=Math.min(i,r);try{let t=atob(e.slice(n+1,n+1+a-a%4)),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);return r}catch{return null}}function Qu(e){let t=Zu(e,4096);if(!t||t.length<16)return null;let n=e=>t[e]<<8|t[e+1];if(t[0]===137&&t[1]===80&&t.length>=24)return{w:(t[16]<<24|t[17]<<16|t[18]<<8|t[19])>>>0,h:(t[20]<<24|t[21]<<16|t[22]<<8|t[23])>>>0};if(t[0]===71&&t[1]===73&&t[2]===70)return{w:t[6]|t[7]<<8,h:t[8]|t[9]<<8};if(t[0]===82&&t[1]===73&&t[8]===87&&t.length>=30){let e=t[15];if(e===32&&t[23]===157)return{w:(t[26]|t[27]<<8)&16383,h:(t[28]|t[29]<<8)&16383};if(e===76)return{w:(t[21]|(t[22]&63)<<8)+1,h:((t[22]>>6|t[23]<<2|(t[24]&15)<<10)&16383)+1};if(e===88)return{w:(t[24]|t[25]<<8|t[26]<<16)+1,h:(t[27]|t[28]<<8|t[29]<<16)+1}}if(t[0]===255&&t[1]===216){let e=2;for(;e+9<t.length;){if(t[e]!==255){e++;continue}let r=t[e+1];if(r===216||r===1||r>=208&&r<=215){e+=2;continue}if(r>=192&&r<=207&&r!==196&&r!==200&&r!==204)return{h:n(e+5),w:n(e+7)};let i=n(e+2);if(i<2)break;e+=2+i}}return null}function $u(e,t,n,r){let i=Math.min(1,Math.max(n/e,r/t));return!(i>0)||i>=.95?0:i}var ed=`self.onmessage = async (e) => {
|
|
12
|
+
const { id, dataURL, blob: given, srcLength, targetW, targetH, resFactor, quality, mime } = e.data
|
|
13
|
+
try {
|
|
14
|
+
const blob = given || await (await fetch(dataURL)).blob()
|
|
15
|
+
const bmp = await createImageBitmap(blob)
|
|
16
|
+
const nw = bmp.width, nh = bmp.height
|
|
17
|
+
if (!nw || !nh) { bmp.close(); self.postMessage({ id, url: null }); return }
|
|
18
|
+
const raw = Math.min(1, Math.max(targetW / nw, targetH / nh))
|
|
19
|
+
if (!(raw > 0) || raw >= 0.95) { bmp.close(); self.postMessage({ id, url: null }); return }
|
|
20
|
+
const factor = raw * resFactor
|
|
21
|
+
const ow = Math.max(1, Math.round(nw * factor))
|
|
22
|
+
const oh = Math.max(1, Math.round(nh * factor))
|
|
23
|
+
const canvas = new OffscreenCanvas(ow, oh)
|
|
24
|
+
const ctx = canvas.getContext('2d')
|
|
25
|
+
ctx.imageSmoothingEnabled = true
|
|
26
|
+
ctx.imageSmoothingQuality = 'high'
|
|
27
|
+
ctx.drawImage(bmp, 0, 0, ow, oh)
|
|
28
|
+
bmp.close()
|
|
29
|
+
const out = await canvas.convertToBlob({ type: mime, quality })
|
|
30
|
+
const url = new FileReaderSync().readAsDataURL(out)
|
|
31
|
+
self.postMessage({ id, url: (url && url.length < srcLength) ? url : null })
|
|
32
|
+
} catch (err) {
|
|
33
|
+
self.postMessage({ id, error: String(err) })
|
|
34
|
+
}
|
|
35
|
+
}`,td=Math.max(1,Math.min(4,(typeof navigator<`u`&&navigator.hardwareConcurrency||2)-1)),nd=null,rd=0,id=0,ad=new Map;function od(){for(let e of ad.values())e(void 0);if(ad.clear(),Array.isArray(nd))for(let e of nd)try{e?.terminate()}catch{}nd=!1}function sd(){let e,t=null;try{e=URL.createObjectURL(new Blob([ed],{type:`text/javascript`})),t=new Worker(e),t.onmessage=e=>{let t=ad.get(e.data.id);t&&(ad.delete(e.data.id),t(e.data.error?void 0:e.data.url??null))},t.onerror=od}catch{t=null}return e&&URL.revokeObjectURL(e),t}function cd(){if(nd===!1)return!1;if(nd===null){if(typeof Worker>`u`||typeof OffscreenCanvas>`u`)return nd=!1;nd=[]}let e=rd++%td;if(!nd[e]){let t=sd();if(!t)return od(),!1;nd[e]=t}return nd[e]}var ld=5e3;function ud(e,t,n,r,i){let a=cd();return a?new Promise(o=>{let s=++id,c=setTimeout(()=>{ad.delete(s),o(void 0)},ld);ad.set(s,e=>{clearTimeout(c),o(e)});try{a.postMessage({id:s,dataURL:i?``:e,blob:i,srcLength:e.length,targetW:t,targetH:n,resFactor:Wu,quality:Uu,mime:r})}catch{clearTimeout(c),ad.delete(s),o(void 0)}}):Promise.resolve(void 0)}async function dd(e,t,n,r){if(typeof e!=`string`||!e.startsWith(`data:image`)||e.startsWith(`data:image/svg`))return null;t=Math.ceil(t),n=Math.ceil(n);let i=e.length+`:`+e.slice(0,64)+e.slice(-64)+`:`+t+`x`+n,a=p.compress,o=a.get(i);if(o?.source===e)return o.result;let s=Yu.get(i);if(s?.source===e&&s.cache===a)return s.promise;let c=(async()=>{let i=Ku(e),a=i===`image/jpeg`?`image/jpeg`:i===`image/webp`?`image/webp`:`image/png`,o=Qu(e);if(o&&o.w>0&&o.h>0&&!$u(o.w,o.h,t,n))return null;if(e.length>=qu){let i=await ud(e,t,n,a,r);if(i!==void 0)return i}let s;try{s=await Gu(e)}catch{return null}let c=s.naturalWidth||s.width,l=s.naturalHeight||s.height;if(!c||!l)return null;let u=$u(c,l,t,n);if(!u)return null;let d=u*Wu,f=Math.max(1,Math.round(c*d)),p=Math.max(1,Math.round(l*d)),m=document.createElement(`canvas`);m.width=f,m.height=p;let h=m.getContext(`2d`);if(!h)return null;h.imageSmoothingEnabled=!0,h.imageSmoothingQuality=`high`,h.drawImage(s,0,0,f,p);try{let t=m.toDataURL(a,Uu);if(typeof t==`string`&&t.startsWith(`data:image`)&&t.length<e.length)return t}catch{}return null})(),l={source:e,promise:c,cache:a};Yu.set(i,l);try{let t=await c;return Xu(a,i,e,t),t}finally{Yu.get(i)===l&&Yu.delete(i)}}async function fd(e,t,n=new Map,r={}){if(!t.compress)return{count:0,before:0,after:0};let i=Array.from(e.querySelectorAll(`img`));e.tagName===`IMG`&&i.unshift(e);let a=0,o=0,s=0,c=async i=>{let c=i.getAttribute(`src`)||``;if(!c.startsWith(`data:image`)||c.startsWith(`data:image/svg`))return;let l=parseFloat(i.dataset.snapdomWidth)||parseFloat(i.style.width)||i.width||0,u=parseFloat(i.dataset.snapdomHeight)||parseFloat(i.style.height)||i.height||0;if(!l||!u)return;let d=r.value||=Hu(e,t),f=d.density*d.stretch(n.get(i)||i),p=await dd(c,l*f,u*f,i.__snapdomBlob);p&&(a++,o+=c.length,s+=p.length,i.setAttribute(`src`,p),Iu(i,`attribute`,`src`,c,p,t))};for(let e=0;e<i.length;e+=6)await Promise.allSettled(i.slice(e,e+6).map(c));return{count:a,before:o,after:s}}var pd=/^(cover|contain|(\d+(\.\d+)?%(\s+\d+(\.\d+)?%)?))$/;function md(e){return{w:e.offsetWidth||e.getBoundingClientRect().width||0,h:e.offsetHeight||e.getBoundingClientRect().height||0}}async function hd(e,t,n=new Map,r={}){if(!t.compress)return{count:0};let i=[],a=[e,...e.querySelectorAll(`*`)];for(let e of a){let t=e.style&&e.style.backgroundImage;t&&t.includes(`data:image`)&&i.push(e)}let o=0,s=async i=>{let a=n.get(i);if(!a||!a.isConnected)return;let s;try{s=getComputedStyle(a)}catch{return}if((s.backgroundRepeat||`repeat`).toLowerCase().split(`,`).some(e=>e.trim()!==`no-repeat`))return;let c=(i.style.backgroundSize||s.backgroundSize||`auto`).toLowerCase();if(c.split(`,`).some(e=>!pd.test(e.trim())))return;let{w:l,h:u}=md(a);if(!l||!u)return;let d=Math.max(1,...(c.match(/\d+(?:\.\d+)?%/g)||[]).map(e=>parseFloat(e)/100)),f=r.value||=Hu(e,t),p=f.density*f.stretch(a)*d,m=l*p,h=u*p,g=i.style.backgroundImage,_=[...g.matchAll(/url\((['"]?)(data:image\/[^)'"]+)\1\)/gi)],v=g;for(let e of _){let t=e[2];if(t.startsWith(`data:image/svg`))continue;let n=await dd(t,m,h);n&&(v=v.split(t).join(n),o++)}v!==g&&(i.style.setProperty(`background-image`,v,i.style.getPropertyPriority(`background-image`)),Iu(i,`style`,`background-image`,g,i.style.backgroundImage,t))};for(let e=0;e<i.length;e+=6)await Promise.allSettled(i.slice(e,e+6).map(s));return{count:o}}async function gd(e,t,n=new Map,r={}){if(!t.compress)return{count:0};let i=Array.from(e.querySelectorAll(`image`));e.localName===`image`&&i.unshift(e);let a=0,o=async i=>{let o=i.getAttribute(`href`)||(typeof i.getAttributeNS==`function`?i.getAttributeNS(`http://www.w3.org/1999/xlink`,`href`):null);if(!o||!o.startsWith(`data:image`)||o.startsWith(`data:image/svg`))return;let s=i.getAttribute(`width`)||``,c=i.getAttribute(`height`)||``;if(s.includes(`%`)||c.includes(`%`))return;let l=n.get(i),u=l?H(l):i.style,d=(e,t)=>{if(/^\d+(?:\.\d+)?px$/.test(u?.[e]||``))return parseFloat(u[e]);if(/^\d+(?:\.\d+)?(?:px)?$/.test(t.trim()))return parseFloat(t);try{return l?.[e]?.baseVal?.value||0}catch{return 0}},f=d(`width`,s),p=d(`height`,c);if(!f||!p)return;let m=r.value||=Hu(e,t),h=m.density*m.stretch(l||i),g=await dd(o,f*h,p*h);g&&(i.setAttribute(`href`,g),Iu(i,`attribute`,`href`,o,g,t),i.hasAttribute(`xlink:href`)&&(i.setAttributeNS(Pu,`xlink:href`,g),Iu(i,`attribute`,`xlink:href`,o,g,t)),a++)};for(let e=0;e<i.length;e+=6)await Promise.allSettled(i.slice(e,e+6).map(o));return{count:a}}async function _d(e,t,n){if(!t.compress)return;let r={};await fd(e,t,n,r),await hd(e,t,n,r),await gd(e,t,n,r)}J(),m(),q(),Le();function vd(e,t,n,r){return e>t+.5?e-n:r-n}function yd(e){let t=e=>e&&e!==`transparent`&&!/^rgba\(.*,\s*0\)$/.test(e),n=H(e.documentElement).backgroundColor,r=t(n)?n:H(e.body).backgroundColor;return t(r)?`;background-color:${r} !important`:``}var bd=/(?:^|;)(?:box-shadow|text-shadow|outline-style|filter|-webkit-filter):/;function xd(e,t){if(U())return e;let n=e.indexOf(`</style>`);if(n===-1)return e;let r=/<style\b[^>]*>[\s\S]*?<\/style>/g,i=[],a=n,o;for(r.lastIndex=n;o=r.exec(e);)i.push({text:e.slice(a,o.index),intern:!0}),i.push({text:o[0],intern:!1}),a=r.lastIndex;i.push({text:e.slice(a),intern:!0});let s=new Map,c=/ style="([^"]*)"/g,l;for(let e of i)if(e.intern)for(c.lastIndex=0;l=c.exec(e.text);)s.set(l[1],(s.get(l[1])||0)+1);let u=0;for(let[e,t]of s)t>1&&(u+=(t-1)*e.length);if(u<2048||e.includes(` data-sdi=`))return e;let d=Sd(t,i.some(e=>!e.intern),e.includes(`data-snapdom-asset`));if(d===null)return e;let f=new Map,p=0,m=[],h=(e,t)=>{if((s.get(t)||0)<2||d.has(t))return e;let n=f.get(t);return n===void 0&&(n=`i`+(p++).toString(36),f.set(t,n),m.push(`[data-sdi="${n}"]{${t}}`)),` data-sdi="${n}"`},g=``;for(let e of i)g+=e.intern?e.text.replace(c,h):e.text;return e.slice(0,n)+m.join(``)+g}function Sd(e,t,n){let r=new Set;if(!t&&!n)return r;if(!e||e.querySelector(`[data-sdi]`))return null;let i=e=>{let t=e.getAttribute(`style`);t&&r.add(t)};if(n&&e.querySelectorAll(`[data-snapdom-asset][style]`).forEach(i),t)try{let t=n=>{for(let r of n){if(r.type===CSSRule.IMPORT_RULE||r.type===CSSRule.NAMESPACE_RULE)throw Error(`External or namespaced CSS`);if(r.selectorText){if(/\[\s*style\b|data-sdi|\[[^\]]*\\|&/i.test(r.selectorText))throw Error(`Attribute-dependent or nested CSS`);e.querySelectorAll(r.selectorText).forEach(i)}r.cssRules&&t(r.cssRules)}};for(let n of[...e.querySelectorAll(`style`)].slice(1)){let e=n.textContent||``;if(/@import\b/i.test(e))return null;let r=new CSSStyleSheet;r.replaceSync(e),t(r.cssRules)}}catch{return null}let a=new Set,o=document.createElement(`div`),s=new XMLSerializer;for(let e of r){o.setAttribute(`style`,e);let t=s.serializeToString(o).match(/ style="([^"]*)"/);t&&a.add(t[1])}return a}async function Cd(e,t){let{clipWindow:n,outerTransforms:r,outerShadows:i,rootTransform2D:a,fontsCSS:o}=t,s=e.options;if(e!==s){let{options:t,...n}=e;e=Object.assign(s,n),Object.defineProperty(e,"options",{value:e,configurable:!0})}let c,l;Sl(e,o),await Tu(`beforeRender`,e);let u=H(e.element),d=e.element.getBoundingClientRect(),f=Math.max(1,Q(e.element.offsetWidth||parseFloat(u.width)||d.width||1)),m=Math.max(1,Q(e.element.offsetHeight||parseFloat(u.height)||d.height||1)),h=e.element.ownerDocument||document,g=!n&&(e.element===h.body||e.element===h.documentElement)&&!e.__pinned,_=null,v=null,y=0;if(g){let t=Math.max(e.element.scrollHeight||0,h.documentElement?.scrollHeight||0,h.body?.scrollHeight||0),n=Math.max(e.element.scrollWidth||0,h.documentElement?.scrollWidth||0,h.body?.scrollWidth||0),r=Math.max(f,Q(n)),a=e.element===h.body,o=a&&H(h.documentElement).direction===`rtl`,s=e=>{e>0&&(o?y=Math.max(y,Q(e-d.width)):f=Math.max(f,Q(e)))};if(a&&h.documentElement){let r=h.documentElement.getBoundingClientRect(),a={top:Math.max(0,d.top-r.top),right:Math.max(0,r.right-d.right),bottom:Math.max(0,r.bottom-d.bottom),left:Math.max(0,d.left-r.left)};if(_=a,i!==`subtree`&&(a.top||a.right||a.bottom||a.left)){let t=e.__session?.styleMap,n=new Map,r=new Map;for(let[i,a]of e.nodeMap){let e=t?.get(i);if(e){let t=n.get(e);if(t===void 0&&n.set(e,t=bd.test(e)),!t)continue}r.set(i,a)}let i=Oc(e.element,r,e.styleCache,d.width>0?f/d.width:1,d.height>0?m/d.height:1);v={top:Math.min(i.top,a.top),right:Math.min(i.right,a.right),bottom:Math.min(i.bottom,a.bottom),left:Math.min(i.left,a.left)}}t=Math.max(e.element.scrollHeight||0,vd(t,r.height,d.top-r.top,d.bottom-r.top)),n=Math.max(e.element.scrollWidth||0,o?vd(n,r.width,r.right-d.right,r.right-d.left):vd(n,r.width,d.left-r.left,d.right-r.left))}t>0&&(m=Math.max(m,Q(t))),s(n);try{let i=(e.scrollbarCSS||``).length+(e.baseCSS||``).length+(e.fontsCSS||``).length+(e.classCSS||``).length,c=p.measureHints.get(e.element);if(c&&c.cssLen===i&&c.w0===r&&c.docH===t&&c.docW===n)c.csh>0&&(m=Math.max(m,Q(c.csh))),s(c.csw);else{let c=h.createElement(`div`);V(c),c.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;width:`+r+`px!important;overflow:visible!important;visibility:hidden!important;`;let l=c.attachShadow({mode:`open`});ml(l,(e.scrollbarCSS||``)+e.baseCSS+`svg{overflow:visible;} foreignObject{overflow:visible;}`+e.classCSS);let u=l.appendChild(pl(e.clone));h.body.appendChild(c);let d=c.scrollHeight,f=c.scrollWidth;if(a){let e=c.getBoundingClientRect(),t=u.getBoundingClientRect();d=vd(d,e.height,t.top-e.top,t.bottom-e.top),f=o?vd(f,e.width,e.right-t.right,e.right-t.left):vd(f,e.width,t.left-e.left,t.right-e.left)}h.body.removeChild(c),p.measureHints.set(e.element,{cssLen:i,w0:r,docH:t,docW:n,csh:d,csw:f}),d>0&&(m=Math.max(m,Q(d))),s(f)}}catch{}}if(e.options?.excludeMode===`remove`||typeof e.options?.filter==`function`&&e.options.filterMode===`remove`){let t=fl(e.element,e.options),n=fl(e.element,{}),r=Math.max(2,m*.15);Number.isFinite(n)&&n>=m-r&&Number.isFinite(t)&&t>0&&(m=Math.max(1,Math.min(m,Q(t+1))))}if(e.options?.reconcile)try{let t=(e.scrollbarCSS||``)+e.baseCSS+`svg{overflow:visible;} foreignObject{overflow:visible;}`+e.classCSS;gl(e.element,e.clone,t,e.nodeMap,f,m)}catch(t){K(e.options.__session,`reconcile-failed`,`reconcile pass failed`,t),G(e.options,`reconcile couldn't run; captured without it.`,t)}let b=(e,t=NaN)=>{let n=typeof e==`string`?parseFloat(e):e;return Number.isFinite(n)?n:t},x=b(e.options.width),S=b(e.options.height),C=n?Q(n.width):f,w=n?Q(n.height):m,T=C,E=w,D=Number.isFinite(x),O=Number.isFinite(S),k=w>0?C/w:1;D&&O?(T=Math.max(1,Q(x)),E=Math.max(1,Q(S))):D?(T=Math.max(1,Q(x)),E=Math.max(1,Q(T/(k||1)))):O&&(E=Math.max(1,Q(S)),T=Math.max(1,Q(E*(k||1))));let A=0,j=0,M=f,N=m;if(n){let t=0,i=0;if(wd(e.element)){let n=null;if(!r&&a&&Number.isFinite(a.a))n={a:a.a,b:a.b||0,c:a.c||0,d:a.d||1,e:0,f:0};else{let t=Mc(e.element),r=Kc(u.transform&&u.transform!==`none`?u.transform:``,t);r&&r.is2D&&(n={a:r.a,b:r.b,c:r.c,d:r.d,e:0,f:0})}if(n&&(n.a!==1||n.b!==0||n.c!==0||n.d!==1)){let{ox:e,oy:r}=jc(u,f,m),a=Ac(f,m,n,e,r);t=a.minX,i=a.minY}}A=Q(n.x+t),j=Q(n.y+i),M=Q(A+n.width),N=Q(j+n.height)}else if(!r&&a&&Number.isFinite(a.a)){let e={a:a.a,b:a.b||0,c:a.c||0,d:a.d||1,e:0,f:0},t=Ac(f,m,e,0,0);A=Q(t.minX),j=Q(t.minY),M=Q(t.maxX),N=Q(t.maxY)}else if(r&&wd(e.element)){let t=u.transform&&u.transform!==`none`?u.transform:``,n=Mc(e.element),r=Fc({baseTransform:t,rotate:n.rotate||`0deg`,scale:n.scale,translate:n.translate,width:f,height:m}),{ox:i,oy:a}=jc(u,f,m),o=r.is2D?r:new DOMMatrix(r.toString()),s={a:o.a,b:o.b,c:o.c,d:o.d,e:0,f:0},c=Ac(f,m,s,i,a);A=Q(c.minX),j=Q(c.minY),M=Q(c.maxX),N=Q(c.maxY)}let ee=yc(u),P=bc(u),F=Sc(u),te=Cc(u),ne=wc(u),re=d.width>0?(M-A)/d.width:1,ie=d.height>0?(N-j)/d.height:1,I=i===`subtree`&&!n?Oc(e.element,e.nodeMap,e.styleCache,re,ie):{top:0,right:0,bottom:0,left:0};v&&(I={top:v.top,right:Math.max(0,v.right-(f-d.width)),bottom:Math.max(0,v.bottom-(m-d.height)),left:v.left}),y>0&&(I={...I,left:Math.max(I.left,y)});let ae=n?{top:0,right:0,bottom:0,left:0}:i?{top:Q(Math.max(ee.top,P.top,I.top)+F.top+te.top+ne.bleed.top),right:Q(Math.max(ee.right,P.right,I.right)+F.right+te.right+ne.bleed.right),bottom:Q(Math.max(ee.bottom,P.bottom,I.bottom)+F.bottom+te.bottom+ne.bleed.bottom),left:Q(Math.max(ee.left,P.left,I.left)+F.left+te.left+ne.bleed.left)}:{top:Q(F.top+I.top),right:Q(F.right+I.right),bottom:Q(F.bottom+I.bottom),left:Q(F.left+I.left)};A=Q(A-ae.left),j=Q(j-ae.top),M=Q(M+ae.right),N=Q(N+ae.bottom);let oe=Math.max(1,Q(M-A)),L=Math.max(1,Q(N-j)),se=`http://www.w3.org/2000/svg`,ce=Q((wd(e.element)?2:0)+ +!r),le=s.__subpixel?.x||0,R=s.__subpixel?.y||0,z=Math.ceil(oe+ce*2+le),ue=Math.ceil(L+ce*2+R),de=Q(-(Q(A)-ce)),fe=Q(-(Q(j)-ce)),pe=Math.max(0,de)+le,me=Math.max(0,fe)+R,he=Q(z-Math.min(0,de)),ge=Q(ue-Math.min(0,fe)),_e=h.defaultView||window,ve=!U()&&CSS.supports(`zoom`,`2`)?Td(_e):1;s.__layoutZoom=ve;let B=document.createElementNS(se,`foreignObject`);B.setAttribute(`x`,String(Math.min(0,de)*ve)),B.setAttribute(`y`,String(Math.min(0,fe)*ve)),B.setAttribute(`width`,String(he*ve)),B.setAttribute(`height`,String(ge*ve)),B.style.overflow=`visible`;let ye=document.createElement(`style`);ye.textContent=(e.scrollbarCSS||``)+e.baseCSS+e.fontsCSS+`svg{overflow:visible;} foreignObject{overflow:visible;} foreignObject>div{-webkit-text-size-adjust:100%!important;text-size-adjust:100%!important;}`+e.classCSS,B.appendChild(ye);let be=document.createElement(`div`);be.setAttribute(`xmlns`,`http://www.w3.org/1999/xhtml`),be.style.cssText=`all:initial;box-sizing:border-box;display:block;overflow:visible;width:${s.__subpixel?Q(pe+d.width):he}px;height:${ge}px`+(pe!==0||me!==0?`;padding:${me}px 0 0 ${pe}px !important`:``)+(ve===1?``:`;zoom:${ve} !important`)+`;direction:ltr !important`+(_?yd(h):``),_&&(pe!==_.left||me!==_.top)&&e.__session&&Gc(e.element,e.nodeMap,e.__session.styleMap,e.styleCache,pe-_.left,me-_.top),be.appendChild(e.clone),B.appendChild(be);let xe=new XMLSerializer().serializeToString(B),Se=D||O,Ce=Object.freeze({w0:C,h0:w,vbW:z,vbH:ue,targetW:T,targetH:E,contentX:Q(de+(n?A:0)),contentY:Q(fe+(n?j:0)),clip:n?Object.freeze({x:Q(A),y:Q(j),width:C,height:w}):null});Object.defineProperty(s,"meta",{value:Ce,enumerable:!0,writable:!1,configurable:!0});let we=!Se||U()?z:D?T:Q(E/ue*z),Te=!Se||U()?ue:O?E:Q(T/z*ue),Ee=parseFloat(H(h.documentElement)?.fontSize)||16,De=ve!==1,Oe=`<svg xmlns="${se}" width="${we}" height="${Te}" viewBox="0 0 ${z} ${ue}" font-size="${Ee}px">${De?`<g transform="scale(${1/ve})">`:``}`,ke=De?`</g></svg>`:`</svg>`;l=Oe+xd(xe,B)+ke,c=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(l)}`,e.svgString=l,e.dataURL=c,s.__artifacts={classCSS:e.classCSS||``,fontsCSS:e.fontsCSS||``,baseCSS:e.baseCSS||``,scrollbarCSS:e.scrollbarCSS||``},await Tu(`afterRender`,e),e.clone=e.nodeMap=e.styleCache=e.svgString=null;let Ae=[...document.querySelectorAll(`#snapdom-sandbox`)].find(Fe);return Ae&&Ae.style.position===`absolute`&&Ae.remove(),e.dataURL}function wd(e){return Ic(e)}function Td(e){let t=e.devicePixelRatio||1;if(t===1)return 1;let n=e.document,r=t;try{let t=n.createElement(`div`);V(t),t.style.cssText=`position:absolute!important;left:-9999px!important;top:0!important;width:0!important;height:0!important;visibility:hidden!important;pointer-events:none!important;border:0 solid transparent!important;border-top-width:0.5px!important`,(n.body||n.documentElement).appendChild(t);let i=parseFloat(e.getComputedStyle(t).borderTopWidth);t.remove(),i>=1&&(r=1)}catch{}return r}function Ed(e){let t=Array.isArray(e.plugins)?e.plugins:Au(),n=[];for(let e of t){let t=Su(e);t&&typeof t.resolveNode==`function`&&n.push(t.resolveNode.bind(t))}return n.length?n:null}async function Dd(e,t){if(!e)throw Error(`[SnapDOM] The element cannot be null or undefined.`);t.__session=eu(t.cache),delete t.__compressedAssets,delete t.__compressedSnapshot,delete t.__compressionDensity,t.__resolveNodeHooks=Ed(t);let n=t;n.element=e,Object.defineProperty(n,"options",{value:n,configurable:!0});let r,i,a,o,s,c,l,u=``,d=null,f=t.needs||`render`,m=n.format,h=n.type;await Tu(`beforeSnap`,n);let g=n.format!==m&&/^(?:png|jpe?g|webp|svg)$/i.test(n.format),_=n.type!==h&&/^(?:png|jpe?g|webp|svg)$/i.test(n.type);if(g||_){let e=String(g?n.format:n.type).toLowerCase();n.format=e===`jpg`?`jpeg`:e,n.type=n.format,n.__explicitFormat=n.format,/^(?:jpeg|webp)$/.test(n.format)&&(n.backgroundColor==null||n.backgroundColor===`transparent`)&&(n.backgroundColor=`#ffffff`)}await Tu(`beforeClone`,n);let v=n.outerTransforms!==!1,y=n.outerShadows===`subtree`?`subtree`:!!n.outerShadows,b=n.clip?zc(n.element,n.clip):null;if(t.__styleShare===void 0)try{t.__styleShare=Br(n.element)&&(typeof n.element.getAnimations!=`function`||n.element.getAnimations({subtree:!0}).length===0)}catch{t.__styleShare=!1}let x=mt(t.fast);for(;;){t.__slicer=x;let e=tu(n.element,b);try{({clone:r,classCSS:i,classPrefixCSS:a,styleCache:o,nodeMap:s,reconcileRisk:c,clipWindow:l}=await kl(n.element,n.options)),c>0&&!t.reconcile&&(K(t.__session,`reconcile-risk`,`text in inline/table-cell elements kept natural width and may re-wrap; pass { reconcile: true } for pixel-exact layout`),t.debug&&!p.warnedReconcile&&(p.warnedReconcile=!0,G(t,`Some text may wrap differently in the capture. Pass { reconcile: true } to fix it (about 2x slower).`))),!v&&r&&(d=kc(n.element,r)),!y&&r&&Jc(n.element,r,n.options),r&&(Qc(n.element,r,s),Yc(n.element,r))}finally{e()}if(!x?.yielded||!t.__tornSinceStart?.())break;x=null,t.__session=eu(t.cache)}if(t.__slicer=null,n.clone=r,n.classCSS=i,n.styleCache=o,n.nodeMap=s,await Tu(`afterClone`,n),!yu(f,`render`))return null;if(x?.due()&&await x.pause(),il(n.clone),n.options?.excludeMode===`remove`||typeof n.options?.filter==`function`&&n.options.filterMode===`remove`)try{ll(n.element,n.clone,n.styleCache,n.nodeMap)}catch(e){K(t.__session,`shrink-failed`,`shrink pass failed`,e),G(t,`Couldn't close the gaps left by removed elements.`,e)}try{await Go(n.clone,n.element,n.nodeMap)}catch{}try{let e=t.__session?.styleMap;e&&Jo(e.keys(),e,n.nodeMap,n.options.__iconMatchers)}catch{}let S=e=>Promise.resolve().then(e),C=(async()=>{await Promise.all([S(()=>Il(n.clone,n.options)),S(()=>Gl(n.element,n.clone,n.styleCache,n.options,n.nodeMap))]);try{Kl(n.element,n.clone,n.nodeMap)}catch(e){K(t.__session,`backdrop-filter-failed`,`backdrop-filter emulation failed`,e),G(t,`Couldn't reproduce a backdrop-filter; captured without it.`,e)}if(t.compress&&(t.__compressionClip=l,t.__compressionRootTransform=d,await S(()=>_d(n.clone,n.options,n.nodeMap))),t.captureSelection)try{qa(n.nodeMap)}catch(e){K(t.__session,`selection-compose-failed`,`field selection compose failed`,e)}})(),w=Promise.resolve();(t.embedFonts===`auto`?((n.element.ownerDocument||document).fonts?.size||0)>0:t.embedFonts)&&(w=S(async()=>{let e=n.element.ownerDocument||document,r=b?e=>{try{let t=e.getBoundingClientRect();return t.right>=b.left-200&&t.left<=b.right+200&&t.bottom>=b.top-200&&t.top<=b.bottom+200}catch{return!0}}:null,{required:i,usedCodepoints:a}=!b&&t.__fontUsage||Ns(n.element,r);if(t.embedFonts===`auto`){let t=new Set;try{for(let n of e.fonts)t.add(String(n.family).replace(/["']/g,``).toLowerCase())}catch{}if(!(t.size>0&&Array.from(i).some(e=>t.has(ds(e).toLowerCase()))))return}U()&&await Ps(new Set(Array.from(i).map(ds).filter(Boolean)),1,e),u=await Ms({required:i,usedCodepoints:a,exclude:n.options.excludeFonts,localFonts:n.options.localFonts,useProxy:n.options.useProxy,fontStylesheetDomains:n.options.fontStylesheetDomains,iconMatchers:n.options.__iconMatchers,doc:e,debug:n.options.debug})})),await Promise.all([C,w]),(n.options.plugins||[]).some(e=>e&&(typeof e.beforeRender==`function`||typeof e.afterRender==`function`)),n.options.engine,x?.due()&&await x.pause();let T=n.clone;zu(T,t.__compressedAssets);let E=await Cd(n,{clipWindow:l,outerTransforms:v,outerShadows:y,rootTransform2D:d,fontsCSS:u});if(t.__compressedSnapshot=Ru(T,t.__compressedAssets),typeof t.__retain==`function`)try{t.__retain({clone:r,nodeMap:s,styleCache:o,styleMap:t.__session.styleMap,classPrefixCSS:a,fontsCSS:u,clipWindow:l,outerTransforms:v,outerShadows:y,rootTransform2D:d,__compressedAssets:t.__compressedAssets,__compressionDensity:t.__compressionDensity})}catch{}return E}m(),N(),q();var Od=new Set([`png`,`jpeg`,`jpg`,`webp`,`svg`]);function kd(e={}){let t=typeof e.type==`string`&&Od.has(e.type.toLowerCase())?e.type.toLowerCase():null,n=e.format??t??`png`;n===`jpg`&&(n=`jpeg`);let r=e.format==null?t===`jpg`?`jpeg`:t:n,i=u(e.cache),a=e.exclude==null?[]:Array.isArray(e.exclude)?e.exclude:[e.exclude],o=[],s=[];for(let t of a)if(typeof t==`string`)try{document.createDocumentFragment().querySelector(t),o.push(t)}catch{G(e,`Invalid exclude selector "${t}"; ignored.`)}else typeof t==`function`?s.push(t):t!=null&&G(e,`Ignored an exclude entry: use a CSS selector or a function.`,t);let c=e.excludeMode??`hide`,l={debug:e.debug??!1,scale:e.scale??1,exclude:o,excludePredicates:s.length?s:null,excludeMode:c,filter:e.filter??null,filterMode:e.filterMode??`hide`,shouldExclude:e=>{if(!e||e.nodeType!==1)return!1;if(e.getAttribute(`data-capture`)===`exclude`)return!0;for(let t of Array.isArray(l.exclude)?l.exclude:[])try{if(e.matches(t))return!0}catch{}for(let t of Array.isArray(l.excludePredicates)?l.excludePredicates:[])try{if(t(e))return!0}catch{}if(typeof l.filter==`function`)try{if(!l.filter(e))return!0}catch{}return!1},placeholders:e.placeholders!==!1,captureSelection:e.captureSelection??!1,canvas:C(e.canvas,`canvas`)?e.canvas:null,embedFonts:e.embedFonts??`auto`,iconFonts:Array.isArray(e.iconFonts)?e.iconFonts:e.iconFonts?[e.iconFonts]:[],__iconMatchers:Fo(e.iconFonts,e),localFonts:Array.isArray(e.localFonts)?e.localFonts:[],excludeFonts:e.excludeFonts??void 0,fontStylesheetDomains:Array.isArray(e.fontStylesheetDomains)?e.fontStylesheetDomains:[],fallbackURL:e.fallbackURL??void 0,cache:i,__styleShare:e.__styleShare,useProxy:typeof e.useProxy==`string`?e.useProxy:``,width:e.width??null,height:e.height??null,format:n,__explicitFormat:r,type:n,quality:e.quality??.92,dpr:e.dpr??(window.devicePixelRatio||1),backgroundColor:e.backgroundColor??([`jpeg`,`webp`].includes(n)?`#ffffff`:null),filename:e.filename??`snapDOM`,outerTransforms:e.outerTransforms??!0,outerShadows:e.outerShadows??!1,reconcile:e.reconcile??!1,burst:e.burst,fast:e.fast===!1||e.fast===`auto`?e.fast:!0,engine:e.engine,invalidate:e.invalidate??!1,__pinned:e.__pinned===!0,__subpixel:e.__subpixel??null,clip:e.clip??null,compress:e.compress!==!1,excludeStyleProps:e.excludeStyleProps??null,resolvePicturePlaceholders:e.resolvePicturePlaceholders!==!1};return l}W(),q(),J();var Ad=`svg,iframe,canvas,video,audio,object,embed,slot,template,picture,style,pre`;function jd(e){try{return e.matches?.(`dialog,[popover]`)||!!e.querySelector?.(`dialog,[popover]`)}catch{return!0}}var Md=/(?:^|;)\s*(?:-webkit-)?backdrop-filter:\s*(?!none(?:\s*!important)?(?:;|$))[^;]+/i;function Nd(e){if(e.__usesBackdropFilter!==void 0)return e.__usesBackdropFilter;let t=!1;for(let n of e.styleMap.values())if(Md.test(n)){t=!0;break}return e.__usesBackdropFilter=t,t}function Pd(e,t){let n=t.has(`backdrop-filter`)||t.has(`-webkit-backdrop-filter`);if(!n&&(n=(e=>/(?:^|;)\s*(?:-webkit-)?backdrop-filter\s*:/i.test(e.getAttribute?.(`style`)||``))(e),!n))try{n=!!e.querySelector?.(`[style*="backdrop-filter" i]`)}catch{n=!0}if(!n)return!1;let r=[e];e.querySelectorAll&&r.push(...e.querySelectorAll(`*`));for(let e of r){let t=getComputedStyle(e),n=t.getPropertyValue(`backdrop-filter`)||t.getPropertyValue(`-webkit-backdrop-filter`);if(n&&n!==`none`)return!0}return!1}var Fd=1/16;function Id(e,t){if(e===t)return!0;if(!e.endsWith(`px`)||!t.endsWith(`px`))return!1;let n=parseFloat(e),r=parseFloat(t);return Number.isFinite(n)&&Number.isFinite(r)&&Math.abs(n-r)<=Fd}var Ld=new Map,Rd=[`width`,`height`,`min-width`,`min-height`];function zd(e){let t=Ld.get(e);if(t===void 0){t=null;for(let n of Rd){let r=e.match(RegExp(`(?:^|;)`+n+`:([^;]+)`));r&&r[1].endsWith(`px`)&&((t||={})[n]=r[1])}Ld.size>5e3&&Ld.clear(),Ld.set(e,t)}return t}function Bd(e){if(e.classList&&e.classList.length)for(let t of Array.from(e.classList))/^c\d+$/.test(t)&&e.classList.remove(t)}function Vd(e,t){let n=[e];for(;n.length;){let e=n.pop();if(e.nodeType===1){let n=t.nodeMap.get(e);n!==void 0&&(t.nodeMap.delete(e),t.srcToClone.get(n)===e&&t.srcToClone.delete(n)),t.styleMap.delete(e)}for(let t=e.firstChild;t;t=t.nextSibling)n.push(t)}}var Hd={attempts:0,served:0,reconciled:0};async function Ud(e,t,n){Hd.attempts++;try{let r=await Wd(e,t,n);return r&&Hd.served++,r}catch{return null}}async function Wd(e,t,n){let r=t.retained;if(!r||!r.clone||!r.styleMap||!r.srcToClone||n.reconcile||n.clip||n.captureSelection||r.clipWindow||e.scrollTop||e.scrollLeft||jd(e)||Nd(r)||r.fontsCSS||Mu(n))return null;for(let e of n.plugins||[])if(e&&(typeof e.beforeSnap==`function`||typeof e.beforeClone==`function`||typeof e.resolveNode==`function`||typeof e.afterClone==`function`))return null;if(r.classPrefixCSS&&(r.classPrefixCSS.includes(`::marker`)||r.classPrefixCSS.includes(`::first-line`))||n.excludeMode===`remove`)return null;let i=e.ownerDocument||document,a=Hr(e);if(!a||zr(i))return null;let o=[];t:for(let n of t.dirtyRoots){if(!n.isConnected||n===e||!e.contains(n))return null;for(let r of t.dirtyRoots)if(r!==n&&r!==e&&r.contains(n))continue t;o.push(n)}if(!o.length)return null;n.__compressedAssets=r.__compressedAssets,n.__compressionDensity=r.__compressionDensity,n.__compressionRootTransform=r.rootTransform2D;for(let t of o){if(t.parentElement===e||t.matches?.(Ad)||t.querySelector?.(Ad)||Pd(t,a))return null;let i=r.srcToClone.get(t);if(!i||!i.parentNode)return null;let o=new Map,s={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:o,options:n},c=tu(t,null),l=vc(t),u;try{u=await So(t,s,n)}finally{l(),c()}if(!u||u.nodeType!==1||u.querySelector?.(`style[data-sd]`)||(await cc(t,u,s,n),s.__pseudoCSS)||s.__usesPlaceholder&&!r.classPrefixCSS?.includes(`[data-sd-ph]`))return null;await Aa(u,s),il(u);try{await Go(u,t,o)}catch{}try{Jo([u,...u.querySelectorAll(`*`)],r.styleMap,o,n.__iconMatchers)}catch{}if(await Promise.all([Il(u,n),Gl(t,u,r.styleCache,n,o)]),n.compress)try{await _d(u,n,o)}catch{}for(let[e,t]of o.entries())Ml(e,t,o,r.styleCache);i.replaceWith(u),Vd(i,r);for(let[e,t]of o.entries())r.nodeMap.set(e,t),r.srcToClone.set(t,e)}let s={styleMap:r.styleMap,styleCache:r.styleCache,nodeMap:r.nodeMap,options:n},c=new WeakSet;for(let[e,t]of r.nodeMap.entries()){if(!t||t.nodeType!==1||!t.isConnected)continue;let i=r.styleMap.get(e);if(!i)continue;let a=zd(i);if(!a)continue;let o=null,l=!1;for(let e in a){o||=getComputedStyle(t);let n=o.getPropertyValue(e);if(e===`min-width`&&n===`auto`&&!c.has(t.parentElement)){let e=parseFloat(o.width);o.boxSizing!==`border-box`&&i.includes(`box-sizing:border-box`)&&(e+=[`padding-left`,`padding-right`,`border-left-width`,`border-right-width`].reduce((e,t)=>e+(parseFloat(o.getPropertyValue(t))||0),0)),n=`${e}px`}if(!Id(n,a[e])){l=!0;break}}if(l){if(n.__compressedAssets?.has(e))return null;c.add(t),Hd.reconciled++,await X(t,e,s,n)}}let l=Ke(r.styleMap);for(let[e,t]of r.styleMap.entries())Bd(e),jl(e,t,l);let u=(r.classPrefixCSS||``)+Array.from(l.entries()).map(([e,t])=>`.${t}{${e}}`).join(``);zu(r.clone,n.__compressedAssets);let d=await Cd({element:e,options:n,plugins:n.plugins,clone:r.clone,classCSS:u,styleCache:r.styleCache,nodeMap:r.nodeMap},{clipWindow:null,outerTransforms:r.outerTransforms,outerShadows:r.outerShadows,rootTransform2D:r.rootTransform2D,fontsCSS:r.fontsCSS||``});return n.__compressedSnapshot=Ru(r.clone,n.__compressedAssets),r.__compressedAssets=n.__compressedAssets,r.__compressionDensity=n.__compressionDensity,d}N();var Gd=new WeakMap,Kd=new WeakMap,qd=new WeakSet,Jd=new WeakMap,Yd=64,Xd=new Map,Zd=[`scroll`,`input`,`change`,`focusin`,`focusout`,`pointerdown`,`pointerup`,`pointercancel`,`keydown`,`keyup`,`beforetoggle`,`toggle`],Qd=[`(prefers-color-scheme: dark)`,`(prefers-reduced-motion: reduce)`,`(prefers-contrast: more)`,`(forced-colors: active)`,`(inverted-colors: inverted)`,`(prefers-reduced-transparency: reduce)`,`(hover: hover)`,`(any-hover: hover)`,`(pointer: coarse)`,`(any-pointer: coarse)`,`(color-gamut: p3)`,`(dynamic-range: high)`];function $d(e){let t=e?.defaultView;return typeof t?.matchMedia==`function`?Qd.map(e=>{try{return t.matchMedia(e).matches?`1`:`0`}catch{return`?`}}).join(``):``}function ef(e){let t=[];for(let n=e;n;){try{let e=n.getBoundingClientRect();t.push(e.x,e.y,e.width,e.height)}catch{t.push(`?`)}n=n.parentElement?n.parentElement:D(n)||null}return t.join(`|`)}function tf(e,t){if(t.disposed||(Xd.delete(e),Xd.set(e,t),Xd.size<=Yd))return;let[n,r]=Xd.entries().next().value;nf(n,r)}function nf(e,t){t.disposed=!0,Xd.delete(e),Gd.delete(e);for(let e of t.observers)try{e.disconnect()}catch{}for(let n of Zd)e.removeEventListener(n,t.onMediaDirty,!0);for(let e of t.trackedShadowRoots.keys())for(let n of of)e.removeEventListener(n,t.onMediaDirty,!0);for(let[e,n]of t.trackedImages)e.removeEventListener(`load`,n),e.removeEventListener(`error`,n);t.trackedImages.clear(),t.trackedShadowRoots.clear(),t.images.length=0,t.controls.length=0,t.scrollNodes.length=0,t.observers.length=0,t.last=null,t.retained=null,t.retainedFrameDriven=!1}function rf(e){if(qd.has(e))return!1;Kd.delete(e);let t=[e],n=[],r=[];for(let e=0;e<t.length;e++){let i=t[e],a=[];i?.nodeType===1&&a.push(i);try{a.push(...i.querySelectorAll(`*`))}catch{return!1}for(let e of a){e.shadowRoot&&t.push(e.shadowRoot);let i=String(e.localName||e.tagName||``).toLowerCase();if(/^(?:iframe|canvas|video|audio|object|embed|marquee|blink)$/.test(i)||i===`progress`&&!e.hasAttribute(`value`)||/^(?:animate|animatetransform|animatemotion|set)$/.test(i))return!1;let a=``;if(i===`img`){r.push(e);try{a=e.currentSrc||e.src||``}catch{}}/^(?:input|textarea|select|option)$/.test(i)&&n.push(e);let o=e.getAttribute?.(`style`)||``,s=Jd.get(e);if(a||o){if((!s||s.src!==a||s.style!==o)&&(s={src:a,style:o,animated:hf(a)||hf(o)},Jd.set(e,s)),s.animated)return!1}else s&&Jd.delete(e)}}return Kd.set(e,{roots:t.slice(1),controls:n,images:r}),!0}function af(e,t){if(!e.querySelectorAll)return!1;let n=Kd.get(e);Kd.delete(e);let r=new Set(n?.roots||[]);if(n&&(t.controls=n.controls,t.scannedImages=n.images),!n){let t=[e];for(let e=0;e<t.length;e++){let n=t[e];n.shadowRoot&&!r.has(n.shadowRoot)&&(r.add(n.shadowRoot),t.push(n.shadowRoot));for(let e of n.querySelectorAll(`*`))e.shadowRoot&&!r.has(e.shadowRoot)&&(r.add(e.shadowRoot),t.push(e.shadowRoot))}}for(let[e,n]of t.trackedShadowRoots)if(!r.has(e)){try{n.disconnect()}catch{}for(let n of of)e.removeEventListener(n,t.onMediaDirty,!0);t.trackedShadowRoots.delete(e);let r=t.observers.indexOf(n);r>=0&&t.observers.splice(r,1)}for(let e of r)if(!t.trackedShadowRoots.has(e))try{let n=new MutationObserver(t.markDirty);n.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),n.__flush=t.markDirty,t.observers.push(n),t.trackedShadowRoots.set(e,n);for(let n of of)e.addEventListener(n,t.onMediaDirty,{capture:!0,passive:!0});t.retained&&t.dirtyAll()}catch{}return!!n}var of=[`scroll`,`change`,`beforetoggle`,`toggle`];function sf(e,t){return[e,...t.trackedShadowRoots.keys()]}function cf(e,t){let n=t.scannedImages;if(t.scannedImages=null,!n){n=[],e.tagName===`IMG`&&n.push(e);for(let r of sf(e,t))r.querySelectorAll&&n.push(...r.querySelectorAll(`img`))}if(t.images=n,t.trackedImages.size){let e=new Set(n);for(let[n,r]of t.trackedImages)e.has(n)||(n.removeEventListener(`load`,r),n.removeEventListener(`error`,r),t.trackedImages.delete(n))}for(let e of n){if(e.complete||t.trackedImages.has(e))continue;let n=()=>{t.capturing&&(t.torn=!0),t.dirty=!0,t.dirtyRoots=null,e.removeEventListener(`load`,n),e.removeEventListener(`error`,n),t.trackedImages.delete(e)};t.trackedImages.set(e,n),e.addEventListener(`load`,n),e.addEventListener(`error`,n)}}function lf(e){let t=new Map,n=new Map,r=new Map;for(let i of e)if($n(i)){if(i.type===`attributes`){let e=t.get(i.target);e||t.set(i.target,e=new Map),e.has(i.attributeName)||e.set(i.attributeName,i.oldValue)}else if(i.type===`characterData`)n.has(i.target)||n.set(i.target,i.oldValue);else if(i.type===`childList`){let e=r.get(i.target);e||r.set(i.target,e=new Map);for(let t of i.addedNodes){if(t.nodeType!==3)return!0;e.set(t.data,(e.get(t.data)||0)+1)}for(let t of i.removedNodes){if(t.nodeType!==3)return!0;e.set(t.data,(e.get(t.data)||0)-1)}}else return!0}for(let[e,n]of t)for(let[t,r]of n)if(e.getAttribute(t)!==r)return!0;for(let[e,t]of n)if(e.data!==t)return!0;for(let e of r.values())for(let t of e.values())if(t!==0)return!0;return!1}var uf=/(?:^data:image\/(?:gif|apng)|\.(?:gif|apng)(?=[?#)'"\s;]|$))/i,df=e=>e&&(typeof e==`object`||typeof e==`function`)?Of(e):`-`;function ff(e,t=131072){if(e=String(e||``).trim(),!/^data:/i.test(e))return``;let n=e.indexOf(`,`);if(n<0)return``;let r=e.slice(0,n),i=e.slice(n+1);try{if(/;base64/i.test(r)){let e=Math.ceil(t/3)*4;return atob(i.slice(0,e-e%4))}return i.slice(0,t*3).replace(/%([0-9a-f]{2})/gi,(e,t)=>String.fromCharCode(parseInt(t,16))).slice(0,t)}catch{return``}}function pf(e){let t=(e.match(/^data:([^;,]+)/i)?.[1]||``).toLowerCase();if(t===`image/gif`||t===`image/apng`)return!0;if(!/image\/(?:png|webp|avif|svg\+xml)/.test(t))return!1;let n=ff(e);return t===`image/png`?n.includes(`acTL`):t===`image/webp`?n.includes(`ANIM`)||n.includes(`ANMF`)||n.includes(`VP8X`)&&!!(n.charCodeAt(n.indexOf(`VP8X`)+8)&2):t===`image/avif`?n.includes(`avis`):/<(?:animate|animateTransform|animateMotion|set)\b|@keyframes\b|animation(?:-name)?\s*:/i.test(n)}function mf(e){let t=String(e||``).trim();return t?uf.test(t)?!0:/^data:/i.test(t)?pf(t):!1:!1}function hf(e){let t=String(e||``);if(mf(t))return!0;for(let e of t.matchAll(/url\(\s*(?:"((?:\\.|[^"\\])*)"|'((?:\\.|[^'\\])*)'|([^)]*))\s*\)/gi))if(mf(e[1]??e[2]??e[3]))return!0;return!1}function gf(e,t=null){let n=e&&e.clone;if(!n)return!1;let r=t?t.map(t=>e.srcToClone?.get(t)).filter(Boolean):[n];for(let t of r)for(let n of _f(t))if(hf(n.getAttribute?.(`src`))||hf(n.getAttribute?.(`href`))||hf(n.getAttribute?.(`style`))||hf(e.styleMap?.get(n)))return!0;return!1}function _f(e){let t=[];e&&e.nodeType===1&&t.push(e);try{t.push(...e.querySelectorAll(`*`))}catch{}return t}function vf(e,t){let n=[],r=new Set,i=e=>{e&&!r.has(e)&&(r.add(e),n.push(e))};e.matches?.(`input,textarea,select,option`)&&i(e);for(let n of sf(e,t))try{for(let e of n.querySelectorAll(`input,textarea,select,option`))i(e)}catch{}t.controls=n}function yf(e,t){let n=[],r=new Set,i=(e,t=!1)=>{if(e&&!r.has(e)){r.add(e);try{(t||e.scrollLeft||e.scrollTop||e.scrollWidth>e.clientWidth||e.scrollHeight>e.clientHeight)&&n.push(e)}catch{}}};for(let t=e;t;t=t.parentElement)i(t,!0);for(let n of sf(e,t))for(let e of _f(n))i(e);t.scrollNodes=n}function bf(e,t){let n=e.ownerDocument||document,r=n.defaultView,i=[r?.location?.hash||``,$d(n),r?.innerWidth||0,r?.innerHeight||0,r?.devicePixelRatio||1,r?.screen?.orientation?.type||``];try{i.push(...[...n.adoptedStyleSheets||[]].map(df))}catch{}for(let e of t.trackedShadowRoots.keys())try{i.push(`#shadow`,...[...e.adoptedStyleSheets||[]].map(df))}catch{}let a=n.activeElement,o=n.fullscreenElement;(a?.contains(e)||e.contains(a))&&i.push(df(a)),(o?.contains(e)||e.contains(o))&&i.push(df(o));let s=[r?.scrollX||0,r?.scrollY||0];for(let e of t.scrollNodes)s.push(e.scrollLeft||0,e.scrollTop||0);let c=[];for(let e of t.controls){let t=String(e.localName||``).toLowerCase();t===`input`?c.push(e.type,x(e)?e.value.length:e.value,+!!e.checked,+!!e.indeterminate):t===`textarea`?c.push(e.value):t===`select`?c.push(e.selectedIndex,e.value):c.push(+!!e.selected)}let l=[];for(let e of t.images){let t=``;try{t=e.currentSrc||e.src||``}catch{}l.push(t,+!!e.complete,e.naturalWidth||0,e.naturalHeight||0)}return{style:i.join(`|`),scroll:s.join(`|`),controls:c,images:l,frameDriven:t.retainedFrameDriven}}function xf(e,t,n){if(!e)return!1;let r=e[n],i=t[n];if(r===i)return!0;if(!Array.isArray(r)||r.length!==i.length)return!1;for(let e=0;e<r.length;e++)if(r[e]!==i[e])return!1;return!0}function Sf(e,t){let n=new Set;for(let r of sf(e,t))try{let e=r.getAnimations?.(r.nodeType===1?{subtree:!0}:void 0)||[];for(let t of e)n.add(t)}catch{}return[...n]}function Cf(e){return e.map(e=>[df(e),e.playState,Math.round((Number(e.currentTime)||0)*10),e.playbackRate].join(`:`)).join(`|`)}function wf(e,t,n){if(!n||n.nodeType!==1)return null;if(n===e||e.contains(n))return e;for(let e of t.trackedShadowRoots.keys())if(e.contains(n))return e;return null}function Tf(e){let t={dirty:!0,pending:[],torn:!1,dirtyRoots:new Set,retained:null,retainedFrameDriven:!1,disposed:!1,capturing:!1,last:null,inflight:Promise.resolve(),observers:[],trackedShadowRoots:new Map,trackedImages:new Map,images:[],scannedImages:null,scrollNodes:[],controls:[],envEpoch:rr(),styleEpoch:ir(),styleStamp:ar(e),outsideMutations:nr(e),geometry:null,renderState:null},n=()=>{t.dirty=!0,t.dirtyRoots=null},r=n=>{if(!t.dirtyRoots)return;let r=n&&(n.nodeType===1?n:n.parentElement);if(!r||r===e||!e.contains(r)||t.dirtyRoots.size>=12){t.dirtyRoots=null;return}t.dirtyRoots.add(r)},i=e=>{if(t.capturing){for(let n of e)t.pending.push(n);return}for(let n of e)$n(n)&&(t.dirty=!0,r(n.target))},a=()=>{if(t.capturing){t.torn=!0;return}n()};t.dirtyAll=n;try{let n=new MutationObserver(i);n.observe(e,{subtree:!0,childList:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),n.__flush=i,t.observers.push(n)}catch{}t.markDirty=i,t.onMediaDirty=a;try{for(let t of Zd)e.addEventListener(t,a,{capture:!0,passive:!0})}catch{}return af(e,t)||vf(e,t),yf(e,t),cf(e,t),t}var Ef=0,Df=new WeakMap;function Of(e){let t=Df.get(e);return t||(t=`@`+ ++Ef,Df.set(e,t)),t}function kf(e,t){let n=typeof e;if(n===`undefined`)return null;if(e===null||n===`boolean`||n===`number`||n===`string`)return JSON.stringify(e);if(n===`function`||n===`symbol`)return n===`symbol`?null:JSON.stringify(Of(e));if(n!==`object`)return null;if(typeof e.nodeType==`number`)return JSON.stringify(Of(e));if(t.has(e))return null;t.add(e);try{if(Array.isArray(e)){let n=[];for(let r of e){let e=kf(r,t);if(e===null)return null;n.push(e)}return`[`+n.join(`,`)+`]`}let n=Object.getPrototypeOf(e);if(n!==Object.prototype&&n!==null)return JSON.stringify(Of(e));let r=[];for(let n of Object.keys(e).sort()){let i=e[n];if(i===void 0)continue;let a=kf(i,t);if(a===null)return null;r.push(JSON.stringify(n)+`:`+a)}return`{`+r.join(`,`)+`}`}finally{t.delete(e)}}function Af(e,t){let{burst:n,invalidate:r,...i}=e||{};try{let e=kf(i,new Set);return e===null?null:`${(t||[]).map(df).join(`,`)}:${e}`}catch{return null}}function jf(e,t,n,r,i=null){let a=Gd.get(e);a||(a=Tf(e),a.baselineSignature=Af(t,n.plugins),Gd.set(e,a));let o=Af(t,n.plugins),s=async()=>{if(a.disposed)return r();let t=o===null||o!==a.baselineSignature;t&&o!==null?a.pendingSig===o?(a.baselineSignature=o,a.last=null,a.dirty=!0,a.dirtyRoots=null,a.pendingSig=null,t=!1):a.pendingSig=o:a.pendingSig=null,af(e,a),cf(e,a);for(let e of a.observers)e.__flush(e.takeRecords());Ar();let s=nr(e);a.dirty&&a.outsideMutations!==s&&a.dirtyAll(),a.outsideMutations=s;let c=e.getRootNode?.(),l=[...a.trackedShadowRoots.keys()];c?.nodeType===11&&!l.includes(c)&&l.push(c),kr(e.ownerDocument||document,l);let u=ar(e);a.styleStamp!==u&&(a.styleStamp=u,a.dirty||a.dirtyAll());let d=bf(e,a),f=Sf(e,a);d.animation=Cf(f),a.renderState&&(!xf(a.renderState,d,`style`)&&(or(),a.dirtyAll()),xf(a.renderState,d,`scroll`)||a.dirtyAll(),xf(a.renderState,d,`controls`)||(jr(e),a.dirtyAll()),!xf(a.renderState,d,`images`)&&!a.dirty&&a.dirtyAll());let p=rr();a.envEpoch!==p&&(a.dirtyAll(),a.envEpoch=p);let m=ir();if(a.styleEpoch!==m&&(a.styleEpoch=m,!a.dirty)){let t=ef(e);a.geometry!==null&&t!==a.geometry&&(jr(e),a.dirtyAll()),a.geometry=t}n.invalidate&&a.dirtyAll();let h=!1,g=!!a.renderState&&!xf(a.renderState,d,`animation`);try{let t=new Set;g&&f.length===0&&(t=null);for(let n of f){let r=n.playState===`running`;if(!r&&!g)continue;r&&(h=!0),g=!0;let i=n.effect?.target;if(wf(e,a,i)===e)t.add(i);else{t=null;break}}if(g&&t&&t.size&&a.retained){a.dirty=!0;for(let e of t)a.dirtyRoots&&a.dirtyRoots.add(e),jr(e)}else g&&!t&&a.dirtyAll()}catch{}let _=d.frameDriven,v=h||_;if(v&&(a.last=null),_&&a.dirtyAll(),!t&&!v&&!a.dirty&&a.last)return tf(e,a),a.last;a.capturing=!0;let y=null;try{let o=null,c=!1,l=null;if(!t&&a.dirty&&a.retained&&a.dirtyRoots&&a.dirtyRoots.size&&i){l=[...a.dirtyRoots];let t=await Ud(e,a,n);t&&(o=await i(t),c=!0)}if(o||=(t||(n.__retain=e=>{let t=new Map;for(let[n,r]of e.nodeMap.entries())t.set(r,n);y={...e,srcToClone:t}}),n.__tornSinceStart=()=>{for(let e of a.observers)for(let t of e.takeRecords())a.pending.push(t);return Ar(),a.torn||lf(a.pending)||nr(e)!==s},await r()),!t&&!a.disposed){a.dirty=!1,a.dirtyRoots=new Set,y?(a.retained=y,a.retainedFrameDriven=gf(y),vf(e,a),yf(e,a)):c&&(a.retainedFrameDriven||=gf(a.retained,l),vf(e,a),yf(e,a));let t=bf(e,a);t.animation=Cf(Sf(e,a));let n=[`style`,`scroll`,`controls`,`images`];h||n.push(`animation`);let r=n.every(e=>xf(d,t,e));a.renderState=t,a.styleEpoch=ir(),a.styleStamp=ar(e),a.geometry=ef(e),a.renderState.frameDriven?(qd.add(e),nf(e,a)):r?!v&&!a.renderState.frameDriven&&(a.last=o,tf(e,a)):(a.dirtyAll(),a.last=null)}return o}finally{n.__retain=void 0,n.__tornSinceStart=void 0;for(let e of a.observers)for(let t of e.takeRecords())a.pending.push(t);Ar();let t=nr(e);(a.torn||lf(a.pending)||t!==s)&&(a.dirtyAll(),a.last=null),a.outsideMutations=t,a.styleEpoch=ir(),a.styleStamp=ar(e),a.pending.length=0,a.torn=!1,a.capturing=!1,a.disposed||(af(e,a),cf(e,a))}},c=a.inflight.then(s,s);return a.inflight=c.catch(()=>{}),c}var Mf=null;function Nf(e){Mf=e}var Pf=`button, a[href], [role="button"], input, select, summary, label, [tabindex]`,Ff=!1,If=null,Lf=new WeakMap,Rf=!1;function zf(e,t){!Ff||!If||t&&t.burst===!1||Lf.set(If.control,{element:e,options:t&&typeof t==`object`?{...t}:t})}function Bf(e){let t={control:e};If=t,setTimeout(()=>{If===t&&(If=null)},0)}function Vf(e){let t=e.target,n=t&&(t.nodeType===1?t:t.parentElement);return n&&n.closest?n.closest(Pf):null}function Hf(e){if(e.type===`keydown`&&e.key!==`Enter`&&e.key!==` `)return;let t=Vf(e);t&&(Bf(t),Wf(e,!1))}function Uf(e){let t=Vf(e);t&&Bf(t)}function Wf(e,t=!0){if(!Mf||document.visibilityState===`hidden`)return;let n=Vf(e);if(!n||e.type===`pointerenter`&&e.target!==n)return;let r=Lf.get(n);if(r){if(!r.element.isConnected){Lf.delete(n);return}Mf(r.element,r.options).catch(()=>{});return}t&&!Rf&&(Rf=!0,Mf(document.body,{clip:`viewport`,burst:!1}).catch(()=>{}))}function Gf(){if(Ff||typeof document>`u`||typeof document.addEventListener!=`function`)return;Ff=!0;let e={capture:!0,passive:!0};document.addEventListener(`pointerdown`,Hf,e),document.addEventListener(`keydown`,Hf,e),document.addEventListener(`click`,Uf,e),document.addEventListener(`pointerenter`,Wf,e),document.addEventListener(`focusin`,Wf,e)}Le();function Kf(...e){return Cu(...e),$}async function qf(e,t){if(typeof e!=`string`||!e.trim())throw Error(`[SnapDOM] fromString() needs an HTML string.`);let n=document.createElement(`div`);V(n),n.style.cssText=`position:fixed;left:-99999px;top:0;pointer-events:none;`,n.innerHTML=e,document.body.appendChild(n);try{await pt();let e=Array.from(n.childNodes).some(e=>e.nodeType===3&&e.textContent.trim());return await Zf(n.children.length===1&&!e?n.firstElementChild:n,{...t||{},burst:!1})}finally{n.remove()}}var $=Object.assign(Zf,{plugins:Kf,fromString:qf,version:`3.4.0`,preCapture:Gf});Nf(Zf);var Jf=Symbol(`snapdom.internal`),Yf=Symbol(`snapdom.internal.silent`),Xf=new Set([`png`,`jpeg`,`jpg`,`webp`,`svg`]);async function Zf(e,t){if(!e)throw Error(`[SnapDOM] The element cannot be null or undefined.`);let n=kd(t);n.element=e,n.invalidate&&or(),ku(n,t&&t.plugins);let{stage:r,loweredBy:i}=vu(n);n.needs=r,n.__needsLoweredBy=i;let a=yu(r,`render`),o=n.burst===!0||!Mu(n),s=typeof n.filter==`function`||!!n.excludePredicates||typeof n.excludeStyleProps==`function`||typeof n.fallbackURL==`function`,c=a&&!n.captureSelection&&n.burst!==!1&&o&&!s&&rf(e);return c&&zf(e,t),n.snap||={toPng:(e,t)=>$.toPng(e,t),toSvg:(e,t)=>$.toSvg(e,t)},c?jf(e,t,n,()=>$.capture(e,n,Jf),e=>Qf(e,n)):$.capture(e,n,Jf)}$.capture=async(e,t,n)=>{if(n!==Jf)throw Error(`[SnapDOM] snapdom.capture() is internal; use snapdom(el).`);if(yu(t.needs||`render`,`render`)&&U()){if(t.embedFonts)try{let n=e.ownerDocument||document,r=new Set;if(t.embedFonts===`auto`){try{for(let e of n.fonts)r.add(String(e.family).replace(/["']/g,``).toLowerCase())}catch{}if(r.size===0)throw null}let i=Ns(e);t.clip||(t.__fontUsage=i);let a=i.required,o=new Set([...a].map(ds).filter(Boolean));if(t.embedFonts===`auto`&&(o=new Set([...o].filter(e=>r.has(e.toLowerCase()))),o.size===0))throw null;await Ps(o,1,n)}catch{}let n=Array.from(e.querySelectorAll(`canvas`));e.tagName===`CANVAS`&&n.unshift(e);for(let e of n)try{if(wo(e))continue;let t=e.getContext(`2d`,{willReadFrequently:!0});t&&t.getImageData(0,0,1,1)}catch(e){G(t,`Couldn't prepare canvases for Safari.`,e)}}return Qf(await Dd(e,t),t)};async function Qf(e,t){let n=t.needs||`render`,r=yu(n,`render`),i=e=>bu(n,t.__needsLoweredBy||[],e),a=typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement?e:null,o=a?null:e,s=()=>o??=a.toDataURL(),c=a||e;a&&(e=``);let l=t.__compressedSnapshot,u=t.__compressionDensity;delete t.__compressedSnapshot,delete t.__compressedAssets;let d,f=t.meta||{},p=(Number.isFinite(t.width)||Number.isFinite(t.height))&&!U(),m=p?Number.isFinite(t.width)?f.targetW/f.vbW:f.targetH/f.vbH:1,h=p?Number.isFinite(t.height)?f.targetH/f.vbH:f.targetW/f.vbW:1,g=e=>{if(a||!l?.size)return c;let t=f.vbW,n=f.vbH,r=e.crop;r&&(t=Math.max(1,Math.min(t,r.x+r.width)-Math.max(0,r.x)),n=Math.max(1,Math.min(n,r.y+r.height)-Math.max(0,r.y)));let i=Number.isFinite(e.width),o=Number.isFinite(e.height);return(i&&o?Math.max(e.width/t,e.height/n):i?e.width/t*(r?Math.max(1,h/m):1):o?e.height/n*(r?Math.max(1,m/h):1):(e.scale||1)*Math.max(m,h))*(e.dpr||1)<=u?c:d??=Bu(s(),l)},_=async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(mn(),fn));return n(c,{...e,...t||{},format:`png`})},v=()=>{if(!r)throw i(`svgString`);if(a)throw Error(`[SnapDOM] html-in-canvas makes a raster capture; there is no SVG string.`);let t=e.indexOf(`,`);return t>=0?decodeURIComponent(e.slice(t+1)):``},y=e=>Object.defineProperty({...e||{},svgString:v},"url",r?{get:s,enumerable:!0}:{get(){throw i(`export.url`)},enumerable:!1,configurable:!0}),b={img:async(e,t)=>{if(a)return _(e,t);let{toImg:n}=await Promise.resolve().then(()=>(_n(),hn)),r={...e,...t||{}};return n(g(r),r)},svg:async(e,t)=>{if(a)return _(e,t);let{toSvg:n}=await Promise.resolve().then(()=>(_n(),hn)),r={...e,...t||{}};return n(g(r),r)},canvas:async(e,t)=>{let{toCanvas:n}=await Promise.resolve().then(()=>(dn(),bt)),r={...e,...t||{}};return n(g(r),r)},blob:async(e,t)=>{let{toBlob:n}=await Promise.resolve().then(()=>(Bn(),Rn)),r={...e,...t||{}};return n(g(r),r)},png:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(mn(),fn)),r={...e,...t||{},format:`png`};return n(g(r),r)},jpeg:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(mn(),fn)),r={...e,...t||{},format:`jpeg`};return n(g(r),r)},webp:async(e,t)=>{let{rasterize:n}=await Promise.resolve().then(()=>(mn(),fn)),r={...e,...t||{},format:`webp`};return n(g(r),r)},download:async(e,t)=>{let{download:n}=await Promise.resolve().then(()=>(Wn(),Vn)),r={...e,...t||{}};return n(g(r),r)}};if(!r)for(let e of Object.keys(b)){let t=e===`download`?`download()`:`to${e.charAt(0).toUpperCase()}${e.slice(1)}()`;b[e]=async()=>{throw i(t)}}let x={};for(let e of[`img`,`svg`,`canvas`,`blob`,`png`,`jpeg`,`webp`])x[e]=async n=>b[e](t,{...E(e,n||{}),[Yf]:!0});x.jpg=x.jpeg;let S=e=>Object.defineProperty({...t,...e},"options",{value:t,configurable:!0}),C=await Eu(`defineExports`,S({artifacts:t.__artifacts||null,export:y(),exports:x})),w=Object.assign({},...C.filter(e=>e&&typeof e==`object`).reverse()),T={...b,...w};T.jpeg&&!T.jpg&&(T.jpg=(e,t)=>T.jpeg(e,t));function E(e,n){let r=n||{},i={...t,...r},o=typeof r.type==`string`?r.type.toLowerCase():``,s=typeof r.format==`string`?r.format.toLowerCase():Xf.has(o)?o:``;return s&&(i.format=s===`jpg`?`jpeg`:s),i.__explicitFormat=s?i.format:t.__explicitFormat??null,e===`blob`&&!i.__explicitFormat&&(i.format=a?`png`:`svg`),i.type=i.format,[e,i.format,o].map(e=>typeof e==`string`?e.toLowerCase():``).find(e=>e===`jpeg`||e===`jpg`||e===`webp`)&&(i.backgroundColor==null||i.backgroundColor===`transparent`)&&(i.backgroundColor=`#ffffff`),i.scale!==1&&(Number.isFinite(i.width)||Number.isFinite(i.height))&&G(i,`scale ignored: width/height already set the size.`),i}let D=!1,O=Promise.resolve();async function k(e,n){let r=Object.freeze(n&&typeof n==`object`?{...n}:{}),i=O.then(async()=>{let n=T[e];if(!n)throw Error(`[SnapDOM] Unknown export type: ${e}`);let i=E(e,r),a=S({artifacts:t.__artifacts||null,export:y({type:e,options:i,requestedOptions:r})}),o=i.format,s=i.type;await Eu(`beforeExport`,a,{format:e,options:i});let c=i.format===o?i.type===s?``:i.type:i.format,l=typeof c==`string`?c.toLowerCase():``;Xf.has(l)&&(i.format=l===`jpg`?`jpeg`:l,i.type=i.format,i.__explicitFormat=i.format,/^(?:jpeg|webp)$/.test(i.format)&&(i.backgroundColor==null||i.backgroundColor===`transparent`)&&(i.backgroundColor=`#ffffff`));let u=await n(a,i);return await Eu(`afterExport`,a,{format:e,options:i,result:u}),D||(D=!0,await Tu(`afterSnap`,t)),u});return O=i.catch(()=>{}),i}let A={url:e,needs:n,warnings:t.__session&&t.__session.warnings||[],toRaw:()=>{if(!r)throw i(`toRaw()`);return s()},to:(e,t)=>k(e,t),toImg:e=>k(`img`,e),toSvg:e=>k(`svg`,e),toCanvas:e=>k(`canvas`,e),toBlob:e=>k(`blob`,e),toPng:e=>k(`png`,e),toJpg:e=>k(`jpg`,e),toWebp:e=>k(`webp`,e),download:e=>k(`download`,e)};r?a&&Object.defineProperty(A,"url",{get:s,enumerable:!0,configurable:!0}):Object.defineProperty(A,"url",{get(){throw i(`url`)},enumerable:!1,configurable:!0}),Object.defineProperty(A,"meta",r?{value:t.meta,enumerable:!0}:{get(){throw i(`meta`)},enumerable:!1,configurable:!0});for(let e of Object.keys(T)){let t=`to`+e.charAt(0).toUpperCase()+e.slice(1);A[t]||(A[t]=t=>k(e,t))}return A}$.toRaw=(e,t)=>$(e,t).then(e=>e.toRaw()),$.toImg=(e,t)=>$(e,t).then(e=>e.toImg()),$.toSvg=(e,t)=>$(e,t).then(e=>e.toSvg()),$.toCanvas=(e,t)=>$(e,t).then(e=>e.toCanvas()),$.toBlob=(e,t)=>$(e,t).then(e=>e.toBlob()),$.toPng=(e,t)=>$(e,{...t,format:`png`}).then(e=>e.toPng()),$.toJpg=(e,t)=>$(e,{...t,format:`jpeg`}).then(e=>e.toJpg()),$.toWebp=(e,t)=>$(e,{...t,format:`webp`}).then(e=>e.toWebp()),$.download=(e,t)=>$(e,t).then(e=>e.download());var $f=1170,ep=3,tp=3,np=`p, h1, h2, h3, h4, h5, h6, pre, table`,rp=new Set([`P`,`PRE`]),ip=2e3,ap=1e3,op=3e4;function sp(e,t){let n,r=new Promise((e,r)=>{n=setTimeout(()=>r(Error(`Creating the image took too long.`)),t)});return Promise.race([e,r]).finally(()=>clearTimeout(n))}function cp(e){let t=Date.now()+e;return new Promise(e=>{let n=()=>{!Array.from(document.fonts).some(e=>e.status===`loading`)||Date.now()>=t?e():setTimeout(n,30)};setTimeout(n,16)})}async function lp(e){let t=globalThis.FontFaceSet.prototype,n=Object.getOwnPropertyDescriptor(t,`ready`);if(!n?.get)return e();let r=n.get;Object.defineProperty(t,"ready",{configurable:!0,get(){let e=r.call(this);return Promise.race([e.catch(()=>this),cp(ap)]).then(()=>this)}});try{return await e()}finally{Object.defineProperty(t,"ready",n)}}function up(e){return e.family.replace(/^["']|["']$/g,``)}function dp(){let e=new Set,t=new Set;for(let n of document.fonts){let r=up(n);t.add(r),(n.status===`loaded`||n.status===`loading`)&&e.add(r)}return[...t].filter(t=>!e.has(t))}function fp(e){try{return e.sheet?.cssRules!=null}catch{return!1}}async function pp(e){let t=async t=>{try{let n=await fetch(e,{credentials:`omit`,cache:t});return await n.blob(),n.ok}catch{return!1}};await t(`default`)||await t(`reload`)}async function mp(){let e=r();if(e.origin===window.location.origin)return[];let t=document.querySelectorAll(`link[rel~="stylesheet"]`);return await Promise.all(Array.from(t).filter(t=>t.href.startsWith(e.href)&&!fp(t)).map(e=>pp(e.href))),[e.host]}async function hp(e){e.offsetHeight,await cp(ip),await Promise.all(Array.from(e.querySelectorAll(`img`),e=>e.decode().catch(()=>{})))}function gp(e){let t=e.querySelector(`[data-share-card-body]`);if(!t)return;let n=e.offsetHeight-$f;if(n<=0)return;let r=Number.parseFloat(getComputedStyle(t).lineHeight)||30,i=t.offsetHeight-n;if(i<tp*r)return;let a=t.getBoundingClientRect().top,o=Array.from(t.querySelectorAll(np)).filter(e=>!e.parentElement?.closest(`pre, table`)).map(e=>{let t=e.getBoundingClientRect();return{tagName:e.tagName,top:t.top-a,bottom:t.bottom-a}}).filter(e=>e.bottom>e.top),s=o.findIndex(e=>e.bottom>i),c=s===-1?o:o.slice(0,s),l=s===-1?void 0:o[s],u;if(l&&rp.has(l.tagName)&&i-l.top>=tp*r)u=i;else{for(;/^H[1-6]$/.test(c.at(-1)?.tagName??``);)c.pop();u=c.at(-1)?.bottom??i}t.classList.add(`is-cut`),t.style.maxHeight=`${Math.max(0,Math.floor(u))}px`;let d=document.createElement(`div`);d.className=`share-card-fade`,t.appendChild(d)}function _p(e,t){let n=[],r=0,i=0;for(let a=0;a<e.length;a++){let o=e.charAt(a);o===`(`?r++:o===`)`?r--:r===0&&t.test(o)&&(n.push(e.slice(i,a)),i=a+1)}return n.push(e.slice(i)),n.map(e=>e.trim()).filter(Boolean)}function vp(e){return!e||e===`none`?[]:_p(e,/,/).flatMap(e=>{let t=_p(e,/\s/);if(t.includes(`inset`))return[];let n=e=>/^-?[\d.]+(px)?$/.test(e),[r=0,i=0,a=0,o=0]=t.filter(n).map(e=>Number.parseFloat(e)),s=t.find(e=>!n(e));return s?[{x:r,y:i,blur:a,spread:o,color:s}]:[]})}function yp(e){let t=e.querySelector(`.share-card-paper`);if(!t)return null;let n=getComputedStyle(t),r=vp(n.boxShadow);if(r.length===0)return null;let i=e.getBoundingClientRect(),a=t.getBoundingClientRect();return{x:a.left-i.left,y:a.top-i.top,width:a.width,height:a.height,radius:Number.parseFloat(n.borderTopLeftRadius)||0,layers:r}}function bp(e,t,n,r,i,a){let o=Math.max(0,Math.min(a,r/2,i/2));e.moveTo(t+o,n),e.arcTo(t+r,n,t+r,n+i,o),e.arcTo(t+r,n+i,t,n+i,o),e.arcTo(t,n+i,t,n,o),e.arcTo(t,n,t+r,n,o),e.closePath()}function xp(e,t,n){let{canvas:r}=e,i=r.width+(t.width+200)*n;e.save(),e.beginPath(),e.rect(0,0,r.width,r.height),bp(e,t.x*n,t.y*n,t.width*n,t.height*n,t.radius*n),e.clip(`evenodd`);for(let r of[...t.layers].reverse())e.shadowColor=r.color,e.shadowBlur=r.blur*n,e.shadowOffsetX=r.x*n+i,e.shadowOffsetY=r.y*n,e.fillStyle=`#000`,e.beginPath(),bp(e,(t.x-r.spread)*n-i,(t.y-r.spread)*n,(t.width+r.spread*2)*n,(t.height+r.spread*2)*n,Math.max(0,t.radius+r.spread)*n),e.fill();e.restore()}function Sp(e){return new Promise((t,n)=>{e.toBlob(e=>e?t(e):n(Error(`The image came out empty.`)),`image/png`)})}async function Cp(e){let t=document.createElement(`div`);t.className=`share-card-host`,t.setAttribute(`aria-hidden`,`true`),t.innerHTML=e,document.body.appendChild(t);let n=()=>t.remove(),r=mp();try{let e=t.querySelector(`[data-share-card]`);if(!e)throw Error(`The share card is missing.`);await hp(e);let i=dp();return gp(e),{html:e.outerHTML,width:e.offsetWidth,height:e.offsetHeight,dispose:n,async capture(){try{let n=yp(e);t.dataset.capturing=``;let a=await sp(lp(async()=>(await $(e,{scale:ep,dpr:1,reconcile:!0,excludeFonts:{families:i},fontStylesheetDomains:await r})).toCanvas()),op),o=a.getContext(`2d`);n&&o&&xp(o,n,ep);let s=await Sp(a),{width:c,height:l}=a;return a.width=0,a.height=0,{blob:s,width:c,height:l,fileName:`${e.dataset.fileName||`post`}.png`}}finally{n()}}}}catch(e){throw n(),e}}function wp(e,t){return new File([e],t,{type:`image/png`})}function Tp(){try{return navigator.canShare?.({files:[wp(new Blob,`post.png`)]})??!1}catch{return!1}}function Ep(){return globalThis.isSecureContext&&typeof globalThis.ClipboardItem==`function`&&typeof navigator.clipboard?.write==`function`}function Dp(t){return e`<svg
|
|
36
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
37
|
+
viewBox="0 0 24 24"
|
|
38
|
+
fill="none"
|
|
39
|
+
stroke="currentColor"
|
|
40
|
+
stroke-width="1.75"
|
|
41
|
+
stroke-linecap="round"
|
|
42
|
+
stroke-linejoin="round"
|
|
43
|
+
aria-hidden="true"
|
|
44
|
+
>
|
|
45
|
+
${t}
|
|
46
|
+
</svg>`}var Op=n`<path d="M12 2v13" /><path d="m16 6-4-4-4 4" /><path d="M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8" />`,kp=n`<rect width="14" height="14" x="8" y="8" rx="2" ry="2" /><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2" />`,Ap=n`<path d="M12 15V3" /><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><path d="m7 10 5 5 5-5" />`,jp=n`<path d="M18 6 6 18" /><path d="m6 6 12 12" />`;async function Mp(e){let t=new Image;t.src=e,await t.decode()}var Np=class extends i{static properties={_open:{state:!0},_status:{state:!0},_card:{state:!0},_imageUrl:{state:!0}};#e=null;#t=null;#n=()=>Promise.reject(Error());#r=null;#i=0;constructor(){super(),this._open=!1,this._status=`loading`,this._card=null,this._imageUrl=``}createRenderRoot(){return this}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(`resize`,this.#s),this.#o()}updated(){this.#s()}async open(e,t){this.#n=e,this.#r=t,this._open=!0,document.body.style.overflow=`hidden`,window.addEventListener(`resize`,this.#s),await this.updateComplete,this.querySelector(`.share-dialog`)?.showModal(),this.querySelector(`.share-dialog-panel`)?.focus(),await this.#a()}async#a(){let e=++this.#i,t=()=>e===this.#i&&this._open;this.#o(),this._status=`loading`;try{let e=await Cp(await this.#n());if(!t()){e.dispose();return}this.#t=e,this._card={html:e.html,width:e.width,height:e.height},this._status=`developing`;let n=await e.capture();if(this.#t=null,!t())return;let r=URL.createObjectURL(n.blob);if(await Mp(r).catch(()=>{}),!t()){URL.revokeObjectURL(r);return}this.#e=n,this._imageUrl=r,this._status=`ready`}catch{if(!t())return;this.#o(),this._status=`error`}}#o(){this.#t?.dispose(),this.#t=null,this._imageUrl&&URL.revokeObjectURL(this._imageUrl),this._imageUrl=``,this._card=null,this.#e=null}#s=()=>{let e=this.querySelector(`.share-dialog-print`),t=e?.querySelector(`.share-dialog-card`);e&&t&&this._card&&(t.style.transform=`scale(${e.clientWidth/this._card.width})`)};#c(){this.#i++,this.querySelector(`.share-dialog`)?.close(),document.body.style.overflow=``,window.removeEventListener(`resize`,this.#s),this._open=!1,this.#o();let e=this.#r;this.#r=null,queueMicrotask(()=>{e?.isConnected&&e.focus()})}#l(){if(!this.#e||!this._imageUrl)return;let e=document.createElement(`a`);e.href=this._imageUrl,e.download=this.#e.fileName,document.body.appendChild(e),e.click(),e.remove()}async#u(){if(this.#e)try{await navigator.share({files:[wp(this.#e.blob,this.#e.fileName)]})}catch(e){if(e instanceof globalThis.DOMException&&e.name===`AbortError`)return;a(`Could not share the image. Download it instead.`,`error`)}}async#d(){if(this.#e)try{await navigator.clipboard.write([new globalThis.ClipboardItem({"image/png":this.#e.blob})]),a(`Image copied.`)}catch{a(`Could not copy the image. Download it instead.`,`error`)}}#f=e=>{e.key===`Escape`&&(e.preventDefault(),e.stopPropagation(),this.#c())};#p(){let t=this._card,n=this._status===`ready`?e`<img
|
|
47
|
+
class="share-dialog-image"
|
|
48
|
+
src=${this._imageUrl}
|
|
49
|
+
alt="This post as an image"
|
|
50
|
+
/>`:t?e`<div class="share-dialog-card" inert>
|
|
51
|
+
${o(t.html)}
|
|
52
|
+
</div>`:e`<div class="share-dialog-blank"></div>`;return e`
|
|
53
|
+
<div
|
|
54
|
+
class="share-dialog-print"
|
|
55
|
+
data-status=${this._status}
|
|
56
|
+
style=${t?`aspect-ratio: ${t.width} / ${t.height}`:``}
|
|
57
|
+
>
|
|
58
|
+
${n}
|
|
59
|
+
</div>
|
|
60
|
+
`}#m(){return this._status===`error`?e`
|
|
61
|
+
<p class="share-dialog-status">
|
|
62
|
+
Could not create the image. Check your connection and try again.
|
|
63
|
+
</p>
|
|
64
|
+
<button
|
|
65
|
+
type="button"
|
|
66
|
+
class="btn-outline"
|
|
67
|
+
@click=${()=>void this.#a()}
|
|
68
|
+
>
|
|
69
|
+
Try again
|
|
70
|
+
</button>
|
|
71
|
+
`:this.#p()}#h(){switch(this._status){case`loading`:case`developing`:return`Creating the image…`;case`ready`:return e`<span class="share-dialog-hint"
|
|
72
|
+
>Press and hold the image to save it.</span
|
|
73
|
+
>`;case`error`:return t}}#g(){if(this._status===`error`)return t;let n=this._status===`ready`;return e`
|
|
74
|
+
<footer class="share-dialog-actions">
|
|
75
|
+
${Tp()?e`<button
|
|
76
|
+
type="button"
|
|
77
|
+
class="btn-outline"
|
|
78
|
+
?disabled=${!n}
|
|
79
|
+
@click=${()=>void this.#u()}
|
|
80
|
+
>
|
|
81
|
+
${Dp(Op)} Share…
|
|
82
|
+
</button>`:t}
|
|
83
|
+
${Ep()?e`<button
|
|
84
|
+
type="button"
|
|
85
|
+
class="btn-outline"
|
|
86
|
+
?disabled=${!n}
|
|
87
|
+
@click=${()=>void this.#d()}
|
|
88
|
+
>
|
|
89
|
+
${Dp(kp)} Copy image
|
|
90
|
+
</button>`:t}
|
|
91
|
+
<button
|
|
92
|
+
type="button"
|
|
93
|
+
class="btn-outline share-dialog-close"
|
|
94
|
+
@click=${()=>this.#c()}
|
|
95
|
+
>
|
|
96
|
+
${Dp(jp)} Close
|
|
97
|
+
</button>
|
|
98
|
+
<button
|
|
99
|
+
type="button"
|
|
100
|
+
class="btn"
|
|
101
|
+
?disabled=${!n}
|
|
102
|
+
@click=${()=>this.#l()}
|
|
103
|
+
>
|
|
104
|
+
${Dp(Ap)} Download
|
|
105
|
+
</button>
|
|
106
|
+
</footer>
|
|
107
|
+
`}render(){return this._open?e`
|
|
108
|
+
<dialog
|
|
109
|
+
class="dialog share-dialog"
|
|
110
|
+
@cancel=${e=>{e.preventDefault(),this.#c()}}
|
|
111
|
+
@keydown=${this.#f}
|
|
112
|
+
@click=${e=>{e.target.tagName===`DIALOG`&&this.#c()}}
|
|
113
|
+
>
|
|
114
|
+
<div
|
|
115
|
+
class="share-dialog-panel"
|
|
116
|
+
tabindex="-1"
|
|
117
|
+
role="document"
|
|
118
|
+
aria-labelledby="share-dialog-title"
|
|
119
|
+
>
|
|
120
|
+
<header>
|
|
121
|
+
<h2 id="share-dialog-title">Share as image</h2>
|
|
122
|
+
</header>
|
|
123
|
+
<section class="share-dialog-preview" data-status=${this._status}>
|
|
124
|
+
${this.#m()}
|
|
125
|
+
</section>
|
|
126
|
+
<p class="share-dialog-note" aria-live="polite">
|
|
127
|
+
${this.#h()}
|
|
128
|
+
</p>
|
|
129
|
+
${this.#g()}
|
|
130
|
+
<button
|
|
131
|
+
type="button"
|
|
132
|
+
aria-label="Close"
|
|
133
|
+
@click=${()=>this.#c()}
|
|
134
|
+
>
|
|
135
|
+
<svg
|
|
136
|
+
viewBox="0 0 24 24"
|
|
137
|
+
fill="none"
|
|
138
|
+
stroke="currentColor"
|
|
139
|
+
stroke-width="2"
|
|
140
|
+
stroke-linecap="round"
|
|
141
|
+
stroke-linejoin="round"
|
|
142
|
+
aria-hidden="true"
|
|
143
|
+
>
|
|
144
|
+
<path d="M18 6 6 18M6 6l12 12" />
|
|
145
|
+
</svg>
|
|
146
|
+
</button>
|
|
147
|
+
</div>
|
|
148
|
+
</dialog>
|
|
149
|
+
`:t}};customElements.define(`jant-share-dialog`,Np);
|