pk-annotator 0.6.2 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.ko.md +9 -1
- package/README.md +9 -1
- package/dist/overlay.mjs +48 -4
- package/dist/{pka-mcp-server-DJ7A2u68.mjs → pka-mcp-server-DeBVJQYE.mjs} +233 -18
- package/dist/pka-mcp.mjs +1 -1
- package/dist/{pka-overlay-agent-art-BKBtrWqF.mjs → pka-overlay-agent-art-n6aH_1kF.mjs} +1 -1
- package/dist/{pka-overlay-agent-theme-CfCyg5Gv.mjs → pka-overlay-agent-theme-DfiOu97H.mjs} +13 -1
- package/dist/{pka-overlay-app-CsIxnRqJ.mjs → pka-overlay-app-D-PF-HmH.mjs} +69 -48
- package/dist/pka-overlay-channel-C6qfFolf.mjs +113 -0
- package/dist/pka-overlay-composer-CK1sTHAv.mjs +244 -0
- package/dist/{pka-overlay-copy-CvKjfQl1.mjs → pka-overlay-copy-BTMmwtSZ.mjs} +1 -1
- package/dist/{pka-overlay-gifenc-BGK0llcr.mjs → pka-overlay-gifenc-DqOpaD2I.mjs} +1 -1
- package/dist/{pka-overlay-perf-panel-gQYSZ0gA.mjs → pka-overlay-perf-panel-xd8kgxtm.mjs} +2 -2
- package/dist/{pka-overlay-send-BZyT4xuW.mjs → pka-overlay-send-UrgGuLhh.mjs} +6 -6
- package/dist/{pka-overlay-snapdom-djDPjHu_.mjs → pka-overlay-snapdom-BArbLl8i.mjs} +1 -1
- package/dist/{pka-overlay-thread-store-DOxLXsAv.mjs → pka-overlay-thread-store-X3FM2ev_.mjs} +1 -1
- package/dist/pka-overlay-untracked-fetch-Dj1et-Fv.mjs +1 -0
- package/dist/pka.mjs +2 -1
- package/dist/{recording-CpEDddkZ.mjs → recording-82fajWWq.mjs} +41 -14
- package/dist/vite.mjs +255 -3
- package/package.json +1 -1
- package/dist/pka-overlay-channel-D5Ghnvgb.mjs +0 -113
- package/dist/pka-overlay-composer-CT2x7vgj.mjs +0 -244
- package/dist/pka-overlay-untracked-fetch-BCn3eft5.mjs +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as e}from"./pka-overlay-untracked-fetch-BCn3eft5.mjs";var t=Object.defineProperty,n=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})};function i(e){return e===!1||typeof e==`string`&&e.toLowerCase().trim()===`disabled`?`disabled`:`soft`}function a(e=`soft`){e===`disabled`&&(s.computedStyle=/* @__PURE__ */ new WeakMap,s.measureHints=/* @__PURE__ */ new WeakMap,s.baseStyle=new o(50),s.defaultStyle=new o(64),s.image=new o(100),s.background=new o(100),s.resource=new o(150),s.compress=new o(50))}var o,s,c=n(()=>{o=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)}},s={image:new o(100),background:new o(100),resource:new o(150),defaultStyle:new o(64),baseStyle:new o(50),compress:new o(50),computedStyle:/* @__PURE__ */ new WeakMap,measureHints:/* @__PURE__ */ new WeakMap,warnedReconcile:!1}});function l(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith(`#`)?null:n}function u(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 d(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 u(n[1])){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)continue;let n=e.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(n&&!C.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 f(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 p(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function m(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 h(e){return!!e&&e.tagName===`INPUT`&&(e.getAttribute(`type`)||``).toLowerCase()===`password`}function g(e){return`•`.repeat(String(e??``).length)}function _(e,t){return e?.nodeType===1&&e.localName===t}function v(e){return e?.nodeType===1&&e.namespaceURI===w}function y(e){return e?.nodeType===1&&e.namespaceURI===T}function b(e){return e?.nodeType===11&&!!e.host}function x(e){return e?.nodeType===9}var S,C,w,T,E=n(()=>{S=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,C=S,w=`http://www.w3.org/1999/xhtml`,T=`http://www.w3.org/2000/svg`});function D(e=`[snapDOM]`,{ttlMs:t=3e5,maxEntries:n=12}={}){let r=/* @__PURE__ */ 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 O(e,t,n){if(P.size>=oe){let e=Date.now();for(let[t,n]of P)n.until<=e&&P.delete(t);for(;P.size>=oe;)P.delete(P.keys().next().value)}P.set(e,{until:Date.now()+n,result:t})}function k(e){return/^data:|^blob:|^about:blank$/i.test(e)}function A(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 ee(e,t){if(!t||k(e)||A(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 j(e,t){return t?/\{url(?:Raw)?\}/.test(t)?t.replace(`{urlRaw}`,()=>p(e)).replace(`{url}`,()=>encodeURIComponent(e)):/[?&]url=?$/.test(t)?`${t}${encodeURIComponent(e)}`:t.endsWith(`?`)?`${t}url=${encodeURIComponent(e)}`:t.endsWith(`/`)?`${t}${p(e)}`:`${t}${t.includes(`?`)?`&`:`?`}url=${encodeURIComponent(e)}`:e}function te(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||``)),r.onerror=()=>n(/* @__PURE__ */ Error(`read_failed`)),r.readAsDataURL(e)})}function ne(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 M(e){try{return new URL(e,globalThis.location?.href||`http://localhost/`).origin}catch{return`invalid-url`}}function re(e,t){try{e.onError?.(t)}catch{}}async function N(t,n={}){let r=n.as??`blob`,i=n.timeout??3e3,a=n.useProxy||``,o=n.errorTTL??8e3,s=n.headers||{},c=!!n.silent;if(/^data:/i.test(t))try{if(r===`text`)return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(r===`dataURL`)return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(`;`)[0]||``};let[,e=``,n=``]=String(t).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(e)?atob(n):decodeURIComponent(n),a=new Uint8Array([...i].map(e=>e.charCodeAt(0))),o=new Blob([a],{type:(e||``).split(`;`)[0]||``});return{ok:!0,data:o,status:200,url:t,fromCache:!1,mime:o.type||``}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:`special_url_error`}}if(/^blob:/i.test(t))try{let n=await e(t);if(!n.ok)return{ok:!1,data:null,status:n.status,url:t,fromCache:!1,reason:`http_error`};let i=await n.blob(),a=i.type||n.headers.get(`content-type`)||``;return r===`dataURL`?{ok:!0,data:await te(i),blob:i,status:n.status,url:t,fromCache:!1,mime:a}:r===`text`?{ok:!0,data:await i.text(),status:n.status,url:t,fromCache:!1,mime:a}:{ok:!0,data:i,status:n.status,url:t,fromCache:!1,mime:a}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:`network`}}if(/^about:blank$/i.test(t))return r===`dataURL`?{ok:!0,data:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==`,status:200,url:t,fromCache:!1,mime:`image/png`}:{ok:!0,data:r===`text`?``:new Blob([]),status:200,url:t,fromCache:!1};let l;try{l=ne(t,{as:r,timeout:i,useProxy:a,errorTTL:o,credentials:n.credentials,headers:s})}catch{let e={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:`network`};return re(n,e),e}let u=P.get(l);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&P.delete(l);let d=ae.get(l);if(d)return d;let f=ee(t,a)?j(t,a):t,p=n.credentials;if(!p)try{let e=typeof location<`u`&&location.href?location.href:`http://localhost/`,n=new URL(t,e);p=typeof location<`u`&&n.origin===location.origin?`include`:`omit`}catch{p=`omit`}let m=new AbortController,h=setTimeout(()=>m.abort(`timeout`),i),g=(async()=>{try{let i=await e(f,{signal:m.signal,credentials:p,headers:s});if(!i.ok){let e={ok:!1,data:null,status:i.status,url:f,fromCache:!1,reason:`http_error`};if(l!==null&&o>0&&O(l,e,o),!c){let e=`${i.status} ${i.statusText||``}`.trim();ie.warnOnce(`http:${i.status}:${r}:${M(t)}`,`HTTP ${e} fetching ${r}: ${t}`)}return re(n,e),e}if(r===`text`)return{ok:!0,data:await i.text(),status:i.status,url:f,fromCache:!1};let a=await i.blob(),u=a.type||i.headers.get(`content-type`)||``;return r===`dataURL`?{ok:!0,data:await te(a),blob:a,status:i.status,url:f,fromCache:!1,mime:u}:{ok:!0,data:a,status:i.status,url:f,fromCache:!1,mime:u}}catch(e){let a=m.signal.aborted?m.signal.reason===`timeout`?`timeout`:`abort`:e&&typeof e==`object`&&e.name===`AbortError`?`abort`:`network`,s={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:a};if(l!==null&&!/^blob:/i.test(t)&&o>0&&O(l,s,o),!c){let e=`${a}:${r}:${M(t)}`,n=a===`timeout`?`Timeout (${i}ms): ${t}. Increase timeout or use a proxy`:a===`abort`?`Aborted fetching ${r}: ${t}`:`Network/CORS fetching ${r}: ${t}. Try useProxy`;ie.errorOnce(e,n)}return re(n,s),s}finally{clearTimeout(h),ae.delete(l)}})();return l!==null&&ae.set(l,g),g}var ie,ae,oe,P,F=n(()=>{E(),ie=D(`[snapDOM]`,{ttlMs:18e4,maxEntries:10}),ae=/* @__PURE__ */ new Map,oe=50,P=/* @__PURE__ */ new Map});async function se(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=d(e,typeof devicePixelRatio<`u`&&devicePixelRatio||1)??l(e);if(!n)return e;let r=p(m(n)),i=(t.useProxy||``)+`|`+r;if(s.background.has(i)){let e=s.background.get(i);return e?`url("${e}")`:`none`}try{let e=await N(r,{as:`dataURL`,useProxy:t.useProxy});return e.ok?(s.background.set(i,e.data),`url("${e.data}")`):(s.background.set(i,null),`none`)}catch{return s.background.set(i,null),`none`}}var ce=n(()=>{c(),E(),F()});function le(e){let t=e.replace(Ce,``).trim();return t?t.replace(/(^|,)(\s*)(?=,|$)/g,`$1$2*`):`*`}function ue(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;if(o){let e=!!a.selectorText&&be.test(a.selectorText);for(let n=0;n<o.length;n++){let i=o[n];if(t.add(i),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]&&xe.test(o.getPropertyValue(i))&&(r[e]=!0)}}}let s=a.selectorText;if(s&&s.includes(`:has(`)&&(r.usesHas=!0),s&&s.includes(`&`))for(let e=a.parentRule;e&&s.includes(`&`);e=e.parentRule)e.selectorText&&(s=s.replace(/&/g,`:is(${e.selectorText})`));if(s&&(r.inContainer||we.test(s)||s.includes(`+`)||s.includes(`~`)))for(let e of me(s,`,`)){let t=e.trim();t&&(r.inContainer||we.test(t)||t.includes(`+`)||t.includes(`~`))&&r.shareUnsafeSels.add(t)}if(s&&s.includes(`:`))for(let e in Se)Se[e].test(s)&&n[e].push(le(s));if(a.styleSheet){if(!de(a.styleSheet,t,n,r))return!1}else if(a.cssRules&&a.cssRules.length){let e=a.constructor?.name===`CSSContainerRule`;e&&r.inContainer++;let i=ue(a.cssRules,t,n,r);if(e&&r.inContainer--,!i)return!1}}return!0}function de(e,t,n,r){let i;try{i=e.cssRules}catch{return!1}return i?ue(i,t,n,r):!1}function fe(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 pe(e){let t=/* @__PURE__ */ new Set;return de(e,t,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:2e4,usesHas:!1,shareUnsafeSels:/* @__PURE__ */ new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:/* @__PURE__ */ new Set,pseudoProps:/* @__PURE__ */ new Set})?t:null}function me(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 he(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 I(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 L(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]=I(n,i)}return r}function ge(e){let t={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(_e),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:/* @__PURE__ */ new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:/* @__PURE__ */ new Set,pseudoProps:/* @__PURE__ */ new Set};for(let a of e.styleSheets)if(!de(a,n,r,i))return t;let a=e.adoptedStyleSheets;if(Array.isArray(a)){for(let e of a)if(!de(e,n,r,i))return t}typeof e.getAnimations==`function`&&fe(e.getAnimations(),n);let o=Array.from(i.shareUnsafeSels),s=I(e.createElement(`div`),o)===null?null:o.map(e=>({sel:e,key:he(e)})),c=new Set(ye);for(let e of ve)n.has(e)&&c.add(e);for(let e of i.pseudoProps)c.add(e);return{universe:n,pseudoUniverse:c,pseudoGates:L(e,r),usesHas:i.usesHas,shareGate:s,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return t}}var _e,ve,ye,be,xe,Se,Ce,we,Te=n(()=>{_e=/* @__PURE__ */ `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(`.`),ve=/* @__PURE__ */ `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(`.`),ye=[`display`,`width`,`height`,`min-width`,`min-height`],be=/::?(?:before|after|first-letter|first-line|marker)/,xe=/%|\bauto\b|calc\(|var\(/i,Se={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Ce=/::?(?:before|after|first-letter|first-line|marker)\b/g,we=/:(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 R(e){return De.add(e),e.setAttribute(`data-snapdom-internal`,``),e}function Ee(e){return De.has(e)}var De,z=n(()=>{De=/* @__PURE__ */ new WeakSet});function Oe(e){if(e=String(e).toLowerCase(),Ve.has(e)){let t={};return s.defaultStyle.set(e,t),t}if(s.defaultStyle.has(e))return s.defaultStyle.get(e);let t=[...document.querySelectorAll(`#snapdom-sandbox`)].find(Ee);t||(t=document.createElement(`div`),R(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)ke(e)||(i[e]=r.getPropertyValue(e));for(let e of _e)!(e in i)&&!ke(e)&&(i[e]=r.getPropertyValue(e));return t.removeChild(n),s.defaultStyle.set(e,i),i}function ke(e){let t=Ge.get(e);if(t===void 0){let n=String(e).toLowerCase();t=We.has(n)||Ue.test(n)||He.test(n),Ge.set(e,t)}return t}function Ae(e,t){let n=Ze.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 je(e,t){return!Je.has(e)&&(t===`inline`||Ke.has(e)||qe.has(e))}function Me(e,t,n){let r=(t.display||``).toLowerCase();if(r===`inline`||qe.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:!$e.has(r)}function Ne(e,t,n=!0,r=!1){if(t=String(t||``).toLowerCase(),Ve.has(t))return``;let i=[],a=Oe(t),o=(e.display||``).toLowerCase(),s=o===`inline`,c=je(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 t in e){if(ke(t)||Ae(t,e))continue;let n=e[t];if(d){if(Ye.has(t))continue;if(Xe.has(t)){n&&n!==a[t]&&(i.push(`${t}:${n}`),n!==`auto`&&(f=!0));continue}}if(n&&n!==a[t]){if(!u&&(t===`width`||t===`inline-size`)&&n.endsWith(`px`)&&n.includes(`.`)){let e=parseFloat(n);if(Number.isFinite(e)){i.push(`${t}:${(e+Qe).toFixed(3)}px`);continue}}i.push(`${t}:${n}`)}}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 Pe(e){let t=/* @__PURE__ */ 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 Fe(e,t=null){let n=/* @__PURE__ */ new Map;for(let r of e){let e=Oe(r);if(!e)continue;let i=(t?Object.entries(e).filter(([e])=>t.has(e)):Object.entries(e)).filter(([t])=>!Ae(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??=/* @__PURE__ */ new Set;let a=``;if(i.size&&r.length>1){let e=r.flatMap(e=>e.tagList);a+=`${e.join(`,`)} { ${[...i].join(``)} }
|
|
1
|
+
import{t as e}from"./pka-overlay-untracked-fetch-Dj1et-Fv.mjs";var t=Object.defineProperty,n=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},r=(e,n)=>{for(var r in n)t(e,r,{get:n[r],enumerable:!0})};function i(e){return e===!1||typeof e==`string`&&e.toLowerCase().trim()===`disabled`?`disabled`:`soft`}function a(e=`soft`){e===`disabled`&&(s.computedStyle=/* @__PURE__ */ new WeakMap,s.measureHints=/* @__PURE__ */ new WeakMap,s.baseStyle=new o(50),s.defaultStyle=new o(64),s.image=new o(100),s.background=new o(100),s.resource=new o(150),s.compress=new o(50))}var o,s,c=n(()=>{o=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)}},s={image:new o(100),background:new o(100),resource:new o(150),defaultStyle:new o(64),baseStyle:new o(50),compress:new o(50),computedStyle:/* @__PURE__ */ new WeakMap,measureHints:/* @__PURE__ */ new WeakMap,warnedReconcile:!1}});function l(e){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)return null;let n=t[2].trim();return n.startsWith(`#`)?null:n}function u(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 d(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 u(n[1])){let t=e.match(/url\((['"]?)(.*?)(\1)\)/);if(!t)continue;let n=e.match(/type\(\s*["']([^"']+)["']\s*\)/i);if(n&&!C.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 f(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 p(e){if(/%[0-9A-Fa-f]{2}/.test(e))return e;try{return encodeURI(e)}catch{return e}}function m(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 h(e){return!!e&&e.tagName===`INPUT`&&(e.getAttribute(`type`)||``).toLowerCase()===`password`}function g(e){return`•`.repeat(String(e??``).length)}function _(e,t){return e?.nodeType===1&&e.localName===t}function v(e){return e?.nodeType===1&&e.namespaceURI===w}function y(e){return e?.nodeType===1&&e.namespaceURI===T}function b(e){return e?.nodeType===11&&!!e.host}function x(e){return e?.nodeType===9}var S,C,w,T,E=n(()=>{S=/^image\/(jpeg|jpg|png|gif|webp|avif|apng|svg\+xml|bmp|x-icon|vnd\.microsoft\.icon)\s*(;|$)/i,C=S,w=`http://www.w3.org/1999/xhtml`,T=`http://www.w3.org/2000/svg`});function D(e=`[snapDOM]`,{ttlMs:t=3e5,maxEntries:n=12}={}){let r=/* @__PURE__ */ 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 O(e,t,n){if(P.size>=oe){let e=Date.now();for(let[t,n]of P)n.until<=e&&P.delete(t);for(;P.size>=oe;)P.delete(P.keys().next().value)}P.set(e,{until:Date.now()+n,result:t})}function k(e){return/^data:|^blob:|^about:blank$/i.test(e)}function A(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 ee(e,t){if(!t||k(e)||A(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 j(e,t){return t?/\{url(?:Raw)?\}/.test(t)?t.replace(`{urlRaw}`,()=>p(e)).replace(`{url}`,()=>encodeURIComponent(e)):/[?&]url=?$/.test(t)?`${t}${encodeURIComponent(e)}`:t.endsWith(`?`)?`${t}url=${encodeURIComponent(e)}`:t.endsWith(`/`)?`${t}${p(e)}`:`${t}${t.includes(`?`)?`&`:`?`}url=${encodeURIComponent(e)}`:e}function te(e){return new Promise((t,n)=>{let r=new FileReader;r.onload=()=>t(String(r.result||``)),r.onerror=()=>n(/* @__PURE__ */ Error(`read_failed`)),r.readAsDataURL(e)})}function ne(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 M(e){try{return new URL(e,globalThis.location?.href||`http://localhost/`).origin}catch{return`invalid-url`}}function re(e,t){try{e.onError?.(t)}catch{}}async function N(t,n={}){let r=n.as??`blob`,i=n.timeout??3e3,a=n.useProxy||``,o=n.errorTTL??8e3,s=n.headers||{},c=!!n.silent;if(/^data:/i.test(t))try{if(r===`text`)return{ok:!0,data:String(t),status:200,url:t,fromCache:!1};if(r===`dataURL`)return{ok:!0,data:String(t),status:200,url:t,fromCache:!1,mime:String(t).slice(5).split(`;`)[0]||``};let[,e=``,n=``]=String(t).match(/^data:([^,]*),(.*)$/)||[],i=/;base64/i.test(e)?atob(n):decodeURIComponent(n),a=new Uint8Array([...i].map(e=>e.charCodeAt(0))),o=new Blob([a],{type:(e||``).split(`;`)[0]||``});return{ok:!0,data:o,status:200,url:t,fromCache:!1,mime:o.type||``}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:`special_url_error`}}if(/^blob:/i.test(t))try{let n=await e(t);if(!n.ok)return{ok:!1,data:null,status:n.status,url:t,fromCache:!1,reason:`http_error`};let i=await n.blob(),a=i.type||n.headers.get(`content-type`)||``;return r===`dataURL`?{ok:!0,data:await te(i),blob:i,status:n.status,url:t,fromCache:!1,mime:a}:r===`text`?{ok:!0,data:await i.text(),status:n.status,url:t,fromCache:!1,mime:a}:{ok:!0,data:i,status:n.status,url:t,fromCache:!1,mime:a}}catch{return{ok:!1,data:null,status:0,url:t,fromCache:!1,reason:`network`}}if(/^about:blank$/i.test(t))return r===`dataURL`?{ok:!0,data:`data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR4nGMAAQAABQABDQottAAAAABJRU5ErkJggg==`,status:200,url:t,fromCache:!1,mime:`image/png`}:{ok:!0,data:r===`text`?``:new Blob([]),status:200,url:t,fromCache:!1};let l;try{l=ne(t,{as:r,timeout:i,useProxy:a,errorTTL:o,credentials:n.credentials,headers:s})}catch{let e={ok:!1,data:null,status:0,url:t,fromCache:!1,reason:`network`};return re(n,e),e}let u=P.get(l);if(u&&u.until>Date.now())return{...u.result,fromCache:!0};u&&P.delete(l);let d=ae.get(l);if(d)return d;let f=ee(t,a)?j(t,a):t,p=n.credentials;if(!p)try{let e=typeof location<`u`&&location.href?location.href:`http://localhost/`,n=new URL(t,e);p=typeof location<`u`&&n.origin===location.origin?`include`:`omit`}catch{p=`omit`}let m=new AbortController,h=setTimeout(()=>m.abort(`timeout`),i),g=(async()=>{try{let i=await e(f,{signal:m.signal,credentials:p,headers:s});if(!i.ok){let e={ok:!1,data:null,status:i.status,url:f,fromCache:!1,reason:`http_error`};if(l!==null&&o>0&&O(l,e,o),!c){let e=`${i.status} ${i.statusText||``}`.trim();ie.warnOnce(`http:${i.status}:${r}:${M(t)}`,`HTTP ${e} fetching ${r}: ${t}`)}return re(n,e),e}if(r===`text`)return{ok:!0,data:await i.text(),status:i.status,url:f,fromCache:!1};let a=await i.blob(),u=a.type||i.headers.get(`content-type`)||``;return r===`dataURL`?{ok:!0,data:await te(a),blob:a,status:i.status,url:f,fromCache:!1,mime:u}:{ok:!0,data:a,status:i.status,url:f,fromCache:!1,mime:u}}catch(e){let a=m.signal.aborted?m.signal.reason===`timeout`?`timeout`:`abort`:e&&typeof e==`object`&&e.name===`AbortError`?`abort`:`network`,s={ok:!1,data:null,status:0,url:f,fromCache:!1,reason:a};if(l!==null&&!/^blob:/i.test(t)&&o>0&&O(l,s,o),!c){let e=`${a}:${r}:${M(t)}`,n=a===`timeout`?`Timeout (${i}ms): ${t}. Increase timeout or use a proxy`:a===`abort`?`Aborted fetching ${r}: ${t}`:`Network/CORS fetching ${r}: ${t}. Try useProxy`;ie.errorOnce(e,n)}return re(n,s),s}finally{clearTimeout(h),ae.delete(l)}})();return l!==null&&ae.set(l,g),g}var ie,ae,oe,P,F=n(()=>{E(),ie=D(`[snapDOM]`,{ttlMs:18e4,maxEntries:10}),ae=/* @__PURE__ */ new Map,oe=50,P=/* @__PURE__ */ new Map});async function se(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=d(e,typeof devicePixelRatio<`u`&&devicePixelRatio||1)??l(e);if(!n)return e;let r=p(m(n)),i=(t.useProxy||``)+`|`+r;if(s.background.has(i)){let e=s.background.get(i);return e?`url("${e}")`:`none`}try{let e=await N(r,{as:`dataURL`,useProxy:t.useProxy});return e.ok?(s.background.set(i,e.data),`url("${e.data}")`):(s.background.set(i,null),`none`)}catch{return s.background.set(i,null),`none`}}var ce=n(()=>{c(),E(),F()});function le(e){let t=e.replace(Ce,``).trim();return t?t.replace(/(^|,)(\s*)(?=,|$)/g,`$1$2*`):`*`}function ue(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;if(o){let e=!!a.selectorText&&be.test(a.selectorText);for(let n=0;n<o.length;n++){let i=o[n];if(t.add(i),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]&&xe.test(o.getPropertyValue(i))&&(r[e]=!0)}}}let s=a.selectorText;if(s&&s.includes(`:has(`)&&(r.usesHas=!0),s&&s.includes(`&`))for(let e=a.parentRule;e&&s.includes(`&`);e=e.parentRule)e.selectorText&&(s=s.replace(/&/g,`:is(${e.selectorText})`));if(s&&(r.inContainer||we.test(s)||s.includes(`+`)||s.includes(`~`)))for(let e of me(s,`,`)){let t=e.trim();t&&(r.inContainer||we.test(t)||t.includes(`+`)||t.includes(`~`))&&r.shareUnsafeSels.add(t)}if(s&&s.includes(`:`))for(let e in Se)Se[e].test(s)&&n[e].push(le(s));if(a.styleSheet){if(!de(a.styleSheet,t,n,r))return!1}else if(a.cssRules&&a.cssRules.length){let e=a.constructor?.name===`CSSContainerRule`;e&&r.inContainer++;let i=ue(a.cssRules,t,n,r);if(e&&r.inContainer--,!i)return!1}}return!0}function de(e,t,n,r){let i;try{i=e.cssRules}catch{return!1}return i?ue(i,t,n,r):!1}function fe(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 pe(e){let t=/* @__PURE__ */ new Set;return de(e,t,{before:[],after:[],firstLetter:[],marker:[],firstLine:[]},{budget:2e4,usesHas:!1,shareUnsafeSels:/* @__PURE__ */ new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:/* @__PURE__ */ new Set,pseudoProps:/* @__PURE__ */ new Set})?t:null}function me(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 he(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 I(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 L(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]=I(n,i)}return r}function ge(e){let t={universe:null,pseudoUniverse:null,usesHas:!0,shareGate:null,marginUnstable:!0,paddingUnstable:!0,importantProps:null,pseudoGates:{before:null,after:null,firstLetter:null,marker:null,firstLine:null}};try{let n=new Set(_e),r={before:[],after:[],firstLetter:[],marker:[],firstLine:[]},i={budget:2e4,usesHas:!1,shareUnsafeSels:/* @__PURE__ */ new Set,inContainer:0,marginUnstable:!1,paddingUnstable:!1,importantProps:/* @__PURE__ */ new Set,pseudoProps:/* @__PURE__ */ new Set};for(let a of e.styleSheets)if(!de(a,n,r,i))return t;let a=e.adoptedStyleSheets;if(Array.isArray(a)){for(let e of a)if(!de(e,n,r,i))return t}typeof e.getAnimations==`function`&&fe(e.getAnimations(),n);let o=Array.from(i.shareUnsafeSels),s=I(e.createElement(`div`),o)===null?null:o.map(e=>({sel:e,key:he(e)})),c=new Set(ye);for(let e of ve)n.has(e)&&c.add(e);for(let e of i.pseudoProps)c.add(e);return{universe:n,pseudoUniverse:c,pseudoGates:L(e,r),usesHas:i.usesHas,shareGate:s,marginUnstable:i.marginUnstable,paddingUnstable:i.paddingUnstable,importantProps:i.importantProps}}catch{return t}}var _e,ve,ye,be,xe,Se,Ce,we,Te=n(()=>{_e=/* @__PURE__ */ `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(`.`),ve=/* @__PURE__ */ `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(`.`),ye=[`display`,`width`,`height`,`min-width`,`min-height`],be=/::?(?:before|after|first-letter|first-line|marker)/,xe=/%|\bauto\b|calc\(|var\(/i,Se={before:/::?before\b/,after:/::?after\b/,firstLetter:/::?first-letter\b/,marker:/::marker\b/,firstLine:/::?first-line\b/},Ce=/::?(?:before|after|first-letter|first-line|marker)\b/g,we=/:(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 R(e){return De.add(e),e.setAttribute(`data-snapdom-internal`,``),e}function Ee(e){return De.has(e)}var De,z=n(()=>{De=/* @__PURE__ */ new WeakSet});function Oe(e){if(e=String(e).toLowerCase(),Ve.has(e)){let t={};return s.defaultStyle.set(e,t),t}if(s.defaultStyle.has(e))return s.defaultStyle.get(e);let t=[...document.querySelectorAll(`#snapdom-sandbox`)].find(Ee);t||(t=document.createElement(`div`),R(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)ke(e)||(i[e]=r.getPropertyValue(e));for(let e of _e)!(e in i)&&!ke(e)&&(i[e]=r.getPropertyValue(e));return t.removeChild(n),s.defaultStyle.set(e,i),i}function ke(e){let t=Ge.get(e);if(t===void 0){let n=String(e).toLowerCase();t=We.has(n)||Ue.test(n)||He.test(n),Ge.set(e,t)}return t}function Ae(e,t){let n=Ze.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 je(e,t){return!Je.has(e)&&(t===`inline`||Ke.has(e)||qe.has(e))}function Me(e,t,n){let r=(t.display||``).toLowerCase();if(r===`inline`||qe.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:!$e.has(r)}function Ne(e,t,n=!0,r=!1){if(t=String(t||``).toLowerCase(),Ve.has(t))return``;let i=[],a=Oe(t),o=(e.display||``).toLowerCase(),s=o===`inline`,c=je(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 t in e){if(ke(t)||Ae(t,e))continue;let n=e[t];if(d){if(Ye.has(t))continue;if(Xe.has(t)){n&&n!==a[t]&&(i.push(`${t}:${n}`),n!==`auto`&&(f=!0));continue}}if(n&&n!==a[t]){if(!u&&(t===`width`||t===`inline-size`)&&n.endsWith(`px`)&&n.includes(`.`)){let e=parseFloat(n);if(Number.isFinite(e)){i.push(`${t}:${(e+Qe).toFixed(3)}px`);continue}}i.push(`${t}:${n}`)}}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 Pe(e){let t=/* @__PURE__ */ 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 Fe(e,t=null){let n=/* @__PURE__ */ new Map;for(let r of e){let e=Oe(r);if(!e)continue;let i=(t?Object.entries(e).filter(([e])=>t.has(e)):Object.entries(e)).filter(([t])=>!Ae(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??=/* @__PURE__ */ new Set;let a=``;if(i.size&&r.length>1){let e=r.flatMap(e=>e.tagList);a+=`${e.join(`,`)} { ${[...i].join(``)} }
|
|
2
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
3
|
`}return a}function Ie(e){let t=Array.from(new Set(e.values())).filter(Boolean).sort(),n=/* @__PURE__ */ new Map,r=1;for(let e of t)n.set(e,`c${r++}`);return n}function Le(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 B(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=s.computedStyle.get(e);r||(r=/* @__PURE__ */ new Map,s.computedStyle.set(e,r));let i=r.get(t);if(!i){let a=Le(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 Re(e,t=null){let n={};for(let r of t||e){let t=e.getPropertyValue(r);t&&(n[r]=t)}for(let e of et){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 ze(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 Be,Ve,He,Ue,We,Ge,Ke,qe,Je,Ye,Xe,Ze,Qe,$e,et,tt=n(()=>{c(),Te(),z(),Be=/* @__PURE__ */ new Set([`meta`,`script`,`noscript`,`title`,`link`,`template`]),Ve=/* @__PURE__ */ new Set(/* @__PURE__ */ `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(`.`)),He=/(?:^|-)(animation|transition)(?:-|$)/i,Ue=/^(--.+|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,We=/* @__PURE__ */ 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`]),Ge=/* @__PURE__ */ new Map,Ke=/* @__PURE__ */ new Set([`span`,`small`,`em`,`strong`,`b`,`i`,`u`,`s`,`code`,`cite`,`mark`,`sub`,`sup`]),qe=/* @__PURE__ */ new Set([`table`,`thead`,`tbody`,`tfoot`,`tr`,`td`,`th`]),Je=/* @__PURE__ */ new Set([`img`,`video`,`canvas`,`svg`,`iframe`,`embed`,`object`,`input`,`textarea`,`select`]),Ye=/* @__PURE__ */ new Set([`width`,`max-width`,`inline-size`,`max-inline-size`]),Xe=/* @__PURE__ */ new Set([`min-width`,`min-inline-size`]),Ze=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`})),Qe=.001,$e=/* @__PURE__ */ new Set([`inline-block`,`inline-flex`,`inline-grid`,`inline-table`,`inline-flow-root`,`table`]),et=[`top`,`right`,`bottom`,`left`]});function nt(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 rt(e){if(e!==!1&&e!==`auto`)return null;let t=performance.now()+(e===`auto`?st:ot),n=null,r={yielded:!1,due:()=>performance.now()>=t,pause:()=>n||=new Promise(e=>{let i=()=>{n=null,r.yielded=!0,t=performance.now()+ot,e()},a=new MessageChannel;a.port1.onmessage=i,a.port2.postMessage(0)})};return r}function it(){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 V(){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 at(){return typeof navigator>`u`?!1:(navigator.userAgent||``).toLowerCase().includes(`firefox`)}var ot,st,H=n(()=>{ot=16,st=40});function U(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 ct(e,t,n,r){let i=e&&e.warnings;i&&i.length<lt&&i.push(r===void 0?{code:t,message:n}:{code:t,message:n,detail:r})}var lt,ut=n(()=>{lt=50}),W=n(()=>{ce(),tt(),H(),E(),ut()}),dt={};r(dt,{MAX_RASTER_AREA:()=>It,MAX_RASTER_SIDE:()=>Ft,cropSvgText:()=>pt,decodeSvgFromDataURL:()=>ht,encodeSvgToDataURL:()=>_t,fixSafariShadows:()=>Et,peekSvgHeader:()=>gt,toCanvas:()=>Pt});function ft(e,t){try{let n=e.match(/<svg\b[^>]*>/i);if(!n)return e;let r=n[0],i=parseFloat((r.match(/\bwidth="([\d.]+)/i)||[])[1]),a=parseFloat((r.match(/\bheight="([\d.]+)/i)||[])[1]);if(!Number.isFinite(i)||!Number.isFinite(a)||i<=0||a<=0)return e;let o=Math.min(1,Ft/i,Ft/a,Math.sqrt(It/(i*a)));if(o>=1)return e;let s=Math.max(1,Math.floor(i*o)),c=Math.max(1,Math.floor(a*o));return ct(t,`raster-clamp`,`capture ${Math.round(i)}x${Math.round(a)}px exceeds decode limits; downscaled to ${s}x${c}px`),console.warn(`[snapdom] Decode limit: ${Math.round(i)}\xD7${Math.round(a)} \u2192 ${s}\xD7${c}. Use ${typeof CompressionStream==`function`?`PNG Blob, `:``}SVG or crop.`),e.replace(r,r.replace(/(\bwidth=")[\d.]+/i,`$1${s}`).replace(/(\bheight=")[\d.]+/i,`$1${c}`))}catch{return e}}function pt(e,t){let n=[`x`,`y`,`width`,`height`].map(e=>Number(t?.[e]));if(!n.every(Number.isFinite)||n[2]<=0||n[3]<=0)throw RangeError(`[snapdom] canvas crop requires finite x/y and positive width/height`);let r=e.match(/<svg\b[^>]*>/i);if(!r)throw Error(`[snapdom] cannot crop a non-SVG capture`);let i=r[0],a=(i.match(/\bviewBox="([^"]+)"/i)||[])[1],o=String(a||``).trim().split(/[\s,]+/).map(Number);if(o.length!==4||!o.every(Number.isFinite)||o[2]<=0||o[3]<=0)throw Error(`[snapdom] cannot crop an SVG without a finite viewBox`);let[s,c,l,u]=o,d=Math.max(s,n[0]),f=Math.max(c,n[1]),p=Math.min(s+l,n[0]+n[2]),m=Math.min(c+u,n[1]+n[3]);if(!(p>d)||!(m>f))throw RangeError(`[snapdom] canvas crop does not intersect the SVG viewBox`);let h=parseFloat((i.match(/\bwidth="([\d.]+)/i)||[])[1]),g=parseFloat((i.match(/\bheight="([\d.]+)/i)||[])[1]),_=Number.isFinite(h)&&h>0?h/l:1,v=Number.isFinite(g)&&g>0?g/u:1,y=Math.max(1,(p-d)*_),b=Math.max(1,(m-f)*v),x=i.replace(/(\bwidth=")[^"]*/i,`$1${y}`).replace(/(\bheight=")[^"]*/i,`$1${b}`).replace(/(\bviewBox=")[^"]*/i,`$1${d} ${f} ${p-d} ${m-f}`);return e.replace(i,x)}function mt(e){return typeof e==`string`&&/^data:image\/svg\+xml/i.test(e)}function ht(e){let t=e.indexOf(`,`);return t>=0?decodeURIComponent(e.slice(t+1)):``}function gt(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 _t(e){return`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}function vt(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 yt(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 bt(e){let t=vt(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=yt(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 xt(e){return e.replace(/([^{}]+)\{([^}]*)\}/g,(e,t,n)=>`${t}{${bt(n)}}`)}function St(e){return e=e.replace(/<style[^>]*>([\s\S]*?)<\/style>/gi,(e,t)=>e.replace(t,xt(t))),e=e.replace(/style=(['"])([\s\S]*?)\1/gi,(e,t,n)=>`style=${t}${bt(n)}${t}`),e}function Ct(){return Lt||(Lt=(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}}})(),Lt)}function wt(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 Tt(e,t){let n=e=>vt(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}:${wt(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 Et(e){if(!/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(e))return{svg:e,naturalOnly:!1};let{native:t,flippedY:n}=await Ct();try{let r=e;return t||(r=St(r)),n&&(r=Tt(r,t)),{svg:r,naturalOnly:!0}}catch{return{svg:e,naturalOnly:!0}}}function Dt(){let e=document.createElement(`canvas`);e.width=16,e.height=16;let t=e.getContext(`2d`,{willReadFrequently:!0});return t?e=>{t.clearRect(0,0,16,16),t.drawImage(e,0,0,16,16);let n=t.getImageData(0,0,16,16).data;for(let e=3;e<n.length;e+=4)if(n[e]>0)return!0;return!1}:null}async function Ot(e,t,n){R(e),e.style.cssText=`position:fixed;left:-99999px;top:-99999px;pointer-events:none`,document.body.appendChild(e);try{if(!n)return await Rt(),await Rt(),!1;let r=performance.now()+(t?600:150);for(;;){let t;try{t=n(e)}catch{return!1}if(t)return!0;if(performance.now()>r)return!1;await Rt()}}finally{try{e.remove()}catch{}}}function kt(e){if(typeof document>`u`||!document.body)return new Image;if(G&&!G.contentDocument){try{G.remove()}catch{}G=null}if(G&&Bt>zt&&Vt===0){try{G.remove()}catch{}G=null}if(!G){let e=document.createElement(`iframe`);R(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)G=e,Bt=0;else{try{e.remove()}catch{}return new Image}}Bt+=e.length,Vt+=1;let t=G.contentDocument.createElement(`img`);return t.__snapdomDecodeFrame=!0,t}function At(e,t=!1){!e||!e.__snapdomDecodeFrame||(e.__snapdomDecodeFrame=!1,Vt=Math.max(0,Vt-1),t&&(Ht=!0),Ht&&Vt===0&&(G?.remove(),G=null,Bt=0,Ht=!1))}function jt(e,t){return e.loading=`eager`,e.decoding=`sync`,e.crossOrigin=`anonymous`,e.src=t,e.decode()}function Mt(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++,Kt.some(e=>t.includes(e))||i++}return i*2>r}function Nt(e,t,n,r,i){if(!t.naturalWidth){e.drawImage(t,0,0,n,r);return}let a=n*r,o=a>Ut&&!Mt(i)?Math.min(Gt,Math.ceil(a/Wt)):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 Pt(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&&!mt(e))throw RangeError(`[snapdom] canvas crop requires an SVG capture payload`);if(mt(e)){let n=(gt(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,Ft/r,Ft/i,Math.sqrt(It/(r*i)))<1;if(c||a||V())try{let n=ht(e);if(c&&(n=pt(n,c)),V()){let e=await Et(n);n=e.svg,d=e.naturalOnly,f=/@font-face|data:image\//i.test(n)}(a||c)&&(n=ft(n,t.__session)),u=_t(n)}catch(t){if(c)throw t;u=e}}let p=l||kt(u);try{l||await jt(p,u)}catch(e){if(!p.__snapdomDecodeFrame)throw e;let n=p;p=kt(u),At(n);try{await jt(p,u)}catch(e){throw At(p,t.__releaseDecodeFrame),e}}try{!l&&!V()&&!at()&&mt(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=V()&&!l?Dt():null,m=!1;e&&(m=await Ot(p,f,e));let h=l?l.width:p.naturalWidth,g=l?l.height:p.naturalHeight,y=c?h:Number.isFinite(o.vbW)?o.vbW:Number.isFinite(o.w0)?o.w0:h,b=c?g:Number.isFinite(o.vbH)?o.vbH:Number.isFinite(o.h0)?o.h0:g,x,S,C=Number.isFinite(n),w=Number.isFinite(r);if(C&&w)x=Math.max(1,n),S=Math.max(1,r);else if(C){let e=n/Math.max(1,y);x=n,S=b*e}else if(w){let e=r/Math.max(1,b);S=r,x=y*e}else{let e=l&&Number.isFinite(o.vbW)&&Number.isFinite(o.vbH);x=e?o.vbW:h,S=e?o.vbH:g}!C&&!w&&(x*=i,S*=i);let T=x*a,E=S*a,D=Math.max(T/Ft,E/Ft,Math.sqrt(T*E/It));D>1&&(ct(t.__session,`canvas-clamp`,`output ${Math.round(T)}x${Math.round(E)}px exceeds canvas limits; downscaled`),console.warn(`[snapdom] Canvas limit: reducing ${Math.round(T)}\xD7${Math.round(E)}. Use ${typeof CompressionStream==`function`?`PNG Blob, `:``}SVG or crop.`),x/=D,S/=D);let O=v(t.canvas)&&_(t.canvas,`canvas`)?t.canvas:document.createElement(`canvas`);O.width=Math.max(1,x*a),O.height=Math.max(1,S*a),O.style.width=`${x}px`,O.style.height=`${S}px`;let k=O.getContext(`2d`);if(!k)throw Error(`[snapdom] toCanvas: the target canvas has no 2d context`);let A=()=>{if(a!==1&&k.scale(a,a),s&&(k.save(),k.fillStyle=s,k.fillRect(0,0,x,S),k.restore()),d&&(Math.round(x*a)!==h||Math.round(S*a)!==g)){let e=document.createElement(`canvas`);e.width=h,e.height=g,Nt(e.getContext(`2d`),p,h,g,u),k.drawImage(e,0,0,x,S)}else k.save(),k.setTransform(1,0,0,1,0,0),Nt(k,p,x*a,S*a,u),k.restore()};if(A(),e&&m&&f){let t=!0;try{t=e(p)}catch{}if(!t){let n=performance.now()+600;do{await Rt();try{t=e(p)}catch{break}}while(!t&&performance.now()<n);O.width=O.width,A()}}return O}finally{At(p,t.__releaseDecodeFrame)}}var Ft,It,Lt,Rt,zt,G,Bt,Vt,Ht,Ut,Wt,Gt,Kt,qt=n(()=>{H(),ut(),E(),z(),Ft=V()?16384:32767,It=268435456,Lt=null,Rt=()=>new Promise(e=>{requestAnimationFrame(e),setTimeout(e,50)}),zt=25165824,G=null,Bt=0,Vt=0,Ht=!1,Ut=4e6,Wt=2e6,Gt=8,Kt=[`%3C`,`%3E`,`%20`,`%7B`,`%7D`,`%3B`]}),Jt={};r(Jt,{rasterize:()=>Yt});async function Yt(e,t){let n=await Pt(e,t),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,V()?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 Xt=n(()=>{qt(),H()}),Zt={};r(Zt,{toImg:()=>Qt,toSvg:()=>Qt});async function Qt(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(V()&&c)try{let{svg:t}=await Et(ht(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(`svg without dimensions`);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=_t(h),await g.decode(),g.style.width=`${p}px`,g.style.height=`${m}px`,g}catch(n){return ct(t.__session,`safari-png-fallback`,`Safari vector toImg failed; using PNG`,n),U(t,`Safari vector toImg failed; using PNG`,n),Yt(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=ht(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=_t(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){U(t,`toImg SVG sizing failed`,n),d.src!==e&&(d.src=e,await d.decode().catch(()=>{}))}}return d}var $t=n(()=>{W(),ut(),Xt(),qt()}),en={};r(en,{encodePng:()=>nn});function tn(e,t=/* @__PURE__ */ 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=rn[(i^n[e])&255]^i>>>8;return r.setUint32(n.length-4,(i^4294967295)>>>0),n}async function nn(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=/* @__PURE__ */ 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]),tn(`IHDR`,r),tn(`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(tn(`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(tn(`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 rn,an=n(()=>{rn=/* @__PURE__ */ 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;rn[e]=t}});function on(e,t){if(typeof e!=`string`||!e.startsWith(`data:image/svg+xml`))return null;let n=gt(e).match(/<svg\b[^>]*>/i)?.[0];if(!n)return null;let r=t.crop?pt(n,t.crop):n,i=parseFloat(r.match(/\bwidth="([^"]+)/i)?.[1]),a=parseFloat(r.match(/\bheight="([^"]+)/i)?.[1]),o=(r.match(/\bviewBox="([^"]+)/i)?.[1]||``).trim().split(/[\s,]+/).map(Number);if(!(i>0&&a>0)||o.length!==4||!o.every(Number.isFinite)||!(o[2]>0&&o[3]>0))return null;let s=Number.isFinite(t.width),c=Number.isFinite(t.height),l=t.meta||{},u=Math.max(1,Math.floor(i)),d=Math.max(1,Math.floor(a)),f=t.crop?u:Number.isFinite(l.vbW)?l.vbW:Number.isFinite(l.w0)?l.w0:u,p=t.crop?d:Number.isFinite(l.vbH)?l.vbH:Number.isFinite(l.h0)?l.h0:d,m=t.dpr??1,h=t.scale??1,g=(s&&c?Math.max(1,t.width):s?t.width:c?t.height*f/Math.max(1,p):u*h)*m,_=(s&&c?Math.max(1,t.height):c?t.height:s?t.width*p/Math.max(1,f):d*h)*m;return Math.max(i,a,g,_)<=Ft&&i*a<=It&&g*_<=It||typeof CompressionStream!=`function`?null:v();async function v(){let{encodePng:s}=await Promise.resolve().then(()=>(an(),en)),c=Math.max(1,Math.floor(g)),l=Math.max(1,Math.floor(_)),f=ht(e),p=f.slice(f.indexOf(n)+n.length,f.lastIndexOf(`</svg>`)),m=r.match(/\bpreserveAspectRatio="([^"]*)"/i)?.[1]||`xMidYMid meet`,h=i/o[2],v=a/o[3],y=0,b=0;/\bnone\b/.test(m)||(h=v=/\bslice\b/.test(m)?Math.max(h,v):Math.min(h,v),y=(i-o[2]*h)*(/xMin/.test(m)?0:/xMax/.test(m)?1:.5),b=(a-o[3]*v)*(/YMin/.test(m)?0:/YMax/.test(m)?1:.5)),y-=o[0]*h,b-=o[1]*v;let x=r.replace(/\s(?:width|height|preserveAspectRatio)="[^"]*"/gi,``).slice(0,-1),S=V()&&/(?:box-shadow|text-shadow)\s*:[^;"}]*px/i.test(f),C=i/g,w=a/_,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),s=S?Math.max(0,Math.floor(i*C)-1):i*C,l=S?Math.max(0,Math.floor(e*w)-1):e*w,f=S?Math.min(u,Math.ceil((i+a)*C)+1)-s:a,m=S?Math.min(d,Math.ceil((e+n)*w)+1)-l:n,g=f/o[2],_=m/o[3],T=S?1:1/C,D=S?1:1/w,O=`matrix(${h*T/g},0,0,${v*D/_},${(y-s)*T/g+o[0]},${(b-l)*D/_+o[1]})`,k=await Pt(_t(`${x} width="${f}" height="${m}" preserveAspectRatio="none"><g style="all:unset!important;transform:${O}!important;transform-origin:0 0!important">${p}</g></svg>`),{width:f,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-s,e*w-l,a*C,n*w,0,0,a,n)}let o=A.getContext(`2d`).getImageData(0,0,a,n).data;for(let e=0;e<n;e++)r.set(o.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 s(c,l,D())}}var sn=n(()=>{qt(),H()}),cn={};r(cn,{toBlob:()=>ln});async function ln(e,t){let n=t.format||t.type||`svg`;if(n===`svg`){if(typeof HTMLCanvasElement<`u`&&e instanceof HTMLCanvasElement)throw Error(`[snapdom] toBlob: engine:'html-in-canvas' produces a raster capture; ask for png/jpeg/webp`);let t=decodeURIComponent(e.split(`,`)[1]);return new Blob([t],{type:`image/svg+xml`})}let r=n===`png`&&on(e,t);if(r)return r;let i=await Pt(e,t);return new Promise(e=>i.toBlob(t=>e(t),`image/${n===`jpg`?`jpeg`:n}`,t.quality))}var un=n(()=>{qt(),sn()}),dn={};r(dn,{download:()=>pn});async function fn(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 pn(e,t){let n=/* @__PURE__ */ 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=it(),d=o===`png`&&on(e,l);if(o===`svg`||d){let t=d?await d:await ln(e,{...l,type:`svg`});if(u&&await fn(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 Pt(e,l);if(u){let e=`image/${o}`,n=await new Promise(n=>f.toBlob(n,e,t?.quality));if(n&&await fn(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 mn=n(()=>{un(),qt(),sn(),H()});W(),W(),H(),c(),Te(),z();var hn=/* @__PURE__ */ new WeakMap,gn=[`margin-top`,`margin-right`,`margin-bottom`,`margin-left`,`margin-block-start`,`margin-block-end`,`margin-inline-start`,`margin-inline-end`],_n=/* @__PURE__ */ new Map,vn=2e3,yn=0;function K(){yn++}function bn(e){let t=e&&(e.nodeType===1?e:e.parentElement);for(;t;){if(Ee(t))return!0;if(t.parentElement)t=t.parentElement;else{let e=t.getRootNode?.();t=e&&e.host?e.host:null}}return!1}function xn(e){for(let t of e)if(Sn(t))return!0;return!1}function Sn(e){if(bn(e.target))return!1;if(e.type===`childList`){let t=!0;for(let n of e.addedNodes)if(!bn(n)){t=!1;break}if(t){for(let n of e.removedNodes)if(!bn(n)){t=!1;break}}if(t)return!1}return!0}var Cn=/* @__PURE__ */ new WeakMap;function wn(e){for(let t of e){if(!Sn(t))continue;let e=t.target.ownerDocument||document;Cn.set(e,(Cn.get(e)||0)+1);let n=t.target.nodeType===1?t.target:t.target.parentElement||t.target.host;for(;n;n=n.parentElement||n.getRootNode?.()?.host)Cn.set(n,(Cn.get(n)||0)+1)}}function Tn(e){let t=e.ownerDocument||document;return Yn(t),(Cn.get(t)||0)-(Cn.get(e)||0)}var q=0;function En(e=document){return Yn(e),q}function Dn(){return Yn(),yn}function On(e){return e?(Yn(e.ownerDocument||document),In(e,Ln(e))):0}function kn(){K(),q++}var An=/* @__PURE__ */ new WeakMap,jn=0,Mn=0;function Nn(e){An.set(e,++jn)}function Pn(e){if(!e||e.nodeType!==1)return;jn++,An.set(e,jn);let t=e.querySelectorAll(`*`);for(let e=0;e<t.length;e++)An.set(t[e],jn)}function Fn(e){Pn(e.parentElement||e);for(let t=e.parentElement;t;t=t.parentElement)Nn(t)}function In(e,t=null){let n=An.get(e)||0;if(t)for(let e of t)n=Math.max(n,An.get(e)||0);return Mn*1e9+n}function Ln(e){let t=e.getRootNode?.();if(!t?.host)return null;let n=[];for(;t?.host;)t.mode===`open`&&Wn(t),n.push(t.host),t=t.host.getRootNode?.();return n}var Rn=/* @__PURE__ */ new WeakMap;function zn(e){e||=document;let t=Rn.get(e);if(!t||t.env!==q){let n=!0;try{n=ar(e).usesHas}catch{}t={env:q,usesHas:n},Rn.set(e,t)}return!t.usesHas}function Bn(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 Vn=/* @__PURE__ */ new WeakSet,Hn=[];function Un(e){if(!xn(e))return;wn(e),K();let t=/* @__PURE__ */ new Set;for(let n of e){if(!Sn(n))continue;let e=n.target.getRootNode&&n.target.getRootNode();if(!e||e.nodeType!==11||t.has(e))continue;t.add(e),e.host?Pn(e.host):jn++;let r=e.querySelectorAll(`*`);for(let e=0;e<r.length;e++)An.set(r[e],jn)}}function Wn(e){if(e&&!Vn.has(e)){Vn.add(e);try{let t=new MutationObserver(Un);t.observe(e,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Hn.push({o:t,root:e})}catch{}}}function Gn(e){if(!xn(e))return;wn(e),K();let t=Bn(e);if(t){Rn.delete(t),q++,Mn++;return}let n=/* @__PURE__ */ new Set;for(let t of e){if(!Sn(t))continue;let e=t.target.nodeType===1?t.target:t.target.parentElement;if(!e)continue;let r=e.ownerDocument||document;if(!zn(r)){Mn++;return}if(e===r.documentElement||e===r.body){Mn++;return}let i=e.parentElement||e;n.has(i)||(n.add(i),Fn(e))}}var Kn=/* @__PURE__ */ new WeakSet,qn=null,Jn=[];function Yn(e=document){if(e===qn||!e||e.nodeType!==9)return;if(Kn.has(e)){qn=e;return}Kn.add(e),qn=e;let t=e.defaultView,n=e=>{xn(e)&&(K(),q++)},r=()=>{K(),q++};try{let t=new MutationObserver(Gn);t.observe(e.documentElement,{subtree:!0,childList:!0,characterData:!0,attributes:!0}),Jn.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}),Jn.push({o:t,env:!0,doc:e})}catch{}try{t?.addEventListener(`resize`,r,{passive:!0})}catch{}try{let n=t=>{K();let n=t.composedPath?.()[0]||t.target;n&&n.nodeType===1&&!bn(n)&&zn(n.ownerDocument||e)?Fn(n):Mn++};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`,()=>{K(),Mn++},{passive:!0})}catch{}try{let t=e.fonts;t&&(t.addEventListener?.(`loadingdone`,r),t.status===`loading`&&t.ready?.then(r).catch(()=>{}))}catch{}}var Xn=/* @__PURE__ */ new WeakMap;function Zn(e,t){if(!e?.querySelectorAll)return;let n;try{n=Array.from(e.querySelectorAll(`:hover`))}catch{return}let r=Xn.get(e)||[];if(r.length===n.length&&r.every((e,t)=>e===n[t]))return;if(Xn.set(e,n),K(),e.nodeType===11){e.host?Pn(e.host):jn++;for(let t of e.querySelectorAll(`*`))An.set(t,jn);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(zn(t))Fn(e);else{Mn++;return}}}function Qn(e,t=null){if(!e)return;Zn(e,e);let n=t||Hn.filter(({root:e})=>e.host?.isConnected).map(({root:e})=>e);for(let t of n)Zn(t,e)}function $n(){Yn();try{for(let e=Jn.length-1;e>=0;e--){let{o:t,env:n,doc:r}=Jn[e];if(r!==document&&!r.defaultView){try{t.disconnect()}catch{}Kn.delete(r),qn===r&&(qn=null),Jn.splice(e,1);continue}let i=t.takeRecords();i.length&&(n?xn(i)&&(K(),q++):Gn(i))}for(let e=Hn.length-1;e>=0;e--){let{o:t,root:n}=Hn[e];if(!n.host||!n.host.isConnected){try{t.disconnect()}catch{}Vn.delete(n),Hn.splice(e,1);continue}let r=t.takeRecords();r.length&&Un(r)}}catch{}}function er(e){if(e&&e.nodeType===1){hn.delete(e);try{let t=(e.ownerDocument||document).createTreeWalker(e,NodeFilter.SHOW_ELEMENT);for(;t.nextNode();)hn.delete(t.currentNode)}catch{}}}var tr=[`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=hn.get(e);if(t&&Er(t,e)){let e=t.snapshot&&t.snapshot.__needsBgInline;if(e!==void 0)return e}return!0}function rr(e){let t=hn.get(e);if(!t||!Er(t,e))return null;let n=t.snapshot;return!n||n.__bgClipTextFix?null:n}var ir=/* @__PURE__ */ new WeakMap;function ar(e){let t=ir.get(e);if(!t||t.epoch!==yn){let n=t&&t.universe;t={epoch:yn,...ge(e)};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)}ir.set(e,t)}return t}function or(e){try{let t=ar(e.ownerDocument||document).shareGate;if(t===null)return!1;if(!t.length)return!0;let n=/* @__PURE__ */ 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 sr(e){let t=e.ownerDocument||document;return e.getRootNode&&e.getRootNode()!==t?null:ar(t).importantProps}function cr(e,t){let n=e.ownerDocument||document,r=e.getRootNode?e.getRootNode():n;return r===n?ar(n).universe:t&&b(r)?ur(e,r,n,t):null}var lr=/* @__PURE__ */ new WeakMap;function ur(e,t,n,r){let i=r.__shadowUniverse;if(i===null)return null;if(!i){let e=ar(n).universe;if(!e)return r.__shadowUniverse=null;i=r.__shadowUniverse={universe:new Set(e),roots:/* @__PURE__ */ new Set}}let a=e=>{for(;b(e)&&!i.roots.has(e);e=e.host.getRootNode()){i.roots.add(e);for(let t of[...e.styleSheets,...e.adoptedStyleSheets||[]]){let e=lr.get(t);if((!e||e.epoch!==yn)&&lr.set(t,e={epoch:yn,props:pe(t)}),!e.props)return!1;for(let t of e.props)i.universe.add(t)}fe(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 dr(e){let t=e.ownerDocument||document;return e.getRootNode&&e.getRootNode()!==t?null:ar(t).pseudoUniverse}var fr={before:null,after:null,firstLetter:null,marker:null,firstLine:null};function pr(e){let t=e.ownerDocument||document;return e.getRootNode&&e.getRootNode()!==t?fr:ar(t).pseudoGates}function mr(e,t={},n=null,r=null){let i={},a=t.excludeStyleProps,o=t=>{if(i[t]!==void 0||ke(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:_r(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/* @__PURE__ */ `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 hr(i),i}function hr(e){if(!at())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=gr(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 gr(e,t){let n=e=>{let t=[],n=/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)(?:[,\s/]+([\d.]+%?))?\s*\)/g,r;for(;r=n.exec(e||``);){let e=r[4];(e===void 0?1:parseFloat(e)/(e.endsWith(`%`)?100:1))>.05&&t.push([+r[1],+r[2],+r[3]])}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 _r(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 tr){let n=e.getPropertyValue(t);if(n&&n!==`none`)return!0}let r=e.getPropertyValue(`background`);return!!(r&&/url\s*\(/i.test(r))}function vr(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=B(t).position;if(e!==`absolute`&&e!==`fixed`)return!0}}return!1}function yr(e,t,n){try{if(typeof e.computedStyleMap==`function`){let t=e.computedStyleMap().get(`width`);if(t!=null)return!xr(String(t).trim().toLowerCase())}}catch{}let r=e.style&&(e.style.width||e.style.inlineSize);return r&&!xr(String(r).trim().toLowerCase())?!0:Sr(e,t)?n||Cr(e,t):!1}var br=/* @__PURE__ */ new Set([`auto`,`min-content`,`max-content`,`stretch`,`fill-available`,`-webkit-fill-available`]);function xr(e){return br.has(e)||e.startsWith(`fit-content`)}function Sr(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=B(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 Cr(e,t){let n=e.parentElement;if(!n)return!1;let r=B(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 wr=/* @__PURE__ */ new WeakMap;function Tr(e,t){let n=wr.get(e);if(n)return n;let r=[t];for(let t in e)r.push(t,e[t]);return n=r.join(``),wr.set(e,n),n}function Er(e,t){return e.env===q&&e.stamp===In(t,e.hosts)}var Dr=/^(width|height|inline-size|block-size|top|right|bottom|left|transform-origin|perspective-origin)$|^inset-/,Or=/(margin|padding)[a-z-]*\s*:[^;]*(%|\bauto\b|calc\(|var\()/i,kr=/* @__PURE__ */ new Set([`INPUT`,`TEXTAREA`,`SELECT`,`OPTION`,`OPTGROUP`,`PROGRESS`,`METER`,`BUTTON`,`DATALIST`]);function Ar(e){let t=e.__styleShare;return t||=e.__styleShare={ids:/* @__PURE__ */ new WeakMap,intern:/* @__PURE__ */ new Map,snaps:/* @__PURE__ */ new Map,rootSeen:!1},t}function jr(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 Mr(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=ar(t.ownerDocument||document),a=t.getAttribute&&t.getAttribute(`style`)||``,o=a&&Or.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)(Dr.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 Nr(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 Re(n,dr(e));let s=o+t,c=a.pseudo||=/* @__PURE__ */ new Map,l=c.get(s);if(l){let t={...l.snap},r=l.rr||Mr(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=Re(n,dr(e));return c.set(s,{snap:u,rr:null,sig:null,h:`height`in u,b:`block-size`in u}),u}function Pr(e,t=null,n={},r=null,i=null){let a=hn.get(e),o=!!(n&&n.embedFonts),s=n&&n.excludeStyleProps||null;if(typeof s!=`function`&&a&&Er(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||Mr(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=mr(c,n,e,cr(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 gn)if(l[n]===`0px`)try{t||=e.computedStyleMap(),t.get(n)?.toString()===`auto`&&(l[n]=`auto`,f=!0)}catch{}}Xr(e,c,l);let p=Hr(e,c,l);u!==null&&(f&&u.push(``,...gn.map(e=>l[e])),p&&u.push(``+p),wr.set(l,d.sig+``+u.join(``)+(`height`in l?``:``)+(`block-size`in l?``:``)));let m=Ln(e);return hn.set(e,{env:q,stamp:In(e,m),hosts:m,snapshot:l,embedFonts:o,excludeStyleProps:s}),l}function Fr(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:_n,defaultStyle:s.defaultStyle,baseStyle:s.baseStyle,image:s.image,resource:s.resource,background:s.background},options:t||{}},e.__ctx=n,e.__ctxOpts=t),n}return{session:{styleMap:/* @__PURE__ */ new Map,styleCache:/* @__PURE__ */ new WeakMap,nodeMap:/* @__PURE__ */ new Map},persist:{snapshotKeyCache:_n,defaultStyle:s.defaultStyle,baseStyle:s.baseStyle,image:s.image,resource:s.resource,background:s.background},options:e||t||{}}}var Ir=/%|[\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,Lr=e=>e.tagName===`INPUT`||e.tagName===`TEXTAREA`;function Rr(e,t,n){if(!e.style||e.style.length===0)return;let r=sr(e),i=r!=null&&!Ir.test(e.getAttribute(`style`)||``);for(let a=0;a<e.style.length;a++){let o=e.style[a];if(i&&!r.has(o)&&!(o.startsWith(`background`)&&Lr(e)))continue;let s=n.getPropertyValue(o);s&&t.style.setProperty(o,s,e.style.getPropertyPriority(o))}}function J(e,t,n,r){if(e.tagName===`STYLE`)return;let i=Fr(n,r),a=i.options&&i.options.cache||`soft`;a!==`disabled`&&Yn(e.ownerDocument),a===`disabled`&&!i.session.__bumpedForDisabled&&(K(),_n.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`)&&Rr(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(Ve.has(u)){let n={};Object.defineProperty(n,"__needsBgInline",{value:_r(c),enumerable:!1});let r=Ln(e);hn.set(e,{env:q,stamp:In(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=Ar(o),n=jr(e,t),r=e.ownerDocument||document,i=r.activeElement;n!==-1&&!kr.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=Pr(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`)),zr(e,c,f),t.style?.length&&f[`box-sizing`]===`border-box`&&c.getPropertyValue(`box-sizing`)!==`border-box`&&Gr(e,t,f);let p=qr(e);if(p){let e=c.getPropertyValue(`min-width`);(!e||e===`auto`||e===`0px`)&&(f[`min-width`]=`0px`)}let m=Tr(f,u),h=!0;if(je(u,(f.display||``).toLowerCase())){h=vr(e),h&&Me(u,f,p)&&yr(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=Ne(f,u,h,p),s.snapshotKeyCache.size>=vn&&s.snapshotKeyCache.delete(s.snapshotKeyCache.keys().next().value),s.snapshotKeyCache.set(m,g)),o.styleMap.set(t,g)}function zr(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 Br=[`border-top-width`,`border-right-width`,`border-bottom-width`,`border-left-width`],Vr=[`width`,`inline-size`,`height`,`block-size`];function Hr(e,t,n){if(!Br.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 Vr){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 Ur=[`box-sizing`,...Vr,`overflow-x`,`overflow-y`],Wr=/(?:box-sizing|width|height|inline-size|block-size|overflow(?:-[xy])?)\s*:/i;function Gr(e,t,n){if(Wr.test(e.getAttribute(`style`)))for(let e of Ur)t.style.getPropertyValue(e)&&n[e]&&t.style.setProperty(e,n[e],t.style.getPropertyPriority(e))}function Kr(e){return e.backgroundImage&&e.backgroundImage!==`none`||e.backgroundColor&&e.backgroundColor!==`rgba(0, 0, 0, 0)`&&e.backgroundColor!==`transparent`||(parseFloat(e.borderTopWidth)||0)>0||(parseFloat(e.borderBottomWidth)||0)>0||(parseFloat(e.paddingTop)||0)>0||(parseFloat(e.paddingBottom)||0)>0?!0:(e.overflowBlock||e.overflowY||`visible`)!==`visible`}function qr(e){let t=e.parentElement;if(!t)return!1;let n=B(t).display||``;return n.includes(`flex`)||n.includes(`grid`)}function Jr(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=B(t);if(e.display===`none`)continue;let n=e.position;if(n!==`absolute`&&n!==`fixed`)return!0}return!1}function Yr(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=B(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 Xr(e,t,n){if(v(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`||Kr(t)||qr(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`||!Jr(e))return;let l=parseFloat(t.height),u=Yr(e);Number.isFinite(l)&&Number.isFinite(u)&&Math.abs(l-u)>2||(delete n.height,delete n[`block-size`])}tt();var Zr=/* @__PURE__ */ new Set([`symbol`,`defs`,`pattern`,`marker`,`linearGradient`,`radialGradient`,`filter`]),Qr=/* @__PURE__ */ new WeakMap,$r=-1;function ei(e){let t=Dn();return t!==$r&&(Qr=/* @__PURE__ */ new WeakMap,$r=t),ti(e)}function ti(e){let t=Qr.get(e);if(t!==void 0)return t;let n;if(e.namespaceURI===`http://www.w3.org/2000/svg`&&(e.localName===`mask`||e.localName===`clipPath`?n=!1:Zr.has(e.localName)&&(n=!0)),n===void 0){let t=e.parentNode;n=!!(t&&t.nodeType===1)&&ti(t)}return Qr.set(e,n),n}function ni(e,t){if(e?.nodeType!==1||t?.nodeType!==1||ei(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=/* @__PURE__ */ 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{}}}}W(),W(),c(),F(),Te(),E();function ri(e){return!!(!e||e.startsWith(`data:`)||e.startsWith(`blob:`))}function ii(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 ai(e,t){let n=e.currentSrc||``;if(n&&!ri(n))return n;let r=t.querySelectorAll(`source[srcset]`),i=null;for(let t of r){let n=t.getAttribute(`srcset`);if(!n||ri(n))continue;let r=t.getAttribute(`type`);if(r&&!S.test(r.trim()))continue;let a=t.getAttribute(`media`);if(a)try{if(window.matchMedia(a).matches)return ii(n,e)}catch{}i||=ii(n,e)}return i}function oi(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&&!ri(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&&!ri(e))return e}return null}z();function si(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 ci=/::[a-zA-Z-]+(?:\([^)]*\))?$|:(?:before|after|first-letter|first-line)$/,li=/^::?(?:before|after|first-letter)$/;function ui(e,t,n=!0,r){return me(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(ci);if(i&&li.test(i[0]))return`:not(*)`;let a=i?e.slice(0,i.index).trim():e;return`:where(${t} ${n?si(a,r):a})${i?i[0]:``}`}).join(`, `)}function di(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}${ui(a,t,!0,n)}{`),e):``}function fi(e){return e.shadowScopeSeq=(e.shadowScopeSeq||0)+1,`s${e.shadowScopeSeq}`}function pi(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+=pi(n.cssRules))}else if(n.constructor?.name===`CSSSupportsRule`)t+=`@supports ${n.conditionText}{${pi(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:``)+pi(n.cssRules)+`}`}else t+=n.cssText+`
|
|
4
4
|
`;return t}function mi(e){let t=``;try{e.querySelectorAll(`style`).forEach(e=>{let n=null;try{n=e.sheet&&e.sheet.cssRules}catch{}t+=(n?pi(n):e.textContent||``)+`
|
package/dist/{pka-overlay-thread-store-DOxLXsAv.mjs → pka-overlay-thread-store-X3FM2ev_.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{_ as e,g as t,h as n,n as r,v as i}from"./overlay.mjs";import{M as a,O as o,P as s,_ as c,c as l,d as u,j as d,n as f,u as p,y as m}from"./pka-overlay-channel-C6qfFolf.mjs";import{t as h}from"./pka-overlay-store-eSg4Q7Sz.mjs";const g=d({id:c,prompt:a(),createdAt:m,elements:o().int().nonnegative()});function _(){let e=sessionStorage.getItem(r);if(e===null)return{sent:[],discarded:null};let t=[],n=null,i;try{i=JSON.parse(e)}catch(e){n=`it is not JSON (${e instanceof Error?e.message:String(e)})`}if(n===null&&!Array.isArray(i)&&(n=`it is not a list`),Array.isArray(i))for(let[e,r]of i.entries()){let i=g.safeParse(r);i.success?t.push(i.data):n??=`entry ${e+1}: ${s(i.error)}`}if(n===null)return{sent:t,discarded:null};let a=`Discarded unreadable History entries in sessionStorage ${r}; ${n}`;return console.error(`[pk-annotator] ${a}`),sessionStorage.setItem(r,JSON.stringify(t)),{sent:t,discarded:a}}function v(a){let o=h({..._(),states:/* @__PURE__ */ new Map,entries:/* @__PURE__ */ new Map,unread:!1}),s=e=>o.get().sent.some(t=>t.id===e),c=o.get().sent.map(e=>e.id),d=/* @__PURE__ */ new Set,m=()=>{d=new Set(c.splice(0,200)),d.size>0&&i(a,f.sync,{ids:[...d]})},g=[e(a,f.state,l,e=>{if(!s(e.id))return;let t=o.get().states.get(e.id)?.status;o.set({states:new Map(o.get().states).set(e.id,e.state)}),(e.state.status===`resolved`||e.state.status===`dismissed`)&&t!==e.state.status&&n()}),e(a,f.thread,u,({id:e,entry:t})=>{if(!s(e))return;let{entries:r,unread:i}=o.get();o.set({entries:new Map(r).set(e,[...r.get(e)??[],t]),unread:i||t.from===`agent`}),t.from===`agent`&&n()}),e(a,f.synced,p,e=>{let t=new Map(o.get().states),n=new Map(o.get().entries);for(let r of e.annotations)t.set(r.id,r.state),n.set(r.id,r.thread);let i=new Set(e.annotations.map(e=>e.id)),a=o.get().sent.filter(e=>!d.has(e.id)||i.has(e.id));sessionStorage.setItem(r,JSON.stringify(a)),o.set({sent:a,states:t,entries:n}),m()})],v=o.subscribe(()=>{let{sent:e,states:n}=o.get();t(e.some(e=>n.get(e.id)?.status===`acknowledged`))});return m(),{...o,added(e){let t=[e,...o.get().sent.filter(t=>t.id!==e.id)];sessionStorage.setItem(r,JSON.stringify(t)),o.set({sent:t,states:new Map(o.get().states).set(e.id,{status:`pending`,history:[{status:`pending`,at:e.createdAt}]})})},disconnect(){for(let e of g)e();v(),t(!1)}}}export{v as connectThread};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{y as e}from"./overlay.mjs";function t(t,n){return e().fetch(t,n)}export{t};
|
package/dist/pka.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { B as Id, F as readJsonLines, I as resolveInside, M as isErrno, O as PkaError, P as readJson, S as wait, W as Timestamp, _ as prune, a as ErrorsInput, c as ReplyInput, h as list, i as TimelineEntry, j as findStore, l as SetStatusInput, m as get, n as RecordingManifest, o as GetInput, p as errors, s as ListInput, u as attach, v as reply, x as validateAttachTarget, y as setStatus, z as ID_PATTERN } from "./recording-
|
|
2
|
+
import { B as Id, F as readJsonLines, I as resolveInside, M as isErrno, O as PkaError, P as readJson, S as wait, W as Timestamp, _ as prune, a as ErrorsInput, c as ReplyInput, h as list, i as TimelineEntry, j as findStore, l as SetStatusInput, m as get, n as RecordingManifest, o as GetInput, p as errors, s as ListInput, u as attach, v as reply, x as validateAttachTarget, y as setStatus, z as ID_PATTERN } from "./recording-82fajWWq.mjs";
|
|
3
3
|
import { createRequire } from "node:module";
|
|
4
4
|
import { createWriteStream } from "node:fs";
|
|
5
5
|
import { mkdir, readFile, stat, writeFile } from "node:fs/promises";
|
|
@@ -1423,6 +1423,7 @@ function printAnnotation(view) {
|
|
|
1423
1423
|
line(` [${element.n}] ${element.source ?? "(no source)"}${element.usedAt === void 0 ? "" : ` usedAt ${element.usedAt}`} ${element.owners.join(" > ")} ${label || element.selector.css}`);
|
|
1424
1424
|
}
|
|
1425
1425
|
for (const attachment of view.attachments) line(` ${attachment.kind}: ${attachment.path}${attachment.summary ? ` ${attachment.summary}` : ""}`);
|
|
1426
|
+
for (const mark of view.marks ?? []) line(` mark ${mark.n}: ${mark.url}`);
|
|
1426
1427
|
for (const entry of view.thread ?? []) line(` ${entry.at} ${entry.from}: ${entry.text}`);
|
|
1427
1428
|
if (view.omitted !== void 0) line(view.omitted.note);
|
|
1428
1429
|
}
|
|
@@ -30,6 +30,7 @@ const Selector = z.strictObject({
|
|
|
30
30
|
});
|
|
31
31
|
const ElementRef = z.strictObject({
|
|
32
32
|
n: z.number().int().positive(),
|
|
33
|
+
url: z.string().optional(),
|
|
33
34
|
source: z.string().regex(/^.+:\d+:\d+$/, "source must be file:line:col").optional(),
|
|
34
35
|
usedAt: z.string().regex(/^.+:\d+:\d+$/, "usedAt must be file:line:col").optional(),
|
|
35
36
|
owners: z.array(z.string()),
|
|
@@ -53,6 +54,11 @@ const Attachment = z.strictObject({
|
|
|
53
54
|
path: RelativePath,
|
|
54
55
|
summary: z.string()
|
|
55
56
|
});
|
|
57
|
+
const MarkPage = z.strictObject({
|
|
58
|
+
n: z.number().int().positive(),
|
|
59
|
+
url: z.string(),
|
|
60
|
+
route: z.string()
|
|
61
|
+
});
|
|
56
62
|
const Annotation = z.strictObject({
|
|
57
63
|
id: Id,
|
|
58
64
|
createdAt: Timestamp,
|
|
@@ -61,7 +67,8 @@ const Annotation = z.strictObject({
|
|
|
61
67
|
viewport: Viewport,
|
|
62
68
|
prompt: z.string(),
|
|
63
69
|
elements: z.array(ElementRef),
|
|
64
|
-
attachments: z.array(Attachment)
|
|
70
|
+
attachments: z.array(Attachment),
|
|
71
|
+
marks: z.array(MarkPage).optional()
|
|
65
72
|
});
|
|
66
73
|
const AnnotationDraft = Annotation.omit({
|
|
67
74
|
id: true,
|
|
@@ -734,6 +741,7 @@ function optionalPageText(value, max) {
|
|
|
734
741
|
}
|
|
735
742
|
const ElementView = z.strictObject({
|
|
736
743
|
n: z.number(),
|
|
744
|
+
url: z.string().optional().describe("The page the element was picked on"),
|
|
737
745
|
source: z.string().optional(),
|
|
738
746
|
usedAt: z.string().optional(),
|
|
739
747
|
owners: z.array(z.string()),
|
|
@@ -749,6 +757,11 @@ const ElementView = z.strictObject({
|
|
|
749
757
|
html: z.string().optional(),
|
|
750
758
|
box: Box.optional()
|
|
751
759
|
});
|
|
760
|
+
const MarkView = z.strictObject({
|
|
761
|
+
n: z.number().describe("Matches the \"## Mark n\" section of the prompt"),
|
|
762
|
+
url: z.string(),
|
|
763
|
+
route: z.string()
|
|
764
|
+
});
|
|
752
765
|
const AnnotationView = z.strictObject({
|
|
753
766
|
id: Id,
|
|
754
767
|
createdAt: Timestamp,
|
|
@@ -765,13 +778,15 @@ const AnnotationView = z.strictObject({
|
|
|
765
778
|
path: z.string(),
|
|
766
779
|
summary: z.string().optional()
|
|
767
780
|
})),
|
|
781
|
+
marks: z.array(MarkView).optional().describe("The page each saved mark of a batch was made on"),
|
|
768
782
|
threadCount: z.number(),
|
|
769
783
|
omitted: z.strictObject({
|
|
770
784
|
elements: z.number(),
|
|
771
785
|
attachments: z.number(),
|
|
786
|
+
marks: z.number(),
|
|
772
787
|
promptCharacters: z.number(),
|
|
773
788
|
note: z.string()
|
|
774
|
-
}).optional().describe("Elements and
|
|
789
|
+
}).optional().describe("Elements, attachments, and mark pages left out of a concise response"),
|
|
775
790
|
history: z.array(StatusEvent).optional(),
|
|
776
791
|
thread: z.array(ThreadEntry).optional()
|
|
777
792
|
});
|
|
@@ -801,6 +816,7 @@ function elementView(element, detail) {
|
|
|
801
816
|
const full = detail === "full";
|
|
802
817
|
const view = {
|
|
803
818
|
n: element.n,
|
|
819
|
+
url: optionalPageText(element.url, CAP.label),
|
|
804
820
|
source: optionalPageText(element.source, CAP.label),
|
|
805
821
|
usedAt: optionalPageText(element.usedAt, CAP.label),
|
|
806
822
|
owners: element.owners.slice(0, CAP.owners).map((owner) => pageText(owner, CAP.short)),
|
|
@@ -840,6 +856,11 @@ function annotationView(record, detail) {
|
|
|
840
856
|
})),
|
|
841
857
|
threadCount: record.thread.length
|
|
842
858
|
};
|
|
859
|
+
if (annotation.marks !== void 0) view.marks = annotation.marks.map((mark) => ({
|
|
860
|
+
n: mark.n,
|
|
861
|
+
url: pageText(mark.url, CAP.label),
|
|
862
|
+
route: pageText(mark.route, CAP.label)
|
|
863
|
+
}));
|
|
843
864
|
if (full) {
|
|
844
865
|
view.viewport = annotation.viewport;
|
|
845
866
|
view.history = state.history;
|
|
@@ -861,16 +882,19 @@ function promptPrefix(prompt) {
|
|
|
861
882
|
}
|
|
862
883
|
}
|
|
863
884
|
/**
|
|
864
|
-
* Caps the prompt, then keeps the leading elements and
|
|
865
|
-
* `[element n]
|
|
885
|
+
* Caps the prompt, then keeps the leading elements, attachments, and mark pages that fit
|
|
886
|
+
* CONCISE_BYTES, so `[element n]`, `[attachment n]`, and `## Mark n` keep their numbers, and
|
|
887
|
+
* says how much was left out.
|
|
866
888
|
*/
|
|
867
889
|
function withinBudget(view) {
|
|
868
890
|
const { elements, attachments } = view;
|
|
891
|
+
const marks = view.marks ?? [];
|
|
869
892
|
const prompt = promptPrefix(view.prompt);
|
|
870
893
|
const promptCharacters = view.prompt.length - prompt.length;
|
|
871
|
-
const omitted = (keptElements, keptAttachments) => ({
|
|
894
|
+
const omitted = (keptElements, keptAttachments, keptMarks) => ({
|
|
872
895
|
elements: elements.length - keptElements,
|
|
873
896
|
attachments: attachments.length - keptAttachments,
|
|
897
|
+
marks: marks.length - keptMarks,
|
|
874
898
|
promptCharacters,
|
|
875
899
|
note: OMITTED_NOTE
|
|
876
900
|
});
|
|
@@ -879,7 +903,8 @@ function withinBudget(view) {
|
|
|
879
903
|
prompt,
|
|
880
904
|
elements: [],
|
|
881
905
|
attachments: [],
|
|
882
|
-
|
|
906
|
+
...view.marks !== void 0 && { marks: [] },
|
|
907
|
+
omitted: omitted(0, 0, 0)
|
|
883
908
|
});
|
|
884
909
|
const fit = (items) => {
|
|
885
910
|
const kept = [];
|
|
@@ -893,14 +918,16 @@ function withinBudget(view) {
|
|
|
893
918
|
};
|
|
894
919
|
const keptElements = fit(elements);
|
|
895
920
|
const keptAttachments = fit(attachments);
|
|
896
|
-
const
|
|
921
|
+
const keptMarks = fit(marks);
|
|
922
|
+
const result = promptCharacters === 0 && keptElements.length === elements.length && keptAttachments.length === attachments.length && keptMarks.length === marks.length ? view : {
|
|
897
923
|
...view,
|
|
898
924
|
prompt,
|
|
899
925
|
elements: keptElements,
|
|
900
926
|
attachments: keptAttachments,
|
|
901
|
-
|
|
927
|
+
...view.marks !== void 0 && { marks: keptMarks },
|
|
928
|
+
omitted: omitted(keptElements.length, keptAttachments.length, keptMarks.length)
|
|
902
929
|
};
|
|
903
|
-
if (jsonBytes(result) > 2e4) throw new PkaError(`The concise view of annotation ${view.id} is over ${CONCISE_BYTES} bytes without its elements and
|
|
930
|
+
if (jsonBytes(result) > 2e4) throw new PkaError(`The concise view of annotation ${view.id} is over ${CONCISE_BYTES} bytes without its elements, attachments, and mark pages; request detail full.`);
|
|
904
931
|
return result;
|
|
905
932
|
}
|
|
906
933
|
const OMITTED_NOTE = "Left out to keep this response small. get_annotation (pka get) with detail full returns all of them.";
|
|
@@ -1108,13 +1135,13 @@ function isOffered(state, claim) {
|
|
|
1108
1135
|
if (claim === void 0) return state.status === "pending";
|
|
1109
1136
|
return isOrphaned(state, claim, Date.now());
|
|
1110
1137
|
}
|
|
1138
|
+
async function isOfferedId(store, id) {
|
|
1139
|
+
const state = await readListedState(store, id);
|
|
1140
|
+
return state !== void 0 && !isClosed(state.status) && isOffered(state, await readClaim(store, id));
|
|
1141
|
+
}
|
|
1111
1142
|
async function oldestOffered(store, skip) {
|
|
1112
1143
|
const ids = (await listIds(store)).filter((id) => !skip.has(id));
|
|
1113
|
-
|
|
1114
|
-
const state = await readListedState(store, id);
|
|
1115
|
-
return state !== void 0 && !isClosed(state.status) && isOffered(state, await readClaim(store, id));
|
|
1116
|
-
};
|
|
1117
|
-
for (let start = 0; start < ids.length; start += SCAN_BATCH) for (const id of await firstMatching(ids.slice(start, start + SCAN_BATCH), SCAN_BATCH, offered)) {
|
|
1144
|
+
for (let start = 0; start < ids.length; start += SCAN_BATCH) for (const id of await firstMatching(ids.slice(start, start + SCAN_BATCH), SCAN_BATCH, (id) => isOfferedId(store, id))) {
|
|
1118
1145
|
const record = await loadListed(store, id);
|
|
1119
1146
|
if (record !== void 0 && isOffered(record.state, record.claim)) return record;
|
|
1120
1147
|
}
|