@fixback/sdk 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/boot.d.ts +17 -3
- package/dist/breadcrumbs.d.ts +315 -32
- package/dist/dom.d.ts +7 -0
- package/dist/fixback.umd.js +19 -5
- package/dist/fixback.umd.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +2396 -1154
- package/dist/index.mjs.map +1 -1
- package/dist/init.d.ts +42 -8
- package/dist/screenshot.d.ts +37 -18
- package/dist/scrub.d.ts +5 -4
- package/dist/version.d.ts +10 -4
- package/package.json +4 -1
package/dist/fixback.umd.js
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
(function(j,J){typeof exports=="object"&&typeof module!="undefined"?J(exports):typeof define=="function"&&define.amd?define(["exports"],J):(j=typeof globalThis!="undefined"?globalThis:j||self,J(j.Fixback={}))})(this,function(j){Object.defineProperty(j,Symbol.toStringTag,{value:"Module"});function J(e){return`${e.replace(/\/+$/,"")}/api/ingest/boot`}function Et(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.originAllowed=="boolean"&&typeof t.canSubmit=="boolean"&&typeof t.gate=="string"&&(t.tier===null||typeof t.tier=="string")}async function _t(e,t,n=fetch){let o;try{o=await n(J(e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}catch{return null}if(!o.ok)return null;let i;try{i=await o.json()}catch{return null}return Et(i)?i:null}var Me=["data-fixback-root","data-fixback-overlay"],St=Me.map(e=>`[${e}]`).join(",");function he(e){let t=e instanceof Node?e:null;for(;t;){if(t instanceof Element){for(const o of Me)if(t.hasAttribute(o))return!0}const n=t.getRootNode();if(n instanceof ShadowRoot&&n!==t){t=n.host;continue}t=t.parentNode}return!1}function Tt(e){for(const t of Array.from(e.querySelectorAll(St)))t.remove()}function Ae(e){const t=globalThis.CSS;return t!=null&&t.escape?t.escape(e):e.replace(/[^\w-]/g,n=>`\\${n}`)}function Ct(e){let t=1,n=e.previousElementSibling;for(;n;)n.tagName===e.tagName&&(t+=1),n=n.previousElementSibling;return t}function Ie(e){if(e.id)return`#${Ae(e.id)}`;const t=[];let n=e;for(;n&&n.tagName.toLowerCase()!=="html";){if(n.id){t.unshift(`#${Ae(n.id)}`);break}const o=n.tagName.toLowerCase(),i=n.parentElement;if(i){const r=Array.from(i.children).filter(s=>s.tagName===n.tagName);t.unshift(r.length>1?`${o}:nth-of-type(${Ct(n)})`:o)}else t.unshift(o);n=i}return t.join(" > ")}function Lt(e){const t=e.tagName.toLowerCase();if(e.id)return`${t}#${e.id}`;const n=e.classList[0];return n?`${t}.${n}`:t}function Mt(e){const t=[];let n=e;for(;n;)t.unshift(Lt(n)),n=n.parentElement;return t.join(" > ")}function At(e){const t=e.getBoundingClientRect();return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function It(e){return{selector:Ie(e),domPath:Mt(e),tag:e.tagName.toLowerCase(),rect:At(e)}}function Rt(e){var t,n;const o=(t=e.doc)!==null&&t!==void 0?t:document,i=(n=e.ignore)!==null&&n!==void 0?n:he;let r=null,s=!1;function f(b){var u;const m=(u=(typeof b.composedPath=="function"?b.composedPath():[])[0])!==null&&u!==void 0?u:b.target;return m instanceof Element?i(m)?null:m:null}function l(b){var u;s||(r=f(b),(u=e.onHover)===null||u===void 0||u.call(e,r))}function d(b){var u;if(s)return;const m=(u=f(b))!==null&&u!==void 0?u:r;m&&(b.preventDefault(),b.stopPropagation(),a(),e.onPick(m))}function h(b){if(!s&&b.key==="Escape"){var u;b.preventDefault(),a(),(u=e.onCancel)===null||u===void 0||u.call(e)}}function a(){s||(s=!0,o.removeEventListener("mouseover",l,!0),o.removeEventListener("click",d,!0),o.removeEventListener("keydown",h,!0),r=null)}return o.addEventListener("mouseover",l,!0),o.addEventListener("click",d,!0),o.addEventListener("keydown",h,!0),{stop:a}}var $t=7,Nt=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi,Pt=new RegExp(`\\d{${$t},}`,"g"),Ut=/\b(bearer|token)\s+[\w.\-~+/]+=*/gi,Bt=/\bhttps?:\/\/[^\s"'<>]+/gi;function Ot(e){return typeof e!="string"||e.length===0?e:e.replace(Nt,"[redacted-email]").replace(Ut,(t,n)=>`${n} [redacted]`).replace(Pt,"[redacted-number]")}function H(e){if(typeof e!="string"||e.length===0)return e;let t=e;return t=t.replace(/(^[a-z][a-z0-9+.-]*:\/\/)[^/@?#]*@/i,"$1"),t=t.replace(/\?[^#]*/,""),t=t.replace(/#.*$/,n=>n.includes("=")?"":n),t}function zt(e){const t={...e};return typeof t.url=="string"&&(t.url=H(t.url)),typeof t.from=="string"&&(t.from=H(t.from)),typeof t.to=="string"&&(t.to=H(t.to)),t}function Dt(e){return Ot(e.replace(Bt,t=>H(t)))}function jt(e){const t={...e};return typeof t.message=="string"&&(t.message=Dt(t.message)),t.data&&(t.data=zt(t.data)),t}function Ft(e){const t={...e};return typeof t.url=="string"&&(t.url=H(t.url)),t.trace&&t.trace.length>0&&(t.trace=t.trace.map(jt)),t}function Re(e,t={}){const n=t.scrub===!1?e:Ft(e),o=t.hook;if(!o)return n;try{const i=o(n);return i!=null?i:null}catch{return n}}var Ko=30,Ht=["warn","error","assert"];function Vt(e){return typeof e!="number"||!Number.isFinite(e)||e<1?30:Math.floor(e)}function Xt(e={}){var t;const n=Vt(e.maxBreadcrumbs),o=e.maxAgeMs,i=e.beforeBreadcrumb,r=(t=e.now)!==null&&t!==void 0?t:Date.now;let s=[];function f(){if(typeof o=="number"&&o>0&&s.length>0){const l=r()-o;s=s.filter(d=>d.timestamp>=l)}}return{add(l){let d=l;if(i)try{d=i(l)}catch{d=l}d&&(s.push(d),f(),s.length>n&&(s=s.slice(-n)))},snapshot(){return f(),s.slice()},clear(){s=[]}}}var $e=300;function Ne(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);try{var t;return(t=JSON.stringify(e))!==null&&t!==void 0?t:String(e)}catch{return"[object]"}}function Gt(e){const t=e.map(Ne).join(" ");return t.length>$e?`${t.slice(0,$e)}…`:t}function Pe(e,t,n){return{category:"console",level:e,message:Gt(t),timestamp:n}}function Yt(e,t,n){const o=H(e),i=H(t);return{category:"navigation",message:`${o} → ${i}`,timestamp:n,data:{from:o,to:i}}}function Ue(e,t,n,o,i){const r=H(n),s=o?{method:t,url:r,status:o}:{method:t,url:r};return{category:e,message:`${t} ${r}${o?` [${o}]`:""}`,timestamp:i,data:s}}function Be(e,t,n,o){return Ue("fetch",e,t,n,o)}function Kt(e,t,n,o){return Ue("xhr",e,t,n,o)}function Oe(e){try{return Ie(e)}catch{return e.tagName?e.tagName.toLowerCase():"unknown"}}function qt(e,t){const n=Oe(e);return{category:"ui.click",message:`click ${n}`,timestamp:t,data:{target:n}}}function Wt(e,t){const n=Oe(e);return{category:"ui.input",message:`input ${n}`,timestamp:t,data:{target:n}}}function Zt(e){return e instanceof Error?{name:e.name||"Error",message:e.message}:typeof e=="string"?{name:"Error",message:e}:{name:"Error",message:Ne(e)}}function Jt(e,t){const{name:n,message:o}=Zt(e);return{category:"error",level:"error",message:o?`${n}: ${o}`:n,timestamp:t,data:{errorType:n}}}function ve(){}function Qt(e,t,n,o){const i=[];for(const r of n){const s=t[r];if(typeof s!="function")continue;const f=(...l)=>{try{r==="assert"?l[0]||e.add(Pe("assert",l.slice(1),o())):e.add(Pe(r,l,o()))}catch{}return s.apply(t,l)};t[r]=f,i.push(()=>{t[r]=s})}return()=>{for(const r of i)r()}}function en(e){return typeof e=="string"?e:e instanceof URL?e.toString():e.url}function tn(e,t){var n,o;return((n=(o=t==null?void 0:t.method)!==null&&o!==void 0?o:typeof e=="object"&&"method"in e?e.method:void 0)!==null&&n!==void 0?n:"GET").toUpperCase()}function nn(e,t,n,o){const i=t.fetch;if(typeof i!="function")return ve;const r=(s,f)=>{const l=en(s),d=tn(s,f),h=i.call(t,s,f);return n(l)?h:h.then(a=>{try{e.add(Be(d,l,a.status,o()))}catch{}return a},a=>{try{e.add(Be(d,l,void 0,o()))}catch{}throw a})};return t.fetch=r,()=>{t.fetch=i}}function on(e,t,n,o){const i=t.XMLHttpRequest;if(typeof i!="function")return ve;const r=i.prototype,s=r.open,f=r.send;return r.open=function(l,d,...h){return this.__fixbackMeta={method:String(l).toUpperCase(),url:String(d)},s.call(this,l,d,...h)},r.send=function(l){const d=this.__fixbackMeta;if(d&&!n(d.url)){const h=()=>{try{e.add(Kt(d.method,d.url,this.status||void 0,o()))}catch{}this.removeEventListener("loadend",h)};this.addEventListener("loadend",h)}return f.call(this,l)},()=>{r.open=s,r.send=f}}function rn(e,t,n){const o=t.history,i=t.location;if(!o||!i)return ve;let r=i.href;const s=a=>{try{e.add(Yt(r,a,n()))}catch{}r=a},f=o.pushState,l=o.replaceState;o.pushState=function(a,b,u){const m=f.call(this,a,b,u);return s(i.href),m},o.replaceState=function(a,b,u){const m=l.call(this,a,b,u);return s(i.href),m};const d=()=>s(i.href),h=()=>s(i.href);return t.addEventListener("popstate",d),t.addEventListener("hashchange",h),()=>{o.pushState=f,o.replaceState=l,t.removeEventListener("popstate",d),t.removeEventListener("hashchange",h)}}function ze(e){var t;const n=(t=(typeof e.composedPath=="function"?e.composedPath():[])[0])!==null&&t!==void 0?t:e.target;return n instanceof Element?n:null}function an(e,t,n){const o=r=>{const s=ze(r);if(!(!s||he(s)))try{e.add(qt(s,n()))}catch{}},i=r=>{const s=ze(r);if(!(!s||he(s)))try{e.add(Wt(s,n()))}catch{}};return t.addEventListener("click",o,!0),t.addEventListener("input",i,!0),()=>{t.removeEventListener("click",o,!0),t.removeEventListener("input",i,!0)}}function sn(e,t={}){var n,o,i,r,s,f;const l=(n=t.win)!==null&&n!==void 0?n:globalThis,d=(o=t.doc)!==null&&o!==void 0?o:typeof document!="undefined"?document:void 0,h=(i=t.consoleObj)!==null&&i!==void 0?i:typeof console!="undefined"?console:void 0,a=(r=t.consoleLevels)!==null&&r!==void 0?r:Ht,b=(s=t.ignoreUrl)!==null&&s!==void 0?s:(()=>!1),u=(f=t.now)!==null&&f!==void 0?f:Date.now,m=[];return h&&m.push(Qt(e,h,a,u)),l&&(m.push(nn(e,l,b,u)),m.push(on(e,l,b,u)),m.push(rn(e,l,u))),d&&m.push(an(e,d,u)),()=>{for(const p of m)try{p()}catch{}}}var ln="#e5484d";function De(e,t,n,o){return{x:Math.round(Math.min(e,n)),y:Math.round(Math.min(t,o)),width:Math.round(Math.abs(n-e)),height:Math.round(Math.abs(o-t))}}function cn(e,t,n,o,i=14){const r=Math.atan2(o-t,n-e);return[{x:n,y:o},{x:n-i*Math.cos(r-Math.PI/6),y:o-i*Math.sin(r-Math.PI/6)},{x:n-i*Math.cos(r+Math.PI/6),y:o-i*Math.sin(r+Math.PI/6)}]}function dn(e){const t={};return e.element&&(t.element=e.element),e.region&&(t.region=e.region),e.marks&&e.marks.length>0&&(t.marks=e.marks.slice()),Object.keys(t).length>0?t:void 0}function je(e,t){var n;const o={},i=e.innerWidth;typeof i=="number"&&i>0&&(o.viewportWidth=Math.round(i));const r=e.innerHeight;typeof r=="number"&&r>0&&(o.viewportHeight=Math.round(r));const s=(n=e.navigator)===null||n===void 0?void 0:n.userAgent;return typeof s=="string"&&s.length>0&&(o.browser=s),t.length>0&&(o.sdkVersion=t),o}function Fe(e){var t;const n={};e.kind&&(n.kind=e.kind);const o=(t=e.comment)===null||t===void 0?void 0:t.trim();o&&(n.comment=o),e.url&&(n.url=e.url),e.environment&&Object.keys(e.environment).length>0&&(n.environment=e.environment);const i=dn({element:e.element,region:e.region,marks:e.marks});return i&&(n.annotation=i),e.trace&&e.trace.length>0&&(n.trace=e.trace),n}var qo="•",un=32,fn=new Set(["button","submit","reset","checkbox","radio","range","color","file","image","hidden"]);function me(e){const t=Math.min(Math.max(e,1),un);return"•".repeat(t)}function bn(e){for(const o of Array.from(e.querySelectorAll("input"))){var t;const i=((t=o.getAttribute("type"))!==null&&t!==void 0?t:"text").toLowerCase();if(fn.has(i))continue;const r=o.value;if(!r)continue;const s=me(r.length);o.value=s,o.setAttribute("value",s)}for(const o of Array.from(e.querySelectorAll("textarea"))){const i=o.value||o.textContent||"";if(!i)continue;const r=me(i.length);o.value=r,o.textContent=r}for(const o of Array.from(e.querySelectorAll("[contenteditable]"))){var n;if(o.getAttribute("contenteditable")==="false")continue;const i=(n=o.textContent)!==null&&n!==void 0?n:"";i.trim()&&(o.textContent=me(i.length))}}var pn={"image/png":"png","image/jpeg":"jpg","image/webp":"webp","image/gif":"gif"};function He(e){var t;return(t=pn[e])!==null&&t!==void 0?t:"png"}function Ve(e,t,n){const o=e==null?void 0:e[`inner${n}`],i=t.documentElement[`client${n}`];return Math.max(1,Math.round((typeof o=="number"&&o>0?o:i)||0)||1)}function hn(e,t,n){return`<svg xmlns="http://www.w3.org/2000/svg" width="${t}" height="${n}"><foreignObject x="0" y="0" width="100%" height="100%"><div xmlns="http://www.w3.org/1999/xhtml">${new XMLSerializer().serializeToString(e)}</div></foreignObject></svg>`}var vn=4e3,mn=(e,{width:t,height:n,type:o})=>new Promise(i=>{let r=!1;const s=f=>{r||(r=!0,i(f))};try{const f=new Image,l=setTimeout(()=>s(null),vn);f.onload=()=>{try{const d=document.createElement("canvas");d.width=t,d.height=n;const h=d.getContext("2d");if(!h){clearTimeout(l),s(null);return}h.drawImage(f,0,0),d.toBlob(a=>{clearTimeout(l),s(a)},o)}catch{clearTimeout(l),s(null)}},f.onerror=()=>{clearTimeout(l),s(null)},f.src=`data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`}catch{s(null)}});async function Xe(e={}){try{var t,n,o,i,r,s;const f=(t=e.doc)!==null&&t!==void 0?t:document,l=(n=(o=e.win)!==null&&o!==void 0?o:f.defaultView)!==null&&n!==void 0?n:void 0,d=(i=e.target)!==null&&i!==void 0?i:f.documentElement,h=(r=e.type)!==null&&r!==void 0?r:"image/png",a=Ve(l,f,"Width"),b=Ve(l,f,"Height"),u=d.cloneNode(!0);Tt(u),bn(u);const m=hn(u,a,b),p=await((s=e.rasterize)!==null&&s!==void 0?s:mn)(m,{width:a,height:b,type:h});return p?{blob:p,width:a,height:b,type:h}:null}catch{return null}}function Q(e){"@babel/helpers - typeof";return Q=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Q(e)}function gn(e,t){if(Q(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var o=n.call(e,t||"default");if(Q(o)!="object")return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function xn(e){var t=gn(e,"string");return Q(t)=="symbol"?t:t+""}function Y(e,t,n){return(t=xn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Wo=60;function yn(e,t){if(e==null)return 60;const n=e.trim();if(n==="")return 60;if(/^\d+$/.test(n))return Number(n);const o=Date.parse(n);return Number.isNaN(o)?60:Math.max(0,Math.ceil((o-t)/1e3))}var wn=class{constructor(e=Date.now){Y(this,"now",void 0),Y(this,"pausedUntil",0),this.now=e}isPaused(){return this.now()<this.pausedUntil}retryAfterSeconds(){return Math.max(0,Math.ceil((this.pausedUntil-this.now())/1e3))}hold(e){const t=this.now(),n=yn(e,t),o=t+n*1e3;return o>this.pausedUntil&&(this.pausedUntil=o),n}},kn="screenshot",En=new wn;function _n(e){return`${e.replace(/\/+$/,"")}/api/ingest/feedback`}function Sn(e){if(!e)return{};const t={};return e.signedIdentity&&(t.signedIdentity=e.signedIdentity),e.reporterId&&(t.reporterId=e.reporterId),e.anonymousId&&(t.anonymousId=e.anonymousId),t}async function Ge(e,t,n=fetch,o=En){var i,r;const s=(i=t.content.source)!==null&&i!==void 0?i:"reporter",f=s==="auto";if(f&&o.isPaused())return{ok:!1,reason:"backpressure",retryAfterSeconds:o.retryAfterSeconds()};const l={key:t.key,...Sn(t.identity),...t.content,source:s},d=new FormData;if(d.append("payload",JSON.stringify(l)),!((r=t.screenshot)===null||r===void 0)&&r.blob){var h;d.append(kn,t.screenshot.blob,(h=t.screenshot.filename)!==null&&h!==void 0?h:"screenshot.png")}let a;try{a=await n(_n(e),{method:"POST",body:d})}catch{return{ok:!1,reason:"unreachable"}}if(!a.ok)return f&&a.status===429?{ok:!1,reason:"backpressure",retryAfterSeconds:o.hold(a.headers.get("Retry-After"))}:{ok:!1,reason:"refused",status:a.status};try{return{ok:!0,feedback:await a.json()}}catch{return{ok:!0,feedback:null}}}var ae="0.1.0",Zo=5,Tn=2e3,Jo=20,Cn=5,Ln=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,Mn=/\bhttps?:\/\/[^\s"')]+/gi,An=/\b0x[0-9a-f]+\b/gi,In=/\b[0-9a-f]{8,}\b/gi,Rn=/\d{4,}/g;function $n(e){return typeof e!="string"||e.length===0?"":e.replace(Ln,"<uuid>").replace(Mn,"<url>").replace(An,"<hex>").replace(In,"<hex>").replace(Rn,"<n>").trim()}function Nn(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function ge(e){const t=e.replace(/\?[^:]*/,""),n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}function Pn(e){var t,n,o;const i=e.match(/^at\s+(.+?)\s+\((.+)\)$/);if(i)return`${(t=i[1])!==null&&t!==void 0?t:""}@${ge((n=i[2])!==null&&n!==void 0?n:"")}`;const r=e.match(/^at\s+(.+)$/);if(r)return`@${ge((o=r[1])!==null&&o!==void 0?o:"")}`;const s=e.indexOf("@");return s>=0?`${e.slice(0,s)}@${ge(e.slice(s+1))}`:null}function Un(e,t=Cn){if(typeof e!="string"||e.length===0)return"";const n=[];for(const o of e.split(`
|
|
2
|
-
`)){const i=Pn(o.trim());if(i&&(n.push(i),n.length>=t))break}return n.join(" < ")}function Bn(e,t,n){return Nn(`${e}|${$n(t)}|${Un(n)}`)}var On=class{constructor(e){var t;Y(this,"options",void 0),Y(this,"tokens",void 0),Y(this,"last",void 0),Y(this,"now",void 0),this.options=e,this.now=(t=e.now)!==null&&t!==void 0?t:Date.now,this.tokens=Math.max(0,e.capacity),this.last=this.now()}take(){const e=this.now(),{capacity:t,refillIntervalMs:n}=this.options;if(n>0&&e>this.last){const o=Math.floor((e-this.last)/n);o>0&&(this.tokens=Math.min(t,this.tokens+o),this.last+=o*n)}return this.tokens>=1?(this.tokens-=1,!0):!1}};function V(e){if(typeof e=="string")return e;if(e==null)return"";try{return String(e)}catch{return""}}function zn(e){const t=e,n=t.error;if(n&&typeof n=="object"){const i=n;return{type:V(i.name)||"Error",value:V(i.message)||V(t.message),stack:typeof i.stack=="string"?i.stack:void 0,original:n}}const o=V(t.message);return o?{type:"Error",value:o,original:o}:null}function Dn(e){const t=e.reason;if(t&&typeof t=="object"){const o=t;return{type:V(o.name)||"UnhandledRejection",value:V(o.message)||V(t),stack:typeof o.stack=="string"?o.stack:void 0,original:t}}const n=V(t);return{type:"UnhandledRejection",value:n,original:t!=null?t:n}}var jn={destroy:()=>{},droppedCount:()=>0};function Fn(e){var t,n,o,i,r,s,f,l,d,h,a,b;const u=(t=e.win)!==null&&t!==void 0?t:typeof window!="undefined"?window:void 0;if(!u)return jn;const m=u,p=(n=(o=e.doc)!==null&&o!==void 0?o:m.document)!==null&&n!==void 0?n:typeof document!="undefined"?document:void 0,c=(i=e.now)!==null&&i!==void 0?i:Date.now,T=(r=e.sdkVersion)!==null&&r!==void 0?r:ae,C=(s=e.maxDistinct)!==null&&s!==void 0?s:20,w=(f=(l=e.deps)===null||l===void 0?void 0:l.captureView)!==null&&f!==void 0?f:Xe,_=(d=(h=e.deps)===null||h===void 0?void 0:h.submitReport)!==null&&d!==void 0?d:Ge,N=new On({capacity:(a=e.burstCapacity)!==null&&a!==void 0?a:5,refillIntervalMs:(b=e.burstRefillMs)!==null&&b!==void 0?b:Tn,now:c}),M=new Map;let A=0;function y(I,L,B){var R,z;return{...Fe({kind:"bug",url:(R=m.location)===null||R===void 0?void 0:R.href,environment:je(m,T),trace:B.trace?(z=e.buffer)===null||z===void 0?void 0:z.snapshot():void 0}),source:"auto",errorSignature:I,occurrences:L}}async function D(I,L,B){const R=M.get(I);if(!R)return;const z=R.sentCount;R.sentCount=L;try{const we=y(I,L,B),te=Re(we,{hook:e.beforeSend,scrub:e.scrub});if(!te)return;let ne=null;if(B.screenshot){const q=await w({doc:p,win:m});ne=q?{blob:q.blob,filename:`screenshot.${He(q.type)}`}:null}!(await _(e.apiUrl,{key:e.key,identity:e.identity,content:te,screenshot:ne})).ok&&R.sentCount===L&&(R.sentCount=z)}catch{R.sentCount===L&&(R.sentCount=z)}}function v(I){const L=Bn(I.type,I.value,I.stack),B=M.get(L);if(B){B.count+=1,B.lastAt=c();return}if(!N.take()){A+=1;return}if(M.size>=C){A+=1;return}const R=c();M.set(L,{count:1,firstAt:R,lastAt:R,sentCount:0});try{var z;(z=e.buffer)===null||z===void 0||z.add(Jt(I.original,R))}catch{}D(L,1,{screenshot:!0,trace:!0})}const S=I=>{try{const L=zn(I);L&&v(L)}catch{}},O=I=>{try{const L=Dn(I);L&&v(L)}catch{}},$=()=>{try{for(const[I,L]of M)L.count>L.sentCount&&D(I,L.count,{screenshot:!1,trace:!1})}catch{}},ee=()=>{(p==null?void 0:p.visibilityState)==="hidden"&&$()};return m.addEventListener("error",S,!0),m.addEventListener("unhandledrejection",O,!0),m.addEventListener("pagehide",$),p==null||p.addEventListener("visibilitychange",ee),{destroy:()=>{m.removeEventListener("error",S,!0),m.removeEventListener("unhandledrejection",O,!0),m.removeEventListener("pagehide",$),p==null||p.removeEventListener("visibilitychange",ee)},droppedCount:()=>A}}var Ye="fixback.anonymousId";function Ke(){const e=globalThis.crypto;return e&&typeof e.randomUUID=="function"?e.randomUUID():`fb-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Hn(){try{const e=globalThis.localStorage,t=e.getItem(Ye);if(t)return t;const n=Ke();return e.setItem(Ye,n),n}catch{return Ke()}}var qe="fixback_invite",Vn="fixback:reporter:";function Xn(e){try{const t=new URL(e).searchParams.get(qe);return t&&t.length>0?t:null}catch{return null}}function Gn(e){try{const t=new URL(e.location.href);if(!t.searchParams.has("fixback_invite"))return;t.searchParams.delete(qe);const n=t.searchParams.toString(),o=`${t.pathname}${n?`?${n}`:""}${t.hash}`;e.history.replaceState(e.history.state,"",o)}catch{}}function We(e){return`${Vn}${e}`}function Ze(){try{var e;return(e=globalThis.localStorage)!==null&&e!==void 0?e:null}catch{return null}}function se(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function Yn(e,t,n=Ze()){if(!n)return;const o=se(t.name),i=se(t.email),r={reporterId:t.reporterId,...o?{name:o}:{},...i?{email:i}:{}};try{n.setItem(We(e),JSON.stringify(r))}catch{}}function Je(e,t=Ze()){if(!t)return null;try{const n=t.getItem(We(e));if(!n)return null;const o=JSON.parse(n);if(typeof(o==null?void 0:o.reporterId)!="string"||o.reporterId.length===0)return null;const i=se(o.name),r=se(o.email);return{reporterId:o.reporterId,...i?{name:i}:{},...r?{email:r}:{}}}catch{return null}}function Qe(e,t){return`${e.replace(/\/+$/,"")}/api/invites/${encodeURIComponent(t)}`}function Kn(e,t){return`${Qe(e,t)}/redeem`}var et=new Set(["revoked","expired","exhausted","not_found"]);function tt(e){return e==="public"||e==="invited"||e==="internal"}function qn(e){if(typeof e!="object"||e===null)return!1;const t=e;return t.status==="pending"?typeof t.projectId=="string"&&(t.kind==="targeted"||t.kind==="shared")&&tt(t.tier):typeof t.status=="string"&&et.has(t.status)}function Wn(e){if(typeof e!="object"||e===null)return!1;const t=e;return t.status==="redeemed"?typeof t.reporterId=="string"&&typeof t.projectId=="string"&&tt(t.tier):typeof t.status=="string"&&et.has(t.status)}async function nt(e){try{return await e.json()}catch{return null}}async function Zn(e,t,n=fetch){let o;try{o=await n(Qe(e,t),{method:"GET",headers:{accept:"application/json"}})}catch{return null}const i=await nt(o);return qn(i)?i:null}async function Jn(e,t,n=fetch){let o;try{o=await n(Kn(e,t),{method:"POST",headers:{accept:"application/json"}})}catch{return null}const i=await nt(o);return Wn(i)?i:null}var Qn=`
|
|
1
|
+
(function(j,ie){typeof exports=="object"&&typeof module!="undefined"?ie(exports):typeof define=="function"&&define.amd?define(["exports"],ie):(j=typeof globalThis!="undefined"?globalThis:j||self,ie(j.Fixback={}))})(this,function(j){Object.defineProperty(j,Symbol.toStringTag,{value:"Module"});function ie(e){return`${e.replace(/\/+$/,"")}/api/ingest/boot`}function Un(e){if(typeof e!="object"||e===null)return!1;const t=e;return typeof t.originAllowed=="boolean"&&typeof t.canSubmit=="boolean"&&typeof t.gate=="string"&&(t.tier===null||typeof t.tier=="string")}async function Bn(e,t,n=fetch){let r;try{r=await n(ie(e),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(t)})}catch{return null}if(!r.ok)return null;let o;try{o=await r.json()}catch{return null}return Un(o)?o:null}var Me=["data-fixback-root","data-fixback-overlay"],Fa=Me.map(e=>`[${e}]`).join(",");function Fn(e){return e instanceof Element&&Me.some(t=>e.hasAttribute(t))}function De(e){let t=e instanceof Node?e:null;for(;t;){if(t instanceof Element){for(const r of Me)if(t.hasAttribute(r))return!0}const n=t.getRootNode();if(n instanceof ShadowRoot&&n!==t){t=n.host;continue}t=t.parentNode}return!1}function ut(e){const t=globalThis.CSS;return t!=null&&t.escape?t.escape(e):e.replace(/[^\w-]/g,n=>`\\${n}`)}function $n(e){let t=1,n=e.previousElementSibling;for(;n;)n.tagName===e.tagName&&(t+=1),n=n.previousElementSibling;return t}function dt(e){if(e.id)return`#${ut(e.id)}`;const t=[];let n=e;for(;n&&n.tagName.toLowerCase()!=="html";){if(n.id){t.unshift(`#${ut(n.id)}`);break}const r=n.tagName.toLowerCase(),o=n.parentElement;if(o){const i=Array.from(o.children).filter(a=>a.tagName===n.tagName);t.unshift(i.length>1?`${r}:nth-of-type(${$n(n)})`:r)}else t.unshift(r);n=o}return t.join(" > ")}function On(e){const t=e.tagName.toLowerCase();if(e.id)return`${t}#${e.id}`;const n=e.classList[0];return n?`${t}.${n}`:t}function zn(e){const t=[];let n=e;for(;n;)t.unshift(On(n)),n=n.parentElement;return t.join(" > ")}function jn(e){const t=e.getBoundingClientRect();return{x:Math.round(t.x),y:Math.round(t.y),width:Math.round(t.width),height:Math.round(t.height)}}function Hn(e){return{selector:dt(e),domPath:zn(e),tag:e.tagName.toLowerCase(),rect:jn(e)}}function Vn(e){var t,n;const r=(t=e.doc)!==null&&t!==void 0?t:document,o=(n=e.ignore)!==null&&n!==void 0?n:De;let i=null,a=!1;function c(h){var f;const b=(f=(typeof h.composedPath=="function"?h.composedPath():[])[0])!==null&&f!==void 0?f:h.target;return b instanceof Element?o(b)?null:b:null}function l(h){var f;a||(i=c(h),(f=e.onHover)===null||f===void 0||f.call(e,i))}function d(h){var f;if(a)return;const b=(f=c(h))!==null&&f!==void 0?f:i;b&&(h.preventDefault(),h.stopPropagation(),s(),e.onPick(b))}function p(h){if(!a&&h.key==="Escape"){var f;h.preventDefault(),s(),(f=e.onCancel)===null||f===void 0||f.call(e)}}function s(){a||(a=!0,r.removeEventListener("mouseover",l,!0),r.removeEventListener("click",d,!0),r.removeEventListener("keydown",p,!0),i=null)}return r.addEventListener("mouseover",l,!0),r.addEventListener("click",d,!0),r.addEventListener("keydown",p,!0),{stop:s}}var Xn=7,ft=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi,pt=new RegExp(`\\d{${Xn},}`,"g"),qn=/\b(bearer|token)\s+[\w.\-~+/]+=*/gi,Gn=/\bhttps?:\/\/[^\s"'<>]+/gi;function Wn(e){return typeof e!="string"||e.length===0?e:e.replace(ft,"[redacted-email]").replace(qn,(t,n)=>`${n} [redacted]`).replace(pt,"[redacted-number]")}function Pe(e){return e.replace(ft,"[redacted-email]").replace(pt,"[redacted-number]")}function H(e){var t;if(typeof e!="string"||e.length===0)return e;let n=e;n=n.replace(/(^[a-z][a-z0-9+.-]*:\/\/)[^/@?#]*@/i,"$1"),n=n.replace(/\?[^#]*/,""),n=n.replace(/#.*$/,a=>a.includes("=")?"":a);const r=n.match(/^([a-z][a-z0-9+.-]*:\/\/[^/?#]*)([\s\S]*)$/i);if(r)return r[1]+Pe((t=r[2])!==null&&t!==void 0?t:"");const o=n.match(/^(\/\/[^/?#]*)([\s\S]*)$/);if(o){var i;return o[1]+Pe((i=o[2])!==null&&i!==void 0?i:"")}return Pe(n)}function Yn(e){const t={...e};return typeof t.url=="string"&&(t.url=H(t.url)),typeof t.from=="string"&&(t.from=H(t.from)),typeof t.to=="string"&&(t.to=H(t.to)),t}function ae(e){return Wn(e.replace(Gn,t=>H(t)))}function Ue(e){if(typeof e=="string")return ae(e);if(Array.isArray(e))return e.map(Ue);if(e&&typeof e=="object"){const t={};for(const[n,r]of Object.entries(e))t[n]=Ue(r);return t}return e}function Kn(e){switch(e.t){case"string":return typeof e.v=="string"?{t:"string",v:ae(e.v)}:e;case"json":return{t:"json",v:Ue(e.v)};case"error":{if(!e.v||typeof e.v!="object")return e;const t={...e.v};return typeof t.message=="string"&&(t.message=ae(t.message)),typeof t.stack=="string"&&(t.stack=ae(t.stack)),{t:"error",v:t}}default:return e}}function Zn(e){const t={...e};return typeof t.message=="string"&&(t.message=ae(t.message)),t.data&&(t.data=Yn(t.data)),typeof t.url=="string"&&(t.url=H(t.url)),Array.isArray(t.args)&&(t.args=t.args.map(Kn)),t}function Jn(e){const t={...e};return typeof t.url=="string"&&(t.url=H(t.url)),t.trace&&t.trace.length>0&&(t.trace=t.trace.map(Zn)),t}function bt(e,t={}){const n=t.scrub===!1?e:Jn(e),r=t.hook;if(!r)return n;try{const o=r(n);return o!=null?o:null}catch{return n}}var Be={network:100,console:80,breadcrumbs:40},Qn=18e4,er=["log","info","warn","error","assert","debug"],ht=["warn","error","assert"];function tr(e){return e!==void 0&&ht.includes(e)}var nr=ht;function rr(e){return nr.includes(e)}function or(e){return e==="console"?"console":e==="fetch"||e==="xhr"||e==="beacon"?"network":"breadcrumbs"}function Fe(e,t){return typeof e!="number"||!Number.isFinite(e)||e<1?t:Math.floor(e)}function ve(){return typeof performance!="undefined"&&typeof performance.now=="function"?performance.now():Date.now()}function ir(){const e=Math.random().toString(36).slice(2,8);let t=0;return()=>`${e}${(t++).toString(36)}`}var mt=["network","console","breadcrumbs"];function ar(e,t){const n=e.length-t;if(n<=0)return e;const r=new Set;for(let o=0;o<e.length&&r.size<n;o+=1)tr(e[o].crumb.level)||r.add(o);for(let o=0;o<e.length&&r.size<n;o+=1)r.has(o)||r.add(o);return e.filter((o,i)=>!r.has(i))}function sr(e={}){var t,n,r,o,i,a;const c={network:Fe((t=e.budgets)===null||t===void 0?void 0:t.network,Be.network),console:Fe((n=e.budgets)===null||n===void 0?void 0:n.console,Be.console),breadcrumbs:Fe((r=e.budgets)===null||r===void 0?void 0:r.breadcrumbs,Be.breadcrumbs)},l=e.maxAgeMs===void 0?Qn:e.maxAgeMs,d=e.beforeBreadcrumb,p=(o=e.now)!==null&&o!==void 0?o:Date.now,s=(i=e.mono)!==null&&i!==void 0?i:ve,h=(a=e.nextId)!==null&&a!==void 0?a:ir(),f={network:[],console:[],breadcrumbs:[]};let b=0;function m(){if(typeof l!="number"||l<=0)return;const u=p()-l;for(const y of mt){const g=f[y];g.length>0&&(f[y]=g.filter(v=>v.crumb.timestamp>=u))}}return{add(u){var y;let g=u;if(d)try{g=d(u)}catch{g=u}if(!g)return;const v={...g,id:(y=g.id)!==null&&y!==void 0?y:h(),timestamp:typeof g.timestamp=="number"?g.timestamp:p(),mono:typeof g.mono=="number"?g.mono:s()},w=or(v.category);f[w].push({crumb:v,seq:b++}),m();const S=f[w],k=c[w];S.length>k&&(f[w]=w==="console"?ar(S,k):S.slice(-k))},snapshot(){m();const u=[];for(const y of mt)u.push(...f[y]);return u.sort((y,g)=>(typeof y.crumb.mono=="number"?y.crumb.mono:y.crumb.timestamp)-(typeof g.crumb.mono=="number"?g.crumb.mono:g.crumb.timestamp)||y.seq-g.seq),u.map(y=>y.crumb)},clear(){f.network=[],f.console=[],f.breadcrumbs=[],b=0}}}var vt=300,$e=2048,$a=4,Oa=100,Oe=1024,za=4096,lr=2048;function Y(e,t){return e.length>t?`${e.slice(0,t)}…`:e}function gt(e){if(typeof e=="string")return e;if(e instanceof Error)return`${e.name}: ${e.message}`;if(e==null||typeof e=="number"||typeof e=="boolean")return String(e);try{var t;return(t=JSON.stringify(e))!==null&&t!==void 0?t:String(e)}catch{return"[object]"}}function cr(e){const t=e.map(gt).join(" ");return t.length>vt?`${t.slice(0,vt)}…`:t}function yt(e){var t;const n={name:e.name||"Error",message:Y(String((t=e.message)!==null&&t!==void 0?t:""),Oe)};return typeof e.stack=="string"&&e.stack.length>0&&(n.stack=Y(e.stack,lr)),n}function ze(e,t,n){if(e===null)return null;const r=typeof e;if(r==="string")return Y(e,Oe);if(r==="number")return Number.isFinite(e)?e:String(e);if(r==="boolean")return e;if(r==="bigint")return`${e.toString()}n`;if(r==="symbol")return e.toString();if(r==="function")return"[Function]";if(r==="undefined")return null;const o=e;if(e instanceof Error){const{name:i,message:a}=yt(e);return{name:i,message:a}}if(n.has(o))return"[Circular]";if(t<=0)return Array.isArray(e)?"[Array]":"[Object]";n.add(o);try{if(Array.isArray(e)){const l=e.slice(0,100).map(d=>ze(d,t-1,n));return e.length>100&&l.push(`… ${e.length-100} more`),l}const i=e,a=Object.keys(i),c={};for(const l of a.slice(0,100)){const d=i[l];typeof d=="undefined"||typeof d=="function"||(c[l]=ze(d,t-1,n))}return a.length>100&&(c["…"]=`${a.length-100} more`),c}finally{n.delete(o)}}function ur(e){if(e==null)return{t:"null",v:null};const t=typeof e;return t==="string"?{t:"string",v:Y(e,Oe)}:t==="number"?Number.isFinite(e)?{t:"number",v:e}:{t:"string",v:String(e)}:t==="boolean"?{t:"bool",v:e}:t==="bigint"?{t:"string",v:`${e.toString()}n`}:t==="symbol"?{t:"string",v:e.toString()}:t==="function"?{t:"string",v:"[Function]"}:e instanceof Error?{t:"error",v:yt(e)}:{t:"json",v:ze(e,4,new Set)}}function je(e){try{var t;const n=(t=JSON.stringify(e))!==null&&t!==void 0?t:"";return typeof TextEncoder!="undefined"?new TextEncoder().encode(n).length:n.length}catch{return Number.POSITIVE_INFINITY}}function dr(e){if(je(e)<=4096)return e;let t=e.slice();for(;t.length>1&&je(t)>4096;)t=t.slice(0,-1);return t.length===1&&je(t)>4096?[{t:"string",v:"[trace: console argument omitted (too large)]"}]:t}function wt(e,t,n,r){const o=dr(t.map(ur));return{category:"console",level:e,message:cr(t),timestamp:n,...o.length>0?{args:o}:{},...r?{source:r}:{}}}function fr(e,t,n){const r=Y(H(e),$e),o=Y(H(t),$e);return{category:"navigation",message:`${r} → ${o}`,timestamp:n,data:{from:r,to:o}}}function He(e){return typeof e!="number"||e<=0?"network-error":e>=500?"http-5xx":e>=400?"http-4xx":"ok"}function Ve(e){if(typeof e=="string")return pr(e);if(typeof Blob!="undefined"&&e instanceof Blob)return e.size;if(typeof ArrayBuffer!="undefined"&&(e instanceof ArrayBuffer||ArrayBuffer.isView(e)))return e.byteLength}function pr(e){try{return typeof TextEncoder!="undefined"?new TextEncoder().encode(e).length:e.length}catch{return e.length}}function xt(e){if(typeof e!="string")return;const t=Number.parseInt(e,10);return Number.isFinite(t)&&t>=0?t:void 0}function kt(e){var t;if(typeof e!="string"||e.length===0)return;const n=(t=e.split(";")[0])===null||t===void 0?void 0:t.trim();return n&&n.length>0?n:void 0}function ge(e,t){const n=Y(H(e.url),$e),r=typeof e.status=="number"&&e.status>0,o=r?` → ${e.status}`:"",i=e.outcome!=="ok"?` (${e.outcome})`:"";return{category:e.api,api:e.api,method:e.method,url:n,message:`${e.method} ${n}${o}${i}`,timestamp:t,...r?{status:e.status}:{},...e.statusText?{statusText:e.statusText}:{},...typeof e.durationMs=="number"?{durationMs:e.durationMs}:{},...typeof e.reqSize=="number"?{reqSize:e.reqSize}:{},...typeof e.respSize=="number"?{respSize:e.respSize}:{},...e.contentType?{contentType:e.contentType}:{},outcome:e.outcome}}function Et(e){try{return dt(e)}catch{return e.tagName?e.tagName.toLowerCase():"unknown"}}function br(e,t){const n=Et(e);return{category:"ui.click",message:`click ${n}`,timestamp:t,data:{target:n}}}function hr(e,t){const n=Et(e);return{category:"ui.input",message:`input ${n}`,timestamp:t,data:{target:n}}}function mr(e){return e instanceof Error?{name:e.name||"Error",message:e.message}:typeof e=="string"?{name:"Error",message:e}:{name:"Error",message:gt(e)}}function vr(e,t,n){const{name:r,message:o}=mr(e),i={category:"error",level:"error",message:o?`${r}: ${o}`:r,timestamp:t,data:{errorType:r}};return n&&n.length>0?{...i,causedBy:n}:i}function ye(){}function gr(e){var t,n;let r;const o=e.match(/^at\s+.+?\s+\((.+)\)$/);if(o)r=o[1];else{const l=e.match(/^at\s+(.+)$/);if(l)r=l[1];else{const d=e.indexOf("@");d>=0&&(r=e.slice(d+1))}}if(!r)return;r=r.replace(/\?[^:]*/,"");const i=(t=r.match(/^(.*):(\d+):\d+$/))!==null&&t!==void 0?t:r.match(/^(.*):(\d+)$/);if(!i)return;const a=(n=i[1])!==null&&n!==void 0?n:"",c=Number(i[2]);if(!(!a||!Number.isFinite(c)))return{file:a,line:c}}function yr(e,t=0){if(typeof e!="string"||e.length===0)return;const n=[];for(const r of e.split(`
|
|
2
|
+
`)){const o=gr(r.trim());o&&n.push(o)}return n[t]}var wr=1;function xr(e,t,n,r){const o=[];for(const i of n){const a=t[i];if(typeof a!="function")continue;const c=rr(i),l=(...d)=>{let p;if(c)try{p=yr(new Error().stack,wr)}catch{p=void 0}try{i==="assert"?d[0]||e.add(wt("assert",d.slice(1),r(),p)):e.add(wt(i,d,r(),p))}catch{}return a.apply(t,d)};t[i]=l,o.push(()=>{t[i]=a})}return()=>{for(const i of o)i()}}function kr(e){return typeof e=="string"?e:e instanceof URL?e.toString():e.url}function Er(e,t){var n,r;return((n=(r=t==null?void 0:t.method)!==null&&r!==void 0?r:typeof e=="object"&&"method"in e?e.method:void 0)!==null&&n!==void 0?n:"GET").toUpperCase()}function St(e,t){try{var n,r,o;return(n=(r=e.headers)===null||r===void 0||(o=r.get)===null||o===void 0?void 0:o.call(r,t))!==null&&n!==void 0?n:null}catch{return null}}function Sr(e){return e.type==="opaque"||e.type==="opaqueredirect"?"opaque-cors":He(e.status)}function Tr(e){const t=typeof e=="object"&&e!==null&&"name"in e?String(e.name):"";return t==="AbortError"?"aborted":t==="TimeoutError"?"timeout":"network-error"}function Cr(e,t,n,r,o=ve){const i=t.fetch;if(typeof i!="function")return ye;const a=(c,l)=>{const d=kr(c),p=Er(c,l),s=Ve(l==null?void 0:l.body),h=o(),f=i.call(t,c,l);return n(d)?f:f.then(b=>{try{e.add(ge({api:"fetch",method:p,url:d,status:b.status||void 0,statusText:b.statusText||void 0,durationMs:Math.max(0,o()-h),reqSize:s,respSize:xt(St(b,"content-length")),contentType:kt(St(b,"content-type")),outcome:Sr(b)},r()))}catch{}return b},b=>{try{e.add(ge({api:"fetch",method:p,url:d,durationMs:Math.max(0,o()-h),reqSize:s,outcome:Tr(b)},r()))}catch{}throw b})};return t.fetch=a,()=>{t.fetch=i}}function Tt(e,t){try{return typeof e.getResponseHeader=="function"?e.getResponseHeader(t):null}catch{return null}}function _r(e){try{return e.statusText||void 0}catch{return}}function Ar(e,t,n,r,o=ve){const i=t.XMLHttpRequest;if(typeof i!="function")return ye;const a=i.prototype,c=a.open,l=a.send;return a.open=function(d,p,...s){return this.__fixbackMeta={method:String(d).toUpperCase(),url:String(p)},c.call(this,d,p,...s)},a.send=function(d){const p=this.__fixbackMeta;if(p&&!n(p.url)){const s=o(),h=Ve(d);let f;const b=()=>{f=He(this.status||void 0)},m=()=>{f="network-error"},u=()=>{f="timeout"},y=()=>{f="aborted"},g=()=>{try{var v;e.add(ge({api:"xhr",method:p.method,url:p.url,status:this.status||void 0,statusText:_r(this),durationMs:Math.max(0,o()-s),reqSize:h,respSize:xt(Tt(this,"content-length")),contentType:kt(Tt(this,"content-type")),outcome:(v=f)!==null&&v!==void 0?v:He(this.status||void 0)},r()))}catch{}this.removeEventListener("load",b),this.removeEventListener("error",m),this.removeEventListener("timeout",u),this.removeEventListener("abort",y),this.removeEventListener("loadend",g)};this.addEventListener("load",b),this.addEventListener("error",m),this.addEventListener("timeout",u),this.addEventListener("abort",y),this.addEventListener("loadend",g)}return l.call(this,d)},()=>{a.open=c,a.send=l}}function Lr(e,t,n,r){const o=t.navigator;if(!o||typeof o.sendBeacon!="function")return ye;const i=o.sendBeacon,a=(l,d,p)=>{if(!n(l))try{e.add(ge({api:"beacon",method:"POST",url:l,reqSize:Ve(d),outcome:p},r()))}catch{}},c=function(l,d){const p=typeof l=="string"?l:String(l);let s;try{s=i.call(o,l,d)}catch(h){throw a(p,d,"network-error"),h}return a(p,d,s?"ok":"network-error"),s};return o.sendBeacon=c,()=>{o.sendBeacon=i}}function Nr(e,t,n){const r=t.history,o=t.location;if(!r||!o)return ye;let i=o.href;const a=s=>{try{e.add(fr(i,s,n()))}catch{}i=s},c=r.pushState,l=r.replaceState;r.pushState=function(s,h,f){const b=c.call(this,s,h,f);return a(o.href),b},r.replaceState=function(s,h,f){const b=l.call(this,s,h,f);return a(o.href),b};const d=()=>a(o.href),p=()=>a(o.href);return t.addEventListener("popstate",d),t.addEventListener("hashchange",p),()=>{r.pushState=c,r.replaceState=l,t.removeEventListener("popstate",d),t.removeEventListener("hashchange",p)}}function Ct(e){var t;const n=(t=(typeof e.composedPath=="function"?e.composedPath():[])[0])!==null&&t!==void 0?t:e.target;return n instanceof Element?n:null}function Ir(e,t,n){const r=i=>{const a=Ct(i);if(!(!a||De(a)))try{e.add(br(a,n()))}catch{}},o=i=>{const a=Ct(i);if(!(!a||De(a)))try{e.add(hr(a,n()))}catch{}};return t.addEventListener("click",r,!0),t.addEventListener("input",o,!0),()=>{t.removeEventListener("click",r,!0),t.removeEventListener("input",o,!0)}}function Rr(e,t={}){var n,r,o,i,a,c,l;const d=(n=t.win)!==null&&n!==void 0?n:globalThis,p=(r=t.doc)!==null&&r!==void 0?r:typeof document!="undefined"?document:void 0,s=(o=t.consoleObj)!==null&&o!==void 0?o:typeof console!="undefined"?console:void 0,h=(i=t.consoleLevels)!==null&&i!==void 0?i:er,f=(a=t.ignoreUrl)!==null&&a!==void 0?a:(()=>!1),b=(c=t.now)!==null&&c!==void 0?c:Date.now,m=(l=t.mono)!==null&&l!==void 0?l:ve,u=t.captureConsole!==!1,y=t.captureNetwork!==!1,g=[];return s&&u&&g.push(xr(e,s,h,b)),d&&(y&&(g.push(Cr(e,d,f,b,m)),g.push(Ar(e,d,f,b,m)),g.push(Lr(e,d,f,b))),g.push(Nr(e,d,b))),p&&g.push(Ir(e,p,b)),()=>{for(const v of g)try{v()}catch{}}}var Mr="#e5484d";function _t(e,t,n,r){return{x:Math.round(Math.min(e,n)),y:Math.round(Math.min(t,r)),width:Math.round(Math.abs(n-e)),height:Math.round(Math.abs(r-t))}}function Dr(e,t,n,r,o=14){const i=Math.atan2(r-t,n-e);return[{x:n,y:r},{x:n-o*Math.cos(i-Math.PI/6),y:r-o*Math.sin(i-Math.PI/6)},{x:n-o*Math.cos(i+Math.PI/6),y:r-o*Math.sin(i+Math.PI/6)}]}function Pr(e){const t={};return e.element&&(t.element=e.element),e.region&&(t.region=e.region),e.marks&&e.marks.length>0&&(t.marks=e.marks.slice()),Object.keys(t).length>0?t:void 0}function At(e,t){var n;const r={},o=e.innerWidth;typeof o=="number"&&o>0&&(r.viewportWidth=Math.round(o));const i=e.innerHeight;typeof i=="number"&&i>0&&(r.viewportHeight=Math.round(i));const a=(n=e.navigator)===null||n===void 0?void 0:n.userAgent;return typeof a=="string"&&a.length>0&&(r.browser=a),t.length>0&&(r.sdkVersion=t),r}function Lt(e){var t;const n={};e.kind&&(n.kind=e.kind);const r=(t=e.comment)===null||t===void 0?void 0:t.trim();r&&(n.comment=r),e.url&&(n.url=e.url),e.environment&&Object.keys(e.environment).length>0&&(n.environment=e.environment);const o=Pr({element:e.element,region:e.region,marks:e.marks});return o&&(n.annotation=o),e.trace&&e.trace.length>0&&(n.trace=e.trace),n}var Xe;function Ur(e,t){return e[13]=1,e[14]=t>>8,e[15]=t&255,e[16]=t>>8,e[17]=t&255,e}var Nt=112,It=72,Rt=89,Mt=115,qe;function Br(){const e=new Int32Array(256);for(let t=0;t<256;t++){let n=t;for(let r=0;r<8;r++)n=n&1?3988292384^n>>>1:n>>>1;e[t]=n}return e}function Fr(e){let t=-1;qe||(qe=Br());for(let n=0;n<e.length;n++)t=qe[(t^e[n])&255]^t>>>8;return t^-1}function $r(e){const t=e.length-1;for(let n=t;n>=4;n--)if(e[n-4]===9&&e[n-3]===Nt&&e[n-2]===It&&e[n-1]===Rt&&e[n]===Mt)return n-3;return 0}function Or(e,t,n=!1){const r=new Uint8Array(13);t*=39.3701,r[0]=Nt,r[1]=It,r[2]=Rt,r[3]=Mt,r[4]=t>>>24,r[5]=t>>>16,r[6]=t>>>8,r[7]=t&255,r[8]=r[4],r[9]=r[5],r[10]=r[6],r[11]=r[7],r[12]=1;const o=Fr(r),i=new Uint8Array(4);if(i[0]=o>>>24,i[1]=o>>>16,i[2]=o>>>8,i[3]=o&255,n){const a=$r(e);return e.set(r,a),e.set(i,a+13),e}else{const a=new Uint8Array(4);a[0]=0,a[1]=0,a[2]=0,a[3]=9;const c=new Uint8Array(54);return c.set(e,0),c.set(a,33),c.set(r,37),c.set(i,50),c}}var Dt="[modern-screenshot]",X=typeof window!="undefined",zr=X&&"Worker"in window,jr=X&&"atob"in window,ja=X&&"btoa"in window,Ge=X?(Xe=window.navigator)===null||Xe===void 0?void 0:Xe.userAgent:"",Pt=Ge.includes("Chrome"),we=Ge.includes("AppleWebKit")&&!Pt,We=Ge.includes("Firefox"),Hr=e=>e&&"__CONTEXT__"in e,Vr=e=>e.constructor.name==="CSSFontFaceRule",Xr=e=>e.constructor.name==="CSSImportRule",qr=e=>e.constructor.name==="CSSLayerBlockRule",z=e=>e.nodeType===1,se=e=>typeof e.className=="object",Ut=e=>e.tagName==="image",Gr=e=>e.tagName==="use",le=e=>z(e)&&typeof e.style!="undefined"&&!se(e),Wr=e=>e.nodeType===8,Yr=e=>e.nodeType===3,J=e=>e.tagName==="IMG",xe=e=>e.tagName==="VIDEO",Kr=e=>e.tagName==="CANVAS",Zr=e=>e.tagName==="TEXTAREA",Jr=e=>e.tagName==="INPUT",Qr=e=>e.tagName==="STYLE",eo=e=>e.tagName==="SCRIPT",to=e=>e.tagName==="SELECT",no=e=>e.tagName==="SLOT",ro=e=>e.tagName==="IFRAME",oo=(...e)=>console.warn(Dt,...e);function io(e){var t;const n=e==null||(t=e.createElement)===null||t===void 0?void 0:t.call(e,"canvas");return n&&(n.height=n.width=1),!!n&&"toDataURL"in n&&!!n.toDataURL("image/webp").includes("image/webp")}var Ye=e=>e.startsWith("data:");function Bt(e,t){if(e.match(/^[a-z]+:\/\//i))return e;if(X&&e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i)||!X)return e;const n=ke().implementation.createHTMLDocument(),r=n.createElement("base"),o=n.createElement("a");return n.head.appendChild(r),n.body.appendChild(o),t&&(r.href=t),o.href=e,o.href}function ke(e){var t;return(t=e&&z(e)?e==null?void 0:e.ownerDocument:e)!==null&&t!==void 0?t:window.document}var Ee="http://www.w3.org/2000/svg";function ao(e,t,n){const r=ke(n).createElementNS(Ee,"svg");return r.setAttributeNS(null,"width",e.toString()),r.setAttributeNS(null,"height",t.toString()),r.setAttributeNS(null,"viewBox",`0 0 ${e} ${t}`),r}function so(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 lo(e,t="image/png",n=1){try{return await new Promise((r,o)=>{e.toBlob(i=>{i?r(i):o(new Error("Blob is null"))},t,n)})}catch(r){if(jr)return co(e.toDataURL(t,n));throw r}}function co(e){var t,n;const[r,o]=e.split(","),i=(t=(n=r.match(/data:(.+);/))===null||n===void 0?void 0:n[1])!==null&&t!==void 0?t:void 0,a=window.atob(o),c=a.length,l=new Uint8Array(c);for(let d=0;d<c;d+=1)l[d]=a.charCodeAt(d);return new Blob([l],{type:i})}function Ft(e,t){return new Promise((n,r)=>{const o=new FileReader;o.onload=()=>n(o.result),o.onerror=()=>r(o.error),o.onabort=()=>r(new Error(`Failed read blob to ${t}`)),t==="dataUrl"?o.readAsDataURL(e):t==="arrayBuffer"&&o.readAsArrayBuffer(e)})}var uo=e=>Ft(e,"dataUrl"),fo=e=>Ft(e,"arrayBuffer");function Q(e,t){const n=ke(t).createElement("img");return n.decoding="sync",n.loading="eager",n.src=e,n}function ce(e,t){return new Promise(n=>{const{timeout:r,ownerDocument:o,onError:i,onWarn:a}=t!=null?t:{},c=typeof e=="string"?Q(e,ke(o)):e;let l=null,d=null;function p(){n(c),l&&clearTimeout(l),d==null||d()}if(r&&(l=setTimeout(p,r)),xe(c)){const s=c.currentSrc||c.src;if(!s)return c.poster?ce(c.poster,t).then(n):p();if(c.readyState>=2)return p();const h=p,f=b=>{a==null||a("Failed video load",s,b),i==null||i(b),p()};d=()=>{c.removeEventListener("loadeddata",h),c.removeEventListener("error",f)},c.addEventListener("loadeddata",h,{once:!0}),c.addEventListener("error",f,{once:!0})}else{const s=Ut(c)?c.href.baseVal:c.currentSrc||c.src;if(!s)return p();const h=async()=>{if(J(c)&&"decode"in c)try{await c.decode()}catch(b){a==null||a("Failed to decode image, trying to render anyway",c.dataset.originalSrc||s,b)}p()},f=b=>{a==null||a("Failed image load",c.dataset.originalSrc||s,b),p()};if(J(c)&&c.complete)return h();d=()=>{c.removeEventListener("load",h),c.removeEventListener("error",f)},c.addEventListener("load",h,{once:!0}),c.addEventListener("error",f,{once:!0})}})}async function po(e,t){le(e)&&(J(e)||xe(e)?await ce(e,t):await Promise.all(["img","video"].flatMap(n=>Array.from(e.querySelectorAll(n)).map(r=>ce(r,t)))))}var $t=(function(){let t=0;const n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(t+=1,`u${n()}${t}`)})();function Ot(e){return e==null?void 0:e.split(",").map(t=>t.trim().replace(/"|'/g,"").toLowerCase()).filter(Boolean)}var zt=0;function bo(e){const t=`${Dt}[#${zt}]`;return zt++,{time:n=>e&&console.time(`${t} ${n}`),timeEnd:n=>e&&console.timeEnd(`${t} ${n}`),warn:(...n)=>e&&oo(...n)}}function ho(e){return{cache:e?"no-cache":"force-cache"}}async function Ke(e,t){return Hr(e)?e:mo(e,{...t,autoDestruct:!0})}async function mo(e,t){var n,r,o,i,a;const{scale:c=1,workerUrl:l,workerNumber:d=1}=t||{},p=!!(t!=null&&t.debug),s=(n=t==null?void 0:t.features)!==null&&n!==void 0?n:!0,h=(r=e.ownerDocument)!==null&&r!==void 0?r:X?window.document:void 0,f=(o=(i=e.ownerDocument)===null||i===void 0?void 0:i.defaultView)!==null&&o!==void 0?o:X?window:void 0,b=new Map,m={width:0,height:0,quality:1,type:"image/png",scale:c,backgroundColor:null,style:null,filter:null,maximumCanvasSize:0,timeout:3e4,progress:null,debug:p,fetch:{requestInit:ho(t==null||(a=t.fetch)===null||a===void 0?void 0:a.bypassingCache),placeholderImage:"data:image/png;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",bypassingCache:!1,...t==null?void 0:t.fetch},fetchFn:null,font:{},drawImageInterval:100,workerUrl:null,workerNumber:d,onCloneEachNode:null,onCloneNode:null,onEmbedNode:null,onCreateForeignObjectSvg:null,includeStyleProperties:null,autoDestruct:!1,...t,__CONTEXT__:!0,log:bo(p),node:e,ownerDocument:h,ownerWindow:f,dpi:c===1?null:96*c,svgStyleElement:jt(h),svgDefsElement:h==null?void 0:h.createElementNS(Ee,"defs"),svgStyles:new Map,defaultComputedStyles:new Map,workers:[...Array.from({length:zr&&l&&d?d:0})].map(()=>{try{const g=new Worker(l);return g.onmessage=async v=>{const{url:w,result:S}=v.data;if(S){var k,N;(k=b.get(w))===null||k===void 0||(N=k.resolve)===null||N===void 0||N.call(k,S)}else{var T,U;(T=b.get(w))===null||T===void 0||(U=T.reject)===null||U===void 0||U.call(T,new Error(`Error receiving message from worker: ${w}`))}},g.onmessageerror=v=>{var w,S;const{url:k}=v.data;(w=b.get(k))===null||w===void 0||(S=w.reject)===null||S===void 0||S.call(w,new Error(`Error receiving message from worker: ${k}`))},g}catch(g){return m.log.warn("Failed to new Worker",g),null}}).filter(Boolean),fontFamilies:new Map,fontCssTexts:new Map,acceptOfImage:`${[io(h)&&"image/webp","image/svg+xml","image/*","*/*"].filter(Boolean).join(",")};q=0.8`,requests:b,drawImageCount:0,tasks:[],features:s,isEnable:g=>{var v;if(g==="restoreScrollPosition"){var w;return typeof s=="boolean"?!1:(w=s[g])!==null&&w!==void 0?w:!1}return typeof s=="boolean"?s:(v=s[g])!==null&&v!==void 0?v:!0},shadowRoots:[]};m.log.time("wait until load"),await po(e,{timeout:m.timeout,onWarn:m.log.warn}),m.log.timeEnd("wait until load");const{width:u,height:y}=vo(e,m);return m.width=u,m.height=y,m}function jt(e){if(!e)return;const t=e.createElement("style"),n=t.ownerDocument.createTextNode(`
|
|
3
|
+
.______background-clip--text {
|
|
4
|
+
background-clip: text;
|
|
5
|
+
-webkit-background-clip: text;
|
|
6
|
+
}
|
|
7
|
+
`);return t.appendChild(n),t}function vo(e,t){let{width:n,height:r}=t;if(z(e)&&(!n||!r)){const o=e.getBoundingClientRect();n=n||o.width||Number(e.getAttribute("width"))||0,r=r||o.height||Number(e.getAttribute("height"))||0}return{width:n,height:r}}async function go(e,t){const{log:n,timeout:r,drawImageCount:o,drawImageInterval:i}=t;n.time("image to canvas");const a=await ce(e,{timeout:r,onWarn:t.log.warn}),{canvas:c,context2d:l}=yo(e.ownerDocument,t),d=()=>{try{l==null||l.drawImage(a,0,0,c.width,c.height)}catch(p){t.log.warn("Failed to drawImage",p)}};if(d(),t.isEnable("fixSvgXmlDecode"))for(let p=0;p<o;p++)await new Promise(s=>{setTimeout(()=>{l==null||l.clearRect(0,0,c.width,c.height),d(),s()},p+i)});return t.drawImageCount=0,n.timeEnd("image to canvas"),c}function yo(e,t){const{width:n,height:r,scale:o,backgroundColor:i,maximumCanvasSize:a}=t,c=e.createElement("canvas");c.width=Math.floor(n*o),c.height=Math.floor(r*o),c.style.width=`${n}px`,c.style.height=`${r}px`,a&&(c.width>a||c.height>a)&&(c.width>a&&c.height>a?c.width>c.height?(c.height*=a/c.width,c.width=a):(c.width*=a/c.height,c.height=a):c.width>a?(c.height*=a/c.width,c.width=a):(c.width*=a/c.height,c.height=a));const l=c.getContext("2d");return l&&i&&(l.fillStyle=i,l.fillRect(0,0,c.width,c.height)),{canvas:c,context2d:l}}function Ht(e,t){if(e.ownerDocument)try{const i=e.toDataURL();if(i!=="data:,")return Q(i,e.ownerDocument)}catch(i){t.log.warn("Failed to clone canvas",i)}const n=e.cloneNode(!1),r=e.getContext("2d"),o=n.getContext("2d");try{return r&&o&&o.putImageData(r.getImageData(0,0,e.width,e.height),0,0),n}catch(i){t.log.warn("Failed to clone canvas",i)}return n}function wo(e,t){try{var n;if(!(e==null||(n=e.contentDocument)===null||n===void 0)&&n.documentElement)return Ze(e.contentDocument.documentElement,t)}catch(r){t.log.warn("Failed to clone iframe",r)}return e.cloneNode(!1)}function xo(e){const 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 ko(e,t){if(e.ownerDocument&&!e.currentSrc&&e.poster)return Q(e.poster,e.ownerDocument);const n=e.cloneNode(!1);n.crossOrigin="anonymous",e.currentSrc&&e.currentSrc!==e.src&&(n.src=e.currentSrc);const r=n.ownerDocument;if(r){let o=!0;if(await ce(n,{onError:()=>o=!1,onWarn:t.log.warn}),!o)return e.poster?Q(e.poster,e.ownerDocument):n;n.currentTime=e.currentTime,await new Promise(a=>{n.addEventListener("seeked",a,{once:!0})});const i=r.createElement("canvas");i.width=e.offsetWidth,i.height=e.offsetHeight;try{const 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?Q(e.poster,e.ownerDocument):n}return Ht(i,t)}return n}function Eo(e,t){return Kr(e)?Ht(e,t):ro(e)?wo(e,t):J(e)?xo(e):xe(e)?ko(e,t):e.cloneNode(!1)}function So(e){let t=e.sandbox;if(!t){const{ownerDocument:n}=e;try{n&&(t=n.createElement("iframe"),t.id=`__SANDBOX__${$t()}`,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(r){e.log.warn("Failed to getSandBox",r)}}return t}var To=["width","height","-webkit-text-fill-color"],Co=["stroke","fill"];function Vt(e,t,n){const{defaultComputedStyles:r}=n,o=e.nodeName.toLowerCase(),i=se(e)&&o!=="svg",a=i?Co.map(m=>[m,e.getAttribute(m)]).filter(([,m])=>m!==null):[],c=[i&&"svg",o,a.map((m,u)=>`${m}=${u}`).join(","),t].filter(Boolean).join(":");if(r.has(c))return r.get(c);const l=So(n),d=l==null?void 0:l.contentWindow;if(!d)return new Map;const p=d==null?void 0:d.document;let s,h;i?(s=p.createElementNS(Ee,"svg"),h=s.ownerDocument.createElementNS(s.namespaceURI,o),a.forEach(([m,u])=>{h.setAttributeNS(null,m,u)}),s.appendChild(h)):s=h=p.createElement(o),h.textContent=" ",p.body.appendChild(s);const f=d.getComputedStyle(h,t),b=new Map;for(let m=f.length,u=0;u<m;u++){const y=f.item(u);To.includes(y)||b.set(y,f.getPropertyValue(y))}return p.body.removeChild(s),r.set(c,b),b}function Xt(e,t,n){const r=new Map,o=[],i=new Map;if(n)for(const l of n)c(l);else for(let l=e.length,d=0;d<l;d++)c(e.item(d));for(let l=o.length,d=0;d<l;d++){var a;(a=i.get(o[d]))===null||a===void 0||a.forEach((p,s)=>r.set(s,p))}function c(l){const d=e.getPropertyValue(l),p=e.getPropertyPriority(l),s=l.lastIndexOf("-"),h=s>-1?l.substring(0,s):void 0;if(h){let f=i.get(h);f||(f=new Map,i.set(h,f)),f.set(l,[d,p])}t.get(l)===d&&!p||(h?o.push(h):r.set(l,[d,p]))}return r}function _o(e,t,n,r){var o;const{ownerWindow:i,includeStyleProperties:a,currentParentNodeStyle:c}=r,l=t.style,d=i.getComputedStyle(e),p=Vt(e,null,r);c==null||c.forEach((m,u)=>{p.delete(u)});const s=Xt(d,p,a);if(s.delete("transition-property"),s.delete("all"),s.delete("d"),s.delete("content"),n&&(s.delete("position"),s.delete("margin-top"),s.delete("margin-right"),s.delete("margin-bottom"),s.delete("margin-left"),s.delete("margin-block-start"),s.delete("margin-block-end"),s.delete("margin-inline-start"),s.delete("margin-inline-end"),s.set("box-sizing",["border-box",""])),((o=s.get("background-clip"))===null||o===void 0?void 0:o[0])==="text"&&t.classList.add("______background-clip--text"),Pt){var h,f,b;s.has("font-kerning")||s.set("font-kerning",["normal",""]),(((h=s.get("overflow-x"))===null||h===void 0?void 0:h[0])==="hidden"||((f=s.get("overflow-y"))===null||f===void 0?void 0:f[0])==="hidden")&&((b=s.get("text-overflow"))===null||b===void 0?void 0:b[0])==="ellipsis"&&e.scrollWidth===e.clientWidth&&s.set("text-overflow",["clip",""])}for(let m=l.length,u=0;u<m;u++)l.removeProperty(l.item(u));return s.forEach(([m,u],y)=>{l.setProperty(y,m,u)}),s}function Ao(e,t){(Zr(e)||Jr(e)||to(e))&&t.setAttribute("value",e.value)}var Lo=["::before","::after"],No=["::-webkit-scrollbar","::-webkit-scrollbar-button","::-webkit-scrollbar-thumb","::-webkit-scrollbar-track","::-webkit-scrollbar-track-piece","::-webkit-scrollbar-corner","::-webkit-resizer"];function Io(e,t,n,r,o){const{ownerWindow:i,svgStyleElement:a,svgStyles:c,currentNodeStyle:l}=r;if(!a||!i)return;function d(p){var s;const h=i.getComputedStyle(e,p);let f=h.getPropertyValue("content");if(!f||f==="none")return;o==null||o(f),f=f.replace(/(')|(")|(counter\(.+\))/g,"");const b=[$t()],m=Vt(e,p,r);l==null||l.forEach((w,S)=>{m.delete(S)});const u=Xt(h,m,r.includeStyleProperties);u.delete("content"),u.delete("-webkit-locale"),((s=u.get("background-clip"))===null||s===void 0?void 0:s[0])==="text"&&t.classList.add("______background-clip--text");const y=[`content: '${f}';`];if(u.forEach(([w,S],k)=>{y.push(`${k}: ${w}${S?" !important":""};`)}),y.length===1)return;try{t.className=[t.className,...b].join(" ")}catch(w){r.log.warn("Failed to copyPseudoClass",w);return}const g=y.join(`
|
|
8
|
+
`);let v=c.get(g);v||(v=[],c.set(g,v)),v.push(`.${b[0]}${p}`)}Lo.forEach(d),n&&No.forEach(d)}var qt=new Set(["symbol"]);async function Gt(e,t,n,r,o){if(z(n)&&(Qr(n)||eo(n))||r.filter&&!r.filter(n))return;qt.has(t.nodeName)||qt.has(n.nodeName)?r.currentParentNodeStyle=void 0:r.currentParentNodeStyle=r.currentNodeStyle;const i=await Ze(n,r,!1,o);r.isEnable("restoreScrollPosition")&&Ro(e,i),t.appendChild(i)}async function Wt(e,t,n,r){let o=e.firstChild;if(z(e)&&e.shadowRoot){var i;o=(i=e.shadowRoot)===null||i===void 0?void 0:i.firstChild,n.shadowRoots.push(e.shadowRoot)}for(let a=o;a;a=a.nextSibling)if(!Wr(a))if(z(a)&&no(a)&&typeof a.assignedNodes=="function"){const c=a.assignedNodes();for(let l=0;l<c.length;l++)await Gt(e,t,c[l],n,r)}else await Gt(e,t,a,n,r)}function Ro(e,t){if(!le(e)||!le(t))return;const{scrollTop:n,scrollLeft:r}=e;if(!n&&!r)return;const{transform:o}=t.style,i=new DOMMatrix(o),{a,b:c,c:l,d}=i;i.a=1,i.b=0,i.c=0,i.d=1,i.translateSelf(-r,-n),i.a=a,i.b=c,i.c=l,i.d=d,t.style.transform=i.toString()}function Mo(e,t){const{backgroundColor:n,width:r,height:o,style:i}=t,a=e.style;if(n&&a.setProperty("background-color",n,"important"),r&&a.setProperty("width",`${r}px`,"important"),o&&a.setProperty("height",`${o}px`,"important"),i)for(const c in i)a[c]=i[c]}var Do=/^[\w-:]+$/;async function Ze(e,t,n=!1,r){const{ownerDocument:o,ownerWindow:i,fontFamilies:a,onCloneEachNode:c}=t;if(o&&Yr(e))return r&&/\S/.test(e.data)&&r(e.data),o.createTextNode(e.data);if(o&&i&&z(e)&&(le(e)||se(e))){var l,d;const f=await Eo(e,t);if(t.isEnable("removeAbnormalAttributes")){const v=f.getAttributeNames();for(let w=v.length,S=0;S<w;S++){const k=v[S];Do.test(k)||f.removeAttribute(k)}}const b=t.currentNodeStyle=_o(e,f,n,t);n&&Mo(f,t);let m=!1;if(t.isEnable("copyScrollbar")){var p,s;const v=[(p=b.get("overflow-x"))===null||p===void 0?void 0:p[0],(s=b.get("overflow-y"))===null||s===void 0?void 0:s[0]];m=v.includes("scroll")||(v.includes("auto")||v.includes("overlay"))&&(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)}const u=(l=b.get("text-transform"))===null||l===void 0?void 0:l[0],y=Ot((d=b.get("font-family"))===null||d===void 0?void 0:d[0]),g=y?v=>{u==="uppercase"?v=v.toUpperCase():u==="lowercase"?v=v.toLowerCase():u==="capitalize"&&(v=v[0].toUpperCase()+v.substring(1)),y.forEach(w=>{let S=a.get(w);S||a.set(w,S=new Set),v.split("").forEach(k=>S.add(k))})}:void 0;return Io(e,f,m,t,g),Ao(e,f),xe(e)||await Wt(e,f,t,g),await(c==null?void 0:c(f)),f}const h=e.cloneNode(!1);return await Wt(e,h,t),await(c==null?void 0:c(h)),h}function Po(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 Uo(e){const{url:t,timeout:n,responseType:r,...o}=e,i=new AbortController,a=n?setTimeout(()=>i.abort(),n):void 0;return fetch(t,{signal:i.signal,...o}).then(c=>{if(!c.ok)throw new Error("Failed fetch, not 2xx response",{cause:c});switch(r){case"arrayBuffer":return c.arrayBuffer();case"dataUrl":return c.blob().then(uo);default:return c.text()}}).finally(()=>clearTimeout(a))}function ue(e,t){const{url:n,requestType:r="text",responseType:o="text",imageDom:i}=t;let a=n;const{timeout:c,acceptOfImage:l,requests:d,fetchFn:p,fetch:{requestInit:s,bypassingCache:h,placeholderImage:f},font:b,workers:m,fontFamilies:u}=e;r==="image"&&(we||We)&&e.drawImageCount++;let y=d.get(n);if(!y){h&&h instanceof RegExp&&h.test(a)&&(a+=(/\?/.test(a)?"&":"?")+new Date().getTime());const g=r.startsWith("font")&&b&&b.minify,v=new Set;g&&r.split(";")[1].split(",").forEach(k=>{u.has(k)&&u.get(k).forEach(N=>v.add(N))});const w=g&&v.size,S={url:a,timeout:c,responseType:w?"arrayBuffer":o,headers:r==="image"?{accept:l}:void 0,...s};y={type:r,resolve:void 0,reject:void 0,response:null},y.response=(async()=>{if(p&&r==="image"){const k=await p(n);if(k)return k}return!we&&n.startsWith("http")&&m.length?new Promise((k,N)=>{m[d.size&m.length-1].postMessage({rawUrl:n,...S}),y.resolve=k,y.reject=N}):Uo(S)})().catch(k=>{if(d.delete(n),r==="image"&&f)return e.log.warn("Failed to fetch image base64, trying to use placeholder image",a),typeof f=="string"?f:f(i);throw k}),d.set(n,y)}return y.response}async function Yt(e,t,n,r){if(!Kt(e))return e;for(const[o,i]of Bo(e,t))try{const a=await ue(n,{url:i,requestType:r?"image":"text",responseType:"dataUrl"});e=e.replace(Fo(o),`$1${a}$3`)}catch(a){n.log.warn("Failed to fetch css data url",o,a)}return e}function Kt(e){return/url\((['"]?)([^'"]+?)\1\)/.test(e)}var Zt=/url\((['"]?)([^'"]+?)\1\)/g;function Bo(e,t){const n=[];return e.replace(Zt,(r,o,i)=>(n.push([i,Bt(i,t)]),r)),n.filter(([r])=>!Ye(r))}function Fo(e){const t=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${t})(['"]?\\))`,"g")}var $o=["background-image","border-image-source","-webkit-border-image","-webkit-mask-image","list-style-image"];function Oo(e,t){return $o.map(n=>{const r=e.getPropertyValue(n);return!r||r==="none"?null:((we||We)&&t.drawImageCount++,Yt(r,null,t,!0).then(o=>{!o||r===o||e.setProperty(n,o,e.getPropertyPriority(n))}))}).filter(Boolean)}function zo(e,t){if(J(e)){const n=e.currentSrc||e.src;if(!Ye(n))return[ue(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.srcset="",e.dataset.originalSrc=n,e.src=r||"")})];(we||We)&&t.drawImageCount++}else if(se(e)&&!Ye(e.href.baseVal)){const n=e.href.baseVal;return[ue(t,{url:n,imageDom:e,requestType:"image",responseType:"dataUrl"}).then(r=>{r&&(e.dataset.originalSrc=n,e.href.baseVal=r||"")})]}return[]}function jo(e,t){var n;const{ownerDocument:r,svgDefsElement:o}=t,i=(n=e.getAttribute("href"))!==null&&n!==void 0?n:e.getAttribute("xlink:href");if(!i)return[];const[a,c]=i.split("#");if(c){const l=`#${c}`,d=t.shadowRoots.reduce((p,s)=>p!=null?p:s.querySelector(`svg ${l}`),r==null?void 0:r.querySelector(`svg ${l}`));if(a&&e.setAttribute("href",l),o!=null&&o.querySelector(l))return[];if(d)return o==null||o.appendChild(d.cloneNode(!0)),[];if(a)return[ue(t,{url:a,responseType:"text"}).then(p=>{o==null||o.insertAdjacentHTML("beforeend",p)})]}return[]}function Jt(e,t){const{tasks:n}=t;z(e)&&((J(e)||Ut(e))&&n.push(...zo(e,t)),Gr(e)&&n.push(...jo(e,t))),le(e)&&n.push(...Oo(e.style,t)),e.childNodes.forEach(r=>{Jt(r,t)})}async function Ho(e,t){const{ownerDocument:n,svgStyleElement:r,fontFamilies:o,fontCssTexts:i,tasks:a,font:c}=t;if(!(!n||!r||!o.size))if(c&&c.cssText){const l=en(c.cssText,t);r.appendChild(n.createTextNode(`${l}
|
|
9
|
+
`))}else{const l=Array.from(n.styleSheets).filter(f=>{try{return"cssRules"in f&&!!f.cssRules.length}catch(b){return t.log.warn(`Error while reading CSS rules from ${f.href}`,b),!1}}),d=n.implementation.createHTMLDocument(""),p=d.createElement("style");d.head.appendChild(p);const s=p.sheet;await Promise.all(l.flatMap(f=>Array.from(f.cssRules).map(async b=>{if(Xr(b)){const m=b.href;let u="";try{u=await ue(t,{url:m,requestType:"text",responseType:"text"})}catch(g){t.log.warn(`Error fetch remote css import from ${m}`,g)}const y=u.replace(Zt,(g,v,w)=>g.replace(w,Bt(w,m)));for(const g of Xo(y))try{s.insertRule(g,s.cssRules.length)}catch(v){t.log.warn("Error inserting rule from remote css import",{rule:g,error:v})}}}))),s.cssRules.length&&l.push(s);const h=[];l.forEach(f=>{Je(f.cssRules,h)}),h.filter(f=>{var b;return Vr(f)&&Kt(f.style.getPropertyValue("src"))&&((b=Ot(f.style.getPropertyValue("font-family")))===null||b===void 0?void 0:b.some(m=>o.has(m)))}).forEach(f=>{const b=f,m=i.get(b.cssText);m?r.appendChild(n.createTextNode(`${m}
|
|
10
|
+
`)):a.push(Yt(b.cssText,b.parentStyleSheet?b.parentStyleSheet.href:null,t).then(u=>{u=en(u,t),i.set(b.cssText,u),r.appendChild(n.createTextNode(`${u}
|
|
11
|
+
`))}))})}}var Vo=/(\/\*[\s\S]*?\*\/)/g,Qt=/((@.*?keyframes [\s\S]*?){([\s\S]*?}\s*?)})/gi;function Xo(e){if(e==null)return[];const t=[];let n=e.replace(Vo,"");for(;;){const i=Qt.exec(n);if(!i)break;t.push(i[0])}n=n.replace(Qt,"");const r=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,o=new RegExp("((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})","gi");for(;;){let i=r.exec(n);if(i)o.lastIndex=r.lastIndex;else if(i=o.exec(n),i)r.lastIndex=o.lastIndex;else break;t.push(i[0])}return t}var qo=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,Go=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function en(e,t){const{font:n}=t,r=n?n==null?void 0:n.preferredFormat:void 0;return r?e.replace(Go,o=>{for(;;){const[i,,a]=qo.exec(o)||[];if(!a)return"";if(a===r)return`src: ${i};`}}):e}function Je(e,t=[]){for(const n of Array.from(e))qr(n)?t.push(...Je(n.cssRules)):"cssRules"in n?Je(n.cssRules,t):t.push(n);return t}var Wo=/\bx?link:?href\s*=\s*["'](?!data:)[^"']+["']/i;function Yo(e){return Wo.test(e.innerHTML)}async function Ko(e,t){const n=await Ke(e,t);if(z(n.node)&&se(n.node)&&!Yo(n.node))return n.node;const{ownerDocument:r,log:o,tasks:i,svgStyleElement:a,svgDefsElement:c,svgStyles:l,font:d,progress:p,autoDestruct:s,onCloneNode:h,onEmbedNode:f,onCreateForeignObjectSvg:b}=n;o.time("clone node");const m=await Ze(n.node,n,!0);if(a&&r){let w="";l.forEach((S,k)=>{w+=`${S.join(`,
|
|
12
|
+
`)} {
|
|
13
|
+
${k}
|
|
14
|
+
}
|
|
15
|
+
`}),a.appendChild(r.createTextNode(w))}o.timeEnd("clone node"),await(h==null?void 0:h(m)),d!==!1&&z(m)&&(o.time("embed web font"),await Ho(m,n),o.timeEnd("embed web font")),o.time("embed node"),Jt(m,n);const u=i.length;let y=0;const g=async()=>{for(;;){const w=i.pop();if(!w)break;try{await w}catch(S){n.log.warn("Failed to run task",S)}p==null||p(++y,u)}};p==null||p(y,u),await Promise.all([...Array.from({length:4})].map(g)),o.timeEnd("embed node"),await(f==null?void 0:f(m));const v=Zo(m,n);return c&&v.insertBefore(c,v.children[0]),a&&v.insertBefore(a,v.children[0]),s&&Po(n),await(b==null?void 0:b(v)),v}function Zo(e,t){const{width:n,height:r}=t,o=ao(n,r,e.ownerDocument),i=o.ownerDocument.createElementNS(o.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),o.appendChild(i),o}async function Jo(e,t){const n=await Ke(e,t),r=await Ko(n),o=so(r,n.isEnable("removeControlCharacter"));if(!n.autoDestruct){var i;n.svgStyleElement=jt(n.ownerDocument),n.svgDefsElement=(i=n.ownerDocument)===null||i===void 0?void 0:i.createElementNS(Ee,"defs"),n.svgStyles.clear()}return await go(Q(o,r.ownerDocument),n)}async function Qo(e,t){const n=await Ke(e,t),{log:r,type:o,quality:i,dpi:a}=n,c=await Jo(n);r.time("canvas to blob");const l=await lo(c,o,i);if(["image/png","image/jpeg"].includes(o)&&a){const d=await fo(l.slice(0,33));let p=new Uint8Array(d);return o==="image/png"?p=Or(p,a):o==="image/jpeg"&&(p=Ur(p,a)),r.timeEnd("canvas to blob"),new Blob([p,l.slice(33)],{type:o})}return r.timeEnd("canvas to blob"),l}var Ha="•",ei=32,ti=new Set(["button","submit","reset","checkbox","radio","range","color","file","image","hidden"]);function Qe(e){const t=Math.min(Math.max(e,1),ei);return"•".repeat(t)}function ni(e){for(const r of Array.from(e.querySelectorAll("input"))){var t;const o=((t=r.getAttribute("type"))!==null&&t!==void 0?t:"text").toLowerCase();if(ti.has(o))continue;const i=r.value;if(!i)continue;const a=Qe(i.length);r.value=a,r.setAttribute("value",a)}for(const r of Array.from(e.querySelectorAll("textarea"))){const o=r.value||r.textContent||"";if(!o)continue;const i=Qe(o.length);r.value=i,r.textContent=i,r.setAttribute("value",i)}for(const r of Array.from(e.querySelectorAll("[contenteditable]"))){var n;if(r.getAttribute("contenteditable")==="false")continue;const o=(n=r.textContent)!==null&&n!==void 0?n:"";o.trim()&&(r.textContent=Qe(o.length))}}var ri={"image/png":"png","image/jpeg":"jpg","image/webp":"webp","image/gif":"gif"};function tn(e){var t;return(t=ri[e])!==null&&t!==void 0?t:"png"}function nn(e,t,n){const r=e==null?void 0:e[`inner${n}`],o=t.documentElement[`client${n}`];return Math.max(1,Math.round((typeof r=="number"&&r>0?r:o)||0)||1)}var oi=6e3,ii=(e,t)=>Qo(e,{width:t.width,height:t.height,type:t.type,timeout:oi,filter:t.filter,onCloneNode:t.onCloneNode});async function rn(e={}){try{var t,n,r,o,i,a;const c=(t=e.doc)!==null&&t!==void 0?t:document,l=(n=(r=e.win)!==null&&r!==void 0?r:c.defaultView)!==null&&n!==void 0?n:void 0,d=(o=e.target)!==null&&o!==void 0?o:c.documentElement,p=(i=e.type)!==null&&i!==void 0?i:"image/png",s=nn(l,c,"Width"),h=nn(l,c,"Height"),f=await((a=e.capture)!==null&&a!==void 0?a:ii)(d,{width:s,height:h,type:p,filter:b=>!Fn(b),onCloneNode:b=>ni(b)});return f?{blob:f,width:s,height:h,type:p}:null}catch{return null}}function de(e){"@babel/helpers - typeof";return de=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},de(e)}function ai(e,t){if(de(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||"default");if(de(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function si(e){var t=ai(e,"string");return de(t)=="symbol"?t:t+""}function ee(e,t,n){return(t=si(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Va=60;function li(e,t){if(e==null)return 60;const n=e.trim();if(n==="")return 60;if(/^\d+$/.test(n))return Number(n);const r=Date.parse(n);return Number.isNaN(r)?60:Math.max(0,Math.ceil((r-t)/1e3))}var ci=class{constructor(e=Date.now){ee(this,"now",void 0),ee(this,"pausedUntil",0),this.now=e}isPaused(){return this.now()<this.pausedUntil}retryAfterSeconds(){return Math.max(0,Math.ceil((this.pausedUntil-this.now())/1e3))}hold(e){const t=this.now(),n=li(e,t),r=t+n*1e3;return r>this.pausedUntil&&(this.pausedUntil=r),n}},ui="screenshot",di=new ci;function fi(e){return`${e.replace(/\/+$/,"")}/api/ingest/feedback`}function pi(e){if(!e)return{};const t={};return e.signedIdentity&&(t.signedIdentity=e.signedIdentity),e.reporterId&&(t.reporterId=e.reporterId),e.anonymousId&&(t.anonymousId=e.anonymousId),t}async function on(e,t,n=fetch,r=di){var o,i;const a=(o=t.content.source)!==null&&o!==void 0?o:"reporter",c=a==="auto";if(c&&r.isPaused())return{ok:!1,reason:"backpressure",retryAfterSeconds:r.retryAfterSeconds()};const l={key:t.key,...pi(t.identity),...t.content,source:a},d=new FormData;if(d.append("payload",JSON.stringify(l)),!((i=t.screenshot)===null||i===void 0)&&i.blob){var p;d.append(ui,t.screenshot.blob,(p=t.screenshot.filename)!==null&&p!==void 0?p:"screenshot.png")}let s;try{s=await n(fi(e),{method:"POST",body:d})}catch{return{ok:!1,reason:"unreachable"}}if(!s.ok)return c&&s.status===429?{ok:!1,reason:"backpressure",retryAfterSeconds:r.hold(s.headers.get("Retry-After"))}:{ok:!1,reason:"refused",status:s.status};try{return{ok:!0,feedback:await s.json()}}catch{return{ok:!0,feedback:null}}}var Se="0.3.0",Xa=5,bi=2e3,qa=20,hi=5,mi=5;function vi(e){if(!e||e.length===0)return[];const t=[];for(let r=e.length-1;r>=0&&t.length<mi;r-=1){var n;const o=(n=e[r])===null||n===void 0?void 0:n.id;typeof o=="string"&&o.length>0&&t.unshift(o)}return t}var gi=/[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,yi=/\bhttps?:\/\/[^\s"')]+/gi,wi=/\b0x[0-9a-f]+\b/gi,xi=/\b[0-9a-f]{8,}\b/gi,ki=/\d{4,}/g;function Ei(e){return typeof e!="string"||e.length===0?"":e.replace(gi,"<uuid>").replace(yi,"<url>").replace(wi,"<hex>").replace(xi,"<hex>").replace(ki,"<n>").trim()}function Si(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return(t>>>0).toString(36)}function et(e){const t=e.replace(/\?[^:]*/,""),n=t.lastIndexOf("/");return n>=0?t.slice(n+1):t}function Ti(e){var t,n,r;const o=e.match(/^at\s+(.+?)\s+\((.+)\)$/);if(o)return`${(t=o[1])!==null&&t!==void 0?t:""}@${et((n=o[2])!==null&&n!==void 0?n:"")}`;const i=e.match(/^at\s+(.+)$/);if(i)return`@${et((r=i[1])!==null&&r!==void 0?r:"")}`;const a=e.indexOf("@");return a>=0?`${e.slice(0,a)}@${et(e.slice(a+1))}`:null}function Ci(e,t=hi){if(typeof e!="string"||e.length===0)return"";const n=[];for(const r of e.split(`
|
|
16
|
+
`)){const o=Ti(r.trim());if(o&&(n.push(o),n.length>=t))break}return n.join(" < ")}function _i(e,t,n){return Si(`${e}|${Ei(t)}|${Ci(n)}`)}var Ai=class{constructor(e){var t;ee(this,"options",void 0),ee(this,"tokens",void 0),ee(this,"last",void 0),ee(this,"now",void 0),this.options=e,this.now=(t=e.now)!==null&&t!==void 0?t:Date.now,this.tokens=Math.max(0,e.capacity),this.last=this.now()}take(){const e=this.now(),{capacity:t,refillIntervalMs:n}=this.options;if(n>0&&e>this.last){const r=Math.floor((e-this.last)/n);r>0&&(this.tokens=Math.min(t,this.tokens+r),this.last+=r*n)}return this.tokens>=1?(this.tokens-=1,!0):!1}};function q(e){if(typeof e=="string")return e;if(e==null)return"";try{return String(e)}catch{return""}}function Li(e){const t=e,n=t.error;if(n&&typeof n=="object"){const o=n;return{type:q(o.name)||"Error",value:q(o.message)||q(t.message),stack:typeof o.stack=="string"?o.stack:void 0,original:n}}const r=q(t.message);return r?{type:"Error",value:r,original:r}:null}function Ni(e){const t=e.reason;if(t&&typeof t=="object"){const r=t;return{type:q(r.name)||"UnhandledRejection",value:q(r.message)||q(t),stack:typeof r.stack=="string"?r.stack:void 0,original:t}}const n=q(t);return{type:"UnhandledRejection",value:n,original:t!=null?t:n}}var Ii={destroy:()=>{},droppedCount:()=>0};function Ri(e){var t,n,r,o,i,a,c,l,d,p,s,h;const f=(t=e.win)!==null&&t!==void 0?t:typeof window!="undefined"?window:void 0;if(!f)return Ii;const b=f,m=(n=(r=e.doc)!==null&&r!==void 0?r:b.document)!==null&&n!==void 0?n:typeof document!="undefined"?document:void 0,u=(o=e.now)!==null&&o!==void 0?o:Date.now,y=(i=e.sdkVersion)!==null&&i!==void 0?i:Se,g=(a=e.maxDistinct)!==null&&a!==void 0?a:20,v=(c=(l=e.deps)===null||l===void 0?void 0:l.captureView)!==null&&c!==void 0?c:rn,w=(d=(p=e.deps)===null||p===void 0?void 0:p.submitReport)!==null&&d!==void 0?d:on,S=new Ai({capacity:(s=e.burstCapacity)!==null&&s!==void 0?s:5,refillIntervalMs:(h=e.burstRefillMs)!==null&&h!==void 0?h:bi,now:u}),k=new Map;let N=0;function T(R,I,F){var M,O;return{...Lt({kind:"bug",url:(M=b.location)===null||M===void 0?void 0:M.href,environment:At(b,y),trace:F.trace?(O=e.buffer)===null||O===void 0?void 0:O.snapshot():void 0}),source:"auto",errorSignature:R,occurrences:I}}async function U(R,I,F){const M=k.get(R);if(!M)return;const O=M.sentCount;M.sentCount=I;try{const K=T(R,I,F),Z=bt(K,{hook:e.beforeSend,scrub:e.scrub});if(!Z)return;let pe=null;if(F.screenshot){const ne=await v({doc:m,win:b});pe=ne?{blob:ne.blob,filename:`screenshot.${tn(ne.type)}`}:null}!(await w(e.apiUrl,{key:e.key,identity:e.identity,content:Z,screenshot:pe})).ok&&M.sentCount===I&&(M.sentCount=O)}catch{M.sentCount===I&&(M.sentCount=O)}}function x(R){const I=_i(R.type,R.value,R.stack),F=k.get(I);if(F){F.count+=1,F.lastAt=u();return}if(!S.take()){N+=1;return}if(k.size>=g){N+=1;return}const M=u();k.set(I,{count:1,firstAt:M,lastAt:M,sentCount:0});try{var O,K;const Z=vi((O=e.buffer)===null||O===void 0?void 0:O.snapshot());(K=e.buffer)===null||K===void 0||K.add(vr(R.original,M,Z))}catch{}U(I,1,{screenshot:!0,trace:!0})}const L=R=>{try{const I=Li(R);I&&x(I)}catch{}},$=R=>{try{const I=Ni(R);I&&x(I)}catch{}},D=()=>{try{for(const[R,I]of k)I.count>I.sentCount&&U(R,I.count,{screenshot:!1,trace:!1})}catch{}},fe=()=>{(m==null?void 0:m.visibilityState)==="hidden"&&D()};return b.addEventListener("error",L,!0),b.addEventListener("unhandledrejection",$,!0),b.addEventListener("pagehide",D),m==null||m.addEventListener("visibilitychange",fe),{destroy:()=>{b.removeEventListener("error",L,!0),b.removeEventListener("unhandledrejection",$,!0),b.removeEventListener("pagehide",D),m==null||m.removeEventListener("visibilitychange",fe)},droppedCount:()=>N}}var an="fixback.anonymousId";function sn(){const e=globalThis.crypto;return e&&typeof e.randomUUID=="function"?e.randomUUID():`fb-${Date.now().toString(36)}-${Math.random().toString(36).slice(2,10)}`}function Mi(){try{const e=globalThis.localStorage,t=e.getItem(an);if(t)return t;const n=sn();return e.setItem(an,n),n}catch{return sn()}}var ln="fixback_invite",Di="fixback:reporter:";function Pi(e){try{const t=new URL(e).searchParams.get(ln);return t&&t.length>0?t:null}catch{return null}}function Ui(e){try{const t=new URL(e.location.href);if(!t.searchParams.has("fixback_invite"))return;t.searchParams.delete(ln);const n=t.searchParams.toString(),r=`${t.pathname}${n?`?${n}`:""}${t.hash}`;e.history.replaceState(e.history.state,"",r)}catch{}}function cn(e){return`${Di}${e}`}function un(){try{var e;return(e=globalThis.localStorage)!==null&&e!==void 0?e:null}catch{return null}}function Te(e){if(typeof e!="string")return;const t=e.trim();return t.length>0?t:void 0}function Bi(e,t,n=un()){if(!n)return;const r=Te(t.name),o=Te(t.email),i={reporterId:t.reporterId,...r?{name:r}:{},...o?{email:o}:{}};try{n.setItem(cn(e),JSON.stringify(i))}catch{}}function dn(e,t=un()){if(!t)return null;try{const n=t.getItem(cn(e));if(!n)return null;const r=JSON.parse(n);if(typeof(r==null?void 0:r.reporterId)!="string"||r.reporterId.length===0)return null;const o=Te(r.name),i=Te(r.email);return{reporterId:r.reporterId,...o?{name:o}:{},...i?{email:i}:{}}}catch{return null}}function fn(e,t){return`${e.replace(/\/+$/,"")}/api/invites/${encodeURIComponent(t)}`}function Fi(e,t){return`${fn(e,t)}/redeem`}var pn=new Set(["revoked","expired","exhausted","not_found"]);function bn(e){return e==="public"||e==="invited"||e==="internal"}function $i(e){if(typeof e!="object"||e===null)return!1;const t=e;return t.status==="pending"?typeof t.projectId=="string"&&(t.kind==="targeted"||t.kind==="shared")&&bn(t.tier):typeof t.status=="string"&&pn.has(t.status)}function Oi(e){if(typeof e!="object"||e===null)return!1;const t=e;return t.status==="redeemed"?typeof t.reporterId=="string"&&typeof t.projectId=="string"&&bn(t.tier):typeof t.status=="string"&&pn.has(t.status)}async function hn(e){try{return await e.json()}catch{return null}}async function zi(e,t,n=fetch){let r;try{r=await n(fn(e,t),{method:"GET",headers:{accept:"application/json"}})}catch{return null}const o=await hn(r);return $i(o)?o:null}async function ji(e,t,n=fetch){let r;try{r=await n(Fi(e,t),{method:"POST",headers:{accept:"application/json"}})}catch{return null}const o=await hn(r);return Oi(o)?o:null}var Hi=`
|
|
3
17
|
:host {
|
|
4
18
|
/* Vendored Signal tokens (packages/ui/src/tokens.css). */
|
|
5
19
|
--fb-color-accent: #2f6fed;
|
|
@@ -245,7 +259,7 @@
|
|
|
245
259
|
animation: none;
|
|
246
260
|
}
|
|
247
261
|
}
|
|
248
|
-
`,
|
|
262
|
+
`,mn="data-fixback-root",Ce="fixback:launch",Vi="fixback:welcomed:",Xi=5e3,qi=4400,Gi=280,Wi='<svg class="fb-launcher__icon" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M3.25 2h9.5A1.25 1.25 0 0 1 14 3.25v6.5A1.25 1.25 0 0 1 12.75 11H7.6l-3.19 2.55A.6.6 0 0 1 3.4 13.1V11h-.15A1.25 1.25 0 0 1 2 9.75v-6.5A1.25 1.25 0 0 1 3.25 2Z"/></svg>',Yi='<svg class="fb-launcher__tuck-icon" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.9" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true" focusable="false"><path d="M4 6l4 4 4-4"/></svg>';function Ki(e,t){const n=Vi+(t!=null?t:"default");try{const r=e==null?void 0:e.localStorage;return r?r.getItem(n)==="1"?!1:(r.setItem(n,"1"),!0):!0}catch{return!0}}function Zi(e,t={}){const n=e.ownerDocument,r=n.defaultView,o=n.querySelector(`[${mn}]`);o&&o.remove();const i=n.createElement("div");i.setAttribute(mn,""),i.style.cssText="position:fixed;right:20px;bottom:20px;z-index:2147483000;margin:0;padding:0;border:0;",t.reduceMotion&&i.setAttribute("data-fb-reduce-motion","true");const a=i.attachShadow({mode:"open"}),c=n.createElement("style");c.textContent=Hi,a.appendChild(c);const l=n.createElement("div");l.className="fb-launcher";const d=n.createElement("button");d.type="button",d.className="fb-launcher__button",d.setAttribute("aria-haspopup","dialog"),d.setAttribute("aria-label","Give feedback"),d.innerHTML=`${Wi}<span class="fb-launcher__label">Feedback</span>`,d.addEventListener("click",()=>{i.dispatchEvent(new CustomEvent(Ce,{bubbles:!0,composed:!0}))});const p=n.createElement("span");p.className="fb-launcher__divider",p.setAttribute("aria-hidden","true");const s=n.createElement("button");s.type="button",s.className="fb-launcher__tuck",s.setAttribute("data-fb-tuck",""),s.setAttribute("aria-label","Hide feedback button"),s.title="Tuck away — hover the corner to bring it back",s.innerHTML=Yi,l.append(d,p,s);const h=n.createElement("div");h.className="fb-launcher__peekzone",h.setAttribute("aria-hidden","true");const f=n.createElement("div");f.className="fb-launcher__nub",f.setAttribute("role","button"),f.setAttribute("tabindex","0"),f.setAttribute("aria-label","Show feedback button"),a.append(l,h,f);let b=!1,m=!1,u,y,g,v,w;const S=()=>{b?i.setAttribute("data-fb-hidden","true"):i.removeAttribute("data-fb-hidden"),b&&m?i.setAttribute("data-fb-peeking","true"):i.removeAttribute("data-fb-peeking")},k=()=>{y!==void 0&&(clearTimeout(y),y=void 0),l.classList.remove("fb-launcher--pulse"),v==null||v.remove(),v=void 0},N=()=>{g!==void 0&&(clearTimeout(g),g=void 0),w==null||w.remove(),w=void 0},T=()=>{u!==void 0&&(clearTimeout(u),u=void 0),m||(m=!0,S())},U=()=>{u!==void 0&&clearTimeout(u),u=setTimeout(()=>{u=void 0,m=!1,S()},Gi)};for(const D of[l,h,f])D.addEventListener("mouseenter",T),D.addEventListener("mouseleave",U);const x=()=>{u!==void 0&&(clearTimeout(u),u=void 0),b=!1,m=!1,S(),N()},L=()=>{k(),b=!0,m=!1,S(),N(),w=n.createElement("div"),w.className="fb-launcher__hint",w.setAttribute("role","status"),w.textContent="Tucked away down here. Hover the bottom-right corner and I'll bring it back.",a.appendChild(w),g=setTimeout(N,qi)};return s.addEventListener("click",L),f.addEventListener("click",x),f.addEventListener("keydown",D=>{(D.key==="Enter"||D.key===" "||D.key==="Spacebar")&&(D.preventDefault(),x())}),Ki(r,t.key)&&(v=n.createElement("div"),v.className="fb-launcher__welcome",v.setAttribute("role","status"),v.innerHTML="You're all set — tap <strong>Feedback</strong> any time to report something.",a.appendChild(v),t.reduceMotion||l.classList.add("fb-launcher--pulse"),y=setTimeout(k,Xi)),e.appendChild(i),{host:i,dispose:()=>{u!==void 0&&clearTimeout(u),y!==void 0&&clearTimeout(y),g!==void 0&&clearTimeout(g)}}}function Ji(e){e.dispose(),e.host.remove()}var Qi=`
|
|
249
263
|
:host {
|
|
250
264
|
--fb-color-accent: #2f6fed;
|
|
251
265
|
--fb-color-accent-hover: #245fd0;
|
|
@@ -439,7 +453,7 @@
|
|
|
439
453
|
@media (prefers-reduced-motion: reduce) {
|
|
440
454
|
.fb-ob-backdrop, .fb-ob-panel { animation: none; }
|
|
441
455
|
}
|
|
442
|
-
`,
|
|
456
|
+
`,ea="data-fixback-onboard",ta={invited:"Invited tester",internal:"Internal",public:"Public"},na={invited:"reviewed before it ships",internal:"ships straight through",public:"tracked, not auto-shipped"},ra='<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="#2f9e5b" stroke-width="1.5" aria-hidden="true"><path d="M8 1.8 13.5 4v3.5c0 3.6-2.4 5.6-5.5 6.7C4.9 13.1 2.5 11.1 2.5 7.5V4z"/><path d="M5.8 8 7.3 9.5 10.3 6.2"/></svg>';function _(e,t,n={},r=[]){const o=e.createElement(t);for(const[i,a]of Object.entries(n))a!==void 0&&o.setAttribute(i,a);for(const i of r)o.appendChild(typeof i=="string"?e.createTextNode(i):i);return o}function _e(e){const t=e.trim();return t.length>0?t:void 0}function oa(e){var t,n,r,o,i,a;const c=(t=e.target)!==null&&t!==void 0?t:document.body,l=(n=e.doc)!==null&&n!==void 0?n:c.ownerDocument;(r=l.querySelector("[data-fixback-onboard]"))===null||r===void 0||r.remove();const d=_(l,"div",{[ea]:""}),p=d.attachShadow({mode:"open"}),s=l.createElement("style");s.textContent=Qi,p.appendChild(s);const h=_(l,"div",{class:"fb-ob-head"},[_(l,"span",{class:"fb-ob-mark"}),_(l,"span",{class:"fb-ob-brand"},["Fixback"]),_(l,"span",{class:"fb-ob-chip"},["invite link"])]),f=_(l,"p",{class:"fb-ob-lede"},["You've been invited to give feedback on ",_(l,"strong",{},[e.origin]),". Point, mark up, send."]),b=_(l,"div",{class:"fb-ob-card"},[_(l,"div",{class:"fb-ob-row"},[_(l,"span",{class:"fb-ob-rowlabel"},["SITE"]),_(l,"span",{class:"fb-ob-site"},[e.origin])]),_(l,"div",{class:"fb-ob-row"},[_(l,"span",{class:"fb-ob-rowlabel"},["ACCESS"]),_(l,"span",{class:"fb-ob-tier"},[ta[e.tier]]),_(l,"span",{class:"fb-ob-tiernote"},[na[e.tier]])])]),m=_(l,"input",{class:"fb-ob-input fb-ob-name",type:"text","aria-label":"Name",placeholder:"Name"}),u=_(l,"input",{class:"fb-ob-input fb-ob-email",type:"email","aria-label":"Email",placeholder:"email@example.com"});!((o=e.defaults)===null||o===void 0)&&o.name&&(m.value=e.defaults.name),!((i=e.defaults)===null||i===void 0)&&i.email&&(u.value=e.defaults.email);const y=_(l,"div",{class:"fb-ob-privacy"}),g=_(l,"span");g.innerHTML=ra,y.appendChild((a=g.firstChild)!==null&&a!==void 0?a:l.createTextNode("")),y.appendChild(_(l,"span",{},[_(l,"strong",{},["Private by default."])," Anything you type is masked before it leaves your browser."]));const v=_(l,"div",{class:"fb-ob-body"},[_(l,"div",{class:"fb-ob-title"},["You're invited to give feedback"]),f,b,_(l,"label",{class:"fb-ob-fieldlabel",for:"fb-ob-name-input"},["Continue as"]),_(l,"div",{class:"fb-ob-fields"},[m,u]),y]);m.id="fb-ob-name-input";const w=_(l,"button",{type:"button",class:"fb-ob-confirm"},["Start giving feedback"]),S=_(l,"div",{class:"fb-ob-backdrop"},[_(l,"div",{class:"fb-ob-panel",role:"dialog","aria-modal":"true","aria-label":"Fixback invite"},[h,v,_(l,"div",{class:"fb-ob-foot"},[w])])]);p.appendChild(S);let k=!1;return w.addEventListener("click",()=>{if(k)return;k=!0,w.disabled=!0;const N={..._e(m.value)?{name:_e(m.value)}:{},..._e(u.value)?{email:_e(u.value)}:{}};e.onConfirm(N)}),c.appendChild(d),{host:d,destroy:()=>d.remove()}}var ia="http://www.w3.org/2000/svg",tt="3",vn=4,aa='600 16px "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif';function sa(e){var t,n;const r=(t=e.doc)!==null&&t!==void 0?t:document,{svg:o,textInput:i}=e,a=(n=e.color)!==null&&n!==void 0?n:Mr;let c="arrow",l=e.initialMarks?e.initialMarks.slice():[],d=null,p=!1,s=null,h=!1;function f(){var x;(x=e.onChange)===null||x===void 0||x.call(e,l.slice())}function b(x){return{x:Math.round(x.clientX),y:Math.round(x.clientY)}}function m(x){const L=typeof x.composedPath=="function"?x.composedPath():[x.target];for(const $ of L){if($===r)break;if($ instanceof Element){const D=$.tagName;if(D==="BUTTON"||D==="INPUT"||D==="TEXTAREA")return!0}}return!1}function u(x){return x.type==="pen"?x.points.length>1:x.type==="text"?x.text.trim().length>0:Math.abs(x.x1-x.x0)>vn||Math.abs(x.y1-x.y0)>vn}function y(x){if(h||p||m(x))return;const L=b(x);if(c==="text"){w(L);return}x.cancelable&&x.preventDefault(),p=!0,d=c==="pen"?{type:"pen",points:[L],color:a}:{type:c,x0:L.x,y0:L.y,x1:L.x,y1:L.y,color:a},T()}function g(x){if(h||!p||!d)return;const L=b(x);d.type==="pen"?d={type:"pen",points:[...d.points,L],color:d.color}:d={...d,x1:L.x,y1:L.y},T()}function v(){if(h||!p)return;p=!1;const x=d;d=null,x&&u(x)&&(l=[...l,x],f()),T()}function w(x){s=x,i.value="",i.style.display="block",i.style.left=`${x.x}px`,i.style.top=`${x.y}px`,i.onkeydown=S,i.onblur=k,setTimeout(()=>{try{i.focus()}catch{}},0)}function S(x){x.key==="Enter"?(x.preventDefault(),x.stopPropagation(),k()):x.key==="Escape"&&(x.preventDefault(),x.stopPropagation(),N())}function k(){if(!s)return;const x=i.value.trim(),L=s;N(),x.length>0&&(l=[...l,{type:"text",x:L.x,y:L.y,text:x,color:a}],f(),T())}function N(){s=null,i.onkeydown=null,i.onblur=null,i.value="",i.style.display="none"}function T(){for(;o.firstChild;)o.removeChild(o.firstChild);for(const x of l)o.appendChild(gn(r,x));d&&o.appendChild(gn(r,d))}function U(){h||(h=!0,r.removeEventListener("mousedown",y,!0),r.removeEventListener("mousemove",g,!0),r.removeEventListener("mouseup",v,!0),N())}return r.addEventListener("mousedown",y,!0),r.addEventListener("mousemove",g,!0),r.addEventListener("mouseup",v,!0),T(),{setTool:x=>{c=x},getTool:()=>c,undo:()=>{l.length!==0&&(l=l.slice(0,-1),f(),T())},marks:()=>l.slice(),stop:U}}function gn(e,t){switch(t.type){case"box":return te(e,"rect",{x:String(Math.min(t.x0,t.x1)),y:String(Math.min(t.y0,t.y1)),width:String(Math.abs(t.x1-t.x0)),height:String(Math.abs(t.y1-t.y0)),rx:"2",fill:"none",stroke:t.color,"stroke-width":tt});case"pen":return te(e,"polyline",{points:t.points.map(n=>`${n.x},${n.y}`).join(" "),fill:"none",stroke:t.color,"stroke-width":tt,"stroke-linecap":"round","stroke-linejoin":"round"});case"text":{const n=te(e,"text",{x:String(t.x),y:String(t.y),fill:t.color,style:`font:${aa}`});return n.textContent=t.text,n}case"arrow":{const n=te(e,"g",{});n.appendChild(te(e,"line",{x1:String(t.x0),y1:String(t.y0),x2:String(t.x1),y2:String(t.y1),stroke:t.color,"stroke-width":tt,"stroke-linecap":"round"}));const r=Dr(t.x0,t.y0,t.x1,t.y1);return n.appendChild(te(e,"polygon",{points:r.map(o=>`${o.x},${o.y}`).join(" "),fill:t.color})),n}}}function te(e,t,n){const r=e.createElementNS(ia,t);for(const[o,i]of Object.entries(n))r.setAttribute(o,i);return r}var la=12;function ca(e){var t,n;const r=(t=e.doc)!==null&&t!==void 0?t:document,o=(n=e.minSize)!==null&&n!==void 0?n:la;let i=null,a=!1;function c(h){a||i||(i={x:h.clientX,y:h.clientY},h.cancelable&&h.preventDefault())}function l(h){var f;a||!i||(f=e.onProgress)===null||f===void 0||f.call(e,_t(i.x,i.y,h.clientX,h.clientY))}function d(h){if(a||!i)return;const f=_t(i.x,i.y,h.clientX,h.clientY);if(i=null,s(),f.width<o||f.height<o){var b;(b=e.onCancel)===null||b===void 0||b.call(e);return}e.onComplete(f)}function p(h){if(!a&&h.key==="Escape"){var f;h.preventDefault(),s(),(f=e.onCancel)===null||f===void 0||f.call(e)}}function s(){a||(a=!0,r.removeEventListener("mousedown",c,!0),r.removeEventListener("mousemove",l,!0),r.removeEventListener("mouseup",d,!0),r.removeEventListener("keydown",p,!0),i=null)}return r.addEventListener("mousedown",c,!0),r.addEventListener("mousemove",l,!0),r.addEventListener("mouseup",d,!0),r.addEventListener("keydown",p,!0),{stop:s}}var ua=`
|
|
443
457
|
:host {
|
|
444
458
|
--fb-color-accent: #2f6fed;
|
|
445
459
|
--fb-color-accent-hover: #245fd0;
|
|
@@ -788,6 +802,6 @@
|
|
|
788
802
|
@media (prefers-reduced-motion: reduce) {
|
|
789
803
|
.fb-ov-highlight { transition: none; }
|
|
790
804
|
}
|
|
791
|
-
`,ko="data-fixback-overlay",Eo="http://www.w3.org/2000/svg",_o=[{value:"bug",label:"Bug"},{value:"improvement",label:"Improve"},{value:"idea",label:"Idea"}],So=[{tool:"arrow",label:"Arrow"},{tool:"box",label:"Box"},{tool:"pen",label:"Pen"},{tool:"text",label:"Text label"}],at=1800;function x(e,t,n={},o=[]){const i=e.createElement(t);for(const[r,s]of Object.entries(n))s!==void 0&&i.setAttribute(r,s);for(const r of o)i.appendChild(typeof r=="string"?e.createTextNode(r):r);return i}function F(e,t,n={},o=[]){const i=e.createElementNS(Eo,t);for(const[r,s]of Object.entries(n))i.setAttribute(r,s);for(const r of o)i.appendChild(r);return i}function To(e){var t,n,o,i,r,s,f,l,d,h;const a=(t=e.doc)!==null&&t!==void 0?t:document,b=(n=(o=e.win)!==null&&o!==void 0?o:a.defaultView)!==null&&n!==void 0?n:window,u=(i=e.sdkVersion)!==null&&i!==void 0?i:ae,m={captureView:(r=(s=e.deps)===null||s===void 0?void 0:s.captureView)!==null&&r!==void 0?r:Xe,submitReport:(f=(l=e.deps)===null||l===void 0?void 0:l.submitReport)!==null&&f!==void 0?f:Ge,startElementPicker:(d=(h=e.deps)===null||h===void 0?void 0:h.startElementPicker)!==null&&d!==void 0?d:Rt};let p=null,c=null,T=null,C=null,w=null,_=null,N=null,M=!1,A="compose";const y={kind:"bug",selectedElement:null,region:null,marks:[],phase:"compose"};function D(g,E){c&&(c.status.textContent=g,c.status.classList.toggle("is-error",E))}function v(g){if(y.kind=g,!!c)for(const[E,P]of c.tabs){const U=E===g;P.classList.toggle("is-active",U),P.setAttribute("aria-pressed",String(U))}}function S(g){if(A=g,!c)return;const E=g!=="compose";c.panel.classList.toggle("is-marking",E),c.pickLayer.classList.toggle("is-visible",g==="picking"),c.captureLayer.classList.toggle("is-visible",g==="capturing"),c.drawLayer.classList.toggle("is-visible",g==="drawing"),c.pickBtn.classList.toggle("is-active",g==="picking"),c.captureBtn.classList.toggle("is-active",g==="capturing"||g==="drawing")}function O(){if(!c)return;const g=!!y.selectedElement,E=!!y.region,P=y.marks.length;c.mark.classList.toggle("has-element",g),c.selector.textContent=g?y.selectedElement.selector:"",c.pickBtn.textContent="",c.pickBtn.append(Co(a),a.createTextNode(g?"Change element":"Pick element")),c.captureBtn.classList.toggle("is-attached",E||P>0);const U=[];g&&U.push("Element"),E&&U.push("Region"),P>0&&U.push(`${P} mark${P===1?"":"s"}`),c.caption.textContent=U.length?`${U.join(" · ")} · masked screenshot on Send`:"Masked screenshot attached on Send"}function $(g){if(!c)return;if(!g){c.highlight.style.display="none";return}const E=g.getBoundingClientRect();c.highlight.style.display="block",c.highlight.style.left=`${E.left}px`,c.highlight.style.top=`${E.top}px`,c.highlight.style.width=`${E.width}px`,c.highlight.style.height=`${E.height}px`}function ee(){T==null||T.stop(),T=null}function I(){c&&(c.highlight.style.display="none"),ee(),A==="picking"&&S("compose")}function L(){c&&(W(),S("picking"),T=m.startElementPicker({doc:a,onHover:$,onPick:g=>{y.selectedElement=It(g),I(),O()},onCancel:I}))}function B(g){if(!c)return;const E=c.selBox;if(!g){E.style.display="none";return}E.style.display="block",E.style.left=`${g.x}px`,E.style.top=`${g.y}px`,E.style.width=`${g.width}px`,E.style.height=`${g.height}px`}function R(){C==null||C.stop(),C=null}function z(){c&&(W(),B(null),S("capturing"),C=yo({doc:a,onProgress:B,onComplete:g=>{R(),B(null),Uo(g)},onCancel:()=>{R(),B(null),S("compose")}}))}function we(g){c&&(c.drawFrame.style.left=`${g.x}px`,c.drawFrame.style.top=`${g.y}px`,c.drawFrame.style.width=`${g.width}px`,c.drawFrame.style.height=`${g.height}px`)}function te(g){if(w==null||w.setTool(g),!!c)for(const[E,P]of c.drawTools)P.classList.toggle("is-active",E===g)}function ne(g){c&&(c.undoBtn.disabled=g.length===0)}function q(){w==null||w.stop(),w=null}function Uo(g){c&&(_=g,we(g),S("drawing"),w=go({doc:a,svg:c.drawSvg,textInput:c.drawText,initialMarks:y.marks,onChange:ne}),te("arrow"),ne(y.marks))}function Bo(){w&&(y.marks=w.marks().slice(),_&&(y.region=_)),ct(),O()}function Oo(){ct(),O()}function ct(){q(),_=null,A==="drawing"&&S("compose")}function W(){ee(),R(),q(),_=null,B(null),c&&(c.highlight.style.display="none"),A!=="compose"&&S("compose")}function ke(){N!==null&&(clearTimeout(N),N=null)}async function zo(){if(!(!c||y.phase==="sending")){W(),y.phase="sending",c.sendBtn.disabled=!0,c.sendBtn.textContent="Sending…",D("",!1);try{var g,E,P,U;const oe=Fe({kind:y.kind,comment:c.comment.value,element:(g=y.selectedElement)!==null&&g!==void 0?g:void 0,region:(E=y.region)!==null&&E!==void 0?E:void 0,marks:y.marks.length>0?y.marks:void 0,url:(P=b.location)===null||P===void 0?void 0:P.href,environment:je(b,u),trace:(U=e.buffer)===null||U===void 0?void 0:U.snapshot()}),re=Re(oe,{hook:e.beforeSend,scrub:e.scrub});if(!re){y.phase="sent",c.panel.classList.add("is-sent"),N=setTimeout(de,at);return}const Z=await m.captureView({doc:a,win:b}),ue=Z?{blob:Z.blob,filename:`screenshot.${He(Z.type)}`}:null,ie=await m.submitReport(e.apiUrl,{key:e.key,identity:e.identity,content:re,screenshot:ue});ie.ok?(y.phase="sent",c.panel.classList.add("is-sent"),N=setTimeout(de,at)):(Ee(),D(ie.reason==="unreachable"?"Couldn't reach Fixback — try again.":"Fixback couldn't accept this report.",!0))}catch{Ee(),D("Something went wrong — try again.",!0)}}}function Ee(){y.phase="compose",c&&(c.sendBtn.disabled=!1,c.sendBtn.textContent="Send")}function Do(){var g;p=x(a,"div",{[ko]:""}),p.style.cssText="position:fixed;right:20px;bottom:84px;z-index:2147483001;margin:0;padding:0;border:0;display:none;";const E=p.attachShadow({mode:"open"}),P=a.createElement("style");P.textContent=wo,E.appendChild(P);const U=x(a,"button",{type:"button",class:"fb-ov-close","aria-label":"Close"},["✕"]),oe=x(a,"div",{class:"fb-ov-head"},[x(a,"span",{class:"fb-ov-mark-sq"}),x(a,"span",{class:"fb-ov-brand"},["Fixback"])]);e.tier!=null&&oe.appendChild(x(a,"span",{class:"fb-ov-tier","aria-label":`Trust tier: ${e.tier}`},[e.tier])),oe.appendChild(U);const re=new Map,Z=x(a,"div",{class:"fb-ov-tabs"});for(const{value:X,label:pe}of _o){const G=x(a,"button",{type:"button",class:"fb-ov-tab","data-kind":X},[pe]);G.addEventListener("click",()=>v(X)),re.set(X,G),Z.appendChild(G)}const ue=x(a,"span",{class:"fb-ov-selector"}),ie=x(a,"span",{class:"fb-ov-mark-caption"}),dt=x(a,"div",{class:"fb-ov-mark"},[ue,ie]),ut=x(a,"textarea",{class:"fb-ov-comment",placeholder:"Describe what you saw or want…","aria-label":"Comment"}),ft=x(a,"div",{class:"fb-ov-status",role:"status","aria-live":"polite"}),_e=x(a,"button",{type:"button",class:"fb-ov-pickbtn",title:"Point at an element"});_e.addEventListener("click",()=>{y.phase!=="sending"&&(A==="picking"?I():L())});const fe=x(a,"button",{type:"button",class:"fb-ov-capturebtn",title:"Capture a region and draw","aria-label":"Capture a region and draw"});fe.appendChild(Lo(a)),fe.addEventListener("click",()=>{y.phase!=="sending"&&z()});const Se=x(a,"button",{type:"button",class:"fb-ov-send"},["Send"]);Se.addEventListener("click",()=>{zo()});const Vo=x(a,"div",{class:"fb-ov-tools"},[_e,fe,Se]),Xo=x(a,"div",{class:"fb-ov-form"},[Z,dt,ut,ft,Vo]),Go=x(a,"div",{class:"fb-ov-done"},[x(a,"div",{class:"fb-ov-done__check"},["✓"]),x(a,"div",{class:"fb-ov-done__title"},["Report sent"]),x(a,"div",{class:"fb-ov-done__sub"},["Thanks — the team can see it now."])]),bt=x(a,"div",{class:"fb-ov-panel",role:"dialog","aria-label":"Fixback feedback"},[oe,Xo,Go]),Te=x(a,"div",{class:"fb-ov-highlight"});Te.style.display="none";const pt=x(a,"div",{class:"fb-ov-pick"},[x(a,"div",{class:"fb-ov-hint"},["Click the element you mean · Esc to cancel"]),Te]),Ce=x(a,"div",{class:"fb-ov-capture-sel"});Ce.style.display="none";const ht=x(a,"div",{class:"fb-ov-capture"},[x(a,"div",{class:"fb-ov-capture-dim"}),x(a,"div",{class:"fb-ov-hint"},["Drag to capture an area · Esc to cancel"]),Ce]),vt=F(a,"svg",{class:"fb-ov-draw-svg",width:"100%",height:"100%"}),Le=x(a,"input",{class:"fb-ov-draw-text",placeholder:"label…","aria-label":"Mark label"});Le.style.display="none";const mt=x(a,"div",{class:"fb-ov-draw-frame"}),gt=new Map,xt=[];for(const{tool:X,label:pe}of So){const G=x(a,"button",{type:"button",class:"fb-ov-drawtool","data-tool":X,title:pe,"aria-label":pe});G.appendChild(Ao(a,X)),G.addEventListener("click",()=>te(X)),gt.set(X,G),xt.push(G)}const be=x(a,"button",{type:"button",class:"fb-ov-draw-undo",title:"Undo","aria-label":"Undo"});be.appendChild(Mo(a)),be.addEventListener("click",()=>w==null?void 0:w.undo());const yt=x(a,"button",{type:"button",class:"fb-ov-draw-cancel"},["Cancel"]);yt.addEventListener("click",()=>Oo());const wt=x(a,"button",{type:"button",class:"fb-ov-draw-attach"},["Attach"]);wt.addEventListener("click",()=>Bo());const Yo=x(a,"div",{class:"fb-ov-draw-toolbar"},[...xt,x(a,"span",{class:"fb-ov-draw-divider"}),be,yt,wt]),kt=x(a,"div",{class:"fb-ov-draw"},[mt,vt,Le,Yo]);E.append(bt,pt,ht,kt),U.addEventListener("click",de),((g=e.target)!==null&&g!==void 0?g:a.body).appendChild(p),c={panel:bt,tabs:re,mark:dt,selector:ue,caption:ie,comment:ut,status:ft,pickBtn:_e,captureBtn:fe,sendBtn:Se,highlight:Te,pickLayer:pt,captureLayer:ht,selBox:Ce,drawLayer:kt,drawSvg:vt,drawText:Le,drawFrame:mt,drawTools:gt,undoBtn:be}}function jo(){(!p||!c)&&Do()}function Fo(){if(jo(),!(!p||!c)){ke(),W(),y.phase="compose",y.selectedElement=null,y.region=null,y.marks=[],c.panel.classList.remove("is-sent"),c.comment.value="",Ee(),D("",!1),v("bug"),O(),p.style.display="block",M=!0;try{c.comment.focus()}catch{}}}function de(){ke(),W(),p&&(p.style.display="none"),M=!1}function Ho(){ke(),W(),p==null||p.remove(),p=null,c=null,M=!1}return{open:Fo,close:de,destroy:Ho,get isOpen(){return M}}}function Co(e){return x(e,"span",{class:"fb-ov-pickbtn__glyph","aria-hidden":"true"},["⌖"])}function Lo(e){return F(e,"svg",{class:"fb-ov-icon",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[F(e,"path",{d:"M2 5V2h3M14 5V2h-3M2 11v3h3M14 11v3h-3"})])}function Mo(e){return F(e,"svg",{class:"fb-ov-icon",width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","aria-hidden":"true"},[F(e,"path",{d:"M6 4 3 7l3 3M3 7h6a4 4 0 0 1 0 8H7"})])}function Ao(e,t){return t==="text"?x(e,"span",{class:"fb-ov-drawtool__t","aria-hidden":"true"},["T"]):F(e,"svg",{class:"fb-ov-icon",width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","aria-hidden":"true"},[{arrow:F(e,"path",{d:"M3 13 13 3M7 3h6v6"}),box:F(e,"rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1"}),pen:F(e,"path",{d:"M3 13l1-3 6-6 2 2-6 6-3 1Z"})}[t]])}var st="https://api.fixback.dev",ye={destroy(){}};function Io(){try{const e=window.location;return e.host||e.hostname||"this site"}catch{return"this site"}}function Ro(){try{return window.location.href}catch{return""}}function $o(e){const{options:t,apiUrl:n,key:o,identity:i,target:r,answer:s}=e,f=so(r,{key:o,reduceMotion:t.reduceMotion}),l=n.replace(/\/+$/,"");let d=null,h=()=>{};if(t.trace!==!1){var a;const p=(a=t.trace)!==null&&a!==void 0?a:{};d=Xt({maxBreadcrumbs:p.maxBreadcrumbs,maxAgeMs:p.maxAgeMs,beforeBreadcrumb:p.beforeBreadcrumb}),h=sn(d,{consoleLevels:p.consoleLevels,ignoreUrl:c=>c.startsWith(l)})}const b=To({apiUrl:n,key:o,identity:i,gate:s.gate,tier:s.tier,sdkVersion:ae,target:r,buffer:d,beforeSend:t.beforeSend,scrub:t.scrub}),u=()=>b.open();f.host.addEventListener(le,u);let m=()=>{};return t.autoCapture!==!1&&(m=Fn({apiUrl:n,key:o,identity:i,sdkVersion:ae,buffer:d,beforeSend:t.beforeSend,scrub:t.scrub}).destroy),()=>{f.host.removeEventListener(le,u),b.destroy(),lo(f),h(),m()}}async function lt(e,t){try{var n,o,i;if(typeof document=="undefined")return ye;const r=e==null?void 0:e.key;if(typeof r!="string"||r.length===0)return ye;const s=(n=e.apiUrl)!==null&&n!==void 0?n:st,f=(o=e.anonymousId)!==null&&o!==void 0?o:Hn(),l=(i=e.target)!==null&&i!==void 0?i:document.body;let d=!1,h=()=>{},a=()=>{};const b={destroy:()=>{d=!0,a(),a=()=>{},h(),h=()=>{}}},u=()=>{var p;const c=Je(r);return{signedIdentity:e.signedIdentity,reporterId:(p=e.reporterId)!==null&&p!==void 0?p:c==null?void 0:c.reporterId,anonymousId:f}},m=async p=>{const c=await _t(s,{key:r,...p});d||!(c!=null&&c.canSubmit)||(h=$o({options:e,apiUrl:s,key:r,identity:p,target:l,answer:c}))};if(t){const p=await Zn(s,t);if(d)return b;if(p&&p.status==="pending"){const c=Je(r),T=async w=>{const _=await Jn(s,t);d||(a(),a=()=>{},_&&_.status==="redeemed"?(Yn(r,{reporterId:_.reporterId,name:w.name,email:w.email}),Gn(window),await m({signedIdentity:e.signedIdentity,reporterId:_.reporterId,anonymousId:f})):await m(u()))},C=ho({origin:Io(),tier:p.tier,defaults:c?{name:c.name,email:c.email}:void 0,target:l,onConfirm:w=>{T(w)}});return a=()=>C.destroy(),b}}return await m(u()),b}catch{return ye}}function No(e){return lt(e,typeof window!="undefined"?Xn(Ro()):null)}function Po(e){return lt(e,typeof(e==null?void 0:e.token)=="string"&&e.token.length>0?e.token:null)}j.DEFAULT_API_URL=st,j.LAUNCH_EVENT=le,j.init=No,j.redeem=Po});
|
|
805
|
+
`,da="data-fixback-overlay",fa="http://www.w3.org/2000/svg",pa=[{value:"bug",label:"Bug"},{value:"improvement",label:"Improve"},{value:"idea",label:"Idea"}],ba=[{tool:"arrow",label:"Arrow"},{tool:"box",label:"Box"},{tool:"pen",label:"Pen"},{tool:"text",label:"Text label"}],yn=1800;function C(e,t,n={},r=[]){const o=e.createElement(t);for(const[i,a]of Object.entries(n))a!==void 0&&o.setAttribute(i,a);for(const i of r)o.appendChild(typeof i=="string"?e.createTextNode(i):i);return o}function V(e,t,n={},r=[]){const o=e.createElementNS(fa,t);for(const[i,a]of Object.entries(n))o.setAttribute(i,a);for(const i of r)o.appendChild(i);return o}function ha(e){var t,n,r,o,i,a,c,l,d,p;const s=(t=e.doc)!==null&&t!==void 0?t:document,h=(n=(r=e.win)!==null&&r!==void 0?r:s.defaultView)!==null&&n!==void 0?n:window,f=(o=e.sdkVersion)!==null&&o!==void 0?o:Se,b={captureView:(i=(a=e.deps)===null||a===void 0?void 0:a.captureView)!==null&&i!==void 0?i:rn,submitReport:(c=(l=e.deps)===null||l===void 0?void 0:l.submitReport)!==null&&c!==void 0?c:on,startElementPicker:(d=(p=e.deps)===null||p===void 0?void 0:p.startElementPicker)!==null&&d!==void 0?d:Vn};let m=null,u=null,y=null,g=null,v=null,w=null,S=null,k=!1,N="compose";const T={kind:"bug",selectedElement:null,region:null,marks:[],phase:"compose"};function U(E,A){u&&(u.status.textContent=E,u.status.classList.toggle("is-error",A))}function x(E){if(T.kind=E,!!u)for(const[A,P]of u.tabs){const B=A===E;P.classList.toggle("is-active",B),P.setAttribute("aria-pressed",String(B))}}function L(E){if(N=E,!u)return;const A=E!=="compose";u.panel.classList.toggle("is-marking",A),u.pickLayer.classList.toggle("is-visible",E==="picking"),u.captureLayer.classList.toggle("is-visible",E==="capturing"),u.drawLayer.classList.toggle("is-visible",E==="drawing"),u.pickBtn.classList.toggle("is-active",E==="picking"),u.captureBtn.classList.toggle("is-active",E==="capturing"||E==="drawing")}function $(){if(!u)return;const E=!!T.selectedElement,A=!!T.region,P=T.marks.length;u.mark.classList.toggle("has-element",E),u.selector.textContent=E?T.selectedElement.selector:"",u.pickBtn.textContent="",u.pickBtn.append(ma(s),s.createTextNode(E?"Change element":"Pick element")),u.captureBtn.classList.toggle("is-attached",A||P>0);const B=[];E&&B.push("Element"),A&&B.push("Region"),P>0&&B.push(`${P} mark${P===1?"":"s"}`),u.caption.textContent=B.length?`${B.join(" · ")} · masked screenshot on Send`:"Masked screenshot attached on Send"}function D(E){if(!u)return;if(!E){u.highlight.style.display="none";return}const A=E.getBoundingClientRect();u.highlight.style.display="block",u.highlight.style.left=`${A.left}px`,u.highlight.style.top=`${A.top}px`,u.highlight.style.width=`${A.width}px`,u.highlight.style.height=`${A.height}px`}function fe(){y==null||y.stop(),y=null}function R(){u&&(u.highlight.style.display="none"),fe(),N==="picking"&&L("compose")}function I(){u&&(re(),L("picking"),y=b.startElementPicker({doc:s,onHover:D,onPick:E=>{T.selectedElement=Hn(E),R(),$()},onCancel:R}))}function F(E){if(!u)return;const A=u.selBox;if(!E){A.style.display="none";return}A.style.display="block",A.style.left=`${E.x}px`,A.style.top=`${E.y}px`,A.style.width=`${E.width}px`,A.style.height=`${E.height}px`}function M(){g==null||g.stop(),g=null}function O(){u&&(re(),F(null),L("capturing"),g=ca({doc:s,onProgress:F,onComplete:E=>{M(),F(null),Ca(E)},onCancel:()=>{M(),F(null),L("compose")}}))}function K(E){u&&(u.drawFrame.style.left=`${E.x}px`,u.drawFrame.style.top=`${E.y}px`,u.drawFrame.style.width=`${E.width}px`,u.drawFrame.style.height=`${E.height}px`)}function Z(E){if(v==null||v.setTool(E),!!u)for(const[A,P]of u.drawTools)P.classList.toggle("is-active",A===E)}function pe(E){u&&(u.undoBtn.disabled=E.length===0)}function ne(){v==null||v.stop(),v=null}function Ca(E){u&&(w=E,K(E),L("drawing"),v=sa({doc:s,svg:u.drawSvg,textInput:u.drawText,initialMarks:T.marks,onChange:pe}),Z("arrow"),pe(T.marks))}function _a(){v&&(T.marks=v.marks().slice(),w&&(T.region=w)),kn(),$()}function Aa(){kn(),$()}function kn(){ne(),w=null,N==="drawing"&&L("compose")}function re(){fe(),M(),ne(),w=null,F(null),u&&(u.highlight.style.display="none"),N!=="compose"&&L("compose")}function rt(){S!==null&&(clearTimeout(S),S=null)}async function La(){if(!(!u||T.phase==="sending")){re(),T.phase="sending",u.sendBtn.disabled=!0,u.sendBtn.textContent="Sending…",U("",!1);try{var E,A,P,B;const be=Lt({kind:T.kind,comment:u.comment.value,element:(E=T.selectedElement)!==null&&E!==void 0?E:void 0,region:(A=T.region)!==null&&A!==void 0?A:void 0,marks:T.marks.length>0?T.marks:void 0,url:(P=h.location)===null||P===void 0?void 0:P.href,environment:At(h,f),trace:(B=e.buffer)===null||B===void 0?void 0:B.snapshot()}),he=bt(be,{hook:e.beforeSend,scrub:e.scrub});if(!he){T.phase="sent",u.panel.classList.add("is-sent"),S=setTimeout(Ae,yn);return}const oe=await b.captureView({doc:s,win:h}),Le=oe?{blob:oe.blob,filename:`screenshot.${tn(oe.type)}`}:null,me=await b.submitReport(e.apiUrl,{key:e.key,identity:e.identity,content:he,screenshot:Le});me.ok?(T.phase="sent",u.panel.classList.add("is-sent"),S=setTimeout(Ae,yn)):(ot(),U(me.reason==="unreachable"?"Couldn't reach Fixback — try again.":"Fixback couldn't accept this report.",!0))}catch{ot(),U("Something went wrong — try again.",!0)}}}function ot(){T.phase="compose",u&&(u.sendBtn.disabled=!1,u.sendBtn.textContent="Send")}function Na(){var E;m=C(s,"div",{[da]:""}),m.style.cssText="position:fixed;right:20px;bottom:84px;z-index:2147483001;margin:0;padding:0;border:0;display:none;";const A=m.attachShadow({mode:"open"}),P=s.createElement("style");P.textContent=ua,A.appendChild(P);const B=C(s,"button",{type:"button",class:"fb-ov-close","aria-label":"Close"},["✕"]),be=C(s,"div",{class:"fb-ov-head"},[C(s,"span",{class:"fb-ov-mark-sq"}),C(s,"span",{class:"fb-ov-brand"},["Fixback"])]);e.tier!=null&&be.appendChild(C(s,"span",{class:"fb-ov-tier","aria-label":`Trust tier: ${e.tier}`},[e.tier])),be.appendChild(B);const he=new Map,oe=C(s,"div",{class:"fb-ov-tabs"});for(const{value:G,label:Re}of pa){const W=C(s,"button",{type:"button",class:"fb-ov-tab","data-kind":G},[Re]);W.addEventListener("click",()=>x(G)),he.set(G,W),oe.appendChild(W)}const Le=C(s,"span",{class:"fb-ov-selector"}),me=C(s,"span",{class:"fb-ov-mark-caption"}),En=C(s,"div",{class:"fb-ov-mark"},[Le,me]),Sn=C(s,"textarea",{class:"fb-ov-comment",placeholder:"Describe what you saw or want…","aria-label":"Comment"}),Tn=C(s,"div",{class:"fb-ov-status",role:"status","aria-live":"polite"}),it=C(s,"button",{type:"button",class:"fb-ov-pickbtn",title:"Point at an element"});it.addEventListener("click",()=>{T.phase!=="sending"&&(N==="picking"?R():I())});const Ne=C(s,"button",{type:"button",class:"fb-ov-capturebtn",title:"Capture a region and draw","aria-label":"Capture a region and draw"});Ne.appendChild(va(s)),Ne.addEventListener("click",()=>{T.phase!=="sending"&&O()});const at=C(s,"button",{type:"button",class:"fb-ov-send"},["Send"]);at.addEventListener("click",()=>{La()});const Da=C(s,"div",{class:"fb-ov-tools"},[it,Ne,at]),Pa=C(s,"div",{class:"fb-ov-form"},[oe,En,Sn,Tn,Da]),Ua=C(s,"div",{class:"fb-ov-done"},[C(s,"div",{class:"fb-ov-done__check"},["✓"]),C(s,"div",{class:"fb-ov-done__title"},["Report sent"]),C(s,"div",{class:"fb-ov-done__sub"},["Thanks — the team can see it now."])]),Cn=C(s,"div",{class:"fb-ov-panel",role:"dialog","aria-label":"Fixback feedback"},[be,Pa,Ua]),st=C(s,"div",{class:"fb-ov-highlight"});st.style.display="none";const _n=C(s,"div",{class:"fb-ov-pick"},[C(s,"div",{class:"fb-ov-hint"},["Click the element you mean · Esc to cancel"]),st]),lt=C(s,"div",{class:"fb-ov-capture-sel"});lt.style.display="none";const An=C(s,"div",{class:"fb-ov-capture"},[C(s,"div",{class:"fb-ov-capture-dim"}),C(s,"div",{class:"fb-ov-hint"},["Drag to capture an area · Esc to cancel"]),lt]),Ln=V(s,"svg",{class:"fb-ov-draw-svg",width:"100%",height:"100%"}),ct=C(s,"input",{class:"fb-ov-draw-text",placeholder:"label…","aria-label":"Mark label"});ct.style.display="none";const Nn=C(s,"div",{class:"fb-ov-draw-frame"}),In=new Map,Rn=[];for(const{tool:G,label:Re}of ba){const W=C(s,"button",{type:"button",class:"fb-ov-drawtool","data-tool":G,title:Re,"aria-label":Re});W.appendChild(ya(s,G)),W.addEventListener("click",()=>Z(G)),In.set(G,W),Rn.push(W)}const Ie=C(s,"button",{type:"button",class:"fb-ov-draw-undo",title:"Undo","aria-label":"Undo"});Ie.appendChild(ga(s)),Ie.addEventListener("click",()=>v==null?void 0:v.undo());const Mn=C(s,"button",{type:"button",class:"fb-ov-draw-cancel"},["Cancel"]);Mn.addEventListener("click",()=>Aa());const Dn=C(s,"button",{type:"button",class:"fb-ov-draw-attach"},["Attach"]);Dn.addEventListener("click",()=>_a());const Ba=C(s,"div",{class:"fb-ov-draw-toolbar"},[...Rn,C(s,"span",{class:"fb-ov-draw-divider"}),Ie,Mn,Dn]),Pn=C(s,"div",{class:"fb-ov-draw"},[Nn,Ln,ct,Ba]);A.append(Cn,_n,An,Pn),B.addEventListener("click",Ae),((E=e.target)!==null&&E!==void 0?E:s.body).appendChild(m),u={panel:Cn,tabs:he,mark:En,selector:Le,caption:me,comment:Sn,status:Tn,pickBtn:it,captureBtn:Ne,sendBtn:at,highlight:st,pickLayer:_n,captureLayer:An,selBox:lt,drawLayer:Pn,drawSvg:Ln,drawText:ct,drawFrame:Nn,drawTools:In,undoBtn:Ie}}function Ia(){(!m||!u)&&Na()}function Ra(){if(Ia(),!(!m||!u)){rt(),re(),T.phase="compose",T.selectedElement=null,T.region=null,T.marks=[],u.panel.classList.remove("is-sent"),u.comment.value="",ot(),U("",!1),x("bug"),$(),m.style.display="block",k=!0;try{u.comment.focus()}catch{}}}function Ae(){rt(),re(),m&&(m.style.display="none"),k=!1}function Ma(){rt(),re(),m==null||m.remove(),m=null,u=null,k=!1}return{open:Ra,close:Ae,destroy:Ma,get isOpen(){return k}}}function ma(e){return C(e,"span",{class:"fb-ov-pickbtn__glyph","aria-hidden":"true"},["⌖"])}function va(e){return V(e,"svg",{class:"fb-ov-icon",width:"14",height:"14",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.5","aria-hidden":"true"},[V(e,"path",{d:"M2 5V2h3M14 5V2h-3M2 11v3h3M14 11v3h-3"})])}function ga(e){return V(e,"svg",{class:"fb-ov-icon",width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","aria-hidden":"true"},[V(e,"path",{d:"M6 4 3 7l3 3M3 7h6a4 4 0 0 1 0 8H7"})])}function ya(e,t){return t==="text"?C(e,"span",{class:"fb-ov-drawtool__t","aria-hidden":"true"},["T"]):V(e,"svg",{class:"fb-ov-icon",width:"15",height:"15",viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.6","aria-hidden":"true"},[{arrow:V(e,"path",{d:"M3 13 13 3M7 3h6v6"}),box:V(e,"rect",{x:"2.5",y:"3.5",width:"11",height:"9",rx:"1"}),pen:V(e,"path",{d:"M3 13l1-3 6-6 2 2-6 6-3 1Z"})}[t]])}var wn="https://api.fixback.dev";function wa(e,t){const n=e.replace(/\/+$/,"");return t.startsWith(`${n}/api/ingest/`)||t.startsWith(`${n}/api/invites/`)}var nt={destroy(){}};function xa(){try{const e=window.location;return e.host||e.hostname||"this site"}catch{return"this site"}}function ka(){try{return window.location.href}catch{return""}}function Ea(e){const{options:t,apiUrl:n,key:r,identity:o,target:i,answer:a}=e,c=Zi(i,{key:r,reduceMotion:t.reduceMotion});let l=null,d=()=>{};if(t.trace!==!1){var p,s,h,f,b;const g=(p=t.trace)!==null&&p!==void 0?p:{},v=e.answer.capture,w=(s=(h=t.capture)===null||h===void 0?void 0:h.console)!==null&&s!==void 0?s:typeof(v==null?void 0:v.console)=="boolean"?v.console:!0,S=(f=(b=t.capture)===null||b===void 0?void 0:b.network)!==null&&f!==void 0?f:typeof(v==null?void 0:v.network)=="boolean"?v.network:!0;l=sr({budgets:g.budgets,maxAgeMs:g.maxAgeMs,beforeBreadcrumb:g.beforeBreadcrumb}),d=Rr(l,{consoleLevels:g.consoleLevels,ignoreUrl:k=>wa(n,k),captureConsole:w,captureNetwork:S})}const m=ha({apiUrl:n,key:r,identity:o,gate:a.gate,tier:a.tier,sdkVersion:Se,target:i,buffer:l,beforeSend:t.beforeSend,scrub:t.scrub}),u=()=>m.open();c.host.addEventListener(Ce,u);let y=()=>{};return t.autoCapture!==!1&&(y=Ri({apiUrl:n,key:r,identity:o,sdkVersion:Se,buffer:l,beforeSend:t.beforeSend,scrub:t.scrub}).destroy),()=>{c.host.removeEventListener(Ce,u),m.destroy(),Ji(c),d(),y()}}async function xn(e,t){try{var n,r,o;if(typeof document=="undefined")return nt;const i=e==null?void 0:e.key;if(typeof i!="string"||i.length===0)return nt;const a=(n=e.apiUrl)!==null&&n!==void 0?n:wn,c=(r=e.anonymousId)!==null&&r!==void 0?r:Mi(),l=(o=e.target)!==null&&o!==void 0?o:document.body;let d=!1,p=()=>{},s=()=>{};const h={destroy:()=>{d=!0,s(),s=()=>{},p(),p=()=>{}}},f=()=>{var m;const u=dn(i);return{signedIdentity:e.signedIdentity,reporterId:(m=e.reporterId)!==null&&m!==void 0?m:u==null?void 0:u.reporterId,anonymousId:c}},b=async m=>{const u=await Bn(a,{key:i,...m});d||!(u!=null&&u.canSubmit)||(p=Ea({options:e,apiUrl:a,key:i,identity:m,target:l,answer:u}))};if(t){const m=await zi(a,t);if(d)return h;if(m&&m.status==="pending"){const u=dn(i),y=async v=>{const w=await ji(a,t);d||(s(),s=()=>{},w&&w.status==="redeemed"?(Bi(i,{reporterId:w.reporterId,name:v.name,email:v.email}),Ui(window),await b({signedIdentity:e.signedIdentity,reporterId:w.reporterId,anonymousId:c})):await b(f()))},g=oa({origin:xa(),tier:m.tier,defaults:u?{name:u.name,email:u.email}:void 0,target:l,onConfirm:v=>{y(v)}});return s=()=>g.destroy(),h}}return await b(f()),h}catch{return nt}}function Sa(e){return xn(e,typeof window!="undefined"?Pi(ka()):null)}function Ta(e){return xn(e,typeof(e==null?void 0:e.token)=="string"&&e.token.length>0?e.token:null)}j.DEFAULT_API_URL=wn,j.LAUNCH_EVENT=Ce,j.init=Sa,j.redeem=Ta});
|
|
792
806
|
|
|
793
807
|
//# sourceMappingURL=fixback.umd.js.map
|