@githumbi/grabby 0.5.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,18 +1,18 @@
1
- "use strict";(()=>{var ji=Object.defineProperty;var Wi=(e,t)=>()=>(e&&(t=e(e=0)),t);var Yi=(e,t)=>{for(var n in t)ji(e,n,{get:t[n],enumerable:!0})};var oi={};Yi(oi,{createContext:()=>Kr,destroyContext:()=>qr,domToBlob:()=>ac,domToCanvas:()=>_t,domToDataUrl:()=>Ve,domToForeignObjectSvg:()=>ti,domToImage:()=>sc,domToJpeg:()=>lc,domToPixel:()=>cc,domToPng:()=>uc,domToSvg:()=>ni,domToWebp:()=>dc,loadMedia:()=>Ge,waitUntilLoad:()=>Gr});function _r(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}function Xs(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let o=0;o<8;o++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function qs(e){let t=-1;Sn||(Sn=Xs());for(let n=0;n<e.length;n++)t=Sn[(t^e[n])&255]^t>>>8;return t^-1}function Zs(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===Rr&&e[n-2]===Ir&&e[n-1]===$r&&e[n]===Lr)return n-3;return 0}function Nr(e,t,n=!1){let o=new Uint8Array(13);t*=39.3701,o[0]=Rr,o[1]=Ir,o[2]=$r,o[3]=Lr,o[4]=t>>>24,o[5]=t>>>16,o[6]=t>>>8,o[7]=t&255,o[8]=o[4],o[9]=o[5],o[10]=o[6],o[11]=o[7],o[12]=1;let r=qs(o),i=new Uint8Array(4);if(i[0]=r>>>24,i[1]=r>>>16,i[2]=r>>>8,i[3]=r&255,n){let a=Zs(e);return e.set(o,a),e.set(i,a+13),e}else{let a=new Uint8Array(4);a[0]=0,a[1]=0,a[2]=0,a[3]=9;let s=new Uint8Array(54);return s.set(e,0),s.set(a,33),s.set(o,37),s.set(i,50),s}}function tl(e){let t=e.indexOf(Js);return t===-1&&(t=e.indexOf(Qs)),t===-1&&(t=e.indexOf(el)),t}function xl(e){let t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}function Fr(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(Se&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!Se)return e;let n=Tt().implementation.createHTMLDocument(),o=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(r),t&&(o.href=t),r.href=e,r.href}function Tt(e){return(e&&le(e)?e?.ownerDocument:e)??window.document}function Hr(e,t,n){let o=Tt(n).createElementNS(At,"svg");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),o}function Ur(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}async function El(e,t="image/png",n=1){try{return await new Promise((o,r)=>{e.toBlob(i=>{i?o(i):r(new Error("Blob is null"))},t,n)})}catch(o){if(Pr)return wl(e.toDataURL(t,n));throw o}}function wl(e){let[t,n]=e.split(","),o=t.match(/data:(.+);/)?.[1]??void 0,r=window.atob(n),i=r.length,a=new Uint8Array(i);for(let s=0;s<i;s+=1)a[s]=r.charCodeAt(s);return new Blob([a],{type:o})}function Br(e,t){return new Promise((n,o)=>{let r=new FileReader;r.onload=()=>n(r.result),r.onerror=()=>o(r.error),r.onabort=()=>o(new Error(`Failed read blob to ${t}`)),t==="dataUrl"?r.readAsDataURL(e):t==="arrayBuffer"&&r.readAsArrayBuffer(e)})}function Le(e,t){let n=Tt(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function Ge(e,t){return new Promise(n=>{let{timeout:o,ownerDocument:r,onError:i,onWarn:a}=t??{},s=typeof e=="string"?Le(e,Tt(r)):e,l=null,c=null;function d(){n(s),l&&clearTimeout(l),c?.()}if(o&&(l=setTimeout(d,o)),kt(s)){let f=s.currentSrc||s.src;if(!f)return s.poster?Ge(s.poster,t).then(n):d();if(s.readyState>=2)return d();let h=d,m=y=>{a?.("Failed video load",f,y),i?.(y),d()};c=()=>{s.removeEventListener("loadeddata",h),s.removeEventListener("error",m)},s.addEventListener("loadeddata",h,{once:!0}),s.addEventListener("error",m,{once:!0})}else{let f=Or(s)?s.href.baseVal:s.currentSrc||s.src;if(!f)return d();let h=async()=>{if(Be(s)&&"decode"in s)try{await s.decode()}catch(y){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||f,y)}d()},m=y=>{a?.("Failed image load",s.dataset.originalSrc||f,y),d()};if(Be(s)&&s.complete)return h();c=()=>{s.removeEventListener("load",h),s.removeEventListener("error",m)},s.addEventListener("load",h,{once:!0}),s.addEventListener("error",m,{once:!0})}})}async function Gr(e,t){et(e)&&(Be(e)||kt(e)?await Ge(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(o=>Ge(o,t)))))}function zr(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}function kl(e){let t=`${Mr}[#${wr}]`;return wr++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&vl(...n)}}function Tl(e){return{cache:e?"no-cache":"force-cache"}}async function ce(e,t){return rl(e)?e:Kr(e,{...t,autoDestruct:!0})}async function Kr(e,t){let{scale:n=1,workerUrl:o,workerNumber:r=1}=t||{},i=!!t?.debug,a=t?.features??!0,s=e.ownerDocument??(Se?window.document:void 0),l=e.ownerDocument?.defaultView??(Se?window:void 0),c=new Map,d={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:Tl(t?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:r,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:kl(i),node:e,ownerDocument:s,ownerWindow:l,dpi:n===1?null:96*n,svgStyleElement:jr(s),svgDefsElement:s?.createElementNS(At,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:nl&&o&&r?r:0})].map(()=>{try{let m=new Worker(o);return m.onmessage=async y=>{let{url:v,result:b}=y.data;b?c.get(v)?.resolve?.(b):c.get(v)?.reject?.(new Error(`Error receiving message from worker: ${v}`))},m.onmessageerror=y=>{let{url:v}=y.data;c.get(v)?.reject?.(new Error(`Error receiving message from worker: ${v}`))},m}catch(m){return d.log.warn("Failed to new Worker",m),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[xl(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:c,drawImageCount:0,tasks:[],features:a,isEnable:m=>m==="restoreScrollPosition"?typeof a=="boolean"?!1:a[m]??!1:typeof a=="boolean"?a:a[m]??!0,shadowRoots:[]};d.log.time("wait until load"),await Gr(e,{timeout:d.timeout,onWarn:d.log.warn}),d.log.timeEnd("wait until load");let{width:f,height:h}=Al(e,d);return d.width=f,d.height=h,d}function jr(e){if(!e)return;let t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
1
+ "use strict";(()=>{var Wi=Object.defineProperty;var Yi=(e,t)=>()=>(e&&(t=e(e=0)),t);var Xi=(e,t)=>{for(var n in t)Wi(e,n,{get:t[n],enumerable:!0})};var ii={};Xi(ii,{createContext:()=>Wr,destroyContext:()=>Jr,domToBlob:()=>cc,domToCanvas:()=>It,domToDataUrl:()=>Ke,domToForeignObjectSvg:()=>oi,domToImage:()=>uc,domToJpeg:()=>dc,domToPixel:()=>mc,domToPng:()=>fc,domToSvg:()=>ri,domToWebp:()=>pc,loadMedia:()=>Ve,waitUntilLoad:()=>Vr});function Ir(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}function Js(){let e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let o=0;o<8;o++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function Qs(e){let t=-1;kn||(kn=Js());for(let n=0;n<e.length;n++)t=kn[(t^e[n])&255]^t>>>8;return t^-1}function el(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===Lr&&e[n-2]===$r&&e[n-1]===Nr&&e[n]===Mr)return n-3;return 0}function Pr(e,t,n=!1){let o=new Uint8Array(13);t*=39.3701,o[0]=Lr,o[1]=$r,o[2]=Nr,o[3]=Mr,o[4]=t>>>24,o[5]=t>>>16,o[6]=t>>>8,o[7]=t&255,o[8]=o[4],o[9]=o[5],o[10]=o[6],o[11]=o[7],o[12]=1;let r=Qs(o),i=new Uint8Array(4);if(i[0]=r>>>24,i[1]=r>>>16,i[2]=r>>>8,i[3]=r&255,n){let a=el(e);return e.set(o,a),e.set(i,a+13),e}else{let a=new Uint8Array(4);a[0]=0,a[1]=0,a[2]=0,a[3]=9;let s=new Uint8Array(54);return s.set(e,0),s.set(a,33),s.set(o,37),s.set(i,50),s}}function rl(e){let t=e.indexOf(tl);return t===-1&&(t=e.indexOf(nl)),t===-1&&(t=e.indexOf(ol)),t}function Sl(e){let t=e?.createElement?.("canvas");return t&&(t.height=t.width=1),!!t&&"toDataURL"in t&&!!t.toDataURL("image/webp").includes("image/webp")}function Ur(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(ke&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!ke)return e;let n=_t().implementation.createHTMLDocument(),o=n.createElement("base"),r=n.createElement("a");return n.head.appendChild(o),n.body.appendChild(r),t&&(o.href=t),r.href=e,r.href}function _t(e){return(e&&ce(e)?e?.ownerDocument:e)??window.document}function Br(e,t,n){let o=_t(n).createElementNS(Rt,"svg");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),o}function Gr(e,t){let n=new XMLSerializer().serializeToString(e);return t&&(n=n.replace(/[\u0000-\u0008\v\f\u000E-\u001F\uD800-\uDFFF\uFFFE\uFFFF]/gu,"")),`data:image/svg+xml;charset=utf-8,${encodeURIComponent(n)}`}async function Cl(e,t="image/png",n=1){try{return await new Promise((o,r)=>{e.toBlob(i=>{i?o(i):r(new Error("Blob is null"))},t,n)})}catch(o){if(Or)return kl(e.toDataURL(t,n));throw o}}function kl(e){let[t,n]=e.split(","),o=t.match(/data:(.+);/)?.[1]??void 0,r=window.atob(n),i=r.length,a=new Uint8Array(i);for(let s=0;s<i;s+=1)a[s]=r.charCodeAt(s);return new Blob([a],{type:o})}function zr(e,t){return new Promise((n,o)=>{let r=new FileReader;r.onload=()=>n(r.result),r.onerror=()=>o(r.error),r.onabort=()=>o(new Error(`Failed read blob to ${t}`)),t==="dataUrl"?r.readAsDataURL(e):t==="arrayBuffer"&&r.readAsArrayBuffer(e)})}function Me(e,t){let n=_t(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function Ve(e,t){return new Promise(n=>{let{timeout:o,ownerDocument:r,onError:i,onWarn:a}=t??{},s=typeof e=="string"?Me(e,_t(r)):e,l=null,c=null;function d(){n(s),l&&clearTimeout(l),c?.()}if(o&&(l=setTimeout(d,o)),At(s)){let f=s.currentSrc||s.src;if(!f)return s.poster?Ve(s.poster,t).then(n):d();if(s.readyState>=2)return d();let h=d,m=y=>{a?.("Failed video load",f,y),i?.(y),d()};c=()=>{s.removeEventListener("loadeddata",h),s.removeEventListener("error",m)},s.addEventListener("loadeddata",h,{once:!0}),s.addEventListener("error",m,{once:!0})}else{let f=Hr(s)?s.href.baseVal:s.currentSrc||s.src;if(!f)return d();let h=async()=>{if(ze(s)&&"decode"in s)try{await s.decode()}catch(y){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||f,y)}d()},m=y=>{a?.("Failed image load",s.dataset.originalSrc||f,y),d()};if(ze(s)&&s.complete)return h();c=()=>{s.removeEventListener("load",h),s.removeEventListener("error",m)},s.addEventListener("load",h,{once:!0}),s.addEventListener("error",m,{once:!0})}})}async function Vr(e,t){ot(e)&&(ze(e)||At(e)?await Ve(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(o=>Ve(o,t)))))}function jr(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}function _l(e){let t=`${Dr}[#${Cr}]`;return Cr++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&wl(...n)}}function Rl(e){return{cache:e?"no-cache":"force-cache"}}async function ue(e,t){return sl(e)?e:Wr(e,{...t,autoDestruct:!0})}async function Wr(e,t){let{scale:n=1,workerUrl:o,workerNumber:r=1}=t||{},i=!!t?.debug,a=t?.features??!0,s=e.ownerDocument??(ke?window.document:void 0),l=e.ownerDocument?.defaultView??(ke?window:void 0),c=new Map,d={width:0,height:0,quality:1,type:"image/png",scale:n,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:i,fetch:{requestInit:Rl(t?.fetch?.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t?.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:r,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:_l(i),node:e,ownerDocument:s,ownerWindow:l,dpi:n===1?null:96*n,svgStyleElement:Yr(s),svgDefsElement:s?.createElementNS(Rt,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:il&&o&&r?r:0})].map(()=>{try{let m=new Worker(o);return m.onmessage=async y=>{let{url:v,result:b}=y.data;b?c.get(v)?.resolve?.(b):c.get(v)?.reject?.(new Error(`Error receiving message from worker: ${v}`))},m.onmessageerror=y=>{let{url:v}=y.data;c.get(v)?.reject?.(new Error(`Error receiving message from worker: ${v}`))},m}catch(m){return d.log.warn("Failed to new Worker",m),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[Sl(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:c,drawImageCount:0,tasks:[],features:a,isEnable:m=>m==="restoreScrollPosition"?typeof a=="boolean"?!1:a[m]??!1:typeof a=="boolean"?a:a[m]??!0,shadowRoots:[]};d.log.time("wait until load"),await Vr(e,{timeout:d.timeout,onWarn:d.log.warn}),d.log.timeEnd("wait until load");let{width:f,height:h}=Il(e,d);return d.width=f,d.height=h,d}function Yr(e){if(!e)return;let t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
2
2
  .______background-clip--text {
3
3
  background-clip: text;
4
4
  -webkit-background-clip: text;
5
5
  }
6
- `);return t.appendChild(n),t}function Al(e,t){let{width:n,height:o}=t;if(le(e)&&(!n||!o)){let r=e.getBoundingClientRect();n=n||r.width||Number(e.getAttribute("width"))||0,o=o||r.height||Number(e.getAttribute("height"))||0}return{width:n,height:o}}async function _l(e,t){let{log:n,timeout:o,drawImageCount:r,drawImageInterval:i}=t;n.time("image to canvas");let a=await Ge(e,{timeout:o,onWarn:t.log.warn}),{canvas:s,context2d:l}=Rl(e.ownerDocument,t),c=()=>{try{l?.drawImage(a,0,0,s.width,s.height)}catch(d){t.log.warn("Failed to drawImage",d)}};if(c(),t.isEnable("fixSvgXmlDecode"))for(let d=0;d<r;d++)await new Promise(f=>{setTimeout(()=>{l?.clearRect(0,0,s.width,s.height),c(),f()},d+i)});return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function Rl(e,t){let{width:n,height:o,scale:r,backgroundColor:i,maximumCanvasSize:a}=t,s=e.createElement("canvas");s.width=Math.floor(n*r),s.height=Math.floor(o*r),s.style.width=`${n}px`,s.style.height=`${o}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));let l=s.getContext("2d");return l&&i&&(l.fillStyle=i,l.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:l}}function Wr(e,t){if(e.ownerDocument)try{let i=e.toDataURL();if(i!=="data:,")return Le(i,e.ownerDocument)}catch(i){t.log.warn("Failed to clone canvas",i)}let n=e.cloneNode(!1),o=e.getContext("2d"),r=n.getContext("2d");try{return o&&r&&r.putImageData(o.getImageData(0,0,e.width,e.height),0,0),n}catch(i){t.log.warn("Failed to clone canvas",i)}return n}function Il(e,t){try{if(e?.contentDocument?.documentElement)return _n(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}function $l(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function Ll(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Le(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let o=n.ownerDocument;if(o){let r=!0;if(await Ge(n,{onError:()=>r=!1,onWarn:t.log.warn}),!r)return e.poster?Le(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(a=>{n.addEventListener("seeked",a,{once:!0})});let i=o.createElement("canvas");i.width=e.offsetWidth,i.height=e.offsetHeight;try{let a=i.getContext("2d");a&&a.drawImage(n,0,0,i.width,i.height)}catch(a){return t.log.warn("Failed to clone video",a),e.poster?Le(e.poster,e.ownerDocument):n}return Wr(i,t)}return n}function Nl(e,t){return dl(e)?Wr(e,t):yl(e)?Il(e,t):Be(e)?$l(e):kt(e)?Ll(e,t):e.cloneNode(!1)}function Ml(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${Vr()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",n.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t)}catch(o){e.log.warn("Failed to getSandBox",o)}}return t}function Yr(e,t,n){let{defaultComputedStyles:o}=n,r=e.nodeName.toLowerCase(),i=nt(e)&&r!=="svg",a=i?Dl.map(v=>[v,e.getAttribute(v)]).filter(([,v])=>v!==null):[],s=[i&&"svg",r,a.map((v,b)=>`${v}=${b}`).join(","),t].filter(Boolean).join(":");if(o.has(s))return o.get(s);let c=Ml(n)?.contentWindow;if(!c)return new Map;let d=c?.document,f,h;i?(f=d.createElementNS(At,"svg"),h=f.ownerDocument.createElementNS(f.namespaceURI,r),a.forEach(([v,b])=>{h.setAttributeNS(null,v,b)}),f.appendChild(h)):f=h=d.createElement(r),h.textContent=" ",d.body.appendChild(f);let m=c.getComputedStyle(h,t),y=new Map;for(let v=m.length,b=0;b<v;b++){let g=m.item(b);Pl.includes(g)||y.set(g,m.getPropertyValue(g))}return d.body.removeChild(f),o.set(s,y),y}function Xr(e,t,n){let o=new Map,r=[],i=new Map;if(n)for(let s of n)a(s);else for(let s=e.length,l=0;l<s;l++){let c=e.item(l);a(c)}for(let s=r.length,l=0;l<s;l++)i.get(r[l])?.forEach((c,d)=>o.set(d,c));function a(s){let l=e.getPropertyValue(s),c=e.getPropertyPriority(s),d=s.lastIndexOf("-"),f=d>-1?s.substring(0,d):void 0;if(f){let h=i.get(f);h||(h=new Map,i.set(f,h)),h.set(s,[l,c])}t.get(s)===l&&!c||(f?r.push(f):o.set(s,[l,c]))}return o}function Ol(e,t,n,o){let{ownerWindow:r,includeStyleProperties:i,currentParentNodeStyle:a}=o,s=t.style,l=r.getComputedStyle(e),c=Yr(e,null,o);a?.forEach((f,h)=>{c.delete(h)});let d=Xr(l,c,i);d.delete("transition-property"),d.delete("all"),d.delete("d"),d.delete("content"),n&&(d.delete("position"),d.delete("margin-top"),d.delete("margin-right"),d.delete("margin-bottom"),d.delete("margin-left"),d.delete("margin-block-start"),d.delete("margin-block-end"),d.delete("margin-inline-start"),d.delete("margin-inline-end"),d.set("box-sizing",["border-box",""])),d.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),Dr&&(d.has("font-kerning")||d.set("font-kerning",["normal",""]),(d.get("overflow-x")?.[0]==="hidden"||d.get("overflow-y")?.[0]==="hidden")&&d.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&d.set("text-overflow",["clip",""]));for(let f=s.length,h=0;h<f;h++)s.removeProperty(s.item(h));return d.forEach(([f,h],m)=>{s.setProperty(m,f,h)}),d}function Fl(e,t){(ml(e)||fl(e)||gl(e))&&t.setAttribute("value",e.value)}function Bl(e,t,n,o,r){let{ownerWindow:i,svgStyleElement:a,svgStyles:s,currentNodeStyle:l}=o;if(!a||!i)return;function c(d){let f=i.getComputedStyle(e,d),h=f.getPropertyValue("content");if(!h||h==="none")return;r?.(h),h=h.replace(/(')|(")|(counter\(.+\))/g,"");let m=[Vr()],y=Yr(e,d,o);l?.forEach((x,C)=>{y.delete(C)});let v=Xr(f,y,o.includeStyleProperties);v.delete("content"),v.delete("-webkit-locale"),v.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let b=[`content: '${h}';`];if(v.forEach(([x,C],I)=>{b.push(`${I}: ${x}${C?" !important":""};`)}),b.length===1)return;try{t.className=[t.className,...m].join(" ")}catch(x){o.log.warn("Failed to copyPseudoClass",x);return}let g=b.join(`
7
- `),p=s.get(g);p||(p=[],s.set(g,p)),p.push(`.${m[0]}${d}`)}Hl.forEach(c),n&&Ul.forEach(c)}async function Cr(e,t,n,o,r){if(le(n)&&(pl(n)||bl(n))||o.filter&&!o.filter(n))return;Sr.has(t.nodeName)||Sr.has(n.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;let i=await _n(n,o,!1,r);o.isEnable("restoreScrollPosition")&&Gl(e,i),t.appendChild(i)}async function kr(e,t,n,o){let r=e.firstChild;le(e)&&e.shadowRoot&&(r=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let i=r;i;i=i.nextSibling)if(!cl(i))if(le(i)&&hl(i)&&typeof i.assignedNodes=="function"){let a=i.assignedNodes();for(let s=0;s<a.length;s++)await Cr(e,t,a[s],n,o)}else await Cr(e,t,i,n,o)}function Gl(e,t){if(!et(e)||!et(t))return;let{scrollTop:n,scrollLeft:o}=e;if(!n&&!o)return;let{transform:r}=t.style,i=new DOMMatrix(r),{a,b:s,c:l,d:c}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-o,-n),i.a=a,i.b=s,i.c=l,i.d=c,t.style.transform=i.toString()}function Vl(e,t){let{backgroundColor:n,width:o,height:r,style:i}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),o&&a.setProperty("width",`${o}px`,"important"),r&&a.setProperty("height",`${r}px`,"important"),i)for(let s in i)a[s]=i[s]}async function _n(e,t,n=!1,o){let{ownerDocument:r,ownerWindow:i,fontFamilies:a,onCloneEachNode:s}=t;if(r&&ul(e))return o&&/\S/.test(e.data)&&o(e.data),r.createTextNode(e.data);if(r&&i&&le(e)&&(et(e)||nt(e))){let c=await Nl(e,t);if(t.isEnable("removeAbnormalAttributes")){let v=c.getAttributeNames();for(let b=v.length,g=0;g<b;g++){let p=v[g];zl.test(p)||c.removeAttribute(p)}}let d=t.currentNodeStyle=Ol(e,c,n,t);n&&Vl(c,t);let f=!1;if(t.isEnable("copyScrollbar")){let v=[d.get("overflow-x")?.[0],d.get("overflow-y")?.[0]];f=v.includes("scroll")||(v.includes("auto")||v.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let h=d.get("text-transform")?.[0],m=zr(d.get("font-family")?.[0]),y=m?v=>{h==="uppercase"?v=v.toUpperCase():h==="lowercase"?v=v.toLowerCase():h==="capitalize"&&(v=v[0].toUpperCase()+v.substring(1)),m.forEach(b=>{let g=a.get(b);g||a.set(b,g=new Set),v.split("").forEach(p=>g.add(p))})}:void 0;return Bl(e,c,f,t,y),Fl(e,c),kt(e)||await kr(e,c,t,y),await s?.(c),c}let l=e.cloneNode(!1);return await kr(e,l,t),await s?.(l),l}function qr(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn("Failed to destroyContext",t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function Kl(e){let{url:t,timeout:n,responseType:o,...r}=e,i=new AbortController,a=n?setTimeout(()=>i.abort(),n):void 0;return fetch(t,{signal:i.signal,...r}).then(s=>{if(!s.ok)throw new Error("Failed fetch, not 2xx response",{cause:s});switch(o){case"arrayBuffer":return s.arrayBuffer();case"dataUrl":return s.blob().then(Sl);default:return s.text()}}).finally(()=>clearTimeout(a))}function tt(e,t){let{url:n,requestType:o="text",responseType:r="text",imageDom:i}=t,a=n,{timeout:s,acceptOfImage:l,requests:c,fetchFn:d,fetch:{requestInit:f,bypassingCache:h,placeholderImage:m},font:y,workers:v,fontFamilies:b}=e;o==="image"&&(Ct||An)&&e.drawImageCount++;let g=c.get(n);if(!g){h&&h instanceof RegExp&&h.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let p=o.startsWith("font")&&y&&y.minify,x=new Set;p&&o.split(";")[1].split(",").forEach(R=>{b.has(R)&&b.get(R).forEach(F=>x.add(F))});let C=p&&x.size,I={url:a,timeout:s,responseType:C?"arrayBuffer":r,headers:o==="image"?{accept:l}:void 0,...f};g={type:o,resolve:void 0,reject:void 0,response:null},g.response=(async()=>{if(d&&o==="image"){let w=await d(n);if(w)return w}return!Ct&&n.startsWith("http")&&v.length?new Promise((w,R)=>{v[c.size&v.length-1].postMessage({rawUrl:n,...I}),g.resolve=w,g.reject=R}):Kl(I)})().catch(w=>{if(c.delete(n),o==="image"&&m)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof m=="string"?m:m(i);throw w}),c.set(n,g)}return g.response}async function Zr(e,t,n,o){if(!Jr(e))return e;for(let[r,i]of jl(e,t))try{let a=await tt(n,{url:i,requestType:o?"image":"text",responseType:"dataUrl"});e=e.replace(Wl(r),`$1${a}$3`)}catch(a){n.log.warn("Failed to fetch css data url",r,a)}return e}function Jr(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}function jl(e,t){let n=[];return e.replace(Qr,(o,r,i)=>(n.push([i,Fr(i,t)]),o)),n.filter(([o])=>!Cn(o))}function Wl(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Xl(e,t){return Yl.map(n=>{let o=e.getPropertyValue(n);return!o||o==="none"?null:((Ct||An)&&t.drawImageCount++,Zr(o,null,t,!0).then(r=>{!r||o===r||e.setProperty(n,r,e.getPropertyPriority(n))}))}).filter(Boolean)}function ql(e,t){if(Be(e)){let n=e.currentSrc||e.src;if(!Cn(n))return[tt(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.srcset="",e.dataset.originalSrc=n,e.src=o||"")})];(Ct||An)&&t.drawImageCount++}else if(nt(e)&&!Cn(e.href.baseVal)){let n=e.href.baseVal;return[tt(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.dataset.originalSrc=n,e.href.baseVal=o||"")})]}return[]}function Zl(e,t){let{ownerDocument:n,svgDefsElement:o}=t,r=e.getAttribute("href")??e.getAttribute("xlink:href");if(!r)return[];let[i,a]=r.split("#");if(a){let s=`#${a}`,l=t.shadowRoots.reduce((c,d)=>c??d.querySelector(`svg ${s}`),n?.querySelector(`svg ${s}`));if(i&&e.setAttribute("href",s),o?.querySelector(s))return[];if(l)return o?.appendChild(l.cloneNode(!0)),[];if(i)return[tt(t,{url:i,responseType:"text"}).then(c=>{o?.insertAdjacentHTML("beforeend",c)})]}return[]}function ei(e,t){let{tasks:n}=t;le(e)&&((Be(e)||Or(e))&&n.push(...ql(e,t)),ll(e)&&n.push(...Zl(e,t))),et(e)&&n.push(...Xl(e.style,t)),e.childNodes.forEach(o=>{ei(o,t)})}async function Jl(e,t){let{ownerDocument:n,svgStyleElement:o,fontFamilies:r,fontCssTexts:i,tasks:a,font:s}=t;if(!(!n||!o||!r.size))if(s&&s.cssText){let l=Ar(s.cssText,t);o.appendChild(n.createTextNode(`${l}
8
- `))}else{let l=Array.from(n.styleSheets).filter(m=>{try{return"cssRules"in m&&!!m.cssRules.length}catch(y){return t.log.warn(`Error while reading CSS rules from ${m.href}`,y),!1}}),c=n.implementation.createHTMLDocument(""),d=c.createElement("style");c.head.appendChild(d);let f=d.sheet;await Promise.all(l.flatMap(m=>Array.from(m.cssRules).map(async y=>{if(al(y)){let v=y.href,b="";try{b=await tt(t,{url:v,requestType:"text",responseType:"text"})}catch(p){t.log.warn(`Error fetch remote css import from ${v}`,p)}let g=b.replace(Qr,(p,x,C)=>p.replace(C,Fr(C,v)));for(let p of ec(g))try{f.insertRule(p,f.cssRules.length)}catch(x){t.log.warn("Error inserting rule from remote css import",{rule:p,error:x})}}}))),f.cssRules.length&&l.push(f);let h=[];l.forEach(m=>{kn(m.cssRules,h)}),h.filter(m=>il(m)&&Jr(m.style.getPropertyValue("src"))&&zr(m.style.getPropertyValue("font-family"))?.some(y=>r.has(y))).forEach(m=>{let y=m,v=i.get(y.cssText);v?o.appendChild(n.createTextNode(`${v}
9
- `)):a.push(Zr(y.cssText,y.parentStyleSheet?y.parentStyleSheet.href:null,t).then(b=>{b=Ar(b,t),i.set(y.cssText,b),o.appendChild(n.createTextNode(`${b}
10
- `))}))})}}function ec(e){if(e==null)return[];let t=[],n=e.replace(Ql,"");for(;;){let i=Tr.exec(n);if(!i)break;t.push(i[0])}n=n.replace(Tr,"");let o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,r=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let i=o.exec(n);if(i)r.lastIndex=o.lastIndex;else if(i=r.exec(n),i)o.lastIndex=r.lastIndex;else break;t.push(i[0])}return t}function Ar(e,t){let{font:n}=t,o=n?n?.preferredFormat:void 0;return o?e.replace(nc,r=>{for(;;){let[i,,a]=tc.exec(r)||[];if(!a)return"";if(a===o)return`src: ${i};`}}):e}function kn(e,t=[]){for(let n of Array.from(e))sl(n)?t.push(...kn(n.cssRules)):"cssRules"in n?kn(n.cssRules,t):t.push(n);return t}function rc(e){return oc.test(e.innerHTML)}async function ti(e,t){let n=await ce(e,t);if(le(n.node)&&nt(n.node)&&!rc(n.node))return n.node;let{ownerDocument:o,log:r,tasks:i,svgStyleElement:a,svgDefsElement:s,svgStyles:l,font:c,progress:d,autoDestruct:f,onCloneNode:h,onEmbedNode:m,onCreateForeignObjectSvg:y}=n;r.time("clone node");let v=await _n(n.node,n,!0);if(a&&o){let C="";l.forEach((I,w)=>{C+=`${I.join(`,
6
+ `);return t.appendChild(n),t}function Il(e,t){let{width:n,height:o}=t;if(ce(e)&&(!n||!o)){let r=e.getBoundingClientRect();n=n||r.width||Number(e.getAttribute("width"))||0,o=o||r.height||Number(e.getAttribute("height"))||0}return{width:n,height:o}}async function Ll(e,t){let{log:n,timeout:o,drawImageCount:r,drawImageInterval:i}=t;n.time("image to canvas");let a=await Ve(e,{timeout:o,onWarn:t.log.warn}),{canvas:s,context2d:l}=$l(e.ownerDocument,t),c=()=>{try{l?.drawImage(a,0,0,s.width,s.height)}catch(d){t.log.warn("Failed to drawImage",d)}};if(c(),t.isEnable("fixSvgXmlDecode"))for(let d=0;d<r;d++)await new Promise(f=>{setTimeout(()=>{l?.clearRect(0,0,s.width,s.height),c(),f()},d+i)});return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function $l(e,t){let{width:n,height:o,scale:r,backgroundColor:i,maximumCanvasSize:a}=t,s=e.createElement("canvas");s.width=Math.floor(n*r),s.height=Math.floor(o*r),s.style.width=`${n}px`,s.style.height=`${o}px`,a&&(s.width>a||s.height>a)&&(s.width>a&&s.height>a?s.width>s.height?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a):s.width>a?(s.height*=a/s.width,s.width=a):(s.width*=a/s.height,s.height=a));let l=s.getContext("2d");return l&&i&&(l.fillStyle=i,l.fillRect(0,0,s.width,s.height)),{canvas:s,context2d:l}}function Xr(e,t){if(e.ownerDocument)try{let i=e.toDataURL();if(i!=="data:,")return Me(i,e.ownerDocument)}catch(i){t.log.warn("Failed to clone canvas",i)}let n=e.cloneNode(!1),o=e.getContext("2d"),r=n.getContext("2d");try{return o&&r&&r.putImageData(o.getImageData(0,0,e.width,e.height),0,0),n}catch(i){t.log.warn("Failed to clone canvas",i)}return n}function Nl(e,t){try{if(e?.contentDocument?.documentElement)return In(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}function Ml(e){let t=e.cloneNode(!1);return e.currentSrc&&e.currentSrc!==e.src&&(t.src=e.currentSrc,t.srcset=""),t.loading==="lazy"&&(t.loading="eager"),t}async function Pl(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Me(e.poster,e.ownerDocument);let n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);let o=n.ownerDocument;if(o){let r=!0;if(await Ve(n,{onError:()=>r=!1,onWarn:t.log.warn}),!r)return e.poster?Me(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(a=>{n.addEventListener("seeked",a,{once:!0})});let i=o.createElement("canvas");i.width=e.offsetWidth,i.height=e.offsetHeight;try{let a=i.getContext("2d");a&&a.drawImage(n,0,0,i.width,i.height)}catch(a){return t.log.warn("Failed to clone video",a),e.poster?Me(e.poster,e.ownerDocument):n}return Xr(i,t)}return n}function Dl(e,t){return pl(e)?Xr(e,t):El(e)?Nl(e,t):ze(e)?Ml(e):At(e)?Pl(e,t):e.cloneNode(!1)}function Ol(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${Kr()}`,t.width="0",t.height="0",t.style.visibility="hidden",t.style.position="fixed",n.body.appendChild(t),t.srcdoc='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',e.sandbox=t)}catch(o){e.log.warn("Failed to getSandBox",o)}}return t}function qr(e,t,n){let{defaultComputedStyles:o}=n,r=e.nodeName.toLowerCase(),i=it(e)&&r!=="svg",a=i?Hl.map(v=>[v,e.getAttribute(v)]).filter(([,v])=>v!==null):[],s=[i&&"svg",r,a.map((v,b)=>`${v}=${b}`).join(","),t].filter(Boolean).join(":");if(o.has(s))return o.get(s);let c=Ol(n)?.contentWindow;if(!c)return new Map;let d=c?.document,f,h;i?(f=d.createElementNS(Rt,"svg"),h=f.ownerDocument.createElementNS(f.namespaceURI,r),a.forEach(([v,b])=>{h.setAttributeNS(null,v,b)}),f.appendChild(h)):f=h=d.createElement(r),h.textContent=" ",d.body.appendChild(f);let m=c.getComputedStyle(h,t),y=new Map;for(let v=m.length,b=0;b<v;b++){let g=m.item(b);Fl.includes(g)||y.set(g,m.getPropertyValue(g))}return d.body.removeChild(f),o.set(s,y),y}function Zr(e,t,n){let o=new Map,r=[],i=new Map;if(n)for(let s of n)a(s);else for(let s=e.length,l=0;l<s;l++){let c=e.item(l);a(c)}for(let s=r.length,l=0;l<s;l++)i.get(r[l])?.forEach((c,d)=>o.set(d,c));function a(s){let l=e.getPropertyValue(s),c=e.getPropertyPriority(s),d=s.lastIndexOf("-"),f=d>-1?s.substring(0,d):void 0;if(f){let h=i.get(f);h||(h=new Map,i.set(f,h)),h.set(s,[l,c])}t.get(s)===l&&!c||(f?r.push(f):o.set(s,[l,c]))}return o}function Ul(e,t,n,o){let{ownerWindow:r,includeStyleProperties:i,currentParentNodeStyle:a}=o,s=t.style,l=r.getComputedStyle(e),c=qr(e,null,o);a?.forEach((f,h)=>{c.delete(h)});let d=Zr(l,c,i);d.delete("transition-property"),d.delete("all"),d.delete("d"),d.delete("content"),n&&(d.delete("position"),d.delete("margin-top"),d.delete("margin-right"),d.delete("margin-bottom"),d.delete("margin-left"),d.delete("margin-block-start"),d.delete("margin-block-end"),d.delete("margin-inline-start"),d.delete("margin-inline-end"),d.set("box-sizing",["border-box",""])),d.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),Fr&&(d.has("font-kerning")||d.set("font-kerning",["normal",""]),(d.get("overflow-x")?.[0]==="hidden"||d.get("overflow-y")?.[0]==="hidden")&&d.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&d.set("text-overflow",["clip",""]));for(let f=s.length,h=0;h<f;h++)s.removeProperty(s.item(h));return d.forEach(([f,h],m)=>{s.setProperty(m,f,h)}),d}function Bl(e,t){(bl(e)||gl(e)||vl(e))&&t.setAttribute("value",e.value)}function Vl(e,t,n,o,r){let{ownerWindow:i,svgStyleElement:a,svgStyles:s,currentNodeStyle:l}=o;if(!a||!i)return;function c(d){let f=i.getComputedStyle(e,d),h=f.getPropertyValue("content");if(!h||h==="none")return;r?.(h),h=h.replace(/(')|(")|(counter\(.+\))/g,"");let m=[Kr()],y=qr(e,d,o);l?.forEach((x,S)=>{y.delete(S)});let v=Zr(f,y,o.includeStyleProperties);v.delete("content"),v.delete("-webkit-locale"),v.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let b=[`content: '${h}';`];if(v.forEach(([x,S],I)=>{b.push(`${I}: ${x}${S?" !important":""};`)}),b.length===1)return;try{t.className=[t.className,...m].join(" ")}catch(x){o.log.warn("Failed to copyPseudoClass",x);return}let g=b.join(`
7
+ `),p=s.get(g);p||(p=[],s.set(g,p)),p.push(`.${m[0]}${d}`)}Gl.forEach(c),n&&zl.forEach(c)}async function Tr(e,t,n,o,r){if(ce(n)&&(hl(n)||yl(n))||o.filter&&!o.filter(n))return;kr.has(t.nodeName)||kr.has(n.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;let i=await In(n,o,!1,r);o.isEnable("restoreScrollPosition")&&Kl(e,i),t.appendChild(i)}async function Ar(e,t,n,o){let r=e.firstChild;ce(e)&&e.shadowRoot&&(r=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let i=r;i;i=i.nextSibling)if(!ml(i))if(ce(i)&&xl(i)&&typeof i.assignedNodes=="function"){let a=i.assignedNodes();for(let s=0;s<a.length;s++)await Tr(e,t,a[s],n,o)}else await Tr(e,t,i,n,o)}function Kl(e,t){if(!ot(e)||!ot(t))return;let{scrollTop:n,scrollLeft:o}=e;if(!n&&!o)return;let{transform:r}=t.style,i=new DOMMatrix(r),{a,b:s,c:l,d:c}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-o,-n),i.a=a,i.b=s,i.c=l,i.d=c,t.style.transform=i.toString()}function jl(e,t){let{backgroundColor:n,width:o,height:r,style:i}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),o&&a.setProperty("width",`${o}px`,"important"),r&&a.setProperty("height",`${r}px`,"important"),i)for(let s in i)a[s]=i[s]}async function In(e,t,n=!1,o){let{ownerDocument:r,ownerWindow:i,fontFamilies:a,onCloneEachNode:s}=t;if(r&&fl(e))return o&&/\S/.test(e.data)&&o(e.data),r.createTextNode(e.data);if(r&&i&&ce(e)&&(ot(e)||it(e))){let c=await Dl(e,t);if(t.isEnable("removeAbnormalAttributes")){let v=c.getAttributeNames();for(let b=v.length,g=0;g<b;g++){let p=v[g];Wl.test(p)||c.removeAttribute(p)}}let d=t.currentNodeStyle=Ul(e,c,n,t);n&&jl(c,t);let f=!1;if(t.isEnable("copyScrollbar")){let v=[d.get("overflow-x")?.[0],d.get("overflow-y")?.[0]];f=v.includes("scroll")||(v.includes("auto")||v.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let h=d.get("text-transform")?.[0],m=jr(d.get("font-family")?.[0]),y=m?v=>{h==="uppercase"?v=v.toUpperCase():h==="lowercase"?v=v.toLowerCase():h==="capitalize"&&(v=v[0].toUpperCase()+v.substring(1)),m.forEach(b=>{let g=a.get(b);g||a.set(b,g=new Set),v.split("").forEach(p=>g.add(p))})}:void 0;return Vl(e,c,f,t,y),Bl(e,c),At(e)||await Ar(e,c,t,y),await s?.(c),c}let l=e.cloneNode(!1);return await Ar(e,l,t),await s?.(l),l}function Jr(e){if(e.ownerDocument=void 0,e.ownerWindow=void 0,e.svgStyleElement=void 0,e.svgDefsElement=void 0,e.svgStyles.clear(),e.defaultComputedStyles.clear(),e.sandbox){try{e.sandbox.remove()}catch(t){e.log.warn("Failed to destroyContext",t)}e.sandbox=void 0}e.workers=[],e.fontFamilies.clear(),e.fontCssTexts.clear(),e.requests.clear(),e.tasks=[],e.shadowRoots=[]}function Yl(e){let{url:t,timeout:n,responseType:o,...r}=e,i=new AbortController,a=n?setTimeout(()=>i.abort(),n):void 0;return fetch(t,{signal:i.signal,...r}).then(s=>{if(!s.ok)throw new Error("Failed fetch, not 2xx response",{cause:s});switch(o){case"arrayBuffer":return s.arrayBuffer();case"dataUrl":return s.blob().then(Tl);default:return s.text()}}).finally(()=>clearTimeout(a))}function rt(e,t){let{url:n,requestType:o="text",responseType:r="text",imageDom:i}=t,a=n,{timeout:s,acceptOfImage:l,requests:c,fetchFn:d,fetch:{requestInit:f,bypassingCache:h,placeholderImage:m},font:y,workers:v,fontFamilies:b}=e;o==="image"&&(Tt||Rn)&&e.drawImageCount++;let g=c.get(n);if(!g){h&&h instanceof RegExp&&h.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let p=o.startsWith("font")&&y&&y.minify,x=new Set;p&&o.split(";")[1].split(",").forEach(A=>{b.has(A)&&b.get(A).forEach(F=>x.add(F))});let S=p&&x.size,I={url:a,timeout:s,responseType:S?"arrayBuffer":r,headers:o==="image"?{accept:l}:void 0,...f};g={type:o,resolve:void 0,reject:void 0,response:null},g.response=(async()=>{if(d&&o==="image"){let E=await d(n);if(E)return E}return!Tt&&n.startsWith("http")&&v.length?new Promise((E,A)=>{v[c.size&v.length-1].postMessage({rawUrl:n,...I}),g.resolve=E,g.reject=A}):Yl(I)})().catch(E=>{if(c.delete(n),o==="image"&&m)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof m=="string"?m:m(i);throw E}),c.set(n,g)}return g.response}async function Qr(e,t,n,o){if(!ei(e))return e;for(let[r,i]of Xl(e,t))try{let a=await rt(n,{url:i,requestType:o?"image":"text",responseType:"dataUrl"});e=e.replace(ql(r),`$1${a}$3`)}catch(a){n.log.warn("Failed to fetch css data url",r,a)}return e}function ei(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}function Xl(e,t){let n=[];return e.replace(ti,(o,r,i)=>(n.push([i,Ur(i,t)]),o)),n.filter(([o])=>!Tn(o))}function ql(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Jl(e,t){return Zl.map(n=>{let o=e.getPropertyValue(n);return!o||o==="none"?null:((Tt||Rn)&&t.drawImageCount++,Qr(o,null,t,!0).then(r=>{!r||o===r||e.setProperty(n,r,e.getPropertyPriority(n))}))}).filter(Boolean)}function Ql(e,t){if(ze(e)){let n=e.currentSrc||e.src;if(!Tn(n))return[rt(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.srcset="",e.dataset.originalSrc=n,e.src=o||"")})];(Tt||Rn)&&t.drawImageCount++}else if(it(e)&&!Tn(e.href.baseVal)){let n=e.href.baseVal;return[rt(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.dataset.originalSrc=n,e.href.baseVal=o||"")})]}return[]}function ec(e,t){let{ownerDocument:n,svgDefsElement:o}=t,r=e.getAttribute("href")??e.getAttribute("xlink:href");if(!r)return[];let[i,a]=r.split("#");if(a){let s=`#${a}`,l=t.shadowRoots.reduce((c,d)=>c??d.querySelector(`svg ${s}`),n?.querySelector(`svg ${s}`));if(i&&e.setAttribute("href",s),o?.querySelector(s))return[];if(l)return o?.appendChild(l.cloneNode(!0)),[];if(i)return[rt(t,{url:i,responseType:"text"}).then(c=>{o?.insertAdjacentHTML("beforeend",c)})]}return[]}function ni(e,t){let{tasks:n}=t;ce(e)&&((ze(e)||Hr(e))&&n.push(...Ql(e,t)),dl(e)&&n.push(...ec(e,t))),ot(e)&&n.push(...Jl(e.style,t)),e.childNodes.forEach(o=>{ni(o,t)})}async function tc(e,t){let{ownerDocument:n,svgStyleElement:o,fontFamilies:r,fontCssTexts:i,tasks:a,font:s}=t;if(!(!n||!o||!r.size))if(s&&s.cssText){let l=Rr(s.cssText,t);o.appendChild(n.createTextNode(`${l}
8
+ `))}else{let l=Array.from(n.styleSheets).filter(m=>{try{return"cssRules"in m&&!!m.cssRules.length}catch(y){return t.log.warn(`Error while reading CSS rules from ${m.href}`,y),!1}}),c=n.implementation.createHTMLDocument(""),d=c.createElement("style");c.head.appendChild(d);let f=d.sheet;await Promise.all(l.flatMap(m=>Array.from(m.cssRules).map(async y=>{if(cl(y)){let v=y.href,b="";try{b=await rt(t,{url:v,requestType:"text",responseType:"text"})}catch(p){t.log.warn(`Error fetch remote css import from ${v}`,p)}let g=b.replace(ti,(p,x,S)=>p.replace(S,Ur(S,v)));for(let p of oc(g))try{f.insertRule(p,f.cssRules.length)}catch(x){t.log.warn("Error inserting rule from remote css import",{rule:p,error:x})}}}))),f.cssRules.length&&l.push(f);let h=[];l.forEach(m=>{An(m.cssRules,h)}),h.filter(m=>ll(m)&&ei(m.style.getPropertyValue("src"))&&jr(m.style.getPropertyValue("font-family"))?.some(y=>r.has(y))).forEach(m=>{let y=m,v=i.get(y.cssText);v?o.appendChild(n.createTextNode(`${v}
9
+ `)):a.push(Qr(y.cssText,y.parentStyleSheet?y.parentStyleSheet.href:null,t).then(b=>{b=Rr(b,t),i.set(y.cssText,b),o.appendChild(n.createTextNode(`${b}
10
+ `))}))})}}function oc(e){if(e==null)return[];let t=[],n=e.replace(nc,"");for(;;){let i=_r.exec(n);if(!i)break;t.push(i[0])}n=n.replace(_r,"");let o=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,r=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let i=o.exec(n);if(i)r.lastIndex=o.lastIndex;else if(i=r.exec(n),i)o.lastIndex=r.lastIndex;else break;t.push(i[0])}return t}function Rr(e,t){let{font:n}=t,o=n?n?.preferredFormat:void 0;return o?e.replace(ic,r=>{for(;;){let[i,,a]=rc.exec(r)||[];if(!a)return"";if(a===o)return`src: ${i};`}}):e}function An(e,t=[]){for(let n of Array.from(e))ul(n)?t.push(...An(n.cssRules)):"cssRules"in n?An(n.cssRules,t):t.push(n);return t}function sc(e){return ac.test(e.innerHTML)}async function oi(e,t){let n=await ue(e,t);if(ce(n.node)&&it(n.node)&&!sc(n.node))return n.node;let{ownerDocument:o,log:r,tasks:i,svgStyleElement:a,svgDefsElement:s,svgStyles:l,font:c,progress:d,autoDestruct:f,onCloneNode:h,onEmbedNode:m,onCreateForeignObjectSvg:y}=n;r.time("clone node");let v=await In(n.node,n,!0);if(a&&o){let S="";l.forEach((I,E)=>{S+=`${I.join(`,
11
11
  `)} {
12
- ${w}
12
+ ${E}
13
13
  }
14
- `}),a.appendChild(o.createTextNode(C))}r.timeEnd("clone node"),await h?.(v),c!==!1&&le(v)&&(r.time("embed web font"),await Jl(v,n),r.timeEnd("embed web font")),r.time("embed node"),ei(v,n);let b=i.length,g=0,p=async()=>{for(;;){let C=i.pop();if(!C)break;try{await C}catch(I){n.log.warn("Failed to run task",I)}d?.(++g,b)}};d?.(g,b),await Promise.all([...Array.from({length:4})].map(p)),r.timeEnd("embed node"),await m?.(v);let x=ic(v,n);return s&&x.insertBefore(s,x.children[0]),a&&x.insertBefore(a,x.children[0]),f&&qr(n),await y?.(x),x}function ic(e,t){let{width:n,height:o}=t,r=Hr(n,o,e.ownerDocument),i=r.ownerDocument.createElementNS(r.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(e),r.appendChild(i),r}async function _t(e,t){let n=await ce(e,t),o=await ti(n),r=Ur(o,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=jr(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(At,"defs"),n.svgStyles.clear());let i=Le(r,o.ownerDocument);return await _l(i,n)}async function ac(e,t){let n=await ce(e,t),{log:o,type:r,quality:i,dpi:a}=n,s=await _t(n);o.time("canvas to blob");let l=await El(s,r,i);if(["image/png","image/jpeg"].includes(r)&&a){let c=await Cl(l.slice(0,33)),d=new Uint8Array(c);return r==="image/png"?d=Nr(d,a):r==="image/jpeg"&&(d=_r(d,a)),o.timeEnd("canvas to blob"),new Blob([d,l.slice(33)],{type:r})}return o.timeEnd("canvas to blob"),l}async function Ve(e,t){let n=await ce(e,t),{log:o,quality:r,type:i,dpi:a}=n,s=await _t(n);o.time("canvas to data url");let l=s.toDataURL(i,r);if(["image/png","image/jpeg"].includes(i)&&a&&Pr&&ol){let[c,d]=l.split(","),f=0,h=!1;if(i==="image/png"){let x=tl(d);x>=0?(f=Math.ceil((x+28)/3)*4,h=!0):f=33/3*4}else i==="image/jpeg"&&(f=18/3*4);let m=d.substring(0,f),y=d.substring(f),v=window.atob(m),b=new Uint8Array(v.length);for(let x=0;x<b.length;x++)b[x]=v.charCodeAt(x);let g=i==="image/png"?Nr(b,a,h):_r(b,a),p=window.btoa(String.fromCharCode(...g));l=[c,",",p,y].join("")}return o.timeEnd("canvas to data url"),l}async function ni(e,t){let n=await ce(e,t),{width:o,height:r,ownerDocument:i}=n,a=await Ve(n),s=Hr(o,r,i),l=s.ownerDocument.createElementNS(s.namespaceURI,"image");return l.setAttributeNS(null,"href",a),l.setAttributeNS(null,"height","100%"),l.setAttributeNS(null,"width","100%"),s.appendChild(l),Ur(s,n.isEnable("removeControlCharacter"))}async function sc(e,t){let n=await ce(e,t),{ownerDocument:o,width:r,height:i,scale:a,type:s}=n,l=s==="image/svg+xml"?await ni(n):await Ve(n),c=Le(l,o);return c.width=Math.floor(r*a),c.height=Math.floor(i*a),c.style.width=`${r}px`,c.style.height=`${i}px`,c}async function lc(e,t){return Ve(await ce(e,{...t,type:"image/jpeg"}))}async function cc(e,t){let n=await ce(e,t),o=await _t(n);return o.getContext("2d").getImageData(0,0,o.width,o.height).data}async function uc(e,t){return Ve(await ce(e,{...t,type:"image/png"}))}async function dc(e,t){return Ve(await ce(e,{...t,type:"image/webp"}))}var Rr,Ir,$r,Lr,Sn,Js,Qs,el,Mr,Se,nl,Pr,ol,Tn,Dr,Ct,An,rl,il,al,sl,le,nt,Or,ll,et,cl,ul,Be,kt,dl,ml,fl,pl,bl,gl,hl,yl,vl,Cn,At,Sl,Cl,Vr,wr,Pl,Dl,Hl,Ul,Sr,zl,Qr,Yl,Ql,Tr,tc,nc,oc,ri=Wi(()=>{"use strict";Rr=112,Ir=72,$r=89,Lr=115;Js="AAlwSFlz",Qs="AAAJcEhZ",el="AAAACXBI";Mr="[modern-screenshot]",Se=typeof window<"u",nl=Se&&"Worker"in window,Pr=Se&&"atob"in window,ol=Se&&"btoa"in window,Tn=Se?window.navigator?.userAgent:"",Dr=Tn.includes("Chrome"),Ct=Tn.includes("AppleWebKit")&&!Dr,An=Tn.includes("Firefox"),rl=e=>e&&"__CONTEXT__"in e,il=e=>e.constructor.name==="CSSFontFaceRule",al=e=>e.constructor.name==="CSSImportRule",sl=e=>e.constructor.name==="CSSLayerBlockRule",le=e=>e.nodeType===1,nt=e=>typeof e.className=="object",Or=e=>e.tagName==="image",ll=e=>e.tagName==="use",et=e=>le(e)&&typeof e.style<"u"&&!nt(e),cl=e=>e.nodeType===8,ul=e=>e.nodeType===3,Be=e=>e.tagName==="IMG",kt=e=>e.tagName==="VIDEO",dl=e=>e.tagName==="CANVAS",ml=e=>e.tagName==="TEXTAREA",fl=e=>e.tagName==="INPUT",pl=e=>e.tagName==="STYLE",bl=e=>e.tagName==="SCRIPT",gl=e=>e.tagName==="SELECT",hl=e=>e.tagName==="SLOT",yl=e=>e.tagName==="IFRAME",vl=(...e)=>console.warn(Mr,...e);Cn=e=>e.startsWith("data:");At="http://www.w3.org/2000/svg";Sl=e=>Br(e,"dataUrl"),Cl=e=>Br(e,"arrayBuffer");Vr=(function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();wr=0;Pl=["width","height","-webkit-text-fill-color"],Dl=["stroke","fill"];Hl=["::before","::after"],Ul=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];Sr=new Set(["symbol"]);zl=/^[\w-:]+$/;Qr=/url\((['"]?)([^'"]+?)\1\)/g;Yl=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];Ql=/(\/\*[\s\S]*?\*\/)/g,Tr=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;tc=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,nc=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;oc=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i});function Yn(e){let t=new Set,n={active:!1,frozen:!1,hoveredElement:null,options:e,toolbar:{visible:e.showToolbar,themeMode:e.themeMode,comments:[]}},o=new Proxy(n,{set(r,i,a){let s=i;return r[s]===a||(Reflect.set(r,s,a),t.forEach(l=>l(o,s))),!0}});return{state:o,subscribe(r){return t.add(r),()=>t.delete(r)}}}var Xn="72px",he="68px";var Ht="grabby-root",de=null,Te=null,Ft,me=new Map;function Xi(e){try{return"adoptedStyleSheets"in e&&typeof CSSStyleSheet=="function"&&typeof CSSStyleSheet.prototype.replaceSync=="function"}catch{return!1}}function qn(e){Ft=e}function D(){if(Te&&de?.isConnected)return Te;de=document.createElement(Ht),de.setAttribute("data-grabby-ignore",""),Te=de.attachShadow({mode:"open"}),document.documentElement.appendChild(de);for(let[e,t]of Array.from(me))t.target==="shadow"&&(me.delete(e),N(e,t.css));return Te}function N(e,t,n="shadow"){let o=me.get(e);if(o){o.css=t,o.sheet&&o.sheet.replaceSync(t),o.el&&(o.el.textContent=t);return}let r=n==="shadow"?D():document;if(Xi(r)){let a=new CSSStyleSheet;a.replaceSync(t),r.adoptedStyleSheets=[...r.adoptedStyleSheets,a],me.set(e,{target:n,css:t,sheet:a});return}let i=document.createElement("style");i.setAttribute("data-grabby-style",e),Ft&&(i.nonce=Ft),i.textContent=t,n==="shadow"?D().prepend(i):document.head.appendChild(i),me.set(e,{target:n,css:t,el:i})}function Y(e){return me.has(e)}function M(e){let t=me.get(e);if(t&&(me.delete(e),t.el&&t.el.remove(),t.sheet)){let n=t.target==="shadow"?Te:document;n&&(n.adoptedStyleSheets=n.adoptedStyleSheets.filter(o=>o!==t.sheet))}}function Zn(e){return!e||!de?!1:e===de?!0:e.getRootNode()===Te}function ye(e){let n=(typeof e.composedPath=="function"?e.composedPath():[])[0]??e.target;return n instanceof Element?n:null}function Ut(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}function Ae(e){if(!e)return!1;let t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable===!0}function Jn(){for(let e of Array.from(me.keys()))M(e);de?.remove(),de=null,Te=null}var qi=new Set(["BUTTON","A","SUMMARY"]),Zi=new Set(["button","link","tab","menuitem","menuitemcheckbox","menuitemradio","switch","option","checkbox","radio"]),eo=new Set(["button","submit","reset","image"]),Ji=new Set(["INPUT","SELECT","TEXTAREA"]),Qi=new Set(["textbox","combobox","searchbox","spinbutton","slider"]),ea=new Set(["IMG","SVG","VIDEO","PICTURE","CANVAS","IFRAME","AUDIO"]),ta=new Set(["H1","H2","H3","H4","H5","H6","P","SPAN","LABEL","LI","STRONG","EM","B","I","SMALL","BLOCKQUOTE","CODE","PRE","TD","TH","DT","DD","FIGCAPTION","LEGEND","CAPTION","Q","CITE","MARK","TIME"]),to=new Set(["HTML","BODY","MAIN"]),na=new Set(["HEADER","FOOTER","NAV","ASIDE"]),oa=.6;function ft(e){return(e.getAttribute("role")??"").toLowerCase()}function Bt(e){return qi.has(e.tagName)?e.tagName!=="A"||e.hasAttribute("href")||e.hasAttribute("role"):e.tagName==="INPUT"&&eo.has(e.type)?!0:Zi.has(ft(e))}function Gt(e){return e.tagName==="INPUT"?!eo.has(e.type):Ji.has(e.tagName)||e.isContentEditable&&e.getAttribute("contenteditable")!==null?!0:Qi.has(ft(e))}function Qn(e){let t=e.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;if(!n||!o)return!1;let r=Math.max(0,Math.min(t.right,n)-Math.max(t.left,0)),i=Math.max(0,Math.min(t.bottom,o)-Math.max(t.top,0));return r*i/(n*o)>=oa}function ra(e){return e.children.length>0}function pt(e){return to.has(e.tagName)?"section":ea.has(e.tagName)?"media":Gt(e)?"field":Bt(e)?"action":na.has(e.tagName)||ft(e)==="main"||ft(e)==="region"?Qn(e)?"section":"container":ta.has(e.tagName)||!ra(e)&&(e.textContent??"").trim()?"text":Qn(e)?"section":"container"}var ia=3;function no(e){if(Bt(e)||Gt(e))return e;let t=e.parentElement;for(let n=0;t&&n<ia;n++){if(Bt(t)||Gt(t))return t;if(to.has(t.tagName))break;t=t.parentElement}return e}var aa=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,sa=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g,la=/\b(Bearer|Basic|Token)\s+[A-Za-z0-9._~+/=-]{8,}/gi,ca=/\b\d(?:[ -]?\d){8,}\b/g,ua=/\b[A-Za-z0-9_-]{32,}\b/g,da=/([?&#](?:access_token|id_token|token|key|api_key|apikey|secret|password|pass|auth|code|session|sig|signature)=)[^&#\s]*/gi;function U(e,t={}){if(!e)return e;let n=e.replace(da,"$1[redacted]").replace(sa,"[token]").replace(la,"$1 [token]");return(t.keepEmails?n:n.replace(aa,"[email]")).replace(ca,"[number]").replace(ua,o=>/\d/.test(o)&&/[A-Za-z]/.test(o)?"[token]":o)}function Vt(e,t=[]){let n=e.pathname||"/";if(t.length>0&&e.search){let o=new URLSearchParams(e.search),r=new URLSearchParams;for(let a of t){let s=o.get(a);s!==null&&r.set(a,s)}let i=r.toString();i&&(n+=`?${i}`)}return e.hash.startsWith("#/")&&(n+=e.hash.split("?")[0]),U(n)}function Ke(e,t=typeof location<"u"?location.href:"http://localhost/"){try{let n=new URL(e,t);if(n.protocol==="javascript:"||n.protocol==="data:"||n.protocol==="vbscript:")return`${n.protocol}\u2026`;let o=new URL(t),r=n.pathname+(n.hash.startsWith("#/")?n.hash:"");return U(n.origin===o.origin?r:`${n.host}${r}`)}catch{return U(e.split(/[?#]/)[0])}}var bt="data-grabby-mask",fe="data-grabby-ignore",ma=["id","class","role","aria-label","data-testid","data-test","data-cy","name","type","href","src","alt","placeholder","title","for","aria-expanded","aria-selected","disabled"],fa=new Set(["href","src"]),pa=8,ba=60,ga=80,ha=80,oo=300;function ya(e){return e.startsWith("_ng")||e.startsWith("ng-reflect-")||e.startsWith("data-v-")||e.startsWith("data-grabby-")||e.startsWith("data-svelte")||e==="style"||e==="value"||e.startsWith("on")}function je(e){return e.startsWith("ng-")||e.startsWith("_ng")||/^svelte-[a-z0-9]+$/i.test(e)||/^s-[A-Za-z0-9_-]{8,}$/.test(e)}function ne(e,t){return e.length<=t?e:`${e.slice(0,t-1).trimEnd()}\u2026`}function Oe(e){return e.closest(`[${bt}]`)!==null}function ee(e,t){if(Oe(e))return"[masked]";let n="",o=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let r=o.nextNode();r;r=o.nextNode()){let i=r.parentElement;if(!(i&&/^(SCRIPT|STYLE|NOSCRIPT|TEMPLATE)$/.test(i.tagName))&&!i?.closest(`[${fe}], [${bt}]`)&&(n+=` ${r.nodeValue??""}`,n.length>t*3))break}return ne(U(n.replace(/\s+/g," ").trim()),t)}function ro(e){let t="";for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE&&(t+=` ${n.nodeValue??""}`);return t.replace(/\s+/g," ").trim()}function va(e,t,n,o){if(t==="class"){let r=o(n.split(/\s+/).filter(Boolean));return r.length===0?null:ne(r.join(" "),ba)}return fa.has(t)?ne(Ke(n),120):ne(U(n,{keepEmails:t==="placeholder"}),ga)}function xa(e,t=n=>n.filter(o=>!je(o))){let n=e.tagName.toLowerCase(),o=[],r=new Set,i=a=>{if(o.length>=pa||r.has(a)||ya(a))return;let s=e.getAttribute(a);if(s===null)return;if(r.add(a),s===""){o.push(a);return}let l=va(e,a,s,t);l!==null&&o.push(`${a}="${l.replace(/"/g,"&quot;")}"`)};for(let a of ma)i(a);for(let{name:a}of Array.from(e.attributes))a.startsWith("aria-")&&i(a);return`<${n}${o.length?` ${o.join(" ")}`:""}>`}function io(e,t){let n=e.tagName.toLowerCase(),o=xa(e,t);if(/^(img|input|br|hr|meta|link|source|area|col|embed|wbr)$/.test(n))return ne(o,oo);let r=Array.from(e.children).filter(a=>!a.hasAttribute(fe)),i;if(Oe(e))i="[masked]";else if(r.length===0)i=ne(U(ro(e)),ha);else if(r.length<=2){let a=ne(U(ro(e)),40),s=r.map(l=>{let c=ee(l,30);return`<${l.tagName.toLowerCase()}${c?`>${c}</${l.tagName.toLowerCase()}>`:" \u2026>"}`});i=[a,...s].filter(Boolean).join(" ")}else i=`(${r.length} elements)`;return ne(`${o}${i}</${n}>`,oo)}var We=40,Ea=/^h[1-6]$/;function wa(e){return(e.getAttribute("role")??"").toLowerCase()}function Sa(e){try{let t=getComputedStyle(e),n=t.borderStyle!=="none"&&parseFloat(t.borderWidth)>0;return!!t.boxShadow&&t.boxShadow!=="none"||n&&parseFloat(t.borderRadius)>0}catch{return!1}}function ao(e,t,n="",o="",r=!1,i=!1){switch(t){case"action":return n==="tab"?"Tab":n.startsWith("menuitem")?"Menu item":n==="checkbox"||o==="checkbox"?"Checkbox":n==="radio"||n==="option"||o==="radio"?"Option":n==="switch"?"Switch":e==="a"||n==="link"?"Link":"Button";case"field":return e==="select"||n==="combobox"?"Dropdown":e==="textarea"?"Text area":o==="checkbox"?"Checkbox":o==="radio"?"Option":o==="range"||n==="slider"?"Slider":o==="file"?"File upload":o==="search"||n==="searchbox"?"Search box":/^(date|datetime-local|month|week|time)$/.test(o)?"Date picker":"Text box";case"media":return e==="svg"?"Icon":e==="video"?"Video":e==="audio"?"Audio player":e==="iframe"?"Embedded content":e==="canvas"?"Chart or drawing":"Image";case"text":return Ea.test(e)||n==="heading"?"Heading":e==="li"?"List item":e==="label"?"Label":e==="td"||e==="th"?"Table cell":e==="blockquote"||e==="q"?"Quote":e==="code"||e==="pre"?"Code":"Text";case"section":return e==="html"||e==="body"?"Whole page":e==="main"||n==="main"?"Main content":e==="header"?"Page header":e==="footer"?"Page footer":e==="nav"?"Navigation menu":"Page section";default:return e==="nav"||n==="navigation"||n==="menu"||n==="menubar"?"Menu":e==="header"?"Header":e==="footer"?"Footer":e==="aside"?"Sidebar":e==="form"||n==="form"?"Form":e==="table"||n==="table"||n==="grid"?"Table":e==="ul"||e==="ol"||n==="list"?"List":e==="dialog"||n==="dialog"||n==="alertdialog"?"Pop-up":r?"Card":i?"Section":"Area"}}function Ca(e){let t=e.labels;return t&&t.length?ee(t[0],We):U(e.getAttribute("aria-label")??"")||U(e.getAttribute("placeholder")??"")}function so(e){return e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]')}function ka(e,t){if(Oe(e)||e.tagName==="BODY"||e.tagName==="HTML")return"";let n=U(e.getAttribute("aria-label")??"");switch(t){case"action":return n||ee(e,We)||U(e.getAttribute("title")??"")||U(e.querySelector("img[alt]")?.getAttribute("alt")??"");case"field":return Ca(e);case"media":return U(e.getAttribute("alt")??"")||n||U(e.getAttribute("title")??"");case"text":return ee(e,We);default:{let o=so(e);return n||(o?ee(o,We):"")}}}function lo(e,t){let n=ne(t.replace(/\s+/g," ").trim(),We);return n?`${e} \u201C${n}\u201D`:e}function co(e){let t=e.tagName.toLowerCase(),n=t==="svg"?"media":pt(e),o=wa(e),r=t==="input"?(e.type||"").toLowerCase():"",i=n==="container",a=ao(t,n,o,r,i&&Sa(e),i&&!!so(e));return lo(a,ka(e,n))}function uo(e){let t=e.facts??{},n=ao(e.tag,e.kind,"",(t.type??"").toLowerCase(),!1,!!t.heading),o=t.label||t.heading||t.text||t.alt||"";return lo(n,o)}var zt="__grabby-overlay__",gt="__grabby-label__",Kt="__grabby-styles__",_a=3;function mo(e={}){let t=null,n=null,o=null,r=null,i=null,a=null,s=[],l="";function c(){Y(Kt)||N(Kt,`
15
- #${zt} {
14
+ `}),a.appendChild(o.createTextNode(S))}r.timeEnd("clone node"),await h?.(v),c!==!1&&ce(v)&&(r.time("embed web font"),await tc(v,n),r.timeEnd("embed web font")),r.time("embed node"),ni(v,n);let b=i.length,g=0,p=async()=>{for(;;){let S=i.pop();if(!S)break;try{await S}catch(I){n.log.warn("Failed to run task",I)}d?.(++g,b)}};d?.(g,b),await Promise.all([...Array.from({length:4})].map(p)),r.timeEnd("embed node"),await m?.(v);let x=lc(v,n);return s&&x.insertBefore(s,x.children[0]),a&&x.insertBefore(a,x.children[0]),f&&Jr(n),await y?.(x),x}function lc(e,t){let{width:n,height:o}=t,r=Br(n,o,e.ownerDocument),i=r.ownerDocument.createElementNS(r.namespaceURI,"foreignObject");return i.setAttributeNS(null,"x","0%"),i.setAttributeNS(null,"y","0%"),i.setAttributeNS(null,"width","100%"),i.setAttributeNS(null,"height","100%"),i.append(e),r.appendChild(i),r}async function It(e,t){let n=await ue(e,t),o=await oi(n),r=Gr(o,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=Yr(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(Rt,"defs"),n.svgStyles.clear());let i=Me(r,o.ownerDocument);return await Ll(i,n)}async function cc(e,t){let n=await ue(e,t),{log:o,type:r,quality:i,dpi:a}=n,s=await It(n);o.time("canvas to blob");let l=await Cl(s,r,i);if(["image/png","image/jpeg"].includes(r)&&a){let c=await Al(l.slice(0,33)),d=new Uint8Array(c);return r==="image/png"?d=Pr(d,a):r==="image/jpeg"&&(d=Ir(d,a)),o.timeEnd("canvas to blob"),new Blob([d,l.slice(33)],{type:r})}return o.timeEnd("canvas to blob"),l}async function Ke(e,t){let n=await ue(e,t),{log:o,quality:r,type:i,dpi:a}=n,s=await It(n);o.time("canvas to data url");let l=s.toDataURL(i,r);if(["image/png","image/jpeg"].includes(i)&&a&&Or&&al){let[c,d]=l.split(","),f=0,h=!1;if(i==="image/png"){let x=rl(d);x>=0?(f=Math.ceil((x+28)/3)*4,h=!0):f=33/3*4}else i==="image/jpeg"&&(f=18/3*4);let m=d.substring(0,f),y=d.substring(f),v=window.atob(m),b=new Uint8Array(v.length);for(let x=0;x<b.length;x++)b[x]=v.charCodeAt(x);let g=i==="image/png"?Pr(b,a,h):Ir(b,a),p=window.btoa(String.fromCharCode(...g));l=[c,",",p,y].join("")}return o.timeEnd("canvas to data url"),l}async function ri(e,t){let n=await ue(e,t),{width:o,height:r,ownerDocument:i}=n,a=await Ke(n),s=Br(o,r,i),l=s.ownerDocument.createElementNS(s.namespaceURI,"image");return l.setAttributeNS(null,"href",a),l.setAttributeNS(null,"height","100%"),l.setAttributeNS(null,"width","100%"),s.appendChild(l),Gr(s,n.isEnable("removeControlCharacter"))}async function uc(e,t){let n=await ue(e,t),{ownerDocument:o,width:r,height:i,scale:a,type:s}=n,l=s==="image/svg+xml"?await ri(n):await Ke(n),c=Me(l,o);return c.width=Math.floor(r*a),c.height=Math.floor(i*a),c.style.width=`${r}px`,c.style.height=`${i}px`,c}async function dc(e,t){return Ke(await ue(e,{...t,type:"image/jpeg"}))}async function mc(e,t){let n=await ue(e,t),o=await It(n);return o.getContext("2d").getImageData(0,0,o.width,o.height).data}async function fc(e,t){return Ke(await ue(e,{...t,type:"image/png"}))}async function pc(e,t){return Ke(await ue(e,{...t,type:"image/webp"}))}var Lr,$r,Nr,Mr,kn,tl,nl,ol,Dr,ke,il,Or,al,_n,Fr,Tt,Rn,sl,ll,cl,ul,ce,it,Hr,dl,ot,ml,fl,ze,At,pl,bl,gl,hl,yl,vl,xl,El,wl,Tn,Rt,Tl,Al,Kr,Cr,Fl,Hl,Gl,zl,kr,Wl,ti,Zl,nc,_r,rc,ic,ac,ai=Yi(()=>{"use strict";Lr=112,$r=72,Nr=89,Mr=115;tl="AAlwSFlz",nl="AAAJcEhZ",ol="AAAACXBI";Dr="[modern-screenshot]",ke=typeof window<"u",il=ke&&"Worker"in window,Or=ke&&"atob"in window,al=ke&&"btoa"in window,_n=ke?window.navigator?.userAgent:"",Fr=_n.includes("Chrome"),Tt=_n.includes("AppleWebKit")&&!Fr,Rn=_n.includes("Firefox"),sl=e=>e&&"__CONTEXT__"in e,ll=e=>e.constructor.name==="CSSFontFaceRule",cl=e=>e.constructor.name==="CSSImportRule",ul=e=>e.constructor.name==="CSSLayerBlockRule",ce=e=>e.nodeType===1,it=e=>typeof e.className=="object",Hr=e=>e.tagName==="image",dl=e=>e.tagName==="use",ot=e=>ce(e)&&typeof e.style<"u"&&!it(e),ml=e=>e.nodeType===8,fl=e=>e.nodeType===3,ze=e=>e.tagName==="IMG",At=e=>e.tagName==="VIDEO",pl=e=>e.tagName==="CANVAS",bl=e=>e.tagName==="TEXTAREA",gl=e=>e.tagName==="INPUT",hl=e=>e.tagName==="STYLE",yl=e=>e.tagName==="SCRIPT",vl=e=>e.tagName==="SELECT",xl=e=>e.tagName==="SLOT",El=e=>e.tagName==="IFRAME",wl=(...e)=>console.warn(Dr,...e);Tn=e=>e.startsWith("data:");Rt="http://www.w3.org/2000/svg";Tl=e=>zr(e,"dataUrl"),Al=e=>zr(e,"arrayBuffer");Kr=(function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();Cr=0;Fl=["width","height","-webkit-text-fill-color"],Hl=["stroke","fill"];Gl=["::before","::after"],zl=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];kr=new Set(["symbol"]);Wl=/^[\w-:]+$/;ti=/url\((['"]?)([^'"]+?)\1\)/g;Zl=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];nc=/(\/\*[\s\S]*?\*\/)/g,_r=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;rc=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,ic=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;ac=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i});function Xn(e){let t=new Set,n={active:!1,frozen:!1,hoveredElement:null,options:e,toolbar:{visible:e.showToolbar,themeMode:e.themeMode,comments:[]}},o=new Proxy(n,{set(r,i,a){let s=i;return r[s]===a||(Reflect.set(r,s,a),t.forEach(l=>l(o,s))),!0}});return{state:o,subscribe(r){return t.add(r),()=>t.delete(r)}}}var qn="72px",ve="68px";var Ut="grabby-root",fe=null,_e=null,Ht,pe=new Map;function qi(e){try{return"adoptedStyleSheets"in e&&typeof CSSStyleSheet=="function"&&typeof CSSStyleSheet.prototype.replaceSync=="function"}catch{return!1}}function Zn(e){Ht=e}function D(){if(_e&&fe?.isConnected)return _e;fe=document.createElement(Ut),fe.setAttribute("data-grabby-ignore",""),_e=fe.attachShadow({mode:"open"}),document.documentElement.appendChild(fe);for(let[e,t]of Array.from(pe))t.target==="shadow"&&(pe.delete(e),M(e,t.css));return _e}function M(e,t,n="shadow"){let o=pe.get(e);if(o){o.css=t,o.sheet&&o.sheet.replaceSync(t),o.el&&(o.el.textContent=t);return}let r=n==="shadow"?D():document;if(qi(r)){let a=new CSSStyleSheet;a.replaceSync(t),r.adoptedStyleSheets=[...r.adoptedStyleSheets,a],pe.set(e,{target:n,css:t,sheet:a});return}let i=document.createElement("style");i.setAttribute("data-grabby-style",e),Ht&&(i.nonce=Ht),i.textContent=t,n==="shadow"?D().prepend(i):document.head.appendChild(i),pe.set(e,{target:n,css:t,el:i})}function q(e){return pe.has(e)}function P(e){let t=pe.get(e);if(t&&(pe.delete(e),t.el&&t.el.remove(),t.sheet)){let n=t.target==="shadow"?_e:document;n&&(n.adoptedStyleSheets=n.adoptedStyleSheets.filter(o=>o!==t.sheet))}}function Jn(e){return!e||!fe?!1:e===fe?!0:e.getRootNode()===_e}function xe(e){let n=(typeof e.composedPath=="function"?e.composedPath():[])[0]??e.target;return n instanceof Element?n:null}function Bt(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}function Re(e){if(!e)return!1;let t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable===!0}function Qn(){for(let e of Array.from(pe.keys()))P(e);fe?.remove(),fe=null,_e=null}var Zi=new Set(["BUTTON","A","SUMMARY"]),Ji=new Set(["button","link","tab","menuitem","menuitemcheckbox","menuitemradio","switch","option","checkbox","radio"]),to=new Set(["button","submit","reset","image"]),Qi=new Set(["INPUT","SELECT","TEXTAREA"]),ea=new Set(["textbox","combobox","searchbox","spinbutton","slider"]),ta=new Set(["IMG","SVG","VIDEO","PICTURE","CANVAS","IFRAME","AUDIO"]),na=new Set(["H1","H2","H3","H4","H5","H6","P","SPAN","LABEL","LI","STRONG","EM","B","I","SMALL","BLOCKQUOTE","CODE","PRE","TD","TH","DT","DD","FIGCAPTION","LEGEND","CAPTION","Q","CITE","MARK","TIME"]),no=new Set(["HTML","BODY","MAIN"]),oa=new Set(["HEADER","FOOTER","NAV","ASIDE"]),ra=.6;function gt(e){return(e.getAttribute("role")??"").toLowerCase()}function Gt(e){return Zi.has(e.tagName)?e.tagName!=="A"||e.hasAttribute("href")||e.hasAttribute("role"):e.tagName==="INPUT"&&to.has(e.type)?!0:Ji.has(gt(e))}function zt(e){return e.tagName==="INPUT"?!to.has(e.type):Qi.has(e.tagName)||e.isContentEditable&&e.getAttribute("contenteditable")!==null?!0:ea.has(gt(e))}function eo(e){let t=e.getBoundingClientRect(),n=window.innerWidth||document.documentElement.clientWidth,o=window.innerHeight||document.documentElement.clientHeight;if(!n||!o)return!1;let r=Math.max(0,Math.min(t.right,n)-Math.max(t.left,0)),i=Math.max(0,Math.min(t.bottom,o)-Math.max(t.top,0));return r*i/(n*o)>=ra}function ia(e){return e.children.length>0}function ht(e){return no.has(e.tagName)?"section":ta.has(e.tagName)?"media":zt(e)?"field":Gt(e)?"action":oa.has(e.tagName)||gt(e)==="main"||gt(e)==="region"?eo(e)?"section":"container":na.has(e.tagName)||!ia(e)&&(e.textContent??"").trim()?"text":eo(e)?"section":"container"}var aa=3;function oo(e){if(Gt(e)||zt(e))return e;let t=e.parentElement;for(let n=0;t&&n<aa;n++){if(Gt(t)||zt(t))return t;if(no.has(t.tagName))break;t=t.parentElement}return e}var sa=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,la=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g,ca=/\b(Bearer|Basic|Token)\s+[A-Za-z0-9._~+/=-]{8,}/gi,ua=/\b\d(?:[ -]?\d){8,}\b/g,da=/\b[A-Za-z0-9_-]{32,}\b/g,ma=/([?&#](?:access_token|id_token|token|key|api_key|apikey|secret|password|pass|auth|code|session|sig|signature)=)[^&#\s]*/gi;function U(e,t={}){if(!e)return e;let n=e.replace(ma,"$1[redacted]").replace(la,"[token]").replace(ca,"$1 [token]");return(t.keepEmails?n:n.replace(sa,"[email]")).replace(ua,"[number]").replace(da,o=>/\d/.test(o)&&/[A-Za-z]/.test(o)?"[token]":o)}function Vt(e,t=[]){let n=e.pathname||"/";if(t.length>0&&e.search){let o=new URLSearchParams(e.search),r=new URLSearchParams;for(let a of t){let s=o.get(a);s!==null&&r.set(a,s)}let i=r.toString();i&&(n+=`?${i}`)}return e.hash.startsWith("#/")&&(n+=e.hash.split("?")[0]),U(n)}function We(e,t=typeof location<"u"?location.href:"http://localhost/"){try{let n=new URL(e,t);if(n.protocol==="javascript:"||n.protocol==="data:"||n.protocol==="vbscript:")return`${n.protocol}\u2026`;let o=new URL(t),r=n.pathname+(n.hash.startsWith("#/")?n.hash:"");return U(n.origin===o.origin?r:`${n.host}${r}`)}catch{return U(e.split(/[?#]/)[0])}}var yt="data-grabby-mask",be="data-grabby-ignore",fa=["id","class","role","aria-label","data-testid","data-test","data-cy","name","type","href","src","alt","placeholder","title","for","aria-expanded","aria-selected","disabled"],pa=new Set(["href","src"]),ba=8,ga=60,ha=80,ya=80,ro=300;function va(e){return e.startsWith("_ng")||e.startsWith("ng-reflect-")||e.startsWith("data-v-")||e.startsWith("data-grabby-")||e.startsWith("data-svelte")||e==="style"||e==="value"||e.startsWith("on")}function Ye(e){return e.startsWith("ng-")||e.startsWith("_ng")||/^svelte-[a-z0-9]+$/i.test(e)||/^s-[A-Za-z0-9_-]{8,}$/.test(e)}function re(e,t){return e.length<=t?e:`${e.slice(0,t-1).trimEnd()}\u2026`}function He(e){return e.closest(`[${yt}]`)!==null}function ne(e,t){if(He(e))return"[masked]";let n="",o=e.ownerDocument.createTreeWalker(e,NodeFilter.SHOW_TEXT);for(let r=o.nextNode();r;r=o.nextNode()){let i=r.parentElement;if(!(i&&/^(SCRIPT|STYLE|NOSCRIPT|TEMPLATE)$/.test(i.tagName))&&!i?.closest(`[${be}], [${yt}]`)&&(n+=` ${r.nodeValue??""}`,n.length>t*3))break}return re(U(n.replace(/\s+/g," ").trim()),t)}function io(e){let t="";for(let n of Array.from(e.childNodes))n.nodeType===Node.TEXT_NODE&&(t+=` ${n.nodeValue??""}`);return t.replace(/\s+/g," ").trim()}function xa(e,t,n,o){if(t==="class"){let r=o(n.split(/\s+/).filter(Boolean));return r.length===0?null:re(r.join(" "),ga)}return pa.has(t)?re(We(n),120):re(U(n,{keepEmails:t==="placeholder"}),ha)}function Ea(e,t=n=>n.filter(o=>!Ye(o))){let n=e.tagName.toLowerCase(),o=[],r=new Set,i=a=>{if(o.length>=ba||r.has(a)||va(a))return;let s=e.getAttribute(a);if(s===null)return;if(r.add(a),s===""){o.push(a);return}let l=xa(e,a,s,t);l!==null&&o.push(`${a}="${l.replace(/"/g,"&quot;")}"`)};for(let a of fa)i(a);for(let{name:a}of Array.from(e.attributes))a.startsWith("aria-")&&i(a);return`<${n}${o.length?` ${o.join(" ")}`:""}>`}function ao(e,t){let n=e.tagName.toLowerCase(),o=Ea(e,t);if(/^(img|input|br|hr|meta|link|source|area|col|embed|wbr)$/.test(n))return re(o,ro);let r=Array.from(e.children).filter(a=>!a.hasAttribute(be)),i;if(He(e))i="[masked]";else if(r.length===0)i=re(U(io(e)),ya);else if(r.length<=2){let a=re(U(io(e)),40),s=r.map(l=>{let c=ne(l,30);return`<${l.tagName.toLowerCase()}${c?`>${c}</${l.tagName.toLowerCase()}>`:" \u2026>"}`});i=[a,...s].filter(Boolean).join(" ")}else i=`(${r.length} elements)`;return re(`${o}${i}</${n}>`,ro)}var Xe=40,wa=/^h[1-6]$/;function Sa(e){return(e.getAttribute("role")??"").toLowerCase()}function Ca(e){try{let t=getComputedStyle(e),n=t.borderStyle!=="none"&&parseFloat(t.borderWidth)>0;return!!t.boxShadow&&t.boxShadow!=="none"||n&&parseFloat(t.borderRadius)>0}catch{return!1}}function so(e,t,n="",o="",r=!1,i=!1){switch(t){case"action":return n==="tab"?"Tab":n.startsWith("menuitem")?"Menu item":n==="checkbox"||o==="checkbox"?"Checkbox":n==="radio"||n==="option"||o==="radio"?"Option":n==="switch"?"Switch":e==="a"||n==="link"?"Link":"Button";case"field":return e==="select"||n==="combobox"?"Dropdown":e==="textarea"?"Text area":o==="checkbox"?"Checkbox":o==="radio"?"Option":o==="range"||n==="slider"?"Slider":o==="file"?"File upload":o==="search"||n==="searchbox"?"Search box":/^(date|datetime-local|month|week|time)$/.test(o)?"Date picker":"Text box";case"media":return e==="svg"?"Icon":e==="video"?"Video":e==="audio"?"Audio player":e==="iframe"?"Embedded content":e==="canvas"?"Chart or drawing":"Image";case"text":return wa.test(e)||n==="heading"?"Heading":e==="li"?"List item":e==="label"?"Label":e==="td"||e==="th"?"Table cell":e==="blockquote"||e==="q"?"Quote":e==="code"||e==="pre"?"Code":"Text";case"section":return e==="html"||e==="body"?"Whole page":e==="main"||n==="main"?"Main content":e==="header"?"Page header":e==="footer"?"Page footer":e==="nav"?"Navigation menu":"Page section";default:return e==="nav"||n==="navigation"||n==="menu"||n==="menubar"?"Menu":e==="header"?"Header":e==="footer"?"Footer":e==="aside"?"Sidebar":e==="form"||n==="form"?"Form":e==="table"||n==="table"||n==="grid"?"Table":e==="ul"||e==="ol"||n==="list"?"List":e==="dialog"||n==="dialog"||n==="alertdialog"?"Pop-up":r?"Card":i?"Section":"Area"}}function ka(e){let t=e.labels;return t&&t.length?ne(t[0],Xe):U(e.getAttribute("aria-label")??"")||U(e.getAttribute("placeholder")??"")}function lo(e){return e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]')}function Ta(e,t){if(He(e)||e.tagName==="BODY"||e.tagName==="HTML")return"";let n=U(e.getAttribute("aria-label")??"");switch(t){case"action":return n||ne(e,Xe)||U(e.getAttribute("title")??"")||U(e.querySelector("img[alt]")?.getAttribute("alt")??"");case"field":return ka(e);case"media":return U(e.getAttribute("alt")??"")||n||U(e.getAttribute("title")??"");case"text":return ne(e,Xe);default:{let o=lo(e);return n||(o?ne(o,Xe):"")}}}function co(e,t){let n=re(t.replace(/\s+/g," ").trim(),Xe);return n?`${e} \u201C${n}\u201D`:e}function uo(e){let t=e.tagName.toLowerCase(),n=t==="svg"?"media":ht(e),o=Sa(e),r=t==="input"?(e.type||"").toLowerCase():"",i=n==="container",a=so(t,n,o,r,i&&Ca(e),i&&!!lo(e));return co(a,Ta(e,n))}function mo(e){let t=e.facts??{},n=so(e.tag,e.kind,"",(t.type??"").toLowerCase(),!1,!!t.heading),o=t.label||t.heading||t.text||t.alt||"";return co(n,o)}var Kt="__grabby-overlay__",vt="__grabby-label__",jt="__grabby-styles__",Ra=3;function fo(e={}){let t=null,n=null,o=null,r=null,i=null,a=null,s=[],l="";function c(){q(jt)||M(jt,`
15
+ #${Kt} {
16
16
  position: fixed;
17
17
  pointer-events: none;
18
18
  z-index: ${2147483646};
@@ -21,7 +21,7 @@
21
21
  transition: top 0.05s ease, left 0.05s ease, width 0.05s ease, height 0.05s ease;
22
22
  box-sizing: border-box;
23
23
  }
24
- #${gt} {
24
+ #${vt} {
25
25
  position: fixed;
26
26
  pointer-events: none;
27
27
  z-index: ${2147483647};
@@ -36,12 +36,12 @@
36
36
  overflow: hidden;
37
37
  text-overflow: ellipsis;
38
38
  }
39
- #${gt}.grabby-plain {
39
+ #${vt}.grabby-plain {
40
40
  font: 600 12px/1.4 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
41
41
  padding: 3px 8px;
42
42
  border-radius: 6px;
43
43
  }
44
- `)}function d(){t||(c(),t=document.createElement("div"),t.id=zt,D().appendChild(t)),n||(n=document.createElement("div"),n.id=gt,e.plainLabels&&(n.className="grabby-plain"),D().appendChild(n))}function f(){if(!r||!t||!n)return;let v=r.getBoundingClientRect();if(v.width===0&&v.height===0&&!r.isConnected){t.style.display="none",n.style.display="none";return}t.style.top=`${v.top}px`,t.style.left=`${v.left}px`,t.style.width=`${v.width}px`,t.style.height=`${v.height}px`,t.style.display="block";let g=`<${r.tagName.toLowerCase()}>`;if(e.plainLabels){n.textContent=`${l} \xB7 Click to select`,h(v);return}if(s.length>0){let p=s.slice(0,_a);g+=` .${p.join(".")}${s.length>p.length?"\u2026":""}`}i&&(g+=` in ${i}`),a&&(g+=` \u2014 ${a}`),n.textContent=g,h(v)}function h(v){if(!n)return;let b=20,g=4,p=v.top-b-g;p<0&&(p=v.bottom+g);let x=v.left;n.style.top=`${p}px`,n.style.left=`${x}px`,n.style.display="block";let C=n.getBoundingClientRect(),I=document.documentElement.clientWidth;C.right>I&&(x=Math.max(0,I-C.width),n.style.left=`${x}px`)}function m(){f(),o=requestAnimationFrame(m)}function y(){o!==null&&(cancelAnimationFrame(o),o=null)}return{show(v,b,g,p){d(),r=v,i=b,e.plainLabels&&(l=co(v)),a=g??null,s=p??[],y(),m()},hide(){y(),r=null,i=null,a=null,s=[],t&&(t.style.display="none"),n&&(n.style.display="none")},isOverlayElement(v){return v===t||v===n||v.id===zt||v.id===gt},dispose(){y(),r=null,i=null,a=null,s=[],t?.remove(),n?.remove(),M(Kt),t=null,n=null}}}var jt="__grabby-crosshair-styles__",fo="__grabby-crosshair-cursor__",Wt="__grabby-crosshair-h__",Yt="__grabby-crosshair-v__";function bo(){let e=null,t=null,n=!1,o=!1;function r(){Y(jt)||(N(jt,`
44
+ `)}function d(){t||(c(),t=document.createElement("div"),t.id=Kt,D().appendChild(t)),n||(n=document.createElement("div"),n.id=vt,e.plainLabels&&(n.className="grabby-plain"),D().appendChild(n))}function f(){if(!r||!t||!n)return;let v=r.getBoundingClientRect();if(v.width===0&&v.height===0&&!r.isConnected){t.style.display="none",n.style.display="none";return}t.style.top=`${v.top}px`,t.style.left=`${v.left}px`,t.style.width=`${v.width}px`,t.style.height=`${v.height}px`,t.style.display="block";let g=`<${r.tagName.toLowerCase()}>`;if(e.plainLabels){n.textContent=`${l} \xB7 Click to select`,h(v);return}if(s.length>0){let p=s.slice(0,Ra);g+=` .${p.join(".")}${s.length>p.length?"\u2026":""}`}i&&(g+=` in ${i}`),a&&(g+=` \u2014 ${a}`),n.textContent=g,h(v)}function h(v){if(!n)return;let b=20,g=4,p=v.top-b-g;p<0&&(p=v.bottom+g);let x=v.left;n.style.top=`${p}px`,n.style.left=`${x}px`,n.style.display="block";let S=n.getBoundingClientRect(),I=document.documentElement.clientWidth;S.right>I&&(x=Math.max(0,I-S.width),n.style.left=`${x}px`)}function m(){f(),o=requestAnimationFrame(m)}function y(){o!==null&&(cancelAnimationFrame(o),o=null)}return{show(v,b,g,p){d(),r=v,i=b,e.plainLabels&&(l=uo(v)),a=g??null,s=p??[],y(),m()},hide(){y(),r=null,i=null,a=null,s=[],t&&(t.style.display="none"),n&&(n.style.display="none")},isOverlayElement(v){return v===t||v===n||v.id===Kt||v.id===vt},dispose(){y(),r=null,i=null,a=null,s=[],t?.remove(),n?.remove(),P(jt),t=null,n=null}}}var Wt="__grabby-crosshair-styles__",po="__grabby-crosshair-cursor__",Yt="__grabby-crosshair-h__",Xt="__grabby-crosshair-v__";function bo(){let e=null,t=null,n=!1,o=!1;function r(){q(Wt)||(M(Wt,`
45
45
  .grabby-crosshair-line {
46
46
  position: fixed;
47
47
  pointer-events: none;
@@ -50,17 +50,17 @@
50
50
  opacity: 0.25;
51
51
  transition: none;
52
52
  }
53
- #${Wt} {
53
+ #${Yt} {
54
54
  left: 0;
55
55
  right: 0;
56
56
  height: 1px;
57
57
  }
58
- #${Yt} {
58
+ #${Xt} {
59
59
  top: 0;
60
60
  bottom: 0;
61
61
  width: 1px;
62
62
  }
63
- `),N(fo,"body.grabby-crosshair-active:not(.grabby-crosshair-held) { cursor: crosshair !important; }","document"))}function i(){e||(r(),e=document.createElement("div"),e.id=Wt,e.className="grabby-crosshair-line",D().appendChild(e)),t||(t=document.createElement("div"),t.id=Yt,t.className="grabby-crosshair-line",D().appendChild(t))}function a(){e&&(e.style.top="-10px"),t&&(t.style.left="-10px")}function s(l){o||(e&&(e.style.top=`${l.clientY}px`),t&&(t.style.left=`${l.clientX}px`))}return{activate(){n||(n=!0,i(),document.body.classList.add("grabby-crosshair-active"),document.addEventListener("mousemove",s,!0))},deactivate(){n&&(n=!1,document.body.classList.remove("grabby-crosshair-active"),document.removeEventListener("mousemove",s,!0),a())},hold(l){o!==l&&(o=l,document.body.classList.toggle("grabby-crosshair-held",l),l&&a())},isCrosshairElement(l){return l===e||l===t||l.id===Wt||l.id===Yt},dispose(){this.hold(!1),this.deactivate(),e?.remove(),t?.remove(),M(jt),M(fo),e=null,t=null}}}function Ra(e,t){for(let n of t)n==null||n===!1||e.appendChild(typeof n=="object"?n:document.createTextNode(String(n)))}function S(e,t,...n){let o=document.createElement(e);if(t)for(let[r,i]of Object.entries(t))i==null||i===!1||(r==="class"?o.className=String(i):r==="style"?Object.assign(o.style,i):r==="dataset"?Object.assign(o.dataset,i):r.startsWith("on")&&typeof i=="function"?o.addEventListener(r.slice(2).toLowerCase(),i):r in o&&typeof i!="string"?o[r]=i:o.setAttribute(r,i===!0?"":String(i)));return Ra(o,n),o}var go="http://www.w3.org/2000/svg";function se(e,t){let n=String(e.size??16),o=document.createElementNS(go,"svg");o.setAttribute("width",n),o.setAttribute("height",n),o.setAttribute("viewBox",e.viewBox??"0 0 16 16"),o.setAttribute("fill",e.fill??"none"),o.setAttribute("aria-hidden","true"),(e.stroke!==void 0||e.fill===void 0)&&(o.setAttribute("stroke",e.stroke??"currentColor"),o.setAttribute("stroke-width",e.strokeWidth??"1.5"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round")),t&&o.setAttribute("class",t);for(let r of e.shapes){let i=document.createElementNS(go,r.tag);for(let[a,s]of Object.entries(r.attrs))i.setAttribute(a,s);o.appendChild(i)}return o}function _e(...e){return e.map(t=>({tag:"path",attrs:{d:t}}))}var Xt={shapes:_e("M5.5 7V3.5a1 1 0 0 1 2 0V7","M7.5 6.5V2.5a1 1 0 0 1 2 0v4","M9.5 7V3.5a1 1 0 0 1 2 0V8","M5.5 7V5.5a1 1 0 0 0-2 0V9a4 4 0 0 0 4 4h1.5a4 4 0 0 0 4-4V6a1 1 0 0 0-2 0")},ho={shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"6"}},..._e("M8 4.5V8l2.5 1.5")]},yo={shapes:_e("M8 2v5","M4.5 4a5.5 5.5 0 1 0 7 0")},ht={shapes:_e("M4 4l8 8M12 4l-8 8")},vo={fill:"none",shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"7",fill:"#22c55e"}},{tag:"path",attrs:{d:"M5 8l2 2 4-4",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}]},xo={viewBox:"0 0 10 10",size:10,fill:"none",shapes:[{tag:"path",attrs:{d:"M2 5.5l2 2 4-4",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}]};var j="__grabby-toast__",Zt="__grabby-toast-styles__",ie=null;function Ia(){Y(Zt)||N(Zt,`
63
+ `),M(po,"body.grabby-crosshair-active:not(.grabby-crosshair-held) { cursor: crosshair !important; }","document"))}function i(){e||(r(),e=document.createElement("div"),e.id=Yt,e.className="grabby-crosshair-line",D().appendChild(e)),t||(t=document.createElement("div"),t.id=Xt,t.className="grabby-crosshair-line",D().appendChild(t))}function a(){e&&(e.style.top="-10px"),t&&(t.style.left="-10px")}function s(l){o||(e&&(e.style.top=`${l.clientY}px`),t&&(t.style.left=`${l.clientX}px`))}return{activate(){n||(n=!0,i(),document.body.classList.add("grabby-crosshair-active"),document.addEventListener("mousemove",s,!0))},deactivate(){n&&(n=!1,document.body.classList.remove("grabby-crosshair-active"),document.removeEventListener("mousemove",s,!0),a())},hold(l){o!==l&&(o=l,document.body.classList.toggle("grabby-crosshair-held",l),l&&a())},isCrosshairElement(l){return l===e||l===t||l.id===Yt||l.id===Xt},dispose(){this.hold(!1),this.deactivate(),e?.remove(),t?.remove(),P(Wt),P(po),e=null,t=null}}}function Ia(e,t){for(let n of t)n==null||n===!1||e.appendChild(typeof n=="object"?n:document.createTextNode(String(n)))}function w(e,t,...n){let o=document.createElement(e);if(t)for(let[r,i]of Object.entries(t))i==null||i===!1||(r==="class"?o.className=String(i):r==="style"?Object.assign(o.style,i):r==="dataset"?Object.assign(o.dataset,i):r.startsWith("on")&&typeof i=="function"?o.addEventListener(r.slice(2).toLowerCase(),i):r in o&&typeof i!="string"?o[r]=i:o.setAttribute(r,i===!0?"":String(i)));return Ia(o,n),o}var go="http://www.w3.org/2000/svg";function le(e,t){let n=String(e.size??16),o=document.createElementNS(go,"svg");o.setAttribute("width",n),o.setAttribute("height",n),o.setAttribute("viewBox",e.viewBox??"0 0 16 16"),o.setAttribute("fill",e.fill??"none"),o.setAttribute("aria-hidden","true"),(e.stroke!==void 0||e.fill===void 0)&&(o.setAttribute("stroke",e.stroke??"currentColor"),o.setAttribute("stroke-width",e.strokeWidth??"1.5"),o.setAttribute("stroke-linecap","round"),o.setAttribute("stroke-linejoin","round")),t&&o.setAttribute("class",t);for(let r of e.shapes){let i=document.createElementNS(go,r.tag);for(let[a,s]of Object.entries(r.attrs))i.setAttribute(a,s);o.appendChild(i)}return o}function Ie(...e){return e.map(t=>({tag:"path",attrs:{d:t}}))}var Zt={shapes:Ie("M5.5 7V3.5a1 1 0 0 1 2 0V7","M7.5 6.5V2.5a1 1 0 0 1 2 0v4","M9.5 7V3.5a1 1 0 0 1 2 0V8","M5.5 7V5.5a1 1 0 0 0-2 0V9a4 4 0 0 0 4 4h1.5a4 4 0 0 0 4-4V6a1 1 0 0 0-2 0")},ho={shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"6"}},...Ie("M8 4.5V8l2.5 1.5")]},yo={shapes:Ie("M8 2v5","M4.5 4a5.5 5.5 0 1 0 7 0")},xt={shapes:Ie("M4 4l8 8M12 4l-8 8")},vo={fill:"none",shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"7",fill:"#22c55e"}},{tag:"path",attrs:{d:"M5 8l2 2 4-4",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}]},xo={viewBox:"0 0 10 10",size:10,fill:"none",shapes:[{tag:"path",attrs:{d:"M2 5.5l2 2 4-4",stroke:"#fff","stroke-width":"1.5","stroke-linecap":"round","stroke-linejoin":"round"}}]};var j="__grabby-toast__",Qt="__grabby-toast-styles__",ae=null;function La(){q(Qt)||M(Qt,`
64
64
  #${j} {
65
65
  position: fixed;
66
66
  bottom: var(--grabby-toast-bottom, 24px);
@@ -167,7 +167,7 @@
167
167
  text-decoration: underline;
168
168
  color: var(--grabby-accent, #2563eb);
169
169
  }
170
- `)}var ve=null;function $a(){return ve?.isConnected||(Ia(),ve=S("div",{id:j,role:"status","aria-live":"polite"}),D().appendChild(ve)),ve}function La(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}function qt(e,t){return S("div",{class:"grabby-toast-row"},S("span",{class:"grabby-toast-label"},e),typeof t=="string"?S("span",{class:"grabby-toast-value"},t):t)}function te(e,t={}){let n=$a(),{detail:o,actions:r}=t,i=t.duration??(r?.length?8e3:3500),a=[S("div",{class:"grabby-toast-header"},se(vo,"grabby-toast-icon"),S("span",{class:"grabby-toast-title"},e))];if(o){let s=S("div",{class:"grabby-toast-details"});if(o.componentName&&s.appendChild(qt("Component",o.componentName)),o.filePath){let l=o.line!=null?`${o.filePath}:${o.line}`:o.filePath;s.appendChild(qt("File",S("a",{class:"grabby-toast-file-link",href:La(o.filePath,o.line,o.column),title:"Open in VS Code"},l)))}o.cssClasses&&o.cssClasses.length>0&&s.appendChild(qt("Classes",o.cssClasses.map(l=>`.${l}`).join(" "))),a.push(s)}r?.length&&a[0].appendChild(S("span",{class:"grabby-toast-actions"},...r.map(s=>S("button",{type:"button",class:s.primary?"grabby-toast-action grabby-toast-action-primary":"grabby-toast-action",onclick:l=>{l.stopPropagation(),Na(),s.onClick()}},s.label)))),n.replaceChildren(...a),ie&&(clearTimeout(ie),ie=null),n.classList.remove("grabby-toast-visible"),n.offsetHeight,n.classList.add("grabby-toast-visible"),ie=setTimeout(()=>{n.classList.remove("grabby-toast-visible"),ie=null},i)}function Na(){ie&&(clearTimeout(ie),ie=null),ve?.classList.remove("grabby-toast-visible")}function Eo(){ie&&(clearTimeout(ie),ie=null),ve?.remove(),ve=null,M(Zt)}function So(e){return Array.from(e).filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))}function wo(e){if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(e);let t="";for(let n=0;n<e.length;n++){let o=e.charAt(n),r=e.charCodeAt(n);if(r===0){t+="\uFFFD";continue}if(r>=1&&r<=31||r===127||n===0&&r>=48&&r<=57||n===1&&r>=48&&r<=57&&e.charCodeAt(0)===45){t+=`\\${r.toString(16)} `;continue}if(n===0&&e.length===1&&r===45){t+=`\\${o}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){t+=o;continue}t+=`\\${o}`}return t}function Fe(e,t=document){if(!e)return null;try{return t.querySelector(e)}catch{return null}}var Ma=["data-testid","data-test","data-cy","data-qa"],Pa=8;function yt(e,t){try{let n=t.ownerDocument.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}function Da(e){let t=e.tagName.toLowerCase(),n=e.parentElement;if(!n)return t;let o=Array.from(n.children).filter(r=>r.tagName===e.tagName);return o.length===1?t:`${t}:nth-of-type(${o.indexOf(e)+1})`}function Co(e){for(let o of Ma){let r=e.getAttribute(o);if(r){let i=`[${o}="${r.replace(/["\\]/g,"\\$&")}"]`;if(yt(i,e))return i}}if(e.id){let o=`#${wo(e.id)}`;if(yt(o,e))return o}let t=[],n=e;for(;n&&t.length<Pa;){if(n!==e&&n.id){let r=`#${wo(n.id)}`;if(yt(r,n)){t.unshift(r);break}}t.unshift(Da(n));let o=t.join(" > ");if(yt(o,e))return o;if(n.tagName==="BODY"||n.tagName==="HTML")break;n=n.parentElement}return t.join(" > ")}function ko(e){let t=null,n=null,o=!1;function r(f){let h=e.getComponentResolver();return h?h(f)?.name??null:null}function i(f){let h=e.getSourceResolver();if(!h)return null;let m=h(f);if(!m?.filePath)return null;let y=m.filePath;return m.line!=null&&(y+=`:${m.line}`),y}function a(f,h){let m=e.getFreezeElement?.();m&&(m.style.pointerEvents="none");let y=document.elementFromPoint(f,h);return m&&(m.style.pointerEvents="auto"),y}function s(f,h,m){let y=a(f,h);return!y||y.closest(`[${fe}]`)?y&&e.isToolbarElement?.(y)?y:null:m?y:no(y)}function l(f){let h=r(f),m=i(f),y=So(f.classList);e.overlay.show(f,h,m,y)}function c(f){if(n)return;let h=s(f.clientX,f.clientY,f.shiftKey);!h||e.overlay.isOverlayElement(h)||e.crosshair.isCrosshairElement(h)||e.isToolbarElement?.(h)||h!==t&&(t=h,l(h),e.onHover(h))}function d(f){let h=ye(f);if(h&&e.isToolbarElement?.(h))return;let m=a(f.clientX,f.clientY);m&&(e.isToolbarElement?.(m)||e.crosshair.isCrosshairElement(m))||(f.preventDefault(),f.stopPropagation(),!n&&t&&e.onSelect(t,{x:f.clientX,y:f.clientY}))}return{activate(){o||(o=!0,e.crosshair.activate(),document.addEventListener("mousemove",c,!0),document.addEventListener("click",d,!0))},deactivate(){o&&(o=!1,t=null,n=null,e.crosshair.hold(!1),e.crosshair.deactivate(),document.removeEventListener("mousemove",c,!0),document.removeEventListener("click",d,!0),e.overlay.hide(),e.onHover(null))},hold(f){o&&(n=f,t=f,e.crosshair.hold(!0),l(f))},release(){n&&(n=null,e.crosshair.hold(!1))},isHolding(){return n!==null},getHoveredElement(){return t},dispose(){this.deactivate()}}}function To(e){let t=e.split("+").map(o=>o.trim()),n={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let o of t){let r=o.toLowerCase();r==="meta"||r==="cmd"||r==="command"?n.meta=!0:r==="ctrl"||r==="control"?n.ctrl=!0:r==="shift"?n.shift=!0:r==="alt"||r==="option"?n.alt=!0:n.key=r}return n}function Ao(e,t){return e.key&&e.key.toLowerCase()===t?!0:e.code?/^[a-z]$/.test(t)?e.code===`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?e.code===`Digit${t}`:!1:!1}function Oa(e,t){return t.meta&&!e.metaKey||t.ctrl&&!e.ctrlKey||t.shift&&!e.shiftKey||t.alt&&!e.altKey?!1:Ao(e,t.key)}function _o(e){let t=null,n=!1,o=!1,r=!1;function i(s){if(!e.getEnableInInputs()&&Ae(ye(s)))return;let l=To(e.getActivationKey());if(!Oa(s,l))return;let c=e.getActivationMode(),d=e.getKeyHoldDuration();if(c==="hold"){if(s.preventDefault(),n)return;if(d>0){if(t)return;t=setTimeout(()=>{n=!0,e.onActivate()},d)}else n=!0,e.onActivate()}else s.preventDefault(),o=!0}function a(s){let l=To(e.getActivationKey());if(!Ao(s,l.key))return;if(e.getActivationMode()==="hold")t&&(clearTimeout(t),t=null),n&&(n=!1,e.onDeactivate());else{if(!o)return;o=!1,e.isActive()?e.onDeactivate():e.onActivate()}}return{start(){r||(r=!0,document.addEventListener("keydown",i,!0),document.addEventListener("keyup",a,!0))},stop(){r&&(r=!1,t&&(clearTimeout(t),t=null),n=!1,o=!1,document.removeEventListener("keydown",i,!0),document.removeEventListener("keyup",a,!0))},dispose(){this.stop()}}}function Ro(){let e=new Map,t=new Map;return{register(n,o){if(e.has(n.name)&&this.unregister(n.name),e.set(n.name,n),n.setup){let r=n.setup(o);r&&t.set(n.name,r)}},unregister(n){let o=t.get(n);o&&(o(),t.delete(n)),e.delete(n)},callHook(n,...o){for(let r of e.values()){let i=r.hooks?.[n];if(i)try{i(...o)}catch(a){console.warn(`[grabby] Plugin "${r.name}" hook "${n}" threw:`,a)}}},callTransformHook(n,o){let r=n;for(let i of e.values()){let a=i.hooks?.transformCopyContent;if(a)try{r=a(r,o)}catch(s){console.warn(`[grabby] Plugin "${i.name}" transformCopyContent threw:`,s)}}return r},getPlugins(){return Array.from(e.values())},dispose(){for(let n of t.values())try{n()}catch{}t.clear(),e.clear()}}}function Fa(e){try{let t=new URL(e,typeof location<"u"?location.href:void 0);return t.protocol==="https:"?!0:t.protocol==="http:"&&/^(localhost|127\.0\.0\.1|\[::1\])$/.test(t.hostname)}catch{return!1}}function Io(e){return Fa(e)?{name:"webhook",hooks:{onComment(t){fetch(e,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"grabby.comment",version:1,origin:typeof location<"u"?location.origin:null,comment:{...t,pin:void 0}})}).catch(()=>{})}}}:(console.warn(`[grabby] webhookUrl must be https:// or http://localhost; ignoring "${e}".`),{name:"webhook"})}var $o="theme-vars",Lo="theme-overrides",Ha=`
170
+ `)}var Ee=null;function $a(){return Ee?.isConnected||(La(),Ee=w("div",{id:j,role:"status","aria-live":"polite"}),D().appendChild(Ee)),Ee}function Na(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}function Jt(e,t){return w("div",{class:"grabby-toast-row"},w("span",{class:"grabby-toast-label"},e),typeof t=="string"?w("span",{class:"grabby-toast-value"},t):t)}function oe(e,t={}){let n=$a(),{detail:o,actions:r}=t,i=t.duration??(r?.length?8e3:3500),a=[w("div",{class:"grabby-toast-header"},le(vo,"grabby-toast-icon"),w("span",{class:"grabby-toast-title"},e))];if(o){let s=w("div",{class:"grabby-toast-details"});if(o.componentName&&s.appendChild(Jt("Component",o.componentName)),o.filePath){let l=o.line!=null?`${o.filePath}:${o.line}`:o.filePath;s.appendChild(Jt("File",w("a",{class:"grabby-toast-file-link",href:Na(o.filePath,o.line,o.column),title:"Open in VS Code"},l)))}o.cssClasses&&o.cssClasses.length>0&&s.appendChild(Jt("Classes",o.cssClasses.map(l=>`.${l}`).join(" "))),a.push(s)}r?.length&&a[0].appendChild(w("span",{class:"grabby-toast-actions"},...r.map(s=>w("button",{type:"button",class:s.primary?"grabby-toast-action grabby-toast-action-primary":"grabby-toast-action",onclick:l=>{l.stopPropagation(),Ma(),s.onClick()}},s.label)))),n.replaceChildren(...a),ae&&(clearTimeout(ae),ae=null),n.classList.remove("grabby-toast-visible"),n.offsetHeight,n.classList.add("grabby-toast-visible"),ae=setTimeout(()=>{n.classList.remove("grabby-toast-visible"),ae=null},i)}function Ma(){ae&&(clearTimeout(ae),ae=null),Ee?.classList.remove("grabby-toast-visible")}function Eo(){ae&&(clearTimeout(ae),ae=null),Ee?.remove(),Ee=null,P(Qt)}function So(e){return Array.from(e).filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))}function wo(e){if(typeof CSS<"u"&&typeof CSS.escape=="function")return CSS.escape(e);let t="";for(let n=0;n<e.length;n++){let o=e.charAt(n),r=e.charCodeAt(n);if(r===0){t+="\uFFFD";continue}if(r>=1&&r<=31||r===127||n===0&&r>=48&&r<=57||n===1&&r>=48&&r<=57&&e.charCodeAt(0)===45){t+=`\\${r.toString(16)} `;continue}if(n===0&&e.length===1&&r===45){t+=`\\${o}`;continue}if(r>=128||r===45||r===95||r>=48&&r<=57||r>=65&&r<=90||r>=97&&r<=122){t+=o;continue}t+=`\\${o}`}return t}function Ue(e,t=document){if(!e)return null;try{return t.querySelector(e)}catch{return null}}var Pa=["data-testid","data-test","data-cy","data-qa"],Da=8;function Et(e,t){try{let n=t.ownerDocument.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}function Oa(e){let t=e.tagName.toLowerCase(),n=e.parentElement;if(!n)return t;let o=Array.from(n.children).filter(r=>r.tagName===e.tagName);return o.length===1?t:`${t}:nth-of-type(${o.indexOf(e)+1})`}function Co(e){for(let o of Pa){let r=e.getAttribute(o);if(r){let i=`[${o}="${r.replace(/["\\]/g,"\\$&")}"]`;if(Et(i,e))return i}}if(e.id){let o=`#${wo(e.id)}`;if(Et(o,e))return o}let t=[],n=e;for(;n&&t.length<Da;){if(n!==e&&n.id){let r=`#${wo(n.id)}`;if(Et(r,n)){t.unshift(r);break}}t.unshift(Oa(n));let o=t.join(" > ");if(Et(o,e))return o;if(n.tagName==="BODY"||n.tagName==="HTML")break;n=n.parentElement}return t.join(" > ")}function ko(e){let t=null,n=null,o=!1;function r(f){let h=e.getComponentResolver();return h?h(f)?.name??null:null}function i(f){let h=e.getSourceResolver();if(!h)return null;let m=h(f);if(!m?.filePath)return null;let y=m.filePath;return m.line!=null&&(y+=`:${m.line}`),y}function a(f,h){let m=e.getFreezeElement?.();m&&(m.style.pointerEvents="none");let y=document.elementFromPoint(f,h);return m&&(m.style.pointerEvents="auto"),y}function s(f,h,m){let y=a(f,h);return!y||y.closest(`[${be}]`)?y&&e.isToolbarElement?.(y)?y:null:m?y:oo(y)}function l(f){let h=r(f),m=i(f),y=So(f.classList);e.overlay.show(f,h,m,y)}function c(f){if(n)return;let h=s(f.clientX,f.clientY,f.shiftKey);!h||e.overlay.isOverlayElement(h)||e.crosshair.isCrosshairElement(h)||e.isToolbarElement?.(h)||h!==t&&(t=h,l(h),e.onHover(h))}function d(f){let h=xe(f);if(h&&e.isToolbarElement?.(h))return;let m=a(f.clientX,f.clientY);m&&(e.isToolbarElement?.(m)||e.crosshair.isCrosshairElement(m))||(f.preventDefault(),f.stopPropagation(),!n&&t&&e.onSelect(t,{x:f.clientX,y:f.clientY}))}return{activate(){o||(o=!0,e.crosshair.activate(),document.addEventListener("mousemove",c,!0),document.addEventListener("click",d,!0))},deactivate(){o&&(o=!1,t=null,n=null,e.crosshair.hold(!1),e.crosshair.deactivate(),document.removeEventListener("mousemove",c,!0),document.removeEventListener("click",d,!0),e.overlay.hide(),e.onHover(null))},hold(f){o&&(n=f,t=f,e.crosshair.hold(!0),l(f))},release(){n&&(n=null,e.crosshair.hold(!1))},isHolding(){return n!==null},getHoveredElement(){return t},dispose(){this.deactivate()}}}function To(e){let t=e.split("+").map(o=>o.trim()),n={key:"",meta:!1,ctrl:!1,shift:!1,alt:!1};for(let o of t){let r=o.toLowerCase();r==="meta"||r==="cmd"||r==="command"?n.meta=!0:r==="ctrl"||r==="control"?n.ctrl=!0:r==="shift"?n.shift=!0:r==="alt"||r==="option"?n.alt=!0:n.key=r}return n}function Ao(e,t){return e.key&&e.key.toLowerCase()===t?!0:e.code?/^[a-z]$/.test(t)?e.code===`Key${t.toUpperCase()}`:/^[0-9]$/.test(t)?e.code===`Digit${t}`:!1:!1}function Fa(e,t){return t.meta&&!e.metaKey||t.ctrl&&!e.ctrlKey||t.shift&&!e.shiftKey||t.alt&&!e.altKey?!1:Ao(e,t.key)}function _o(e){let t=null,n=!1,o=!1,r=!1;function i(s){if(!e.getEnableInInputs()&&Re(xe(s)))return;let l=To(e.getActivationKey());if(!Fa(s,l))return;let c=e.getActivationMode(),d=e.getKeyHoldDuration();if(c==="hold"){if(s.preventDefault(),n)return;if(d>0){if(t)return;t=setTimeout(()=>{n=!0,e.onActivate()},d)}else n=!0,e.onActivate()}else s.preventDefault(),o=!0}function a(s){let l=To(e.getActivationKey());if(!Ao(s,l.key))return;if(e.getActivationMode()==="hold")t&&(clearTimeout(t),t=null),n&&(n=!1,e.onDeactivate());else{if(!o)return;o=!1,e.isActive()?e.onDeactivate():e.onActivate()}}return{start(){r||(r=!0,document.addEventListener("keydown",i,!0),document.addEventListener("keyup",a,!0))},stop(){r&&(r=!1,t&&(clearTimeout(t),t=null),n=!1,o=!1,document.removeEventListener("keydown",i,!0),document.removeEventListener("keyup",a,!0))},dispose(){this.stop()}}}function Ro(){let e=new Map,t=new Map;return{register(n,o){if(e.has(n.name)&&this.unregister(n.name),e.set(n.name,n),n.setup){let r=n.setup(o);r&&t.set(n.name,r)}},unregister(n){let o=t.get(n);o&&(o(),t.delete(n)),e.delete(n)},callHook(n,...o){for(let r of e.values()){let i=r.hooks?.[n];if(i)try{i(...o)}catch(a){console.warn(`[grabby] Plugin "${r.name}" hook "${n}" threw:`,a)}}},callTransformHook(n,o){let r=n;for(let i of e.values()){let a=i.hooks?.transformCopyContent;if(a)try{r=a(r,o)}catch(s){console.warn(`[grabby] Plugin "${i.name}" transformCopyContent threw:`,s)}}return r},getPlugins(){return Array.from(e.values())},dispose(){for(let n of t.values())try{n()}catch{}t.clear(),e.clear()}}}function Ha(e){try{let t=new URL(e,typeof location<"u"?location.href:void 0);return t.protocol==="https:"?!0:t.protocol==="http:"&&/^(localhost|127\.0\.0\.1|\[::1\])$/.test(t.hostname)}catch{return!1}}function Io(e){return Ha(e)?{name:"webhook",hooks:{onComment(t){fetch(e,{method:"POST",credentials:"omit",headers:{"Content-Type":"application/json"},body:JSON.stringify({type:"grabby.comment",version:1,origin:typeof location<"u"?location.origin:null,comment:{...t,pin:void 0}})}).catch(()=>{})}}}:(console.warn(`[grabby] webhookUrl must be https:// or http://localhost; ignoring "${e}".`),{name:"webhook"})}var Lo="theme-vars",$o="theme-overrides",Ua=`
171
171
  :host {
172
172
  all: initial;
173
173
  --grabby-bg: #ffffff;
@@ -198,11 +198,11 @@
198
198
  --grabby-popover-hover: #f1f5f9;
199
199
  --grabby-popover-shadow: rgba(0, 0, 0, 0.12);
200
200
  }
201
- `,Ua={overlayBorderColor:"--grabby-overlay-border",overlayBgColor:"--grabby-overlay-bg",labelBgColor:"--grabby-label-bg",labelTextColor:"--grabby-label-text",toastBgColor:"--grabby-toast-bg",toastTextColor:"--grabby-toast-text",toolbarBgColor:"--grabby-toolbar-bg",toolbarTextColor:"--grabby-toolbar-text",toolbarAccentColor:"--grabby-toolbar-active",popoverBgColor:"--grabby-popover-bg",popoverTextColor:"--grabby-popover-text",popoverBorderColor:"--grabby-popover-border"},Ba=/^[#a-zA-Z0-9\s(),.%-]+$/;function No(){return{apply(e){N($o,Ha)},applyOverrides(e){let t=[];for(let[n,o]of Object.entries(Ua)){let r=e[n];r&&Ba.test(r)&&!/url\s*\(/i.test(r)&&t.push(` ${o}: ${r};`)}if(t.length===0){this.clearOverrides();return}N(Lo,` :host {
201
+ `,Ba={overlayBorderColor:"--grabby-overlay-border",overlayBgColor:"--grabby-overlay-bg",labelBgColor:"--grabby-label-bg",labelTextColor:"--grabby-label-text",toastBgColor:"--grabby-toast-bg",toastTextColor:"--grabby-toast-text",toolbarBgColor:"--grabby-toolbar-bg",toolbarTextColor:"--grabby-toolbar-text",toolbarAccentColor:"--grabby-toolbar-active",popoverBgColor:"--grabby-popover-bg",popoverTextColor:"--grabby-popover-text",popoverBorderColor:"--grabby-popover-border"},Ga=/^[#a-zA-Z0-9\s(),.%-]+$/;function No(){return{apply(e){M(Lo,Ua)},applyOverrides(e){let t=[];for(let[n,o]of Object.entries(Ba)){let r=e[n];r&&Ga.test(r)&&!/url\s*\(/i.test(r)&&t.push(` ${o}: ${r};`)}if(t.length===0){this.clearOverrides();return}M($o,` :host {
202
202
  ${t.join(`
203
203
  `)}
204
- }`)},clearOverrides(){M(Lo)},dispose(){M($o),this.clearOverrides()}}}var L="__grabby-toolbar__",vt=42,He="cubic-bezier(0.19, 1, 0.22, 1)",Jt=360,Qt="__grabby-toolbar-styles__";function Ga(e){if(e.length===0)return null;let t=0,n=0;for(let o of e)o.sync==="pending"?t++:o.sync==="failed"&&n++;return n?{text:`${n} not sent`,tone:"error"}:t?{text:"Sending\u2026",tone:"busy"}:{text:`${e.length} sent`,tone:"ok"}}function Mo(e,t={}){let n=null,o=null,r={},i=new Set,a=null,s=null,l=null,c=null,d=!1,f=null;function h(){f&&clearTimeout(f),f=null}function m(){Y(Qt)||N(Qt,`
205
- #${L} {
204
+ }`)},clearOverrides(){P($o)},dispose(){P(Lo),this.clearOverrides()}}}var N="__grabby-toolbar__",wt=42,Be="cubic-bezier(0.19, 1, 0.22, 1)",en=360,tn="__grabby-toolbar-styles__";function za(e){if(e.length===0)return null;let t=0,n=0;for(let o of e)o.sync==="pending"?t++:o.sync==="failed"&&n++;return n?{text:`${n} not sent`,tone:"error"}:t?{text:"Sending\u2026",tone:"busy"}:{text:`${e.length} sent`,tone:"ok"}}function Mo(e,t={}){let n=null,o=null,r={},i=new Set,a=null,s=null,l=null,c=null,d=!1,f=null;function h(){f&&clearTimeout(f),f=null}function m(){q(tn)||M(tn,`
205
+ #${N} {
206
206
  position: fixed;
207
207
  bottom: 20px;
208
208
  left: 50%;
@@ -219,27 +219,27 @@ ${t.join(`
219
219
  pointer-events: auto;
220
220
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
221
221
  box-sizing: border-box;
222
- height: ${vt}px;
222
+ height: ${wt}px;
223
223
  overflow: hidden;
224
224
  justify-content: flex-end;
225
225
  transition: opacity 0.2s ease, transform 0.2s ease,
226
- left ${Jt}ms ${He}, width ${Jt}ms ${He};
226
+ left ${en}ms ${Be}, width ${en}ms ${Be};
227
227
  }
228
- #${L} .grabby-toolbar-content {
228
+ #${N} .grabby-toolbar-content {
229
229
  display: flex;
230
230
  align-items: center;
231
231
  gap: 2px;
232
232
  flex-shrink: 0;
233
233
  transform-origin: right center;
234
234
  transition: opacity 0.24s ease-out, filter 0.3s cubic-bezier(0.22, 1, 0.36, 1),
235
- transform 0.42s ${He}, visibility 0s;
235
+ transform 0.42s ${Be}, visibility 0s;
236
236
  }
237
- #${L}.grabby-toolbar-hidden {
237
+ #${N}.grabby-toolbar-hidden {
238
238
  opacity: 0;
239
239
  transform: translateX(-50%) translateY(20px);
240
240
  pointer-events: none;
241
241
  }
242
- #${L} button {
242
+ #${N} button {
243
243
  display: flex;
244
244
  align-items: center;
245
245
  justify-content: center;
@@ -253,19 +253,19 @@ ${t.join(`
253
253
  padding: 0;
254
254
  transition: background 0.15s ease, color 0.15s ease;
255
255
  }
256
- #${L} button:hover {
256
+ #${N} button:hover {
257
257
  background: var(--grabby-toolbar-hover, #f1f5f9);
258
258
  color: var(--grabby-accent, #2563eb);
259
259
  }
260
- #${L} button { position: relative; }
261
- #${L} button.grabby-btn-labelled {
260
+ #${N} button { position: relative; }
261
+ #${N} button.grabby-btn-labelled {
262
262
  width: auto;
263
263
  gap: 6px;
264
264
  padding: 0 12px 0 10px;
265
265
  font: 600 13px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
266
266
  color: var(--grabby-accent, #2563eb);
267
267
  }
268
- #${L} .grabby-badge {
268
+ #${N} .grabby-badge {
269
269
  position: absolute;
270
270
  top: 1px;
271
271
  right: 1px;
@@ -280,22 +280,22 @@ ${t.join(`
280
280
  text-align: center;
281
281
  pointer-events: none;
282
282
  }
283
- #${L} .grabby-badge[hidden] { display: none; }
284
- #${L} button.grabby-btn-active {
283
+ #${N} .grabby-badge[hidden] { display: none; }
284
+ #${N} button.grabby-btn-active {
285
285
  color: var(--grabby-toolbar-active, #2563eb);
286
286
  }
287
- #${L} button.grabby-btn-disabled {
287
+ #${N} button.grabby-btn-disabled {
288
288
  opacity: 0.4;
289
289
  color: var(--grabby-toolbar-text, #64748b);
290
290
  }
291
- #${L} .grabby-toolbar-divider {
291
+ #${N} .grabby-toolbar-divider {
292
292
  width: 1px;
293
293
  height: 20px;
294
294
  background: var(--grabby-toolbar-border, #e2e8f0);
295
295
  margin: 0 4px;
296
296
  flex-shrink: 0;
297
297
  }
298
- #${L} .grabby-toolbar-left {
298
+ #${N} .grabby-toolbar-left {
299
299
  display: flex;
300
300
  align-items: center;
301
301
  gap: 2px;
@@ -304,18 +304,18 @@ ${t.join(`
304
304
  opacity: 1;
305
305
  transition: max-width 0.25s ease, opacity 0.2s ease, margin 0.25s ease;
306
306
  }
307
- #${L} .grabby-toolbar-status {
307
+ #${N} .grabby-toolbar-status {
308
308
  padding: 0 6px;
309
309
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
310
310
  white-space: nowrap;
311
311
  color: #15803d;
312
312
  }
313
- #${L} .grabby-toolbar-status[data-tone="ok"]::before { content: "\u2713 "; }
314
- #${L} .grabby-toolbar-status[data-tone="busy"] { color: var(--grabby-toolbar-text, #64748b); }
315
- #${L} .grabby-toolbar-status[data-tone="error"] { color: #b91c1c; }
316
- #${L} .grabby-toolbar-status[hidden],
317
- #${L} button[hidden] { display: none; }
318
- #${L} button.grabby-btn-finish {
313
+ #${N} .grabby-toolbar-status[data-tone="ok"]::before { content: "\u2713 "; }
314
+ #${N} .grabby-toolbar-status[data-tone="busy"] { color: var(--grabby-toolbar-text, #64748b); }
315
+ #${N} .grabby-toolbar-status[data-tone="error"] { color: #b91c1c; }
316
+ #${N} .grabby-toolbar-status[hidden],
317
+ #${N} button[hidden] { display: none; }
318
+ #${N} button.grabby-btn-finish {
319
319
  width: auto;
320
320
  padding: 0 14px;
321
321
  margin-left: 2px;
@@ -324,11 +324,11 @@ ${t.join(`
324
324
  background: var(--grabby-accent, #2563eb);
325
325
  color: #fff;
326
326
  }
327
- #${L} button.grabby-btn-finish:hover {
327
+ #${N} button.grabby-btn-finish:hover {
328
328
  background: var(--grabby-accent-hover, #1d4ed8);
329
329
  color: #fff;
330
330
  }
331
- #${L} button.grabby-btn-expand {
331
+ #${N} button.grabby-btn-expand {
332
332
  position: absolute;
333
333
  left: 50%;
334
334
  top: 50%;
@@ -338,48 +338,48 @@ ${t.join(`
338
338
  scale: 0.6;
339
339
  visibility: hidden;
340
340
  pointer-events: none;
341
- transition: opacity 0.2s ease-out, scale 0.3s ${He}, visibility 0s 0.2s;
341
+ transition: opacity 0.2s ease-out, scale 0.3s ${Be}, visibility 0s 0.2s;
342
342
  }
343
- #${L} button.grabby-btn-expand .grabby-badge { top: -3px; right: -5px; }
344
- #${L}.grabby-toolbar-collapsed {
345
- left: calc(100% - 20px - ${vt/2}px);
343
+ #${N} button.grabby-btn-expand .grabby-badge { top: -3px; right: -5px; }
344
+ #${N}.grabby-toolbar-collapsed {
345
+ left: calc(100% - 20px - ${wt/2}px);
346
346
  padding: 4px;
347
347
  }
348
- #${L}.grabby-toolbar-collapsed .grabby-toolbar-content {
348
+ #${N}.grabby-toolbar-collapsed .grabby-toolbar-content {
349
349
  opacity: 0;
350
350
  filter: blur(6px);
351
351
  transform: scale(0.4);
352
352
  pointer-events: none;
353
353
  visibility: hidden;
354
354
  transition: opacity 0.24s ease-out, filter 0.3s cubic-bezier(0.22, 1, 0.36, 1),
355
- transform 0.42s ${He}, visibility 0s 0.3s;
355
+ transform 0.42s ${Be}, visibility 0s 0.3s;
356
356
  }
357
- #${L}.grabby-toolbar-collapsed button.grabby-btn-expand {
357
+ #${N}.grabby-toolbar-collapsed button.grabby-btn-expand {
358
358
  opacity: 1;
359
359
  scale: 1;
360
360
  visibility: visible;
361
361
  pointer-events: auto;
362
- transition: opacity 0.24s ease-out 0.08s, scale 0.36s ${He} 0.08s, visibility 0s;
362
+ transition: opacity 0.24s ease-out 0.08s, scale 0.36s ${Be} 0.08s, visibility 0s;
363
363
  }
364
364
  @media (prefers-reduced-motion: reduce) {
365
- #${L}, #${L} .grabby-toolbar-content, #${L} button.grabby-btn-expand {
365
+ #${N}, #${N} .grabby-toolbar-content, #${N} button.grabby-btn-expand {
366
366
  transition-duration: 0s !important;
367
367
  transition-delay: 0s !important;
368
368
  }
369
369
  }
370
- #${L} .grabby-toolbar-left.grabby-toolbar-left-hidden {
370
+ #${N} .grabby-toolbar-left.grabby-toolbar-left-hidden {
371
371
  max-width: 0;
372
372
  opacity: 0;
373
373
  pointer-events: none;
374
374
  }
375
- `)}function y(b,g,p,x){let C=document.createElement("button");return C.type="button",C.appendChild(se(g)),C.title=p,C.setAttribute("aria-label",p),C.setAttribute("data-grabby-btn",b),C.addEventListener("click",I=>{I.preventDefault(),I.stopPropagation(),x()}),C}function v(){if(n)return;m(),n=document.createElement("div"),n.id=L,n.setAttribute("role","toolbar"),n.setAttribute("aria-label","Grabby toolbar"),r.selection=y("selection",Xt,"Comment on an element (Alt+G)",e.onSelectionMode),t.label&&(r.selection.classList.add("grabby-btn-labelled"),r.selection.append(document.createTextNode(t.label))),r.history=y("history",ho,"Comments",e.onHistory),a=document.createElement("span"),a.className="grabby-badge",a.hidden=!0,r.history.appendChild(a),r.enable=y("enable",yo,"Enable/Disable",e.onEnableToggle),r.dismiss=y("dismiss",ht,t.dismissLabel??"Dismiss toolbar",e.onDismiss),r.expand=y("expand",Xt,t.expandLabel??"Open Grabby toolbar",()=>e.onExpand?.()),r.expand.classList.add("grabby-btn-expand"),l=document.createElement("span"),l.className="grabby-badge",l.hidden=!0,r.expand.appendChild(l);let b=document.createElement("span");b.className="grabby-toolbar-divider",o=document.createElement("div"),o.className="grabby-toolbar-left",o.appendChild(r.selection),o.appendChild(r.history),o.appendChild(b),c=document.createElement("div"),c.className="grabby-toolbar-content",c.appendChild(o),t.review&&(s=document.createElement("span"),s.className="grabby-toolbar-status",s.setAttribute("role","status"),s.hidden=!0,r.finish=document.createElement("button"),r.finish.type="button",r.finish.className="grabby-btn-finish",r.finish.textContent="Finish review",r.finish.setAttribute("data-grabby-btn","finish"),r.finish.hidden=!0,r.finish.addEventListener("click",g=>{g.preventDefault(),g.stopPropagation(),e.onFinish?.()}),c.appendChild(s),c.appendChild(r.finish),i.add(s)),t.hideEnable||c.appendChild(r.enable),c.appendChild(r.dismiss),n.append(c,r.expand),d&&(n.classList.add("grabby-toolbar-collapsed"),n.style.width=`${vt}px`),D().appendChild(n),i.clear(),i.add(n),i.add(o),i.add(c),i.add(b);for(let g of Object.values(r))i.add(g)}return{show(){v(),n.classList.remove("grabby-toolbar-hidden")},hide(){n&&n.classList.add("grabby-toolbar-hidden")},update(b){if(!n)return;b.active?r.selection.classList.add("grabby-btn-active"):r.selection.classList.remove("grabby-btn-active");let g=b.toolbar.comments.length;for(let p of[a,l])p&&(p.hidden=g===0,p.textContent=g>99?"99+":String(g));if(r.history.setAttribute("aria-label",g?`Comments (${g})`:"Comments"),s&&r.finish){let p=Ga(b.toolbar.comments);s.hidden=!p,s.textContent=p?.text??"",s.dataset.tone=p?.tone??"",r.finish.hidden=g===0}b.options.enabled?(r.enable.classList.add("grabby-btn-active"),o?.classList.remove("grabby-toolbar-left-hidden")):(r.enable.classList.remove("grabby-btn-active"),o?.classList.add("grabby-toolbar-left-hidden"))},collapse(){d||(d=!0,n&&(h(),n.style.width=`${n.offsetWidth}px`,n.offsetWidth,n.classList.add("grabby-toolbar-collapsed"),n.style.width=`${vt}px`))},expand(){if(!d||(d=!1,!n))return;h(),n.classList.remove("grabby-toolbar-collapsed");let b=getComputedStyle(n),g=["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"].reduce((p,x)=>p+(parseFloat(b[x])||0),0);n.style.width=`${(c?.offsetWidth??0)+g}px`,f=setTimeout(()=>{f=null,!d&&n&&(n.style.width="")},Jt+40)},isCollapsed(){return d},isToolbarElement(b){if(i.has(b))return!0;let g=b;for(;g;){if(g===n||g.id===L)return!0;g=g.parentElement}return!1},dispose(){h(),n?.remove(),M(Qt),n=null,o=null,c=null,r={},a=null,l=null,s=null,i.clear()}}}function Do(e){return Math.ceil(e.length/4)}var Po=new Set(["styles","layout","computed"]),Va=new Set(["label","type","text","href","placeholder","alt","src","title"]);function za(e,t){return t.length>0&&(e.includes(`>${t}<`)||e.includes(`"${t}"`)||e.includes(`>${t}`))}function Ka(e){return e.anonymous||!e.name?`anon:${e.sessionId}`:`name:${e.name}`}function Ye(e){return!e.anonymous&&e.name?e.name:`Anonymous ${e.sessionId.replace(/-/g,"").slice(0,4)}`}function ja(e){return e.split(/[\\/]/).pop()??e}function en(e,t,n){let o=n?e:ja(e);return t!=null?`${o}:${t}`:o}function Oo(e,t){return e.split(`
375
+ `)}function y(b,g,p,x){let S=document.createElement("button");return S.type="button",S.appendChild(le(g)),S.title=p,S.setAttribute("aria-label",p),S.setAttribute("data-grabby-btn",b),S.addEventListener("click",I=>{I.preventDefault(),I.stopPropagation(),x()}),S}function v(){if(n)return;m(),n=document.createElement("div"),n.id=N,n.setAttribute("role","toolbar"),n.setAttribute("aria-label","Grabby toolbar"),r.selection=y("selection",Zt,"Comment on an element (Alt+G)",e.onSelectionMode),t.label&&(r.selection.classList.add("grabby-btn-labelled"),r.selection.append(document.createTextNode(t.label))),r.history=y("history",ho,"Comments",e.onHistory),a=document.createElement("span"),a.className="grabby-badge",a.hidden=!0,r.history.appendChild(a),r.enable=y("enable",yo,"Enable/Disable",e.onEnableToggle),r.dismiss=y("dismiss",xt,t.dismissLabel??"Dismiss toolbar",e.onDismiss),r.expand=y("expand",Zt,t.expandLabel??"Open Grabby toolbar",()=>e.onExpand?.()),r.expand.classList.add("grabby-btn-expand"),l=document.createElement("span"),l.className="grabby-badge",l.hidden=!0,r.expand.appendChild(l);let b=document.createElement("span");b.className="grabby-toolbar-divider",o=document.createElement("div"),o.className="grabby-toolbar-left",o.appendChild(r.selection),o.appendChild(r.history),o.appendChild(b),c=document.createElement("div"),c.className="grabby-toolbar-content",c.appendChild(o),t.review&&(s=document.createElement("span"),s.className="grabby-toolbar-status",s.setAttribute("role","status"),s.hidden=!0,r.finish=document.createElement("button"),r.finish.type="button",r.finish.className="grabby-btn-finish",r.finish.textContent="Finish review",r.finish.setAttribute("data-grabby-btn","finish"),r.finish.hidden=!0,r.finish.addEventListener("click",g=>{g.preventDefault(),g.stopPropagation(),e.onFinish?.()}),c.appendChild(s),c.appendChild(r.finish),i.add(s)),t.hideEnable||c.appendChild(r.enable),c.appendChild(r.dismiss),n.append(c,r.expand),d&&(n.classList.add("grabby-toolbar-collapsed"),n.style.width=`${wt}px`),D().appendChild(n),i.clear(),i.add(n),i.add(o),i.add(c),i.add(b);for(let g of Object.values(r))i.add(g)}return{show(){v(),n.classList.remove("grabby-toolbar-hidden")},hide(){n&&n.classList.add("grabby-toolbar-hidden")},update(b){if(!n)return;b.active?r.selection.classList.add("grabby-btn-active"):r.selection.classList.remove("grabby-btn-active");let g=b.toolbar.comments.length;for(let p of[a,l])p&&(p.hidden=g===0,p.textContent=g>99?"99+":String(g));if(r.history.setAttribute("aria-label",g?`Comments (${g})`:"Comments"),s&&r.finish){let p=za(b.toolbar.comments);s.hidden=!p,s.textContent=p?.text??"",s.dataset.tone=p?.tone??"",r.finish.hidden=g===0}b.options.enabled?(r.enable.classList.add("grabby-btn-active"),o?.classList.remove("grabby-toolbar-left-hidden")):(r.enable.classList.remove("grabby-btn-active"),o?.classList.add("grabby-toolbar-left-hidden"))},collapse(){d||(d=!0,n&&(h(),n.style.width=`${n.offsetWidth}px`,n.offsetWidth,n.classList.add("grabby-toolbar-collapsed"),n.style.width=`${wt}px`))},expand(){if(!d||(d=!1,!n))return;h(),n.classList.remove("grabby-toolbar-collapsed");let b=getComputedStyle(n),g=["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"].reduce((p,x)=>p+(parseFloat(b[x])||0),0);n.style.width=`${(c?.offsetWidth??0)+g}px`,f=setTimeout(()=>{f=null,!d&&n&&(n.style.width="")},en+40)},isCollapsed(){return d},isToolbarElement(b){if(i.has(b))return!0;let g=b;for(;g;){if(g===n||g.id===N)return!0;g=g.parentElement}return!1},dispose(){h(),n?.remove(),P(tn),n=null,o=null,c=null,r={},a=null,l=null,s=null,i.clear()}}}function Do(e){return Math.ceil(e.length/4)}var Po=new Set(["styles","layout","computed"]),Va=new Set(["label","type","text","href","placeholder","alt","src","title"]);function Ka(e,t){return t.length>0&&(e.includes(`>${t}<`)||e.includes(`"${t}"`)||e.includes(`>${t}`))}function ja(e){return e.anonymous||!e.name?`anon:${e.sessionId}`:`name:${e.name}`}function qe(e){return!e.anonymous&&e.name?e.name:`Anonymous ${e.sessionId.replace(/-/g,"").slice(0,4)}`}function Wa(e){return e.split(/[\\/]/).pop()??e}function nn(e,t,n){let o=n?e:Wa(e);return t!=null?`${o}:${t}`:o}function Oo(e,t){return e.split(`
376
376
  `).map((n,o)=>o===0?n:`${t}${n}`).join(`
377
- `)}function Re(e){return Array.from(new Set(e))}function Wa(e,t,n){let o=e.length,r=[`# UI feedback \xB7 ${o} comment${o===1?"":"s"}`],i=[];t.origin&&i.push(t.origin);let a=Re(e.map(c=>c.framework).filter(Boolean));a.length&&i.push(a.join(", "));let s=Re(e.map(c=>c.page.route));!n.showRoutes&&s.length===1&&i.push(`page ${s[0]}`);let l=e[0]?.page.viewport;if(l&&i.push(`${l[0]}\xD7${l[1]}`),i.push((t.now??new Date).toISOString().slice(0,10)),r.push(i.join(" \xB7 ")),n.showAuthors){let c=Re(e.map(d=>Ye(d.author)));r.push(`From: ${c.join(", ")}`)}return r}function Ya(e,t,n){let o=e.target,i=[o.source?en(o.source.file,o.source.line,!0):o.selector,o.component,`<${o.tag}>`].filter(Boolean).join(" "),a=n.showAuthors?` (${Ye(e.author)})`:"",s=n.showRoutes?` [${e.page.route}]`:"",l=n.showIds?` [id ${e.id}]`:"";return`${t}. ${i}${s} \u2014 ${Oo(e.comment," ")}${a}${l}`}function Xa(e,t,n,o,r){let i=e.target,a=n.level==="detailed",s=[`${t}. ${Oo(e.comment," ")}`],l=m=>s.push(` - ${m}`),c=[`\`${i.preview}\``,`(${i.kind})`];i.component&&i.component!==r?c.push(i.source?.line!=null&&o?`${i.component} line ${i.source.line}`:i.component):i.source?.line!=null&&o&&c.push(`line ${i.source.line}`),l(c.join(" ")),(!i.source||a)&&l(`selector: \`${i.selector}\``);let d=Object.entries(i.facts).filter(([m,y])=>!Po.has(m)&&!(Va.has(m)&&!a&&za(i.preview,y)));d.length&&l(d.map(([m,y])=>`${m}: ${y}`).join(" \xB7 "));for(let[m,y]of Object.entries(i.facts))Po.has(m)&&l(`${m}: ${y}`);let f=i.stack.filter((m,y)=>!(y===0&&(i.source||m.name===i.component)));if(f.length&&l(`inside: ${f.map(m=>m.file?`${m.name} (${en(m.file,m.line,a)})`:m.name).join(" \u203A ")}`),a){for(let[m,y]of Object.entries(i.extra))l(`${m}: ${y}`);l(`viewport: ${e.page.viewport[0]}\xD7${e.page.viewport[1]}`)}e.screenshot?.url&&l(`screenshot: ${e.screenshot.url}`);let h=[];return n.showAuthors&&h.push(`by ${Ye(e.author)}`),n.showRoutes&&h.push(`on ${e.page.route}`),h.length&&l(h.join(" ")),n.showIds&&l(`id: ${e.id}`),s}function Fo(e,t="standard",n={}){if(e.length===0)return"";let o=[...e].sort((c,d)=>c.createdAt-d.createdAt),r=Re(o.map(c=>Ka(c.author))),i={level:t,showIds:n.showIds===!0,showAuthors:r.length>1||o.some(c=>!c.author.anonymous&&!!c.author.name),showRoutes:Re(o.map(c=>c.page.route)).length>1},a=Wa(o,n,i);if(t==="compact")return a.push(""),o.forEach((c,d)=>a.push(Ya(c,d+1,i))),a.join(`
378
- `);let s=new Map;for(let c of o){let d=c.target.source?.file??"",f=s.get(d);f?f.push(c):s.set(d,[c])}let l=0;for(let[c,d]of s){a.push("");let f=Re(d.map(y=>y.target.component)),h=c&&f.length===1?f[0]:null,m=Re(d.map(y=>y.target.source?.line??null));if(c){let y=m.length===1?en(c,m[0],!0):c;a.push(`## ${y}${h?` \xB7 ${h}`:""}`)}else a.push("## Elements without source info");for(let y of d)l+=1,a.push(...Xa(y,l,i,!!c&&m.length>1,h))}return a.join(`
379
- `)}var qa="grabby",Et="screenshots";var xt=null;function Za(){return xt||(xt=new Promise(e=>{try{if(typeof indexedDB>"u"){e(null);return}let t=indexedDB.open(qa,1);t.onupgradeneeded=()=>{t.result.objectStoreNames.contains(Et)||t.result.createObjectStore(Et)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}catch{e(null)}}),xt)}async function tn(e,t){let n=await Za();return n?new Promise(o=>{try{let r=n.transaction(Et,e),i=t(r.objectStore(Et));r.oncomplete=()=>o(i?i.result:null),r.onerror=()=>o(null),r.onabort=()=>o(null)}catch{o(null)}}):null}function Ho(e,t){return tn("readwrite",n=>n.put(t,e))}function Xe(e){return tn("readonly",t=>t.get(e))}function nn(e){return e.length===0?Promise.resolve(null):tn("readwrite",t=>{for(let n of e)t.delete(n)})}var on="__grabby-comments__",Uo="comments-panel",Ja={pending:"Sending\u2026",sent:"Sent",failed:"Not sent"};function Qa(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function es(e){return e.split(/[\\/]/).pop()??e}function ts(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}var ns=`
380
- #${on} {
377
+ `)}function Le(e){return Array.from(new Set(e))}function Ya(e,t,n){let o=e.length,r=[`# UI feedback \xB7 ${o} comment${o===1?"":"s"}`],i=[];t.origin&&i.push(t.origin);let a=Le(e.map(c=>c.framework).filter(Boolean));a.length&&i.push(a.join(", "));let s=Le(e.map(c=>c.page.route));!n.showRoutes&&s.length===1&&i.push(`page ${s[0]}`);let l=e[0]?.page.viewport;if(l&&i.push(`${l[0]}\xD7${l[1]}`),i.push((t.now??new Date).toISOString().slice(0,10)),r.push(i.join(" \xB7 ")),n.showAuthors){let c=Le(e.map(d=>qe(d.author)));r.push(`From: ${c.join(", ")}`)}return r}function Xa(e,t,n){let o=e.target,i=[o.source?nn(o.source.file,o.source.line,!0):o.selector,o.component,`<${o.tag}>`].filter(Boolean).join(" "),a=n.showAuthors?` (${qe(e.author)})`:"",s=n.showRoutes?` [${e.page.route}]`:"",l=n.showIds?` [id ${e.id}]`:"";return`${t}. ${i}${s} \u2014 ${Oo(e.comment," ")}${a}${l}`}function qa(e,t,n,o,r){let i=e.target,a=n.level==="detailed",s=[`${t}. ${Oo(e.comment," ")}`],l=m=>s.push(` - ${m}`),c=[`\`${i.preview}\``,`(${i.kind})`];i.component&&i.component!==r?c.push(i.source?.line!=null&&o?`${i.component} line ${i.source.line}`:i.component):i.source?.line!=null&&o&&c.push(`line ${i.source.line}`),l(c.join(" ")),(!i.source||a)&&l(`selector: \`${i.selector}\``);let d=Object.entries(i.facts).filter(([m,y])=>!Po.has(m)&&!(Va.has(m)&&!a&&Ka(i.preview,y)));d.length&&l(d.map(([m,y])=>`${m}: ${y}`).join(" \xB7 "));for(let[m,y]of Object.entries(i.facts))Po.has(m)&&l(`${m}: ${y}`);let f=i.stack.filter((m,y)=>!(y===0&&(i.source||m.name===i.component)));if(f.length&&l(`inside: ${f.map(m=>m.file?`${m.name} (${nn(m.file,m.line,a)})`:m.name).join(" \u203A ")}`),a){for(let[m,y]of Object.entries(i.extra))l(`${m}: ${y}`);l(`viewport: ${e.page.viewport[0]}\xD7${e.page.viewport[1]}`)}e.screenshot?.url&&l(`screenshot: ${e.screenshot.url}`);let h=[];return n.showAuthors&&h.push(`by ${qe(e.author)}`),n.showRoutes&&h.push(`on ${e.page.route}`),h.length&&l(h.join(" ")),n.showIds&&l(`id: ${e.id}`),s}function Fo(e,t="standard",n={}){if(e.length===0)return"";let o=[...e].sort((c,d)=>c.createdAt-d.createdAt),r=Le(o.map(c=>ja(c.author))),i={level:t,showIds:n.showIds===!0,showAuthors:r.length>1||o.some(c=>!c.author.anonymous&&!!c.author.name),showRoutes:Le(o.map(c=>c.page.route)).length>1},a=Ya(o,n,i);if(t==="compact")return a.push(""),o.forEach((c,d)=>a.push(Xa(c,d+1,i))),a.join(`
378
+ `);let s=new Map;for(let c of o){let d=c.target.source?.file??"",f=s.get(d);f?f.push(c):s.set(d,[c])}let l=0;for(let[c,d]of s){a.push("");let f=Le(d.map(y=>y.target.component)),h=c&&f.length===1?f[0]:null,m=Le(d.map(y=>y.target.source?.line??null));if(c){let y=m.length===1?nn(c,m[0],!0):c;a.push(`## ${y}${h?` \xB7 ${h}`:""}`)}else a.push("## Elements without source info");for(let y of d)l+=1,a.push(...qa(y,l,i,!!c&&m.length>1,h))}return a.join(`
379
+ `)}var Za="grabby",Ct="screenshots";var St=null;function Ja(){return St||(St=new Promise(e=>{try{if(typeof indexedDB>"u"){e(null);return}let t=indexedDB.open(Za,1);t.onupgradeneeded=()=>{t.result.objectStoreNames.contains(Ct)||t.result.createObjectStore(Ct)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}catch{e(null)}}),St)}async function on(e,t){let n=await Ja();return n?new Promise(o=>{try{let r=n.transaction(Ct,e),i=t(r.objectStore(Ct));r.oncomplete=()=>o(i?i.result:null),r.onerror=()=>o(null),r.onabort=()=>o(null)}catch{o(null)}}):null}function Ho(e,t){return on("readwrite",n=>n.put(t,e))}function Ze(e){return on("readonly",t=>t.get(e))}function rn(e){return e.length===0?Promise.resolve(null):on("readwrite",t=>{for(let n of e)t.delete(n)})}var an="__grabby-comments__",Uo="comments-panel",Qa={pending:"Sending\u2026",sent:"Sent",failed:"Not sent"};function es(e){let t=Math.floor((Date.now()-e)/1e3);if(t<60)return"just now";let n=Math.floor(t/60);if(n<60)return`${n}m ago`;let o=Math.floor(n/60);return o<24?`${o}h ago`:`${Math.floor(o/24)}d ago`}function ts(e){return e.split(/[\\/]/).pop()??e}function ns(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}var os=`
380
+ #${an} {
381
381
  position: fixed;
382
- bottom: ${he};
382
+ bottom: ${ve};
383
383
  left: 50%;
384
384
  transform: translateX(-50%);
385
385
  z-index: ${2147483647};
@@ -397,7 +397,7 @@ ${t.join(`
397
397
  visibility: hidden;
398
398
  transition: opacity .15s ease, visibility .15s ease;
399
399
  }
400
- #${on}.grabby-popover-visible { opacity: 1; visibility: visible; }
400
+ #${an}.grabby-popover-visible { opacity: 1; visibility: visible; }
401
401
  .grabby-panel-header {
402
402
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
403
403
  padding: 10px 12px 10px 14px;
@@ -463,8 +463,8 @@ ${t.join(`
463
463
  padding: 6px 8px 6px 14px; border-top: 1px solid var(--grabby-popover-border, #e2e8f0);
464
464
  font-size: 11px; color: var(--grabby-text-muted, #94a3b8);
465
465
  }
466
- `;function Bo(e,t={}){let n=t.variant==="live",o=null,r=!1,i=[];function a(){return o?.isConnected||(N(Uo,ns),o=S("div",{id:on,role:"dialog","aria-label":"Comments"}),D().appendChild(o)),o}function s(){for(let f of i)URL.revokeObjectURL(f);i=[]}function l(f){let h=f.screenshot?.localId;if(!h)return null;let m=S("img",{class:"grabby-thumb",alt:"",loading:"lazy"});return m.addEventListener("error",()=>m.remove(),{once:!0}),Xe(h).then(y=>{if(!y||typeof URL.createObjectURL!="function"){m.remove();return}let v=URL.createObjectURL(y);i.push(v),m.src=v}).catch(()=>m.remove()),m}function c(f,h){let m=f.target,y=n?[document.createTextNode(`${uo(m)} `)]:[S("span",{class:"grabby-kind"},m.kind)];n||(m.component&&y.push(document.createTextNode(`${m.component} `)),m.source?y.push(S("a",{href:ts(m.source.file,m.source.line,m.source.column),title:`Open ${m.source.file} in VS Code`,onclick:p=>p.stopPropagation()},`${es(m.source.file)}${m.source.line!=null?`:${m.source.line}`:""}`)):m.component||y.push(document.createTextNode(`<${m.tag}>`)));let v=[h&&!n?Ye(f.author):"",Qa(f.createdAt)].filter(Boolean);y.push(document.createTextNode(` \xB7 ${v.join(" \xB7 ")}`)),t.showSync&&f.sync&&(y.push(document.createTextNode(" \xB7 ")),y.push(S("span",{class:`grabby-sync grabby-sync-${f.sync}`},Ja[f.sync]??f.sync)));let b=S("button",{type:"button",class:"grabby-comment-delete","aria-label":"Delete comment",title:"Delete comment",onclick:p=>{p.stopPropagation(),e.onDelete(f)}},se(ht)),g=S("div",{class:"grabby-comment-row",role:"button",tabindex:"0","aria-label":`Edit comment: ${f.comment}`,dataset:{grabbyCommentId:f.id}},l(f),S("div",{class:"grabby-comment-body"},S("div",{class:"grabby-comment-text"},f.comment),S("div",{class:"grabby-comment-meta"},...y)),b);return Fe(m.selector)||g.classList.add("grabby-comment-missing"),g.addEventListener("mouseenter",()=>e.onHover(f)),g.addEventListener("mouseleave",()=>e.onHover(null)),g.addEventListener("click",p=>{p.stopPropagation(),e.onEdit(f,g)}),g.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),e.onEdit(f,g)),(p.key==="Delete"||p.key==="Backspace")&&(p.preventDefault(),e.onDelete(f))}),g}function d(f){let h=a();s();let m=f.length,v=new Set(f.map(C=>C.author.anonymous?C.author.sessionId:C.author.name)).size>1||f.some(C=>!C.author.anonymous),b=S("div",{class:"grabby-panel-header"},S("span",{class:"grabby-panel-title"},n?"Your feedback":"Comments",S("span",{class:"grabby-panel-count"},String(m))),m>0&&!n?S("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-all":"",onclick:C=>{C.stopPropagation(),e.onCopyAll()}},"Copy all\u2026"):null),g=m===0?S("div",{class:"grabby-panel-empty"},S("strong",null,n?"Nothing sent yet":"No comments yet"),n?"Click Comment, then click the part of the page you want to talk about.":"Click the hand icon (or press Alt+G), then click anything on the page to comment on it."):S("div",{class:"grabby-panel-list"},...f.map(C=>c(C,v))),p=t.identityLabel?.()??null,x=null;n&&p?x=S("div",{class:"grabby-panel-footer"},S("span",null,`Commenting as ${p}`),S("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-change-identity":"",onclick:C=>{C.stopPropagation(),e.onChangeIdentity?.()}},"Change")):!n&&m>0&&(x=S("div",{class:"grabby-panel-footer"},S("span",null,"Click a comment to edit it"),S("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-clear-all":"",onclick:C=>{C.stopPropagation(),e.onClearAll()}},"Clear all"))),h.replaceChildren(b,g,...x?[x]:[])}return{show(f){d(f),r=!0,a().offsetHeight,a().classList.add("grabby-popover-visible")},refresh(f){r&&d(f)},hide(){r=!1,o?.classList.remove("grabby-popover-visible")},isVisible(){return r},isPanelElement(f){return!!o&&(f===o||o.contains(f))},dispose(){s(),o?.remove(),M(Uo),o=null,r=!1}}}var z="__grabby-comment-popover__",rn="__grabby-comment-styles__";function Go(e){let t=null,n=null,o=!1,r={mode:"new"},i=null,a=!1,s="comment",l="",c=null,d="";function f(){Y(rn)||N(rn,`
467
- #${z} {
466
+ `;function Bo(e,t={}){let n=t.variant==="live",o=null,r=!1,i=[];function a(){return o?.isConnected||(M(Uo,os),o=w("div",{id:an,role:"dialog","aria-label":"Comments"}),D().appendChild(o)),o}function s(){for(let f of i)URL.revokeObjectURL(f);i=[]}function l(f){let h=f.screenshot?.localId;if(!h)return null;let m=w("img",{class:"grabby-thumb",alt:"",loading:"lazy"});return m.addEventListener("error",()=>m.remove(),{once:!0}),Ze(h).then(y=>{if(!y||typeof URL.createObjectURL!="function"){m.remove();return}let v=URL.createObjectURL(y);i.push(v),m.src=v}).catch(()=>m.remove()),m}function c(f,h){let m=f.target,y=n?[document.createTextNode(`${mo(m)} `)]:[w("span",{class:"grabby-kind"},m.kind)];n||(m.component&&y.push(document.createTextNode(`${m.component} `)),m.source?y.push(w("a",{href:ns(m.source.file,m.source.line,m.source.column),title:`Open ${m.source.file} in VS Code`,onclick:p=>p.stopPropagation()},`${ts(m.source.file)}${m.source.line!=null?`:${m.source.line}`:""}`)):m.component||y.push(document.createTextNode(`<${m.tag}>`)));let v=[h&&!n?qe(f.author):"",es(f.createdAt)].filter(Boolean);y.push(document.createTextNode(` \xB7 ${v.join(" \xB7 ")}`)),t.showSync&&f.sync&&(y.push(document.createTextNode(" \xB7 ")),y.push(w("span",{class:`grabby-sync grabby-sync-${f.sync}`},Qa[f.sync]??f.sync)));let b=w("button",{type:"button",class:"grabby-comment-delete","aria-label":"Delete comment",title:"Delete comment",onclick:p=>{p.stopPropagation(),e.onDelete(f)}},le(xt)),g=w("div",{class:"grabby-comment-row",role:"button",tabindex:"0","aria-label":`Edit comment: ${f.comment}`,dataset:{grabbyCommentId:f.id}},l(f),w("div",{class:"grabby-comment-body"},w("div",{class:"grabby-comment-text"},f.comment),w("div",{class:"grabby-comment-meta"},...y)),b);return Ue(m.selector)||g.classList.add("grabby-comment-missing"),g.addEventListener("mouseenter",()=>e.onHover(f)),g.addEventListener("mouseleave",()=>e.onHover(null)),g.addEventListener("click",p=>{p.stopPropagation(),e.onEdit(f,g)}),g.addEventListener("keydown",p=>{(p.key==="Enter"||p.key===" ")&&(p.preventDefault(),e.onEdit(f,g)),(p.key==="Delete"||p.key==="Backspace")&&(p.preventDefault(),e.onDelete(f))}),g}function d(f){let h=a();s();let m=f.length,v=new Set(f.map(S=>S.author.anonymous?S.author.sessionId:S.author.name)).size>1||f.some(S=>!S.author.anonymous),b=w("div",{class:"grabby-panel-header"},w("span",{class:"grabby-panel-title"},n?"Your feedback":"Comments",w("span",{class:"grabby-panel-count"},String(m))),m>0&&!n?w("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-all":"",onclick:S=>{S.stopPropagation(),e.onCopyAll()}},"Copy all\u2026"):null),g=m===0?w("div",{class:"grabby-panel-empty"},w("strong",null,n?"Nothing sent yet":"No comments yet"),n?"Click Comment, then click the part of the page you want to talk about.":"Click the hand icon (or press Alt+G), then click anything on the page to comment on it."):w("div",{class:"grabby-panel-list"},...f.map(S=>c(S,v))),p=t.identityLabel?.()??null,x=null;n&&p?x=w("div",{class:"grabby-panel-footer"},w("span",null,`Commenting as ${p}`),w("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-change-identity":"",onclick:S=>{S.stopPropagation(),e.onChangeIdentity?.()}},"Change")):!n&&m>0&&(x=w("div",{class:"grabby-panel-footer"},w("span",null,"Click a comment to edit it"),w("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-clear-all":"",onclick:S=>{S.stopPropagation(),e.onClearAll()}},"Clear all"))),h.replaceChildren(b,g,...x?[x]:[])}return{show(f){d(f),r=!0,a().offsetHeight,a().classList.add("grabby-popover-visible")},refresh(f){r&&d(f)},hide(){r=!1,o?.classList.remove("grabby-popover-visible")},isVisible(){return r},isPanelElement(f){return!!o&&(f===o||o.contains(f))},dispose(){s(),o?.remove(),P(Uo),o=null,r=!1}}}var V="__grabby-comment-popover__",sn="__grabby-comment-styles__";function Go(e){let t=null,n=null,o=!1,r={mode:"new"},i=null,a=!1,s="comment",l="",c=null,d="";function f(){q(sn)||M(sn,`
467
+ #${V} {
468
468
  position: fixed;
469
469
  z-index: ${2147483647};
470
470
  background: var(--grabby-popover-bg, #ffffff);
@@ -484,7 +484,7 @@ ${t.join(`
484
484
  from { opacity: 0; transform: scale(0.96); }
485
485
  to { opacity: 1; transform: scale(1); }
486
486
  }
487
- #${z} textarea {
487
+ #${V} textarea {
488
488
  width: 100%;
489
489
  min-height: 64px;
490
490
  padding: 8px 10px;
@@ -497,51 +497,51 @@ ${t.join(`
497
497
  outline: none;
498
498
  box-sizing: border-box;
499
499
  }
500
- #${z} textarea:focus {
500
+ #${V} textarea:focus {
501
501
  border-color: var(--grabby-accent, #2563eb);
502
502
  }
503
- #${z} textarea::placeholder {
503
+ #${V} textarea::placeholder {
504
504
  color: var(--grabby-text-muted, #94a3b8);
505
505
  }
506
- #${z} .grabby-cp-title { font: 600 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-popover-text, #334155); }
507
- #${z} .grabby-cp-sub { font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-text-muted, #94a3b8); }
508
- #${z} .grabby-cp-name {
506
+ #${V} .grabby-cp-title { font: 600 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-popover-text, #334155); }
507
+ #${V} .grabby-cp-sub { font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-text-muted, #94a3b8); }
508
+ #${V} .grabby-cp-name {
509
509
  width: 100%; box-sizing: border-box; padding: 8px 10px; border-radius: 8px; outline: none;
510
510
  border: 1px solid var(--grabby-popover-border, #e2e8f0); background: var(--grabby-surface, #f1f5f9);
511
511
  color: var(--grabby-popover-text, #334155); font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
512
512
  }
513
- #${z} .grabby-cp-name:focus { border-color: var(--grabby-accent, #2563eb); }
514
- #${z} .grabby-cp-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
515
- #${z} .grabby-cp-post {
513
+ #${V} .grabby-cp-name:focus { border-color: var(--grabby-accent, #2563eb); }
514
+ #${V} .grabby-cp-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
515
+ #${V} .grabby-cp-post {
516
516
  font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 8px 14px; border-radius: 8px; cursor: pointer;
517
517
  border: 1px solid var(--grabby-accent, #2563eb); background: var(--grabby-accent, #2563eb); color: #fff;
518
518
  }
519
- #${z} .grabby-cp-link {
519
+ #${V} .grabby-cp-link {
520
520
  font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 8px 4px; border: none;
521
521
  background: transparent; color: var(--grabby-text-muted, #64748b); cursor: pointer; text-decoration: underline;
522
522
  }
523
- #${z} .grabby-cp-edit-actions { display: flex; align-items: center; gap: 6px; }
524
- #${z} .grabby-cp-edit-actions .grabby-cp-spacer { flex: 1; }
525
- #${z} .grabby-cp-delete {
523
+ #${V} .grabby-cp-edit-actions { display: flex; align-items: center; gap: 6px; }
524
+ #${V} .grabby-cp-edit-actions .grabby-cp-spacer { flex: 1; }
525
+ #${V} .grabby-cp-delete {
526
526
  font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 8px 6px; border: none;
527
527
  border-radius: 8px; background: transparent; color: #b91c1c; cursor: pointer;
528
528
  }
529
- #${z} .grabby-cp-delete:hover { background: rgba(185, 28, 28, 0.08); }
530
- #${z} .grabby-cp-cancel {
529
+ #${V} .grabby-cp-delete:hover { background: rgba(185, 28, 28, 0.08); }
530
+ #${V} .grabby-cp-cancel {
531
531
  font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 8px 10px; border: none;
532
532
  border-radius: 8px; background: transparent; color: var(--grabby-text-muted, #64748b); cursor: pointer;
533
533
  }
534
- #${z} .grabby-cp-cancel:hover { background: var(--grabby-surface, #f1f5f9); }
535
- #${z} .grabby-cp-hint {
534
+ #${V} .grabby-cp-cancel:hover { background: var(--grabby-surface, #f1f5f9); }
535
+ #${V} .grabby-cp-hint {
536
536
  font-size: 11px;
537
537
  color: var(--grabby-text-muted, #94a3b8);
538
538
  white-space: nowrap;
539
539
  text-align: right;
540
540
  }
541
- `)}function h(){if(t)return t;f(),t=document.createElement("div"),t.id=z,t.setAttribute("role","dialog"),t.setAttribute("aria-label","Comment"),n=document.createElement("textarea"),n.placeholder="What should change here?",n.rows=3;let w=document.createElement("span");return w.className="grabby-cp-hint",w.textContent="\u21B5 save \xB7 Esc cancel \xB7 \u21E7\u21B5 newline",t.appendChild(n),t.appendChild(w),D().appendChild(t),t}function m(w,R){let F=window.innerWidth,W=window.innerHeight,E=300,A=120;if(!R){w.style.left="50%",w.style.top="24px",w.style.transform="translateX(-50%)";return}let T=R.getBoundingClientRect(),B,P;T.right+16+E<=F?(B=T.right+16,P=T.top+T.height/2-A/2):T.left-16-E>=0?(B=T.left-16-E,P=T.top+T.height/2-A/2):T.bottom+12+A<=W?(B=Math.max(12,Math.min(T.left,F-E-12)),P=T.bottom+12):(B=Math.max(12,Math.min(T.left,F-E-12)),P=Math.max(12,T.top-12-A)),P=Math.max(12,Math.min(P,W-A-12)),w.style.transform="",w.style.left=`${B}px`,w.style.top=`${P}px`}function y(w){return!!w&&w!==n&&w!==c&&Ae(w)}function v(){let w=n?.value.trim();w&&(l=w,a?p():g())}function b(){let w=W=>E=>{E.stopPropagation(),W()},R=()=>{let W=r;I(),e.onCancel(W)},F=()=>{let W=r;I(),e.onDelete?.(W)};return S("div",{class:"grabby-cp-edit-actions"},e.onDelete?S("button",{type:"button",class:"grabby-cp-delete","data-grabby-delete":"",onclick:w(F)},"Delete"):null,S("span",{class:"grabby-cp-spacer"}),S("button",{type:"button",class:"grabby-cp-cancel","data-grabby-cancel":"",onclick:w(R)},"Cancel"),S("button",{type:"button",class:"grabby-cp-post","data-grabby-save":"",onclick:w(v)},"Save"))}function g(w){let R=r,F=l;I(),w?e.onSubmit(F,R,w):e.onSubmit(F,R)}function p(){if(!t)return;s="identity",c=S("input",{type:"text",class:"grabby-cp-name",placeholder:"Your name",maxlength:"80",autocomplete:"name","aria-label":"Your name"});let w=()=>g({name:c?.value.trim()||null});t.replaceChildren(S("div",{class:"grabby-cp-title"},"Thanks! Who is this from?"),S("div",{class:"grabby-cp-sub"},"Your name helps the team follow up. It's remembered in this browser."),c,S("div",{class:"grabby-cp-actions"},S("button",{type:"button",class:"grabby-cp-link","data-grabby-anonymous":"",onclick:R=>{R.stopPropagation(),g({name:null})}},"Post anonymously"),S("button",{type:"button",class:"grabby-cp-post","data-grabby-post":"",onclick:R=>{R.stopPropagation(),w()}},"Post"))),c.focus()}function x(){i||(i=w=>{if(!o)return;if(s==="identity"){if(w.key==="Escape"){w.preventDefault(),w.stopImmediatePropagation();let F=r;I(),e.onCancel(F)}else w.key==="Enter"&&Ut()===c&&(w.preventDefault(),w.stopImmediatePropagation(),g({name:c?.value.trim()||null}));return}if(!n)return;let R=Ut();if(R!==n){if(y(R))return;n.focus()}if(w.stopImmediatePropagation(),w.key==="Enter"&&!w.shiftKey)w.preventDefault(),v();else if(w.key==="Escape"){w.preventDefault();let F=r;I(),e.onCancel(F)}},document.addEventListener("keydown",i,!0))}function C(){i&&(document.removeEventListener("keydown",i,!0),i=null)}function I(){o=!1,t?.remove(),t=null,n=null,c=null,s="comment",C()}return{show(w){I();let R=h();d=w.initialValue??"",n.value=d,r={mode:w.mode,entryId:w.entryId},a=w.askIdentity===!0&&w.mode==="new",o=!0,w.mode==="edit"&&R.appendChild(b()),m(R,w.anchor),x(),n?.focus(),requestAnimationFrame(()=>n?.focus())},hide(){o&&I()},isVisible(){return o},hasDraft(){if(!o)return!1;if(s==="identity")return!0;let w=n?.value.trim()??"";return w!==""&&w!==d.trim()},isPopoverElement(w){if(!t)return!1;let R=w;for(;R;){if(R===t||R.id===z)return!0;R=R.parentElement}return!1},dispose(){I(),M(rn)}}}var Ko="__grabby-copy-sheet__",Vo="copy-sheet",zo=[{id:"compact",label:"Compact",hint:"One line per comment: file, component and your note."},{id:"standard",label:"Standard",hint:"Adds the element, its key facts and styles. Best for most fixes."},{id:"detailed",label:"Detailed",hint:"Adds ancestors, position and all custom styles, for tricky layout bugs."}],os=`
541
+ `)}function h(){if(t)return t;f(),t=document.createElement("div"),t.id=V,t.setAttribute("role","dialog"),t.setAttribute("aria-label","Comment"),n=document.createElement("textarea"),n.placeholder="What should change here?",n.rows=3;let E=document.createElement("span");return E.className="grabby-cp-hint",E.textContent="\u21B5 save \xB7 Esc cancel \xB7 \u21E7\u21B5 newline",t.appendChild(n),t.appendChild(E),D().appendChild(t),t}function m(E,A){let F=window.innerWidth,Y=window.innerHeight,L=300,W=120;if(!A){E.style.left="50%",E.style.top="24px",E.style.transform="translateX(-50%)";return}let k=A.getBoundingClientRect(),T,_;k.right+16+L<=F?(T=k.right+16,_=k.top+k.height/2-W/2):k.left-16-L>=0?(T=k.left-16-L,_=k.top+k.height/2-W/2):k.bottom+12+W<=Y?(T=Math.max(12,Math.min(k.left,F-L-12)),_=k.bottom+12):(T=Math.max(12,Math.min(k.left,F-L-12)),_=Math.max(12,k.top-12-W)),_=Math.max(12,Math.min(_,Y-W-12)),E.style.transform="",E.style.left=`${T}px`,E.style.top=`${_}px`}function y(E){return!!E&&E!==n&&E!==c&&Re(E)}function v(){let E=n?.value.trim();E&&(l=E,a?p():g())}function b(){let E=Y=>L=>{L.stopPropagation(),Y()},A=()=>{let Y=r;I(),e.onCancel(Y)},F=()=>{let Y=r;I(),e.onDelete?.(Y)};return w("div",{class:"grabby-cp-edit-actions"},e.onDelete?w("button",{type:"button",class:"grabby-cp-delete","data-grabby-delete":"",onclick:E(F)},"Delete"):null,w("span",{class:"grabby-cp-spacer"}),w("button",{type:"button",class:"grabby-cp-cancel","data-grabby-cancel":"",onclick:E(A)},"Cancel"),w("button",{type:"button",class:"grabby-cp-post","data-grabby-save":"",onclick:E(v)},"Save"))}function g(E){let A=r,F=l;I(),E?e.onSubmit(F,A,E):e.onSubmit(F,A)}function p(){if(!t)return;s="identity",c=w("input",{type:"text",class:"grabby-cp-name",placeholder:"Your name",maxlength:"80",autocomplete:"name","aria-label":"Your name"});let E=()=>g({name:c?.value.trim()||null});t.replaceChildren(w("div",{class:"grabby-cp-title"},"Thanks! Who is this from?"),w("div",{class:"grabby-cp-sub"},"Your name helps the team follow up. It's remembered in this browser."),c,w("div",{class:"grabby-cp-actions"},w("button",{type:"button",class:"grabby-cp-link","data-grabby-anonymous":"",onclick:A=>{A.stopPropagation(),g({name:null})}},"Post anonymously"),w("button",{type:"button",class:"grabby-cp-post","data-grabby-post":"",onclick:A=>{A.stopPropagation(),E()}},"Post"))),c.focus()}function x(){i||(i=E=>{if(!o)return;if(s==="identity"){if(E.key==="Escape"){E.preventDefault(),E.stopImmediatePropagation();let F=r;I(),e.onCancel(F)}else E.key==="Enter"&&Bt()===c&&(E.preventDefault(),E.stopImmediatePropagation(),g({name:c?.value.trim()||null}));return}if(!n)return;let A=Bt();if(A!==n){if(y(A))return;n.focus()}if(E.stopImmediatePropagation(),E.key==="Enter"&&!E.shiftKey)E.preventDefault(),v();else if(E.key==="Escape"){E.preventDefault();let F=r;I(),e.onCancel(F)}},document.addEventListener("keydown",i,!0))}function S(){i&&(document.removeEventListener("keydown",i,!0),i=null)}function I(){o=!1,t?.remove(),t=null,n=null,c=null,s="comment",S()}return{show(E){I();let A=h();d=E.initialValue??"",n.value=d,r={mode:E.mode,entryId:E.entryId},a=E.askIdentity===!0&&E.mode==="new",o=!0,E.mode==="edit"&&A.appendChild(b()),m(A,E.anchor),x(),n?.focus(),requestAnimationFrame(()=>n?.focus())},hide(){o&&I()},isVisible(){return o},hasDraft(){if(!o)return!1;if(s==="identity")return!0;let E=n?.value.trim()??"";return E!==""&&E!==d.trim()},isPopoverElement(E){if(!t)return!1;let A=E;for(;A;){if(A===t||A.id===V)return!0;A=A.parentElement}return!1},dispose(){I(),P(sn)}}}var Ko="__grabby-copy-sheet__",zo="copy-sheet",Vo=[{id:"compact",label:"Compact",hint:"One line per comment: file, component and your note."},{id:"standard",label:"Standard",hint:"Adds the element, its key facts and styles. Best for most fixes."},{id:"detailed",label:"Detailed",hint:"Adds ancestors, position and all custom styles, for tricky layout bugs."}],rs=`
542
542
  #${Ko} {
543
543
  position: fixed;
544
- bottom: ${he};
544
+ bottom: ${ve};
545
545
  left: 50%;
546
546
  transform: translateX(-50%);
547
547
  z-index: ${2147483647};
@@ -585,10 +585,10 @@ ${t.join(`
585
585
  .grabby-sheet .grabby-btn:hover { background: var(--grabby-popover-hover, #f1f5f9); }
586
586
  .grabby-sheet .grabby-btn-primary { background: var(--grabby-accent, #2563eb); border-color: var(--grabby-accent, #2563eb); color: #fff; }
587
587
  .grabby-sheet .grabby-btn-primary:hover { background: var(--grabby-accent-hover, #1d4ed8); }
588
- `;function rs(){return typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.platform||navigator.userAgent)}function jo(e){let t=null,n=null;function o(){t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null),e.onClose?.())}function r(i){o(),N(Vo,os);let a=i.level,s=!1,l=rs()?"\u2318":"Ctrl",c=S("span",{class:"grabby-sheet-tokens"}),d=S("div",{class:"grabby-sheet-hint"}),f=S("div",{class:"grabby-sheet-status",role:"status","aria-live":"polite"}),h=S("textarea",{"aria-label":"Text that will be copied",spellcheck:"false"}),m=new Map;function y(){c.textContent=`\u2248 ${Do(h.value).toLocaleString()} tokens`}function v(x,C=!1){if(x===a&&!C)return;let I=s&&x!==a;a=x,s=!1,h.value=i.render(a),d.textContent=zo.find(w=>w.id===a)?.hint??"";for(let[w,R]of m)R.setAttribute("aria-checked",String(w===a));f.classList.remove("grabby-error"),f.textContent=I?"Your edits were replaced by the new detail level.":"",y(),e.onLevelChange?.(a)}let b=S("div",{class:"grabby-seg",role:"radiogroup","aria-label":"Detail level"},...zo.map(x=>{let C=S("button",{type:"button",role:"radio","aria-checked":"false",title:x.hint,onclick:I=>{I.stopPropagation(),v(x.id)}},x.label);return m.set(x.id,C),C}));async function g(x){if(await e.onCopy(h.value,x,a)){o();return}h.focus(),h.select(),f.classList.add("grabby-error"),f.textContent=`The browser blocked the clipboard. The text is selected; press ${l}+C to copy it.`}h.addEventListener("input",()=>{s=!0,y()});let p=i.count;t=S("div",{id:Ko,class:"grabby-sheet",role:"dialog","aria-modal":"false","aria-label":"Copy comments"},S("div",{class:"grabby-sheet-head"},S("span",{class:"grabby-sheet-title"},`Copy ${p} comment${p===1?"":"s"} for your AI agent`),c),b,d,h,f,S("div",{class:"grabby-sheet-actions"},S("span",{class:"grabby-spacer"},`${l}+Enter copies and clears \xB7 Esc closes`),S("button",{type:"button",class:"grabby-btn","data-grabby-copy-keep":"",onclick:x=>{x.stopPropagation(),g("keep")}},"Copy, keep comments"),S("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-clear":"",onclick:x=>{x.stopPropagation(),g("clear")}},"Copy & clear"))),n=x=>{t&&(x.key==="Escape"?(x.preventDefault(),x.stopImmediatePropagation(),o()):x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),x.stopImmediatePropagation(),g("clear")))},document.addEventListener("keydown",n,!0),D().appendChild(t),v(a,!0),t.querySelector("[data-grabby-copy-clear]")?.focus()}return{open:r,close:o,isVisible:()=>!!t,isSheetElement:i=>!!t&&(i===t||t.contains(i)),dispose(){o(),M(Vo)}}}var Yo="__grabby-finish-sheet__",Wo="finish-sheet",is=15e3,as=3e3,ss=`
588
+ `;function is(){return typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.platform||navigator.userAgent)}function jo(e){let t=null,n=null;function o(){t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null),e.onClose?.())}function r(i){o(),M(zo,rs);let a=i.level,s=!1,l=is()?"\u2318":"Ctrl",c=w("span",{class:"grabby-sheet-tokens"}),d=w("div",{class:"grabby-sheet-hint"}),f=w("div",{class:"grabby-sheet-status",role:"status","aria-live":"polite"}),h=w("textarea",{"aria-label":"Text that will be copied",spellcheck:"false"}),m=new Map;function y(){c.textContent=`\u2248 ${Do(h.value).toLocaleString()} tokens`}function v(x,S=!1){if(x===a&&!S)return;let I=s&&x!==a;a=x,s=!1,h.value=i.render(a),d.textContent=Vo.find(E=>E.id===a)?.hint??"";for(let[E,A]of m)A.setAttribute("aria-checked",String(E===a));f.classList.remove("grabby-error"),f.textContent=I?"Your edits were replaced by the new detail level.":"",y(),e.onLevelChange?.(a)}let b=w("div",{class:"grabby-seg",role:"radiogroup","aria-label":"Detail level"},...Vo.map(x=>{let S=w("button",{type:"button",role:"radio","aria-checked":"false",title:x.hint,onclick:I=>{I.stopPropagation(),v(x.id)}},x.label);return m.set(x.id,S),S}));async function g(x){if(await e.onCopy(h.value,x,a)){o();return}h.focus(),h.select(),f.classList.add("grabby-error"),f.textContent=`The browser blocked the clipboard. The text is selected; press ${l}+C to copy it.`}h.addEventListener("input",()=>{s=!0,y()});let p=i.count;t=w("div",{id:Ko,class:"grabby-sheet",role:"dialog","aria-modal":"false","aria-label":"Copy comments"},w("div",{class:"grabby-sheet-head"},w("span",{class:"grabby-sheet-title"},`Copy ${p} comment${p===1?"":"s"} for your AI agent`),c),b,d,h,f,w("div",{class:"grabby-sheet-actions"},w("span",{class:"grabby-spacer"},`${l}+Enter copies and clears \xB7 Esc closes`),w("button",{type:"button",class:"grabby-btn","data-grabby-copy-keep":"",onclick:x=>{x.stopPropagation(),g("keep")}},"Copy, keep comments"),w("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-clear":"",onclick:x=>{x.stopPropagation(),g("clear")}},"Copy & clear"))),n=x=>{t&&(x.key==="Escape"?(x.preventDefault(),x.stopImmediatePropagation(),o()):x.key==="Enter"&&(x.metaKey||x.ctrlKey)&&(x.preventDefault(),x.stopImmediatePropagation(),g("clear")))},document.addEventListener("keydown",n,!0),D().appendChild(t),v(a,!0),t.querySelector("[data-grabby-copy-clear]")?.focus()}return{open:r,close:o,isVisible:()=>!!t,isSheetElement:i=>!!t&&(i===t||t.contains(i)),dispose(){o(),P(zo)}}}var Yo="__grabby-finish-sheet__",Wo="finish-sheet",as=15e3,ss=3e3,ls=`
589
589
  #${Yo} {
590
590
  position: fixed;
591
- bottom: ${he};
591
+ bottom: ${ve};
592
592
  left: 50%;
593
593
  transform: translateX(-50%);
594
594
  z-index: ${2147483647};
@@ -619,29 +619,29 @@ ${t.join(`
619
619
  .grabby-finish .grabby-btn[disabled] { opacity: .6; cursor: default; }
620
620
  .grabby-finish .grabby-btn-primary { background: var(--grabby-accent, #2563eb); border-color: var(--grabby-accent, #2563eb); color: #fff; }
621
621
  .grabby-finish .grabby-btn-primary:hover { background: var(--grabby-accent-hover, #1d4ed8); }
622
- `;function an(e,t){return`${e} ${t}${e===1?"":"s"}`}function Xo(e){let t=null,n=null,o={total:0,sent:0,pending:0,failed:0},r=!1,i=null,a=null,s=!1;function l(){r=!1,i&&clearTimeout(i),a&&clearInterval(a),i=null,a=null}function c(){l(),s=!1,t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null))}function d(){c(),e.onDone()}function f(){if(o.pending===0||s){d();return}r=!0,e.onRetry(),a=setInterval(e.onRetry,as),i=setTimeout(()=>{l(),s=!0,m()},is),m()}function h(y,v,b=!1,g=!1){let p=S("button",{type:"button",class:b?"grabby-btn grabby-btn-primary":"grabby-btn",onclick:x=>{x.stopPropagation(),v()}},y);return p.disabled=g,p}function m(){if(!t)return;let{total:y,sent:v,pending:b,failed:g}=o,p=[],x="";y===0?p.push(S("div",{class:"grabby-finish-line"},"You haven't left any comments yet.")):b===0&&g===0?(p.push(S("div",{class:"grabby-finish-line","data-tone":"ok"},y===1?"\u2713 Your comment was sent to the team.":`\u2713 All ${y} comments were sent to the team.`)),x="Press Done to start a fresh list, or just close this tab."):(v&&p.push(S("div",{class:"grabby-finish-line","data-tone":"ok"},`\u2713 ${an(v,"comment")} sent to the team`)),b&&p.push(S("div",{class:"grabby-finish-line"},`${an(b,"comment")} still sending\u2026`)),g&&p.push(S("div",{class:"grabby-finish-line","data-tone":"error"},`${an(g,"comment")} couldn't be sent`)),s&&b?x="They're saved in this browser and will be sent the next time you open this site. You can close this tab.":b?x="Keep this tab open for a moment.":g&&(x="Try again, or let the team know your feedback didn't go through."));let C=[h("Keep reviewing",c)];g&&C.push(h("Try again",e.onRetry)),y===0?C.push(h("Exit feedback mode",d,!0)):r?C.push(h("Sending\u2026",()=>{},!0,!0)):C.push(h("Done",f,!0)),t.replaceChildren(S("div",{class:"grabby-finish-title"},"Your review"),S("div",{class:"grabby-finish-lines",role:"status","aria-live":"polite"},...p),...x?[S("div",{class:"grabby-finish-note"},x)]:[],S("div",{class:"grabby-finish-actions"},...C)),t.querySelector(".grabby-btn-primary:not([disabled])")?.focus()}return{open(y){c(),N(Wo,ss),o=y,t=S("div",{id:Yo,class:"grabby-finish",role:"dialog","aria-modal":"false","aria-label":"Finish review"}),n=v=>{t&&v.key==="Escape"&&(v.preventDefault(),v.stopImmediatePropagation(),c())},document.addEventListener("keydown",n,!0),D().appendChild(t),m()},update(y){if(t){if(o=y,r&&y.pending===0&&(l(),y.failed===0)){d();return}m()}},close:c,isVisible:()=>!!t,isSheetElement:y=>!!t&&(y===t||t.contains(y)),dispose(){c(),M(Wo)}}}var Ee="__grabby-coach__",qo="coach-mark",Zo="grabby:v1:onboarded",ls=`
623
- #${Ee} {
624
- position: fixed; bottom: ${he}; left: 50%; transform: translateX(-50%);
622
+ `;function ln(e,t){return`${e} ${t}${e===1?"":"s"}`}function Xo(e){let t=null,n=null,o={total:0,sent:0,pending:0,failed:0},r=!1,i=null,a=null,s=!1;function l(){r=!1,i&&clearTimeout(i),a&&clearInterval(a),i=null,a=null}function c(){l(),s=!1,t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null))}function d(){c(),e.onDone()}function f(){if(o.pending===0||s){d();return}r=!0,e.onRetry(),a=setInterval(e.onRetry,ss),i=setTimeout(()=>{l(),s=!0,m()},as),m()}function h(y,v,b=!1,g=!1){let p=w("button",{type:"button",class:b?"grabby-btn grabby-btn-primary":"grabby-btn",onclick:x=>{x.stopPropagation(),v()}},y);return p.disabled=g,p}function m(){if(!t)return;let{total:y,sent:v,pending:b,failed:g}=o,p=[],x="";y===0?p.push(w("div",{class:"grabby-finish-line"},"You haven't left any comments yet.")):b===0&&g===0?(p.push(w("div",{class:"grabby-finish-line","data-tone":"ok"},y===1?"\u2713 Your comment was sent to the team.":`\u2713 All ${y} comments were sent to the team.`)),x="Press Done to start a fresh list, or just close this tab."):(v&&p.push(w("div",{class:"grabby-finish-line","data-tone":"ok"},`\u2713 ${ln(v,"comment")} sent to the team`)),b&&p.push(w("div",{class:"grabby-finish-line"},`${ln(b,"comment")} still sending\u2026`)),g&&p.push(w("div",{class:"grabby-finish-line","data-tone":"error"},`${ln(g,"comment")} couldn't be sent`)),s&&b?x="They're saved in this browser and will be sent the next time you open this site. You can close this tab.":b?x="Keep this tab open for a moment.":g&&(x="Try again, or let the team know your feedback didn't go through."));let S=[h("Keep reviewing",c)];g&&S.push(h("Try again",e.onRetry)),y===0?S.push(h("Exit feedback mode",d,!0)):r?S.push(h("Sending\u2026",()=>{},!0,!0)):S.push(h("Done",f,!0)),t.replaceChildren(w("div",{class:"grabby-finish-title"},"Your review"),w("div",{class:"grabby-finish-lines",role:"status","aria-live":"polite"},...p),...x?[w("div",{class:"grabby-finish-note"},x)]:[],w("div",{class:"grabby-finish-actions"},...S)),t.querySelector(".grabby-btn-primary:not([disabled])")?.focus()}return{open(y){c(),M(Wo,ls),o=y,t=w("div",{id:Yo,class:"grabby-finish",role:"dialog","aria-modal":"false","aria-label":"Finish review"}),n=v=>{t&&v.key==="Escape"&&(v.preventDefault(),v.stopImmediatePropagation(),c())},document.addEventListener("keydown",n,!0),D().appendChild(t),m()},update(y){if(t){if(o=y,r&&y.pending===0&&(l(),y.failed===0)){d();return}m()}},close:c,isVisible:()=>!!t,isSheetElement:y=>!!t&&(y===t||t.contains(y)),dispose(){c(),P(Wo)}}}var Se="__grabby-coach__",qo="coach-mark",Zo="grabby:v1:onboarded",cs=`
623
+ #${Se} {
624
+ position: fixed; bottom: ${ve}; left: 50%; transform: translateX(-50%);
625
625
  z-index: ${2147483647}; width: min(320px, calc(100vw - 32px)); box-sizing: border-box;
626
626
  padding: 14px 16px; border-radius: 12px; background: #0f172a; color: #f8fafc;
627
627
  font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
628
628
  box-shadow: 0 12px 32px rgba(15, 23, 42, .3); animation: grabby-coach-in .2s ease;
629
629
  }
630
- #${Ee}::after {
630
+ #${Se}::after {
631
631
  content: ''; position: absolute; bottom: -6px; left: 50%; margin-left: -6px;
632
632
  border: 6px solid transparent; border-bottom: 0; border-top-color: #0f172a;
633
633
  }
634
634
  @keyframes grabby-coach-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
635
- #${Ee} strong { display: block; font-size: 14px; margin-bottom: 6px; }
636
- #${Ee} ol { margin: 0 0 10px; padding-left: 20px; }
637
- #${Ee} li { margin: 2px 0; }
638
- #${Ee} button {
635
+ #${Se} strong { display: block; font-size: 14px; margin-bottom: 6px; }
636
+ #${Se} ol { margin: 0 0 10px; padding-left: 20px; }
637
+ #${Se} li { margin: 2px 0; }
638
+ #${Se} button {
639
639
  font: 600 12px/1 inherit; font-family: inherit; padding: 7px 12px; border-radius: 7px; border: 0;
640
640
  background: #f8fafc; color: #0f172a; cursor: pointer; float: right;
641
641
  }
642
- #${Ee} .grabby-coach-foot { overflow: hidden; color: #94a3b8; font-size: 12px; line-height: 28px; }
643
- `;function cs(){try{return localStorage.getItem(Zo)==="1"}catch{return!1}}function us(){try{localStorage.setItem(Zo,"1")}catch{}}function Jo(){let e=null;function t(){us(),e?.remove(),e=null}return{maybeShow(){e||cs()||(N(qo,ls),e=S("div",{id:Ee,role:"dialog","aria-label":"How to leave feedback"},S("strong",null,"Leave feedback on this page"),S("ol",null,S("li",null,"Click ",S("b",null,"Comment")," below."),S("li",null,"Click the part of the page you want to talk about."),S("li",null,"Type your note and press Enter.")),S("div",{class:"grabby-coach-foot"},"A screenshot is attached for you.",S("button",{type:"button",onclick:n=>{n.stopPropagation(),t()}},"Got it"))),D().appendChild(e))},dismiss:t,dispose(){e?.remove(),e=null,M(qo)}}}var sn="grabby:v1:outbox",Qo=[2e3,1e4,3e4,12e4,3e5,6e5],ds=336*60*60*1e3,er=6e4;function ms(){try{let e=localStorage.getItem(sn),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n.id=="string"&&(n.kind==="comment"||n.kind==="shot"||n.kind==="delete"&&typeof n.session=="string")).map(n=>typeof n.created=="number"?n:{...n,created:Date.now()}):[]}catch{return[]}}function fs(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function ln(e){let t=fs(e.server),n=ms().map(b=>({...b,next:0})),o=null,r=!1,i=!1;function a(){try{n.length?localStorage.setItem(sn,JSON.stringify(n)):localStorage.removeItem(sn)}catch{}}function s(b={}){return{...e.projectKey?{"X-Grabby-Key":e.projectKey}:{},...b}}function l(b,g){n.some(p=>p.id===b&&p.kind===g)||(n.push({id:b,kind:g,attempts:0,next:0,created:Date.now()}),a(),c(0))}function c(b){i||(o&&clearTimeout(o),o=setTimeout(()=>{o=null,y()},b))}function d(b){let{screenshot:g,sync:p,pin:x,...C}=b;return C}function f(b){let g=JSON.stringify({comment:d(b)});return fetch(`${t}/v1/comments`,{method:"POST",credentials:"omit",keepalive:g.length<er,headers:s({"Content-Type":"application/json"}),body:g})}function h(b,g){return fetch(`${t}/v1/comments/${encodeURIComponent(b)}`,{method:"DELETE",credentials:"omit",keepalive:!0,headers:s({"X-Grabby-Session":g})})}async function m(b){if(b.kind==="delete"){let R=await h(b.id,b.session);return R.ok||R.status===404?"done":R.status===429||R.status>=500?"retry":"drop"}let g=e.getComment(b.id);if(!g)return"drop";if(b.kind==="comment"){let R=await f(g);return R.ok?(e.getComment(b.id)?.screenshot?.localId&&l(b.id,"shot"),"done"):R.status===429||R.status>=500?"retry":(e.onState(b.id,"failed",await R.text().catch(()=>String(R.status))),"drop")}let p=g.screenshot?.localId,x=p?await e.getScreenshot(p):null;if(!x)return"drop";let{width:C,height:I}=g.screenshot,w=await fetch(`${t}/v1/comments/${encodeURIComponent(b.id)}/screenshot?w=${C}&h=${I}`,{method:"PUT",credentials:"omit",keepalive:x.size<er,headers:s({"Content-Type":x.type||"image/webp","X-Grabby-Session":g.author.sessionId}),body:x});return w.ok||w.status>=400&&w.status<500&&w.status!==429?w.ok?"done":"drop":"retry"}async function y(){if(r||i)return;r=!0;try{let g=Date.now();for(let p of[...n].sort((x,C)=>x.next-C.next)){if(p.next>g)continue;let x;try{x=await m(p)}catch{x="retry"}x==="retry"&&Date.now()-p.created<ds?(p.attempts+=1,p.next=Date.now()+Qo[Math.min(p.attempts-1,Qo.length-1)],p.kind==="comment"&&e.onState(p.id,"pending")):(n=n.filter(C=>C!==p),p.kind==="comment"&&x==="done"&&e.onState(p.id,"sent"),p.kind==="comment"&&x==="retry"&&e.onState(p.id,"failed","could not reach the feedback server for 14 days")),a()}}finally{r=!1}let b=n.reduce((g,p)=>Math.min(g,p.next),1/0);b!==1/0&&c(Math.max(0,b-Date.now()))}let v=()=>{for(let b of n)b.next=0;c(0)};return typeof window<"u"&&window.addEventListener("online",v),n.length&&c(500),{send:b=>l(b,"comment"),remove(b,g,p=0){n=n.filter(x=>x.id!==b),n.push({id:b,kind:"delete",session:g,attempts:0,next:Date.now()+p,created:Date.now()}),a(),c(0)},cancelRemove(b){let g=n.find(p=>p.id===b&&p.kind==="delete");return g?(n=n.filter(p=>p!==g),a(),g.attempts===0):!1},sendScreenshot:b=>{n.some(g=>g.id===b&&g.kind==="comment")||l(b,"shot")},isQueued:b=>n.some(g=>g.id===b),flush:v,flushOnExit(){for(let b of n){if(b.kind==="delete"){b.attempts+=1,h(b.id,b.session).catch(()=>{});continue}if(b.kind!=="comment")continue;let g=e.getComment(b.id);g&&f(g).catch(()=>{})}a()},dispose(){i=!0,o&&clearTimeout(o),typeof window<"u"&&window.removeEventListener("online",v)}}}var tr="grabby",cn="grabby:v1:live";function un(){try{return window.sessionStorage}catch{return null}}function ps(){return un()?.getItem(cn)==="1"}function wt(){try{un()?.setItem(cn,"1")}catch{}}function dn(){try{un()?.removeItem(cn)}catch{}}function nr(e){try{let t=new URL(window.location.href),n=t.searchParams.get(tr);n!==null&&(n&&(!e||n===e)&&wt(),t.searchParams.delete(tr),window.history.replaceState(window.history.state,"",t.pathname+t.search+t.hash))}catch{}return ps()}var mn="__grabby-freeze-overlay__",fn="__grabby-freeze-styles__",or="__grabby-freeze-hover-styles__",rr="__grabby-freeze-anim-styles__",pn="data-grabby-hover",ir=["mouseenter","mouseleave","mouseover","mouseout","pointerenter","pointerleave","pointerover","pointerout"],ar=["focus","blur","focusin","focusout"];function sr(){let e=null,t=!1,n=!1,o=!1,r=[];function i(){Y(fn)||N(fn,`
644
- #${mn} {
642
+ #${Se} .grabby-coach-foot { overflow: hidden; color: #94a3b8; font-size: 12px; line-height: 28px; }
643
+ `;function us(){try{return localStorage.getItem(Zo)==="1"}catch{return!1}}function ds(){try{localStorage.setItem(Zo,"1")}catch{}}function Jo(){let e=null;function t(){ds(),e?.remove(),e=null}return{maybeShow(){e||us()||(M(qo,cs),e=w("div",{id:Se,role:"dialog","aria-label":"How to leave feedback"},w("strong",null,"Leave feedback on this page"),w("ol",null,w("li",null,"Click ",w("b",null,"Comment")," below."),w("li",null,"Click the part of the page you want to talk about."),w("li",null,"Type your note and press Enter.")),w("div",{class:"grabby-coach-foot"},"A screenshot is attached for you.",w("button",{type:"button",onclick:n=>{n.stopPropagation(),t()}},"Got it"))),D().appendChild(e))},dismiss:t,dispose(){e?.remove(),e=null,P(qo)}}}var cn="grabby:v1:outbox",Qo=[2e3,1e4,3e4,12e4,3e5,6e5],ms=336*60*60*1e3,er=6e4;function fs(){try{let e=localStorage.getItem(cn),t=e?JSON.parse(e):[];return Array.isArray(t)?t.filter(n=>typeof n.id=="string"&&(n.kind==="comment"||n.kind==="shot"||n.kind==="delete"&&typeof n.session=="string")).map(n=>typeof n.created=="number"?n:{...n,created:Date.now()}):[]}catch{return[]}}function ps(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function un(e){let t=ps(e.server),n=fs().map(b=>({...b,next:0})),o=null,r=!1,i=!1;function a(){try{n.length?localStorage.setItem(cn,JSON.stringify(n)):localStorage.removeItem(cn)}catch{}}function s(b={}){return{...e.projectKey?{"X-Grabby-Key":e.projectKey}:{},...b}}function l(b,g){n.some(p=>p.id===b&&p.kind===g)||(n.push({id:b,kind:g,attempts:0,next:0,created:Date.now()}),a(),c(0))}function c(b){i||(o&&clearTimeout(o),o=setTimeout(()=>{o=null,y()},b))}function d(b){let{screenshot:g,sync:p,pin:x,...S}=b;return S}function f(b){let g=JSON.stringify({comment:d(b)});return fetch(`${t}/v1/comments`,{method:"POST",credentials:"omit",keepalive:g.length<er,headers:s({"Content-Type":"application/json"}),body:g})}function h(b,g){return fetch(`${t}/v1/comments/${encodeURIComponent(b)}`,{method:"DELETE",credentials:"omit",keepalive:!0,headers:s({"X-Grabby-Session":g})})}async function m(b){if(b.kind==="delete"){let A=await h(b.id,b.session);return A.ok||A.status===404?"done":A.status===429||A.status>=500?"retry":"drop"}let g=e.getComment(b.id);if(!g)return"drop";if(b.kind==="comment"){let A=await f(g);return A.ok?(e.getComment(b.id)?.screenshot?.localId&&l(b.id,"shot"),"done"):A.status===429||A.status>=500?"retry":(e.onState(b.id,"failed",await A.text().catch(()=>String(A.status))),"drop")}let p=g.screenshot?.localId,x=p?await e.getScreenshot(p):null;if(!x)return"drop";let{width:S,height:I}=g.screenshot,E=await fetch(`${t}/v1/comments/${encodeURIComponent(b.id)}/screenshot?w=${S}&h=${I}`,{method:"PUT",credentials:"omit",keepalive:x.size<er,headers:s({"Content-Type":x.type||"image/webp","X-Grabby-Session":g.author.sessionId}),body:x});return E.ok||E.status>=400&&E.status<500&&E.status!==429?E.ok?"done":"drop":"retry"}async function y(){if(r||i)return;r=!0;try{let g=Date.now();for(let p of[...n].sort((x,S)=>x.next-S.next)){if(p.next>g)continue;let x;try{x=await m(p)}catch{x="retry"}x==="retry"&&Date.now()-p.created<ms?(p.attempts+=1,p.next=Date.now()+Qo[Math.min(p.attempts-1,Qo.length-1)],p.kind==="comment"&&e.onState(p.id,"pending")):(n=n.filter(S=>S!==p),p.kind==="comment"&&x==="done"&&e.onState(p.id,"sent"),p.kind==="comment"&&x==="retry"&&e.onState(p.id,"failed","could not reach the feedback server for 14 days")),a()}}finally{r=!1}let b=n.reduce((g,p)=>Math.min(g,p.next),1/0);b!==1/0&&c(Math.max(0,b-Date.now()))}let v=()=>{for(let b of n)b.next=0;c(0)};return typeof window<"u"&&window.addEventListener("online",v),n.length&&c(500),{send:b=>l(b,"comment"),remove(b,g,p=0){n=n.filter(x=>x.id!==b),n.push({id:b,kind:"delete",session:g,attempts:0,next:Date.now()+p,created:Date.now()}),a(),c(0)},cancelRemove(b){let g=n.find(p=>p.id===b&&p.kind==="delete");return g?(n=n.filter(p=>p!==g),a(),g.attempts===0):!1},sendScreenshot:b=>{n.some(g=>g.id===b&&g.kind==="comment")||l(b,"shot")},isQueued:b=>n.some(g=>g.id===b),flush:v,flushOnExit(){for(let b of n){if(b.kind==="delete"){b.attempts+=1,h(b.id,b.session).catch(()=>{});continue}if(b.kind!=="comment")continue;let g=e.getComment(b.id);g&&f(g).catch(()=>{})}a()},dispose(){i=!0,o&&clearTimeout(o),typeof window<"u"&&window.removeEventListener("online",v)}}}var tr="grabby",dn="grabby:v1:live";function mn(){try{return window.sessionStorage}catch{return null}}function bs(){return mn()?.getItem(dn)==="1"}function kt(){try{mn()?.setItem(dn,"1")}catch{}}function fn(){try{mn()?.removeItem(dn)}catch{}}function nr(e){try{let t=new URL(window.location.href),n=t.searchParams.get(tr);n!==null&&(n&&(!e||n===e)&&kt(),t.searchParams.delete(tr),window.history.replaceState(window.history.state,"",t.pathname+t.search+t.hash))}catch{}return bs()}var pn="__grabby-freeze-overlay__",bn="__grabby-freeze-styles__",or="__grabby-freeze-hover-styles__",rr="__grabby-freeze-anim-styles__",gn="data-grabby-hover",ir=["mouseenter","mouseleave","mouseover","mouseout","pointerenter","pointerleave","pointerover","pointerout"],ar=["focus","blur","focusin","focusout"];function sr(){let e=null,t=!1,n=!1,o=!1,r=[];function i(){q(bn)||M(bn,`
644
+ #${pn} {
645
645
  position: fixed;
646
646
  top: 0;
647
647
  left: 0;
@@ -651,26 +651,40 @@ ${t.join(`
651
651
  pointer-events: auto;
652
652
  background: transparent;
653
653
  }
654
- `)}function a(){return e||(i(),e=document.createElement("div"),e.id=mn,e.style.display="none",D().appendChild(e),e)}let s=p=>{p.stopImmediatePropagation()},l=p=>{p.preventDefault(),p.stopImmediatePropagation()};function c(){for(let p of ir)document.addEventListener(p,s,!0);for(let p of ar)document.addEventListener(p,l,!0)}function d(){for(let p of ir)document.removeEventListener(p,s,!0);for(let p of ar)document.removeEventListener(p,l,!0)}function f(p){let x=p;for(;x&&x!==document.documentElement;)x.setAttribute(pn,""),r.push(x),x=x.parentElement}function h(){for(let p of r)p.removeAttribute(pn);r=[]}function m(){if(n)return;let p=[];for(let x of Array.from(document.styleSheets)){let C;try{C=x.cssRules}catch{continue}y(C,p)}p.length!==0&&(N(or,p.join(`
655
- `),"document"),n=!0)}function y(p,x){for(let C of Array.from(p))if(C instanceof CSSStyleRule){if(C.selectorText.includes(":hover")){let I=C.selectorText.replace(/:hover/g,`[${pn}]`);x.push(`${I} { ${C.style.cssText} }`)}}else if(C instanceof CSSMediaRule){let I=[];y(C.cssRules,I),I.length>0&&x.push(`@media ${C.conditionText} { ${I.join(`
656
- `)} }`)}}function v(){M(or),n=!1}function b(){o||(N(rr,`
654
+ `)}function a(){return e||(i(),e=document.createElement("div"),e.id=pn,e.style.display="none",D().appendChild(e),e)}let s=p=>{p.stopImmediatePropagation()},l=p=>{p.preventDefault(),p.stopImmediatePropagation()};function c(){for(let p of ir)document.addEventListener(p,s,!0);for(let p of ar)document.addEventListener(p,l,!0)}function d(){for(let p of ir)document.removeEventListener(p,s,!0);for(let p of ar)document.removeEventListener(p,l,!0)}function f(p){let x=p;for(;x&&x!==document.documentElement;)x.setAttribute(gn,""),r.push(x),x=x.parentElement}function h(){for(let p of r)p.removeAttribute(gn);r=[]}function m(){if(n)return;let p=[];for(let x of Array.from(document.styleSheets)){let S;try{S=x.cssRules}catch{continue}y(S,p)}p.length!==0&&(M(or,p.join(`
655
+ `),"document"),n=!0)}function y(p,x){for(let S of Array.from(p))if(S instanceof CSSStyleRule){if(S.selectorText.includes(":hover")){let I=S.selectorText.replace(/:hover/g,`[${gn}]`);x.push(`${I} { ${S.style.cssText} }`)}}else if(S instanceof CSSMediaRule){let I=[];y(S.cssRules,I),I.length>0&&x.push(`@media ${S.conditionText} { ${I.join(`
656
+ `)} }`)}}function v(){P(or),n=!1}function b(){o||(M(rr,`
657
657
  *, *::before, *::after {
658
658
  animation-play-state: paused !important;
659
659
  transition: none !important;
660
660
  }
661
- `,"document"),o=!0)}function g(){M(rr),o=!1}return{show(p){c(),p&&(f(p),m()),b();let x=a();x.style.display="block",t=!0},hide(){e&&(e.style.display="none"),t=!1,h(),v(),g(),d()},isVisible(){return t},isFreezeElement(p){return p===e||p.id===mn},getElement(){return e},dispose(){h(),v(),g(),d(),e?.remove(),M(fn),e=null,t=!1}}}var Z="__grabby-markers__",qe="__grabby-marker-tip__",bn="__grabby-marker-styles__",St=22,bs=250,gs=500,hs=30,lr=140,ys={size:12,shapes:_e("M10.5 2.5l3 3L6 13H3v-3z","M9 4l3 3")};function cr(e){let t=null,n=null,o=!1,r="",i=null,a=0,s=null,l=new Map;function c(){Y(bn)||N(bn,`
662
- #${Z} {
661
+ `,"document"),o=!0)}function g(){P(rr),o=!1}return{show(p){c(),p&&(f(p),m()),b();let x=a();x.style.display="block",t=!0},hide(){e&&(e.style.display="none"),t=!1,h(),v(),g(),d()},isVisible(){return t},isFreezeElement(p){return p===e||p.id===pn},getElement(){return e},dispose(){h(),v(),g(),d(),e?.remove(),P(bn),e=null,t=!1}}}var lr="__grabby-markers__",cr="__grabby-markers-doc__",gs=1e3,Je="__grabby-marker-tip__",hn="__grabby-marker-styles__",Qe=22,hs=250,ys=500,vs=30,ur=140,xs={size:12,shapes:Ie("M10.5 2.5l3 3L6 13H3v-3z","M9 4l3 3")};function Es(e){for(let n=e.parentElement;n&&n!==document.body&&n!==document.documentElement;n=n.parentElement){let o=getComputedStyle(n);if(o.position==="fixed"||o.position==="sticky"||/(auto|scroll|overlay)/.test(o.overflowY+o.overflowX))return"screen"}let t=getComputedStyle(e).position;return t==="fixed"||t==="sticky"?"screen":"page"}function dr(e){let t=null,n=null,o=null,r=!1,i="",a=null,s=0,l=null,c=new Map;function d(){q(hn)||M(hn,`
662
+ /*
663
+ * Page coordinates: the browser moves these with the page as it
664
+ * scrolls, so they never trail behind their element. (A fixed layer
665
+ * repositioned from script lags a frame behind fast scrolling.)
666
+ */
667
+ #${cr} {
668
+ position: absolute;
669
+ left: 0;
670
+ top: 0;
671
+ width: 0;
672
+ height: 0;
673
+ pointer-events: none;
674
+ z-index: ${2147483645};
675
+ }
676
+ #${lr} {
663
677
  position: fixed;
664
678
  inset: 0;
665
679
  pointer-events: none;
666
680
  z-index: ${2147483645};
667
681
  }
668
- #${Z} .grabby-marker {
682
+ .grabby-markers-layer .grabby-marker {
669
683
  position: absolute;
670
684
  left: 0;
671
685
  top: 0;
672
- width: ${St}px;
673
- height: ${St}px;
686
+ width: ${Qe}px;
687
+ height: ${Qe}px;
674
688
  margin: 0;
675
689
  padding: 0;
676
690
  border: none;
@@ -686,22 +700,22 @@ ${t.join(`
686
700
  pointer-events: auto;
687
701
  transition: transform 0.12s ease, box-shadow 0.15s ease;
688
702
  }
689
- #${Z} .grabby-marker[hidden] { display: none; }
690
- #${Z} .grabby-marker:hover,
691
- #${Z} .grabby-marker:focus-visible {
703
+ .grabby-markers-layer .grabby-marker[hidden] { display: none; }
704
+ .grabby-markers-layer .grabby-marker:hover,
705
+ .grabby-markers-layer .grabby-marker:focus-visible {
692
706
  z-index: 1;
693
707
  outline: none;
694
708
  box-shadow: 0 0 0 2px #fff, 0 0 0 5px color-mix(in srgb, var(--grabby-accent, #2563eb) 35%, transparent), 0 2px 6px rgba(0, 0, 0, 0.25);
695
709
  }
696
- #${Z} .grabby-marker-edit { display: none; }
697
- #${Z} .grabby-marker:hover .grabby-marker-num,
698
- #${Z} .grabby-marker:focus-visible .grabby-marker-num { display: none; }
699
- #${Z} .grabby-marker:hover .grabby-marker-edit,
700
- #${Z} .grabby-marker:focus-visible .grabby-marker-edit { display: block; }
701
- #${Z} .grabby-marker-in {
710
+ .grabby-markers-layer .grabby-marker-edit { display: none; }
711
+ .grabby-markers-layer .grabby-marker:hover .grabby-marker-num,
712
+ .grabby-markers-layer .grabby-marker:focus-visible .grabby-marker-num { display: none; }
713
+ .grabby-markers-layer .grabby-marker:hover .grabby-marker-edit,
714
+ .grabby-markers-layer .grabby-marker:focus-visible .grabby-marker-edit { display: block; }
715
+ .grabby-markers-layer .grabby-marker-in {
702
716
  animation: grabby-marker-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
703
717
  }
704
- #${Z} .grabby-marker-out {
718
+ .grabby-markers-layer .grabby-marker-out {
705
719
  animation: grabby-marker-out 0.2s ease-out both;
706
720
  pointer-events: none;
707
721
  }
@@ -713,7 +727,7 @@ ${t.join(`
713
727
  from { opacity: 1; scale: 1; }
714
728
  to { opacity: 0; scale: 0.3; }
715
729
  }
716
- #${qe} {
730
+ #${Je} {
717
731
  position: fixed;
718
732
  z-index: ${2147483645};
719
733
  max-width: 260px;
@@ -728,16 +742,16 @@ ${t.join(`
728
742
  overflow-wrap: anywhere;
729
743
  animation: grabby-marker-tip-in 0.12s ease both;
730
744
  }
731
- #${qe}[hidden] { display: none; }
732
- #${qe} .grabby-marker-tip-hint { display: block; margin-top: 4px; opacity: 0.6; font-size: 11px; }
745
+ #${Je}[hidden] { display: none; }
746
+ #${Je} .grabby-marker-tip-hint { display: block; margin-top: 4px; opacity: 0.6; font-size: 11px; }
733
747
  @keyframes grabby-marker-tip-in {
734
748
  from { opacity: 0; transform: translateY(-2px); }
735
749
  to { opacity: 1; transform: none; }
736
750
  }
737
751
  @media (prefers-reduced-motion: reduce) {
738
- #${Z} .grabby-marker-in, #${Z} .grabby-marker-out, #${qe} { animation: none; }
752
+ .grabby-markers-layer .grabby-marker-in, .grabby-markers-layer .grabby-marker-out, #${Je} { animation: none; }
739
753
  }
740
- `)}function d(){return t||(c(),t=document.createElement("div"),t.id=Z,n=document.createElement("div"),n.id=qe,n.hidden=!0,n.setAttribute("role","tooltip"),D().append(t,n),t)}function f(){return e.getComments().filter(E=>E.page.route===r).reverse()}function h(E){let A=E.trim();return A.length>lr?`${A.slice(0,lr-1)}\u2026`:A}function m(E){let A=document.createElement("span");A.className="grabby-marker-num";let T=document.createElement("button");T.type="button",T.className="grabby-marker",T.dataset.grabbyMarker=E.id,T.append(A,se(ys,"grabby-marker-edit"));let B={comment:E,button:T,number:A,element:null,lastLookup:0};return T.addEventListener("click",P=>{P.preventDefault(),P.stopPropagation(),p(),e.onOpen(B.comment,B.element,T)}),T.addEventListener("mouseenter",()=>y(B)),T.addEventListener("focus",()=>y(B)),T.addEventListener("mouseleave",()=>v(B)),T.addEventListener("blur",()=>v(B)),B}function y(E){s=E,b(E),e.onHover(E.comment,E.element)}function v(E){s===E&&(s=null,p(),e.onHover(null,null))}function b(E){if(!n)return;let A=document.createElement("span");A.className="grabby-marker-tip-hint",A.textContent="Click to edit",n.replaceChildren(document.createTextNode(h(E.comment.comment)),A),n.hidden=!1,g(E)}function g(E){if(!n||n.hidden)return;let A=E.button.getBoundingClientRect(),T=n.getBoundingClientRect(),B=Math.max(8,Math.min(A.left+A.width/2-T.width/2,window.innerWidth-T.width-8)),P=A.bottom+8,pe=P+T.height>window.innerHeight-8?A.top-8-T.height:P;n.style.left=`${B}px`,n.style.top=`${Math.max(8,pe)}px`}function p(){n&&(n.hidden=!0)}function x(E,A){E.classList.remove("grabby-marker-out","grabby-marker-in"),E.style.animationDelay=`${A}ms`,E.offsetWidth,E.classList.add("grabby-marker-in")}function C(E,A){let T=l.get(E);if(T){if(l.delete(E),s===T&&v(T),!A){T.button.remove();return}T.button.style.animationDelay="0ms",T.button.classList.remove("grabby-marker-in"),T.button.classList.add("grabby-marker-out"),setTimeout(()=>T.button.remove(),220)}}function I(E){if(!o)return;let A=d(),T=f(),B=new Set(T.map(P=>P.id));for(let P of[...l.keys()])B.has(P)||C(P,!E);T.forEach((P,pe)=>{let re=l.get(P.id),Pt=!re;re||(re=m(P),l.set(P.id,re),A.appendChild(re.button)),re.comment=P;let st=String(pe+1);re.number.textContent=st,re.button.setAttribute("aria-label",`Comment ${st}: ${h(P.comment)}. Click to edit.`),(E||Pt)&&x(re.button,E?pe*hs:0)}),s&&l.get(s.comment.id)===s&&b(s),w(performance.now()),F()}function w(E){for(let A of l.values()){A.element?.isConnected||(A.element=null,E-A.lastLookup>=gs&&(A.lastLookup=E,A.element=e.findElement(A.comment)));let T=A.element?.getBoundingClientRect();if(!T||T.width===0&&T.height===0){A.button.hidden=!0;continue}let B=A.comment.pin??{x:1,y:0},P=T.left+B.x*T.width-St/2,pe=T.top+B.y*T.height-St/2;A.button.hidden=!1,A.button.style.transform=`translate(${Math.round(P)}px, ${Math.round(pe)}px)`}s&&g(s)}function R(){i=null;let E=performance.now();if(o){if(E-a>=bs){a=E;let A=e.currentRoute();if(A!==r){r=A;for(let T of[...l.keys()])C(T,!1);I(!0);return}}w(E),F()}}function F(){i===null&&o&&(i=requestAnimationFrame(R))}function W(){i!==null&&cancelAnimationFrame(i),i=null}return{setVisible(E){if(E!==o)if(o=E,E)r=e.currentRoute(),a=performance.now(),I(!0);else{W(),p(),s&&v(s);for(let A of[...l.keys()])C(A,!0)}},refresh(){I(!1)},isMarkerElement(E){return!!t&&(t===E||t.contains(E))},dispose(){W(),l.clear(),t?.remove(),n?.remove(),t=null,n=null,s=null,o=!1,M(bn)}}}var gn="__grabby-feedback-styles__";function vs(){Y(gn)||N(gn,`
754
+ `)}function f(){return t||(d(),t=document.createElement("div"),t.id=lr,t.className="grabby-markers-layer",n=document.createElement("div"),n.id=cr,n.className="grabby-markers-layer",o=document.createElement("div"),o.id=Je,o.hidden=!0,o.setAttribute("role","tooltip"),D().append(n,t,o),t)}function h(){return e.getComments().filter(k=>k.page.route===i).reverse()}function m(k){let T=k.trim();return T.length>ur?`${T.slice(0,ur-1)}\u2026`:T}function y(k){let T=document.createElement("span");T.className="grabby-marker-num";let _=document.createElement("button");_.type="button",_.className="grabby-marker",_.dataset.grabbyMarker=k.id,_.append(T,le(xs,"grabby-marker-edit"));let X={comment:k,button:_,number:T,element:null,lastLookup:0,context:"page",contextCheckedAt:-1/0};return _.addEventListener("click",B=>{B.preventDefault(),B.stopPropagation(),x(),e.onOpen(X.comment,X.element,_)}),_.addEventListener("mouseenter",()=>v(X)),_.addEventListener("focus",()=>v(X)),_.addEventListener("mouseleave",()=>b(X)),_.addEventListener("blur",()=>b(X)),X}function v(k){l=k,g(k),e.onHover(k.comment,k.element)}function b(k){l===k&&(l=null,x(),e.onHover(null,null))}function g(k){if(!o)return;let T=document.createElement("span");T.className="grabby-marker-tip-hint",T.textContent="Click to edit",o.replaceChildren(document.createTextNode(m(k.comment.comment)),T),o.hidden=!1,p(k)}function p(k){if(!o||o.hidden)return;let T=k.button.getBoundingClientRect(),_=o.getBoundingClientRect(),X=Math.max(8,Math.min(T.left+T.width/2-_.width/2,window.innerWidth-_.width-8)),B=T.bottom+8,de=B+_.height>window.innerHeight-8?T.top-8-_.height:B;o.style.left=`${X}px`,o.style.top=`${Math.max(8,de)}px`}function x(){o&&(o.hidden=!0)}function S(k,T){k.classList.remove("grabby-marker-out","grabby-marker-in"),k.style.animationDelay=`${T}ms`,k.offsetWidth,k.classList.add("grabby-marker-in")}function I(k,T){let _=c.get(k);if(_){if(c.delete(k),l===_&&b(_),!T){_.button.remove();return}_.button.style.animationDelay="0ms",_.button.classList.remove("grabby-marker-in"),_.button.classList.add("grabby-marker-out"),setTimeout(()=>_.button.remove(),220)}}function E(k){if(!r)return;let T=f(),_=h(),X=new Set(_.map(B=>B.id));for(let B of[...c.keys()])X.has(B)||I(B,!k);_.forEach((B,de)=>{let Z=c.get(B.id),ge=!Z;Z||(Z=y(B),c.set(B.id,Z),T.appendChild(Z.button)),Z.comment=B;let ut=String(de+1);Z.number.textContent=ut,Z.button.setAttribute("aria-label",`Comment ${ut}: ${m(B.comment)}. Click to edit.`),(k||ge)&&S(Z.button,k?de*vs:0)}),l&&c.get(l.comment.id)===l&&g(l),A(performance.now()),Y()}function A(k){for(let T of c.values()){T.element?.isConnected||(T.element=null,k-T.lastLookup>=ys&&(T.lastLookup=k,T.element=e.findElement(T.comment)));let _=T.element?.getBoundingClientRect();if(!_||_.width===0&&_.height===0){T.button.hidden=!0;continue}if(k-T.contextCheckedAt>=gs){T.contextCheckedAt=k,T.context=Es(T.element);let ge=T.context==="page"?n:t;ge&&T.button.parentElement!==ge&&ge.appendChild(T.button)}let X=T.comment.pin??{x:1,y:0},B=(document.documentElement.clientWidth||window.innerWidth)-Qe,de=Math.max(0,Math.min(_.left+X.x*_.width-Qe/2,B)),Z=_.top+X.y*_.height-Qe/2;T.context==="page"&&(de+=window.scrollX,Z=Math.max(0,Z+window.scrollY)),T.button.hidden=!1,T.button.style.transform=`translate(${Math.round(de)}px, ${Math.round(Z)}px)`}l&&p(l)}function F(){a=null;let k=performance.now();if(r){if(k-s>=hs){s=k;let T=e.currentRoute();if(T!==i){i=T;for(let _ of[...c.keys()])I(_,!1);E(!0);return}}A(k),Y()}}function Y(){a===null&&r&&(a=requestAnimationFrame(F))}function L(){a!==null&&cancelAnimationFrame(a),a=null}function W(){r&&c.size&&A(performance.now())}return{setVisible(k){if(k!==r)if(r=k,k)i=e.currentRoute(),s=performance.now(),document.addEventListener("scroll",W,{capture:!0,passive:!0}),E(!0);else{document.removeEventListener("scroll",W,!0),L(),x(),l&&b(l);for(let T of[...c.keys()])I(T,!0)}},refresh(){E(!1)},isMarkerElement(k){return[t,n].some(T=>!!T&&(T===k||T.contains(k)))},dispose(){L(),document.removeEventListener("scroll",W,!0),c.clear(),t?.remove(),n?.remove(),n=null,o?.remove(),t=null,o=null,l=null,r=!1,P(hn)}}}var yn="__grabby-feedback-styles__";function ws(){q(yn)||M(yn,`
741
755
  @keyframes grabby-flash {
742
756
  0% { opacity: 1; }
743
757
  100% { opacity: 0; transform: scale(1.02); }
@@ -781,4 +795,4 @@ ${t.join(`
781
795
  height: 10px;
782
796
  flex-shrink: 0;
783
797
  }
784
- `)}function ur(e,t="Selected"){vs();let n=e.getBoundingClientRect(),o=document.createElement("div");o.className="grabby-select-flash",o.style.top=`${n.top}px`,o.style.left=`${n.left}px`,o.style.width=`${n.width}px`,o.style.height=`${n.height}px`,D().appendChild(o);let r=document.createElement("div");r.className="grabby-select-pill",r.append(se(xo),` ${t}`),D().appendChild(r);let i=70,a=n.left+n.width/2-i/2,s=n.top-24;s<4&&(s=n.bottom+6);let l=document.documentElement.clientWidth;a+i>l-4&&(a=l-i-4),a<4&&(a=4),r.style.top=`${s}px`,r.style.left=`${a}px`;let c=()=>{o.remove(),r.remove()};r.addEventListener("animationend",c),setTimeout(c,1200)}function dr(){M(gn)}var Qe="grabby:v1:comments";var we=null,Ze=null,Je=null,mr=!1,xs=100;function hn(){try{let e=localStorage.getItem(Qe);if(!e)return[];let t=JSON.parse(e);return!t||typeof t!="object"||t.v!==1||!Array.isArray(t.entries)?[]:t.entries}catch{try{localStorage.removeItem(Qe)}catch{}return[]}}function yn(e){Je=e,!(we!=null||Ze!=null)&&(we=requestAnimationFrame(Ue),Ze=setTimeout(Ue,xs))}function Ue(){if(we!=null&&(cancelAnimationFrame(we),we=null),Ze!=null&&(clearTimeout(Ze),Ze=null),Je==null)return;let e=Je;Je=null,Es(e)}function Es(e){let t={v:1,entries:e};try{localStorage.setItem(Qe,JSON.stringify(t))}catch(n){if(ws(n)){let o=e.slice(0,Math.floor(e.length/2));try{localStorage.setItem(Qe,JSON.stringify({v:1,entries:o}))}catch{fr()}}else fr()}}function ws(e){if(!e||typeof e!="object")return!1;let t=e;return t.name==="QuotaExceededError"||t.code===22}function fr(){mr||(mr=!0,console.warn("[grabby] saving comments to localStorage failed (quota or other error)."))}function pr(){we!=null&&(cancelAnimationFrame(we),we=null),Je=null;try{localStorage.removeItem(Qe)}catch{}}var oe=null,xn=new Map;function Ss(){if(oe?.isConnected&&oe.contentDocument)return oe.contentDocument;try{return oe=document.createElement("iframe"),oe.setAttribute("aria-hidden","true"),oe.setAttribute("tabindex","-1"),oe.setAttribute("data-grabby-ignore",""),Object.assign(oe.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(oe),oe.contentDocument}catch{return null}}function Cs(e,t,n){let o=t?`${e}[${t}]`:e,r=xn.get(o);r||(r=new Map,xn.set(o,r));let i=n.filter(a=>!r.has(a));if(i.length>0){let a=Ss(),s=a?.defaultView;if(a?.body&&s){let l=a.createElement(e);t&&l.setAttribute("type",t),a.body.appendChild(l);let c=s.getComputedStyle(l);for(let d of i)r.set(d,c.getPropertyValue(d));l.remove()}else for(let l of i)r.set(l,"")}return r}function br(){oe?.remove(),oe=null,xn.clear()}function vn(e){return Math.round(e).toString(16).padStart(2,"0")}function ks(e){let t=e.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?\s*\)$/);if(!t)return e;let[n,o,r]=[Number(t[1]),Number(t[2]),Number(t[3])],i=t[4]===void 0?1:t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]);if(i===0)return"transparent";let a=`#${vn(n)}${vn(o)}${vn(r)}`;return i>=1?/^#(.)\1(.)\2(.)\3$/.test(a)?`#${a[1]}${a[3]}${a[5]}`:a:(i=Math.round(i*100)/100,`${a} ${Math.round(i*100)}%`)}function Ts(e,t){let n=t.trim().replace(/(\d+\.\d{2,})px/g,(r,i)=>`${Math.round(Number(i)*10)/10}px`);/color|background|border|shadow|fill|stroke/.test(e)&&(n=n.replace(/rgba?\([^)]*\)/g,r=>ks(r))),e==="font-family"&&(n=n.split(",")[0].replace(/["']/g,"").trim());let o=n.split(" ");return o.length===4&&o.every(r=>r===o[0])?n=o[0]:o.length===4&&o[0]===o[2]&&o[1]===o[3]&&(n=`${o[0]} ${o[1]}`),n}function Ie(e,t){let n={},o;try{o=getComputedStyle(e)}catch{return n}let r=e.tagName.toLowerCase(),i=r==="input"||r==="button"?e.getAttribute("type"):null,a=Cs(r,i,t);for(let s of t){let l=o.getPropertyValue(s);!l||l===a.get(s)||l==="none"||l==="normal"||l==="auto"||l==="rgba(0, 0, 0, 0)"||/^border/.test(s)&&(/^0px\b/.test(l)||/\bnone\b/.test(l))||(n[s]=Ts(s,l))}return n}var As={"background-color":"bg","border-radius":"radius","font-size":"size","font-weight":"weight","line-height":"line-height","font-family":"font","box-shadow":"shadow","flex-direction":"direction","grid-template-columns":"columns","justify-content":"justify","align-items":"align","text-align":"text-align","object-fit":"fit"};function $e(e){return Object.entries(e).map(([t,n])=>`${As[t]??t} ${t==="box-shadow"?"yes":n}`).join(" \xB7 ")}var _s=["background-color","color","font-size","font-weight","padding","border-radius","border"],Rs=["background-color","border","border-radius","padding","font-size"],Is=["font-size","font-weight","line-height","color","font-family","text-align","letter-spacing"],$s=["object-fit","border-radius","aspect-ratio"],Ls=["display","flex-direction","gap","grid-template-columns","justify-content","align-items","padding","max-width","background-color","border-radius","box-shadow","border"],Ns=["margin","color","background-color","font-size","font-weight","line-height","display","position","z-index","opacity","overflow","box-shadow","border"];function $(e,t,n){n!=null&&n!==""&&(e[t]=n)}function hr(e){let t=e.getBoundingClientRect();return t.width||t.height?`${Math.round(t.width)}\xD7${Math.round(t.height)}`:""}function Ms(e){let t=e.getAttribute("aria-labelledby");return t?t.split(/\s+/).map(n=>e.ownerDocument.getElementById(n)).filter(n=>!!n).map(n=>ee(n,60)).join(" "):""}function En(e){return U(e.getAttribute("aria-label")??"")||Ms(e)}function Ps(e){let t=[];(e.disabled||e.getAttribute("aria-disabled")==="true")&&t.push("disabled");for(let n of["aria-expanded","aria-pressed","aria-selected","aria-checked"]){let o=e.getAttribute(n);o!==null&&t.push(`${n.slice(5)}=${o}`)}return e.getAttribute("aria-current")&&t.push("current"),t.join(", ")}function Ds(e){let t={},n=e.querySelector("img[alt]")?.getAttribute("alt")??"";return $(t,"label",En(e)||ee(e,80)||U(e.getAttribute("title")??"")||U(n)),e.tagName==="A"?$(t,"href",Ke(e.getAttribute("href")??"")):(e.tagName==="BUTTON"||e.tagName==="INPUT")&&$(t,"type",e.getAttribute("type")??(e.tagName==="BUTTON"?"submit":"")),$(t,"state",Ps(e)),$(t,"styles",$e(Ie(e,_s))),t}function Os(e){let t=e.labels;return t&&t.length>0?ee(t[0],60):En(e)||U(e.getAttribute("placeholder")??"",{keepEmails:!0})}function Fs(e){let t={};$(t,"label",Os(e));let n=e.tagName==="INPUT"?e.type||"text":e.tagName.toLowerCase();$(t,"type",n),$(t,"placeholder",U(e.getAttribute("placeholder")??"",{keepEmails:!0}));let o=[];return(e.required||e.getAttribute("aria-required")==="true")&&o.push("required"),e.disabled&&o.push("disabled"),e.getAttribute("aria-invalid")==="true"&&o.push("invalid"),$(t,"state",o.join(", ")),e.tagName==="SELECT"&&$(t,"options",String(e.options.length)),$(t,"styles",$e(Ie(e,Rs))),t}function Hs(e){let t={};return $(t,"text",ee(e,120)),$(t,"styles",$e(Ie(e,Is))),t}function gr(e){let t=Ke(e);return t.split("/").filter(Boolean).pop()??t}function Us(e){let t={};if(e.tagName==="IMG"){let n=e;$(t,"alt",n.hasAttribute("alt")?U(n.alt)||"(empty)":"(missing)"),$(t,"src",gr(n.currentSrc||n.getAttribute("src")||"")),n.naturalWidth&&$(t,"natural",`${n.naturalWidth}\xD7${n.naturalHeight}`)}else e.tagName==="SVG"||e.tagName.toLowerCase()==="svg"?($(t,"label",En(e)||ee(e.querySelector("title")??e,40)),$(t,"viewBox",e.getAttribute("viewBox")??"")):(e.tagName==="VIDEO"||e.tagName==="AUDIO"||e.tagName==="IFRAME")&&($(t,"src",gr(e.getAttribute("src")??e.querySelector("source")?.getAttribute("src")??"")),$(t,"title",U(e.getAttribute("title")??"")));return $(t,"size",hr(e)),$(t,"styles",$e(Ie(e,$s))),t}function Bs(e,t){let n=t?.(e);if(n?.name&&n.hostElement===e)return n.name;let o=e.tagName.toLowerCase();return/^h[1-6]$/.test(o)?"heading":o==="a"?"link":o==="img"||o==="svg"?"image":o==="ul"||o==="ol"?"list":o}function yr(e,t){let n=new Map;for(let r of Array.from(e.children)){if(r.hasAttribute(fe)||/^(SCRIPT|STYLE|TEMPLATE)$/.test(r.tagName))continue;let i=Bs(r,t);n.set(i,(n.get(i)??0)+1)}let o=Array.from(n.entries()).slice(0,6).map(([r,i])=>i>1?`${i}\xD7 ${r}`:r);return n.size>6&&o.push("\u2026"),o.join(", ")}function vr(e){let t=e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]');return t?ee(t,60):""}function Gs(e,t){let n={};return $(n,"heading",vr(e)),$(n,"contains",yr(e,t)),$(n,"size",hr(e)),$(n,"layout",$e(Ie(e,Ls))),n}function Vs(e,t){let n={};$(n,"title",U(e.ownerDocument.title)),$(n,"viewport",`${window.innerWidth}\xD7${window.innerHeight}`);let o=Array.from(e.querySelectorAll('header, nav, main, aside, footer, section, [role="region"]')).filter(r=>!r.parentElement?.closest('header, nav, main, aside, footer, section, [role="region"]')||r.parentElement===e).slice(0,8).map(r=>{let i=vr(r);return i?`${r.tagName.toLowerCase()} "${ne(i,30)}"`:r.tagName.toLowerCase()});return $(n,"regions",o.join(", ")),$(n,"contains",yr(e.tagName==="HTML"?e.ownerDocument.body??e:e,t)),n}function zs(e,t){let n=[],o=e.parentElement;for(;o&&n.length<t&&o.tagName!=="BODY"&&o.tagName!=="HTML";){let r=Array.from(o.classList).filter(i=>!i.startsWith("ng-")&&!i.startsWith("_ng")).slice(0,2);n.push(`${o.tagName.toLowerCase()}${r.length?`.${r.join(".")}`:""}`),o=o.parentElement}return n.reverse().join(" > ")}function Ks(e,t){let n={},o=e.getBoundingClientRect();return(o.width||o.height)&&$(n,"box",`${Math.round(o.left)},${Math.round(o.top)} ${Math.round(o.width)}\xD7${Math.round(o.height)}`),$(n,"ancestors",zs(e,5)),$(n,"computed",$e(Ie(e,Ns))),t!=="section"&&t!=="field"&&!Oe(e)&&$(n,"text",ee(e,240)),n}function xr(e,t,n){let o;switch(t){case"action":o=Ds(e);break;case"field":o=Fs(e);break;case"text":o=Hs(e);break;case"media":o=Us(e);break;case"section":o=Vs(e,n);break;default:o=Gs(e,n)}return{facts:o,extra:Ks(e,t)}}var js=3;function wn(e){return!!e&&!/(^|[\\/])node_modules[\\/]/.test(e)}function Ws(e,t){let n=t.componentResolver?.(e)??null,o=[],r=[];for(let i of n?.stack??[]){let a=i.filePath!==void 0?{filePath:i.filePath,line:i.line??null}:i.hostElement&&t.sourceResolver?t.sourceResolver(i.hostElement):null,s={name:i.name,file:a?.filePath??null,line:a?.line??null};r.push(s),wn(s.file)&&o.length<js&&o.push(s)}return{component:n?.name??null,frames:o.length>0?o:r.slice(0,2)}}function Ys(e,t,n){let o=t.sourceResolver?.(e);if(o&&wn(o.filePath))return{file:o.filePath,line:o.line,column:o.column};let r=n.find(i=>wn(i.file));return r?.file?{file:r.file,line:r.line,column:null}:null}function Er(e,t){let n=t.cleanClasses??(c=>c.filter(d=>!je(d))),o=pt(e),{component:r,frames:i}=Ws(e,t),a=Ys(e,t,i),{facts:s,extra:l}=xr(e,o,t.componentResolver);return{kind:o,tag:e.tagName.toLowerCase(),component:r,source:a,stack:i,selector:Co(e),preview:o==="section"?`<${e.tagName.toLowerCase()}>`:io(e,n),facts:s,extra:l}}var mc=1200,fc=1600,ii=5e3;function pc(e){return e instanceof Element?e.tagName.toLowerCase()===Ht?!1:!e.hasAttribute(fe):!0}function bc(e){e instanceof HTMLElement&&e.hasAttribute(bt)&&(e.style.filter="blur(8px)")}var Rn='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',rt=null,ot;function gc(){let e=window.trustedTypes;if(!e)return Rn;if(ot===void 0)try{ot=e.createPolicy("grabby",{createHTML:t=>t===Rn?t:""})}catch{ot=null}return ot?ot.createHTML(Rn):null}async function hc(){if(rt?.isConnected)return rt;let e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1"),e.setAttribute(fe,""),Object.assign(e.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(e);let t=gc();return t!==null&&await new Promise(n=>{let o=()=>n();e.addEventListener("load",o,{once:!0}),setTimeout(o,1e3);try{e.srcdoc=t}catch{o()}}),rt=e,e}function ai(){rt?.remove(),rt=null}function yc(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}async function si(e){if(typeof window>"u"||!e.isConnected)return null;let t=e.getBoundingClientRect();if(t.width<1||t.height<1)return null;let n=Math.min(t.width,document.documentElement.scrollWidth||t.width),o=Math.min(t.height,fc),r=window.devicePixelRatio||1,i=Math.min(r,mc/Math.max(n,o));return yc((async()=>{let{createContext:s,destroyContext:l,domToBlob:c}=await Promise.resolve().then(()=>(ri(),oi)),d=await s(e,{width:n,height:o,scale:i,type:"image/webp",quality:.8,filter:pc,onCloneEachNode:bc,style:{margin:"0"},timeout:ii});d.sandbox=await hc();let f;try{f=await c(d)}finally{d.sandbox=void 0,l(d)}return f?{blob:f,width:Math.round(n*i),height:Math.round(o*i)}:null})(),ii+1e3)}var li="grabby:v1:session",In="grabby:v1:author";function it(){let e=typeof crypto<"u"?crypto:void 0;if(e&&typeof e.randomUUID=="function")try{return e.randomUUID()}catch{}let t=new Uint8Array(16);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let o=0;o<16;o++)t[o]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var ci=null;function Rt(){try{let e=localStorage.getItem(li);if(e)return e;let t=it();return localStorage.setItem(li,t),t}catch{return ci??=it(),ci}}function It(){try{let e=localStorage.getItem(In);if(!e)return null;let t=JSON.parse(e);return typeof t!="object"||t===null||typeof t.anonymous!="boolean"?null:{name:typeof t.name=="string"?t.name.slice(0,80):null,anonymous:t.anonymous}}catch{return null}}function ui(e){try{localStorage.setItem(In,JSON.stringify(e))}catch{}}function di(){try{localStorage.removeItem(In)}catch{}}function mi(e){return{name:e&&!e.anonymous?e.name:null,anonymous:!e||e.anonymous||!e.name,sessionId:Rt()}}function $t(){return typeof window>"u"?null:window.ng||null}function Ne(e){return e.startsWith("_")?e.slice(1):e}function fi(e){let t=$t();if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=new Set,r=e;for(;r;){let a=t.getComponent(r);a&&!o.has(a)&&(o.add(a),n.push({name:Ne(a.constructor.name),hostElement:r})),r=r.parentElement}if(n.length===0){let a=e;for(;a;){let s=t.getOwningComponent(a);if(s&&!o.has(s)){o.add(s);let l=a.parentElement;for(;l&&t.getComponent(l)!==s;)l=l.parentElement;for(n.push({name:Ne(s.constructor.name),hostElement:l??a.parentElement}),r=l?.parentElement??a.parentElement?.parentElement??null;r;){let c=t.getComponent(r);c&&!o.has(c)&&(o.add(c),n.push({name:Ne(c.constructor.name),hostElement:r})),r=r.parentElement}break}a=a.parentElement}}let i=n.length>0?n[0]:{name:null,hostElement:null};return{name:i.name,hostElement:i.hostElement,stack:n}}function vc(){return globalThis.__GRABBY_SOURCE_MAP__??null}function pi(e){let t=vc();if(!t)return{filePath:null,line:null,column:null};let n=$t();if(!n)return{filePath:null,line:null,column:null};let o=xc(e,n);if(!o)return{filePath:null,line:null,column:null};let r=t[o];return r?{filePath:r.file,line:r.line,column:null}:{filePath:null,line:null,column:null}}function xc(e,t){let n=t.getComponent(e);if(n)return Ne(n.constructor.name);let o=e;for(;o;){let r=t.getOwningComponent(o);if(r)return Ne(r.constructor.name);o=o.parentElement}return null}var bi={name:"Angular",resolveComponent:e=>{let t=fi(e);return t.name?t:null},resolveSource:pi,cleanClasses:e=>e.filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))};var Lt={filePath:null,line:null,column:null};function at(e){let t=e.replace(/\\/g,"/").replace(/^file:\/\//,"").split("?")[0];if(!/^(\/|[A-Za-z]:\/)/.test(t))return t;let n=t.lastIndexOf("/src/");if(n>=0){let o=/\/((?:packages|apps|libs)\/[^/]+)$/.exec(t.slice(0,n));return`${o?`${o[1]}/`:""}${t.slice(n+1)}`}for(let o of["app","pages","components","routes","lib"]){let r=t.lastIndexOf(`/${o}/`);if(r>=0)return t.slice(r+1)}return t.split("/").slice(-3).join("/")}function Ce(e){return(e.replace(/\\/g,"/").split("/").pop()??e).replace(/\.(vue|svelte|[cm]?[jt]sx?)$/,"")}var Ec=["__reactFiber$","__reactInternalInstance$"];function Mt(e){let t=Object.keys(e);for(let n of Ec){let o=t.find(r=>r.startsWith(n));if(o)return e[o]??null}return null}function Nt(e,t=0){if(!e||t>4||typeof e=="string")return null;if(typeof e=="function"){let n=e;return n.displayName||n.name||null}if(typeof e=="object"){let n=e;if(n.displayName)return n.displayName;if(n.render)return Nt(n.render,t+1);if(n.type)return Nt(n.type,t+1)}return null}function $n(e,t=0){if(t>8)return null;if(e.stateNode instanceof Element)return e.stateNode;let n=e.child;for(;n;){let o=$n(n,t+1);if(o)return o;n=n.sibling}return null}var wc=12,Sc=new Set(["Slot","SlotClone","Presence","Primitive","Anonymous","Unknown"]);function Cc(e){return Sc.has(e)||e.startsWith("_")||e.includes(".")}function gi(e){let t=Mt(e);if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=t;for(;o&&n.length<wc;){let r=Nt(o.type);r&&!Cc(r)&&n[n.length-1]?.name!==r&&n.push({name:r,hostElement:$n(o)}),o=o.return}return{name:n[0]?.name??null,hostElement:n[0]?.hostElement??null,stack:n}}var hi="data-grabby-loc",yi=/^(.*?):(\d+):(\d+)(?::([A-Za-z_$][\w$.]*))?$/;function vi(e){let t=e;for(;t;){let n=t.getAttribute?.(hi);if(n)return kc(n);t=t.parentElement}return{filePath:null,line:null,column:null}}function kc(e){let t=yi.exec(e);return t?{filePath:t[1],line:Number(t[2]),column:Number(t[3])}:{filePath:e,line:null,column:null}}function xi(e){let t=e?.getAttribute?.(hi);if(!t)return null;let n=yi.exec(t);return n?{file:n[1],line:Number(n[2]),column:Number(n[3]),name:n[4]??null}:{file:t,line:null,column:null,name:null}}function Tc(e){return!("_debugOwner"in e)&&!("_debugSource"in e)&&!("_debugStack"in e)}function Ac(e){let t=[];for(let n of e.stack){let o=xi(n.hostElement),r=o?.name??(o?Ce(o.file):null);r&&t[t.length-1]?.name!==r&&t.push({name:r,hostElement:n.hostElement})}return t[0]?{name:t[0].name,hostElement:t[0].hostElement,stack:t}:null}var Ei={name:"React",resolveComponent:e=>{let t=gi(e);if(!t.name)return null;let n=Mt(e);return n&&Tc(n)?Ac(t)??{name:null,hostElement:null,stack:[]}:t}};var wi=new Set(["KeepAlive","Transition","TransitionGroup","Teleport","Suspense","BaseTransition","RouterView","RouterLink"]),Si=12;function Ci(e){let t=e??null;for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.nextSibling;return t}function ki(e){let t=e;for(;t;){let n=t.__vueParentComponent;if(n)return n;t=t.parentElement}return null}function _c(e){let t=e.type??{};return t.__name||t.name||t.displayName||(t.__file?Ce(t.__file):null)}function Rc(e){return Ci(e.subTree?.el??e.vnode?.el)}function Ti(e){let t=e;for(;t;){let n=t.__vue__;if(n)return n;t=t.parentElement}return null}function Ic(e){let t=e.$options??{};return t.name||t._componentTag||(t.__file?Ce(t.__file):null)}function $c(e){let t=ki(e);if(t){let o=[];for(let i=t;i&&o.length<Si;i=i.parent){let a=_c(i);a&&!wi.has(a)&&o.push({name:a,hostElement:Rc(i)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}let n=Ti(e);if(n){let o=[];for(let i=n;i&&o.length<Si;i=i.$parent){let a=Ic(i);a&&!wi.has(a)&&o.push({name:a,hostElement:Ci(i.$el)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}return null}function Lc(e){let n=ki(e)?.type?.__file??Ti(e)?.$options?.__file;return n?{filePath:at(n),line:null,column:null}:Lt}var Ai={name:"Vue",resolveComponent:$c,resolveSource:Lc};var Nc=12;function _i(e){let t=e;for(;t;){let n=t.__svelte_meta;if(n?.loc)return{meta:n,el:t};t=t.parentElement}return null}function Mc(e){let t=e.loc?.line;return typeof t!="number"?null:"parent"in e?t:t+1}function Pc(e){let t=_i(e);if(!t?.meta.loc?.file)return null;let{meta:n}=t,o=Ce(n.loc.file),r=[{name:o,hostElement:t.el}];for(let i=n.parent;i&&r.length<Nc;i=i.parent){if(i.type!=="component"||!i.file)continue;let a=Ce(i.file);a!==r[r.length-1].name&&r.push({name:a,hostElement:null,filePath:at(i.file),line:typeof i.line=="number"?i.line:null})}return{name:o,hostElement:t.el,stack:r}}function Dc(e){let t=_i(e),n=t?.meta.loc?.file;if(!t||!n)return Lt;let o=t.meta.loc?.column;return{filePath:at(n),line:Mc(t.meta),column:typeof o=="number"?o+1:null}}var Ri={name:"Svelte",resolveComponent:Pc,resolveSource:Dc,cleanClasses:e=>e.filter(t=>!/^svelte-[a-z0-9]+$/i.test(t)&&!/^s-[A-Za-z0-9_-]{8,}$/.test(t))};var Ii={name:"HTML",resolveComponent:e=>{let t=e.closest("[data-component]"),n=t?.getAttribute("data-component");if(!t||!n)return null;let o=[];for(let r=t;r;r=r.parentElement?.closest("[data-component]")??null){let i=r.getAttribute("data-component");if(i&&o.push({name:i,hostElement:r}),o.length>=12)break}return{name:n,hostElement:t,stack:o}}};var Ln=[bi,Ei,Ai,Ri,Ii];function $i(e=Ln){function t(n){for(let o of e)try{let r=o.resolveComponent(n);if(r?.name)return{adapter:o,result:r}}catch{}return null}return{resolveComponent(n){return t(n)?.result??null},resolveSource(n){let o=vi(n);if(o.filePath)return o;let r=t(n),i=r?[r.adapter,...e.filter(a=>a!==r.adapter)]:e;for(let a of i)try{let s=a.resolveSource?.(n);if(s?.filePath)return s}catch{}return null},frameworkFor(n){return t(n)?.adapter.name??"HTML"},cleanClasses(n){return e.reduce((o,r)=>r.cleanClasses?r.cleanClasses(o):o,n)}}}var Oc=200,Ni="grabby:v1:level",Nn=8e3;function Fc(){return{activationKey:"Alt+G",activationMode:"toggle",keyHoldDuration:0,enabled:!0,enableInInputs:!1,devOnly:!0,showToolbar:!0,themeMode:"light",mode:"local",persistHistory:!0,copyOnComment:!1,detailLevel:"standard",screenshots:!0,captureQueryParams:[]}}function Mi(e){return e?.mode==="live"&&!nr(e.projectKey)?Hc(e):Di(e)}function Hc(e){let t=null,n=[],o=a=>{t?a(t):n.push(a)},r=e.server?Uc(e):null,i={...Pi(),setOptions:a=>o(s=>s.setOptions(a)),registerPlugin:a=>o(s=>s.registerPlugin(a)),unregisterPlugin:a=>o(s=>s.unregisterPlugin(a)),setComponentResolver:a=>o(s=>s.setComponentResolver(a)),setSourceResolver:a=>o(s=>s.setSourceResolver(a)),identify:a=>o(s=>s.identify(a)),show(){if(t){t.show();return}r?.dispose(),wt(),t=Di(e);for(let a of n.splice(0))a(t);Object.assign(i,t)}};return i}function Uc(e){try{if(!localStorage.getItem("grabby:v1:outbox"))return null}catch{return null}let t=hn();return ln({server:e.server,projectKey:e.projectKey,getComment:n=>t.find(o=>o.id===n),getScreenshot:Xe,onState(n,o){t=t.map(r=>r.id===n?{...r,sync:o}:r),yn(t)}})}var Mn="grabby:v1:collapsed";function Bc(){try{return sessionStorage.getItem(Mn)==="1"}catch{return!1}}function Li(e){try{e?sessionStorage.setItem(Mn,"1"):sessionStorage.removeItem(Mn)}catch{}}function Gc(){try{if(typeof ngDevMode<"u"&&ngDevMode===!1)return!1}catch{}try{if(process.env.NODE_ENV==="production")return!1}catch{}return!0}function Vc(e){try{let t=localStorage.getItem(Ni);if(t==="compact"||t==="standard"||t==="detailed")return t}catch{}return e}function zc(e){try{localStorage.setItem(Ni,e)}catch{}}function Pi(){let e=()=>{};return{activate:e,deactivate:e,toggle:e,isActive:()=>!1,setOptions:e,registerPlugin:e,unregisterPlugin:e,setComponentResolver:e,setSourceResolver:e,showToolbar:e,hideToolbar:e,setThemeMode:e,getComments:()=>[],exportComments:()=>"",deleteComment:e,clearComments:e,identify:e,show:e,hide:e,dispose:e}}function Di(e){let n={...Fc(),...e},o=n.mode==="live";if(!o&&n.devOnly&&!Gc())return Pi();let r=n.identity??(o?"ask":"none"),i=null;qn(n.styleNonce);let a=Yn(n);if(n.persistHistory){let u=hn();u.length>0&&(a.state.toolbar={...a.state.toolbar,comments:u})}let s=mo({plainLabels:o}),l=bo(),c=sr(),d=Ro(),f=No(),h=Jo(),m=null,y=$i(n.adapters??Ln),v=y.resolveComponent,b=y.resolveSource,g=u=>y.cleanClasses(u.filter(k=>!je(k))),p=null,x,C=null,I=new Map,w=!1,R=Vc(n.detailLevel),F=Bc(),W=new Map;f.apply(a.state.toolbar.themeMode),Pe();function E(){return a.state.toolbar.comments}function A(u){a.state.toolbar={...a.state.toolbar,comments:u},X.update(a.state),q.refresh(u),ge.update(T())}function T(){let u=E(),k=_=>u.filter(H=>H.sync===_).length;return{total:u.length,sent:k("sent"),pending:k("pending"),failed:k("failed")}}function B(){return ue.hasDraft()||!!m&&E().some(u=>u.sync==="pending")}function P(u,k){let _=Fo(u,k,{origin:location.host});return d.callTransformHook(_,u)}function pe(){return r==="anonymous"?{name:null,anonymous:!0,sessionId:Rt()}:i?{name:i.name,anonymous:!1,sessionId:Rt(),...i.id?{userId:i.id}:{}}:mi(It())}function re(){return r==="ask"&&!i&&!It()}function Pt(){if(r!=="ask")return null;if(i)return i.name;let u=It();return u?u.anonymous||!u.name?"anonymous":u.name:null}function st(u,k){let _=E().find(H=>H.id===u);!_||_.sync===k||(o&&k==="sent"&&te("Feedback sent. Thank you!"),o&&k==="failed"&&te("Your feedback couldn't be sent. Please try again later."),A(E().map(H=>H.id===u?{...H,sync:k}:H)))}function Pn(u){return{componentName:u.target.component,filePath:u.target.source?.file??null,line:u.target.source?.line??null,column:u.target.source?.column??null}}function Fi(u,k,_,H){let G=Date.now(),O={id:it(),createdAt:G,updatedAt:G,status:"open",comment:k,author:pe(),page:{route:Vt(location,a.state.options.captureQueryParams),title:document.title,viewport:[window.innerWidth,window.innerHeight]},target:Er(u,{componentResolver:v,sourceResolver:b,cleanClasses:g}),screenshot:null,framework:y.frameworkFor(u),...m?{sync:"pending"}:{},...H?{pin:H}:{}};I.set(O.id,u),A([O,...E()].slice(0,Oc)),d.callHook("onComment",O,u),m?.send(O.id),_&&Hi(O.id,_);let Q=E().length;if(o)return te("Thanks! Sending your feedback\u2026"),O;let dt={label:Q===1?"Copy":`Copy all ${Q}`,onClick:On,primary:!0};return a.state.options.copyOnComment?Dn(P([O],R)).then(Ot=>{te(Ot?"Comment saved and copied":"Comment saved (clipboard blocked)",{detail:Pn(O),actions:Q>1?[dt]:[]})}):te(Q===1?"Comment saved":`Comment saved \xB7 ${Q} total`,{detail:Pn(O),actions:[dt]}),O}async function Hi(u,k){let _=await k;if(!_)return;await Ho(u,_.blob);let H=E().find(O=>O.id===u);if(!H){nn([u]);return}let G={...H,screenshot:{localId:u,width:_.width,height:_.height}};A(E().map(O=>O.id===u?G:O)),d.callHook("onScreenshot",G,_.blob),m?.sendScreenshot(u)}function ke(u,k,_=!1){if(u.length===0)return;let H=new Set(u),G=E(),O=G.filter(V=>H.has(V.id));for(let V of u)I.delete(V);A(G.filter(V=>!H.has(V.id)));let Q=_&&m?O.filter(V=>V.sync!==void 0):[],dt=new Set(Q.filter(V=>m.isQueued(V.id)).map(V=>V.id));for(let V of Q)m.remove(V.id,V.author.sessionId,k?Nn+500:0);let Ot=O.flatMap(V=>V.screenshot?.localId?[V.screenshot.localId]:[]),mt=it();W.set(mt,setTimeout(()=>{W.delete(mt),nn(Ot)},Nn+500)),k&&te(k,{duration:Nn,actions:[{label:"Undo",onClick:()=>{clearTimeout(W.get(mt)),W.delete(mt);let V=new Set(E().map(K=>K.id)),Wn=new Set(Q.filter(K=>!V.has(K.id)&&(!m.cancelRemove(K.id)||K.sync!=="sent"||dt.has(K.id))).map(K=>K.id)),zi=[...O.filter(K=>!V.has(K.id)).map(K=>Wn.has(K.id)?{...K,sync:"pending"}:K),...E()].sort((K,Ki)=>Ki.createdAt-K.createdAt);A(zi);for(let K of Wn)m?.send(K);te(`Restored ${O.length} comment${O.length===1?"":"s"}`)}}]})}async function Dn(u){try{return await navigator.clipboard.writeText(u),!0}catch(k){return d.callHook("onCopyError",k instanceof Error?k:new Error(String(k))),!1}}function On(){let u=E();if(u.length===0){te("No comments to copy yet");return}ae(),Me.open({count:u.length,level:R,render:k=>P(u,k)})}function Fn(u){return Zn(u)||c.isFreezeElement(u)}function Hn(){ue.hide(),lt(),be.isHolding()&&(p=null,x=void 0,C=null,be.release())}function lt(){w&&(w=!1,s.hide())}function ae(){q.hide(),Hn(),Me.close(),ge.close()}function Ui(){if(ge.isVisible()){ge.close();return}ae(),J(!0),ge.open(T())}function Bi(){ae(),h.dismiss(),J(!0),a.state.toolbar={...a.state.toolbar,visible:!1},X.hide(),o&&dn()}let be=ko({overlay:s,crosshair:l,getComponentResolver:()=>v,getSourceResolver:()=>b,isToolbarElement:Fn,getFreezeElement:()=>c.getElement(),onHover(u){a.state.hoveredElement=u,u&&d.callHook("onElementHover",u)},onSelect(u,k){p=u;let _=u.getBoundingClientRect(),H=(G,O,Q)=>Q>0?Math.min(1,Math.max(0,(G-O)/Q)):.5;x={x:Math.round(H(k.x,_.left,_.width)*1e3)/1e3,y:Math.round(H(k.y,_.top,_.height)*1e3)/1e3},C=a.state.options.screenshots?si(u):null,d.callHook("onElementSelect",u),h.dismiss(),ur(u),be.hold(u),ue.show({anchor:u,mode:"new",askIdentity:re()})}}),Dt=cr({getComments:E,currentRoute:()=>Vt(location,a.state.options.captureQueryParams),findElement(u){let k=I.get(u.id);return k?.isConnected?k:Fe(u.target.selector)},onHover(u,k){be.isHolding()||w||ue.isVisible()||(u&&k?s.show(k,u.target.component,null,[]):s.hide())},onOpen(u,k,_){be.isHolding()||(ae(),J(!0),w=!0,k&&s.show(k,u.target.component,null,[]),ue.show({anchor:k??_,initialValue:u.comment,mode:"edit",entryId:u.id}))}});function ze(){Dt.setVisible(a.state.toolbar.visible&&!F&&a.state.options.enabled)}function ct(){a.state.options.enabled&&(a.state.active||(a.state.toolbar.visible===!1&&a.state.options.showToolbar&&(a.state.toolbar={...a.state.toolbar,visible:!0},X.show()),F&&Un(),ae(),a.state.active=!0,be.activate(),d.callHook("onActivate"),X.update(a.state)))}function J(u=!1){a.state.active&&(!u&&a.state.frozen||(a.state.active=!1,a.state.frozen=!1,c.hide(),be.deactivate(),d.callHook("onDeactivate"),X.update(a.state)))}function Gi(){a.state.frozen=!a.state.frozen,a.state.frozen?c.show(a.state.hoveredElement):c.hide(),X.update(a.state)}let X=Mo({onSelectionMode(){a.state.active?J(!0):ct()},onHistory(){Hn(),Me.close(),q.isVisible()?q.hide():q.show([...E()])},onEnableToggle(){ae();let u=!a.state.options.enabled;a.state.options={...a.state.options,enabled:u},u||J(!0),X.update(a.state)},onDismiss:Vi,onExpand:Un,onFinish:Ui},o?{label:"Comment",dismissLabel:"Hide toolbar",expandLabel:"Leave feedback",hideEnable:!0,review:!!n.server}:{dismissLabel:"Hide toolbar",expandLabel:"Open Grabby toolbar"});function Vi(){ae(),h.dismiss(),J(!0),F=!0,X.collapse(),Li(!0),Pe(),ze()}function Un(){F=!1,X.expand(),Li(!1),Pe(),ze()}let q=Bo({onHover(u){let k=u?Fe(u.target.selector):null;k&&u?s.show(k,u.target.component,null,[]):s.hide()},onEdit(u,k){s.hide();let _=Fe(u.target.selector);q.hide(),ue.show({anchor:_??k,initialValue:u.comment,mode:"edit",entryId:u.id})},onDelete(u){s.hide(),ke([u.id],"Comment deleted",!0)},onCopyAll(){s.hide(),On()},onClearAll(){s.hide();let u=E().length;ke(E().map(k=>k.id),`Cleared ${u} comment${u===1?"":"s"}`,!0),q.hide()},onChangeIdentity(){di(),q.refresh(E()),te("We'll ask for your name on your next comment")}},{variant:o?"live":"local",showSync:!!n.server,identityLabel:Pt}),Me=jo({async onCopy(u,k){let _=E();if(!await Dn(u))return!1;d.callHook("onCopySuccess",u,_);let G=`${_.length} comment${_.length===1?"":"s"}`;return k==="clear"?ke(_.map(O=>O.id),`Copied and cleared ${G}`):te(`Copied ${G}`),!0},onLevelChange(u){R=u,zc(u)}}),ge=Xo({onDone(){let u=E().filter(_=>_.sync==="sent"&&!m?.isQueued(_.id)).map(_=>_.id);if(!E().length){Bi();return}ke(u,null);let k=E().length;te(k?`Thanks for your review! ${k} comment${k===1?" is":"s are"} still sending.`:"Thanks for your review! Your feedback was sent.")},onRetry(){let u=E().filter(k=>k.sync==="failed");if(u.length){let k=new Set(u.map(_=>_.id));A(E().map(_=>k.has(_.id)?{..._,sync:"pending"}:_));for(let _ of k)m?.send(_)}m?.flush()}}),ue=Go({onSubmit(u,k,_){if(_&&ui({name:_.name,anonymous:!_.name}),k.mode==="new"){let G=p,O=C,Q=x;p=null,x=void 0,C=null,G&&Fi(G,u,O,Q),J(!0);return}if(!k.entryId)return;let H=E().map(G=>G.id===k.entryId?{...G,comment:u,updatedAt:Date.now(),...m?{sync:"pending"}:{}}:G);A(H),m?.send(k.entryId),te("Comment updated"),w?lt():q.show([...H])},onCancel(u){if(u.mode==="new"){p=null,x=void 0,C=null,J(!0);return}w?lt():q.show([...E()])},onDelete(u){lt(),u.entryId&&ke([u.entryId],"Comment deleted",!0)}});function Bn(u){let k=ye(u);k&&(Fn(k)||(q.isVisible()||ue.isVisible()||Me.isVisible()||ge.isVisible())&&ae())}document.addEventListener("click",Bn);function Gn(){Ue(),m?.flushOnExit()}function Vn(){document.visibilityState==="hidden"&&Ue()}window.addEventListener("pagehide",Gn),document.addEventListener("visibilitychange",Vn);function zn(u){!o||!B()||(u.preventDefault(),u.returnValue="")}window.addEventListener("beforeunload",zn);function Pe(){a.state.toolbar.visible&&!F?document.documentElement.style.setProperty("--grabby-toast-bottom",Xn):document.documentElement.style.removeProperty("--grabby-toast-bottom")}function Kn(u){u.key.toLowerCase()!=="f"||u.metaKey||u.ctrlKey||u.altKey||Ae(ye(u))||a.state.active&&(u.preventDefault(),Gi())}document.addEventListener("keydown",Kn,!0);function jn(u){if(u.key==="Escape"&&!Ae(ye(u))&&!(ue.isVisible()||Me.isVisible()||ge.isVisible())){if(q.isVisible()){q.hide(),u.preventDefault();return}a.state.active&&(u.preventDefault(),J(!0))}}document.addEventListener("keydown",jn,!0);let ut=_o({getActivationKey:()=>a.state.options.activationKey,getActivationMode:()=>a.state.options.activationMode,getKeyHoldDuration:()=>a.state.options.keyHoldDuration,getEnableInInputs:()=>a.state.options.enableInInputs,onActivate:ct,onDeactivate:()=>J(),isActive:()=>a.state.active}),De={activate:ct,deactivate:()=>J(!0),toggle(){a.state.active?J(!0):ct()},isActive(){return a.state.active},setOptions(u){a.state.options={...a.state.options,...u}},registerPlugin(u){u.options&&(a.state.options={...a.state.options,...u.options}),u.theme&&f.applyOverrides(u.theme),d.register(u,De)},unregisterPlugin(u){d.unregister(u)},setComponentResolver(u){v=u},setSourceResolver(u){b=u},showToolbar(){a.state.toolbar={...a.state.toolbar,visible:!0},X.show(),X.update(a.state),Pe()},hideToolbar(){ae(),a.state.toolbar={...a.state.toolbar,visible:!1},X.hide(),Pe()},setThemeMode(u){a.state.toolbar={...a.state.toolbar,themeMode:u},f.apply(u),X.update(a.state)},getComments(){return[...E()]},exportComments(u={}){let k=u.ids?new Set(u.ids):null,_=k?E().filter(H=>k.has(H.id)):E();return P(_,u.level??R)},deleteComment(u){ke([u],null,!0)},clearComments(){ke(E().map(u=>u.id),null)},identify(u){i=u&&u.name?{id:u.id,name:u.name.slice(0,80)}:null,q.refresh(E())},show(){o&&wt(),De.showToolbar()},hide(){o&&dn(),De.hideToolbar()},dispose(){Ue(),J(!0),document.removeEventListener("click",Bn),window.removeEventListener("pagehide",Gn),window.removeEventListener("beforeunload",zn),document.removeEventListener("visibilitychange",Vn),document.removeEventListener("keydown",Kn,!0),document.removeEventListener("keydown",jn,!0),ut.dispose(),be.dispose(),s.dispose(),l.dispose(),c.dispose(),Dt.dispose(),Eo(),dr(),d.dispose(),ae(),X.dispose(),q.dispose(),ue.dispose(),Me.dispose(),ge.dispose(),h.dispose(),m?.dispose(),f.dispose(),br(),ai(),document.documentElement.style.removeProperty("--grabby-toast-bottom"),Jn()}};return a.state.options.enabled&&ut.start(),a.state.toolbar={...a.state.toolbar,visible:!1},F&&X.collapse(),o&&n.showToolbar&&(De.showToolbar(),F||h.maybeShow()),a.subscribe((u,k)=>{k==="options"&&(u.options.enabled?ut.start():(ut.stop(),J(!0))),k==="options"&&ze(),k==="toolbar"&&(Pe(),ze(),Dt.refresh(),u.options.persistHistory&&(u.toolbar.comments.length>0?yn(u.toolbar.comments):pr()))}),n.server&&(m=ln({server:n.server,projectKey:n.projectKey,getComment:u=>E().find(k=>k.id===u),getScreenshot:Xe,onState:(u,k)=>st(u,k)})),n.webhookUrl&&De.registerPlugin(Io(n.webhookUrl)),ze(),De}function Kc(e){let t=e?.dataset??{},n={};return(t.mode==="live"||t.mode==="local")&&(n.mode=t.mode),t.server&&(n.server=t.server),t.projectKey&&(n.projectKey=t.projectKey),(t.identity==="ask"||t.identity==="anonymous"||t.identity==="none")&&(n.identity=t.identity),t.activationKey&&(n.activationKey=t.activationKey),t.screenshots==="false"&&(n.screenshots=!1),t.webhookUrl&&(n.webhookUrl=t.webhookUrl),t.styleNonce?n.styleNonce=t.styleNonce:e?.nonce&&(n.styleNonce=e.nonce),n}var Oi=Mi(Kc(document.currentScript));window.grabby=Oi;var Wm=Oi;})();
798
+ `)}function mr(e,t="Selected"){ws();let n=e.getBoundingClientRect(),o=document.createElement("div");o.className="grabby-select-flash",o.style.top=`${n.top}px`,o.style.left=`${n.left}px`,o.style.width=`${n.width}px`,o.style.height=`${n.height}px`,D().appendChild(o);let r=document.createElement("div");r.className="grabby-select-pill",r.append(le(xo),` ${t}`),D().appendChild(r);let i=70,a=n.left+n.width/2-i/2,s=n.top-24;s<4&&(s=n.bottom+6);let l=document.documentElement.clientWidth;a+i>l-4&&(a=l-i-4),a<4&&(a=4),r.style.top=`${s}px`,r.style.left=`${a}px`;let c=()=>{o.remove(),r.remove()};r.addEventListener("animationend",c),setTimeout(c,1200)}function fr(){P(yn)}var nt="grabby:v1:comments";var Ce=null,et=null,tt=null,pr=!1,Ss=100;function vn(){try{let e=localStorage.getItem(nt);if(!e)return[];let t=JSON.parse(e);return!t||typeof t!="object"||t.v!==1||!Array.isArray(t.entries)?[]:t.entries}catch{try{localStorage.removeItem(nt)}catch{}return[]}}function xn(e){tt=e,!(Ce!=null||et!=null)&&(Ce=requestAnimationFrame(Ge),et=setTimeout(Ge,Ss))}function Ge(){if(Ce!=null&&(cancelAnimationFrame(Ce),Ce=null),et!=null&&(clearTimeout(et),et=null),tt==null)return;let e=tt;tt=null,Cs(e)}function Cs(e){let t={v:1,entries:e};try{localStorage.setItem(nt,JSON.stringify(t))}catch(n){if(ks(n)){let o=e.slice(0,Math.floor(e.length/2));try{localStorage.setItem(nt,JSON.stringify({v:1,entries:o}))}catch{br()}}else br()}}function ks(e){if(!e||typeof e!="object")return!1;let t=e;return t.name==="QuotaExceededError"||t.code===22}function br(){pr||(pr=!0,console.warn("[grabby] saving comments to localStorage failed (quota or other error)."))}function gr(){Ce!=null&&(cancelAnimationFrame(Ce),Ce=null),tt=null;try{localStorage.removeItem(nt)}catch{}}var ie=null,wn=new Map;function Ts(){if(ie?.isConnected&&ie.contentDocument)return ie.contentDocument;try{return ie=document.createElement("iframe"),ie.setAttribute("aria-hidden","true"),ie.setAttribute("tabindex","-1"),ie.setAttribute("data-grabby-ignore",""),Object.assign(ie.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(ie),ie.contentDocument}catch{return null}}function As(e,t,n){let o=t?`${e}[${t}]`:e,r=wn.get(o);r||(r=new Map,wn.set(o,r));let i=n.filter(a=>!r.has(a));if(i.length>0){let a=Ts(),s=a?.defaultView;if(a?.body&&s){let l=a.createElement(e);t&&l.setAttribute("type",t),a.body.appendChild(l);let c=s.getComputedStyle(l);for(let d of i)r.set(d,c.getPropertyValue(d));l.remove()}else for(let l of i)r.set(l,"")}return r}function hr(){ie?.remove(),ie=null,wn.clear()}function En(e){return Math.round(e).toString(16).padStart(2,"0")}function _s(e){let t=e.match(/^rgba?\(\s*([\d.]+)[,\s]+([\d.]+)[,\s]+([\d.]+)(?:[,\s/]+([\d.]+%?))?\s*\)$/);if(!t)return e;let[n,o,r]=[Number(t[1]),Number(t[2]),Number(t[3])],i=t[4]===void 0?1:t[4].endsWith("%")?Number(t[4].slice(0,-1))/100:Number(t[4]);if(i===0)return"transparent";let a=`#${En(n)}${En(o)}${En(r)}`;return i>=1?/^#(.)\1(.)\2(.)\3$/.test(a)?`#${a[1]}${a[3]}${a[5]}`:a:(i=Math.round(i*100)/100,`${a} ${Math.round(i*100)}%`)}function Rs(e,t){let n=t.trim().replace(/(\d+\.\d{2,})px/g,(r,i)=>`${Math.round(Number(i)*10)/10}px`);/color|background|border|shadow|fill|stroke/.test(e)&&(n=n.replace(/rgba?\([^)]*\)/g,r=>_s(r))),e==="font-family"&&(n=n.split(",")[0].replace(/["']/g,"").trim());let o=n.split(" ");return o.length===4&&o.every(r=>r===o[0])?n=o[0]:o.length===4&&o[0]===o[2]&&o[1]===o[3]&&(n=`${o[0]} ${o[1]}`),n}function $e(e,t){let n={},o;try{o=getComputedStyle(e)}catch{return n}let r=e.tagName.toLowerCase(),i=r==="input"||r==="button"?e.getAttribute("type"):null,a=As(r,i,t);for(let s of t){let l=o.getPropertyValue(s);!l||l===a.get(s)||l==="none"||l==="normal"||l==="auto"||l==="rgba(0, 0, 0, 0)"||/^border/.test(s)&&(/^0px\b/.test(l)||/\bnone\b/.test(l))||(n[s]=Rs(s,l))}return n}var Is={"background-color":"bg","border-radius":"radius","font-size":"size","font-weight":"weight","line-height":"line-height","font-family":"font","box-shadow":"shadow","flex-direction":"direction","grid-template-columns":"columns","justify-content":"justify","align-items":"align","text-align":"text-align","object-fit":"fit"};function Ne(e){return Object.entries(e).map(([t,n])=>`${Is[t]??t} ${t==="box-shadow"?"yes":n}`).join(" \xB7 ")}var Ls=["background-color","color","font-size","font-weight","padding","border-radius","border"],$s=["background-color","border","border-radius","padding","font-size"],Ns=["font-size","font-weight","line-height","color","font-family","text-align","letter-spacing"],Ms=["object-fit","border-radius","aspect-ratio"],Ps=["display","flex-direction","gap","grid-template-columns","justify-content","align-items","padding","max-width","background-color","border-radius","box-shadow","border"],Ds=["margin","color","background-color","font-size","font-weight","line-height","display","position","z-index","opacity","overflow","box-shadow","border"];function $(e,t,n){n!=null&&n!==""&&(e[t]=n)}function vr(e){let t=e.getBoundingClientRect();return t.width||t.height?`${Math.round(t.width)}\xD7${Math.round(t.height)}`:""}function Os(e){let t=e.getAttribute("aria-labelledby");return t?t.split(/\s+/).map(n=>e.ownerDocument.getElementById(n)).filter(n=>!!n).map(n=>ne(n,60)).join(" "):""}function Sn(e){return U(e.getAttribute("aria-label")??"")||Os(e)}function Fs(e){let t=[];(e.disabled||e.getAttribute("aria-disabled")==="true")&&t.push("disabled");for(let n of["aria-expanded","aria-pressed","aria-selected","aria-checked"]){let o=e.getAttribute(n);o!==null&&t.push(`${n.slice(5)}=${o}`)}return e.getAttribute("aria-current")&&t.push("current"),t.join(", ")}function Hs(e){let t={},n=e.querySelector("img[alt]")?.getAttribute("alt")??"";return $(t,"label",Sn(e)||ne(e,80)||U(e.getAttribute("title")??"")||U(n)),e.tagName==="A"?$(t,"href",We(e.getAttribute("href")??"")):(e.tagName==="BUTTON"||e.tagName==="INPUT")&&$(t,"type",e.getAttribute("type")??(e.tagName==="BUTTON"?"submit":"")),$(t,"state",Fs(e)),$(t,"styles",Ne($e(e,Ls))),t}function Us(e){let t=e.labels;return t&&t.length>0?ne(t[0],60):Sn(e)||U(e.getAttribute("placeholder")??"",{keepEmails:!0})}function Bs(e){let t={};$(t,"label",Us(e));let n=e.tagName==="INPUT"?e.type||"text":e.tagName.toLowerCase();$(t,"type",n),$(t,"placeholder",U(e.getAttribute("placeholder")??"",{keepEmails:!0}));let o=[];return(e.required||e.getAttribute("aria-required")==="true")&&o.push("required"),e.disabled&&o.push("disabled"),e.getAttribute("aria-invalid")==="true"&&o.push("invalid"),$(t,"state",o.join(", ")),e.tagName==="SELECT"&&$(t,"options",String(e.options.length)),$(t,"styles",Ne($e(e,$s))),t}function Gs(e){let t={};return $(t,"text",ne(e,120)),$(t,"styles",Ne($e(e,Ns))),t}function yr(e){let t=We(e);return t.split("/").filter(Boolean).pop()??t}function zs(e){let t={};if(e.tagName==="IMG"){let n=e;$(t,"alt",n.hasAttribute("alt")?U(n.alt)||"(empty)":"(missing)"),$(t,"src",yr(n.currentSrc||n.getAttribute("src")||"")),n.naturalWidth&&$(t,"natural",`${n.naturalWidth}\xD7${n.naturalHeight}`)}else e.tagName==="SVG"||e.tagName.toLowerCase()==="svg"?($(t,"label",Sn(e)||ne(e.querySelector("title")??e,40)),$(t,"viewBox",e.getAttribute("viewBox")??"")):(e.tagName==="VIDEO"||e.tagName==="AUDIO"||e.tagName==="IFRAME")&&($(t,"src",yr(e.getAttribute("src")??e.querySelector("source")?.getAttribute("src")??"")),$(t,"title",U(e.getAttribute("title")??"")));return $(t,"size",vr(e)),$(t,"styles",Ne($e(e,Ms))),t}function Vs(e,t){let n=t?.(e);if(n?.name&&n.hostElement===e)return n.name;let o=e.tagName.toLowerCase();return/^h[1-6]$/.test(o)?"heading":o==="a"?"link":o==="img"||o==="svg"?"image":o==="ul"||o==="ol"?"list":o}function xr(e,t){let n=new Map;for(let r of Array.from(e.children)){if(r.hasAttribute(be)||/^(SCRIPT|STYLE|TEMPLATE)$/.test(r.tagName))continue;let i=Vs(r,t);n.set(i,(n.get(i)??0)+1)}let o=Array.from(n.entries()).slice(0,6).map(([r,i])=>i>1?`${i}\xD7 ${r}`:r);return n.size>6&&o.push("\u2026"),o.join(", ")}function Er(e){let t=e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]');return t?ne(t,60):""}function Ks(e,t){let n={};return $(n,"heading",Er(e)),$(n,"contains",xr(e,t)),$(n,"size",vr(e)),$(n,"layout",Ne($e(e,Ps))),n}function js(e,t){let n={};$(n,"title",U(e.ownerDocument.title)),$(n,"viewport",`${window.innerWidth}\xD7${window.innerHeight}`);let o=Array.from(e.querySelectorAll('header, nav, main, aside, footer, section, [role="region"]')).filter(r=>!r.parentElement?.closest('header, nav, main, aside, footer, section, [role="region"]')||r.parentElement===e).slice(0,8).map(r=>{let i=Er(r);return i?`${r.tagName.toLowerCase()} "${re(i,30)}"`:r.tagName.toLowerCase()});return $(n,"regions",o.join(", ")),$(n,"contains",xr(e.tagName==="HTML"?e.ownerDocument.body??e:e,t)),n}function Ws(e,t){let n=[],o=e.parentElement;for(;o&&n.length<t&&o.tagName!=="BODY"&&o.tagName!=="HTML";){let r=Array.from(o.classList).filter(i=>!i.startsWith("ng-")&&!i.startsWith("_ng")).slice(0,2);n.push(`${o.tagName.toLowerCase()}${r.length?`.${r.join(".")}`:""}`),o=o.parentElement}return n.reverse().join(" > ")}function Ys(e,t){let n={},o=e.getBoundingClientRect();return(o.width||o.height)&&$(n,"box",`${Math.round(o.left)},${Math.round(o.top)} ${Math.round(o.width)}\xD7${Math.round(o.height)}`),$(n,"ancestors",Ws(e,5)),$(n,"computed",Ne($e(e,Ds))),t!=="section"&&t!=="field"&&!He(e)&&$(n,"text",ne(e,240)),n}function wr(e,t,n){let o;switch(t){case"action":o=Hs(e);break;case"field":o=Bs(e);break;case"text":o=Gs(e);break;case"media":o=zs(e);break;case"section":o=js(e,n);break;default:o=Ks(e,n)}return{facts:o,extra:Ys(e,t)}}var Xs=3;function Cn(e){return!!e&&!/(^|[\\/])node_modules[\\/]/.test(e)}function qs(e,t){let n=t.componentResolver?.(e)??null,o=[],r=[];for(let i of n?.stack??[]){let a=i.filePath!==void 0?{filePath:i.filePath,line:i.line??null}:i.hostElement&&t.sourceResolver?t.sourceResolver(i.hostElement):null,s={name:i.name,file:a?.filePath??null,line:a?.line??null};r.push(s),Cn(s.file)&&o.length<Xs&&o.push(s)}return{component:n?.name??null,frames:o.length>0?o:r.slice(0,2)}}function Zs(e,t,n){let o=t.sourceResolver?.(e);if(o&&Cn(o.filePath))return{file:o.filePath,line:o.line,column:o.column};let r=n.find(i=>Cn(i.file));return r?.file?{file:r.file,line:r.line,column:null}:null}function Sr(e,t){let n=t.cleanClasses??(c=>c.filter(d=>!Ye(d))),o=ht(e),{component:r,frames:i}=qs(e,t),a=Zs(e,t,i),{facts:s,extra:l}=wr(e,o,t.componentResolver);return{kind:o,tag:e.tagName.toLowerCase(),component:r,source:a,stack:i,selector:Co(e),preview:o==="section"?`<${e.tagName.toLowerCase()}>`:ao(e,n),facts:s,extra:l}}var bc=1200,gc=1600,si=5e3;function hc(e){return e instanceof Element?e.tagName.toLowerCase()===Ut?!1:!e.hasAttribute(be):!0}function yc(e){e instanceof HTMLElement&&e.hasAttribute(yt)&&(e.style.filter="blur(8px)")}var Ln='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',st=null,at;function vc(){let e=window.trustedTypes;if(!e)return Ln;if(at===void 0)try{at=e.createPolicy("grabby",{createHTML:t=>t===Ln?t:""})}catch{at=null}return at?at.createHTML(Ln):null}async function xc(){if(st?.isConnected)return st;let e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1"),e.setAttribute(be,""),Object.assign(e.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(e);let t=vc();return t!==null&&await new Promise(n=>{let o=()=>n();e.addEventListener("load",o,{once:!0}),setTimeout(o,1e3);try{e.srcdoc=t}catch{o()}}),st=e,e}function li(){st?.remove(),st=null}function Ec(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}async function ci(e){if(typeof window>"u"||!e.isConnected)return null;let t=e.getBoundingClientRect();if(t.width<1||t.height<1)return null;let n=Math.min(t.width,document.documentElement.scrollWidth||t.width),o=Math.min(t.height,gc),r=window.devicePixelRatio||1,i=Math.min(r,bc/Math.max(n,o));return Ec((async()=>{let{createContext:s,destroyContext:l,domToBlob:c}=await Promise.resolve().then(()=>(ai(),ii)),d=await s(e,{width:n,height:o,scale:i,type:"image/webp",quality:.8,filter:hc,onCloneEachNode:yc,style:{margin:"0"},timeout:si});d.sandbox=await xc();let f;try{f=await c(d)}finally{d.sandbox=void 0,l(d)}return f?{blob:f,width:Math.round(n*i),height:Math.round(o*i)}:null})(),si+1e3)}var ui="grabby:v1:session",$n="grabby:v1:author";function lt(){let e=typeof crypto<"u"?crypto:void 0;if(e&&typeof e.randomUUID=="function")try{return e.randomUUID()}catch{}let t=new Uint8Array(16);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let o=0;o<16;o++)t[o]=Math.floor(Math.random()*256);t[6]=t[6]&15|64,t[8]=t[8]&63|128;let n=Array.from(t,o=>o.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var di=null;function Lt(){try{let e=localStorage.getItem(ui);if(e)return e;let t=lt();return localStorage.setItem(ui,t),t}catch{return di??=lt(),di}}function $t(){try{let e=localStorage.getItem($n);if(!e)return null;let t=JSON.parse(e);return typeof t!="object"||t===null||typeof t.anonymous!="boolean"?null:{name:typeof t.name=="string"?t.name.slice(0,80):null,anonymous:t.anonymous}}catch{return null}}function mi(e){try{localStorage.setItem($n,JSON.stringify(e))}catch{}}function fi(){try{localStorage.removeItem($n)}catch{}}function pi(e){return{name:e&&!e.anonymous?e.name:null,anonymous:!e||e.anonymous||!e.name,sessionId:Lt()}}function Nt(){return typeof window>"u"?null:window.ng||null}function Pe(e){return e.startsWith("_")?e.slice(1):e}function bi(e){let t=Nt();if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=new Set,r=e;for(;r;){let a=t.getComponent(r);a&&!o.has(a)&&(o.add(a),n.push({name:Pe(a.constructor.name),hostElement:r})),r=r.parentElement}if(n.length===0){let a=e;for(;a;){let s=t.getOwningComponent(a);if(s&&!o.has(s)){o.add(s);let l=a.parentElement;for(;l&&t.getComponent(l)!==s;)l=l.parentElement;for(n.push({name:Pe(s.constructor.name),hostElement:l??a.parentElement}),r=l?.parentElement??a.parentElement?.parentElement??null;r;){let c=t.getComponent(r);c&&!o.has(c)&&(o.add(c),n.push({name:Pe(c.constructor.name),hostElement:r})),r=r.parentElement}break}a=a.parentElement}}let i=n.length>0?n[0]:{name:null,hostElement:null};return{name:i.name,hostElement:i.hostElement,stack:n}}function wc(){return globalThis.__GRABBY_SOURCE_MAP__??null}function gi(e){let t=wc();if(!t)return{filePath:null,line:null,column:null};let n=Nt();if(!n)return{filePath:null,line:null,column:null};let o=Sc(e,n);if(!o)return{filePath:null,line:null,column:null};let r=t[o];return r?{filePath:r.file,line:r.line,column:null}:{filePath:null,line:null,column:null}}function Sc(e,t){let n=t.getComponent(e);if(n)return Pe(n.constructor.name);let o=e;for(;o;){let r=t.getOwningComponent(o);if(r)return Pe(r.constructor.name);o=o.parentElement}return null}var hi={name:"Angular",resolveComponent:e=>{let t=bi(e);return t.name?t:null},resolveSource:gi,cleanClasses:e=>e.filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))};var Mt={filePath:null,line:null,column:null};function ct(e){let t=e.replace(/\\/g,"/").replace(/^file:\/\//,"").split("?")[0];if(!/^(\/|[A-Za-z]:\/)/.test(t))return t;let n=t.lastIndexOf("/src/");if(n>=0){let o=/\/((?:packages|apps|libs)\/[^/]+)$/.exec(t.slice(0,n));return`${o?`${o[1]}/`:""}${t.slice(n+1)}`}for(let o of["app","pages","components","routes","lib"]){let r=t.lastIndexOf(`/${o}/`);if(r>=0)return t.slice(r+1)}return t.split("/").slice(-3).join("/")}function Te(e){return(e.replace(/\\/g,"/").split("/").pop()??e).replace(/\.(vue|svelte|[cm]?[jt]sx?)$/,"")}var Cc=["__reactFiber$","__reactInternalInstance$"];function Dt(e){let t=Object.keys(e);for(let n of Cc){let o=t.find(r=>r.startsWith(n));if(o)return e[o]??null}return null}function Pt(e,t=0){if(!e||t>4||typeof e=="string")return null;if(typeof e=="function"){let n=e;return n.displayName||n.name||null}if(typeof e=="object"){let n=e;if(n.displayName)return n.displayName;if(n.render)return Pt(n.render,t+1);if(n.type)return Pt(n.type,t+1)}return null}function Nn(e,t=0){if(t>8)return null;if(e.stateNode instanceof Element)return e.stateNode;let n=e.child;for(;n;){let o=Nn(n,t+1);if(o)return o;n=n.sibling}return null}var kc=12,Tc=new Set(["Slot","SlotClone","Presence","Primitive","Anonymous","Unknown"]);function Ac(e){return Tc.has(e)||e.startsWith("_")||e.includes(".")}function yi(e){let t=Dt(e);if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=t;for(;o&&n.length<kc;){let r=Pt(o.type);r&&!Ac(r)&&n[n.length-1]?.name!==r&&n.push({name:r,hostElement:Nn(o)}),o=o.return}return{name:n[0]?.name??null,hostElement:n[0]?.hostElement??null,stack:n}}var vi="data-grabby-loc",xi=/^(.*?):(\d+):(\d+)(?::([A-Za-z_$][\w$.]*))?$/;function Ei(e){let t=e;for(;t;){let n=t.getAttribute?.(vi);if(n)return _c(n);t=t.parentElement}return{filePath:null,line:null,column:null}}function _c(e){let t=xi.exec(e);return t?{filePath:t[1],line:Number(t[2]),column:Number(t[3])}:{filePath:e,line:null,column:null}}function wi(e){let t=e?.getAttribute?.(vi);if(!t)return null;let n=xi.exec(t);return n?{file:n[1],line:Number(n[2]),column:Number(n[3]),name:n[4]??null}:{file:t,line:null,column:null,name:null}}function Rc(e){return!("_debugOwner"in e)&&!("_debugSource"in e)&&!("_debugStack"in e)}function Ic(e){let t=[];for(let n of e.stack){let o=wi(n.hostElement),r=o?.name??(o?Te(o.file):null);r&&t[t.length-1]?.name!==r&&t.push({name:r,hostElement:n.hostElement})}return t[0]?{name:t[0].name,hostElement:t[0].hostElement,stack:t}:null}var Si={name:"React",resolveComponent:e=>{let t=yi(e);if(!t.name)return null;let n=Dt(e);return n&&Rc(n)?Ic(t)??{name:null,hostElement:null,stack:[]}:t}};var Ci=new Set(["KeepAlive","Transition","TransitionGroup","Teleport","Suspense","BaseTransition","RouterView","RouterLink"]),ki=12;function Ti(e){let t=e??null;for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.nextSibling;return t}function Ai(e){let t=e;for(;t;){let n=t.__vueParentComponent;if(n)return n;t=t.parentElement}return null}function Lc(e){let t=e.type??{};return t.__name||t.name||t.displayName||(t.__file?Te(t.__file):null)}function $c(e){return Ti(e.subTree?.el??e.vnode?.el)}function _i(e){let t=e;for(;t;){let n=t.__vue__;if(n)return n;t=t.parentElement}return null}function Nc(e){let t=e.$options??{};return t.name||t._componentTag||(t.__file?Te(t.__file):null)}function Mc(e){let t=Ai(e);if(t){let o=[];for(let i=t;i&&o.length<ki;i=i.parent){let a=Lc(i);a&&!Ci.has(a)&&o.push({name:a,hostElement:$c(i)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}let n=_i(e);if(n){let o=[];for(let i=n;i&&o.length<ki;i=i.$parent){let a=Nc(i);a&&!Ci.has(a)&&o.push({name:a,hostElement:Ti(i.$el)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}return null}function Pc(e){let n=Ai(e)?.type?.__file??_i(e)?.$options?.__file;return n?{filePath:ct(n),line:null,column:null}:Mt}var Ri={name:"Vue",resolveComponent:Mc,resolveSource:Pc};var Dc=12;function Ii(e){let t=e;for(;t;){let n=t.__svelte_meta;if(n?.loc)return{meta:n,el:t};t=t.parentElement}return null}function Oc(e){let t=e.loc?.line;return typeof t!="number"?null:"parent"in e?t:t+1}function Fc(e){let t=Ii(e);if(!t?.meta.loc?.file)return null;let{meta:n}=t,o=Te(n.loc.file),r=[{name:o,hostElement:t.el}];for(let i=n.parent;i&&r.length<Dc;i=i.parent){if(i.type!=="component"||!i.file)continue;let a=Te(i.file);a!==r[r.length-1].name&&r.push({name:a,hostElement:null,filePath:ct(i.file),line:typeof i.line=="number"?i.line:null})}return{name:o,hostElement:t.el,stack:r}}function Hc(e){let t=Ii(e),n=t?.meta.loc?.file;if(!t||!n)return Mt;let o=t.meta.loc?.column;return{filePath:ct(n),line:Oc(t.meta),column:typeof o=="number"?o+1:null}}var Li={name:"Svelte",resolveComponent:Fc,resolveSource:Hc,cleanClasses:e=>e.filter(t=>!/^svelte-[a-z0-9]+$/i.test(t)&&!/^s-[A-Za-z0-9_-]{8,}$/.test(t))};var $i={name:"HTML",resolveComponent:e=>{let t=e.closest("[data-component]"),n=t?.getAttribute("data-component");if(!t||!n)return null;let o=[];for(let r=t;r;r=r.parentElement?.closest("[data-component]")??null){let i=r.getAttribute("data-component");if(i&&o.push({name:i,hostElement:r}),o.length>=12)break}return{name:n,hostElement:t,stack:o}}};var Mn=[hi,Si,Ri,Li,$i];function Ni(e=Mn){function t(n){for(let o of e)try{let r=o.resolveComponent(n);if(r?.name)return{adapter:o,result:r}}catch{}return null}return{resolveComponent(n){return t(n)?.result??null},resolveSource(n){let o=Ei(n);if(o.filePath)return o;let r=t(n),i=r?[r.adapter,...e.filter(a=>a!==r.adapter)]:e;for(let a of i)try{let s=a.resolveSource?.(n);if(s?.filePath)return s}catch{}return null},frameworkFor(n){return t(n)?.adapter.name??"HTML"},cleanClasses(n){return e.reduce((o,r)=>r.cleanClasses?r.cleanClasses(o):o,n)}}}var Uc=200,Pi="grabby:v1:level",Pn=8e3;function Bc(){return{activationKey:"Alt+G",activationMode:"toggle",keyHoldDuration:0,enabled:!0,enableInInputs:!1,devOnly:!0,showToolbar:!0,themeMode:"light",mode:"local",persistHistory:!0,copyOnComment:!1,detailLevel:"standard",screenshots:!0,captureQueryParams:[]}}function Di(e){return e?.mode==="live"&&!nr(e.projectKey)?Gc(e):Fi(e)}function Gc(e){let t=null,n=[],o=a=>{t?a(t):n.push(a)},r=e.server?zc(e):null,i={...Oi(),setOptions:a=>o(s=>s.setOptions(a)),registerPlugin:a=>o(s=>s.registerPlugin(a)),unregisterPlugin:a=>o(s=>s.unregisterPlugin(a)),setComponentResolver:a=>o(s=>s.setComponentResolver(a)),setSourceResolver:a=>o(s=>s.setSourceResolver(a)),identify:a=>o(s=>s.identify(a)),show(){if(t){t.show();return}r?.dispose(),kt(),t=Fi(e);for(let a of n.splice(0))a(t);Object.assign(i,t)}};return i}function zc(e){try{if(!localStorage.getItem("grabby:v1:outbox"))return null}catch{return null}let t=vn();return un({server:e.server,projectKey:e.projectKey,getComment:n=>t.find(o=>o.id===n),getScreenshot:Ze,onState(n,o){t=t.map(r=>r.id===n?{...r,sync:o}:r),xn(t)}})}var Dn="grabby:v1:collapsed";function Vc(){try{return sessionStorage.getItem(Dn)==="1"}catch{return!1}}function Mi(e){try{e?sessionStorage.setItem(Dn,"1"):sessionStorage.removeItem(Dn)}catch{}}function Kc(){try{if(typeof ngDevMode<"u"&&ngDevMode===!1)return!1}catch{}try{if(process.env.NODE_ENV==="production")return!1}catch{}return!0}function jc(e){try{let t=localStorage.getItem(Pi);if(t==="compact"||t==="standard"||t==="detailed")return t}catch{}return e}function Wc(e){try{localStorage.setItem(Pi,e)}catch{}}function Oi(){let e=()=>{};return{activate:e,deactivate:e,toggle:e,isActive:()=>!1,setOptions:e,registerPlugin:e,unregisterPlugin:e,setComponentResolver:e,setSourceResolver:e,showToolbar:e,hideToolbar:e,setThemeMode:e,getComments:()=>[],exportComments:()=>"",deleteComment:e,clearComments:e,identify:e,show:e,hide:e,dispose:e}}function Fi(e){let n={...Bc(),...e},o=n.mode==="live";if(!o&&n.devOnly&&!Kc())return Oi();let r=n.identity??(o?"ask":"none"),i=null;Zn(n.styleNonce);let a=Xn(n);if(n.persistHistory){let u=vn();u.length>0&&(a.state.toolbar={...a.state.toolbar,comments:u})}let s=fo({plainLabels:o}),l=bo(),c=sr(),d=Ro(),f=No(),h=Jo(),m=null,y=Ni(n.adapters??Mn),v=y.resolveComponent,b=y.resolveSource,g=u=>y.cleanClasses(u.filter(C=>!Ye(C))),p=null,x,S=null,I=new Map,E=!1,A=jc(n.detailLevel),F=Vc(),Y=new Map;f.apply(a.state.toolbar.themeMode),Oe();function L(){return a.state.toolbar.comments}function W(u){a.state.toolbar={...a.state.toolbar,comments:u},J.update(a.state),Q.refresh(u),ye.update(k())}function k(){let u=L(),C=R=>u.filter(H=>H.sync===R).length;return{total:u.length,sent:C("sent"),pending:C("pending"),failed:C("failed")}}function T(){return me.hasDraft()||!!m&&L().some(u=>u.sync==="pending")}function _(u,C){let R=Fo(u,C,{origin:location.host});return d.callTransformHook(R,u)}function X(){return r==="anonymous"?{name:null,anonymous:!0,sessionId:Lt()}:i?{name:i.name,anonymous:!1,sessionId:Lt(),...i.id?{userId:i.id}:{}}:pi($t())}function B(){return r==="ask"&&!i&&!$t()}function de(){if(r!=="ask")return null;if(i)return i.name;let u=$t();return u?u.anonymous||!u.name?"anonymous":u.name:null}function Z(u,C){let R=L().find(H=>H.id===u);!R||R.sync===C||(o&&C==="sent"&&oe("Feedback sent. Thank you!"),o&&C==="failed"&&oe("Your feedback couldn't be sent. Please try again later."),W(L().map(H=>H.id===u?{...H,sync:C}:H)))}function ge(u){return{componentName:u.target.component,filePath:u.target.source?.file??null,line:u.target.source?.line??null,column:u.target.source?.column??null}}function ut(u,C,R,H){let G=Date.now(),O={id:lt(),createdAt:G,updatedAt:G,status:"open",comment:C,author:X(),page:{route:Vt(location,a.state.options.captureQueryParams),title:document.title,viewport:[window.innerWidth,window.innerHeight]},target:Sr(u,{componentResolver:v,sourceResolver:b,cleanClasses:g}),screenshot:null,framework:y.frameworkFor(u),...m?{sync:"pending"}:{},...H?{pin:H}:{}};I.set(O.id,u),W([O,...L()].slice(0,Uc)),d.callHook("onComment",O,u),m?.send(O.id),R&&Ui(O.id,R);let te=L().length;if(o)return oe("Thanks! Sending your feedback\u2026"),O;let pt={label:te===1?"Copy":`Copy all ${te}`,onClick:Fn,primary:!0};return a.state.options.copyOnComment?On(_([O],A)).then(Ft=>{oe(Ft?"Comment saved and copied":"Comment saved (clipboard blocked)",{detail:ge(O),actions:te>1?[pt]:[]})}):oe(te===1?"Comment saved":`Comment saved \xB7 ${te} total`,{detail:ge(O),actions:[pt]}),O}async function Ui(u,C){let R=await C;if(!R)return;await Ho(u,R.blob);let H=L().find(O=>O.id===u);if(!H){rn([u]);return}let G={...H,screenshot:{localId:u,width:R.width,height:R.height}};W(L().map(O=>O.id===u?G:O)),d.callHook("onScreenshot",G,R.blob),m?.sendScreenshot(u)}function Ae(u,C,R=!1){if(u.length===0)return;let H=new Set(u),G=L(),O=G.filter(z=>H.has(z.id));for(let z of u)I.delete(z);W(G.filter(z=>!H.has(z.id)));let te=R&&m?O.filter(z=>z.sync!==void 0):[],pt=new Set(te.filter(z=>m.isQueued(z.id)).map(z=>z.id));for(let z of te)m.remove(z.id,z.author.sessionId,C?Pn+500:0);let Ft=O.flatMap(z=>z.screenshot?.localId?[z.screenshot.localId]:[]),bt=lt();Y.set(bt,setTimeout(()=>{Y.delete(bt),rn(Ft)},Pn+500)),C&&oe(C,{duration:Pn,actions:[{label:"Undo",onClick:()=>{clearTimeout(Y.get(bt)),Y.delete(bt);let z=new Set(L().map(K=>K.id)),Yn=new Set(te.filter(K=>!z.has(K.id)&&(!m.cancelRemove(K.id)||K.sync!=="sent"||pt.has(K.id))).map(K=>K.id)),Ki=[...O.filter(K=>!z.has(K.id)).map(K=>Yn.has(K.id)?{...K,sync:"pending"}:K),...L()].sort((K,ji)=>ji.createdAt-K.createdAt);W(Ki);for(let K of Yn)m?.send(K);oe(`Restored ${O.length} comment${O.length===1?"":"s"}`)}}]})}async function On(u){try{return await navigator.clipboard.writeText(u),!0}catch(C){return d.callHook("onCopyError",C instanceof Error?C:new Error(String(C))),!1}}function Fn(){let u=L();if(u.length===0){oe("No comments to copy yet");return}se(),De.open({count:u.length,level:A,render:C=>_(u,C)})}function Hn(u){return Jn(u)||c.isFreezeElement(u)}function Un(){me.hide(),dt(),he.isHolding()&&(p=null,x=void 0,S=null,he.release())}function dt(){E&&(E=!1,s.hide())}function se(){Q.hide(),Un(),De.close(),ye.close()}function Bi(){if(ye.isVisible()){ye.close();return}se(),ee(!0),ye.open(k())}function Gi(){se(),h.dismiss(),ee(!0),a.state.toolbar={...a.state.toolbar,visible:!1},J.hide(),o&&fn()}let he=ko({overlay:s,crosshair:l,getComponentResolver:()=>v,getSourceResolver:()=>b,isToolbarElement:Hn,getFreezeElement:()=>c.getElement(),onHover(u){a.state.hoveredElement=u,u&&d.callHook("onElementHover",u)},onSelect(u,C){p=u;let R=u.getBoundingClientRect(),H=(G,O,te)=>te>0?Math.min(1,Math.max(0,(G-O)/te)):.5;x={x:Math.round(H(C.x,R.left,R.width)*1e3)/1e3,y:Math.round(H(C.y,R.top,R.height)*1e3)/1e3},S=a.state.options.screenshots?ci(u):null,d.callHook("onElementSelect",u),h.dismiss(),mr(u),he.hold(u),me.show({anchor:u,mode:"new",askIdentity:B()})}}),Ot=dr({getComments:L,currentRoute:()=>Vt(location,a.state.options.captureQueryParams),findElement(u){let C=I.get(u.id);return C?.isConnected?C:Ue(u.target.selector)},onHover(u,C){he.isHolding()||E||me.isVisible()||(u&&C?s.show(C,u.target.component,null,[]):s.hide())},onOpen(u,C,R){he.isHolding()||(se(),ee(!0),E=!0,C&&s.show(C,u.target.component,null,[]),me.show({anchor:C??R,initialValue:u.comment,mode:"edit",entryId:u.id}))}});function je(){Ot.setVisible(a.state.toolbar.visible&&!F&&a.state.options.enabled)}function mt(){a.state.options.enabled&&(a.state.active||(a.state.toolbar.visible===!1&&a.state.options.showToolbar&&(a.state.toolbar={...a.state.toolbar,visible:!0},J.show()),F&&Bn(),se(),a.state.active=!0,he.activate(),d.callHook("onActivate"),J.update(a.state)))}function ee(u=!1){a.state.active&&(!u&&a.state.frozen||(a.state.active=!1,a.state.frozen=!1,c.hide(),he.deactivate(),d.callHook("onDeactivate"),J.update(a.state)))}function zi(){a.state.frozen=!a.state.frozen,a.state.frozen?c.show(a.state.hoveredElement):c.hide(),J.update(a.state)}let J=Mo({onSelectionMode(){a.state.active?ee(!0):mt()},onHistory(){Un(),De.close(),Q.isVisible()?Q.hide():Q.show([...L()])},onEnableToggle(){se();let u=!a.state.options.enabled;a.state.options={...a.state.options,enabled:u},u||ee(!0),J.update(a.state)},onDismiss:Vi,onExpand:Bn,onFinish:Bi},o?{label:"Comment",dismissLabel:"Hide toolbar",expandLabel:"Leave feedback",hideEnable:!0,review:!!n.server}:{dismissLabel:"Hide toolbar",expandLabel:"Open Grabby toolbar"});function Vi(){se(),h.dismiss(),ee(!0),F=!0,J.collapse(),Mi(!0),Oe(),je()}function Bn(){F=!1,J.expand(),Mi(!1),Oe(),je()}let Q=Bo({onHover(u){let C=u?Ue(u.target.selector):null;C&&u?s.show(C,u.target.component,null,[]):s.hide()},onEdit(u,C){s.hide();let R=Ue(u.target.selector);Q.hide(),me.show({anchor:R??C,initialValue:u.comment,mode:"edit",entryId:u.id})},onDelete(u){s.hide(),Ae([u.id],"Comment deleted",!0)},onCopyAll(){s.hide(),Fn()},onClearAll(){s.hide();let u=L().length;Ae(L().map(C=>C.id),`Cleared ${u} comment${u===1?"":"s"}`,!0),Q.hide()},onChangeIdentity(){fi(),Q.refresh(L()),oe("We'll ask for your name on your next comment")}},{variant:o?"live":"local",showSync:!!n.server,identityLabel:de}),De=jo({async onCopy(u,C){let R=L();if(!await On(u))return!1;d.callHook("onCopySuccess",u,R);let G=`${R.length} comment${R.length===1?"":"s"}`;return C==="clear"?Ae(R.map(O=>O.id),`Copied and cleared ${G}`):oe(`Copied ${G}`),!0},onLevelChange(u){A=u,Wc(u)}}),ye=Xo({onDone(){let u=L().filter(R=>R.sync==="sent"&&!m?.isQueued(R.id)).map(R=>R.id);if(!L().length){Gi();return}Ae(u,null);let C=L().length;oe(C?`Thanks for your review! ${C} comment${C===1?" is":"s are"} still sending.`:"Thanks for your review! Your feedback was sent.")},onRetry(){let u=L().filter(C=>C.sync==="failed");if(u.length){let C=new Set(u.map(R=>R.id));W(L().map(R=>C.has(R.id)?{...R,sync:"pending"}:R));for(let R of C)m?.send(R)}m?.flush()}}),me=Go({onSubmit(u,C,R){if(R&&mi({name:R.name,anonymous:!R.name}),C.mode==="new"){let G=p,O=S,te=x;p=null,x=void 0,S=null,G&&ut(G,u,O,te),ee(!0);return}if(!C.entryId)return;let H=L().map(G=>G.id===C.entryId?{...G,comment:u,updatedAt:Date.now(),...m?{sync:"pending"}:{}}:G);W(H),m?.send(C.entryId),oe("Comment updated"),E?dt():Q.show([...H])},onCancel(u){if(u.mode==="new"){p=null,x=void 0,S=null,ee(!0);return}E?dt():Q.show([...L()])},onDelete(u){dt(),u.entryId&&Ae([u.entryId],"Comment deleted",!0)}});function Gn(u){let C=xe(u);C&&(Hn(C)||(Q.isVisible()||me.isVisible()||De.isVisible()||ye.isVisible())&&se())}document.addEventListener("click",Gn);function zn(){Ge(),m?.flushOnExit()}function Vn(){document.visibilityState==="hidden"&&Ge()}window.addEventListener("pagehide",zn),document.addEventListener("visibilitychange",Vn);function Kn(u){!o||!T()||(u.preventDefault(),u.returnValue="")}window.addEventListener("beforeunload",Kn);function Oe(){a.state.toolbar.visible&&!F?document.documentElement.style.setProperty("--grabby-toast-bottom",qn):document.documentElement.style.removeProperty("--grabby-toast-bottom")}function jn(u){u.key.toLowerCase()!=="f"||u.metaKey||u.ctrlKey||u.altKey||Re(xe(u))||a.state.active&&(u.preventDefault(),zi())}document.addEventListener("keydown",jn,!0);function Wn(u){if(u.key==="Escape"&&!Re(xe(u))&&!(me.isVisible()||De.isVisible()||ye.isVisible())){if(Q.isVisible()){Q.hide(),u.preventDefault();return}a.state.active&&(u.preventDefault(),ee(!0))}}document.addEventListener("keydown",Wn,!0);let ft=_o({getActivationKey:()=>a.state.options.activationKey,getActivationMode:()=>a.state.options.activationMode,getKeyHoldDuration:()=>a.state.options.keyHoldDuration,getEnableInInputs:()=>a.state.options.enableInInputs,onActivate:mt,onDeactivate:()=>ee(),isActive:()=>a.state.active}),Fe={activate:mt,deactivate:()=>ee(!0),toggle(){a.state.active?ee(!0):mt()},isActive(){return a.state.active},setOptions(u){a.state.options={...a.state.options,...u}},registerPlugin(u){u.options&&(a.state.options={...a.state.options,...u.options}),u.theme&&f.applyOverrides(u.theme),d.register(u,Fe)},unregisterPlugin(u){d.unregister(u)},setComponentResolver(u){v=u},setSourceResolver(u){b=u},showToolbar(){a.state.toolbar={...a.state.toolbar,visible:!0},J.show(),J.update(a.state),Oe()},hideToolbar(){se(),a.state.toolbar={...a.state.toolbar,visible:!1},J.hide(),Oe()},setThemeMode(u){a.state.toolbar={...a.state.toolbar,themeMode:u},f.apply(u),J.update(a.state)},getComments(){return[...L()]},exportComments(u={}){let C=u.ids?new Set(u.ids):null,R=C?L().filter(H=>C.has(H.id)):L();return _(R,u.level??A)},deleteComment(u){Ae([u],null,!0)},clearComments(){Ae(L().map(u=>u.id),null)},identify(u){i=u&&u.name?{id:u.id,name:u.name.slice(0,80)}:null,Q.refresh(L())},show(){o&&kt(),Fe.showToolbar()},hide(){o&&fn(),Fe.hideToolbar()},dispose(){Ge(),ee(!0),document.removeEventListener("click",Gn),window.removeEventListener("pagehide",zn),window.removeEventListener("beforeunload",Kn),document.removeEventListener("visibilitychange",Vn),document.removeEventListener("keydown",jn,!0),document.removeEventListener("keydown",Wn,!0),ft.dispose(),he.dispose(),s.dispose(),l.dispose(),c.dispose(),Ot.dispose(),Eo(),fr(),d.dispose(),se(),J.dispose(),Q.dispose(),me.dispose(),De.dispose(),ye.dispose(),h.dispose(),m?.dispose(),f.dispose(),hr(),li(),document.documentElement.style.removeProperty("--grabby-toast-bottom"),Qn()}};return a.state.options.enabled&&ft.start(),a.state.toolbar={...a.state.toolbar,visible:!1},F&&J.collapse(),o&&n.showToolbar&&(Fe.showToolbar(),F||h.maybeShow()),a.subscribe((u,C)=>{C==="options"&&(u.options.enabled?ft.start():(ft.stop(),ee(!0))),C==="options"&&je(),C==="toolbar"&&(Oe(),je(),Ot.refresh(),u.options.persistHistory&&(u.toolbar.comments.length>0?xn(u.toolbar.comments):gr()))}),n.server&&(m=un({server:n.server,projectKey:n.projectKey,getComment:u=>L().find(C=>C.id===u),getScreenshot:Ze,onState:(u,C)=>Z(u,C)})),n.webhookUrl&&Fe.registerPlugin(Io(n.webhookUrl)),je(),Fe}function Yc(e){let t=e?.dataset??{},n={};return(t.mode==="live"||t.mode==="local")&&(n.mode=t.mode),t.server&&(n.server=t.server),t.projectKey&&(n.projectKey=t.projectKey),(t.identity==="ask"||t.identity==="anonymous"||t.identity==="none")&&(n.identity=t.identity),t.activationKey&&(n.activationKey=t.activationKey),t.screenshots==="false"&&(n.screenshots=!1),t.webhookUrl&&(n.webhookUrl=t.webhookUrl),t.styleNonce?n.styleNonce=t.styleNonce:e?.nonce&&(n.styleNonce=e.nonce),n}var Hi=Di(Yc(document.currentScript));window.grabby=Hi;var qm=Hi;})();