@githumbi/grabby 0.5.0 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/dist/angular/index.d.ts +22 -1
- package/dist/angular/index.js +608 -63
- package/dist/angular/index.js.map +1 -1
- package/dist/cli/index.js +2 -2
- package/dist/core/index.cjs +723 -178
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +2 -2
- package/dist/core/index.d.ts +2 -2
- package/dist/core/index.js +608 -63
- package/dist/core/index.js.map +1 -1
- package/dist/export/index.cjs +19 -1
- package/dist/export/index.cjs.map +1 -1
- package/dist/export/index.d.cts +23 -2
- package/dist/export/index.d.ts +23 -2
- package/dist/export/index.js +19 -1
- package/dist/export/index.js.map +1 -1
- package/dist/grabby.global.js +177 -137
- package/dist/live/index.d.cts +1 -1
- package/dist/live/index.d.ts +1 -1
- package/dist/react/index.d.ts +22 -1
- package/dist/react/index.js +608 -63
- package/dist/react/index.js.map +1 -1
- package/dist/{types-BQDEG-Gl.d.cts → types-DOAcZ0U6.d.cts} +23 -2
- package/dist/{types-BQDEG-Gl.d.ts → types-DOAcZ0U6.d.ts} +23 -2
- package/package.json +1 -1
package/dist/grabby.global.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
"use strict";(()=>{var
|
|
1
|
+
"use strict";(()=>{var Ia=Object.defineProperty;var $a=(e,t)=>()=>(e&&(t=e(e=0)),t);var La=(e,t)=>{for(var n in t)Ia(e,n,{get:t[n],enumerable:!0})};var Hi={};La(Hi,{createContext:()=>Ai,destroyContext:()=>Li,domToBlob:()=>Jc,domToCanvas:()=>Ut,domToDataUrl:()=>qe,domToForeignObjectSvg:()=>Di,domToImage:()=>Qc,domToJpeg:()=>eu,domToPixel:()=>tu,domToPng:()=>nu,domToSvg:()=>Fi,domToWebp:()=>ou,loadMedia:()=>Xe,waitUntilLoad:()=>Ci});function ui(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}function Ul(){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 Gl(e){let t=-1;jn||(jn=Ul());for(let n=0;n<e.length;n++)t=jn[(t^e[n])&255]^t>>>8;return t^-1}function Vl(e){let t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===di&&e[n-2]===mi&&e[n-1]===fi&&e[n]===pi)return n-3;return 0}function bi(e,t,n=!1){let o=new Uint8Array(13);t*=39.3701,o[0]=di,o[1]=mi,o[2]=fi,o[3]=pi,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=Gl(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=Vl(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 Wl(e){let t=e.indexOf(zl);return t===-1&&(t=e.indexOf(Kl)),t===-1&&(t=e.indexOf(jl)),t}function mc(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 xi(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=Ht().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 Ht(e){return(e&&me(e)?e?.ownerDocument:e)??window.document}function Ei(e,t,n){let o=Ht(n).createElementNS(Bt,"svg");return o.setAttributeNS(null,"width",e.toString()),o.setAttributeNS(null,"height",t.toString()),o.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),o}function wi(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 fc(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(hi)return pc(e.toDataURL(t,n));throw o}}function pc(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 Si(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 Fe(e,t){let n=Ht(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function Xe(e,t){return new Promise(n=>{let{timeout:o,ownerDocument:r,onError:i,onWarn:a}=t??{},s=typeof e=="string"?Fe(e,Ht(r)):e,l=null,u=null;function m(){n(s),l&&clearTimeout(l),u?.()}if(o&&(l=setTimeout(m,o)),Ft(s)){let p=s.currentSrc||s.src;if(!p)return s.poster?Xe(s.poster,t).then(n):m();if(s.readyState>=2)return m();let x=m,d=g=>{a?.("Failed video load",p,g),i?.(g),m()};u=()=>{s.removeEventListener("loadeddata",x),s.removeEventListener("error",d)},s.addEventListener("loadeddata",x,{once:!0}),s.addEventListener("error",d,{once:!0})}else{let p=vi(s)?s.href.baseVal:s.currentSrc||s.src;if(!p)return m();let x=async()=>{if(Ye(s)&&"decode"in s)try{await s.decode()}catch(g){a?.("Failed to decode image, trying to render anyway",s.dataset.originalSrc||p,g)}m()},d=g=>{a?.("Failed image load",s.dataset.originalSrc||p,g),m()};if(Ye(s)&&s.complete)return x();u=()=>{s.removeEventListener("load",x),s.removeEventListener("error",d)},s.addEventListener("load",x,{once:!0}),s.addEventListener("error",d,{once:!0})}})}async function Ci(e,t){mt(e)&&(Ye(e)||Ft(e)?await Xe(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(o=>Xe(o,t)))))}function Ti(e){return e?.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}function hc(e){let t=`${gi}[#${ri}]`;return ri++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&dc(...n)}}function yc(e){return{cache:e?"no-cache":"force-cache"}}async function fe(e,t){return ql(e)?e:Ai(e,{...t,autoDestruct:!0})}async function Ai(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),u=new Map,m={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:yc(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:hc(i),node:e,ownerDocument:s,ownerWindow:l,dpi:n===1?null:96*n,svgStyleElement:_i(s),svgDefsElement:s?.createElementNS(Bt,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:Yl&&o&&r?r:0})].map(()=>{try{let d=new Worker(o);return d.onmessage=async g=>{let{url:y,result:f}=g.data;f?u.get(y)?.resolve?.(f):u.get(y)?.reject?.(new Error(`Error receiving message from worker: ${y}`))},d.onmessageerror=g=>{let{url:y}=g.data;u.get(y)?.reject?.(new Error(`Error receiving message from worker: ${y}`))},d}catch(d){return m.log.warn("Failed to new Worker",d),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[mc(s)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:u,drawImageCount:0,tasks:[],features:a,isEnable:d=>d==="restoreScrollPosition"?typeof a=="boolean"?!1:a[d]??!1:typeof a=="boolean"?a:a[d]??!0,shadowRoots:[]};m.log.time("wait until load"),await Ci(e,{timeout:m.timeout,onWarn:m.log.warn}),m.log.timeEnd("wait until load");let{width:p,height:x}=vc(e,m);return m.width=p,m.height=x,m}function _i(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
|
|
7
|
-
`),
|
|
8
|
-
`))}else{let l=Array.from(n.styleSheets).filter(
|
|
9
|
-
`)):a.push(
|
|
10
|
-
`))}))})}}function
|
|
6
|
+
`);return t.appendChild(n),t}function vc(e,t){let{width:n,height:o}=t;if(me(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 xc(e,t){let{log:n,timeout:o,drawImageCount:r,drawImageInterval:i}=t;n.time("image to canvas");let a=await Xe(e,{timeout:o,onWarn:t.log.warn}),{canvas:s,context2d:l}=Ec(e.ownerDocument,t),u=()=>{try{l?.drawImage(a,0,0,s.width,s.height)}catch(m){t.log.warn("Failed to drawImage",m)}};if(u(),t.isEnable("fixSvgXmlDecode"))for(let m=0;m<r;m++)await new Promise(p=>{setTimeout(()=>{l?.clearRect(0,0,s.width,s.height),u(),p()},m+i)});return t.drawImageCount=0,n.timeEnd("image to canvas"),s}function Ec(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 Ri(e,t){if(e.ownerDocument)try{let i=e.toDataURL();if(i!=="data:,")return Fe(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 wc(e,t){try{if(e?.contentDocument?.documentElement)return Zn(e.contentDocument.documentElement,t)}catch(n){t.log.warn("Failed to clone iframe",n)}return e.cloneNode(!1)}function Sc(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 Cc(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Fe(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 Xe(n,{onError:()=>r=!1,onWarn:t.log.warn}),!r)return e.poster?Fe(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?Fe(e.poster,e.ownerDocument):n}return Ri(i,t)}return n}function kc(e,t){return oc(e)?Ri(e,t):uc(e)?wc(e,t):Ye(e)?Sc(e):Ft(e)?Cc(e,t):e.cloneNode(!1)}function Tc(e){let t=e.sandbox;if(!t){let{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${ki()}`,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 Ii(e,t,n){let{defaultComputedStyles:o}=n,r=e.nodeName.toLowerCase(),i=pt(e)&&r!=="svg",a=i?_c.map(y=>[y,e.getAttribute(y)]).filter(([,y])=>y!==null):[],s=[i&&"svg",r,a.map((y,f)=>`${y}=${f}`).join(","),t].filter(Boolean).join(":");if(o.has(s))return o.get(s);let u=Tc(n)?.contentWindow;if(!u)return new Map;let m=u?.document,p,x;i?(p=m.createElementNS(Bt,"svg"),x=p.ownerDocument.createElementNS(p.namespaceURI,r),a.forEach(([y,f])=>{x.setAttributeNS(null,y,f)}),p.appendChild(x)):p=x=m.createElement(r),x.textContent=" ",m.body.appendChild(p);let d=u.getComputedStyle(x,t),g=new Map;for(let y=d.length,f=0;f<y;f++){let v=d.item(f);Ac.includes(v)||g.set(v,d.getPropertyValue(v))}return m.body.removeChild(p),o.set(s,g),g}function $i(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 u=e.item(l);a(u)}for(let s=r.length,l=0;l<s;l++)i.get(r[l])?.forEach((u,m)=>o.set(m,u));function a(s){let l=e.getPropertyValue(s),u=e.getPropertyPriority(s),m=s.lastIndexOf("-"),p=m>-1?s.substring(0,m):void 0;if(p){let x=i.get(p);x||(x=new Map,i.set(p,x)),x.set(s,[l,u])}t.get(s)===l&&!u||(p?r.push(p):o.set(s,[l,u]))}return o}function Rc(e,t,n,o){let{ownerWindow:r,includeStyleProperties:i,currentParentNodeStyle:a}=o,s=t.style,l=r.getComputedStyle(e),u=Ii(e,null,o);a?.forEach((p,x)=>{u.delete(x)});let m=$i(l,u,i);m.delete("transition-property"),m.delete("all"),m.delete("d"),m.delete("content"),n&&(m.delete("position"),m.delete("margin-top"),m.delete("margin-right"),m.delete("margin-bottom"),m.delete("margin-left"),m.delete("margin-block-start"),m.delete("margin-block-end"),m.delete("margin-inline-start"),m.delete("margin-inline-end"),m.set("box-sizing",["border-box",""])),m.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text"),yi&&(m.has("font-kerning")||m.set("font-kerning",["normal",""]),(m.get("overflow-x")?.[0]==="hidden"||m.get("overflow-y")?.[0]==="hidden")&&m.get("text-overflow")?.[0]==="ellipsis"&&e.scrollWidth===e.clientWidth&&m.set("text-overflow",["clip",""]));for(let p=s.length,x=0;x<p;x++)s.removeProperty(s.item(x));return m.forEach(([p,x],d)=>{s.setProperty(d,p,x)}),m}function Ic(e,t){(rc(e)||ic(e)||lc(e))&&t.setAttribute("value",e.value)}function Mc(e,t,n,o,r){let{ownerWindow:i,svgStyleElement:a,svgStyles:s,currentNodeStyle:l}=o;if(!a||!i)return;function u(m){let p=i.getComputedStyle(e,m),x=p.getPropertyValue("content");if(!x||x==="none")return;r?.(x),x=x.replace(/(')|(")|(counter\(.+\))/g,"");let d=[ki()],g=Ii(e,m,o);l?.forEach((h,k)=>{g.delete(k)});let y=$i(p,g,o.includeStyleProperties);y.delete("content"),y.delete("-webkit-locale"),y.get("background-clip")?.[0]==="text"&&t.classList.add("______background-clip--text");let f=[`content: '${x}';`];if(y.forEach(([h,k],L)=>{f.push(`${L}: ${h}${k?" !important":""};`)}),f.length===1)return;try{t.className=[t.className,...d].join(" ")}catch(h){o.log.warn("Failed to copyPseudoClass",h);return}let v=f.join(`
|
|
7
|
+
`),b=s.get(v);b||(b=[],s.set(v,b)),b.push(`.${d[0]}${m}`)}$c.forEach(u),n&&Lc.forEach(u)}async function ai(e,t,n,o,r){if(me(n)&&(ac(n)||sc(n))||o.filter&&!o.filter(n))return;ii.has(t.nodeName)||ii.has(n.nodeName)?o.currentParentNodeStyle=void 0:o.currentParentNodeStyle=o.currentNodeStyle;let i=await Zn(n,o,!1,r);o.isEnable("restoreScrollPosition")&&Nc(e,i),t.appendChild(i)}async function si(e,t,n,o){let r=e.firstChild;me(e)&&e.shadowRoot&&(r=e.shadowRoot?.firstChild,n.shadowRoots.push(e.shadowRoot));for(let i=r;i;i=i.nextSibling)if(!tc(i))if(me(i)&&cc(i)&&typeof i.assignedNodes=="function"){let a=i.assignedNodes();for(let s=0;s<a.length;s++)await ai(e,t,a[s],n,o)}else await ai(e,t,i,n,o)}function Nc(e,t){if(!mt(e)||!mt(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:u}=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=u,t.style.transform=i.toString()}function Pc(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 Zn(e,t,n=!1,o){let{ownerDocument:r,ownerWindow:i,fontFamilies:a,onCloneEachNode:s}=t;if(r&&nc(e))return o&&/\S/.test(e.data)&&o(e.data),r.createTextNode(e.data);if(r&&i&&me(e)&&(mt(e)||pt(e))){let u=await kc(e,t);if(t.isEnable("removeAbnormalAttributes")){let y=u.getAttributeNames();for(let f=y.length,v=0;v<f;v++){let b=y[v];Oc.test(b)||u.removeAttribute(b)}}let m=t.currentNodeStyle=Rc(e,u,n,t);n&&Pc(u,t);let p=!1;if(t.isEnable("copyScrollbar")){let y=[m.get("overflow-x")?.[0],m.get("overflow-y")?.[0]];p=y.includes("scroll")||(y.includes("auto")||y.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}let x=m.get("text-transform")?.[0],d=Ti(m.get("font-family")?.[0]),g=d?y=>{x==="uppercase"?y=y.toUpperCase():x==="lowercase"?y=y.toLowerCase():x==="capitalize"&&(y=y[0].toUpperCase()+y.substring(1)),d.forEach(f=>{let v=a.get(f);v||a.set(f,v=new Set),y.split("").forEach(b=>v.add(b))})}:void 0;return Mc(e,u,p,t,g),Ic(e,u),Ft(e)||await si(e,u,t,g),await s?.(u),u}let l=e.cloneNode(!1);return await si(e,l,t),await s?.(l),l}function Li(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 Dc(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(bc);default:return s.text()}}).finally(()=>clearTimeout(a))}function ft(e,t){let{url:n,requestType:o="text",responseType:r="text",imageDom:i}=t,a=n,{timeout:s,acceptOfImage:l,requests:u,fetchFn:m,fetch:{requestInit:p,bypassingCache:x,placeholderImage:d},font:g,workers:y,fontFamilies:f}=e;o==="image"&&(Dt||qn)&&e.drawImageCount++;let v=u.get(n);if(!v){x&&x instanceof RegExp&&x.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());let b=o.startsWith("font")&&g&&g.minify,h=new Set;b&&o.split(";")[1].split(",").forEach($=>{f.has($)&&f.get($).forEach(U=>h.add(U))});let k=b&&h.size,L={url:a,timeout:s,responseType:k?"arrayBuffer":r,headers:o==="image"?{accept:l}:void 0,...p};v={type:o,resolve:void 0,reject:void 0,response:null},v.response=(async()=>{if(m&&o==="image"){let C=await m(n);if(C)return C}return!Dt&&n.startsWith("http")&&y.length?new Promise((C,$)=>{y[u.size&y.length-1].postMessage({rawUrl:n,...L}),v.resolve=C,v.reject=$}):Dc(L)})().catch(C=>{if(u.delete(n),o==="image"&&d)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof d=="string"?d:d(i);throw C}),u.set(n,v)}return v.response}async function Mi(e,t,n,o){if(!Ni(e))return e;for(let[r,i]of Fc(e,t))try{let a=await ft(n,{url:i,requestType:o?"image":"text",responseType:"dataUrl"});e=e.replace(Hc(r),`$1${a}$3`)}catch(a){n.log.warn("Failed to fetch css data url",r,a)}return e}function Ni(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}function Fc(e,t){let n=[];return e.replace(Pi,(o,r,i)=>(n.push([i,xi(i,t)]),o)),n.filter(([o])=>!Wn(o))}function Hc(e){let t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}function Uc(e,t){return Bc.map(n=>{let o=e.getPropertyValue(n);return!o||o==="none"?null:((Dt||qn)&&t.drawImageCount++,Mi(o,null,t,!0).then(r=>{!r||o===r||e.setProperty(n,r,e.getPropertyPriority(n))}))}).filter(Boolean)}function Gc(e,t){if(Ye(e)){let n=e.currentSrc||e.src;if(!Wn(n))return[ft(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.srcset="",e.dataset.originalSrc=n,e.src=o||"")})];(Dt||qn)&&t.drawImageCount++}else if(pt(e)&&!Wn(e.href.baseVal)){let n=e.href.baseVal;return[ft(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(o=>{o&&(e.dataset.originalSrc=n,e.href.baseVal=o||"")})]}return[]}function Vc(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((u,m)=>u??m.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[ft(t,{url:i,responseType:"text"}).then(u=>{o?.insertAdjacentHTML("beforeend",u)})]}return[]}function Oi(e,t){let{tasks:n}=t;me(e)&&((Ye(e)||vi(e))&&n.push(...Gc(e,t)),ec(e)&&n.push(...Vc(e,t))),mt(e)&&n.push(...Uc(e.style,t)),e.childNodes.forEach(o=>{Oi(o,t)})}async function zc(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=ci(s.cssText,t);o.appendChild(n.createTextNode(`${l}
|
|
8
|
+
`))}else{let l=Array.from(n.styleSheets).filter(d=>{try{return"cssRules"in d&&!!d.cssRules.length}catch(g){return t.log.warn(`Error while reading CSS rules from ${d.href}`,g),!1}}),u=n.implementation.createHTMLDocument(""),m=u.createElement("style");u.head.appendChild(m);let p=m.sheet;await Promise.all(l.flatMap(d=>Array.from(d.cssRules).map(async g=>{if(Jl(g)){let y=g.href,f="";try{f=await ft(t,{url:y,requestType:"text",responseType:"text"})}catch(b){t.log.warn(`Error fetch remote css import from ${y}`,b)}let v=f.replace(Pi,(b,h,k)=>b.replace(k,xi(k,y)));for(let b of jc(v))try{p.insertRule(b,p.cssRules.length)}catch(h){t.log.warn("Error inserting rule from remote css import",{rule:b,error:h})}}}))),p.cssRules.length&&l.push(p);let x=[];l.forEach(d=>{Yn(d.cssRules,x)}),x.filter(d=>Zl(d)&&Ni(d.style.getPropertyValue("src"))&&Ti(d.style.getPropertyValue("font-family"))?.some(g=>r.has(g))).forEach(d=>{let g=d,y=i.get(g.cssText);y?o.appendChild(n.createTextNode(`${y}
|
|
9
|
+
`)):a.push(Mi(g.cssText,g.parentStyleSheet?g.parentStyleSheet.href:null,t).then(f=>{f=ci(f,t),i.set(g.cssText,f),o.appendChild(n.createTextNode(`${f}
|
|
10
|
+
`))}))})}}function jc(e){if(e==null)return[];let t=[],n=e.replace(Kc,"");for(;;){let i=li.exec(n);if(!i)break;t.push(i[0])}n=n.replace(li,"");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 ci(e,t){let{font:n}=t,o=n?n?.preferredFormat:void 0;return o?e.replace(Yc,r=>{for(;;){let[i,,a]=Wc.exec(r)||[];if(!a)return"";if(a===o)return`src: ${i};`}}):e}function Yn(e,t=[]){for(let n of Array.from(e))Ql(n)?t.push(...Yn(n.cssRules)):"cssRules"in n?Yn(n.cssRules,t):t.push(n);return t}function qc(e){return Xc.test(e.innerHTML)}async function Di(e,t){let n=await fe(e,t);if(me(n.node)&&pt(n.node)&&!qc(n.node))return n.node;let{ownerDocument:o,log:r,tasks:i,svgStyleElement:a,svgDefsElement:s,svgStyles:l,font:u,progress:m,autoDestruct:p,onCloneNode:x,onEmbedNode:d,onCreateForeignObjectSvg:g}=n;r.time("clone node");let y=await Zn(n.node,n,!0);if(a&&o){let k="";l.forEach((L,C)=>{k+=`${L.join(`,
|
|
11
11
|
`)} {
|
|
12
|
-
${
|
|
12
|
+
${C}
|
|
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,""")}"`)};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
|
-
#${
|
|
14
|
+
`}),a.appendChild(o.createTextNode(k))}r.timeEnd("clone node"),await x?.(y),u!==!1&&me(y)&&(r.time("embed web font"),await zc(y,n),r.timeEnd("embed web font")),r.time("embed node"),Oi(y,n);let f=i.length,v=0,b=async()=>{for(;;){let k=i.pop();if(!k)break;try{await k}catch(L){n.log.warn("Failed to run task",L)}m?.(++v,f)}};m?.(v,f),await Promise.all([...Array.from({length:4})].map(b)),r.timeEnd("embed node"),await d?.(y);let h=Zc(y,n);return s&&h.insertBefore(s,h.children[0]),a&&h.insertBefore(a,h.children[0]),p&&Li(n),await g?.(h),h}function Zc(e,t){let{width:n,height:o}=t,r=Ei(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 Ut(e,t){let n=await fe(e,t),o=await Di(n),r=wi(o,n.isEnable("removeControlCharacter"));n.autoDestruct||(n.svgStyleElement=_i(n.ownerDocument),n.svgDefsElement=n.ownerDocument?.createElementNS(Bt,"defs"),n.svgStyles.clear());let i=Fe(r,o.ownerDocument);return await xc(i,n)}async function Jc(e,t){let n=await fe(e,t),{log:o,type:r,quality:i,dpi:a}=n,s=await Ut(n);o.time("canvas to blob");let l=await fc(s,r,i);if(["image/png","image/jpeg"].includes(r)&&a){let u=await gc(l.slice(0,33)),m=new Uint8Array(u);return r==="image/png"?m=bi(m,a):r==="image/jpeg"&&(m=ui(m,a)),o.timeEnd("canvas to blob"),new Blob([m,l.slice(33)],{type:r})}return o.timeEnd("canvas to blob"),l}async function qe(e,t){let n=await fe(e,t),{log:o,quality:r,type:i,dpi:a}=n,s=await Ut(n);o.time("canvas to data url");let l=s.toDataURL(i,r);if(["image/png","image/jpeg"].includes(i)&&a&&hi&&Xl){let[u,m]=l.split(","),p=0,x=!1;if(i==="image/png"){let h=Wl(m);h>=0?(p=Math.ceil((h+28)/3)*4,x=!0):p=33/3*4}else i==="image/jpeg"&&(p=18/3*4);let d=m.substring(0,p),g=m.substring(p),y=window.atob(d),f=new Uint8Array(y.length);for(let h=0;h<f.length;h++)f[h]=y.charCodeAt(h);let v=i==="image/png"?bi(f,a,x):ui(f,a),b=window.btoa(String.fromCharCode(...v));l=[u,",",b,g].join("")}return o.timeEnd("canvas to data url"),l}async function Fi(e,t){let n=await fe(e,t),{width:o,height:r,ownerDocument:i}=n,a=await qe(n),s=Ei(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),wi(s,n.isEnable("removeControlCharacter"))}async function Qc(e,t){let n=await fe(e,t),{ownerDocument:o,width:r,height:i,scale:a,type:s}=n,l=s==="image/svg+xml"?await Fi(n):await qe(n),u=Fe(l,o);return u.width=Math.floor(r*a),u.height=Math.floor(i*a),u.style.width=`${r}px`,u.style.height=`${i}px`,u}async function eu(e,t){return qe(await fe(e,{...t,type:"image/jpeg"}))}async function tu(e,t){let n=await fe(e,t),o=await Ut(n);return o.getContext("2d").getImageData(0,0,o.width,o.height).data}async function nu(e,t){return qe(await fe(e,{...t,type:"image/png"}))}async function ou(e,t){return qe(await fe(e,{...t,type:"image/webp"}))}var di,mi,fi,pi,jn,zl,Kl,jl,gi,ke,Yl,hi,Xl,Xn,yi,Dt,qn,ql,Zl,Jl,Ql,me,pt,vi,ec,mt,tc,nc,Ye,Ft,oc,rc,ic,ac,sc,lc,cc,uc,dc,Wn,Bt,bc,gc,ki,ri,Ac,_c,$c,Lc,ii,Oc,Pi,Bc,Kc,li,Wc,Yc,Xc,Bi=$a(()=>{"use strict";di=112,mi=72,fi=89,pi=115;zl="AAlwSFlz",Kl="AAAJcEhZ",jl="AAAACXBI";gi="[modern-screenshot]",ke=typeof window<"u",Yl=ke&&"Worker"in window,hi=ke&&"atob"in window,Xl=ke&&"btoa"in window,Xn=ke?window.navigator?.userAgent:"",yi=Xn.includes("Chrome"),Dt=Xn.includes("AppleWebKit")&&!yi,qn=Xn.includes("Firefox"),ql=e=>e&&"__CONTEXT__"in e,Zl=e=>e.constructor.name==="CSSFontFaceRule",Jl=e=>e.constructor.name==="CSSImportRule",Ql=e=>e.constructor.name==="CSSLayerBlockRule",me=e=>e.nodeType===1,pt=e=>typeof e.className=="object",vi=e=>e.tagName==="image",ec=e=>e.tagName==="use",mt=e=>me(e)&&typeof e.style<"u"&&!pt(e),tc=e=>e.nodeType===8,nc=e=>e.nodeType===3,Ye=e=>e.tagName==="IMG",Ft=e=>e.tagName==="VIDEO",oc=e=>e.tagName==="CANVAS",rc=e=>e.tagName==="TEXTAREA",ic=e=>e.tagName==="INPUT",ac=e=>e.tagName==="STYLE",sc=e=>e.tagName==="SCRIPT",lc=e=>e.tagName==="SELECT",cc=e=>e.tagName==="SLOT",uc=e=>e.tagName==="IFRAME",dc=(...e)=>console.warn(gi,...e);Wn=e=>e.startsWith("data:");Bt="http://www.w3.org/2000/svg";bc=e=>Si(e,"dataUrl"),gc=e=>Si(e,"arrayBuffer");ki=(function(){let t=0,n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();ri=0;Ac=["width","height","-webkit-text-fill-color"],_c=["stroke","fill"];$c=["::before","::after"],Lc=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];ii=new Set(["symbol"]);Oc=/^[\w-:]+$/;Pi=/url\((['"]?)([^'"]+?)\1\)/g;Bc=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];Kc=/(\/\*[\s\S]*?\*\/)/g,li=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;Wc=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Yc=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;Xc=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i});function Eo(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 wo="72px",xe="68px";var Jt="grabby-root",ge=null,Re=null,Zt,he=new Map;function Ma(e){try{return"adoptedStyleSheets"in e&&typeof CSSStyleSheet=="function"&&typeof CSSStyleSheet.prototype.replaceSync=="function"}catch{return!1}}function So(e){Zt=e}function B(){if(Re&&ge?.isConnected)return Re;ge=document.createElement(Jt),ge.setAttribute("data-grabby-ignore",""),Re=ge.attachShadow({mode:"open"}),document.documentElement.appendChild(ge);for(let[e,t]of Array.from(he))t.target==="shadow"&&(he.delete(e),P(e,t.css));return Re}function P(e,t,n="shadow"){let o=he.get(e);if(o){o.css=t,o.sheet&&o.sheet.replaceSync(t),o.el&&(o.el.textContent=t);return}let r=n==="shadow"?B():document;if(Ma(r)){let a=new CSSStyleSheet;a.replaceSync(t),r.adoptedStyleSheets=[...r.adoptedStyleSheets,a],he.set(e,{target:n,css:t,sheet:a});return}let i=document.createElement("style");i.setAttribute("data-grabby-style",e),Zt&&(i.nonce=Zt),i.textContent=t,n==="shadow"?B().prepend(i):document.head.appendChild(i),he.set(e,{target:n,css:t,el:i})}function q(e){return he.has(e)}function O(e){let t=he.get(e);if(t&&(he.delete(e),t.el&&t.el.remove(),t.sheet)){let n=t.target==="shadow"?Re:document;n&&(n.adoptedStyleSheets=n.adoptedStyleSheets.filter(o=>o!==t.sheet))}}function Co(e){return!e||!ge?!1:e===ge?!0:e.getRootNode()===Re}function ye(e){let n=(typeof e.composedPath=="function"?e.composedPath():[])[0]??e.target;return n instanceof Element?n:null}function Qt(){let e=document.activeElement;for(;e?.shadowRoot?.activeElement;)e=e.shadowRoot.activeElement;return e}function Ie(e){if(!e)return!1;let t=e.tagName;return t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable===!0}function ko(){for(let e of Array.from(he.keys()))O(e);ge?.remove(),ge=null,Re=null}var Na=new Set(["BUTTON","A","SUMMARY"]),Pa=new Set(["button","link","tab","menuitem","menuitemcheckbox","menuitemradio","switch","option","checkbox","radio"]),Ao=new Set(["button","submit","reset","image"]),Oa=new Set(["INPUT","SELECT","TEXTAREA"]),Da=new Set(["textbox","combobox","searchbox","spinbutton","slider"]),Fa=new Set(["IMG","SVG","VIDEO","PICTURE","CANVAS","IFRAME","AUDIO"]),Ha=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"]),_o=new Set(["HTML","BODY","MAIN"]),Ba=new Set(["HEADER","FOOTER","NAV","ASIDE"]),Ua=.6;function kt(e){return(e.getAttribute("role")??"").toLowerCase()}function en(e){return Na.has(e.tagName)?e.tagName!=="A"||e.hasAttribute("href")||e.hasAttribute("role"):e.tagName==="INPUT"&&Ao.has(e.type)?!0:Pa.has(kt(e))}function tn(e){return e.tagName==="INPUT"?!Ao.has(e.type):Oa.has(e.tagName)||e.isContentEditable&&e.getAttribute("contenteditable")!==null?!0:Da.has(kt(e))}function To(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)>=Ua}function Ga(e){return e.children.length>0}function $e(e){return _o.has(e.tagName)?"section":Fa.has(e.tagName)?"media":tn(e)?"field":en(e)?"action":Ba.has(e.tagName)||kt(e)==="main"||kt(e)==="region"?To(e)?"section":"container":Ha.has(e.tagName)||!Ga(e)&&(e.textContent??"").trim()?"text":To(e)?"section":"container"}var Va=3;function Ro(e){if(en(e)||tn(e))return e;let t=e.parentElement;for(let n=0;t&&n<Va;n++){if(en(t)||tn(t))return t;if(_o.has(t.tagName))break;t=t.parentElement}return e}var za=/[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}/g,Ka=/\beyJ[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\.[A-Za-z0-9_-]{8,}\b/g,ja=/\b(Bearer|Basic|Token)\s+[A-Za-z0-9._~+/=-]{8,}/gi,Wa=/\b\d(?:[ -]?\d){8,}\b/g,Ya=/\b[A-Za-z0-9_-]{32,}\b/g,Xa=/([?&#](?:access_token|id_token|token|key|api_key|apikey|secret|password|pass|auth|code|session|sig|signature)=)[^&#\s]*/gi;function V(e,t={}){if(!e)return e;let n=e.replace(Xa,"$1[redacted]").replace(Ka,"[token]").replace(ja,"$1 [token]");return(t.keepEmails?n:n.replace(za,"[email]")).replace(Wa,"[number]").replace(Ya,o=>/\d/.test(o)&&/[A-Za-z]/.test(o)?"[token]":o)}function nn(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]),V(n)}function et(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 V(n.origin===o.origin?r:`${n.host}${r}`)}catch{return V(e.split(/[?#]/)[0])}}var Tt="data-grabby-mask",ie="data-grabby-ignore",qa=["id","class","role","aria-label","data-testid","data-test","data-cy","name","type","href","src","alt","placeholder","title","for","aria-expanded","aria-selected","disabled"],Za=new Set(["href","src"]),Ja=8,Qa=60,es=80,ts=80,Io=300;function ns(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 Ve(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 ze(e){return e.closest(`[${Tt}]`)!==null}function oe(e,t){if(ze(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(`[${ie}], [${Tt}]`)&&(n+=` ${r.nodeValue??""}`,n.length>t*3))break}return ne(V(n.replace(/\s+/g," ").trim()),t)}function $o(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 os(e,t,n,o){if(t==="class"){let r=o(n.split(/\s+/).filter(Boolean));return r.length===0?null:ne(r.join(" "),Qa)}return Za.has(t)?ne(et(n),120):ne(V(n,{keepEmails:t==="placeholder"}),es)}function rs(e,t=n=>n.filter(o=>!Ve(o))){let n=e.tagName.toLowerCase(),o=[],r=new Set,i=a=>{if(o.length>=Ja||r.has(a)||ns(a))return;let s=e.getAttribute(a);if(s===null)return;if(r.add(a),s===""){o.push(a);return}let l=os(e,a,s,t);l!==null&&o.push(`${a}="${l.replace(/"/g,""")}"`)};for(let a of qa)i(a);for(let{name:a}of Array.from(e.attributes))a.startsWith("aria-")&&i(a);return`<${n}${o.length?` ${o.join(" ")}`:""}>`}function on(e,t){let n=e.tagName.toLowerCase(),o=rs(e,t);if(/^(img|input|br|hr|meta|link|source|area|col|embed|wbr)$/.test(n))return ne(o,Io);let r=Array.from(e.children).filter(a=>!a.hasAttribute(ie)),i;if(ze(e))i="[masked]";else if(r.length===0)i=ne(V($o(e)),ts);else if(r.length<=2){let a=ne(V($o(e)),40),s=r.map(l=>{let u=oe(l,30);return`<${l.tagName.toLowerCase()}${u?`>${u}</${l.tagName.toLowerCase()}>`:" \u2026>"}`});i=[a,...s].filter(Boolean).join(" ")}else i=`(${r.length} elements)`;return ne(`${o}${i}</${n}>`,Io)}var tt=40,is=/^h[1-6]$/;function as(e){return(e.getAttribute("role")??"").toLowerCase()}function ss(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 Mo(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 is.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 ls(e){let t=e.labels;return t&&t.length?oe(t[0],tt):V(e.getAttribute("aria-label")??"")||V(e.getAttribute("placeholder")??"")}function No(e){return e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]')}function cs(e,t){if(ze(e)||e.tagName==="BODY"||e.tagName==="HTML")return"";let n=V(e.getAttribute("aria-label")??"");switch(t){case"action":return n||oe(e,tt)||V(e.getAttribute("title")??"")||V(e.querySelector("img[alt]")?.getAttribute("alt")??"");case"field":return ls(e);case"media":return V(e.getAttribute("alt")??"")||n||V(e.getAttribute("title")??"");case"text":return oe(e,tt);default:{let o=No(e);return n||(o?oe(o,tt):"")}}}function Po(e,t){let n=ne(t.replace(/\s+/g," ").trim(),tt);return n?`${e} \u201C${n}\u201D`:e}function Le(e){let t=e.tagName.toLowerCase(),n=t==="svg"?"media":$e(e),o=as(e),r=t==="input"?(e.type||"").toLowerCase():"",i=n==="container",a=Mo(t,n,o,r,i&&ss(e),i&&!!No(e));return Po(a,cs(e,n))}function Lo(e){let t=e.facts??{},n=Mo(e.tag,e.kind,"",(t.type??"").toLowerCase(),!1,!!t.heading),o=t.label||t.heading||t.text||t.alt||"";return Po(n,o)}var rn=3;function an(e){let t=e.slice(0,rn).join(", "),n=e.length>rn?` and ${e.length-rn} more`:"";return`${e.length} elements: ${t}${n}`}function sn(e){return`Area in ${e}`}function At(e){return e.members?.length?an(e.members.map(t=>t.label)):e.area?sn(Lo(e.target)):Lo(e.target)}var ln="__grabby-overlay__",_t="__grabby-label__",cn="__grabby-styles__",ds=3;function Do(e={}){let t=null,n=null,o=null,r=null,i=null,a=null,s=[],l="";function u(){q(cn)||P(cn,`
|
|
15
|
+
#${ln} {
|
|
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
|
-
#${
|
|
24
|
+
#${_t} {
|
|
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
|
-
#${
|
|
39
|
+
#${_t}.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
|
|
44
|
+
`)}function m(){t||(u(),t=document.createElement("div"),t.id=ln,B().appendChild(t)),n||(n=document.createElement("div"),n.id=_t,e.plainLabels&&(n.className="grabby-plain"),B().appendChild(n))}function p(){if(!r||!t||!n)return;let y=r.getBoundingClientRect();if(y.width===0&&y.height===0&&!r.isConnected){t.style.display="none",n.style.display="none";return}t.style.top=`${y.top}px`,t.style.left=`${y.left}px`,t.style.width=`${y.width}px`,t.style.height=`${y.height}px`,t.style.display="block";let v=`<${r.tagName.toLowerCase()}>`;if(e.plainLabels){n.textContent=`${l} \xB7 Click to select`,x(y);return}if(s.length>0){let b=s.slice(0,ds);v+=` .${b.join(".")}${s.length>b.length?"\u2026":""}`}i&&(v+=` in ${i}`),a&&(v+=` \u2014 ${a}`),n.textContent=v,x(y)}function x(y){if(!n)return;let f=20,v=4,b=y.top-f-v;b<0&&(b=y.bottom+v);let h=y.left;n.style.top=`${b}px`,n.style.left=`${h}px`,n.style.display="block";let k=n.getBoundingClientRect(),L=document.documentElement.clientWidth;k.right>L&&(h=Math.max(0,L-k.width),n.style.left=`${h}px`)}function d(){p(),o=requestAnimationFrame(d)}function g(){o!==null&&(cancelAnimationFrame(o),o=null)}return{show(y,f,v,b){m(),r=y,i=f,e.plainLabels&&(l=Le(y)),a=v??null,s=b??[],g(),d()},hide(){g(),r=null,i=null,a=null,s=[],t&&(t.style.display="none"),n&&(n.style.display="none")},isOverlayElement(y){return y===t||y===n||y.id===ln||y.id===_t},dispose(){g(),r=null,i=null,a=null,s=[],t?.remove(),n?.remove(),O(cn),t=null,n=null}}}var un="__grabby-crosshair-styles__",Fo="__grabby-crosshair-cursor__",dn="__grabby-crosshair-h__",mn="__grabby-crosshair-v__";function Ho(){let e=null,t=null,n=!1,o=!1;function r(){q(un)||(P(un,`
|
|
45
45
|
.grabby-crosshair-line {
|
|
46
46
|
position: fixed;
|
|
47
47
|
pointer-events: none;
|
|
@@ -50,18 +50,18 @@
|
|
|
50
50
|
opacity: 0.25;
|
|
51
51
|
transition: none;
|
|
52
52
|
}
|
|
53
|
-
#${
|
|
53
|
+
#${dn} {
|
|
54
54
|
left: 0;
|
|
55
55
|
right: 0;
|
|
56
56
|
height: 1px;
|
|
57
57
|
}
|
|
58
|
-
#${
|
|
58
|
+
#${mn} {
|
|
59
59
|
top: 0;
|
|
60
60
|
bottom: 0;
|
|
61
61
|
width: 1px;
|
|
62
62
|
}
|
|
63
|
-
`),
|
|
64
|
-
#${
|
|
63
|
+
`),P(Fo,"body.grabby-crosshair-active:not(.grabby-crosshair-held) { cursor: crosshair !important; }","document"))}function i(){e||(r(),e=document.createElement("div"),e.id=dn,e.className="grabby-crosshair-line",B().appendChild(e)),t||(t=document.createElement("div"),t.id=mn,t.className="grabby-crosshair-line",B().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===dn||l.id===mn},dispose(){this.hold(!1),this.deactivate(),e?.remove(),t?.remove(),O(un),O(Fo),e=null,t=null}}}function ms(e,t){for(let n of t)n==null||n===!1||e.appendChild(typeof n=="object"?n:document.createTextNode(String(n)))}function T(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 ms(o,n),o}var Bo="http://www.w3.org/2000/svg";function de(e,t){let n=String(e.size??16),o=document.createElementNS(Bo,"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(Bo,r.tag);for(let[a,s]of Object.entries(r.attrs))i.setAttribute(a,s);o.appendChild(i)}return o}function Me(...e){return e.map(t=>({tag:"path",attrs:{d:t}}))}var pn={shapes:Me("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")},Uo={shapes:[{tag:"circle",attrs:{cx:"8",cy:"8",r:"6"}},...Me("M8 4.5V8l2.5 1.5")]},Go={shapes:Me("M8 2v5","M4.5 4a5.5 5.5 0 1 0 7 0")},Rt={shapes:Me("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"}}]},zo={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 Z="__grabby-toast__",gn="__grabby-toast-styles__",le=null;function fs(){q(gn)||P(gn,`
|
|
64
|
+
#${Z} {
|
|
65
65
|
position: fixed;
|
|
66
66
|
bottom: var(--grabby-toast-bottom, 24px);
|
|
67
67
|
left: 50%;
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
max-width: 480px;
|
|
81
81
|
min-width: 260px;
|
|
82
82
|
}
|
|
83
|
-
#${
|
|
83
|
+
#${Z} .grabby-toast-actions {
|
|
84
84
|
margin-left: auto;
|
|
85
85
|
display: flex;
|
|
86
86
|
gap: 6px;
|
|
87
87
|
padding-left: 12px;
|
|
88
88
|
}
|
|
89
|
-
#${
|
|
89
|
+
#${Z} .grabby-toast-action {
|
|
90
90
|
pointer-events: auto;
|
|
91
91
|
font: 600 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
92
92
|
padding: 6px 10px;
|
|
@@ -97,40 +97,40 @@
|
|
|
97
97
|
cursor: pointer;
|
|
98
98
|
white-space: nowrap;
|
|
99
99
|
}
|
|
100
|
-
#${
|
|
100
|
+
#${Z}:not(.grabby-toast-visible) .grabby-toast-action {
|
|
101
101
|
pointer-events: none;
|
|
102
102
|
}
|
|
103
|
-
#${
|
|
103
|
+
#${Z} .grabby-toast-action:hover {
|
|
104
104
|
background: var(--grabby-surface, #f1f5f9);
|
|
105
105
|
}
|
|
106
|
-
#${
|
|
106
|
+
#${Z} .grabby-toast-action-primary {
|
|
107
107
|
background: var(--grabby-accent, #2563eb);
|
|
108
108
|
border-color: var(--grabby-accent, #2563eb);
|
|
109
109
|
color: #fff;
|
|
110
110
|
}
|
|
111
|
-
#${
|
|
111
|
+
#${Z} .grabby-toast-action-primary:hover {
|
|
112
112
|
background: var(--grabby-accent-hover, #1d4ed8);
|
|
113
113
|
}
|
|
114
|
-
#${
|
|
114
|
+
#${Z}.grabby-toast-visible {
|
|
115
115
|
transform: translateX(-50%) translateY(0);
|
|
116
116
|
opacity: 1;
|
|
117
117
|
}
|
|
118
|
-
#${
|
|
118
|
+
#${Z} .grabby-toast-header {
|
|
119
119
|
display: flex;
|
|
120
120
|
align-items: center;
|
|
121
121
|
gap: 8px;
|
|
122
122
|
margin-bottom: 0;
|
|
123
123
|
}
|
|
124
|
-
#${
|
|
124
|
+
#${Z} .grabby-toast-icon {
|
|
125
125
|
flex-shrink: 0;
|
|
126
126
|
width: 16px;
|
|
127
127
|
height: 16px;
|
|
128
128
|
}
|
|
129
|
-
#${
|
|
129
|
+
#${Z} .grabby-toast-title {
|
|
130
130
|
font-weight: 600;
|
|
131
131
|
color: var(--grabby-toast-title, #334155);
|
|
132
132
|
}
|
|
133
|
-
#${
|
|
133
|
+
#${Z} .grabby-toast-details {
|
|
134
134
|
margin-top: 8px;
|
|
135
135
|
display: flex;
|
|
136
136
|
flex-direction: column;
|
|
@@ -138,23 +138,23 @@
|
|
|
138
138
|
font-size: 12px;
|
|
139
139
|
font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, monospace;
|
|
140
140
|
}
|
|
141
|
-
#${
|
|
141
|
+
#${Z} .grabby-toast-row {
|
|
142
142
|
display: flex;
|
|
143
143
|
gap: 8px;
|
|
144
144
|
align-items: baseline;
|
|
145
145
|
}
|
|
146
|
-
#${
|
|
146
|
+
#${Z} .grabby-toast-label {
|
|
147
147
|
color: var(--grabby-toast-label, #64748b);
|
|
148
148
|
flex-shrink: 0;
|
|
149
149
|
min-width: 72px;
|
|
150
150
|
}
|
|
151
|
-
#${
|
|
151
|
+
#${Z} .grabby-toast-value {
|
|
152
152
|
color: var(--grabby-toast-text, #334155);
|
|
153
153
|
overflow: hidden;
|
|
154
154
|
text-overflow: ellipsis;
|
|
155
155
|
white-space: nowrap;
|
|
156
156
|
}
|
|
157
|
-
#${
|
|
157
|
+
#${Z} .grabby-toast-file-link {
|
|
158
158
|
color: var(--grabby-toast-text, #334155);
|
|
159
159
|
text-decoration: none;
|
|
160
160
|
overflow: hidden;
|
|
@@ -163,11 +163,11 @@
|
|
|
163
163
|
pointer-events: auto;
|
|
164
164
|
cursor: pointer;
|
|
165
165
|
}
|
|
166
|
-
#${
|
|
166
|
+
#${Z} .grabby-toast-file-link:hover {
|
|
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 ps(){return Ee?.isConnected||(fs(),Ee=T("div",{id:Z,role:"status","aria-live":"polite"}),B().appendChild(Ee)),Ee}function bs(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}function bn(e,t){return T("div",{class:"grabby-toast-row"},T("span",{class:"grabby-toast-label"},e),typeof t=="string"?T("span",{class:"grabby-toast-value"},t):t)}function re(e,t={}){let n=ps(),{detail:o,actions:r}=t,i=t.duration??(r?.length?8e3:3500),a=[T("div",{class:"grabby-toast-header"},de(Vo,"grabby-toast-icon"),T("span",{class:"grabby-toast-title"},e))];if(o){let s=T("div",{class:"grabby-toast-details"});if(o.componentName&&s.appendChild(bn("Component",o.componentName)),o.filePath){let l=o.line!=null?`${o.filePath}:${o.line}`:o.filePath;s.appendChild(bn("File",T("a",{class:"grabby-toast-file-link",href:bs(o.filePath,o.line,o.column),title:"Open in VS Code"},l)))}o.cssClasses&&o.cssClasses.length>0&&s.appendChild(bn("Classes",o.cssClasses.map(l=>`.${l}`).join(" "))),a.push(s)}r?.length&&a[0].appendChild(T("span",{class:"grabby-toast-actions"},...r.map(s=>T("button",{type:"button",class:s.primary?"grabby-toast-action grabby-toast-action-primary":"grabby-toast-action",onclick:l=>{l.stopPropagation(),gs(),s.onClick()}},s.label)))),n.replaceChildren(...a),le&&(clearTimeout(le),le=null),n.classList.remove("grabby-toast-visible"),n.offsetHeight,n.classList.add("grabby-toast-visible"),le=setTimeout(()=>{n.classList.remove("grabby-toast-visible"),le=null},i)}function gs(){le&&(clearTimeout(le),le=null),Ee?.classList.remove("grabby-toast-visible")}function Ko(){le&&(clearTimeout(le),le=null),Ee?.remove(),Ee=null,O(gn)}function Wo(e){return Array.from(e).filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))}function jo(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 Ne(e,t=document){if(!e)return null;try{return t.querySelector(e)}catch{return null}}var hs=["data-testid","data-test","data-cy","data-qa"],ys=8;function It(e,t){try{let n=t.ownerDocument.querySelectorAll(e);return n.length===1&&n[0]===t}catch{return!1}}function vs(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 hn(e){for(let o of hs){let r=e.getAttribute(o);if(r){let i=`[${o}="${r.replace(/["\\]/g,"\\$&")}"]`;if(It(i,e))return i}}if(e.id){let o=`#${jo(e.id)}`;if(It(o,e))return o}let t=[],n=e;for(;n&&t.length<ys;){if(n!==e&&n.id){let r=`#${jo(n.id)}`;if(It(r,n)){t.unshift(r);break}}t.unshift(vs(n));let o=t.join(" > ");if(It(o,e))return o;if(n.tagName==="BODY"||n.tagName==="HTML")break;n=n.parentElement}return t.join(" > ")}var yn=20,xs=.85,Yo=4,Es=4e3,ws=new Set(["SCRIPT","STYLE","TEMPLATE","NOSCRIPT","HEAD","META","LINK","BR","WBR"]);function vn(e,t){return{left:Math.min(e.x,t.x),top:Math.min(e.y,t.y),right:Math.max(e.x,t.x),bottom:Math.max(e.y,t.y)}}function Xo(e,t){let n=Math.min(e.right,t.right)-Math.max(e.left,t.left),o=Math.min(e.bottom,t.bottom)-Math.max(e.top,t.top);return n>0&&o>0?n*o:0}function Ss(e,t){return e.left<=t.left&&e.top<=t.top&&e.right>=t.right&&e.bottom>=t.bottom}function Cs(e){let t=getComputedStyle(e);return t.visibility==="hidden"||t.opacity==="0"}function xn(e,t,n=document.body){let o=[],r=0,i=a=>{if(o.length>=yn||++r>Es||ws.has(a.tagName)||t(a)||a.hasAttribute(ie))return;let s=a.getBoundingClientRect(),l=s.width===0&&s.height===0;if(!(!l&&Xo(s,e)===0)){if(!l&&s.width>=Yo&&s.height>=Yo&&Xo(s,e)/(s.width*s.height)>=xs&&$e(a)!=="section"&&!Cs(a)){o.push(a);return}for(let u of Array.from(a.children))i(u)}};for(let a of Array.from(n.children))i(a);return o}function qo(e){if(e.length===0)return document.body;let t=e[0].parentElement??document.body;for(;t&&!e.every(n=>t.contains(n));)t=t.parentElement;return t??document.body}function Zo(e,t){let n=(e.left+e.right)/2,o=(e.top+e.bottom)/2,r=typeof document.elementsFromPoint=="function"?document.elementsFromPoint(n,o):[];for(let i of r)if(!(t(i)||i.closest(`[${ie}]`))){for(let a=i;a;a=a.parentElement)if(Ss(a.getBoundingClientRect(),e))return a}return document.body}var $t=e=>Math.round(Math.min(1,Math.max(0,e))*1e3)/1e3;function Jo(e,t){let n=e.getBoundingClientRect(),o=n.width||1,r=n.height||1;return{x:$t((t.left-n.left)/o),y:$t((t.top-n.top)/r),w:$t((t.right-t.left)/o),h:$t((t.bottom-t.top)/r)}}function nt(e,t){let n=e.getBoundingClientRect();return{left:n.left+t.x*n.width,top:n.top+t.y*n.height,right:n.left+(t.x+t.w)*n.width,bottom:n.top+(t.y+t.h)*n.height}}function ot(e){let t=null;for(let n of e){let o=n.getBoundingClientRect();o.width===0&&o.height===0||(t=t?{left:Math.min(t.left,o.left),top:Math.min(t.top,o.top),right:Math.max(t.right,o.right),bottom:Math.max(t.bottom,o.bottom)}:{left:o.left,top:o.top,right:o.right,bottom:o.bottom})}return t}var ks=6,En=typeof navigator<"u"&&/Mac|iPhone|iPad/.test(navigator.platform||navigator.userAgent),Qo=["pointerdown","mousedown","pointerup","mouseup","touchstart"];function Ts(e){return En?e.metaKey:e.ctrlKey}function er(e){let t=null,n=null,o=!1,r=null,i=null,a=null,s={x:0,y:0},l=!1,u=[];function m(A){let I=e.getComponentResolver();return I?I(A)?.name??null:null}function p(A){let I=e.getSourceResolver();if(!I)return null;let w=I(A);if(!w?.filePath)return null;let E=w.filePath;return w.line!=null&&(E+=`:${w.line}`),E}function x(A,I){let w=e.getFreezeElement?.();w&&(w.style.pointerEvents="none");let E=document.elementFromPoint(A,I);return w&&(w.style.pointerEvents="auto"),E}function d(A,I,w){let E=x(A,I);return!E||E.closest(`[${ie}]`)?E&&e.isToolbarElement?.(E)?E:null:w?E:Ro(E)}function g(A){return!!e.isToolbarElement?.(A)||e.overlay.isOverlayElement(A)||e.crosshair.isCrosshairElement(A)}function y(A){let I=m(A),w=p(A),E=Wo(A.classList);e.overlay.show(A,I,w,E)}let f=A=>`${A} element${A===1?"":"s"}`;function v(){u.length?e.groupOutline.show({elements:u},`${f(u.length)} \xB7 release ${En?"\u2318":"Ctrl"} to comment`):e.groupOutline.hide()}function b(){u.length&&(u=[],e.groupOutline.hide())}function h(){if(a=null,!i)return;e.groupOutline.marquee(i);let A=xn(i,g);A.length?e.groupOutline.show({elements:A},f(A.length)):e.groupOutline.hide()}function k(){i=null,a!==null&&cancelAnimationFrame(a),a=null,e.groupOutline.marquee(null),e.groupOutline.hide()}function L(A){let I=i;k();let w=xn(I,g);if(w.length===1)t=w[0],e.onSelect(w[0],A);else if(w.length>1)e.onSelectGroup(w,A);else{let E=Zo(I,g);e.onSelectArea(E,Jo(E,I),A)}}function C(A){let I=ye(A);if(I&&e.isToolbarElement?.(I)||(A.stopPropagation(),(A.type==="mousedown"||A.type==="touchstart")&&A.preventDefault(),n))return;let w=A,E=A.type==="pointerdown"||A.type==="mousedown";if(E&&w.button===0&&!r)r={x:w.clientX,y:w.clientY},l=!1;else if(!E&&A.type!=="touchstart"&&r){let _={x:w.clientX,y:w.clientY},D=r;r=null,i&&(i=vn(D,_),l=!0,L(_))}}function $(A){if(n)return;if(s={x:A.clientX,y:A.clientY},r){if(!i&&Math.hypot(A.clientX-r.x,A.clientY-r.y)<ks)return;i||(b(),e.overlay.hide(),t=null),i=vn(r,s),a===null&&(a=requestAnimationFrame(h));return}let I=d(A.clientX,A.clientY,A.shiftKey);!I||e.overlay.isOverlayElement(I)||e.crosshair.isCrosshairElement(I)||e.isToolbarElement?.(I)||I!==t&&(t=I,y(I),e.onHover(I))}function U(A){let I=ye(A);if(I&&e.isToolbarElement?.(I))return;let w=x(A.clientX,A.clientY);if(!(w&&(e.isToolbarElement?.(w)||e.crosshair.isCrosshairElement(w)))&&(A.preventDefault(),A.stopPropagation(),!n)){if(l){l=!1;return}if(t){if(s={x:A.clientX,y:A.clientY},Ts(A)){let E=u.indexOf(t);E>=0?u.splice(E,1):u.length<yn&&u.push(t),v();return}b(),e.onSelect(t,s)}}}function W(A){if(A.key!==(En?"Meta":"Control")||!u.length||n)return;let I=u;u=[],e.groupOutline.hide(),I.length===1?(t=I[0],e.onSelect(I[0],s)):e.onSelectGroup(I,s)}return{activate(){if(!o){o=!0,e.crosshair.activate();for(let A of Qo)window.addEventListener(A,C,{capture:!0,passive:!1});document.addEventListener("mousemove",$,!0),document.addEventListener("click",U,!0),window.addEventListener("keyup",W,!0)}},deactivate(){if(o){o=!1,t=null,n=null,r=null,l=!1,u=[],k(),e.crosshair.hold(!1),e.crosshair.deactivate();for(let A of Qo)window.removeEventListener(A,C,!0);document.removeEventListener("mousemove",$,!0),document.removeEventListener("click",U,!0),window.removeEventListener("keyup",W,!0),e.overlay.hide(),e.onHover(null)}},hold(A,I){o&&(n=A,t=A,r=null,e.crosshair.hold(!0),I?(e.overlay.hide(),e.groupOutline.show(I.spec,I.label)):y(A))},release(){n&&(n=null,e.groupOutline.hide(),e.crosshair.hold(!1))},isHolding(){return n!==null},getHoveredElement(){return t},dispose(){this.deactivate()}}}function tr(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 nr(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 As(e,t){return t.meta&&!e.metaKey||t.ctrl&&!e.ctrlKey||t.shift&&!e.shiftKey||t.alt&&!e.altKey?!1:nr(e,t.key)}function or(e){let t=null,n=!1,o=!1,r=!1;function i(s){if(!e.getEnableInInputs()&&Ie(ye(s)))return;let l=tr(e.getActivationKey());if(!As(s,l))return;let u=e.getActivationMode(),m=e.getKeyHoldDuration();if(u==="hold"){if(s.preventDefault(),n)return;if(m>0){if(t)return;t=setTimeout(()=>{n=!0,e.onActivate()},m)}else n=!0,e.onActivate()}else s.preventDefault(),o=!0}function a(s){let l=tr(e.getActivationKey());if(!nr(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 rr(){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 _s(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 ir(e){return _s(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 ar="theme-vars",sr="theme-overrides",Rs=`
|
|
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
|
-
`,
|
|
201
|
+
`,Is={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"},$s=/^[#a-zA-Z0-9\s(),.%-]+$/;function lr(){return{apply(e){P(ar,Rs)},applyOverrides(e){let t=[];for(let[n,o]of Object.entries(Is)){let r=e[n];r&&$s.test(r)&&!/url\s*\(/i.test(r)&&t.push(` ${o}: ${r};`)}if(t.length===0){this.clearOverrides();return}P(sr,` :host {
|
|
202
202
|
${t.join(`
|
|
203
203
|
`)}
|
|
204
|
-
}`)},clearOverrides(){
|
|
205
|
-
#${
|
|
204
|
+
}`)},clearOverrides(){O(sr)},dispose(){O(ar),this.clearOverrides()}}}var H="__grabby-toolbar__",Lt=42,Ke="cubic-bezier(0.19, 1, 0.22, 1)",wn=360,Sn="__grabby-toolbar-styles__";function Ls(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 cr(e,t={}){let n=null,o=null,r={},i=new Set,a=null,s=null,l=null,u=null,m=!1,p=null;function x(){p&&clearTimeout(p),p=null}function d(){q(Sn)||P(Sn,`
|
|
205
|
+
#${H} {
|
|
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: ${
|
|
222
|
+
height: ${Lt}px;
|
|
223
223
|
overflow: hidden;
|
|
224
224
|
justify-content: flex-end;
|
|
225
225
|
transition: opacity 0.2s ease, transform 0.2s ease,
|
|
226
|
-
left ${
|
|
226
|
+
left ${wn}ms ${Ke}, width ${wn}ms ${Ke};
|
|
227
227
|
}
|
|
228
|
-
#${
|
|
228
|
+
#${H} .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 ${
|
|
235
|
+
transform 0.42s ${Ke}, visibility 0s;
|
|
236
236
|
}
|
|
237
|
-
#${
|
|
237
|
+
#${H}.grabby-toolbar-hidden {
|
|
238
238
|
opacity: 0;
|
|
239
239
|
transform: translateX(-50%) translateY(20px);
|
|
240
240
|
pointer-events: none;
|
|
241
241
|
}
|
|
242
|
-
#${
|
|
242
|
+
#${H} 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
|
-
#${
|
|
256
|
+
#${H} button:hover {
|
|
257
257
|
background: var(--grabby-toolbar-hover, #f1f5f9);
|
|
258
258
|
color: var(--grabby-accent, #2563eb);
|
|
259
259
|
}
|
|
260
|
-
#${
|
|
261
|
-
#${
|
|
260
|
+
#${H} button { position: relative; }
|
|
261
|
+
#${H} 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
|
-
#${
|
|
268
|
+
#${H} .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
|
-
#${
|
|
284
|
-
#${
|
|
283
|
+
#${H} .grabby-badge[hidden] { display: none; }
|
|
284
|
+
#${H} button.grabby-btn-active {
|
|
285
285
|
color: var(--grabby-toolbar-active, #2563eb);
|
|
286
286
|
}
|
|
287
|
-
#${
|
|
287
|
+
#${H} button.grabby-btn-disabled {
|
|
288
288
|
opacity: 0.4;
|
|
289
289
|
color: var(--grabby-toolbar-text, #64748b);
|
|
290
290
|
}
|
|
291
|
-
#${
|
|
291
|
+
#${H} .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
|
-
#${
|
|
298
|
+
#${H} .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
|
-
#${
|
|
307
|
+
#${H} .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
|
-
#${
|
|
314
|
-
#${
|
|
315
|
-
#${
|
|
316
|
-
#${
|
|
317
|
-
#${
|
|
318
|
-
#${
|
|
313
|
+
#${H} .grabby-toolbar-status[data-tone="ok"]::before { content: "\u2713 "; }
|
|
314
|
+
#${H} .grabby-toolbar-status[data-tone="busy"] { color: var(--grabby-toolbar-text, #64748b); }
|
|
315
|
+
#${H} .grabby-toolbar-status[data-tone="error"] { color: #b91c1c; }
|
|
316
|
+
#${H} .grabby-toolbar-status[hidden],
|
|
317
|
+
#${H} button[hidden] { display: none; }
|
|
318
|
+
#${H} 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
|
-
#${
|
|
327
|
+
#${H} button.grabby-btn-finish:hover {
|
|
328
328
|
background: var(--grabby-accent-hover, #1d4ed8);
|
|
329
329
|
color: #fff;
|
|
330
330
|
}
|
|
331
|
-
#${
|
|
331
|
+
#${H} 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 ${
|
|
341
|
+
transition: opacity 0.2s ease-out, scale 0.3s ${Ke}, visibility 0s 0.2s;
|
|
342
342
|
}
|
|
343
|
-
#${
|
|
344
|
-
#${
|
|
345
|
-
left: calc(100% - 20px - ${
|
|
343
|
+
#${H} button.grabby-btn-expand .grabby-badge { top: -3px; right: -5px; }
|
|
344
|
+
#${H}.grabby-toolbar-collapsed {
|
|
345
|
+
left: calc(100% - 20px - ${Lt/2}px);
|
|
346
346
|
padding: 4px;
|
|
347
347
|
}
|
|
348
|
-
#${
|
|
348
|
+
#${H}.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 ${
|
|
355
|
+
transform 0.42s ${Ke}, visibility 0s 0.3s;
|
|
356
356
|
}
|
|
357
|
-
#${
|
|
357
|
+
#${H}.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 ${
|
|
362
|
+
transition: opacity 0.24s ease-out 0.08s, scale 0.36s ${Ke} 0.08s, visibility 0s;
|
|
363
363
|
}
|
|
364
364
|
@media (prefers-reduced-motion: reduce) {
|
|
365
|
-
#${
|
|
365
|
+
#${H}, #${H} .grabby-toolbar-content, #${H} button.grabby-btn-expand {
|
|
366
366
|
transition-duration: 0s !important;
|
|
367
367
|
transition-delay: 0s !important;
|
|
368
368
|
}
|
|
369
369
|
}
|
|
370
|
-
#${
|
|
370
|
+
#${H} .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
|
|
375
|
+
`)}function g(f,v,b,h){let k=document.createElement("button");return k.type="button",k.appendChild(de(v)),k.title=b,k.setAttribute("aria-label",b),k.setAttribute("data-grabby-btn",f),k.addEventListener("click",L=>{L.preventDefault(),L.stopPropagation(),h()}),k}function y(){if(n)return;d(),n=document.createElement("div"),n.id=H,n.setAttribute("role","toolbar"),n.setAttribute("aria-label","Grabby toolbar"),r.selection=g("selection",pn,"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=g("history",Uo,"Comments",e.onHistory),a=document.createElement("span"),a.className="grabby-badge",a.hidden=!0,r.history.appendChild(a),r.enable=g("enable",Go,"Enable/Disable",e.onEnableToggle),r.dismiss=g("dismiss",Rt,t.dismissLabel??"Dismiss toolbar",e.onDismiss),r.expand=g("expand",pn,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 f=document.createElement("span");f.className="grabby-toolbar-divider",o=document.createElement("div"),o.className="grabby-toolbar-left",o.appendChild(r.selection),o.appendChild(r.history),o.appendChild(f),u=document.createElement("div"),u.className="grabby-toolbar-content",u.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",v=>{v.preventDefault(),v.stopPropagation(),e.onFinish?.()}),u.appendChild(s),u.appendChild(r.finish),i.add(s)),t.hideEnable||u.appendChild(r.enable),u.appendChild(r.dismiss),n.append(u,r.expand),m&&(n.classList.add("grabby-toolbar-collapsed"),n.style.width=`${Lt}px`),B().appendChild(n),i.clear(),i.add(n),i.add(o),i.add(u),i.add(f);for(let v of Object.values(r))i.add(v)}return{show(){y(),n.classList.remove("grabby-toolbar-hidden")},hide(){n&&n.classList.add("grabby-toolbar-hidden")},update(f){if(!n)return;f.active?r.selection.classList.add("grabby-btn-active"):r.selection.classList.remove("grabby-btn-active");let v=f.toolbar.comments.length;for(let b of[a,l])b&&(b.hidden=v===0,b.textContent=v>99?"99+":String(v));if(r.history.setAttribute("aria-label",v?`Comments (${v})`:"Comments"),s&&r.finish){let b=Ls(f.toolbar.comments);s.hidden=!b,s.textContent=b?.text??"",s.dataset.tone=b?.tone??"",r.finish.hidden=v===0}f.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(){m||(m=!0,n&&(x(),n.style.width=`${n.offsetWidth}px`,n.offsetWidth,n.classList.add("grabby-toolbar-collapsed"),n.style.width=`${Lt}px`))},expand(){if(!m||(m=!1,!n))return;x(),n.classList.remove("grabby-toolbar-collapsed");let f=getComputedStyle(n),v=["paddingLeft","paddingRight","borderLeftWidth","borderRightWidth"].reduce((b,h)=>b+(parseFloat(f[h])||0),0);n.style.width=`${(u?.offsetWidth??0)+v}px`,p=setTimeout(()=>{p=null,!m&&n&&(n.style.width="")},wn+40)},isCollapsed(){return m},isToolbarElement(f){if(i.has(f))return!0;let v=f;for(;v;){if(v===n||v.id===H)return!0;v=v.parentElement}return!1},dispose(){x(),n?.remove(),O(Sn),n=null,o=null,u=null,r={},a=null,l=null,s=null,i.clear()}}}function dr(e){return Math.ceil(e.length/4)}var ur=new Set(["styles","layout","computed"]),Ms=new Set(["label","type","text","href","placeholder","alt","src","title"]);function Ns(e,t){return t.length>0&&(e.includes(`>${t}<`)||e.includes(`"${t}"`)||e.includes(`>${t}`))}function Ps(e){return e.anonymous||!e.name?`anon:${e.sessionId}`:`name:${e.name}`}function it(e){return!e.anonymous&&e.name?e.name:`Anonymous ${e.sessionId.replace(/-/g,"").slice(0,4)}`}function Os(e){return e.split(/[\\/]/).pop()??e}function rt(e,t,n){let o=n?e:Os(e);return t!=null?`${o}:${t}`:o}function mr(e,t){return e.split(`
|
|
376
376
|
`).map((n,o)=>o===0?n:`${t}${n}`).join(`
|
|
377
|
-
`)}function
|
|
378
|
-
`);let s=new Map;for(let
|
|
379
|
-
`)}var
|
|
380
|
-
#${
|
|
377
|
+
`)}function Pe(e){return Array.from(new Set(e))}function Ds(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=Pe(e.map(u=>u.framework).filter(Boolean));a.length&&i.push(a.join(", "));let s=Pe(e.map(u=>u.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 u=Pe(e.map(m=>it(m.author)));r.push(`From: ${u.join(", ")}`)}return r}var Mt=e=>`${Math.round(e*100)}%`;function Fs(e,t){return(e.members??[]).map(n=>n.source?rt(n.source.file,n.source.line,t):n.selector).join(", ")}function Hs(e,t,n){let o=e.target,i=[o.source?rt(o.source.file,o.source.line,!0):o.selector,o.component,`<${o.tag}>`].filter(Boolean).join(" "),a=e.members?.length?`[${e.members.length} elements] ${Fs(e,!0)}`:e.area?`[area] in ${i}`:i,s=n.showAuthors?` (${it(e.author)})`:"",l=n.showRoutes?` [${e.page.route}]`:"",u=n.showIds?` [id ${e.id}]`:"";return`${t}. ${a}${l} \u2014 ${mr(e.comment," ")}${s}${u}`}function Bs(e,t,n,o,r){let i=e.target,a=n.level==="detailed",s=[`${t}. ${mr(e.comment," ")}`],l=d=>s.push(` - ${d}`),u=[`\`${i.preview}\``,`(${i.kind})`];if(i.component&&i.component!==r?u.push(i.source?.line!=null&&o?`${i.component} line ${i.source.line}`:i.component):i.source?.line!=null&&o&&u.push(`line ${i.source.line}`),e.members?.length&&u.unshift("in"),e.area&&u.unshift("area in"),l(u.join(" ")),e.area){let d=e.area;l(`region: ${Mt(d.x)} from left, ${Mt(d.y)} from top, ${Mt(d.w)} wide, ${Mt(d.h)} tall`)}if(e.members?.length){l(`${e.members.length} elements:`);for(let d of e.members){let g=d.source?rt(d.source.file,d.source.line,a):`selector \`${d.selector}\``;s.push(` - \`${d.preview}\` (${d.kind})${d.component&&d.component!==i.component?` ${d.component}`:""} ${g}`)}}(!i.source||a)&&l(`selector: \`${i.selector}\``);let m=Object.entries(i.facts).filter(([d,g])=>!ur.has(d)&&!(Ms.has(d)&&!a&&Ns(i.preview,g)));m.length&&l(m.map(([d,g])=>`${d}: ${g}`).join(" \xB7 "));for(let[d,g]of Object.entries(i.facts))ur.has(d)&&l(`${d}: ${g}`);let p=i.stack.filter((d,g)=>!(g===0&&(i.source||d.name===i.component)));if(p.length&&l(`inside: ${p.map(d=>d.file?`${d.name} (${rt(d.file,d.line,a)})`:d.name).join(" \u203A ")}`),a){for(let[d,g]of Object.entries(i.extra))l(`${d}: ${g}`);l(`viewport: ${e.page.viewport[0]}\xD7${e.page.viewport[1]}`)}e.screenshot?.url&&l(`screenshot: ${e.screenshot.url}`);let x=[];return n.showAuthors&&x.push(`by ${it(e.author)}`),n.showRoutes&&x.push(`on ${e.page.route}`),x.length&&l(x.join(" ")),n.showIds&&l(`id: ${e.id}`),s}function fr(e,t="standard",n={}){if(e.length===0)return"";let o=[...e].sort((u,m)=>u.createdAt-m.createdAt),r=Pe(o.map(u=>Ps(u.author))),i={level:t,showIds:n.showIds===!0,showAuthors:r.length>1||o.some(u=>!u.author.anonymous&&!!u.author.name),showRoutes:Pe(o.map(u=>u.page.route)).length>1},a=Ds(o,n,i);if(t==="compact")return a.push(""),o.forEach((u,m)=>a.push(Hs(u,m+1,i))),a.join(`
|
|
378
|
+
`);let s=new Map;for(let u of o){let m=u.target.source?.file??"",p=s.get(m);p?p.push(u):s.set(m,[u])}let l=0;for(let[u,m]of s){a.push("");let p=Pe(m.map(g=>g.target.component)),x=u&&p.length===1?p[0]:null,d=Pe(m.map(g=>g.target.source?.line??null));if(u){let g=d.length===1?rt(u,d[0],!0):u;a.push(`## ${g}${x?` \xB7 ${x}`:""}`)}else a.push("## Elements without source info");for(let g of m)l+=1,a.push(...Bs(g,l,i,!!u&&d.length>1,x))}return a.join(`
|
|
379
|
+
`)}var Us="grabby",Pt="screenshots";var Nt=null;function Gs(){return Nt||(Nt=new Promise(e=>{try{if(typeof indexedDB>"u"){e(null);return}let t=indexedDB.open(Us,1);t.onupgradeneeded=()=>{t.result.objectStoreNames.contains(Pt)||t.result.createObjectStore(Pt)},t.onsuccess=()=>e(t.result),t.onerror=()=>e(null),t.onblocked=()=>e(null)}catch{e(null)}}),Nt)}async function Cn(e,t){let n=await Gs();return n?new Promise(o=>{try{let r=n.transaction(Pt,e),i=t(r.objectStore(Pt));r.oncomplete=()=>o(i?i.result:null),r.onerror=()=>o(null),r.onabort=()=>o(null)}catch{o(null)}}):null}function pr(e,t){return Cn("readwrite",n=>n.put(t,e))}function at(e){return Cn("readonly",t=>t.get(e))}function kn(e){return e.length===0?Promise.resolve(null):Cn("readwrite",t=>{for(let n of e)t.delete(n)})}var Tn="__grabby-comments__",br="comments-panel",Vs={pending:"Sending\u2026",sent:"Sent",failed:"Not sent"};function zs(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 Ks(e){return e.split(/[\\/]/).pop()??e}function js(e,t,n){let o=`vscode://file/${encodeURI(e)}`;return t!=null&&(o+=`:${t}`),t!=null&&n!=null&&(o+=`:${n}`),o}var Ws=`
|
|
380
|
+
#${Tn} {
|
|
381
381
|
position: fixed;
|
|
382
|
-
bottom: ${
|
|
382
|
+
bottom: ${xe};
|
|
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
|
-
#${
|
|
400
|
+
#${Tn}.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
|
|
467
|
-
#${
|
|
466
|
+
`;function gr(e,t={}){let n=t.variant==="live",o=null,r=!1,i=[];function a(){return o?.isConnected||(P(br,Ws),o=T("div",{id:Tn,role:"dialog","aria-label":"Comments"}),B().appendChild(o)),o}function s(){for(let p of i)URL.revokeObjectURL(p);i=[]}function l(p){let x=p.screenshot?.localId;if(!x)return null;let d=T("img",{class:"grabby-thumb",alt:"",loading:"lazy"});return d.addEventListener("error",()=>d.remove(),{once:!0}),at(x).then(g=>{if(!g||typeof URL.createObjectURL!="function"){d.remove();return}let y=URL.createObjectURL(g);i.push(y),d.src=y}).catch(()=>d.remove()),d}function u(p,x){let d=p.target,g=p.members?.length?`${p.members.length} elements`:p.area?"area":null,y=n?[document.createTextNode(`${At(p)} `)]:[T("span",{class:"grabby-kind"},g??d.kind)];n||(d.component&&y.push(document.createTextNode(`${d.component} `)),d.source?y.push(T("a",{href:js(d.source.file,d.source.line,d.source.column),title:`Open ${d.source.file} in VS Code`,onclick:h=>h.stopPropagation()},`${Ks(d.source.file)}${d.source.line!=null?`:${d.source.line}`:""}`)):d.component||y.push(document.createTextNode(`<${d.tag}>`)));let f=[x&&!n?it(p.author):"",zs(p.createdAt)].filter(Boolean);y.push(document.createTextNode(` \xB7 ${f.join(" \xB7 ")}`)),t.showSync&&p.sync&&(y.push(document.createTextNode(" \xB7 ")),y.push(T("span",{class:`grabby-sync grabby-sync-${p.sync}`},Vs[p.sync]??p.sync)));let v=T("button",{type:"button",class:"grabby-comment-delete","aria-label":"Delete comment",title:"Delete comment",onclick:h=>{h.stopPropagation(),e.onDelete(p)}},de(Rt)),b=T("div",{class:"grabby-comment-row",role:"button",tabindex:"0","aria-label":`Edit comment: ${p.comment}`,dataset:{grabbyCommentId:p.id}},l(p),T("div",{class:"grabby-comment-body"},T("div",{class:"grabby-comment-text"},p.comment),T("div",{class:"grabby-comment-meta"},...y)),v);return Ne(d.selector)||b.classList.add("grabby-comment-missing"),b.addEventListener("mouseenter",()=>e.onHover(p)),b.addEventListener("mouseleave",()=>e.onHover(null)),b.addEventListener("click",h=>{h.stopPropagation(),e.onEdit(p,b)}),b.addEventListener("keydown",h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),e.onEdit(p,b)),(h.key==="Delete"||h.key==="Backspace")&&(h.preventDefault(),e.onDelete(p))}),b}function m(p){let x=a();s();let d=p.length,y=new Set(p.map(k=>k.author.anonymous?k.author.sessionId:k.author.name)).size>1||p.some(k=>!k.author.anonymous),f=T("div",{class:"grabby-panel-header"},T("span",{class:"grabby-panel-title"},n?"Your feedback":"Comments",T("span",{class:"grabby-panel-count"},String(d))),d>0&&!n?T("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-all":"",onclick:k=>{k.stopPropagation(),e.onCopyAll()}},"Copy all\u2026"):null),v=d===0?T("div",{class:"grabby-panel-empty"},T("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."):T("div",{class:"grabby-panel-list"},...p.map(k=>u(k,y))),b=t.identityLabel?.()??null,h=null;n&&b?h=T("div",{class:"grabby-panel-footer"},T("span",null,`Commenting as ${b}`),T("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-change-identity":"",onclick:k=>{k.stopPropagation(),e.onChangeIdentity?.()}},"Change")):!n&&d>0&&(h=T("div",{class:"grabby-panel-footer"},T("span",null,"Click a comment to edit it"),T("button",{type:"button",class:"grabby-btn grabby-btn-link","data-grabby-clear-all":"",onclick:k=>{k.stopPropagation(),e.onClearAll()}},"Clear all"))),x.replaceChildren(f,v,...h?[h]:[])}return{show(p){m(p),r=!0,a().offsetHeight,a().classList.add("grabby-popover-visible")},refresh(p){r&&m(p)},hide(){r=!1,o?.classList.remove("grabby-popover-visible")},isVisible(){return r},isPanelElement(p){return!!o&&(p===o||o.contains(p))},dispose(){s(),o?.remove(),O(br),o=null,r=!1}}}var j="__grabby-comment-popover__",An="__grabby-comment-styles__";function hr(e){let t=null,n=null,o=!1,r={mode:"new"},i=null,a=!1,s="comment",l="",u=null,m="";function p(){q(An)||P(An,`
|
|
467
|
+
#${j} {
|
|
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
|
-
#${
|
|
487
|
+
#${j} textarea {
|
|
488
488
|
width: 100%;
|
|
489
489
|
min-height: 64px;
|
|
490
490
|
padding: 8px 10px;
|
|
@@ -497,51 +497,58 @@ ${t.join(`
|
|
|
497
497
|
outline: none;
|
|
498
498
|
box-sizing: border-box;
|
|
499
499
|
}
|
|
500
|
-
#${
|
|
500
|
+
#${j} textarea:focus {
|
|
501
501
|
border-color: var(--grabby-accent, #2563eb);
|
|
502
502
|
}
|
|
503
|
-
#${
|
|
503
|
+
#${j} textarea::placeholder {
|
|
504
504
|
color: var(--grabby-text-muted, #94a3b8);
|
|
505
505
|
}
|
|
506
|
-
#${
|
|
507
|
-
#${
|
|
508
|
-
#${
|
|
506
|
+
#${j} .grabby-cp-title { font: 600 13px/1.3 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-popover-text, #334155); }
|
|
507
|
+
#${j} .grabby-cp-sub { font: 12px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: var(--grabby-text-muted, #94a3b8); }
|
|
508
|
+
#${j} .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
|
-
#${
|
|
514
|
-
#${
|
|
515
|
-
#${
|
|
513
|
+
#${j} .grabby-cp-name:focus { border-color: var(--grabby-accent, #2563eb); }
|
|
514
|
+
#${j} .grabby-cp-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; }
|
|
515
|
+
#${j} .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
|
-
#${
|
|
519
|
+
#${j} .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
|
-
#${
|
|
524
|
-
|
|
525
|
-
|
|
523
|
+
#${j} .grabby-cp-heading {
|
|
524
|
+
font: 600 12px/1.35 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
525
|
+
color: #15803d;
|
|
526
|
+
overflow: hidden;
|
|
527
|
+
text-overflow: ellipsis;
|
|
528
|
+
white-space: nowrap;
|
|
529
|
+
}
|
|
530
|
+
#${j} .grabby-cp-edit-actions { display: flex; align-items: center; gap: 6px; }
|
|
531
|
+
#${j} .grabby-cp-edit-actions .grabby-cp-spacer { flex: 1; }
|
|
532
|
+
#${j} .grabby-cp-delete {
|
|
526
533
|
font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 8px 6px; border: none;
|
|
527
534
|
border-radius: 8px; background: transparent; color: #b91c1c; cursor: pointer;
|
|
528
535
|
}
|
|
529
|
-
#${
|
|
530
|
-
#${
|
|
536
|
+
#${j} .grabby-cp-delete:hover { background: rgba(185, 28, 28, 0.08); }
|
|
537
|
+
#${j} .grabby-cp-cancel {
|
|
531
538
|
font: 500 12px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; padding: 8px 10px; border: none;
|
|
532
539
|
border-radius: 8px; background: transparent; color: var(--grabby-text-muted, #64748b); cursor: pointer;
|
|
533
540
|
}
|
|
534
|
-
#${
|
|
535
|
-
#${
|
|
541
|
+
#${j} .grabby-cp-cancel:hover { background: var(--grabby-surface, #f1f5f9); }
|
|
542
|
+
#${j} .grabby-cp-hint {
|
|
536
543
|
font-size: 11px;
|
|
537
544
|
color: var(--grabby-text-muted, #94a3b8);
|
|
538
545
|
white-space: nowrap;
|
|
539
546
|
text-align: right;
|
|
540
547
|
}
|
|
541
|
-
`)}function
|
|
542
|
-
#${
|
|
548
|
+
`)}function x(){if(t)return t;p(),t=document.createElement("div"),t.id=j,t.setAttribute("role","dialog"),t.setAttribute("aria-label","Comment"),n=document.createElement("textarea"),n.placeholder="What should change here?",n.rows=3;let C=document.createElement("span");return C.className="grabby-cp-hint",C.textContent="\u21B5 save \xB7 Esc cancel \xB7 \u21E7\u21B5 newline",t.appendChild(n),t.appendChild(C),B().appendChild(t),t}function d(C,$,U){let W=window.innerWidth,A=window.innerHeight,I=300,w=120;if(!$&&!U){C.style.left="50%",C.style.top="24px",C.style.transform="translateX(-50%)";return}let E=U?{...U,width:U.right-U.left,height:U.bottom-U.top}:$.getBoundingClientRect(),_,D;E.right+16+I<=W?(_=E.right+16,D=E.top+E.height/2-w/2):E.left-16-I>=0?(_=E.left-16-I,D=E.top+E.height/2-w/2):E.bottom+12+w<=A?(_=Math.max(12,Math.min(E.left,W-I-12)),D=E.bottom+12):(_=Math.max(12,Math.min(E.left,W-I-12)),D=Math.max(12,E.top-12-w)),D=Math.max(12,Math.min(D,A-w-12)),C.style.transform="",C.style.left=`${_}px`,C.style.top=`${D}px`}function g(C){return!!C&&C!==n&&C!==u&&Ie(C)}function y(){let C=n?.value.trim();C&&(l=C,a?b():v())}function f(){let C=W=>A=>{A.stopPropagation(),W()},$=()=>{let W=r;L(),e.onCancel(W)},U=()=>{let W=r;L(),e.onDelete?.(W)};return T("div",{class:"grabby-cp-edit-actions"},e.onDelete?T("button",{type:"button",class:"grabby-cp-delete","data-grabby-delete":"",onclick:C(U)},"Delete"):null,T("span",{class:"grabby-cp-spacer"}),T("button",{type:"button",class:"grabby-cp-cancel","data-grabby-cancel":"",onclick:C($)},"Cancel"),T("button",{type:"button",class:"grabby-cp-post","data-grabby-save":"",onclick:C(y)},"Save"))}function v(C){let $=r,U=l;L(),C?e.onSubmit(U,$,C):e.onSubmit(U,$)}function b(){if(!t)return;s="identity",u=T("input",{type:"text",class:"grabby-cp-name",placeholder:"Your name",maxlength:"80",autocomplete:"name","aria-label":"Your name"});let C=()=>v({name:u?.value.trim()||null});t.replaceChildren(T("div",{class:"grabby-cp-title"},"Thanks! Who is this from?"),T("div",{class:"grabby-cp-sub"},"Your name helps the team follow up. It's remembered in this browser."),u,T("div",{class:"grabby-cp-actions"},T("button",{type:"button",class:"grabby-cp-link","data-grabby-anonymous":"",onclick:$=>{$.stopPropagation(),v({name:null})}},"Post anonymously"),T("button",{type:"button",class:"grabby-cp-post","data-grabby-post":"",onclick:$=>{$.stopPropagation(),C()}},"Post"))),u.focus()}function h(){i||(i=C=>{if(!o)return;if(s==="identity"){if(C.key==="Escape"){C.preventDefault(),C.stopImmediatePropagation();let U=r;L(),e.onCancel(U)}else C.key==="Enter"&&Qt()===u&&(C.preventDefault(),C.stopImmediatePropagation(),v({name:u?.value.trim()||null}));return}if(!n)return;let $=Qt();if($!==n){if(g($))return;n.focus()}if(C.stopImmediatePropagation(),C.key==="Enter"&&!C.shiftKey)C.preventDefault(),y();else if(C.key==="Escape"){C.preventDefault();let U=r;L(),e.onCancel(U)}},document.addEventListener("keydown",i,!0))}function k(){i&&(document.removeEventListener("keydown",i,!0),i=null)}function L(){o=!1,t?.remove(),t=null,n=null,u=null,s="comment",k()}return{show(C){L();let $=x();m=C.initialValue??"",n.value=m,r={mode:C.mode,entryId:C.entryId},a=C.askIdentity===!0&&C.mode==="new",o=!0,n.placeholder=C.placeholder??"What should change here?",C.heading&&$.prepend(T("div",{class:"grabby-cp-heading",title:C.heading},C.heading)),C.mode==="edit"&&$.appendChild(f()),d($,C.anchor,C.anchorBox),h(),n?.focus(),requestAnimationFrame(()=>n?.focus())},hide(){o&&L()},isVisible(){return o},hasDraft(){if(!o)return!1;if(s==="identity")return!0;let C=n?.value.trim()??"";return C!==""&&C!==m.trim()},isPopoverElement(C){if(!t)return!1;let $=C;for(;$;){if($===t||$.id===j)return!0;$=$.parentElement}return!1},dispose(){L(),O(An)}}}var xr="__grabby-copy-sheet__",yr="copy-sheet",vr=[{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."}],Ys=`
|
|
549
|
+
#${xr} {
|
|
543
550
|
position: fixed;
|
|
544
|
-
bottom: ${
|
|
551
|
+
bottom: ${xe};
|
|
545
552
|
left: 50%;
|
|
546
553
|
transform: translateX(-50%);
|
|
547
554
|
z-index: ${2147483647};
|
|
@@ -585,10 +592,10 @@ ${t.join(`
|
|
|
585
592
|
.grabby-sheet .grabby-btn:hover { background: var(--grabby-popover-hover, #f1f5f9); }
|
|
586
593
|
.grabby-sheet .grabby-btn-primary { background: var(--grabby-accent, #2563eb); border-color: var(--grabby-accent, #2563eb); color: #fff; }
|
|
587
594
|
.grabby-sheet .grabby-btn-primary:hover { background: var(--grabby-accent-hover, #1d4ed8); }
|
|
588
|
-
`;function
|
|
589
|
-
#${
|
|
595
|
+
`;function Xs(){return typeof navigator<"u"&&/Mac|iPhone|iPad/i.test(navigator.platform||navigator.userAgent)}function Er(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(),P(yr,Ys);let a=i.level,s=!1,l=Xs()?"\u2318":"Ctrl",u=T("span",{class:"grabby-sheet-tokens"}),m=T("div",{class:"grabby-sheet-hint"}),p=T("div",{class:"grabby-sheet-status",role:"status","aria-live":"polite"}),x=T("textarea",{"aria-label":"Text that will be copied",spellcheck:"false"}),d=new Map;function g(){u.textContent=`\u2248 ${dr(x.value).toLocaleString()} tokens`}function y(h,k=!1){if(h===a&&!k)return;let L=s&&h!==a;a=h,s=!1,x.value=i.render(a),m.textContent=vr.find(C=>C.id===a)?.hint??"";for(let[C,$]of d)$.setAttribute("aria-checked",String(C===a));p.classList.remove("grabby-error"),p.textContent=L?"Your edits were replaced by the new detail level.":"",g(),e.onLevelChange?.(a)}let f=T("div",{class:"grabby-seg",role:"radiogroup","aria-label":"Detail level"},...vr.map(h=>{let k=T("button",{type:"button",role:"radio","aria-checked":"false",title:h.hint,onclick:L=>{L.stopPropagation(),y(h.id)}},h.label);return d.set(h.id,k),k}));async function v(h){if(await e.onCopy(x.value,h,a)){o();return}x.focus(),x.select(),p.classList.add("grabby-error"),p.textContent=`The browser blocked the clipboard. The text is selected; press ${l}+C to copy it.`}x.addEventListener("input",()=>{s=!0,g()});let b=i.count;t=T("div",{id:xr,class:"grabby-sheet",role:"dialog","aria-modal":"false","aria-label":"Copy comments"},T("div",{class:"grabby-sheet-head"},T("span",{class:"grabby-sheet-title"},`Copy ${b} comment${b===1?"":"s"} for your AI agent`),u),f,m,x,p,T("div",{class:"grabby-sheet-actions"},T("span",{class:"grabby-spacer"},`${l}+Enter copies and clears \xB7 Esc closes`),T("button",{type:"button",class:"grabby-btn","data-grabby-copy-keep":"",onclick:h=>{h.stopPropagation(),v("keep")}},"Copy, keep comments"),T("button",{type:"button",class:"grabby-btn grabby-btn-primary","data-grabby-copy-clear":"",onclick:h=>{h.stopPropagation(),v("clear")}},"Copy & clear"))),n=h=>{t&&(h.key==="Escape"?(h.preventDefault(),h.stopImmediatePropagation(),o()):h.key==="Enter"&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),h.stopImmediatePropagation(),v("clear")))},document.addEventListener("keydown",n,!0),B().appendChild(t),y(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(),O(yr)}}}var Sr="__grabby-finish-sheet__",wr="finish-sheet",qs=15e3,Zs=3e3,Js=`
|
|
596
|
+
#${Sr} {
|
|
590
597
|
position: fixed;
|
|
591
|
-
bottom: ${
|
|
598
|
+
bottom: ${xe};
|
|
592
599
|
left: 50%;
|
|
593
600
|
transform: translateX(-50%);
|
|
594
601
|
z-index: ${2147483647};
|
|
@@ -619,29 +626,29 @@ ${t.join(`
|
|
|
619
626
|
.grabby-finish .grabby-btn[disabled] { opacity: .6; cursor: default; }
|
|
620
627
|
.grabby-finish .grabby-btn-primary { background: var(--grabby-accent, #2563eb); border-color: var(--grabby-accent, #2563eb); color: #fff; }
|
|
621
628
|
.grabby-finish .grabby-btn-primary:hover { background: var(--grabby-accent-hover, #1d4ed8); }
|
|
622
|
-
`;function
|
|
623
|
-
#${
|
|
624
|
-
position: fixed; bottom: ${
|
|
629
|
+
`;function _n(e,t){return`${e} ${t}${e===1?"":"s"}`}function Cr(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 u(){l(),s=!1,t&&(t.remove(),t=null,n&&(document.removeEventListener("keydown",n,!0),n=null))}function m(){u(),e.onDone()}function p(){if(o.pending===0||s){m();return}r=!0,e.onRetry(),a=setInterval(e.onRetry,Zs),i=setTimeout(()=>{l(),s=!0,d()},qs),d()}function x(g,y,f=!1,v=!1){let b=T("button",{type:"button",class:f?"grabby-btn grabby-btn-primary":"grabby-btn",onclick:h=>{h.stopPropagation(),y()}},g);return b.disabled=v,b}function d(){if(!t)return;let{total:g,sent:y,pending:f,failed:v}=o,b=[],h="";g===0?b.push(T("div",{class:"grabby-finish-line"},"You haven't left any comments yet.")):f===0&&v===0?(b.push(T("div",{class:"grabby-finish-line","data-tone":"ok"},g===1?"\u2713 Your comment was sent to the team.":`\u2713 All ${g} comments were sent to the team.`)),h="Press Done to start a fresh list, or just close this tab."):(y&&b.push(T("div",{class:"grabby-finish-line","data-tone":"ok"},`\u2713 ${_n(y,"comment")} sent to the team`)),f&&b.push(T("div",{class:"grabby-finish-line"},`${_n(f,"comment")} still sending\u2026`)),v&&b.push(T("div",{class:"grabby-finish-line","data-tone":"error"},`${_n(v,"comment")} couldn't be sent`)),s&&f?h="They're saved in this browser and will be sent the next time you open this site. You can close this tab.":f?h="Keep this tab open for a moment.":v&&(h="Try again, or let the team know your feedback didn't go through."));let k=[x("Keep reviewing",u)];v&&k.push(x("Try again",e.onRetry)),g===0?k.push(x("Exit feedback mode",m,!0)):r?k.push(x("Sending\u2026",()=>{},!0,!0)):k.push(x("Done",p,!0)),t.replaceChildren(T("div",{class:"grabby-finish-title"},"Your review"),T("div",{class:"grabby-finish-lines",role:"status","aria-live":"polite"},...b),...h?[T("div",{class:"grabby-finish-note"},h)]:[],T("div",{class:"grabby-finish-actions"},...k)),t.querySelector(".grabby-btn-primary:not([disabled])")?.focus()}return{open(g){u(),P(wr,Js),o=g,t=T("div",{id:Sr,class:"grabby-finish",role:"dialog","aria-modal":"false","aria-label":"Finish review"}),n=y=>{t&&y.key==="Escape"&&(y.preventDefault(),y.stopImmediatePropagation(),u())},document.addEventListener("keydown",n,!0),B().appendChild(t),d()},update(g){if(t){if(o=g,r&&g.pending===0&&(l(),g.failed===0)){m();return}d()}},close:u,isVisible:()=>!!t,isSheetElement:g=>!!t&&(g===t||t.contains(g)),dispose(){u(),O(wr)}}}var Se="__grabby-coach__",kr="coach-mark",Tr="grabby:v1:onboarded",Qs=`
|
|
630
|
+
#${Se} {
|
|
631
|
+
position: fixed; bottom: ${xe}; left: 50%; transform: translateX(-50%);
|
|
625
632
|
z-index: ${2147483647}; width: min(320px, calc(100vw - 32px)); box-sizing: border-box;
|
|
626
633
|
padding: 14px 16px; border-radius: 12px; background: #0f172a; color: #f8fafc;
|
|
627
634
|
font: 13px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
628
635
|
box-shadow: 0 12px 32px rgba(15, 23, 42, .3); animation: grabby-coach-in .2s ease;
|
|
629
636
|
}
|
|
630
|
-
#${
|
|
637
|
+
#${Se}::after {
|
|
631
638
|
content: ''; position: absolute; bottom: -6px; left: 50%; margin-left: -6px;
|
|
632
639
|
border: 6px solid transparent; border-bottom: 0; border-top-color: #0f172a;
|
|
633
640
|
}
|
|
634
641
|
@keyframes grabby-coach-in { from { opacity: 0; transform: translate(-50%, 6px); } to { opacity: 1; transform: translate(-50%, 0); } }
|
|
635
|
-
#${
|
|
636
|
-
#${
|
|
637
|
-
#${
|
|
638
|
-
#${
|
|
642
|
+
#${Se} strong { display: block; font-size: 14px; margin-bottom: 6px; }
|
|
643
|
+
#${Se} ol { margin: 0 0 10px; padding-left: 20px; }
|
|
644
|
+
#${Se} li { margin: 2px 0; }
|
|
645
|
+
#${Se} button {
|
|
639
646
|
font: 600 12px/1 inherit; font-family: inherit; padding: 7px 12px; border-radius: 7px; border: 0;
|
|
640
647
|
background: #f8fafc; color: #0f172a; cursor: pointer; float: right;
|
|
641
648
|
}
|
|
642
|
-
#${
|
|
643
|
-
`;function
|
|
644
|
-
#${
|
|
649
|
+
#${Se} .grabby-coach-foot { overflow: hidden; color: #94a3b8; font-size: 12px; line-height: 28px; }
|
|
650
|
+
`;function el(){try{return localStorage.getItem(Tr)==="1"}catch{return!1}}function tl(){try{localStorage.setItem(Tr,"1")}catch{}}function Ar(){let e=null;function t(){tl(),e?.remove(),e=null}return{maybeShow(){e||el()||(P(kr,Qs),e=T("div",{id:Se,role:"dialog","aria-label":"How to leave feedback"},T("strong",null,"Leave feedback on this page"),T("ol",null,T("li",null,"Click ",T("b",null,"Comment")," below."),T("li",null,"Click the part of the page you want to talk about."),T("li",null,"Type your note and press Enter.")),T("div",{class:"grabby-coach-foot"},"A screenshot is attached for you.",T("button",{type:"button",onclick:n=>{n.stopPropagation(),t()}},"Got it"))),B().appendChild(e))},dismiss:t,dispose(){e?.remove(),e=null,O(kr)}}}var Rn="grabby:v1:outbox",_r=[2e3,1e4,3e4,12e4,3e5,6e5],nl=336*60*60*1e3,Rr=6e4;function ol(){try{let e=localStorage.getItem(Rn),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 rl(e){let t=e.length;for(;t>0&&e[t-1]==="/";)t--;return e.slice(0,t)}function In(e){let t=rl(e.server),n=ol().map(f=>({...f,next:0})),o=null,r=!1,i=!1;function a(){try{n.length?localStorage.setItem(Rn,JSON.stringify(n)):localStorage.removeItem(Rn)}catch{}}function s(f={}){return{...e.projectKey?{"X-Grabby-Key":e.projectKey}:{},...f}}function l(f,v){n.some(b=>b.id===f&&b.kind===v)||(n.push({id:f,kind:v,attempts:0,next:0,created:Date.now()}),a(),u(0))}function u(f){i||(o&&clearTimeout(o),o=setTimeout(()=>{o=null,g()},f))}function m(f){let{screenshot:v,sync:b,pin:h,...k}=f;return k}function p(f){let v=JSON.stringify({comment:m(f)});return fetch(`${t}/v1/comments`,{method:"POST",credentials:"omit",keepalive:v.length<Rr,headers:s({"Content-Type":"application/json"}),body:v})}function x(f,v){return fetch(`${t}/v1/comments/${encodeURIComponent(f)}`,{method:"DELETE",credentials:"omit",keepalive:!0,headers:s({"X-Grabby-Session":v})})}async function d(f){if(f.kind==="delete"){let $=await x(f.id,f.session);return $.ok||$.status===404?"done":$.status===429||$.status>=500?"retry":"drop"}let v=e.getComment(f.id);if(!v)return"drop";if(f.kind==="comment"){let $=await p(v);return $.ok?(e.getComment(f.id)?.screenshot?.localId&&l(f.id,"shot"),"done"):$.status===429||$.status>=500?"retry":(e.onState(f.id,"failed",await $.text().catch(()=>String($.status))),"drop")}let b=v.screenshot?.localId,h=b?await e.getScreenshot(b):null;if(!h)return"drop";let{width:k,height:L}=v.screenshot,C=await fetch(`${t}/v1/comments/${encodeURIComponent(f.id)}/screenshot?w=${k}&h=${L}`,{method:"PUT",credentials:"omit",keepalive:h.size<Rr,headers:s({"Content-Type":h.type||"image/webp","X-Grabby-Session":v.author.sessionId}),body:h});return C.ok||C.status>=400&&C.status<500&&C.status!==429?C.ok?"done":"drop":"retry"}async function g(){if(r||i)return;r=!0;try{let v=Date.now();for(let b of[...n].sort((h,k)=>h.next-k.next)){if(b.next>v)continue;let h;try{h=await d(b)}catch{h="retry"}h==="retry"&&Date.now()-b.created<nl?(b.attempts+=1,b.next=Date.now()+_r[Math.min(b.attempts-1,_r.length-1)],b.kind==="comment"&&e.onState(b.id,"pending")):(n=n.filter(k=>k!==b),b.kind==="comment"&&h==="done"&&e.onState(b.id,"sent"),b.kind==="comment"&&h==="retry"&&e.onState(b.id,"failed","could not reach the feedback server for 14 days")),a()}}finally{r=!1}let f=n.reduce((v,b)=>Math.min(v,b.next),1/0);f!==1/0&&u(Math.max(0,f-Date.now()))}let y=()=>{for(let f of n)f.next=0;u(0)};return typeof window<"u"&&window.addEventListener("online",y),n.length&&u(500),{send:f=>l(f,"comment"),remove(f,v,b=0){n=n.filter(h=>h.id!==f),n.push({id:f,kind:"delete",session:v,attempts:0,next:Date.now()+b,created:Date.now()}),a(),u(0)},cancelRemove(f){let v=n.find(b=>b.id===f&&b.kind==="delete");return v?(n=n.filter(b=>b!==v),a(),v.attempts===0):!1},sendScreenshot:f=>{n.some(v=>v.id===f&&v.kind==="comment")||l(f,"shot")},isQueued:f=>n.some(v=>v.id===f),flush:y,flushOnExit(){for(let f of n){if(f.kind==="delete"){f.attempts+=1,x(f.id,f.session).catch(()=>{});continue}if(f.kind!=="comment")continue;let v=e.getComment(f.id);v&&p(v).catch(()=>{})}a()},dispose(){i=!0,o&&clearTimeout(o),typeof window<"u"&&window.removeEventListener("online",y)}}}var Ir="grabby",$n="grabby:v1:live";function Ln(){try{return window.sessionStorage}catch{return null}}function il(){return Ln()?.getItem($n)==="1"}function Ot(){try{Ln()?.setItem($n,"1")}catch{}}function Mn(){try{Ln()?.removeItem($n)}catch{}}function $r(e){try{let t=new URL(window.location.href),n=t.searchParams.get(Ir);n!==null&&(n&&(!e||n===e)&&Ot(),t.searchParams.delete(Ir),window.history.replaceState(window.history.state,"",t.pathname+t.search+t.hash))}catch{}return il()}var Nn="__grabby-freeze-overlay__",Pn="__grabby-freeze-styles__",Lr="__grabby-freeze-hover-styles__",Mr="__grabby-freeze-anim-styles__",On="data-grabby-hover",Nr=["mouseenter","mouseleave","mouseover","mouseout","pointerenter","pointerleave","pointerover","pointerout"],Pr=["focus","blur","focusin","focusout"];function Or(){let e=null,t=!1,n=!1,o=!1,r=[];function i(){q(Pn)||P(Pn,`
|
|
651
|
+
#${Nn} {
|
|
645
652
|
position: fixed;
|
|
646
653
|
top: 0;
|
|
647
654
|
left: 0;
|
|
@@ -651,26 +658,40 @@ ${t.join(`
|
|
|
651
658
|
pointer-events: auto;
|
|
652
659
|
background: transparent;
|
|
653
660
|
}
|
|
654
|
-
`)}function a(){return e||(i(),e=document.createElement("div"),e.id=
|
|
655
|
-
`),"document"),n=!0)}function
|
|
656
|
-
`)} }`)}}function
|
|
661
|
+
`)}function a(){return e||(i(),e=document.createElement("div"),e.id=Nn,e.style.display="none",B().appendChild(e),e)}let s=b=>{b.stopImmediatePropagation()},l=b=>{b.preventDefault(),b.stopImmediatePropagation()};function u(){for(let b of Nr)document.addEventListener(b,s,!0);for(let b of Pr)document.addEventListener(b,l,!0)}function m(){for(let b of Nr)document.removeEventListener(b,s,!0);for(let b of Pr)document.removeEventListener(b,l,!0)}function p(b){let h=b;for(;h&&h!==document.documentElement;)h.setAttribute(On,""),r.push(h),h=h.parentElement}function x(){for(let b of r)b.removeAttribute(On);r=[]}function d(){if(n)return;let b=[];for(let h of Array.from(document.styleSheets)){let k;try{k=h.cssRules}catch{continue}g(k,b)}b.length!==0&&(P(Lr,b.join(`
|
|
662
|
+
`),"document"),n=!0)}function g(b,h){for(let k of Array.from(b))if(k instanceof CSSStyleRule){if(k.selectorText.includes(":hover")){let L=k.selectorText.replace(/:hover/g,`[${On}]`);h.push(`${L} { ${k.style.cssText} }`)}}else if(k instanceof CSSMediaRule){let L=[];g(k.cssRules,L),L.length>0&&h.push(`@media ${k.conditionText} { ${L.join(`
|
|
663
|
+
`)} }`)}}function y(){O(Lr),n=!1}function f(){o||(P(Mr,`
|
|
657
664
|
*, *::before, *::after {
|
|
658
665
|
animation-play-state: paused !important;
|
|
659
666
|
transition: none !important;
|
|
660
667
|
}
|
|
661
|
-
`,"document"),o=!0)}function
|
|
662
|
-
|
|
668
|
+
`,"document"),o=!0)}function v(){O(Mr),o=!1}return{show(b){u(),b&&(p(b),d()),f();let h=a();h.style.display="block",t=!0},hide(){e&&(e.style.display="none"),t=!1,x(),y(),v(),m()},isVisible(){return t},isFreezeElement(b){return b===e||b.id===Nn},getElement(){return e},dispose(){x(),y(),v(),m(),e?.remove(),O(Pn),e=null,t=!1}}}var Dr="__grabby-markers__",Fr="__grabby-markers-doc__",al=1e3,st="__grabby-marker-tip__",Dn="__grabby-marker-styles__",lt=22,sl=250,ll=500,cl=30,Hr=140,ul={size:12,shapes:Me("M10.5 2.5l3 3L6 13H3v-3z","M9 4l3 3")};function dl(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 Br(e){let t=null,n=null,o=null,r=!1,i="",a=null,s=0,l=null,u=new Map;function m(){q(Dn)||P(Dn,`
|
|
669
|
+
/*
|
|
670
|
+
* Page coordinates: the browser moves these with the page as it
|
|
671
|
+
* scrolls, so they never trail behind their element. (A fixed layer
|
|
672
|
+
* repositioned from script lags a frame behind fast scrolling.)
|
|
673
|
+
*/
|
|
674
|
+
#${Fr} {
|
|
675
|
+
position: absolute;
|
|
676
|
+
left: 0;
|
|
677
|
+
top: 0;
|
|
678
|
+
width: 0;
|
|
679
|
+
height: 0;
|
|
680
|
+
pointer-events: none;
|
|
681
|
+
z-index: ${2147483645};
|
|
682
|
+
}
|
|
683
|
+
#${Dr} {
|
|
663
684
|
position: fixed;
|
|
664
685
|
inset: 0;
|
|
665
686
|
pointer-events: none;
|
|
666
687
|
z-index: ${2147483645};
|
|
667
688
|
}
|
|
668
|
-
|
|
689
|
+
.grabby-markers-layer .grabby-marker {
|
|
669
690
|
position: absolute;
|
|
670
691
|
left: 0;
|
|
671
692
|
top: 0;
|
|
672
|
-
width: ${
|
|
673
|
-
height: ${
|
|
693
|
+
width: ${lt}px;
|
|
694
|
+
height: ${lt}px;
|
|
674
695
|
margin: 0;
|
|
675
696
|
padding: 0;
|
|
676
697
|
border: none;
|
|
@@ -686,22 +707,24 @@ ${t.join(`
|
|
|
686
707
|
pointer-events: auto;
|
|
687
708
|
transition: transform 0.12s ease, box-shadow 0.15s ease;
|
|
688
709
|
}
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
710
|
+
.grabby-markers-layer .grabby-marker[hidden] { display: none; }
|
|
711
|
+
/* Several elements or an area: a green square, like the outline it shows. */
|
|
712
|
+
.grabby-markers-layer .grabby-marker.grabby-marker-group { border-radius: 6px; background: #16a34a; }
|
|
713
|
+
.grabby-markers-layer .grabby-marker:hover,
|
|
714
|
+
.grabby-markers-layer .grabby-marker:focus-visible {
|
|
692
715
|
z-index: 1;
|
|
693
716
|
outline: none;
|
|
694
717
|
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
718
|
}
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
719
|
+
.grabby-markers-layer .grabby-marker-edit { display: none; }
|
|
720
|
+
.grabby-markers-layer .grabby-marker:hover .grabby-marker-num,
|
|
721
|
+
.grabby-markers-layer .grabby-marker:focus-visible .grabby-marker-num { display: none; }
|
|
722
|
+
.grabby-markers-layer .grabby-marker:hover .grabby-marker-edit,
|
|
723
|
+
.grabby-markers-layer .grabby-marker:focus-visible .grabby-marker-edit { display: block; }
|
|
724
|
+
.grabby-markers-layer .grabby-marker-in {
|
|
702
725
|
animation: grabby-marker-in 0.25s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
703
726
|
}
|
|
704
|
-
|
|
727
|
+
.grabby-markers-layer .grabby-marker-out {
|
|
705
728
|
animation: grabby-marker-out 0.2s ease-out both;
|
|
706
729
|
pointer-events: none;
|
|
707
730
|
}
|
|
@@ -713,7 +736,7 @@ ${t.join(`
|
|
|
713
736
|
from { opacity: 1; scale: 1; }
|
|
714
737
|
to { opacity: 0; scale: 0.3; }
|
|
715
738
|
}
|
|
716
|
-
#${
|
|
739
|
+
#${st} {
|
|
717
740
|
position: fixed;
|
|
718
741
|
z-index: ${2147483645};
|
|
719
742
|
max-width: 260px;
|
|
@@ -728,16 +751,33 @@ ${t.join(`
|
|
|
728
751
|
overflow-wrap: anywhere;
|
|
729
752
|
animation: grabby-marker-tip-in 0.12s ease both;
|
|
730
753
|
}
|
|
731
|
-
#${
|
|
732
|
-
#${
|
|
754
|
+
#${st}[hidden] { display: none; }
|
|
755
|
+
#${st} .grabby-marker-tip-hint { display: block; margin-top: 4px; opacity: 0.6; font-size: 11px; }
|
|
733
756
|
@keyframes grabby-marker-tip-in {
|
|
734
757
|
from { opacity: 0; transform: translateY(-2px); }
|
|
735
758
|
to { opacity: 1; transform: none; }
|
|
736
759
|
}
|
|
737
760
|
@media (prefers-reduced-motion: reduce) {
|
|
738
|
-
|
|
761
|
+
.grabby-markers-layer .grabby-marker-in, .grabby-markers-layer .grabby-marker-out, #${st} { animation: none; }
|
|
739
762
|
}
|
|
740
|
-
`)}function
|
|
763
|
+
`)}function p(){return t||(m(),t=document.createElement("div"),t.id=Dr,t.className="grabby-markers-layer",n=document.createElement("div"),n.id=Fr,n.className="grabby-markers-layer",o=document.createElement("div"),o.id=st,o.hidden=!0,o.setAttribute("role","tooltip"),B().append(n,t,o),t)}function x(){return e.getComments().filter(w=>w.page.route===i).reverse()}function d(w){let E=w.trim();return E.length>Hr?`${E.slice(0,Hr-1)}\u2026`:E}function g(w){let E=document.createElement("span");E.className="grabby-marker-num";let _=document.createElement("button");_.type="button",_.className="grabby-marker",_.dataset.grabbyMarker=w.id,_.append(E,de(ul,"grabby-marker-edit"));let D={comment:w,button:_,number:E,element:null,lastLookup:0,context:"page",contextCheckedAt:-1/0};return _.addEventListener("click",K=>{K.preventDefault(),K.stopPropagation(),h(),e.onOpen(D.comment,D.element,_)}),_.addEventListener("mouseenter",()=>y(D)),_.addEventListener("focus",()=>y(D)),_.addEventListener("mouseleave",()=>f(D)),_.addEventListener("blur",()=>f(D)),D}function y(w){l=w,v(w),e.onHover(w.comment,w.element)}function f(w){l===w&&(l=null,h(),e.onHover(null,null))}function v(w){if(!o)return;let E=document.createElement("span");E.className="grabby-marker-tip-hint",E.textContent="Click to edit",o.replaceChildren(document.createTextNode(d(w.comment.comment)),E),o.hidden=!1,b(w)}function b(w){if(!o||o.hidden)return;let E=w.button.getBoundingClientRect(),_=o.getBoundingClientRect(),D=Math.max(8,Math.min(E.left+E.width/2-_.width/2,window.innerWidth-_.width-8)),K=E.bottom+8,pe=K+_.height>window.innerHeight-8?E.top-8-_.height:K;o.style.left=`${D}px`,o.style.top=`${Math.max(8,pe)}px`}function h(){o&&(o.hidden=!0)}function k(w,E){w.classList.remove("grabby-marker-out","grabby-marker-in"),w.style.animationDelay=`${E}ms`,w.offsetWidth,w.classList.add("grabby-marker-in")}function L(w,E){let _=u.get(w);if(_){if(u.delete(w),l===_&&f(_),!E){_.button.remove();return}_.button.style.animationDelay="0ms",_.button.classList.remove("grabby-marker-in"),_.button.classList.add("grabby-marker-out"),setTimeout(()=>_.button.remove(),220)}}function C(w){if(!r)return;let E=p(),_=x(),D=new Set(_.map(K=>K.id));for(let K of[...u.keys()])D.has(K)||L(K,!w);_.forEach((K,pe)=>{let Y=u.get(K.id),Ae=!Y;Y||(Y=g(K),u.set(K.id,Y),E.appendChild(Y.button)),Y.comment=K,Y.button.classList.toggle("grabby-marker-group",!!(K.members?.length||K.area));let Ze=String(pe+1);Y.number.textContent=Ze,Y.button.setAttribute("aria-label",`Comment ${Ze}: ${d(K.comment)}. Click to edit.`),(w||Ae)&&k(Y.button,w?pe*cl:0)}),l&&u.get(l.comment.id)===l&&v(l),$(performance.now()),W()}function $(w){for(let E of u.values()){E.element?.isConnected||(E.element=null,w-E.lastLookup>=ll&&(E.lastLookup=w,E.element=e.findElement(E.comment)));let _=E.element?.getBoundingClientRect();if(!_||_.width===0&&_.height===0){E.button.hidden=!0;continue}if(w-E.contextCheckedAt>=al){E.contextCheckedAt=w,E.context=dl(E.element);let Ae=E.context==="page"?n:t;Ae&&E.button.parentElement!==Ae&&Ae.appendChild(E.button)}let D=E.comment.pin??{x:1,y:0},K=(document.documentElement.clientWidth||window.innerWidth)-lt,pe=Math.max(0,Math.min(_.left+D.x*_.width-lt/2,K)),Y=_.top+D.y*_.height-lt/2;E.context==="page"&&(pe+=window.scrollX,Y=Math.max(0,Y+window.scrollY)),E.button.hidden=!1,E.button.style.transform=`translate(${Math.round(pe)}px, ${Math.round(Y)}px)`}l&&b(l)}function U(){a=null;let w=performance.now();if(r){if(w-s>=sl){s=w;let E=e.currentRoute();if(E!==i){i=E;for(let _ of[...u.keys()])L(_,!1);C(!0);return}}$(w),W()}}function W(){a===null&&r&&(a=requestAnimationFrame(U))}function A(){a!==null&&cancelAnimationFrame(a),a=null}function I(){r&&u.size&&$(performance.now())}return{setVisible(w){if(w!==r)if(r=w,w)i=e.currentRoute(),s=performance.now(),document.addEventListener("scroll",I,{capture:!0,passive:!0}),C(!0);else{document.removeEventListener("scroll",I,!0),A(),h(),l&&f(l);for(let E of[...u.keys()])L(E,!0)}},refresh(){C(!1)},isMarkerElement(w){return[t,n].some(E=>!!E&&(E===w||E.contains(w)))},dispose(){A(),document.removeEventListener("scroll",I,!0),u.clear(),t?.remove(),n?.remove(),n=null,o?.remove(),t=null,o=null,l=null,r=!1,O(Dn)}}}var je="__grabby-group__",Fn="__grabby-group-styles__",Ur="#16a34a";function Gr(){let e=null,t=null,n=null,o=[],r=null,i=null;function a(){return e||(q(Fn)||P(Fn,`
|
|
764
|
+
#${je} { position: fixed; inset: 0; pointer-events: none; z-index: ${2147483646}; }
|
|
765
|
+
#${je} .grabby-group-box {
|
|
766
|
+
position: absolute; left: 0; top: 0; box-sizing: border-box;
|
|
767
|
+
border: 2px dashed ${Ur}; border-radius: 4px; background: rgba(22, 163, 74, 0.08);
|
|
768
|
+
}
|
|
769
|
+
#${je} .grabby-group-marquee {
|
|
770
|
+
position: absolute; left: 0; top: 0; box-sizing: border-box;
|
|
771
|
+
border: 1px solid var(--grabby-accent, #2563eb); border-radius: 2px;
|
|
772
|
+
background: color-mix(in srgb, var(--grabby-accent, #2563eb) 8%, transparent);
|
|
773
|
+
}
|
|
774
|
+
#${je} .grabby-group-label {
|
|
775
|
+
position: absolute; left: 0; top: 0; padding: 2px 6px; border-radius: 3px;
|
|
776
|
+
background: ${Ur}; color: #fff; white-space: nowrap;
|
|
777
|
+
font: 600 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
|
|
778
|
+
}
|
|
779
|
+
#${je} [hidden] { display: none; }
|
|
780
|
+
`),e=document.createElement("div"),e.id=je,B().appendChild(e),e)}function s(x,d){x.style.transform=`translate(${Math.round(d.left)}px, ${Math.round(d.top)}px)`,x.style.width=`${Math.max(0,Math.round(d.right-d.left))}px`,x.style.height=`${Math.max(0,Math.round(d.bottom-d.top))}px`}function l(){return r?"area"in r?r.element.isConnected?[nt(r.element,r.area)]:[]:r.elements.flatMap(x=>{if(!x.isConnected)return[];let d=x.getBoundingClientRect();return d.width===0&&d.height===0?[]:[{left:d.left,top:d.top,right:d.right,bottom:d.bottom}]}):[]}function u(){let x=a(),d=l();for(;o.length<d.length;){let g=document.createElement("div");g.className="grabby-group-box",x.insertBefore(g,n),o.push(g)}if(o.forEach((g,y)=>{g.hidden=y>=d.length,y<d.length&&s(g,d[y])}),n&&!n.hidden){let g=r&&"elements"in r?ot(r.elements):d[0]??null;g&&(n.style.transform=`translate(${Math.round(g.left)}px, ${Math.round(Math.max(0,g.top-20))}px)`)}}function m(){i=null,r&&(u(),i=requestAnimationFrame(m))}function p(){i!==null&&cancelAnimationFrame(i),i=null}return{marquee(x){if(!x){t&&(t.hidden=!0);return}let d=a();t||(t=document.createElement("div"),t.className="grabby-group-marquee",d.appendChild(t)),t.hidden=!1,s(t,x)},show(x,d){r=x;let g=a();n||(n=document.createElement("div"),n.className="grabby-group-label",g.appendChild(n)),n.hidden=!d,n.textContent=d??"",p(),m()},hide(){r=null,p();for(let x of o)x.hidden=!0;n&&(n.hidden=!0)},isVisible(){return r!==null},dispose(){p(),e?.remove(),e=null,t=null,n=null,o=[],r=null,O(Fn)}}}var Hn="__grabby-feedback-styles__";function ml(){q(Hn)||P(Hn,`
|
|
741
781
|
@keyframes grabby-flash {
|
|
742
782
|
0% { opacity: 1; }
|
|
743
783
|
100% { opacity: 0; transform: scale(1.02); }
|
|
@@ -781,4 +821,4 @@ ${t.join(`
|
|
|
781
821
|
height: 10px;
|
|
782
822
|
flex-shrink: 0;
|
|
783
823
|
}
|
|
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;})();
|
|
824
|
+
`)}function Vr(e,t="Selected"){ml();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`,B().appendChild(o);let r=document.createElement("div");r.className="grabby-select-pill",r.append(de(zo),` ${t}`),B().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 u=()=>{o.remove(),r.remove()};r.addEventListener("animationend",u),setTimeout(u,1200)}function zr(){O(Hn)}var dt="grabby:v1:comments";var Ce=null,ct=null,ut=null,Kr=!1,fl=100;function Bn(){try{let e=localStorage.getItem(dt);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(dt)}catch{}return[]}}function Un(e){ut=e,!(Ce!=null||ct!=null)&&(Ce=requestAnimationFrame(We),ct=setTimeout(We,fl))}function We(){if(Ce!=null&&(cancelAnimationFrame(Ce),Ce=null),ct!=null&&(clearTimeout(ct),ct=null),ut==null)return;let e=ut;ut=null,pl(e)}function pl(e){let t={v:1,entries:e};try{localStorage.setItem(dt,JSON.stringify(t))}catch(n){if(bl(n)){let o=e.slice(0,Math.floor(e.length/2));try{localStorage.setItem(dt,JSON.stringify({v:1,entries:o}))}catch{jr()}}else jr()}}function bl(e){if(!e||typeof e!="object")return!1;let t=e;return t.name==="QuotaExceededError"||t.code===22}function jr(){Kr||(Kr=!0,console.warn("[grabby] saving comments to localStorage failed (quota or other error)."))}function Wr(){Ce!=null&&(cancelAnimationFrame(Ce),Ce=null),ut=null;try{localStorage.removeItem(dt)}catch{}}var ae=null,Vn=new Map;function gl(){if(ae?.isConnected&&ae.contentDocument)return ae.contentDocument;try{return ae=document.createElement("iframe"),ae.setAttribute("aria-hidden","true"),ae.setAttribute("tabindex","-1"),ae.setAttribute("data-grabby-ignore",""),Object.assign(ae.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(ae),ae.contentDocument}catch{return null}}function hl(e,t,n){let o=t?`${e}[${t}]`:e,r=Vn.get(o);r||(r=new Map,Vn.set(o,r));let i=n.filter(a=>!r.has(a));if(i.length>0){let a=gl(),s=a?.defaultView;if(a?.body&&s){let l=a.createElement(e);t&&l.setAttribute("type",t),a.body.appendChild(l);let u=s.getComputedStyle(l);for(let m of i)r.set(m,u.getPropertyValue(m));l.remove()}else for(let l of i)r.set(l,"")}return r}function Yr(){ae?.remove(),ae=null,Vn.clear()}function Gn(e){return Math.round(e).toString(16).padStart(2,"0")}function yl(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=`#${Gn(n)}${Gn(o)}${Gn(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 vl(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=>yl(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 Oe(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=hl(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]=vl(s,l))}return n}var xl={"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 De(e){return Object.entries(e).map(([t,n])=>`${xl[t]??t} ${t==="box-shadow"?"yes":n}`).join(" \xB7 ")}var El=["background-color","color","font-size","font-weight","padding","border-radius","border"],wl=["background-color","border","border-radius","padding","font-size"],Sl=["font-size","font-weight","line-height","color","font-family","text-align","letter-spacing"],Cl=["object-fit","border-radius","aspect-ratio"],kl=["display","flex-direction","gap","grid-template-columns","justify-content","align-items","padding","max-width","background-color","border-radius","box-shadow","border"],Tl=["margin","color","background-color","font-size","font-weight","line-height","display","position","z-index","opacity","overflow","box-shadow","border"];function N(e,t,n){n!=null&&n!==""&&(e[t]=n)}function qr(e){let t=e.getBoundingClientRect();return t.width||t.height?`${Math.round(t.width)}\xD7${Math.round(t.height)}`:""}function Al(e){let t=e.getAttribute("aria-labelledby");return t?t.split(/\s+/).map(n=>e.ownerDocument.getElementById(n)).filter(n=>!!n).map(n=>oe(n,60)).join(" "):""}function zn(e){return V(e.getAttribute("aria-label")??"")||Al(e)}function _l(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 Rl(e){let t={},n=e.querySelector("img[alt]")?.getAttribute("alt")??"";return N(t,"label",zn(e)||oe(e,80)||V(e.getAttribute("title")??"")||V(n)),e.tagName==="A"?N(t,"href",et(e.getAttribute("href")??"")):(e.tagName==="BUTTON"||e.tagName==="INPUT")&&N(t,"type",e.getAttribute("type")??(e.tagName==="BUTTON"?"submit":"")),N(t,"state",_l(e)),N(t,"styles",De(Oe(e,El))),t}function Il(e){let t=e.labels;return t&&t.length>0?oe(t[0],60):zn(e)||V(e.getAttribute("placeholder")??"",{keepEmails:!0})}function $l(e){let t={};N(t,"label",Il(e));let n=e.tagName==="INPUT"?e.type||"text":e.tagName.toLowerCase();N(t,"type",n),N(t,"placeholder",V(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"),N(t,"state",o.join(", ")),e.tagName==="SELECT"&&N(t,"options",String(e.options.length)),N(t,"styles",De(Oe(e,wl))),t}function Ll(e){let t={};return N(t,"text",oe(e,120)),N(t,"styles",De(Oe(e,Sl))),t}function Xr(e){let t=et(e);return t.split("/").filter(Boolean).pop()??t}function Ml(e){let t={};if(e.tagName==="IMG"){let n=e;N(t,"alt",n.hasAttribute("alt")?V(n.alt)||"(empty)":"(missing)"),N(t,"src",Xr(n.currentSrc||n.getAttribute("src")||"")),n.naturalWidth&&N(t,"natural",`${n.naturalWidth}\xD7${n.naturalHeight}`)}else e.tagName==="SVG"||e.tagName.toLowerCase()==="svg"?(N(t,"label",zn(e)||oe(e.querySelector("title")??e,40)),N(t,"viewBox",e.getAttribute("viewBox")??"")):(e.tagName==="VIDEO"||e.tagName==="AUDIO"||e.tagName==="IFRAME")&&(N(t,"src",Xr(e.getAttribute("src")??e.querySelector("source")?.getAttribute("src")??"")),N(t,"title",V(e.getAttribute("title")??"")));return N(t,"size",qr(e)),N(t,"styles",De(Oe(e,Cl))),t}function Nl(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 Zr(e,t){let n=new Map;for(let r of Array.from(e.children)){if(r.hasAttribute(ie)||/^(SCRIPT|STYLE|TEMPLATE)$/.test(r.tagName))continue;let i=Nl(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 Jr(e){let t=e.querySelector('h1, h2, h3, h4, h5, h6, [role="heading"]');return t?oe(t,60):""}function Pl(e,t){let n={};return N(n,"heading",Jr(e)),N(n,"contains",Zr(e,t)),N(n,"size",qr(e)),N(n,"layout",De(Oe(e,kl))),n}function Ol(e,t){let n={};N(n,"title",V(e.ownerDocument.title)),N(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=Jr(r);return i?`${r.tagName.toLowerCase()} "${ne(i,30)}"`:r.tagName.toLowerCase()});return N(n,"regions",o.join(", ")),N(n,"contains",Zr(e.tagName==="HTML"?e.ownerDocument.body??e:e,t)),n}function Dl(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 Fl(e,t){let n={},o=e.getBoundingClientRect();return(o.width||o.height)&&N(n,"box",`${Math.round(o.left)},${Math.round(o.top)} ${Math.round(o.width)}\xD7${Math.round(o.height)}`),N(n,"ancestors",Dl(e,5)),N(n,"computed",De(Oe(e,Tl))),t!=="section"&&t!=="field"&&!ze(e)&&N(n,"text",oe(e,240)),n}function Qr(e,t,n){let o;switch(t){case"action":o=Rl(e);break;case"field":o=$l(e);break;case"text":o=Ll(e);break;case"media":o=Ml(e);break;case"section":o=Ol(e,n);break;default:o=Pl(e,n)}return{facts:o,extra:Fl(e,t)}}var Hl=3;function Kn(e){return!!e&&!/(^|[\\/])node_modules[\\/]/.test(e)}function ei(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),Kn(s.file)&&o.length<Hl&&o.push(s)}return{component:n?.name??null,frames:o.length>0?o:r.slice(0,2)}}function ti(e,t,n){let o=t.sourceResolver?.(e);if(o&&Kn(o.filePath))return{file:o.filePath,line:o.line,column:o.column};let r=n.find(i=>Kn(i.file));return r?.file?{file:r.file,line:r.line,column:null}:null}function ni(e,t){let n=t.cleanClasses??(u=>u.filter(m=>!Ve(m))),o=$e(e),{component:r,frames:i}=ei(e,t),a=ti(e,t,i),{facts:s,extra:l}=Qr(e,o,t.componentResolver);return{kind:o,tag:e.tagName.toLowerCase(),component:r,source:a,stack:i,selector:hn(e),preview:o==="section"?`<${e.tagName.toLowerCase()}>`:on(e,n),facts:s,extra:l}}var Bl=120;function oi(e,t){let n=t.cleanClasses??(a=>a.filter(s=>!Ve(s))),o=$e(e),{component:r,frames:i}=ei(e,t);return{kind:o,tag:e.tagName.toLowerCase(),component:r,source:ti(e,t,i),selector:hn(e),preview:o==="section"?`<${e.tagName.toLowerCase()}>`:ne(on(e,n),Bl),label:Le(e)}}var ru=1200,Ui=1600,Gi=5e3;function iu(e){return e instanceof Element?e.tagName.toLowerCase()===Jt?!1:!e.hasAttribute(ie):!0}function au(e){e instanceof HTMLElement&&e.hasAttribute(Tt)&&(e.style.filter="blur(8px)")}var Jn='<!DOCTYPE html><meta charset="UTF-8"><title></title><body>',gt=null,bt;function su(){let e=window.trustedTypes;if(!e)return Jn;if(bt===void 0)try{bt=e.createPolicy("grabby",{createHTML:t=>t===Jn?t:""})}catch{bt=null}return bt?bt.createHTML(Jn):null}async function lu(){if(gt?.isConnected)return gt;let e=document.createElement("iframe");e.setAttribute("aria-hidden","true"),e.setAttribute("tabindex","-1"),e.setAttribute(ie,""),Object.assign(e.style,{position:"fixed",width:"0",height:"0",border:"0",visibility:"hidden",pointerEvents:"none"}),document.documentElement.appendChild(e);let t=su();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()}}),gt=e,e}function Vi(){gt?.remove(),gt=null}function cu(e,t){return new Promise(n=>{let o=setTimeout(()=>n(null),t);e.then(r=>{clearTimeout(o),n(r)},()=>{clearTimeout(o),n(null)})})}var uu=4e3,Gt=(e,t)=>Math.min(Math.max(e,0),t);async function Qn(e,t){if(typeof window>"u"||!e.isConnected)return null;let n=e.getBoundingClientRect();if(n.width<1||n.height<1)return null;let o=Math.min(n.width,document.documentElement.scrollWidth||n.width),r=t?{x:Gt(t.left-n.left,o),y:Gt(t.top-n.top,n.height),right:Gt(t.right-n.left,o),bottom:Gt(t.bottom-n.top,n.height)}:null;if(r&&(r.right-r.x<1||r.bottom-r.y<1||r.bottom>uu))return null;let i=o,a=r?r.bottom:Math.min(n.height,Ui),s=r?r.right-r.x:i,l=r?Math.min(r.bottom-r.y,Ui):a,u=window.devicePixelRatio||1,m=Math.min(u,ru/Math.max(s,l));return cu((async()=>{let{createContext:x,destroyContext:d,domToBlob:g,domToCanvas:y}=await Promise.resolve().then(()=>(Bi(),Hi)),f=await x(e,{width:i,height:a,scale:m,type:"image/webp",quality:.8,filter:iu,onCloneEachNode:au,style:{margin:"0"},timeout:Gi});f.sandbox=await lu();let v;try{if(r){let b=await y(f),h=document.createElement("canvas");h.width=Math.max(1,Math.round(s*m)),h.height=Math.max(1,Math.round(l*m)),h.getContext("2d")?.drawImage(b,r.x*m,r.y*m,s*m,l*m,0,0,h.width,h.height),v=await new Promise(k=>h.toBlob(k,"image/webp",.8))}else v=await g(f)}finally{f.sandbox=void 0,d(f)}return v?{blob:v,width:Math.round(s*m),height:Math.round(l*m)}:null})(),Gi+1e3)}var zi="grabby:v1:session",eo="grabby:v1:author";function ht(){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 Ki=null;function Vt(){try{let e=localStorage.getItem(zi);if(e)return e;let t=ht();return localStorage.setItem(zi,t),t}catch{return Ki??=ht(),Ki}}function zt(){try{let e=localStorage.getItem(eo);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 ji(e){try{localStorage.setItem(eo,JSON.stringify(e))}catch{}}function Wi(){try{localStorage.removeItem(eo)}catch{}}function Yi(e){return{name:e&&!e.anonymous?e.name:null,anonymous:!e||e.anonymous||!e.name,sessionId:Vt()}}function Kt(){return typeof window>"u"?null:window.ng||null}function He(e){return e.startsWith("_")?e.slice(1):e}function Xi(e){let t=Kt();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:He(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:He(s.constructor.name),hostElement:l??a.parentElement}),r=l?.parentElement??a.parentElement?.parentElement??null;r;){let u=t.getComponent(r);u&&!o.has(u)&&(o.add(u),n.push({name:He(u.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 du(){return globalThis.__GRABBY_SOURCE_MAP__??null}function qi(e){let t=du();if(!t)return{filePath:null,line:null,column:null};let n=Kt();if(!n)return{filePath:null,line:null,column:null};let o=mu(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 mu(e,t){let n=t.getComponent(e);if(n)return He(n.constructor.name);let o=e;for(;o;){let r=t.getOwningComponent(o);if(r)return He(r.constructor.name);o=o.parentElement}return null}var Zi={name:"Angular",resolveComponent:e=>{let t=Xi(e);return t.name?t:null},resolveSource:qi,cleanClasses:e=>e.filter(t=>!t.startsWith("ng-")&&!t.startsWith("_ng"))};var jt={filePath:null,line:null,column:null};function yt(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 fu=["__reactFiber$","__reactInternalInstance$"];function Yt(e){let t=Object.keys(e);for(let n of fu){let o=t.find(r=>r.startsWith(n));if(o)return e[o]??null}return null}function Wt(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 Wt(n.render,t+1);if(n.type)return Wt(n.type,t+1)}return null}function to(e,t=0){if(t>8)return null;if(e.stateNode instanceof Element)return e.stateNode;let n=e.child;for(;n;){let o=to(n,t+1);if(o)return o;n=n.sibling}return null}var pu=12,bu=new Set(["Slot","SlotClone","Presence","Primitive","Anonymous","Unknown"]);function gu(e){return bu.has(e)||e.startsWith("_")||e.includes(".")}function Ji(e){let t=Yt(e);if(!t)return{name:null,hostElement:null,stack:[]};let n=[],o=t;for(;o&&n.length<pu;){let r=Wt(o.type);r&&!gu(r)&&n[n.length-1]?.name!==r&&n.push({name:r,hostElement:to(o)}),o=o.return}return{name:n[0]?.name??null,hostElement:n[0]?.hostElement??null,stack:n}}var Qi="data-grabby-loc",ea=/^(.*?):(\d+):(\d+)(?::([A-Za-z_$][\w$.]*))?$/;function ta(e){let t=e;for(;t;){let n=t.getAttribute?.(Qi);if(n)return hu(n);t=t.parentElement}return{filePath:null,line:null,column:null}}function hu(e){let t=ea.exec(e);return t?{filePath:t[1],line:Number(t[2]),column:Number(t[3])}:{filePath:e,line:null,column:null}}function na(e){let t=e?.getAttribute?.(Qi);if(!t)return null;let n=ea.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 yu(e){return!("_debugOwner"in e)&&!("_debugSource"in e)&&!("_debugStack"in e)}function vu(e){let t=[];for(let n of e.stack){let o=na(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 oa={name:"React",resolveComponent:e=>{let t=Ji(e);if(!t.name)return null;let n=Yt(e);return n&&yu(n)?vu(t)??{name:null,hostElement:null,stack:[]}:t}};var ra=new Set(["KeepAlive","Transition","TransitionGroup","Teleport","Suspense","BaseTransition","RouterView","RouterLink"]),ia=12;function aa(e){let t=e??null;for(;t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.nextSibling;return t}function sa(e){let t=e;for(;t;){let n=t.__vueParentComponent;if(n)return n;t=t.parentElement}return null}function xu(e){let t=e.type??{};return t.__name||t.name||t.displayName||(t.__file?Te(t.__file):null)}function Eu(e){return aa(e.subTree?.el??e.vnode?.el)}function la(e){let t=e;for(;t;){let n=t.__vue__;if(n)return n;t=t.parentElement}return null}function wu(e){let t=e.$options??{};return t.name||t._componentTag||(t.__file?Te(t.__file):null)}function Su(e){let t=sa(e);if(t){let o=[];for(let i=t;i&&o.length<ia;i=i.parent){let a=xu(i);a&&!ra.has(a)&&o.push({name:a,hostElement:Eu(i)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}let n=la(e);if(n){let o=[];for(let i=n;i&&o.length<ia;i=i.$parent){let a=wu(i);a&&!ra.has(a)&&o.push({name:a,hostElement:aa(i.$el)})}let r=o[0];return r?{name:r.name,hostElement:r.hostElement,stack:o}:null}return null}function Cu(e){let n=sa(e)?.type?.__file??la(e)?.$options?.__file;return n?{filePath:yt(n),line:null,column:null}:jt}var ca={name:"Vue",resolveComponent:Su,resolveSource:Cu};var ku=12;function ua(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 Tu(e){let t=e.loc?.line;return typeof t!="number"?null:"parent"in e?t:t+1}function Au(e){let t=ua(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<ku;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:yt(i.file),line:typeof i.line=="number"?i.line:null})}return{name:o,hostElement:t.el,stack:r}}function _u(e){let t=ua(e),n=t?.meta.loc?.file;if(!t||!n)return jt;let o=t.meta.loc?.column;return{filePath:yt(n),line:Tu(t.meta),column:typeof o=="number"?o+1:null}}var da={name:"Svelte",resolveComponent:Au,resolveSource:_u,cleanClasses:e=>e.filter(t=>!/^svelte-[a-z0-9]+$/i.test(t)&&!/^s-[A-Za-z0-9_-]{8,}$/.test(t))};var ma={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 no=[Zi,oa,ca,da,ma];function fa(e=no){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=ta(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 Ru=200,ba="grabby:v1:level",oo=8e3;function Iu(){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 ga(e){return e?.mode==="live"&&!$r(e.projectKey)?$u(e):ya(e)}function $u(e){let t=null,n=[],o=a=>{t?a(t):n.push(a)},r=e.server?Lu(e):null,i={...ha(),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(),Ot(),t=ya(e);for(let a of n.splice(0))a(t);Object.assign(i,t)}};return i}function Lu(e){try{if(!localStorage.getItem("grabby:v1:outbox"))return null}catch{return null}let t=Bn();return In({server:e.server,projectKey:e.projectKey,getComment:n=>t.find(o=>o.id===n),getScreenshot:at,onState(n,o){t=t.map(r=>r.id===n?{...r,sync:o}:r),Un(t)}})}var ro="grabby:v1:collapsed";function Mu(){try{return sessionStorage.getItem(ro)==="1"}catch{return!1}}function pa(e){try{e?sessionStorage.setItem(ro,"1"):sessionStorage.removeItem(ro)}catch{}}function Nu(){try{if(typeof ngDevMode<"u"&&ngDevMode===!1)return!1}catch{}try{if(process.env.NODE_ENV==="production")return!1}catch{}return!0}function Pu(e){try{let t=localStorage.getItem(ba);if(t==="compact"||t==="standard"||t==="detailed")return t}catch{}return e}function Ou(e){try{localStorage.setItem(ba,e)}catch{}}function ha(){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 ya(e){let n={...Iu(),...e},o=n.mode==="live";if(!o&&n.devOnly&&!Nu())return ha();let r=n.identity??(o?"ask":"none"),i=null;So(n.styleNonce);let a=Eo(n);if(n.persistHistory){let c=Bn();c.length>0&&(a.state.toolbar={...a.state.toolbar,comments:c})}let s=Do({plainLabels:o}),l=Gr(),u=Ho(),m=Or(),p=rr(),x=lr(),d=Ar(),g=null,y=fa(n.adapters??no),f=y.resolveComponent,v=y.resolveSource,b=c=>y.cleanClasses(c.filter(S=>!Ve(S))),h=null,k,L=null,C=null,$=new Map,U=null,W=new Map,A=!1,I=Pu(n.detailLevel),w=Mu(),E=new Map;x.apply(a.state.toolbar.themeMode),Ue();function _(){return a.state.toolbar.comments}function D(c){a.state.toolbar={...a.state.toolbar,comments:c},Q.update(a.state),ee.refresh(c),ve.update(K())}function K(){let c=_(),S=R=>c.filter(M=>M.sync===R).length;return{total:c.length,sent:S("sent"),pending:S("pending"),failed:S("failed")}}function pe(){return ue.hasDraft()||!!g&&_().some(c=>c.sync==="pending")}function Y(c,S){let R=fr(c,S,{origin:location.host});return p.callTransformHook(R,c)}function Ae(){return r==="anonymous"?{name:null,anonymous:!0,sessionId:Vt()}:i?{name:i.name,anonymous:!1,sessionId:Vt(),...i.id?{userId:i.id}:{}}:Yi(zt())}function Ze(){return r==="ask"&&!i&&!zt()}function xa(){if(r!=="ask")return null;if(i)return i.name;let c=zt();return c?c.anonymous||!c.name?"anonymous":c.name:null}function Ea(c,S){let R=_().find(M=>M.id===c);!R||R.sync===S||(o&&S==="sent"&&re("Feedback sent. Thank you!"),o&&S==="failed"&&re("Your feedback couldn't be sent. Please try again later."),D(_().map(M=>M.id===c?{...M,sync:S}:M)))}function io(c){return{componentName:c.target.component,filePath:c.target.source?.file??null,line:c.target.source?.line??null,column:c.target.source?.column??null}}function wa(c,S,R,M={}){let{pin:F,members:z,area:se}=M,wt={componentResolver:f,sourceResolver:v,cleanClasses:b},St=Date.now(),J={id:ht(),createdAt:St,updatedAt:St,status:"open",comment:S,author:Ae(),page:{route:nn(location,a.state.options.captureQueryParams),title:document.title,viewport:[window.innerWidth,window.innerHeight]},target:ni(c,wt),screenshot:null,framework:y.frameworkFor(c),...g?{sync:"pending"}:{},...F?{pin:F}:{},...z?.length?{members:z.map(Ct=>oi(Ct,wt))}:{},...se?{area:se}:{}};W.set(J.id,c),z?.length&&$.set(J.id,z),D([J,..._()].slice(0,Ru)),p.callHook("onComment",J,c),g?.send(J.id),R&&Sa(J.id,R);let G=_().length;if(o)return re("Thanks! Sending your feedback\u2026"),J;let Qe={label:G===1?"Copy":`Copy all ${G}`,onClick:so,primary:!0};return a.state.options.copyOnComment?ao(Y([J],I)).then(Ct=>{re(Ct?"Comment saved and copied":"Comment saved (clipboard blocked)",{detail:io(J),actions:G>1?[Qe]:[]})}):re(G===1?"Comment saved":`Comment saved \xB7 ${G} total`,{detail:io(J),actions:[Qe]}),J}async function Sa(c,S){let R=await S;if(!R)return;await pr(c,R.blob);let M=_().find(z=>z.id===c);if(!M){kn([c]);return}let F={...M,screenshot:{localId:c,width:R.width,height:R.height}};D(_().map(z=>z.id===c?F:z)),p.callHook("onScreenshot",F,R.blob),g?.sendScreenshot(c)}function _e(c,S,R=!1){if(c.length===0)return;let M=new Set(c),F=_(),z=F.filter(G=>M.has(G.id));for(let G of c)W.delete(G),$.delete(G);D(F.filter(G=>!M.has(G.id)));let se=R&&g?z.filter(G=>G.sync!==void 0):[],wt=new Set(se.filter(G=>g.isQueued(G.id)).map(G=>G.id));for(let G of se)g.remove(G.id,G.author.sessionId,S?oo+500:0);let St=z.flatMap(G=>G.screenshot?.localId?[G.screenshot.localId]:[]),J=ht();E.set(J,setTimeout(()=>{E.delete(J),kn(St)},oo+500)),S&&re(S,{duration:oo,actions:[{label:"Undo",onClick:()=>{clearTimeout(E.get(J)),E.delete(J);let G=new Set(_().map(X=>X.id)),Qe=new Set(se.filter(X=>!G.has(X.id)&&(!g.cancelRemove(X.id)||X.sync!=="sent"||wt.has(X.id))).map(X=>X.id)),_a=[...z.filter(X=>!G.has(X.id)).map(X=>Qe.has(X.id)?{...X,sync:"pending"}:X),..._()].sort((X,Ra)=>Ra.createdAt-X.createdAt);D(_a);for(let X of Qe)g?.send(X);re(`Restored ${z.length} comment${z.length===1?"":"s"}`)}}]})}async function ao(c){try{return await navigator.clipboard.writeText(c),!0}catch(S){return p.callHook("onCopyError",S instanceof Error?S:new Error(String(S))),!1}}function so(){let c=_();if(c.length===0){re("No comments to copy yet");return}ce(),Be.open({count:c.length,level:I,render:S=>Y(c,S)})}function lo(c){return Co(c)||m.isFreezeElement(c)}function co(){ue.hide(),vt(),be.isHolding()&&(Xt(),be.release())}function Xt(){h=null,k=void 0,L=null,C=null,U=null}function vt(){A&&(A=!1,s.hide(),l.hide())}function uo(c,S){let R=c.getBoundingClientRect(),M=(F,z,se)=>se>0?Math.min(1,Math.max(0,(F-z)/se)):.5;return{x:Math.round(M(S.x,R.left,R.width)*1e3)/1e3,y:Math.round(M(S.y,R.top,R.height)*1e3)/1e3}}function mo(c,S){if(c.area&&S)return{spec:{element:S,area:c.area},label:"Area"};if(!c.members?.length)return null;let R=$.get(c.id)?.filter(F=>F.isConnected),M=R?.length?R:c.members.flatMap(F=>Ne(F.selector)??[]);return M.length?{spec:{elements:M},label:`${c.members.length} elements`}:null}function fo(c,S,R,M,F,z){h=c,k=uo(c,S),U=a.state.options.screenshots?Qn(c,z??void 0):null,d.dismiss(),be.hold(c,{spec:R,label:F}),ue.show({anchor:c,anchorBox:z,mode:"new",askIdentity:Ze(),heading:M,placeholder:"What should change here?"})}function ce(){ee.hide(),co(),Be.close(),ve.close()}function Ca(){if(ve.isVisible()){ve.close();return}ce(),te(!0),ve.open(K())}function ka(){ce(),d.dismiss(),te(!0),a.state.toolbar={...a.state.toolbar,visible:!1},Q.hide(),o&&Mn()}let be=er({overlay:s,crosshair:u,groupOutline:l,getComponentResolver:()=>f,getSourceResolver:()=>v,isToolbarElement:lo,getFreezeElement:()=>m.getElement(),onHover(c){a.state.hoveredElement=c,c&&p.callHook("onElementHover",c)},onSelect(c,S){h=c,k=uo(c,S),U=a.state.options.screenshots?Qn(c):null,p.callHook("onElementSelect",c),d.dismiss(),Vr(c),be.hold(c),ue.show({anchor:c,mode:"new",askIdentity:Ze()})},onSelectGroup(c,S){L=c;let R=an(c.map(Le));for(let M of c)p.callHook("onElementSelect",M);fo(qo(c),S,{elements:c},R,`${c.length} elements`,ot(c))},onSelectArea(c,S,R){C=S,p.callHook("onElementSelect",c),fo(c,R,{element:c,area:S},sn(Le(c)),"Area",nt(c,S))}}),qt=Br({getComments:_,currentRoute:()=>nn(location,a.state.options.captureQueryParams),findElement(c){let S=W.get(c.id);return S?.isConnected?S:Ne(c.target.selector)},onHover(c,S){if(be.isHolding()||A||ue.isVisible())return;let R=c?mo(c,S):null;R?l.show(R.spec,R.label):c&&S?s.show(S,c.target.component,null,[]):(s.hide(),l.hide())},onOpen(c,S,R){if(be.isHolding())return;ce(),te(!0),A=!0;let M=mo(c,S);M?l.show(M.spec,M.label):S&&s.show(S,c.target.component,null,[]);let F=M?.spec;ue.show({anchor:S??R,anchorBox:F?"area"in F?nt(F.element,F.area):ot(F.elements):null,initialValue:c.comment,mode:"edit",entryId:c.id,heading:c.members?.length||c.area?At(c):void 0})}});function Je(){qt.setVisible(a.state.toolbar.visible&&!w&&a.state.options.enabled)}function xt(){a.state.options.enabled&&(a.state.active||(a.state.toolbar.visible===!1&&a.state.options.showToolbar&&(a.state.toolbar={...a.state.toolbar,visible:!0},Q.show()),w&&po(),ce(),a.state.active=!0,be.activate(),p.callHook("onActivate"),Q.update(a.state)))}function te(c=!1){a.state.active&&(!c&&a.state.frozen||(a.state.active=!1,a.state.frozen=!1,m.hide(),be.deactivate(),p.callHook("onDeactivate"),Q.update(a.state)))}function Ta(){a.state.frozen=!a.state.frozen,a.state.frozen?m.show(a.state.hoveredElement):m.hide(),Q.update(a.state)}let Q=cr({onSelectionMode(){a.state.active?te(!0):xt()},onHistory(){co(),Be.close(),ee.isVisible()?ee.hide():ee.show([..._()])},onEnableToggle(){ce();let c=!a.state.options.enabled;a.state.options={...a.state.options,enabled:c},c||te(!0),Q.update(a.state)},onDismiss:Aa,onExpand:po,onFinish:Ca},o?{label:"Comment",dismissLabel:"Hide toolbar",expandLabel:"Leave feedback",hideEnable:!0,review:!!n.server}:{dismissLabel:"Hide toolbar",expandLabel:"Open Grabby toolbar"});function Aa(){ce(),d.dismiss(),te(!0),w=!0,Q.collapse(),pa(!0),Ue(),Je()}function po(){w=!1,Q.expand(),pa(!1),Ue(),Je()}let ee=gr({onHover(c){let S=c?Ne(c.target.selector):null;S&&c?s.show(S,c.target.component,null,[]):s.hide()},onEdit(c,S){s.hide();let R=Ne(c.target.selector);ee.hide(),ue.show({anchor:R??S,initialValue:c.comment,mode:"edit",entryId:c.id})},onDelete(c){s.hide(),_e([c.id],"Comment deleted",!0)},onCopyAll(){s.hide(),so()},onClearAll(){s.hide();let c=_().length;_e(_().map(S=>S.id),`Cleared ${c} comment${c===1?"":"s"}`,!0),ee.hide()},onChangeIdentity(){Wi(),ee.refresh(_()),re("We'll ask for your name on your next comment")}},{variant:o?"live":"local",showSync:!!n.server,identityLabel:xa}),Be=Er({async onCopy(c,S){let R=_();if(!await ao(c))return!1;p.callHook("onCopySuccess",c,R);let F=`${R.length} comment${R.length===1?"":"s"}`;return S==="clear"?_e(R.map(z=>z.id),`Copied and cleared ${F}`):re(`Copied ${F}`),!0},onLevelChange(c){I=c,Ou(c)}}),ve=Cr({onDone(){let c=_().filter(R=>R.sync==="sent"&&!g?.isQueued(R.id)).map(R=>R.id);if(!_().length){ka();return}_e(c,null);let S=_().length;re(S?`Thanks for your review! ${S} comment${S===1?" is":"s are"} still sending.`:"Thanks for your review! Your feedback was sent.")},onRetry(){let c=_().filter(S=>S.sync==="failed");if(c.length){let S=new Set(c.map(R=>R.id));D(_().map(R=>S.has(R.id)?{...R,sync:"pending"}:R));for(let R of S)g?.send(R)}g?.flush()}}),ue=hr({onSubmit(c,S,R){if(R&&ji({name:R.name,anonymous:!R.name}),S.mode==="new"){let F=h,z={pin:k,members:L,area:C},se=U;Xt(),F&&wa(F,c,se,z),te(!0);return}if(!S.entryId)return;let M=_().map(F=>F.id===S.entryId?{...F,comment:c,updatedAt:Date.now(),...g?{sync:"pending"}:{}}:F);D(M),g?.send(S.entryId),re("Comment updated"),A?vt():ee.show([...M])},onCancel(c){if(c.mode==="new"){Xt(),te(!0);return}A?vt():ee.show([..._()])},onDelete(c){vt(),c.entryId&&_e([c.entryId],"Comment deleted",!0)}});function bo(c){let S=ye(c);S&&(lo(S)||(ee.isVisible()||ue.isVisible()||Be.isVisible()||ve.isVisible())&&ce())}document.addEventListener("click",bo);function go(){We(),g?.flushOnExit()}function ho(){document.visibilityState==="hidden"&&We()}window.addEventListener("pagehide",go),document.addEventListener("visibilitychange",ho);function yo(c){!o||!pe()||(c.preventDefault(),c.returnValue="")}window.addEventListener("beforeunload",yo);function Ue(){a.state.toolbar.visible&&!w?document.documentElement.style.setProperty("--grabby-toast-bottom",wo):document.documentElement.style.removeProperty("--grabby-toast-bottom")}function vo(c){c.key.toLowerCase()!=="f"||c.metaKey||c.ctrlKey||c.altKey||Ie(ye(c))||a.state.active&&(c.preventDefault(),Ta())}document.addEventListener("keydown",vo,!0);function xo(c){if(c.key==="Escape"&&!Ie(ye(c))&&!(ue.isVisible()||Be.isVisible()||ve.isVisible())){if(ee.isVisible()){ee.hide(),c.preventDefault();return}a.state.active&&(c.preventDefault(),te(!0))}}document.addEventListener("keydown",xo,!0);let Et=or({getActivationKey:()=>a.state.options.activationKey,getActivationMode:()=>a.state.options.activationMode,getKeyHoldDuration:()=>a.state.options.keyHoldDuration,getEnableInInputs:()=>a.state.options.enableInInputs,onActivate:xt,onDeactivate:()=>te(),isActive:()=>a.state.active}),Ge={activate:xt,deactivate:()=>te(!0),toggle(){a.state.active?te(!0):xt()},isActive(){return a.state.active},setOptions(c){a.state.options={...a.state.options,...c}},registerPlugin(c){c.options&&(a.state.options={...a.state.options,...c.options}),c.theme&&x.applyOverrides(c.theme),p.register(c,Ge)},unregisterPlugin(c){p.unregister(c)},setComponentResolver(c){f=c},setSourceResolver(c){v=c},showToolbar(){a.state.toolbar={...a.state.toolbar,visible:!0},Q.show(),Q.update(a.state),Ue()},hideToolbar(){ce(),a.state.toolbar={...a.state.toolbar,visible:!1},Q.hide(),Ue()},setThemeMode(c){a.state.toolbar={...a.state.toolbar,themeMode:c},x.apply(c),Q.update(a.state)},getComments(){return[..._()]},exportComments(c={}){let S=c.ids?new Set(c.ids):null,R=S?_().filter(M=>S.has(M.id)):_();return Y(R,c.level??I)},deleteComment(c){_e([c],null,!0)},clearComments(){_e(_().map(c=>c.id),null)},identify(c){i=c&&c.name?{id:c.id,name:c.name.slice(0,80)}:null,ee.refresh(_())},show(){o&&Ot(),Ge.showToolbar()},hide(){o&&Mn(),Ge.hideToolbar()},dispose(){We(),te(!0),document.removeEventListener("click",bo),window.removeEventListener("pagehide",go),window.removeEventListener("beforeunload",yo),document.removeEventListener("visibilitychange",ho),document.removeEventListener("keydown",vo,!0),document.removeEventListener("keydown",xo,!0),Et.dispose(),be.dispose(),s.dispose(),u.dispose(),m.dispose(),qt.dispose(),l.dispose(),Ko(),zr(),p.dispose(),ce(),Q.dispose(),ee.dispose(),ue.dispose(),Be.dispose(),ve.dispose(),d.dispose(),g?.dispose(),x.dispose(),Yr(),Vi(),document.documentElement.style.removeProperty("--grabby-toast-bottom"),ko()}};return a.state.options.enabled&&Et.start(),a.state.toolbar={...a.state.toolbar,visible:!1},w&&Q.collapse(),o&&n.showToolbar&&(Ge.showToolbar(),w||d.maybeShow()),a.subscribe((c,S)=>{S==="options"&&(c.options.enabled?Et.start():(Et.stop(),te(!0))),S==="options"&&Je(),S==="toolbar"&&(Ue(),Je(),qt.refresh(),c.options.persistHistory&&(c.toolbar.comments.length>0?Un(c.toolbar.comments):Wr()))}),n.server&&(g=In({server:n.server,projectKey:n.projectKey,getComment:c=>_().find(S=>S.id===c),getScreenshot:at,onState:(c,S)=>Ea(c,S)})),n.webhookUrl&&Ge.registerPlugin(ir(n.webhookUrl)),Je(),Ge}function Du(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 va=ga(Du(document.currentScript));window.grabby=va;var qf=va;})();
|