vendor: 9,029 bytes, line 1
1(()=>{"use strict";var e={9306(e,t,n){var r=n(4901),s=n(6823),i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(s(e)+" is not a function")}},3506(e,t,n){var r=n(3925),s=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i("Can't set "+s(e)+" as a prototype")}},6469(e,t,n){var r=n(8227),s=n(2360),i=n(4913).f,o=r("unscopables"),a=Array.prototype;void 0===a[o]&&i(a,o,{configurable:!0,value:s(null)}),e.exports=function(e){a[o][e]=!0}},8551(e,t,n){var r=n(34),s=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw new i(s(e)+" is not an object")}},7811(e){e.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},4644(e,t,n){var r,s,i,o=n(7811),a=n(3724),c=n(4576),l=n(4901),u=n(34),d=n(9297),h=n(6955),p=n(6823),f=n(6699),m=n(6840),g=n(2106),y=n(1625),v=n(2787),_=n(2967),b=n(8227),S=n(3392),w=n(1181),k=w.enforce,T=w.get,E=c.Int8Array,x=E&&E.prototype,I=c.Uint8ClampedArray,C=I&&I.prototype,O=E&&v(E),A=x&&v(x),M=Object.prototype,R=c.TypeError,N=b("toStringTag"),P=S("TYPED_ARRAY_TAG"),L="TypedArrayConstructor",D=o&&!!_&&"Opera"!==h(c.opera),$=!1,j={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},B={BigInt64Array:8,BigUint64Array:8},F=function(e){var t=v(e);if(u(t)){var n=T(t);return n&&d(n,L)?n[L]:F(t)}},U=function(e){if(!u(e))return!1;var t=h(e);return d(j,t)||d(B,t)};for(r in j)(i=(s=c[r])&&s.prototype)?k(i)[L]=s:D=!1;for(r in B)(i=(s=c[r])&&s.prototype)&&(k(i)[L]=s);if((!D||!l(O)||O===Function.prototype)&&(O=function(){throw new R("Incorrect invocation")},D))for(r in j)c[r]&&_(c[r],O);if((!D||!A||A===M)&&(A=O.prototype,D))for(r in j)c[r]&&_(c[r].prototype,A);if(D&&v(C)!==A&&_(C,A),a&&!d(A,N))for(r in $=!0,g(A,N,{configurable:!0,get:function(){return u(this)?this[P]:void 0}}),j)c[r]&&f(c[r],P,r);e.exports={NATIVE_ARRAY_BUFFER_VIEWS:D,TYPED_ARRAY_TAG:$&&P,aTypedArray:function(e){if(U(e))return e;throw new R("Target is not a typed array")},aTypedArrayConstructor:function(e){if(l(e)&&(!_||y(O,e)))return e;throw new R(p(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(a){if(n)for(var s in j){var i=c[s];if(i&&d(i.prototype,e))try{delete i.prototype[e]}catch(n){try{i.prototype[e]=t}catch(e){}}}A[e]&&!n||m(A,e,n?t:D&&x[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,s;if(a){if(_){if(n)for(r in j)if((s=c[r])&&d(s,e))try{delete s[e]}catch(e){}if(O[e]&&!n)return;try{return m(O,e,n?t:D&&O[e]||t)}catch(e){}}for(r in j)!(s=c[r])||s[e]&&!n||m(s,e,t)}},getTypedArrayConstructor:F,isView:function(e){if(!u(e))return!1;var t=h(e);return"DataView"===t||d(j,t)||d(B,t)},isTypedArray:U,TypedArray:O,TypedArrayPrototype:A}},4373(e,t,n){var r=n(8981),s=n(5610),i=n(6198);e.exports=function(e){for(var t=r(this),n=i(t),o=arguments.length,a=s(o>1?arguments[1]:void 0,n),c=o>2?arguments[2]:void 0,l=void 0===c?n:s(c,n);l>a;)t[a++]=e;return t}},9617(e,t,n){var r=n(5397),s=n(5610),i=n(6198),o=function(e){return function(t,n,o){var a=r(t),c=i(a);if(0===c)return!e&&-1;var l,u=s(o,c);if(e&&n!=n){for(;c>u;)if((l=a[u++])!=l)return!0}else for(;c>u;u++)if((e||u in a)&&a[u]===n)return e||u||0;return!e&&-1}};e.exports={includes:o(!0),indexOf:o(!1)}},7680(e,t,n){var r=n(9504);e.exports=r([].slice)},4488(e,t,n){var r=n(7680),s=Math.floor,i=function(e,t){var n=e.length;if(n<8)for(var o,a,c=1;c<n;){for(a=c,o=e[c];a&&t(e[a-1],o)>0;)e[a]=e[--a];a!==c++&&(e[a]=o)}else for(var l=s(n/2),u=i(r(e,0,l),t),d=i(r(e,l),t),h=u.length,p=d.length,f=0,m=0;f<h||m<p;)e[f+m]=f<h&&m<p?t(u[f],d[m])<=0?u[f++]:d[m++]:f<h?u[f++]:d[m++];return e};e.exports=i},2195(e,t,n){var r=n(9504),s=r({}.toString),i=r("".slice);e.exports=function(e){return i(s(e),8,-1)}},6955(e,t,n){var r=n(2140),s=n(4901),i=n(2195),o=n(8227)("toStringTag"),a=Object,c="Arguments"===i(function(){return arguments}());e.exports=r?i:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=a(e),o))?n:c?i(t):"Object"===(r=i(t))&&s(t.callee)?"Arguments":r}},7740(e,t,n){var r=n(9297),s=n(5031),i=n(7347),o=n(4913);e.exports=function(e,t,n){for(var a=s(t),c=o.f,l=i.f,u=0;u<a.length;u++){var d=a[u];r(e,d)||n&&r(n,d)||c(e,d,l(t,d))}}},2211(e,t,n){var r=n(9039);e.exports=!r(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})},6699(e,t,n){var r=n(3724),s=n(4913),i=n(6980);e.exports=r?function(e,t,n){return s.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},6980(e){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},2106(e,t,n){var r=n(283),s=n(4913);e.exports=function(e,t,n){return n.get&&r(n.get,t,{getter:!0}),n.set&&r(n.set,t,{setter:!0}),s.f(e,t,n)}},6840(e,t,n){var r=n(4901),s=n(4913),i=n(283),o=n(9433);e.exports=function(e,t,n,a){a||(a={});var c=a.enumerable,l=void 0!==a.name?a.name:t;if(r(n)&&i(n,l,a),a.global)c?e[t]=n:o(t,n);else{try{a.unsafe?e[t]&&(c=!0):delete e[t]}catch(e){}c?e[t]=n:s.f(e,t,{value:n,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},9433(e,t,n){var r=n(4576),s=Object.defineProperty;e.exports=function(e,t){try{s(r,e,{value:t,configurable:!0,writable:!0})}catch(n){r[e]=t}return t}},3724(e,t,n){var r=n(9039);e.exports=!r(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]})},4055(e,t,n){var r=n(4576),s=n(34),i=r.document,o=s(i)&&s(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},8727(e){e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},3709(e,t,n){var r=n(2839).match(/firefox\/(\d+)/i);e.exports=!!r&&+r[1]},3763(e,t,n){var r=n(2839);e.exports=/MSIE|Trident/.test(r)},2839(e,t,n){var r=n(4576).navigator,s=r&&r.userAgent;e.exports=s?String(s):""},9519(e,t,n){var r,s,i=n(4576),o=n(2839),a=i.process,c=i.Deno,l=a&&a.versions||c&&c.version,u=l&&l.v8;u&&(s=(r=u.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!s&&o&&(!(r=o.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=o.match(/Chrome\/(\d+)/))&&(s=+r[1]),e.exports=s},3607(e,t,n){var r=n(2839).match(/AppleWebKit\/(\d+)\./);e.exports=!!r&&+r[1]},6518(e,t,n){var r=n(4576),s=n(7347).f,i=n(6699),o=n(6840),a=n(9433),c=n(7740),l=n(2796);e.exports=function(e,t){var n,u,d,h,p,f=e.target,m=e.global,g=e.stat;if(n=m?r:g?r[f]||a(f,{}):r[f]&&r[f].prototype)for(u in t){if(h=t[u],d=e.dontCallGetSet?(p=s(n,u))&&p.value:n[u],!l(m?u:f+(g?".":"#")+u,e.forced)&&void 0!==d){if(typeof h==typeof d)continue;c(h,d)}(e.sham||d&&d.sham)&&i(h,"sham",!0),o(n,u,h,e)}}},9039(e){e.exports=function(e){try{return!!e()}catch(e){return!0}}},616(e,t,n){var r=n(9039);e.exports=!r(function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})},9565(e,t,n){var r=n(616),s=Function.prototype.call;e.exports=r?s.bind(s):function(){return s.apply(s,arguments)}},350(e,t,n){var r=n(3724),s=n(9297),i=Function.prototype,o=r&&Object.getOwnPropertyDescriptor,a=s(i,"name"),c=a&&"something"===function(){}.name,l=a&&(!r||r&&o(i,"name").configurable);e.exports={EXISTS:a,PROPER:c,CONFIGURABLE:l}},6706(e,t,n){var r=n(9504),s=n(9306);e.exports=function(e,t,n){try{return r(s(Object.getOwnPropertyDescriptor(e,t)[n]))}catch(e){}}},7476(e,t,n){var r=n(2195),s=n(9504);e.exports=function(e){if("Function"===r(e))return s(e)}},9504(e,t,n){var r=n(616),s=Function.prototype,i=s.call,o=r&&s.bind.bind(i,i);e.exports=r?o:function(e){return function(){return i.apply(e,arguments)}}},7751(e,t,n){var r=n(4576),s=n(4901);e.exports=function(e,t){return arguments.length<2?(n=r[e],s(n)?n:void 0):r[e]&&r[e][t];var n}},5966(e,t,n){var r=n(9306),s=n(4117);e.exports=function(e,t){var n=e[t];return s(n)?void 0:r(n)}},4576(e){var t=function(e){return e&&e.Math===Math&&e};e.exports=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof globalThis&&globalThis)||t("object"==typeof this&&this)||function(){return this}()||Function("return this")()},9297(e,t,n){var r=n(9504),s=n(8981),i=r({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return i(s(e),t)}},421(e){e.exports={}},397(e,t,n){var r=n(7751);e.exports=r("document","documentElement")},5917(e,t,n){var r=n(3724),s=n(9039),i=n(4055);e.exports=!r&&!s(function(){return 7!==Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a})},7055(e,t,n){var r=n(9504),s=n(9039),i=n(2195),o=Object,a=r("".split);e.exports=s(function(){return!o("z").propertyIsEnumerable(0)})?function(e){return"String"===i(e)?a(e,""):o(e)}:o},3706(e,t,n){var r=n(9504),s=n(4901),i=n(7629),o=r(Function.toString);s(i.inspectSource)||(i.inspectSource=function(e){return o(e)}),e.exports=i.inspectSource},1181(e,t,n){var r,s,i,o=n(8622),a=n(4576),c=n(34),l=n(6699),u=n(9297),d=n(7629),h=n(6119),p=n(421),f="Object already initialized",m=a.TypeError,g=a.WeakMap;if(o||d.state){var y=d.state||(d.state=new g);y.get=y.get,y.has=y.has,y.set=y.set,r=function(e,t){if(y.has(e))throw new m
vendor: 4,858 bytes, line 1
1(f);return t.facade=e,y.set(e,t),t},s=function(e){return y.get(e)||{}},i=function(e){return y.has(e)}}else{var v=h("state");p[v]=!0,r=function(e,t){if(u(e,v))throw new m(f);return t.facade=e,l(e,v,t),t},s=function(e){return u(e,v)?e[v]:{}},i=function(e){return u(e,v)}}e.exports={set:r,get:s,has:i,enforce:function(e){return i(e)?s(e):r(e,{})},getterFor:function(e){return function(t){var n;if(!c(t)||(n=s(t)).type!==e)throw new m("Incompatible receiver, "+e+" required");return n}}}},4901(e){var t="object"==typeof document&&document.all;e.exports=void 0===t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},2796(e,t,n){var r=n(9039),s=n(4901),i=/#|\.prototype\./,o=function(e,t){var n=c[a(e)];return n===u||n!==l&&(s(t)?r(t):!!t)},a=o.normalize=function(e){return String(e).replace(i,".").toLowerCase()},c=o.data={},l=o.NATIVE="N",u=o.POLYFILL="P";e.exports=o},4117(e){e.exports=function(e){return null==e}},34(e,t,n){var r=n(4901);e.exports=function(e){return"object"==typeof e?null!==e:r(e)}},3925(e,t,n){var r=n(34);e.exports=function(e){return r(e)||null===e}},6395(e){e.exports=!1},757(e,t,n){var r=n(7751),s=n(4901),i=n(1625),o=n(7040),a=Object;e.exports=o?function(e){return"symbol"==typeof e}:function(e){var t=r("Symbol");return s(t)&&i(t.prototype,a(e))}},6198(e,t,n){var r=n(8014);e.exports=function(e){return r(e.length)}},283(e,t,n){var r=n(9504),s=n(9039),i=n(4901),o=n(9297),a=n(3724),c=n(350).CONFIGURABLE,l=n(3706),u=n(1181),d=u.enforce,h=u.get,p=String,f=Object.defineProperty,m=r("".slice),g=r("".replace),y=r([].join),v=a&&!s(function(){return 8!==f(function(){},"length",{value:8}).length}),_=String(String).split("String"),b=e.exports=function(e,t,n){"Symbol("===m(p(t),0,7)&&(t="["+g(p(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),n&&n.getter&&(t="get "+t),n&&n.setter&&(t="set "+t),(!o(e,"name")||c&&e.name!==t)&&(a?f(e,"name",{value:t,configurable:!0}):e.name=t),v&&n&&o(n,"arity")&&e.length!==n.arity&&f(e,"length",{value:n.arity});try{n&&o(n,"constructor")&&n.constructor?a&&f(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var r=d(e);return o(r,"source")||(r.source=y(_,"string"==typeof t?t:"")),e};Function.prototype.toString=b(function(){return i(this)&&h(this).source||l(this)},"toString")},741(e){var t=Math.ceil,n=Math.floor;e.exports=Math.trunc||function(e){var r=+e;return(r>0?n:t)(r)}},2360(e,t,n){var r,s=n(8551),i=n(6801),o=n(8727),a=n(421),c=n(397),l=n(4055),u=n(6119),d="prototype",h="script",p=u("IE_PROTO"),f=function(){},m=function(e){return"<"+h+">"+e+"</"+h+">"},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},y=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}var e,t,n;y="undefined"!=typeof document?document.domain&&r?g(r):(t=l("iframe"),n="java"+h+":",t.style.display="none",c.appendChild(t),t.src=String(n),(e=t.contentWindow.document).open(),e.write(m("document.F=Object")),e.close(),e.F):g(r);for(var s=o.length;s--;)delete y[d][o[s]];return y()};a[p]=!0,e.exports=Object.create||function(e,t){var n;return null!==e?(f[d]=s(e),n=new f,f[d]=null,n[p]=e):n=y(),void 0===t?n:i.f(n,t)}},6801(e,t,n){var r=n(3724),s=n(8686),i=n(4913),o=n(8551),a=n(5397),c=n(1072);t.f=r&&!s?Object.defineProperties:function(e,t){o(e);for(var n,r=a(t),s=c(t),l=s.length,u=0;l>u;)i.f(e,n=s[u++],r[n]);return e}},4913(e,t,n){var r=n(3724),s=n(5917),i=n(8686),o=n(8551),a=n(6969),c=TypeError,l=Object.defineProperty,u=Object.getOwnPropertyDescriptor,d="enumerable",h="configurable",p="writable";t.f=r?i?function(e,t,n){if(o(e),t=a(t),o(n),"function"==typeof e&&"prototype"===t&&"value"in n&&p in n&&!n[p]){var r=u(e,t);r&&r[p]&&(e[t]=n.value,n={configurable:h in n?n[h]:r[h],enumerable:d in n?n[d]:r[d],writable:!1})}return l(e,t,n)}:l:function(e,t,n){if(o(e),t=a(t),o(n),s)try{return l(e,t,n)}catch(e){}if("get"in n||"set"in n)throw new c("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},7347(e,t,n){var r=n(3724),s=n(9565),i=n(8773),o=n(6980),a=n(5397),c=n(6969),l=n(9297),u=n(5917),d=Object.getOwnPropertyDescriptor;t.f=r?d:function(e,t){if(e=a(e),t=c(t),u)try{return d(e,t)}catch(e){}if(l(e,t))return o(!s(i.f,e,t),e[t])}},8480(e,t,n){var r=n(1828),s=n(8727).concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return r(e,s)}},3717(e,t){t.f=Object.getOwnPropertySymbols},2787(e,t,n){var r=n(9297),s=n(4901),i=n(8981),o=n(6119),a=n(2211),c=o("IE_PROTO"),l=Object,u=l.prototype;e.exports=a?l.getPrototypeOf:function(e){var t=i(e);if(r(t,c))return t[c];var n=t.constructor;return s(n)&&t instanceof n?n.prototype:t instanceof l?u:null}},1625(e,t,n){var r=n(9504);e.exports=r({}.isPrototypeOf)},1828(e,t,n){var r=n(9504),s=n(9297),i=n(5397),o=n(9617).indexOf,a=n(421),c=r([].push);e.exports=function(e,t){var n,r=i(e),l=0,u=[];for(n in r)!s(a,n)&&s(r,n)&&c(u,n);for(;t.length>l;
1)s(r,n=t[l++])&&(~o(u,n)||c(u,n));return u}},1072(e,t,n){var r=n(1828),s=n(8727);e.exports=Object.keys||function(e){return r(e,s)}},8773(e,t){var n={}.propertyIsEnumerable,r=Object.getOwnPropertyDescriptor,s=r&&!n.call({1:2},1);t.f=s?function(e){var t=r(this,e);return!!t&&t.enumerable}:n},2967(e,t,n){var r=n(6706),s=n(34),i=n(7750),o=n(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=r(Object.prototype,"__proto__","set"))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return i(n),o(r),s(n)?(t?e(n,r):n.__proto__=r,n):n}}():void 0)},4270(e,t,n){var r=n(9565),s=n(4901),i=n(34),o=TypeError;e.exports=function(e,t){var n,a;if("string"===t&&s(n=e.toString)&&!i(a=r(n,e)))return a;if(s(n=e.valueOf)&&!i(a=r(n,e)))return a;if("string"!==t&&s(n=e.toString)&&!i(a=r(n,e)))return a;throw new o("Can't convert object to primitive value")}},5031(e,t,n){var r=n(7751),s=n(9504),i=n(8480),o=n(3717),a=n(8551),c=s([].concat);e.exports=r("Reflect","ownKeys")||function(e){var t=i.f(a(e)),n=o.f;return n?c(t,n(e)):t}},5213(e,t,n){var r=n(4576),s=n(9039),i=r.RegExp,o=!s(function(){var e=!0;try{i(".","d")}catch(t){e=!1}var t={},n="",r=e?"dgimsy":"gimsy",s=function(e,r){Object.defineProperty(t,e,{get:function(){return n+=r,!0}})},o={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in e&&(o.hasIndices="d"),o)s(a,o[a]);return Object.getOwnPropertyDescriptor(i.prototype,"flags").get.call(t)!==r||n!==r});e.exports={correct:o}},7979(e,t,n){var r=n(8551);e.exports=function(){var e=r(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t}},7750(e,t,n){var r=n(4117),s=TypeError;e.exports=function(e){if(r(e))throw new s("Can't call method on "+e);return e}},6119(e,t,n){var r=n(5745),s=n(3392),i=r("keys");e.exports=function(e){return i[e]||(i[e]=s(e))}},7629(e,t,n){var r=n(6395),s=n(4576),i=n(9433),o="__core-js_shared__",a=e.exports=s[o]||i(o,{});(a.versions||(a.versions=[])).push({version:"3.47.0",mode:r?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru), 2025 CoreJS Company (core-js.io)",license:"https://github.com/zloirock/core-js/blob/v3.47.0/LICENSE",source:"https://github.com/zloirock/core-js"})},5745(e,t,n){var r=n(7629);e.exports=function(e,t){return r[e]||(r[e]=t||{})}},4495(e,t,n){var r=n(9519),s=n(9039),i=n(4576).String;e.exports=!!Object.getOwnPropertySymbols&&!s(function(){var e=Symbol("symbol detection");return!i(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&r&&r<41})},5610(e,t,n){var r=n(1291),s=Math.max,i=Math.min;e.exports=function(e,t){var n=r(e);return n<0?s(n+t,0):i(n,t)}},5854(e,t,n){var r=n(2777),s=TypeError;e.exports=function(e){var t=r(e,"number");if("number"==typeof t)throw new s("Can't convert number to bigint");return BigInt(t)}},5397(e,t,n){var r=n(7055),s=n(7750);e.exports=function(e){return r(s(e))}},1291(e,t,n){var r=n(741);e.exports=function(e){var t=+e;return t!=t||0===t?0:r(t)}},8014(e,t,n){var r=n(1291),s=Math.min;e.exports=function(e){var t=r(e);return t>0?s(t,9007199254740991):0}},8981(e,t,n){var r=n(7750),s=Object;e.exports=function(e){return s(r(e))}},8229(e,t,n){var r=n(9590),s=RangeError;e.exports=function(e,t){var n=r(e);if(n%t)throw new s("Wrong offset");return n}},9590(e,t,n){var r=n(1291),s=RangeError;e.exports=function(e){var t=r(e);if(t<0)throw new s("The argument can't be less than 0");return t}},2777(e,t,n){var r=n(9565),s=n(34),i=n(757),o=n(5966),a=n(4270),c=n(8227),l=TypeError,u=c("toPrimitive");e.exports=function(e,t){if(!s(e)||i(e))return e;var n,c=o(e,u);if(c){if(void 0===t&&(t="default"),n=r(c,e,t),!s(n)||i(n))return n;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},6969(e,t,n){var r=n(2777),s=n(757);e.exports=function(e){var t=r(e,"string");return s(t)?t:t+""}},2140(e,t,n){var r={};r[n(8227)("toStringTag")]="z",e.exports="[object z]"===String(r)},6823(e){var t=String;e.exports=function(e){try{return t(e)}catch(e){return"Object"}}},3392(e,t,n){var r=n(9504),s=0,i=Math.random(),o=r(1.1.toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+o(++s+i,36)}},7040(e,t,n){var r=n(4495);e.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}
1,8686(e,t,n){var r=n(3724),s=n(9039);e.exports=r&&s(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype})},8622(e,t,n){var r=n(4576),s=n(4901),i=r.WeakMap;e.exports=s(i)&&/native code/.test(String(i))},8227(e,t,n){var r=n(4576),s=n(5745),i=n(9297),o=n(3392),a=n(4495),c=n(7040),l=r.Symbol,u=s("wks"),d=c?l.for||l:l&&l.withoutSetter||o;e.exports=function(e){return i(u,e)||(u[e]=a&&i(l,e)?l[e]:d("Symbol."+e)),u[e]}},4423(e,t,n){var r=n(6518),s=n(9617).includes,i=n(9039),o=n(6469);r({target:"Array",proto:!0,forced:i(function(){return!Array(1).includes()})},{includes:function(e){return s(this,e,arguments.length>1?arguments[1]:void 0)}}),o("includes")},9479(e,t,n){var r=n(3724),s=n(2106),i=n(5213),o=n(7979);r&&!i.correct&&(s(RegExp.prototype,"flags",{configurable:!0,get:o}),i.correct=!0)},5044(e,t,n){var r=n(4644),s=n(4373),i=n(5854),o=n(6955),a=n(9565),c=n(9504),l=n(9039),u=r.aTypedArray,d=r.exportTypedArrayMethod,h=c("".slice),p=l(function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e});d("fill",function(e){var t=arguments.length;u(this);var n="Big"===h(o(this),0,3)?i(e):+e;return a(s,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)},p)},8845(e,t,n){var r=n(4576),s=n(9565),i=n(4644),o=n(6198),a=n(8229),c=n(8981),l=n(9039),u=r.RangeError,d=r.Int8Array,h=d&&d.prototype,p=h&&h.set,f=i.aTypedArray,m=i.exportTypedArrayMethod,g=!l(function(){var e=new Uint8ClampedArray(2);return s(p,e,{length:1,0:3},1),3!==e[1]}),y=g&&i.NATIVE_ARRAY_BUFFER_VIEWS&&l(function(){var e=new d(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]});m("set",function(e){f(this);var t=a(arguments.length>1?arguments[1]:void 0,1),n=c(e);if(g)return s(p,this,n,t);var r=this.length,i=o(n),l=0;if(i+t>r)throw new u("Wrong length");for(;l<i;)this[t+l]=n[l++]},!g||y)},373(e,t,n){var r=n(4576),s=n(7476),i=n(9039),o=n(9306),a=n(4488),c=n(4644),l=n(3709),u=n(3763),d=n(9519),h=n(3607),p=c.aTypedArray,f=c.exportTypedArrayMethod,m=r.Uint16Array,g=m&&s(m.prototype.sort),y=!(!g||i(function(){g(new m(2),null)})&&i(function(){g(new m(2),{})})),v=!!g&&!i(function(){if(d)return d<74;if(l)return l<67;if(u)return!0;if(h)return h<602;var e,t,n=new m(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(g(n,function(e,t){return(e/4|0)-(t/4|0)}),e=0;e<516;e++)if(n[e]!==r[e])return!0});f("sort",function(e){return void 0!==e&&o(e),v?g(this,e):a(p(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))},!v||y)}},t={};function n(r){var s=t[r];if(void 0!==s)return s.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,n),i.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var r={};n.r(r),n.d(r,{debug:()=>bv,error:()=>kv,fatal:()=>Tv,fmt:()=>yv,info:()=>Sv,trace:()=>_v,warn:()=>wv});var s={};n.r(s),n.d(s,{count:()=>xv,distribution:()=>Cv,gauge:()=>Iv});var i={};n.r(i),n.d(i,{BrowserClient:()=>di,MULTIPLEXED_TRANSPORT_EXTRA_KEY:()=>$m,OpenFeatureIntegrationHook:()=>ab,SDK_VERSION:()=>a,SEMANTIC_ATTRIBUTE_SENTRY_OP:()=>ft,SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN:()=>mt,SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE:()=>ht,SEMANTIC_ATTRIBUTE_SENTRY_SOURCE:()=>dt,Scope:()=>Re,WINDOW:()=>oi,addBreadcrumb:()=>Oi,addEventProcessor:()=>ti,addIntegration:()=>tt,breadcrumbsIntegration:()=>Qi,browserApiErrorsIntegration:()=>eo,browserProfilingIntegration:()=>Gl,browserSessionIntegration:()=>so,browserTracingIntegration:()=>pl,buildLaunchDarklyFlagUsedHandler:()=>qp,captureConsoleIntegration:()=>Fm,captureEvent:()=>zs,captureException:()=>Fs,captureFeedback:()=>Vp,captureMessage:()=>Us,captureSession:()=>ii,chromeStackLineParser:()=>Mo,close:()=>
1Qs,consoleLoggingIntegration:()=>qm,contextLinesIntegration:()=>o_,continueTrace:()=>ha,createConsolaReporter:()=>Jm,createLangChainCallbackHandler:()=>vy,createTransport:()=>Zr,createUserFeedbackEnvelope:()=>Jv,cultureContextIntegration:()=>io,dedupeIntegration:()=>Pt,defaultRequestInstrumentationOptions:()=>al,defaultStackLineParsers:()=>Uo,defaultStackParser:()=>zo,diagnoseSdkConnectivity:()=>pb,elementTimingIntegration:()=>q_,endSession:()=>ri,eventFiltersIntegration:()=>st,eventFromException:()=>Ls,eventFromMessage:()=>Ds,exceptionFromError:()=>Cs,extraErrorDataIntegration:()=>_y,featureFlagsIntegration:()=>Sy,feedbackAsyncIntegration:()=>Lm,feedbackIntegration:()=>Dm,feedbackSyncIntegration:()=>Dm,flush:()=>Ys,forceLoad:()=>Qo,functionToStringIntegration:()=>ut,geckoStackLineParser:()=>Po,getActiveSpan:()=>Hn,getClient:()=>Ge,getCurrentScope:()=>He,getDefaultIntegrations:()=>Xo,getFeedback:()=>cf,getGlobalScope:()=>Ve,getIsolationScope:()=>qe,getReplay:()=>$p,getRootSpan:()=>zn,getSpanDescendants:()=>Un,getSpanStatusFromHttpCode:()=>un,getTraceData:()=>Kc,globalHandlersIntegration:()=>po,graphqlClientIntegration:()=>p_,growthbookIntegration:()=>db,httpClientIntegration:()=>Qv,httpContextIntegration:()=>_o,inboundFiltersIntegration:()=>it,init:()=>Yo,instrumentAnthropicAiClient:()=>My,instrumentGoogleGenAIClient:()=>Fy,instrumentLangChainEmbeddings:()=>zy,instrumentLangGraph:()=>Jy,instrumentOpenAiClient:()=>sv,instrumentOutgoingRequests:()=>cl,instrumentSupabaseClient:()=>fv,isEnabled:()=>ei,isInitialized:()=>Zs,lastEventId:()=>Xs,launchDarklyIntegration:()=>Hp,lazyLoadIntegration:()=>Pm,linkedErrorsIntegration:()=>Eo,logger:()=>r,makeBrowserOfflineTransport:()=>sb,makeFetchTransport:()=>Go,makeMultiplexedTransport:()=>Bm,metrics:()=>s,moduleMetadataIntegration:()=>Nv,onLoad:()=>Zo,openFeatureIntegration:()=>ob,opera10StackLineParser:()=>jo,opera11StackLineParser:()=>Fo,parameterize:()=>gv,registerSpanErrorInstrumentation:()=>Ia,registerWebWorker:()=>gb,replayCanvasIntegration:()=>H_,replayIntegration:()=>Pp,reportPageLoaded:()=>V_,reportingObserverIntegration:()=>Yv,rewriteFramesIntegration:()=>$v,sendFeedback:()=>Yp,setActiveSpanInBrowser:()=>J_,setContext:()=>Ws,setConversationId:()=>Gs,setCurrentClient:()=>jt,setExtra:()=>qs,setExtras:()=>Hs,setHttpStatus:()=>dn,setMeasurement:()=>ta,setTag:()=>Js,setTags:()=>Vs,setUser:()=>Ks,showReportDialog:()=>Kv,spanStreamingIntegration:()=>Y_,spanToBaggageHeader:()=>Qn,spanToJSON:()=>An,spanToTraceHeader:()=>En,spotlightBrowserIntegration:()=>ib,startBrowserTracingNavigationSpan:()=>ml,startBrowserTracingPageLoadSpan:()=>fl,startInactiveSpan:()=>da,startNewTrace:()=>ma,startSession:()=>ni,startSpan:()=>la,startSpanManual:()=>ua,statsigIntegration:()=>hb,supabaseIntegration:()=>mv,suppressTracing:()=>fa,thirdPartyErrorFilterIntegration:()=>jv,uiProfiler:()=>Vv,unleashIntegration:()=>cb,updateSpanName:()=>Vn,webWorkerIntegration:()=>fb,winjsStackLineParser:()=>Do,withActiveSpan:()=>pa,withIsolationScope:()=>Ke,withScope:()=>Je,withStreamedSpan:()=>Zn,zodErrorsIntegration:()=>qv}),n(4423);const o="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,a="10.48.0",c=globalThis;function l(){return u(c),c}function u(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||a,t[a]=t[a]||{}}function d(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:c;const r=n.__SENTRY__=n.__SENTRY__||{},s=r[a]=r[a]||{};return s[e]||(s[e]=t())}n(9479);const h=Object.prototype.toString;function p(e){switch(h.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return k(e,Error)}}function f(e,t){return h.call(e)===`[object ${t}]`}function m(e){return f(e,"ErrorEvent")}function g(e){return f(e,"DOMError")}function y(e){return f(e,"String")}function v(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function _(e){return null===e||v(e)||"object"!=typeof e&&"function"!=typeof e}function b(e){return f(e,"Object")}function S(e){return"undefined"!=typeof Event&&k(e,Event)}function w(e){return Boolean((null==e?void 0:e.then)&&"function"==typeof e.then)}function k(e,t){try{return e instanceof t}catch{return!1}}function T(e){return!("object"!=typeof e||null===e||!(e.__isVue||e._isVue||e.__v_isVNode))}function E(e){return"undefined"!=typeof Request&&k(e,Request)}const x=c,I=80;function C(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let i=0,o=0;const a=" > ",c=a.length;let l;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||I;for(;n&&i++<r&&(l=O(n,u),!("html"===l||i>1&&o+s.length*c+l.length>=d));)s.push(l),o+=l.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function O(e,t){const n=e,r=[];if(null==n||!n.tagName)return"";if(x.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=null!=t&&t.length?t.filter(e=>n.getAttribute(e)).map(e=>[e,n.getAttribute(e)]):null;
1if(null!=s&&s.length)s.forEach(e=>{r.push(`[${e[0]}="${e[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const e=n.className;if(e&&y(e)){const t=e.split(/\s+/);for(const e of t)r.push(`.${e}`)}}for(const e of["aria-label","type","name","title","alt"]){const t=n.getAttribute(e);t&&r.push(`[${e}="${t}"]`)}return r.join("")}function A(){try{return x.document.location.href}catch{return""}}function M(e){if(!x.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}const R=["debug","info","warn","error","log","assert","trace"],N={};function P(e){if(!("console"in c))return e();const t=c.console,n={},r=Object.keys(N);r.forEach(e=>{const r=N[e];n[e]=t[e],t[e]=r});try{return e()}finally{r.forEach(e=>{t[e]=n[e]})}}function L(){return $().enabled}function D(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];o&&L()&&P(()=>{c.console[e](`Sentry Logger [${e}]:`,...n)})}function $(){return o?d("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const j={enable:function(){$().enabled=!0},disable:function(){$().enabled=!1},isEnabled:L,log:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];D("log",...t)},warn:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];D("warn",...t)},error:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];D("error",...t)}};function B(e,t,n){if(!(t in e))return;const r=e[t];if("function"!=typeof r)return;const s=n(r);"function"==typeof s&&U(s,r);try{e[t]=s}catch{o&&j.log(`Failed to replace method "${t}" in object`,e)}}function F(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{o&&j.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function U(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,F(e,"__sentry_original__",t)}catch{}}function z(e){return e.__sentry_original__}function W(e){if(p(e))return{message:e.message,name:e.name,stack:e.stack,...q(e)};if(S(e)){const t={type:e.type,target:H(e.target),currentTarget:H(e.currentTarget),...q(e)};return"undefined"!=typeof CustomEvent&&k(e,CustomEvent)&&(t.detail=e.detail),t}return e}function H(e){try{return"undefined"!=typeof Element&&k(e,Element)?C(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function q(e){return"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e)):{}}let V;function J(e){if(void 0!==V)return V?V(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=c;return t in n&&"function"==typeof n[t]?(V=n[t],V(e)):(V=null,e())}function K(){return J(()=>Math.random())}function G(){return J(()=>Date.now())}const X=50,Y="?",Q=/\(error: (.*)\)/,Z=/captureMessage|captureException/;function ee(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];const r=t.sort((e,t)=>e[0]-t[0]).map(e=>e[1]);return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;const s=[],i=e.split("\n");for(let e=t;e<i.length;e++){let t=i[e];t.length>1024&&(t=t.slice(0,1024));const o=Q.test(t)?t.replace(Q,"$1"):t;if(!o.includes("Error: ")){for(const e of r){const t=e(o);if(t){s.push(t);break}}if(s.length>=X+n)break}}return function(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(te(t).function||"")&&t.pop(),t.reverse(),Z.test(te(t).function||"")&&(t.pop(),Z.test(te(t).function||"")&&t.pop()),t.slice(0,X).map(e=>({...e,filename:e.filename||te(t).filename,function:e.function||Y}))}(s.slice(n))}}function te(e){return e[e.length-1]||{}}const ne="<anonymous>";function re(e){try{return e&&"function"==typeof e&&e.name||ne}catch{return ne}}function se(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach(t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)}),e}catch{return}}}function ie(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function oe(e){var t;let n=null!=e&&e.startsWith("file://")?e.slice(7):e;return null!==(t=n)&&void 0!==t&&t.match(/\/[A-Z]:/)&&(n=n.slice(1)),n}function ae(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function ce(e,t){let n=e;const r=n.length;if(r<=150)return n;t>r&&(t=r);let s=Math.max(t-60,0);s<5&&(s=0);let i=Math.min(s+140,r);return i>r-5&&(i=r),i===r&&(s=Math.max(i-140,0)),n=n.slice(s,i),s>0&&(n=`'{snip} ${n}`),i<r&&(n+=" {snip}"),n}function le(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{T(r)?n.push(ie(r)):n.push(String(r))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function ue(e,t){let n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return!!y(e)&&(f(t,"RegExp")?t.test(e):y(t)?n?e===t:e.includes(t):"function"==typeof t&&t(e))}function de(e){let t=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).some(n=>ue(e,n,t))}let he;function pe(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){const e=c;return e.crypto||e.msCrypto}();try{if(null!=e&&e.randomUUID)return J(()=>e.randomUUID()).replace(/-/g,"")}catch{}return he||(he=[1e7]+1e3+4e3+8e3+1e11),he.replace(/[018]/g,e=>(e^(16*K()&15)>>e/4).toString(16))}function fe(e){var t;return null===(t=e.exception)||void 0===t||null===(t=t.values)||void 0===t?void 0:t[0]}function me(e){const{message:t,event_id:n}=e;if(t)return t;const r=fe(e);return r?r.type&&r.value?`${r.type}: ${r.value}
1`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ge(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function ye(e,t){const n=fe(e);if(!n)return;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...null==r?void 0:r.data,...t.data};n.mechanism.data=e}}function ve(e){if(function(e){try{return e.__sentry_captured__}catch{}}(e))return!0;try{F(e,"__sentry_captured__",!0)}catch{}return!1}const _e=1e3;function be(){return G()/_e}let Se;function we(){const e=Se??(Se=function(){const{performance:e}=c;if(null==e||!e.now||!e.timeOrigin)return be;const t=e.timeOrigin;return()=>(t+J(()=>e.now()))/_e}());return e()}let ke=null;function Te(){return null===ke&&(ke=function(){var e;const{performance:t}=c;if(null==t||!t.now)return;const n=3e5,r=J(()=>t.now()),s=G(),i=t.timeOrigin;if("number"==typeof i&&Math.abs(i+r-s)<n)return i;const o=null===(e=t.timing)||void 0===e?void 0:e.navigationStart;return"number"==typeof o&&Math.abs(o+r-s)<n?o:s-r}()),ke}function Ee(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||we(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:pe()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function xe(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(!t||"object"!=typeof t||n<=0)return t;if(e&&0===Object.keys(t).length)return e;const r={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(r[e]=xe(r[e],t[e],n-1));return r}function Ie(){return pe()}function Ce(){return pe().substring(16)}const Oe="_sentrySpan";function Ae(e,t){t?F(e,Oe,t):delete e[Oe]}function Me(e){return e[Oe]}class Re{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ie(),sampleRand:K()}}clone(){const e=new Re;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,Ae(e,Me(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ee(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,n=t instanceof Re?t.getScopeData():b(t)?e:void 0,{tags:r,attributes:s,extra:i,user:o,contexts:a,level:c,fingerprint:l=[],propagationContext:u,conversationId:d}=n||{};return this._tags={...this._tags,...r},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...a},o&&Object.keys(o).length&&(this._user=o),c&&(this._level=c),l.length&&(this._fingerprint=l),u&&(this._propagationContext=u),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Ae(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ie(),sampleRand:K()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:be(),...e,message:e.message?ae(e.message,2048):e.message};var s;return this._breadcrumbs.push(r),this._breadcrumbs.length>n&&(this._breadcrumbs=this._breadcrumbs.slice(-n),null===(s=this._client)||void 0===s||s.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:Me(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=xe(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=(null==t?void 0:t.event_id)||pe();if(!this._client)return o&&j.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}captureMessage(e,t,n){const r=(null==n?void 0:n.event_id)||pe();if(!this._client)return o&&j.warn("No client configured on scope - will not capture message!"),r;const s=(null==n?void 0:n.syntheticException)??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:s,...n,event_id:r},this),r}
1captureEvent(e,t){const n=e.event_id||(null==t?void 0:t.event_id)||pe();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(o&&j.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}const Ne=e=>e instanceof Promise&&!e[Pe],Pe=Symbol("chained PromiseLike"),Le=(e,t,n)=>{const r=e.then(e=>(t(e),e),e=>{throw n(e),e});return Ne(r)&&Ne(e)?r:De(e,r)},De=(e,t)=>{let n=!1;for(const r in e){if(r in t)continue;n=!0;const s=e[r];"function"==typeof s?Object.defineProperty(t,r,{value:function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return s.apply(e,n)},enumerable:!0,configurable:!0,writable:!0}):t[r]=s}return n&&Object.assign(t,{[Pe]:!0}),t};class $e{constructor(e,t){let n,r;n=e||new Re,r=t||new Re,this._stack=[{scope:n}],this._isolationScope=r}withScope(e){const t=this._pushScope();let n;try{n=e(t)}catch(e){throw this._popScope(),e}return w(n)?Le(n,()=>this._popScope(),()=>this._popScope()):(this._popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1||!this._stack.pop())}}function je(){const e=u(l());return e.stack=e.stack||new $e(d("defaultCurrentScope",()=>new Re),d("defaultIsolationScope",()=>new Re))}function Be(e){return je().withScope(e)}function Fe(e,t){const n=je();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Ue(e){return je().withScope(()=>e(je().getIsolationScope()))}function ze(e){const t=u(e);return t.acs?t.acs:{withIsolationScope:Ue,withScope:Be,withSetScope:Fe,withSetIsolationScope:(e,t)=>Ue(t),getCurrentScope:()=>je().getScope(),getIsolationScope:()=>je().getIsolationScope()}}let We;function He(){return ze(l()).getCurrentScope()}function qe(){return ze(l()).getIsolationScope()}function Ve(){return d("globalScope",()=>new Re)}function Je(){const e=ze(l());for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(2===n.length){const[t,r]=n;return t?e.withSetScope(t,r):e.withScope(r)}return e.withScope(n[0])}function Ke(){const e=ze(l());for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];if(2===n.length){const[t,r]=n;return t?e.withSetIsolationScope(t,r):e.withIsolationScope(r)}return e.withIsolationScope(n[0])}function Ge(){return He().getClient()}function Xe(e){const t=null===(n=We)||void 0===n?void 0:n();var n;if(t)return{trace_id:t.traceId,span_id:t.spanId};const r=e.getPropagationContext(),{traceId:s,parentSpanId:i,propagationSpanId:o}=r,a={trace_id:s,span_id:o||Ce()};return i&&(a.parent_span_id=i),a}const Ye=[];function Qe(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;if(t.forEach(e=>{e.isDefaultInstance=!0}),Array.isArray(n))r=[...t,...n];else if("function"==typeof n){const e=n(t);r=Array.isArray(e)?e:[e]}else r=t;return function(e){const t={};return e.forEach(e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)}),Object.values(t)}(r)}function Ze(e,t){for(const n of t)null!=n&&n.afterAllSetup&&n.afterAllSetup(e)}function et(e,t,n){if(n[t.name])o&&j.log(`Integration skipped because it was already installed: ${t.name}`);else{if(n[t.name]=t,Ye.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),Ye.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const n=t.preprocessEvent.bind(t);e.on("preprocessEvent",(t,r)=>n(t,r,e))}if("function"==typeof t.processEvent){const n=t.processEvent.bind(t),r=Object.assign((t,r)=>n(t,r,e),{id:t.name});e.addEventProcessor(r)}o&&j.log(`Integration installed: ${t.name}`)}}
1function tt(e){const t=Ge();t?t.addIntegration(e):o&&j.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`)}function nt(e){const t=[];e.message&&t.push(e.message);try{const n=e.exception.values[e.exception.values.length-1];null!=n&&n.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}const rt=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],st=function(){let e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{name:"EventFilters",setup(n){const r=n.getOptions();e=ot(t,r)},processEvent(n,r,s){if(!e){const n=s.getOptions();e=ot(t,n)}return function(e,t){if(e.type){if("transaction"===e.type&&function(e,t){if(null==t||!t.length)return!1;const n=e.transaction;return!!n&&de(n,t)}(e,t.ignoreTransactions))return o&&j.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${me(e)}`),!0}else{if(function(e,t){return!(null==t||!t.length)&&nt(e).some(e=>de(e,t))}(e,t.ignoreErrors))return o&&j.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${me(e)}`),!0;if(function(e){var t;return!(null===(t=e.exception)||void 0===t||null===(t=t.values)||void 0===t||!t.length)&&(!e.message&&!e.exception.values.some(e=>e.stacktrace||e.type&&"Error"!==e.type||e.value))}(e))return o&&j.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${me(e)}`),!0;if(function(e,t){if(null==t||!t.length)return!1;const n=at(e);return!!n&&de(n,t)}(e,t.denyUrls))return o&&j.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${me(e)}.\nUrl: ${at(e)}`),!0;if(!function(e,t){if(null==t||!t.length)return!0;const n=at(e);return!n||de(n,t)}(e,t.allowUrls))return o&&j.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${me(e)}.\nUrl: ${at(e)}`),!0}return!1}(n,e)?null:n}}},it=function(){return{...st(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),name:"InboundFilters"}};function ot(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:rt],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function at(e){try{var t,n;const r=[...(null===(t=e.exception)||void 0===t?void 0:t.values)??[]].reverse().find(e=>{var t,n;return void 0===(null===(t=e.mechanism)||void 0===t?void 0:t.parent_id)&&(null===(n=e.stacktrace)||void 0===n||null===(n=n.frames)||void 0===n?void 0:n.length)}),s=null==r||null===(n=r.stacktrace)||void 0===n?void 0:n.frames;return s?function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}(s):null}catch{return o&&j.error(`Cannot extract url for event ${me(e)}`),null}}let ct;const lt=new WeakMap,ut=()=>({name:"FunctionToString",setupOnce(){ct=Function.prototype.toString;try{Function.prototype.toString=function(){const e=z(this),t=lt.has(Ge())&&void 0!==e?e:this;for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return ct.apply(t,r)}}catch{}},setup(e){lt.set(e,!0)}}),dt="sentry.source",ht="sentry.sample_rate",pt="sentry.previous_trace_sample_rate",ft="sentry.op",mt="sentry.origin",gt="sentry.idle_span_finish_reason",yt="sentry.measurement_unit",vt="sentry.measurement_value",_t="sentry.release",bt="sentry.environment",St="sentry.segment.name",wt="sentry.segment.id",kt="sentry.sdk.name",Tt="sentry.sdk.version",Et="user.id",xt="user.email",It="user.ip_address",Ct="user.n
1ame",Ot="sentry.custom_span_name",At="sentry.profile_id",Mt="sentry.exclusive_time",Rt="sentry.link.type",Nt=()=>({name:"ConversationId",setup(e){e.on("spanStart",e=>{const t=He().getScopeData(),n=qe().getScopeData(),r=t.conversationId||n.conversationId;r&&e.setAttribute("gen_ai.conversation.id",r)})}}),Pt=()=>{let e;return{name:"Dedupe",processEvent(t){if(t.type)return t;try{if(function(e,t){return!!t&&(!!function(e,t){const n=e.message,r=t.message;return!(!n&&!r)&&(!(n&&!r||!n&&r)&&(n===r&&(!!Dt(e,t)&&!!Lt(e,t))))}(e,t)||!!function(e,t){const n=$t(t),r=$t(e);return!(!n||!r)&&(n.type===r.type&&n.value===r.value&&(!!Dt(e,t)&&!!Lt(e,t)))}(e,t))}(t,e))return o&&j.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}};function Lt(e,t){let n=se(e),r=se(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],s=n[e];if(t.filename!==s.filename||t.lineno!==s.lineno||t.colno!==s.colno||t.function!==s.function)return!1}return!0}function Dt(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch{return!1}}function $t(e){var t;return null===(t=e.exception)||void 0===t||null===(t=t.values)||void 0===t?void 0:t[0]}function jt(e){He().setClient(e)}const Bt=/^o(\d+)\./,Ft=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Ut(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const{host:n,path:r,pass:s,port:i,projectId:o,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${o}`}function zt(e){const t=Ft.exec(e);if(!t)return void P(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});const[n,r,s="",i="",o="",a=""]=t.slice(1);let c="",l=a;const u=l.split("/");if(u.length>1&&(c=u.slice(0,-1).join("/"),l=u.pop()),l){const e=l.match(/^\d+/);e&&(l=e[0])}return Wt({host:i,pass:s,path:c,projectId:l,port:o,protocol:n,publicKey:r})}function Wt(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Ht(e){const t=e.getOptions(),{host:n}=e.getDsn()||{};let r;return t.orgId?r=String(t.orgId):n&&(r=function(e){const t=e.match(Bt);return null==t?void 0:t[1]}(n)),r}function qt(e){const t="string"==typeof e?zt(e):Wt(e);if(t&&function(e){if(!o)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find(t=>!e[t]&&(j.error(`Invalid Sentry Dsn: ${t} missing`),!0))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(j.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(j.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(j.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}const Vt="7";function Jt(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Kt(e,t,n){return t||`${function(e){return`${Jt(e)}${e.projectId}/envelope/`}(e)}?${function(e,t){const n={sentry_version:Vt};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}(e,n)}`}const Gt="production",Xt="sentry-",Yt=8192;function Qt(e){const t=function(e){if(e&&(y(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce((e,t)=>{const n=en(t);return Object.entries(n).forEach(t=>{let[n,r]=t;e[n]=r}),e},{}):en(e)}(e);if(!t)return;const n=Object.entries(t).reduce((e,t)=>{let[n,r]=t;return n.startsWith(Xt)&&(e[n.slice(Xt.length)]=r),e},{});return Object.keys(n).length>0?n:void 0}function Zt(e){if(e)return function(e){if(0!==Object.keys(e).length)return Object.entries(e).reduce((e,t,n)=>{let[r,s]=t;const i=`${encodeURIComponent(r)}=${encodeURIComponent(s)}`,a=0===n?i:`${e},${i}`;return a.length>Yt?(o&&j.warn(`Not adding key: ${r} with val: ${s} to baggage header due to exceeding baggage size limits.`),e):a},"")}(Object.entries(e).reduce((e,t)=>{let[n,r]=t;return r&&(e[`${Xt}${n}`]=r),e},{}))}function en(e){return e.split(",").map(e=>{const t=e.indexOf("=");return-1===t?[]:[e.slice(0,t),e.slice(t+1)].map(e=>{try{return decodeURIComponent(e.trim())}catch{return}})}).reduce((e,t)=>
1{let[n,r]=t;return n&&r&&(e[n]=r),e},{})}function tn(e){var t;if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const n=e||(null===(t=Ge())||void 0===t?void 0:t.getOptions());return!(!n||null==n.tracesSampleRate&&!n.tracesSampler)}function nn(e,t){const{value:n,unit:r}="object"==typeof(s=e)&&null!=s&&!Array.isArray(s)&&Object.keys(s).includes("value")?e:{value:e,unit:void 0};var s;const i=function(e){const t="string"==typeof e?"string":"boolean"==typeof e?"boolean":"number"!=typeof e||Number.isNaN(e)?null:Number.isInteger(e)?"integer":"double";if(t)return{value:e,type:t}}(n),o=r&&"string"==typeof r?{unit:r}:{};if(i)return{...i,...o};if(!t||"skip-undefined"===t&&void 0===n)return;let a="";try{a=JSON.stringify(n)??""}catch{}return{value:a,type:"string",...o}}function rn(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];const n={};for(const[r,s]of Object.entries(e??{})){const e=nn(s,t);e&&(n[r]=e)}return n}function sn(e){if(!e)return 0;let t=0;for(const[r,s]of Object.entries(e)){var n;t+=2*r.length,t+=2*s.type.length,t+=2*((null===(n=s.unit)||void 0===n?void 0:n.length)??0);const e=s.value;Array.isArray(e)?t+=on(e[0])*e.length:_(e)?t+=on(e):t+=100}return t}function on(e){return"string"==typeof e?2*e.length:"boolean"==typeof e?4:"number"==typeof e?8:0}const an=0,cn=1,ln=2;function un(e){if(e<400&&e>=100)return{code:cn};if(e>=400&&e<500)switch(e){case 401:return{code:ln,message:"unauthenticated"};case 403:return{code:ln,message:"permission_denied"};case 404:return{code:ln,message:"not_found"};case 409:return{code:ln,message:"already_exists"};case 413:return{code:ln,message:"failed_precondition"};case 429:return{code:ln,message:"resource_exhausted"};case 499:return{code:ln,message:"cancelled"};default:return{code:ln,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:ln,message:"unimplemented"};case 503:return{code:ln,message:"unavailable"};case 504:return{code:ln,message:"deadline_exceeded"};default:return{code:ln,message:"internal_error"}}return{code:ln,message:"internal_error"}}function dn(e,t){e.setAttribute("http.response.status_code",t);const n=un(t);"unknown_error"!==n.message&&e.setStatus(n)}const hn="_sentryScope",pn="_sentryIsolationScope";function fn(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}function mn(e){const t=e;return{scope:t[hn],isolationScope:fn(t[pn])}}function gn(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}const yn=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function vn(e,t){const n=function(e){if(!e)return;const t=e.match(yn);if(!t)return;let n;return"1"===t[3]?n=!0:"0"===t[3]&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}(e),r=Qt(t);if(null==n||!n.traceId)return{traceId:Ie(),sampleRand:K()};const s=function(e,t){const n=gn(null==t?void 0:t.sample_rand);if(void 0!==n)return n;const r=gn(null==t?void 0:t.sample_rate);return r&&void 0!==(null==e?void 0:e.parentSampled)?e.parentSampled?K()*r:r+K()*(1-r):K()}(n,r);r&&(r.sample_rand=s.toString());const{traceId:i,parentSpanId:o,parentSampled:a}=n;return{traceId:i,parentSpanId:o,sampled:a,dsc:r||{},sampleRand:s}}function _n(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ie(),t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce(),n=arguments.length>2?arguments[2]:void 0,r="";return void 0!==n&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function bn(){return`00-${arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ie()}-${arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ce()}-${(arguments.length>2?arguments[2]:void 0)?"01":"00"}`}const Sn=1;let wn=!1;function kn(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:s,parent_span_id:i,status:o,origin:a,links:c}=An(e);return{parent_span_id:i,span_id:t,trace_id:n,data:r,op:s,status:o,origin:a,links:c}}function Tn(e){const{spanId:t,traceId:n,isRemote:r}=e.spanContext(),s=r?t:An(e).parent_span_id,i=mn(e).scope;return{parent_span_id:s,span_id:r?(null==i?void 0:i.getPropagationContext().propagationSpanId)||Ce():t,trace_id:n}}function En(e){const{traceId:t,spanId:n}=e.spanContext();return _n(t,n,Ln(e))}function xn(e){return e&&e.length>0?e.map(e=>{let{context:{spanId:t,traceId:n,traceFlags:r,...s},attributes:i}=e;return{span_id:t,trace_id:n,sampled:r===Sn,attributes:i,...s}}):void 0}function In(e){return null!=e&&e.length?e.map(e=>{let{context:{spanId:t,traceId:n,traceFlags:r},attributes:s}=e;return{span_id:t,trace_id:n,sampled:r===Sn,attributes:s}}):void 0}function Cn(e){return"number"==typeof e?On(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?On(e.getTime()):we()}function On(e){return e>9999999999?e/1e3:e}function An(e){if(Pn(e))return e.getSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(Nn(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:i,parent_span_id:Rn(e),start_timestamp:Cn(s),timestamp:Cn(o)||void 0,status:Dn(a),op:r[ft],origin:r[mt],links:xn(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Mn(e){if(Pn(e))return e.getStreamedSpanJSON();const{spanId:t,traceId:n}=e.spanContext();if(Nn(e)){const{attributes:r,startTime:s,name:i,endTime:o,status:a,links:c}=e;return{name:i,span_id:t,trace_id:n,parent_span_id:Rn(e),start_timestamp:Cn(s),end_timestamp:Cn(o),is_segment:e===Wn(e),status:$n(a),attributes:r,links:In(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Wn(e)}}function Rn(e){var t;return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?null===(t=e.parentSpanContext)||void 0===t?void 0:t.spanId:void 0}function Nn(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}function Pn(e){return"function"==typeof e.getSpanJSON}function Ln(e){const{traceFlags:t}=e.spanContext();return t===Sn}function Dn(e){if(e&&e.code!==an)return e.code===cn?"ok":e.message||"internal_error"}function $n(e){return e&&e.code!==cn&&e.code!==an&&"cancelled"!==e.message?"error":"ok"}const jn="_sentryChildSpans",Bn="_sentryRootSpan";function Fn(e,t){const n=e[Bn]||e;F(t,Bn,n),e[jn]?e[jn].add(t):F(e,jn,new Set([t]))}function Un(e){const t=new Set;return function e(n){if(!t.has(n)&&Ln(n)){t.add(n);const r=n[jn]?Array.from(n[jn]):[];for(const t of r)e(t)}}(e),Array.from(t)}const zn=Wn;function Wn(e){return e[Bn]||e}function Hn(){const e=ze(l());return e.getActiveSpan?e.getActiveSpan():Me(He())}function qn(){wn||(P(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),wn=!0)}function Vn(e,t){e.updateName(t),e.setAttributes({[dt]:"custom",[Ot]:t})}const Jn="_frozenDsc";function Kn(e,t){F(e,Jn,t)}function Gn(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s={environment:n.environment||Gt,release:n.release,public_key:r,trace_id:e,org_id:Ht(t)};return t.emit("createDsc",s),s}function Xn(e,t){const n=t.getPropagationContext();return n.dsc||Gn(n.traceId,e)}
1function Yn(e){const t=Ge();if(!t)return{};const n=zn(e),r=An(n),s=r.data,i=n.spanContext().traceState,o=(null==i?void 0:i.get("sentry.sample_rate"))??s[ht]??s[pt];function a(e){return"number"!=typeof o&&"string"!=typeof o||(e.sample_rate=`${o}`),e}const c=n[Jn];if(c)return a(c);const l=null==i?void 0:i.get("sentry.dsc"),u=l&&Qt(l);if(u)return a(u);const d=Gn(e.spanContext().traceId,t),h=s[dt]??s["sentry.span.source"],p=r.description;var f;return"url"!==h&&p&&(d.transaction=p),tn()&&(d.sampled=String(Ln(n)),d.sample_rand=(null==i?void 0:i.get("sentry.sample_rand"))??(null===(f=mn(n).scope)||void 0===f?void 0:f.getPropagationContext().sampleRand.toString())),a(d),t.emit("createDsc",d,n),d}function Qn(e){return Zt(Yn(e))}function Zn(e){return F(e,"_streamed",!0),e}function er(e){return!!e&&"function"==typeof e&&"_streamed"in e&&!!e._streamed}function tr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0;try{return rr("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function nr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:102400;const r=tr(e,t);return s=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(s))>n?nr(e,t-1,n):r;var s}function rr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1/0,r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1/0,s=arguments.length>4&&void 0!==arguments[4]?arguments[4]:function(){const e=new WeakSet;return[function(t){return!!e.has(t)||(e.add(t),!1)},function(t){e.delete(t)}]}();const[i,o]=s;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const a=function(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof globalThis&&t===globalThis)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(T(t))return ie(t);if(b(n=t)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n)return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${re(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=function(e){const t=Object.getPrototypeOf(e);return null!=t&&t.constructor?t.constructor.name:"null prototype"}(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}var n}(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const c="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:n;if(0===c)return a.replace("object ","");if(i(t))return"[Circular ~]";const l=t;if(l&&"function"==typeof l.toJSON)try{return rr("",l.toJSON(),c-1,r,s)}catch{}const u=Array.isArray(t)?[]:{};let d=0;const h=W(t);for(const e in h){if(!Object.prototype.hasOwnProperty.call(h,e))continue;if(d>=r){u[e]="[MaxProperties ~]";break}const t=h[e];u[e]=rr(e,t,c-1,r,s),d++}return o(t),u}function sr(e){return[e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]]}function ir(e,t){const[n,r]=e;return[n,[...r,t]]}function or(e,t){const n=e[1];for(const e of n)if(t(e,e[0].type))return!0;return!1}function ar(e,t){return or(e,(e,n)=>t.includes(n))}function cr(e){const t=u(c);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function lr(e){const[t,n]=e;let r=JSON.stringify(t);function s(e){"string"==typeof r?r="string"==typeof e?r+e:[cr(r),e]:r.push("string"==typeof e?cr(e):e)}for(const e of n){const[t,n]=e;if(s(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)s(n);else{let e;try{e=JSON.stringify(n)}catch{e=JSON.stringify(tr(n))}s(e)}}return"string"==typeof r?r:function(e){const t=e.reduce((e,t)=>e+t.length,0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(r)}function ur(e){return[{type:"span"},e]}function dr(e){const t="string"==typeof e.data?cr(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}n(5044),n(8845),n(373);const hr={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function pr(e){return function(e){return e in hr}(e)?hr[e]:e}function fr(e){if(null==e||!e.sdk)return;
1const{name:t,version:n}=e.sdk;return{name:t,version:n}}function mr(e,t,n,r){var s;const i=null===(s=e.sdkProcessingMetadata)||void 0===s?void 0:s.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:Ut(r)},...i&&{trace:i}}}function gr(e){j.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function yr(e,t){if(null==t||!t.length||!e.description)return!1;for(const n of t){if(_r(n)){if(ue(e.description,n))return o&&gr(e),!0;continue}if(!n.name&&!n.op)continue;const t=!n.name||ue(e.description,n.name),r=!n.op||e.op&&ue(e.op,n.op);if(t&&r)return o&&gr(e),!0}return!1}function vr(e,t){const n=t.parent_span_id,r=t.span_id;if(n)for(const t of e)t.parent_span_id===r&&(t.parent_span_id=n)}function _r(e){return"string"==typeof e||e instanceof RegExp}function br(e,t){const{extra:n,tags:r,attributes:s,user:i,contexts:o,level:a,sdkProcessingMetadata:c,breadcrumbs:l,fingerprint:u,eventProcessors:d,attachments:h,propagationContext:p,transactionName:f,span:m}=t;Sr(e,"extra",n),Sr(e,"tags",r),Sr(e,"attributes",s),Sr(e,"user",i),Sr(e,"contexts",o),e.sdkProcessingMetadata=xe(e.sdkProcessingMetadata,c,2),a&&(e.level=a),f&&(e.transactionName=f),m&&(e.span=m),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),d.length&&(e.eventProcessors=[...e.eventProcessors,...d]),h.length&&(e.attachments=[...e.attachments,...h]),e.propagationContext={...e.propagationContext,...p}}function Sr(e,t,n){e[t]=xe(e[t],n,1)}function wr(e,t){const n=Ve().getScopeData();return e&&br(n,e.getScopeData()),t&&br(n,t.getScopeData()),n}const kr="sentry.timestamp.sequence";let Tr,Er=0;function xr(e){const t=Math.floor(1e3*e);void 0!==Tr&&t!==Tr&&(Er=0);const n=Er;return Er++,Tr=t,{key:kr,value:{value:n,type:"integer"}}}function Ir(e,t){return t?Je(t,()=>{const n=Hn(),r=n?Tn(n):Xe(t);return[n?Yn(n):Xn(e,t),r]}):[void 0,void 0]}const Cr={trace:1,debug:5,info:9,warn:13,error:17,fatal:21},Or=100;function Ar(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];!n||e[t]&&!r||(e[t]=n)}function Mr(e,t){const n=Lr(),r=Pr(e);void 0===r?n.set(e,[t]):r.length>=Or?(Nr(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Rr(e){var t;let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:He(),r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Mr;const s=(null==n?void 0:n.getClient())??Ge();if(!s)return void(o&&j.warn("No client available to capture log."));const{release:i,environment:a,enableLogs:c=!1,beforeSendLog:l}=s.getOptions();if(!c)return void(o&&j.warn("logging option not enabled, log will not be captured."));const[,u]=Ir(s,n),d={...e.attributes},{user:{id:h,email:p,username:f},attributes:m={}}=wr(qe(),n);Ar(d,"user.id",h,!1),Ar(d,"user.email",p,!1),Ar(d,"user.name",f,!1),Ar(d,"sentry.release",i),Ar(d,"sentry.environment",a);const{name:g,version:y}=(null===(t=s.getSdkMetadata())||void 0===t?void 0:t.sdk)??{};Ar(d,"sentry.sdk.name",g),Ar(d,"sentry.sdk.version",y);const _=s.getIntegrationByName("Replay"),b=null==_?void 0:_.getReplayId(!0);Ar(d,"sentry.replay_id",b),b&&"buffer"===(null==_?void 0:_.getRecordingMode())&&Ar(d,"sentry._internal.replay_is_buffering",!0);const S=e.message;if(v(S)){const{__sentry_template_string__:e,__sentry_template_values__:t=[]}=S;null!=t&&t.length&&(d["sentry.message.template"]=e),t.forEach((e,t)=>{d[`sentry.message.parameter.${t}`]=e})}const w=Me(n);Ar(d,"sentry.trace.parent_span_id",null==w?void 0:w.spanContext().spanId);const k={...e,attributes:d};s.emit("beforeCaptureLog",k);const T=l?P(()=>l(k)):k;if(!T)return s.recordDroppedEvent("before_send","log_item",1),void(o&&j.warn("beforeSendLog returned null, log will not be captured."));const{level:E,message:x,attributes:I={},severityNumber:C}=T,O=we(),A=xr(O);r(s,{timestamp:O,level:E,body:x,trace_id:null==u?void 0:u.trace_id,severity_number:C??Cr[E],attributes:{...rn(m),...rn(I,!0),[A.key]:A.value}}),s.emit("afterCaptureLog",T)}function Nr(e,t){const n=t??Pr(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return null!=t&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Ut(r)),sr(s,[(i=e,[{type:"log",item_count:i.length,content_type:"application/vnd.sentry.items.log+json"},{items:i}])]);var i}(n,r._metadata,r.tunnel,e.getDsn());Lr().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(s)}function Pr(e){return Lr().get(e)}function Lr(){return d("clientToLogBufferMap",()=>new WeakMap)}const Dr=1e3;function $r(e,t,n){!n||arguments.length>3&&void 0!==arguments[3]&&!arguments[3]&&t in e||(e[t]=n)}function jr(e,t){const n=Ur(),r=Fr(e);void 0===r?n.set(e,[t]):r.length>=Dr?(Br(e,r),n.set(e,[t])):n.set(e,[...r,t])}function Br(e,t){const n=t??Fr(e)??[];if(0===n.length)return;const r=e.getOptions(),s=function(e,t,n,r){const s={};return null!=t&&t.sdk&&(s.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(s.dsn=Ut(r)),sr(s,[(i=e,[{type:"trace_metric",item_count:i.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:i}])]);var i}(n,r._metadata,r.tunnel,e.getDsn());Ur().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(s)}
1function Fr(e){return Ur().get(e)}function Ur(){return d("clientToMetricBufferMap",()=>new WeakMap)}function zr(e){return new Hr(t=>{t(e)})}function Wr(e){return new Hr((t,n)=>{n(e)})}class Hr{constructor(e){this._state=0,this._handlers=[],this._runExecutor(e)}then(e,t){return new Hr((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()})}catch(e){return this.then(e=>e,e)}finally(e){return new Hr((t,n)=>{let r,s;return this.then(t=>{s=!1,r=t,e&&e()},t=>{s=!0,r=t,e&&e()}).then(()=>{s?n(r):t(r)})})}_executeHandlers(){if(0===this._state)return;const e=this._handlers.slice();this._handlers=[],e.forEach(e=>{e[0]||(1===this._state&&e[1](this._value),2===this._state&&e[2](this._value),e[0]=!0)})}_runExecutor(e){const t=(e,t)=>{0===this._state&&(w(t)?t.then(n,r):(this._state=e,this._value=t,this._executeHandlers()))},n=e=>{t(1,e)},r=e=>{t(2,e)};try{e(n,r)}catch(e){r(e)}}}function qr(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}const Vr=Symbol.for("SentryBufferFullError");function Jr(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:100;const t=new Set;function n(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(r){if(!(t.size<e))return Wr(Vr);const s=r();return t.add(s),s.then(()=>n(s),()=>n(s)),s},drain:function(e){if(!t.size)return zr(!0);const n=Promise.allSettled(Array.from(t)).then(()=>!0);if(!e)return n;const r=[n,new Promise(t=>qr(setTimeout(()=>t(!1),e)))];return Promise.race(r)}}}const Kr=6e4;function Gr(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:G();const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?Kr:r-t}function Xr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:G();return function(e,t){return e[t]||e.all||0}(e,t)>n}function Yr(e,t){let{statusCode:n,headers:r}=t,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:G();const i={...e},o=null==r?void 0:r["x-sentry-rate-limits"],a=null==r?void 0:r["retry-after"];if(o)for(const e of o.trim().split(",")){const[t,n,,,r]=e.split(":",5),o=parseInt(t,10),a=1e3*(isNaN(o)?60:o);if(n)for(const e of n.split(";"))"metric_bucket"===e&&r&&!r.split(";").includes("custom")||(i[e]=s+a);else i.all=s+a}else a?i.all=s+Gr(a,s):429===n&&(i.all=s+6e4);return i}const Qr=64;function Zr(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Jr(e.bufferSize||Qr),r={};return{send:function(s){const i=[];if(or(s,(t,n)=>{const s=pr(n);Xr(r,s)?e.recordDroppedEvent("ratelimit_backoff",s):i.push(t)}),0===i.length)return Promise.resolve({});const a=sr(s[0],i),c=t=>{ar(a,["client_report"])?o&&j.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`):or(a,(n,r)=>{e.recordDroppedEvent(t,pr(r))})};return n.add(()=>t({body:lr(a)}).then(e=>413===e.statusCode?(o&&j.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),c("send_error"),e):(o&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&j.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Yr(r,e),e),e=>{throw c("network_error"),o&&j.error("Encountered error running transport request:",e),e})).then(e=>e,e=>{if(e===Vr)return o&&j.error("Skipped sending event because buffer is full."),c("queue_overflow"),Promise.resolve({});throw e})},flush:e=>n.drain(e)}}
1function es(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;try{const s=ts(t,n,e,r);return w(s)?s:zr(s)}catch(e){return Wr(e)}}function ts(e,t,n,r){const s=n[r];if(!e||!s)return e;const i=s({...e},t);return o&&null===i&&j.log(`Event processor "${s.id||"?"}" dropped event`),w(i)?i.then(e=>ts(e,t,n,r+1)):ts(i,t,n,r+1)}let ns,rs,ss,is;function os(e){const t=c._sentryDebugIds,n=c._debugIds;if(!t&&!n)return{};const r=t?Object.keys(t):[],s=n?Object.keys(n):[];if(is&&r.length===rs&&s.length===ss)return is;rs=r.length,ss=s.length,is={},ns||(ns={});const i=(t,n)=>{for(const s of t){var r;const t=n[s],i=null===(r=ns)||void 0===r?void 0:r[s];if(i&&is&&t)is[i[0]]=t,ns&&(ns[s]=[i[0],t]);else if(t){const n=e(s);for(let e=n.length-1;e>=0;e--){const r=n[e],i=null==r?void 0:r.filename;if(i&&is&&ns){is[i]=t,ns[s]=[i,t];break}}}}};return t&&i(r,t),n&&i(s,n),is}function as(e,t,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||pe(),timestamp:t.timestamp||be()},l=n.integrations||e.integrations.map(e=>e.name);!function(e,t){const{environment:n,release:r,dist:s,maxValueLength:i}=t;e.environment=e.environment||n||Gt,!e.release&&r&&(e.release=r),!e.dist&&s&&(e.dist=s);const o=e.request;var a;null!=o&&o.url&&i&&(o.url=ae(o.url,i)),i&&(null===(a=e.exception)||void 0===a||null===(a=a.values)||void 0===a||a.forEach(e=>{e.value&&(e.value=ae(e.value,i))}))}(c,e),function(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}(c,l),s&&s.emit("applyFrameMetadata",t),void 0===t.type&&function(e,t){var n;const r=os(t);null===(n=e.exception)||void 0===n||null===(n=n.values)||void 0===n||n.forEach(e=>{var t;null===(t=e.stacktrace)||void 0===t||null===(t=t.frames)||void 0===t||t.forEach(e=>{e.filename&&(e.debug_id=r[e.filename])})})}(c,e.stackParser);const u=function(e,t){if(!t)return e;const n=e?e.clone():new Re;return n.update(t),n}(r,n.captureContext);n.mechanism&&ye(c,n.mechanism);const d=s?s.getEventProcessors():[],h=wr(i,u),p=[...n.attachments||[],...h.attachments];p.length&&(n.attachments=p),function(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=t;!function(e,t){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(s).length&&(e.user={...s,...e.user}),Object.keys(i).length&&(e.contexts={...i,...e.contexts}),o&&(e.level=o),a&&"transaction"!==e.type&&(e.transaction=a)}(e,t),r&&function(e,t){e.contexts={trace:Tn(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Yn(t),...e.sdkProcessingMetadata};const n=An(zn(t)).description;n&&!e.transaction&&"transaction"===e.type&&(e.transaction=n)}(e,r),function(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}(e,n),function(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}(e,s),function(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}(e,i)}(c,h);const f=[...d,...h.eventProcessors];return(n.data&&!0===n.data.__sentry__?zr(c):es(f,c,n)).then(e=>(e&&function(e){var t;const n={};if(null===(t=e.exception)||void 0===t||null===(t=t.values)||void 0===t||t.forEach(e=>{var t;null===(t=e.stacktrace)||void 0===t||null===(t=t.frames)||void 0===t||t.forEach(e=>{e.debug_id&&(e.abs_path?n[e.abs_path]=e.debug_id:e.filename&&(n[e.filename]=e.debug_id),delete e.debug_id)})}),0===Object.keys(n).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const r=e.debug_meta.images;Object.entries(n).forEach(e=>{let[t,n]=e;r.push({type:"sourcemap",code_file:t,debug_id:n})})}(e),"number"==typeof o&&o>0?function(e,t,n){var r,s;if(!e)return null;const i={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(e=>({...e,...e.data&&{data:tr(e.data,t,n)}}))},...e.user&&{user:tr(e.user,t,n)},...e.contexts&&{contexts:tr(e.contexts,t,n)},...e.extra&&{extra:tr(e.extra,t,n)}};return null!==(r=e.contexts)&&void 0!==r&&r.trace&&i.contexts&&(i.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(i.contexts.trace.data=tr(e.contexts.trace.data,t,n))),e.spans&&(i.spans=e.spans.map(e=>({...e,...e.data&&{data:tr(e.data,t,n)}}))),null!==(s=e.contexts)&&void 0!==s&&s.flags&&i.contexts&&(i.contexts.flags=tr(e.contexts.flags,3,n)),i}(e,o,a):e))}const cs=["user","level","extra","contexts","tags","fingerprint","propagationContext"],ls="Not capturing exception because it's already been captured.",us="Discarded session because of missing or non-string release",ds=Symbol.for("SentryInternalError"),hs=Symbol.for("SentryDoNotSendEventError");function ps(e){return{message:e,[ds]:!0}}function fs(e){return{message:e,[hs]:!0}}function ms(e){return!!e&&"object"==typeof e&&ds in e}function gs(e){return!!e&&"object"==typeof e&&hs in e}
1function ys(e,t,n,r,s){let i,o=0,a=!1;e.on(n,()=>{o=0,clearTimeout(i),a=!1}),e.on(t,t=>{o+=r(t),o>=8e5?s(e):a||(a=!0,i=qr(setTimeout(()=>{s(e)},5e3)))}),e.on("flush",()=>{s(e)})}class vs{constructor(e){var t,n,r;if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Jr((null===(t=e.transportOptions)||void 0===t?void 0:t.bufferSize)??Qr),e.dsn?this._dsn=qt(e.dsn):o&&j.warn("No DSN provided, client will not send events."),this._dsn){const t=Kt(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??(null===(n=this._options._experiments)||void 0===n?void 0:n.enableLogs),this._options.enableLogs&&ys(this,"afterCaptureLog","flushLogs",ks,Nr),(this._options.enableMetrics??(null===(r=this._options._experiments)||void 0===r?void 0:r.enableMetrics)??1)&&ys(this,"afterCaptureMetric","flushMetrics",ws,Br)}captureException(e,t,n){const r=pe();if(ve(e))return o&&j.log(ls),r;const s={event_id:r,...t};return this._process(()=>this.eventFromException(e,s).then(e=>this._captureEvent(e,s,n)).then(e=>e),"error"),s.event_id}captureMessage(e,t,n,r){const s={event_id:pe(),...n},i=v(e)?e:String(e),o=_(e),a=o?this.eventFromMessage(i,t,s):this.eventFromException(e,s);return this._process(()=>a.then(e=>this._captureEvent(e,s,r)),o?"unknown":"error"),s.event_id}captureEvent(e,t,n){const r=pe();if(null!=t&&t.originalException&&ve(t.originalException))return o&&j.log(ls),r;const s={event_id:r,...t},i=e.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,l=_s(e.type);return this._process(()=>this._captureEvent(e,s,a||n,c),l),s.event_id}captureSession(e){this.sendSession(e),Ee(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(!t)return!0;this.emit("flush");const n=await this._isClientDoneProcessing(e),r=await t.flush(e);return n&&r}async close(e){Nr(this);const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(e=>{let{name:t}=e;return t.startsWith("Spotlight")}))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];!t&&e.beforeSetup&&e.beforeSetup(this),et(this,e,this._integrations),t||Ze(this,[e])}sendEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.emit("beforeSendEvent",e,t);let n=function(e,t,n,r){const s=fr(n),i=e.type&&"replay_event"!==e.type?e.type:"event";!function(e,t){var n,r,s,i;if(!t)return e;const o=e.sdk||{};e.sdk={...o,name:o.name||t.name,version:o.version||t.version,integrations:[...(null===(n=e.sdk)||void 0===n?void 0:n.integrations)||[],...t.integrations||[]],packages:[...(null===(r=e.sdk)||void 0===r?void 0:r.packages)||[],...t.packages||[]],settings:null!==(s=e.sdk)&&void 0!==s&&s.settings||t.settings?{...null===(i=e.sdk)||void 0===i?void 0:i.settings,...t.settings}:void 0}}(e,null==n?void 0:n.sdk);const o=mr(e,s,r,t);return delete e.sdkProcessingMetadata,sr(o,[[{type:i},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=ir(n,dr(e));this.sendEnvelope(n).then(t=>this.emit("afterSendEvent",e,t))}sendSession(e){const{release:t,environment:n=Gt}=this._options;if("aggregates"in e){const r=e.attrs||{};if(!r.release&&!t)return void(o&&j.warn(us));r.release=r.release||t,r.environment=r.environment||n,e.attrs=r}else{if(!e.release&&!t)return void(o&&j.warn(us));e.release=e.release||t,e.environment=e.environment||n}this.emit("beforeSendSession",e);const r=function(e,t,n,r){const s=fr(n);return sr({sent_at:(new Date).toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:Ut(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(r)}recordDroppedEvent(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;if(this._options.sendClientReports){const r=`${e}:${t}`;o&&j.log(`Recording outcome: "${r}"${n>1?` (${n} times)`:""}`),this._outcomes[r]=(this._outcomes[r]||0)+n}}on(e,t){const n=this._hooks[e]=this._hooks[e]||new Set,r=function(){return t(...arguments)};return n.add(r),()=>{n.delete(r)}}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const s=this._hooks[e];
1s&&s.forEach(e=>e(...n))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return o&&j.error("Error while sending envelope:",e),{}}return o&&j.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=function(e,t){const n={};return t.forEach(t=>{null!=t&&t.beforeSetup&&t.beforeSetup(e)}),t.forEach(t=>{t&&et(e,t,n)}),n}(this,e),Ze(this,e)}_updateSessionFromEvent(e,t){var n;let r="fatal"===t.level,s=!1;const i=null===(n=t.exception)||void 0===n?void 0:n.values;if(i){s=!0,r=!1;for(const e of i){var o;if(!1===(null===(o=e.mechanism)||void 0===o?void 0:o.handled)){r=!0;break}}}const a="ok"===e.status;(a&&0===e.errors||a&&r)&&(Ee(e,{...r&&{status:"crashed"},errors:e.errors||Number(s||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise(e=>setTimeout(e,1)),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,n,r){const s=this.getOptions(),i=Object.keys(this._integrations);return!t.integrations&&null!=i&&i.length&&(t.integrations=i),this.emit("preprocessEvent",e,t),e.type||r.setLastEventId(e.event_id||t.event_id),as(s,e,t,n,this,r).then(e=>{var r;if(null===e)return e;this.emit("postprocessEvent",e,t),e.contexts={trace:{...null===(r=e.contexts)||void 0===r?void 0:r.trace,...Xe(n)},...e.contexts};const s=Xn(this,n);return e.sdkProcessingMetadata={dynamicSamplingContext:s,...e.sdkProcessingMetadata},e})}_captureEvent(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:He(),r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:qe();return o&&bs(e)&&j.log(`Captured error event \`${nt(e)[0]||"<unknown>"}\``),this._processEvent(e,t,n,r).then(e=>e.event_id,e=>
1{o&&(gs(e)?j.log(e.message):ms(e)?j.warn(e.message):j.warn(e))})}_processEvent(e,t,n,r){const s=this.getOptions(),{sampleRate:i}=s,o=Ss(e),a=bs(e),c=`before send for type \`${e.type||"error"}\``,l=void 0===i?void 0:gn(i);if(a&&"number"==typeof l&&K()>l)return this.recordDroppedEvent("sample_rate","error"),Wr(fs(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));const u=_s(e.type);return this._prepareEvent(e,t,n,r).then(e=>{var n;if(null===e)throw this.recordDroppedEvent("event_processor",u),fs("An event processor returned `null`, will not send event.");if(!0===(null===(n=t.data)||void 0===n?void 0:n.__sentry__))return e;const r=function(e,t,n,r){const{beforeSend:s,beforeSendTransaction:i,ignoreSpans:o}=t,a=!er(t.beforeSendSpan)&&t.beforeSendSpan;let c=n;if(bs(c)&&s)return s(c,r);if(Ss(c)){if(a||o){const t=function(e){var t;const{trace_id:n,parent_span_id:r,span_id:s,status:i,origin:o,data:a,op:c}=(null===(t=e.contexts)||void 0===t?void 0:t.trace)??{};return{data:a??{},description:e.transaction,op:c,parent_span_id:r,span_id:s??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:n??"",origin:o,profile_id:null==a?void 0:a[At],exclusive_time:null==a?void 0:a[Mt],measurements:e.measurements,is_segment:!0}}(c);if(null!=o&&o.length&&yr(t,o))return null;if(a){const e=a(t);e?c=xe(n,{type:"transaction",timestamp:(l=e).timestamp,start_timestamp:l.start_timestamp,transaction:l.description,contexts:{trace:{trace_id:l.trace_id,span_id:l.span_id,parent_span_id:l.parent_span_id,op:l.op,status:l.status,origin:l.origin,data:{...l.data,...l.profile_id&&{[At]:l.profile_id},...l.exclusive_time&&{[Mt]:l.exclusive_time}}}},measurements:l.measurements}):qn()}if(c.spans){const t=[],n=c.spans;for(const e of n)if(null!=o&&o.length&&yr(e,o))vr(n,e);else if(a){const n=a(e);n?t.push(n):(qn(),t.push(e))}else t.push(e);const r=c.spans.length-t.length;r&&e.recordDroppedEvent("before_send","span",r),c.spans=t}}if(i){if(c.spans){const e=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return i(c,r)}}var l;return c}(this,s,e,t);return function(e,t){const n=`${t} must return \`null\` or a valid event.`;if(w(e))return e.then(e=>{if(!b(e)&&null!==e)throw ps(n);return e},e=>{throw ps(`${t} rejected with ${e}`)});if(!b(e)&&null!==e)throw ps(n);return e}(r,c)}).then(s=>{if(null===s){if(this.recordDroppedEvent("before_send",u),o){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw fs(`${c} returned \`null\`, will not send event.`)}const i=n.getSession()||r.getSession();if(a&&i&&this._updateSessionFromEvent(i,s),o){var l;const e=((null===(l=s.sdkProcessingMetadata)||void 0===l?void 0:l.spanCountBeforeProcessing)||0)-(s.spans?s.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const d=s.transaction_info;if(o&&d&&s.transaction!==e.transaction){const e="custom";s.transaction_info={...d,source:e}}return this.sendEvent(s,t),s}).then(null,e=>{if(gs(e)||ms(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),ps(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)})}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then(e=>(this._numProcessing--,e),e=>(this._numProcessing--,e===Vr&&this.recordDroppedEvent("queue_overflow",t),e))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(e=>{let[t,n]=e;const[r,s]=t.split(":");return{reason:r,category:s,quantity:n}})}_flushOutcomes(){o&&j.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(o&&j.log("No outcomes to send"));if(!this._dsn)return void(o&&j.log("No dsn provided, will not send outcomes"));o&&j.log("Sending outcomes:",e);const t=(n=e,sr((r=this._options.tunnel&&Ut(this._dsn))?{dsn:r}:{},[[{type:"client_report"},{timestamp:be(),discarded_events:n}]]));var n,r;this.sendEnvelope(t)}}function _s(e){return"replay_event"===e?"replay":e||"error"}function bs(e){return void 0===e.type}function Ss(e){return"transaction"===e.type}function ws(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+Ts(e.attributes)}function ks(e){let t=0;return e.message&&(t+=2*e.message.length),t+Ts(e.attributes)}function Ts(e){if(!e)return 0;let t=0;
1return Object.values(e).forEach(e=>{Array.isArray(e)?t+=e.length*Es(e[0]):_(e)?t+=Es(e):t+=100}),t}function Es(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function xs(e){var t;"aggregates"in e?void 0===(null===(t=e.attrs)||void 0===t?void 0:t.ip_address)&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}function Is(e){return function(e){return p(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function Cs(e,t){const n=As(e,t),r={type:Ns(t),value:Ps(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Os(e,t){return{exception:{values:[Cs(e,t)]}}}function As(e,t){const n=t.stacktrace||t.stack||"",r=function(e){return e&&Ms.test(e.message)?1:0}(t),s=function(e){return"number"==typeof e.framesToPop?e.framesToPop:0}(t);try{return e(n,r,s)}catch{}return[]}const Ms=/Minified React error #\d+;/i;function Rs(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function Ns(e){const t=null==e?void 0:e.name;return!t&&Rs(e)?e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception":t}function Ps(e){const t=null==e?void 0:e.message;return Rs(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?Is(t.error):Is(e):"No error message"}function Ls(e,t,n,r){const s=$s(e,t,(null==n?void 0:n.syntheticException)||void 0,r);return ye(s),s.level="error",null!=n&&n.event_id&&(s.event_id=n.event_id),zr(s)}function Ds(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"info",r=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;const i=js(e,t,(null==r?void 0:r.syntheticException)||void 0,s);return i.level=n,null!=r&&r.event_id&&(i.event_id=r.event_id),zr(i)}function $s(e,t,n,r,s){let i;if(m(t)&&t.error)return Os(e,t.error);if(g(t)||f(t,"DOMException")){const s=t;if("stack"in t)i=Os(e,t);else{const t=s.name||(g(s)?"DOMError":"DOMException"),o=s.message?`${t}: ${s.message}`:t;i=js(e,o,n,r),ge(i,o)}return"code"in s&&(i.tags={...i.tags,"DOMException.code":`${s.code}`}),i}return p(t)?Os(e,t):b(t)||S(t)?(i=function(e,t,n,r){const s=Ge(),i=null==s?void 0:s.getOptions().normalizeDepth,o=(a=t,Object.values(a).find(e=>e instanceof Error));var a;const c={__serialized__:nr(t,i)};if(o)return{exception:{values:[Cs(e,o)]},extra:c};const l={exception:{values:[{type:S(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Bs(t,{isUnhandledRejection:r})}]},extra:c};if(n){const t=As(e,n);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}(e,t,n,s),ye(i,{synthetic:!0}),i):(i=js(e,t,n,r),ge(i,`${t}`,void 0),ye(i,{synthetic:!0}),i)}function js(e,t,n,r){const s={};if(r&&n){const r=As(e,n);r.length&&(s.exception={values:[{value:t,stacktrace:{frames:r}}]}),ye(s,{synthetic:!0})}if(v(t)){const{__sentry_template_string__:e,__sentry_template_values__:n}=t;return s.logentry={message:e,params:n},s}return s.message=t,s}function Bs(e,t){let{isUnhandledRejection:n}=t;const r=function(e){const t=Object.keys(W(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}(e),s=n?"promise rejection":"exception";return m(e)?`Event \`ErrorEvent\` captured as ${s} with message \`${e.message}\``:S(e)?`Event \`${function(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}(e)}\` (type=${e.type}) captured as ${s}`:`Object captured as ${s} with keys: ${r}`}function Fs(e,t){return He().captureException(e,function(e){if(e)return function(e){return e instanceof Re||"function"==typeof e}(e)||function(e){return Object.keys(e).some(e=>cs.includes(e))}(e)?{captureContext:e}:e}(t))}function Us(e,t){const n="string"==typeof t?t:void 0,r="string"!=typeof t?{captureContext:t}:void 0;return He().captureMessage(e,n,r)}function zs(e,t){return He().captureEvent(e,t)}function Ws(e,t){qe().setContext(e,t)}function Hs(e){qe().setExtras(e)}function qs(e,t){qe().setExtra(e,t)}function Vs(e){qe().setTags(e)}function Js(e,t){qe().setTag(e,t)}function Ks(e){qe().setUser(e)}function Gs(e){qe().setConversationId(e)}function Xs(){return qe().lastEventId()}
1async function Ys(e){const t=Ge();return t?t.flush(e):(o&&j.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Qs(e){const t=Ge();return t?t.close(e):(o&&j.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function Zs(){return!!Ge()}function ei(){const e=Ge();return!1!==(null==e?void 0:e.getOptions().enabled)&&!(null==e||!e.getTransport())}function ti(e){qe().addEventProcessor(e)}function ni(e){const t=qe(),{user:n}=wr(t,He()),{userAgent:r}=c.navigator||{},s=function(e){const t=we(),n={sid:pe(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return{sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}(n)};return e&&Ee(n,e),n}({user:n,...r&&{userAgent:r},...e}),i=t.getSession();return"ok"===(null==i?void 0:i.status)&&Ee(i,{status:"exited"}),ri(),t.setSession(s),s}function ri(){const e=qe(),t=He().getSession()||e.getSession();t&&function(e){let t={};"ok"===e.status&&(t={status:"exited"}),Ee(e,t)}(t),si(),e.setSession()}function si(){const e=qe(),t=Ge(),n=e.getSession();n&&t&&t.captureSession(n)}function ii(){arguments.length>0&&void 0!==arguments[0]&&arguments[0]?ri():si()}const oi=c;let ai=0;function ci(){return ai>0}function li(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(z(e))return e}catch{return e}const n=function(){for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];try{const n=r.map(e=>li(e,t));return e.apply(this,n)}catch(e){throw ai++,setTimeout(()=>{ai--}),Je(n=>{n.addEventProcessor(e=>(t.mechanism&&(ge(e,void 0,void 0),ye(e,t.mechanism)),e.extra={...e.extra,arguments:r},e)),Fs(e)}),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=e[t])}catch{}U(n,e),F(e,"__sentry_wrapped__",n);try{Object.getOwnPropertyDescriptor(n,"name").configurable&&Object.defineProperty(n,"name",{get:()=>e.name})}catch{}return n}function ui(){const e=A(),{referrer:t}=oi.document||{},{userAgent:n}=oi.navigator||{};return{url:e,headers:{...t&&{Referer:t},...n&&{"User-Agent":n}}}}class di extends vs{constructor(e){var t;const n=(r=e,{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:null===(s=oi.SENTRY_RELEASE)||void 0===s?void 0:s.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...r});var r,s;!function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[t],r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"npm";const s=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${t}`,s.packages=n.map(e=>({name:`${r}:@sentry/${e}`,version:a})),s.version=a)}(n,"browser",["browser"],oi.SENTRY_SDK_SOURCE||"npm"),null!==(t=n._metadata)&&void 0!==t&&t.sdk&&(n._metadata.sdk.settings={infer_ip:n.sendDefaultPii?"auto":"never",...n._metadata.sdk.settings}),super(n);const{sendDefaultPii:i,sendClientReports:o,enableLogs:c,_experiments:l,enableMetrics:u}=this._options,d=u??(null==l?void 0:l.enableMetrics)??!0;oi.document&&(o||c||d)&&oi.document.addEventListener("visibilitychange",()=>{"hidden"===oi.document.visibilityState&&(o&&this._flushOutcomes(),c&&Nr(this),d&&Br(this))}),i&&this.on("beforeSendSession",xs)}eventFromException(e,t){return Ls(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2?arguments[2]:void 0;return Ds(this._options.stackParser,e,t,n,this._options.attachStacktrace)}_prepareEvent(e,t,n,r){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n,r)}}const hi={},pi={};function fi(e,t){hi[e]=hi[e]||[],hi[e].push(t)}function mi(e,t){if(!pi[e]){pi[e]=!0;try{t()}catch(t){o&&j.error(`Error while instrumenting ${e}`,t)}}}function gi(e,t){const n=e&&hi[e];if(n)for(const r of n)try{r(t)}catch(t){o&&j.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${re(r)}\nError:`,t)}}function yi(e){const t="console";fi(t,e),mi(t,vi)}function vi(){"console"in c&&R.forEach(function(e){e in c.console&&B(c.console,e,function(t){return N[e]=t,function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];gi("console",{args:n,level:e});const s=N[e];null==s||s.apply(c.console,n)}})})}const _i=c;function bi(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Si(){if("string"==typeof EdgeRuntime)return!0;
1if(!function(){if(!("fetch"in _i))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}())return!1;if(bi(_i.fetch))return!0;let e=!1;const t=_i.document;if(t&&"function"==typeof t.createElement)try{var n;const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),null!==(n=r.contentWindow)&&void 0!==n&&n.fetch&&(e=bi(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){o&&j.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}function wi(e,t){const n="fetch";fi(n,e),mi(n,()=>ki(void 0,t))}function ki(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&!Si()||B(c,"fetch",function(t){return function(){const n=new Error;for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];const{method:o,url:a}=function(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,n]=e;return{url:xi(t),method:Ei(n,"method")?String(n.method).toUpperCase():E(t)&&Ei(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:xi(t),method:Ei(t,"method")?String(t.method).toUpperCase():"GET"}}(s),l={args:s,fetchData:{method:o,url:a},startTimestamp:1e3*we(),virtualError:n,headers:Ii(s)};return e||gi("fetch",{...l}),t.apply(c,s).then(async t=>(e?e(t):gi("fetch",{...l,endTimestamp:1e3*we(),response:t}),t),e=>{gi("fetch",{...l,endTimestamp:1e3*we(),error:e}),p(e)&&void 0===e.stack&&(e.stack=n.stack,F(e,"framesToPop",1));
1const t=Ge(),r=(null==t?void 0:t.getOptions().enhanceFetchErrorMessages)??"always";if(!1!==r&&e instanceof TypeError&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const t=new URL(l.fetchData.url).host;"always"===r?e.message=`${e.message} (${t})`:F(e,"__sentry_fetch_url_host__",t)}catch{}throw e})}})}function Ti(e){let t;try{t=e.clone()}catch{return}!async function(e,t){if(null!=e&&e.body){const n=e.body,r=n.getReader(),s=setTimeout(()=>{n.cancel().then(null,()=>{})},9e4);let i=!0;for(;i;){let e;try{e=setTimeout(()=>{n.cancel().then(null,()=>{})},5e3);const{done:s}=await r.read();clearTimeout(e),s&&(t(),i=!1)}catch{i=!1}finally{clearTimeout(e)}}clearTimeout(s),r.releaseLock(),n.cancel().then(null,()=>{})}}(t,()=>{gi("fetch-body-resolved",{endTimestamp:1e3*we(),response:e})})}function Ei(e,t){return!!e&&"object"==typeof e&&!!e[t]}function xi(e){return"string"==typeof e?e:e?Ei(e,"url")?e.url:e.toString?e.toString():"":""}function Ii(e){const[t,n]=e;try{if("object"==typeof n&&null!==n&&"headers"in n&&n.headers)return new Headers(n.headers);if(E(t))return new Headers(t.headers)}catch{}}const Ci=100;function Oi(e,t){const n=Ge(),r=qe();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:i=Ci}=n.getOptions();if(i<=0)return;const o={timestamp:be(),...e},a=s?P(()=>s(o,t)):o;null!==a&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,i))}function Ai(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}function Mi(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}const Ri="thismessage:/";function Ni(e){return"isRelative"in e}function Pi(e,t){const n=e.indexOf("://")<=0&&0!==e.indexOf("//"),r=t??(n?Ri:void 0);try{if("canParse"in URL&&!URL.canParse(e,r))return;const t=new URL(e,r);return n?{isRelative:n,pathname:t.pathname,search:t.search,hash:t.hash}:t}catch{}}function Li(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function Di(e){return e.split(/[?#]/,1)[0]}function $i(e){let t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];if(e.startsWith("data:")){const n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=e.includes(";base64,"),i=e.indexOf(",");let o="";if(t&&-1!==i){const t=e.slice(i+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${r}${s?",base64":""}${o?`,${o}`:""}`}return e}const ji=c;let Bi,Fi,Ui;function zi(e){fi("dom",e),mi("dom",Wi)}function Wi(){if(!ji.document)return;const e=gi.bind(null,"dom"),t=Hi(e,!0);ji.document.addEventListener("click",t,!1),ji.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(t=>{const n=ji,r=n[t]?.prototype;r?.hasOwnProperty?.("addEventListener")&&(B(r,"addEventListener",function(t){return function(n,r,s){if("click"===n||"keypress"==n)try{const r=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},i=r[n]=r[n]||{refCount:0};if(!i.handler){const r=Hi(e);i.handler=r,t.call(this,n,r,s)}i.refCount++}catch{}return t.call(this,n,r,s)}}),B(r,"removeEventListener",function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this.__sentry_instrumentation_handlers__||{},s=n[t];s&&(s.refCount--,s.refCount<=0&&(e.call(this,t,s.handler,r),s.handler=void 0,delete n[t]),0===Object.keys(n).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,n,r)}}))})}function Hi(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=function(e){try{return e.target}catch{return null}}(n);if(function(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}(n.type,r))return;F(n,"_sentryCaptured",!0),r&&!r._sentryId&&F(r,"_sentryId",pe());const s="keypress"===n.type?"input":n.type;(function(e){if(e.type!==Fi)return!1;try{if(!e.target||e.target._sentryId!==Ui)return!1}catch{}return!0})(n)||(e({event:n,name:s,global:t}),Fi=n.type,Ui=r?r._sentryId:void 0),clearTimeout(Bi),Bi=ji.setTimeout(()=>{Ui=void 0,Fi=void 0},1e3)}}const qi="__sentry_xhr_v3__";function Vi(e){fi("xhr",e),mi("xhr",Ji)}function Ji(){if(!ji.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,n){const r=new Error,s=1e3*we(),i=y(n[0])?n[0].toUpperCase():void 0,o=function(e){if(y(e))return e;try{return e.toString()}catch{}}(n[1]);if(!i||!o)return e.apply(t,n);t[qi]={method:i,url:o,request_headers:{}}
1,"POST"===i&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const a=()=>{const e=t[qi];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}gi("xhr",{endTimestamp:1e3*we(),startTimestamp:s,xhr:t,virtualError:r})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,n)=>(a(),e.apply(t,n))}):t.addEventListener("readystatechange",a),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,n){const[r,s]=n,i=t[qi];return i&&y(r)&&y(s)&&(i.request_headers[r.toLowerCase()]=s),e.apply(t,n)}}),e.apply(t,n)}}),e.send=new Proxy(e.send,{apply(e,t,n){const r=t[qi];return r?(void 0!==n[0]&&(r.body=n[0]),gi("xhr",{startTimestamp:1e3*we(),xhr:t}),e.apply(t,n)):e.apply(t,n)}})}let Ki;function Gi(e){const t="history";fi(t,e),mi(t,Xi)}function Xi(){function e(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const r=Ki,s=function(e){try{return new URL(e,ji.location.origin).toString()}catch{return e}}(String(n));if(Ki=s,r===s)return e.apply(this,t);gi("history",{from:r,to:s})}return e.apply(this,t)}}ji.addEventListener("popstate",()=>{const e=ji.location.href,t=Ki;Ki=e,t!==e&&gi("history",{from:t,to:e})}),"history"in _i&&_i.history&&(B(ji.history,"pushState",e),B(ji.history,"replaceState",e))}const Yi="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Qi=function(){const e={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return{name:"Breadcrumbs",setup(t){e.console&&yi(function(e){return function(t){if(Ge()!==e)return;const n={category:"console",data:{arguments:t.args,logger:"console"},level:Ai(t.level),message:le(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;n.message=`Assertion failed: ${le(t.args.slice(1)," ")||"console.assert"}`,n.data.arguments=t.args.slice(1)}Oi(n,{input:t.args,level:t.level})}}(t)),e.dom&&zi(function(e,t){return function(n){if(Ge()!==e)return;let r,s,i="object"==typeof t?t.serializeAttribute:void 0,o="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;o&&o>1024&&(Yi&&j.warn(`\`dom.maxStringLength\` cannot exceed 1024, but a value of ${o} was configured. Sentry will use 1024 instead.`),o=1024),"string"==typeof i&&(i=[i]);try{const e=n.event,t=function(e){return!!e&&!!e.target}(e)?e.target:e;r=C(t,{keyAttrs:i,maxStringLength:o}),s=M(t)}catch{r="<unknown>"}if(0===r.length)return;const a={category:`ui.${n.name}`,message:r};s&&(a.data={"ui.component_name":s}),Oi(a,{event:n.event,name:n.name,global:n.global})}}(t,e.dom)),e.xhr&&Vi(function(e){return function(t){if(Ge()!==e)return;const{startTimestamp:n,endTimestamp:r}=t,s=t.xhr[qi];if(!n||!r||!s)return;const{method:i,url:o,status_code:a,body:c}=s,l={method:i,url:o,status_code:a},u={xhr:t.xhr,input:c,startTimestamp:n,endTimestamp:r},d={category:"xhr",data:l,type:"http",level:Mi(a)};e.emit("beforeOutgoingRequestBreadcrumb",d,u),Oi(d,u)}}(t)),e.fetch&&wi(function(e){return function(t){if(Ge()!==e)return;const{startTimestamp:n,endTimestamp:r}=t;if(r&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.error){const s={data:t.error,input:t.args,startTimestamp:n,endTimestamp:r},i={category:"fetch",data:t.fetchData,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",i,s),Oi(i,s)}else{const s=t.response,i={...t.fetchData,status_code:null==s?void 0:s.status},o={input:t.args,response:s,startTimestamp:n,endTimestamp:r},a={category:"fetch",data:i,type:"http",level:Mi(i.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",a,o),Oi(a,o)}}}(t)),e.history&&Gi(function(e){return function(t){var n;if(Ge()!==e)return;let r=t.from,s=t.to;const i=Li(oi.location.href);let o=r?Li(r):void 0;const a=Li(s);null!==(n=o)&&void 0!==n&&n.path||(o=i),i.protocol===a.protocol&&i.host===a.host&&(s=a.relative),i.protocol===o.protocol&&i.host===o.host&&(r=o.relative),Oi({category:"navigation",data:{from:r,to:s}})}}(t)),e.sentry&&t.on("beforeSendEvent",function(e){return function(t){Ge()===e&&Oi({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:me(t)},{event:t})}}(t))}}},Zi="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDB
1Request,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),eo=function(){const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return{name:"BrowserApiErrors",setupOnce(){e.setTimeout&&B(oi,"setTimeout",to),e.setInterval&&B(oi,"setInterval",to),e.requestAnimationFrame&&B(oi,"requestAnimationFrame",no),e.XMLHttpRequest&&"XMLHttpRequest"in oi&&B(XMLHttpRequest.prototype,"send",ro);const t=e.eventTarget;t&&(Array.isArray(t)?t:Zi).forEach(t=>function(e,t){var n,r;const s=null===(n=oi[e])||void 0===n?void 0:n.prototype;null!=s&&null!==(r=s.hasOwnProperty)&&void 0!==r&&r.call(s,"addEventListener")&&(B(s,"addEventListener",function(n){return function(r,s,i){try{"function"==typeof s.handleEvent&&(s.handleEvent=li(s.handleEvent,{mechanism:{data:{handler:re(s),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&function(e,t,n){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,n)}(this,r,s),n.apply(this,[r,li(s,{mechanism:{data:{handler:re(s),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),i])}}),B(s,"removeEventListener",function(e){return function(t,n,r){try{const s=n.__sentry_wrapped__;s&&e.call(this,t,s,r)}catch{}return e.call(this,t,n,r)}}))}(t,e))}}};function to(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const s=n[0];return n[0]=li(s,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${re(e)}`}}),e.apply(this,n)}}function no(e){return function(t){return e.apply(this,[li(t,{mechanism:{data:{handler:re(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function ro(e){return function(){const t=this;["onload","onerror","onprogress","onreadystatechange"].forEach(e=>{e in t&&"function"==typeof t[e]&&B(t,e,function(t){const n={mechanism:{data:{handler:re(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},r=z(t);return r&&(n.mechanism.data.handler=re(r)),li(t,n)})});for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];return e.apply(this,r)}}const so=function(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===oi.document)return void(Yi&&j.warn("Using the `browserSessionIntegration` in non-browser environments is not supported."));ni({ignoreDuration:!0}),ii();const t=qe();let n=t.getUser();t.addScopeListener(e=>{var t,r;const s=e.getUser();(null===(t=n)||void 0===t?void 0:t.id)===(null==s?void 0:s.id)&&(null===(r=n)||void 0===r?void 0:r.ip_address)===(null==s?void 0:s.ip_address)||(ii(),n=s)}),"route"===e&&Gi(e=>{let{from:t,to:n}=e;t!==n&&(ni({ignoreDuration:!0}),ii())})}}},io=()=>({name:"CultureContext",preprocessEvent(e){const t=function(){try{const e=oi.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}();var n;t&&(e.contexts={...e.contexts,culture:{...t,...null===(n=e.contexts)||void 0===n?void 0:n.culture}})}});let oo=null;function ao(e){const t="error";fi(t,e),mi(t,co)}function co(){oo=c.onerror,c.onerror=function(e,t,n,r,s){return gi("error",{column:r,error:s,line:n,msg:e,url:t}),!!oo&&oo.apply(this,arguments)},c.onerror.__SENTRY_INSTRUMENTED__=!0}let lo=null;function uo(e){const t="unhandledrejection";fi(t,e),mi(t,ho)}function ho(){lo=c.onunhandledrejection,c.onunhandledrejection=function(e){return gi("unhandledrejection",e),!lo||lo.apply(this,arguments)},c.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const po=function(){const e={onerror:!0,onunhandledrejection:!0,...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return{name:"GlobalHandlers",setupOnce(){Error.stackTraceLimit=50},setup(t){e.onerror&&(function(e){ao(t=>{const{stackParser:n,attachStacktrace:r}=yo();if(Ge()!==e||ci())return;const{msg:s,url:i,line:o,column:a,error:c}=t,l=function(e,t,n,r){const s=e.exception=e.exception||{},i=s.values=s.values||[],o=i[0]=i[0]||{},a=o.stacktrace=o.stacktrace||{},c=a.frames=a.frames||[];return 0===c.length&&c.push({colno:r,lineno:n,filename:vo(t)??A(),function:Y,in_app:!0}),e}($s(n,c||s,void 0,r,!1),i,o,a);l.level="error",zs(l,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}(t),go("onerror")),e.onunhandledrejection&&(function(e){uo(t=>{const{stackParser:n,attachStacktrace:r}=yo();if(Ge()!==e||ci())return;const s=fo(t),i=_(s)?mo(s):$s(n,s,void 0,r,!0);i.level="error",zs(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}(t),go("onunhandledrejection"))}}};function fo(e){if(_(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function mo(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function go(e){Yi&&j.log(`Global Handler attached: ${e}`)}function yo(){const e=Ge();return(null==e?void 0:e.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function vo(e){if(y(e)&&0!==e.length)return e.startsWith("data:")?`<${$i(e,!1)}>`:e}const _o=()=>({name:"HttpContext",preprocessEvent(e){var t;if(!oi.navigator&&!oi.location&&!oi.document)return;const n=ui(),r={...n.headers,...null===(t=e.request)||void 0===t?void 0:t.headers};e.request={...n,...e.request,headers:r}}});function bo(e,t,n,r,s,i){var o;if(null===(o=s.exception)||void 0===o||!o.values||!i||!k(i.originalException,Error))return;const a=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;a&&(s.exception.values=So(e,t,r,i.originalException,n,s.exception.values,a,0))}function So(e,t,n,r,s,i,o,a){if(i.length>=n+1)return i;let c=[...i];if(k(r[s],Error)){ko(o,a,r);
1const i=e(t,r[s]),l=c.length;To(i,s,l,a),c=So(e,t,n,r[s],s,[i,...c],i,l)}return wo(r)&&r.errors.forEach((i,l)=>{if(k(i,Error)){ko(o,a,r);const u=e(t,i),d=c.length;To(u,`errors[${l}]`,d,a),c=So(e,t,n,i,s,[u,...c],u,d)}}),c}function wo(e){return Array.isArray(e.errors)}function ko(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...wo(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function To(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}const Eo=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.limit||5,n=e.key||"cause";return{name:"LinkedErrors",preprocessEvent(e,r,s){bo(Cs,s.getOptions().stackParser,n,t,e,r)}}};function xo(e,t,n,r){const s={filename:e,function:"<anonymous>"===t?Y:t,in_app:!0};return void 0!==n&&(s.lineno=n),void 0!==r&&(s.colno=r),s}const Io=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Co=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Oo=/\((\S*)(?::(\d+))(?::(\d+))\)/,Ao=/at (.+?) ?\(data:(.+?),/,Mo=[30,e=>{const t=e.match(Ao);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const n=Io.exec(e);if(n){const[,e,t,r]=n;return xo(e,Y,+t,+r)}const r=Co.exec(e);if(r){var s;if(0===(null===(s=r[2])||void 0===s?void 0:s.indexOf("eval"))){const e=Oo.exec(r[2]);e&&(r[2]=e[1],r[3]=e[2],r[4]=e[3])}const[e,t]=Wo(r[1]||Y,r[2]);return xo(t,e,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}}],Ro=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,No=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Po=[50,e=>{const t=Ro.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=No.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||Y;return[n,e]=Wo(n,e),xo(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Lo=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:[-a-z]+):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Do=[40,e=>{const t=Lo.exec(e);return t?xo(t[2],t[1]||Y,+t[3],t[4]?+t[4]:void 0):void 0}],$o=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,jo=[10,e=>{const t=$o.exec(e);return t?xo(t[2],t[3]||Y,+t[1]):void 0}],Bo=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,Fo=[20,e=>{const t=Bo.exec(e);return t?xo(t[5],t[3]||t[4]||Y,+t[1],+t[2]):void 0}],Uo=[Mo,Po],zo=ee(...Uo),Wo=(e,t)=>{const n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:Y,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},Ho="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,qo={};function Vo(e){const t=qo[e];if(t)return t;let n=ji[e];if(bi(n))return qo[e]=n.bind(ji);const r=ji.document;if(r&&"function"==typeof r.createElement)try{const t=r.createElement("iframe");t.hidden=!0,r.head.appendChild(t);const s=t.contentWindow;s?.[e]&&(n=s[e]),r.head.removeChild(t)}catch(t){Ho&&j.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return n?qo[e]=n.bind(ji):n}function Jo(...e){return Vo("setTimeout")(...e)}const Ko=40;function Go(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Vo("fetch"),n=0,r=0;return Zr(e,async function(s){const i=s.body.length;n+=i,r++;const o={body:s.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:n<=6e4&&r<15,...e.fetchOptions};try{const n=await t(e.url,o);return{statusCode:n.status,headers:{"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")}}}catch(e){throw qo.fetch=void 0,e}finally{n-=i,r--}},Jr(e.bufferSize||Ko))}function Xo(e){return[it(),ut(),Nt(),eo(),Qi(),po(),Eo(),Pt(),_o(),io(),so()]}function Yo(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=!e.skipBrowserExtensionCheck&&!!function(){var e;if(void 0===oi.window)return!1;const t=oi;if(t.nw)return!1;const n=t.chrome||t.browser;if(null==n||null===(e=n.runtime)||void 0===e||!e.id)return!1;const r=A();return!(oi===oi.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(r))}()&&(Yi&&P(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0);let n=null==e.defaultIntegrations?Xo():e.defaultIntegrations;const r={...e,enabled:!t&&e.enabled,stackParser:(s=e.stackParser||zo,Array.isArray(s)?ee(...s):s),integrations:Qe({integrations:e.integrations,defaultIntegrations:n}),transport:e.transport||Go};var s;return function(e,t){!0===t.debug&&(o?j.enable():P(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),He().update(t.initialScope);const n=new e(t);return jt(n),n.init(),n}(di,r)}function Qo(){}function Zo(e){e()}class ea{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._traceId=e.traceId||Ie(),this._spanId=e.spanId||Ce(),this.dropReason=e.dropReason}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:0}}end(e){}setAttribute(e,t){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}
1addEvent(e,t,n){return this}addLink(e){return this}addLinks(e){return this}recordException(e,t){}}function ta(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:Hn();const s=r&&zn(r);s&&(o&&j.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),s.addEvent(e,{[vt]:t,[yt]:n}))}function na(e){if(!e||0===e.length)return;const t={};return e.forEach(e=>{const n=e.attributes||{},r=n[yt],s=n[vt];"string"==typeof r&&"number"==typeof s&&(t[e.name]={value:s,unit:r})}),t}function ra(e){return"stream"===e.getOptions().traceLifecycle}class sa{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this._traceId=e.traceId||Ie(),this._spanId=e.spanId||Ce(),this._startTime=e.startTimestamp||we(),this._links=e.links,this._attributes={},this.setAttributes({[mt]:"manual",[ft]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,t){}spanContext(){const{_spanId:e,_traceId:t,_sampled:n}=this;return{spanId:e,traceId:t,traceFlags:n?Sn:0}}setAttribute(e,t){return void 0===t?delete this._attributes[e]:this._attributes[e]=t,this}setAttributes(e){return Object.keys(e).forEach(t=>this.setAttribute(t,e[t])),this}updateStartTime(e){this._startTime=Cn(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(dt,"custom"),this}end(e){this._endTime||(this._endTime=Cn(e),function(e){if(!o)return;const{description:t="< unknown name >",op:n="< unknown op >"}=An(e),{spanId:r}=e.spanContext(),s=`[Tracing] Finishing "${n}" ${zn(e)===e?"root ":""}span "${t}" with ID ${r}`;j.log(s)}(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[ft],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Dn(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[mt],profile_id:this._attributes[At],exclusive_time:this._attributes[Mt],measurements:na(this._events),is_segment:this._isStandaloneSpan&&zn(this)===this||void 0,segment_id:this._isStandaloneSpan?zn(this).spanContext().spanId:void 0,links:xn(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===zn(this),status:$n(this._status),attributes:this._attributes,links:In(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,t,n){o&&j.log("[Tracing] Adding an event to span:",e);const r=ia(t)?t:n||we(),s=ia(t)?{}:t||{},i={name:e,time:Cn(r),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){const e=Ge();if(e&&(e.emit("spanEnd",this),this._isStandaloneSpan||e.emit("afterSpanEnd",this)),!this._isStandaloneSpan&&this!==zn(this))return;if(this._isStandaloneSpan)return void(this._sampled?function(e){const t=Ge(
1);if(!t)return;const n=e[1];n&&0!==n.length?t.sendEnvelope(e):t.recordDroppedEvent("before_send","span")}(function(e,t){const n=Yn(e[0]),r=null==t?void 0:t.getDsn(),s=null==t?void 0:t.getOptions().tunnel,i={sent_at:(new Date).toISOString(),...function(e){return!!e.trace_id&&!!e.public_key}(n)&&{trace:n},...!!s&&r&&{dsn:Ut(r)}},{beforeSendSpan:o,ignoreSpans:a}=(null==t?void 0:t.getOptions())||{},c=null!=a&&a.length?e.filter(e=>!yr(An(e),a)):e,l=e.length-c.length;l&&(null==t||t.recordDroppedEvent("before_send","span",l));const u=o?e=>{const t=An(e);return(er(o)?t:o(t))||(qn(),t)}:An,d=[];for(const e of c){const t=u(e);t&&d.push(ur(t))}return sr(i,d)}([this],e)):(o&&j.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span")));if(e&&ra(e))return void e.emit("afterSegmentSpanEnd",this);const t=this._convertSpanToTransaction();t&&(mn(this).scope||He()).captureEvent(t)}_convertSpanToTransaction(){var e;if(!oa(An(this)))return;this._name||(o&&j.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");const{scope:t,isolationScope:n}=mn(this),r=null==t||null===(e=t.getScopeData().sdkProcessingMetadata)||void 0===e?void 0:e.normalizedRequest;if(!0!==this._sampled)return;const s=Un(this).filter(e=>e!==this&&!function(e){return e instanceof sa&&e.isStandaloneSpan()}(e)).map(e=>An(e)).filter(oa),i=this._attributes[dt];delete this._attributes[Ot],s.forEach(e=>{delete e.data[Ot]});const a={contexts:{trace:kn(this)},spans:s.length>1e3?s.sort((e,t)=>e.start_timestamp-t.start_timestamp).slice(0,1e3):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:t,capturedSpanIsolationScope:n,dynamicSamplingContext:Yn(this)},request:r,...i&&{transaction_info:{source:i}}},c=na(this._events);return c&&Object.keys(c).length&&(o&&j.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),a.measurements=c),a}}function ia(e){return e&&"number"==typeof e||e instanceof Date||Array.isArray(e)}function oa(e){return!!(e.start_timestamp&&e.timestamp&&e.span_id&&e.trace_id)}function aa(e,t){let n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>{},s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:()=>{};try{n=e()}catch(e){throw t(e),r(),e}return function(e,t,n,r){return w(e)?Le(e,e=>{n(),r(e)},e=>{t(e),n()}):(n(),r(e),e)}(n,t,r,s)}const ca="__SENTRY_SUPPRESS_TRACING__";function la(e,t){const n=va();if(n.startSpan)return n.startSpan(e,t);const r=ya(e),{forceTransaction:s,parentSpan:i,scope:o}=e;return Je(null==o?void 0:o.clone(),()=>Sa(i)(()=>{const n=He(),o=ba(n,i),a=e.onlyIfParent&&!o?new ea:ga({parentSpan:o,spanArguments:r,forceTransaction:s,scope:n});return wa(a)&&o||Ae(n,a),aa(()=>t(a),()=>{const{status:e}=An(a);!a.isRecording()||e&&"ok"!==e||a.setStatus({code:ln,message:"internal_error"})},()=>{a.end()})}))}function ua(e,t){const n=va();if(n.startSpanManual)return n.startSpanManual(e,t);const r=ya(e),{forceTransaction:s,parentSpan:i,scope:o}=e;return Je(null==o?void 0:o.clone(),()=>Sa(i)(()=>{const n=He(),o=ba(n,i),a=e.onlyIfParent&&!o?new ea:ga({parentSpan:o,spanArguments:r,forceTransaction:s,scope:n});return wa(a)&&o||Ae(n,a),aa(()=>t(a,()=>a.end()),()=>{const{status:e}=An(a);!a.isRecording()||e&&"ok"!==e||a.setStatus({code:ln,message:"internal_error"})})}))}function da(e){const t=va();if(t.startInactiveSpan)return t.startInactiveSpan(e);const n=ya(e),{forceTransaction:r,parentSpan:s}=e;return(e.scope?t=>Je(e.scope,t):void 0!==s?e=>pa(s,e):e=>e())(()=>{const t=He(),i=ba(t,s);return e.onlyIfParent&&!i?new ea:ga({parentSpan:i,spanArguments:n,forceTransaction:r,scope:t})})}const ha=(e,t)=>{const n=ze(l());if(n.continueTrace)return n.continueTrace(e,t);const{sentryTrace:r,baggage:s}=e,i=Ge(),o=Qt(s);return i&&!function(e,t){const n=Ht(e);return t&&n&&t!==n?(j.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):!e.getOptions().strictTraceContinuation||!(t&&!n||!t&&n)||(j.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1)}(i,null==o?void 0:o.org_id)?ma(t):Je(e=>{const n=vn(r,s);return e.setPropagationContext(n),Ae(e,void 0),t()})};function pa(e,t){const n=va();return n.withActiveSpan?n.withActiveSpan(e,t):Je(n=>(Ae(n,e||void 0),t(n)))}function fa(e){const t=va();return t.suppressTracing?t.suppressTracing(e):Je(t=>{t.setSDKProcessingMetadata({[ca]:!0});const n=e();return t.setSDKProcessingMetadata({[ca]:void 0}),n})}function ma(e){const t=va();return t.startNewTrace?t.startNewTrace(e):Je(t=>(t.setPropagationContext({traceId:Ie(),sampleRand:K()}
1),o&&j.log(`Starting a new trace with id ${t.getPropagationContext().traceId}`),pa(null,e)))}function ga(e){let{parentSpan:t,spanArguments:n,forceTransaction:r,scope:s}=e;if(!tn()){const e=new ea;return!r&&t||Kn(e,{sampled:"false",sample_rate:"0",transaction:n.name,...Yn(e)}),e}const i=Ge();if(function(e,t){var n;const r=null==e?void 0:e.getOptions().ignoreSpans;return!!(e&&ra(e)&&null!=r&&r.length)&&yr({description:t.name||"",op:(null===(n=t.attributes)||void 0===n?void 0:n[ft])||t.op},r)}(i,n))return ka(s)||null==i||i.recordDroppedEvent("ignored","span"),new ea({dropReason:"ignored",traceId:(null==t?void 0:t.spanContext().traceId)??s.getPropagationContext().traceId});const a=qe();let l;if(t&&!r)l=function(e,t,n){const{spanId:r,traceId:s}=e.spanContext(),i=ka(t),o=!i&&Ln(e),a=o?new sa({...n,parentSpanId:r,traceId:s,sampled:o}):new ea({traceId:s});Fn(e,a);const c=Ge();return c?(ra(c)&&a instanceof ea&&(e instanceof ea&&e.dropReason?(a.dropReason=e.dropReason,c.recordDroppedEvent(e.dropReason,"span")):i||(a.dropReason="sample_rate",c.recordDroppedEvent("sample_rate","span"))),c.emit("spanStart",a),n.endTimestamp&&(c.emit("spanEnd",a),c.emit("afterSpanEnd",a)),a):a}(t,s,n),Fn(t,l);else if(t){const e=Yn(t),{traceId:r,spanId:i}=t.spanContext(),o=Ln(t);l=_a({traceId:r,parentSpanId:i,...n},s,o),Kn(l,e)}else{const{traceId:e,dsc:t,parentSpanId:r,sampled:i}={...a.getPropagationContext(),...s.getPropagationContext()};l=_a({traceId:e,parentSpanId:r,...n},s,i),t&&Kn(l,t)}return function(e){if(!o)return;const{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=An(e),{spanId:s}=e.spanContext(),i=Ln(e),a=zn(e),c=a===e,l=`[Tracing] Starting ${i?"sampled":"unsampled"} ${c?"root ":""}span`,u=[`op: ${n}`,`name: ${t}`,`ID: ${s}`];if(r&&u.push(`parent ID: ${r}`),!c){const{op:e,description:t}=An(a);u.push(`root ID: ${a.spanContext().spanId}`),e&&u.push(`root op: ${e}`),t&&u.push(`root description: ${t}`)}j.log(`${l}\n ${u.join("\n ")}`)}(l),function(e,t,n){e&&(F(e,pn,function(e){try{const t=c.WeakRef;if("function"==typeof t)return new t(e)}catch{}return e}(n)),F(e,hn,t))}(l,s,a),l}function ya(e){const t={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){const n={...t};return n.startTimestamp=Cn(e.startTime),delete n.startTime,n}return t}function va(){return ze(l())}function _a(e,t,n){var r;const s=Ge(),i=(null==s?void 0:s.getOptions())||{},{name:a=""}=e,c={spanAttributes:{...e.attributes},spanName:a,parentSampled:n};null==s||s.emit("beforeSampling",c,{decision:!1});const l=c.parentSampled??n,u=c.spanAttributes,d=t.getPropagationContext(),h=ka(t),[p,f,m]=h?[!1]:function(e,t,n){if(!tn(e))return[!1];let r,s;"function"==typeof e.tracesSampler?(s=e.tracesSampler({...t,inheritOrSampleWith:e=>"number"==typeof t.parentSampleRate?t.parentSampleRate:"boolean"==typeof t.parentSampled?Number(t.parentSampled):e}),r=!0):void 0!==t.parentSampled?s=t.parentSampled:void 0!==e.tracesSampleRate&&(s=e.tracesSampleRate,r=!0);const i=gn(s);if(void 0===i)return o&&j.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(s)} of type ${JSON.stringify(typeof s)}.`),[!1];if(!i)return o&&j.log("[Tracing] Discarding transaction because "+("function"==typeof e.tracesSampler?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0")),[!1,i,r];const a=n<i;return a||o&&j.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(s)})`),[a,i,r]}(i,{name:a,parentSampled:l,attributes:u,parentSampleRate:gn(null===(r=d.dsc)||void 0===r?void 0:r.sample_rate)},d.sampleRand),g=new sa({...e,attributes:{[dt]:"custom",[ht]:void 0!==f&&m?f:void 0,...u},sampled:p});return p||!s||h||(o&&j.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),s.recordDroppedEvent("sample_rate",ra(s)?"span":"transaction")),s&&s.emit("spanStart",g),g}function ba(e,t){if(t)return t;if(null===t)return;const n=Me(e);if(!n)return;const r=Ge();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?zn(n):n}function Sa(e){return void 0!==e?t=>pa(e,t):e=>e()}function wa(e){return e instanceof ea&&"ignored"===e.dropReason}function ka(e){return!0===e.getScopeData().sdkProcessingMetadata[ca]}const Ta={idleTimeout:1e3,finalTimeout:3e4,childSpanTimeout:15e3};function Ea(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=new Map;let r,s=!1,i="externalFinish",a=!t.disableAutoFinish;const c=[],{idleTimeout:l=Ta.idleTimeout,finalTimeout:u=Ta.finalTimeout,childSpanTimeout:d=Ta.childSpanTimeout,beforeSpanEnd:h,trimIdleSpanEndTimestamp:p=!0}
1=t,f=Ge();if(!f||!tn()){const e=new ea;return Kn(e,{sample_rate:"0",sampled:"false",...Yn(e)}),e}const m=He(),g=Hn(),y=function(e){const t=da(e);return Ae(He(),t),o&&j.log("[Tracing] Started span is an idle span"),t}(e);function v(){r&&(clearTimeout(r),r=void 0)}function _(e){v(),r=setTimeout(()=>{!s&&0===n.size&&a&&(i="idleTimeout",y.end(e))},l)}function b(e){r=setTimeout(()=>{!s&&a&&(i="heartbeatFailed",y.end(e))},d)}function S(e){s=!0,n.clear(),c.forEach(e=>e()),Ae(m,g);const t=An(y),{start_timestamp:r}=t;if(!r)return;t.data[gt]||y.setAttribute(gt,i);const a=t.status;a&&"unknown"!==a||y.setStatus({code:cn}),j.log(`[Tracing] Idle span "${t.op}" finished`);const d=Un(y).filter(e=>e!==y);let h=0;d.forEach(t=>{t.isRecording()&&(t.setStatus({code:ln,message:"cancelled"}),t.end(e),o&&j.log("[Tracing] Cancelling span since span ended early",JSON.stringify(t,void 0,2)));const n=An(t),{timestamp:r=0,start_timestamp:s=0}=n,i=s<=e,a=r-s<=(u+l)/1e3;if(o){const e=JSON.stringify(t,void 0,2);i?a||j.log("[Tracing] Discarding span since it finished after idle span final timeout",e):j.log("[Tracing] Discarding span since it happened after idle span was finished",e)}a&&i||(function(e,t){e[jn]&&e[jn].delete(t)}(y,t),h++)}),h>0&&y.setAttribute("sentry.idle_span_discarded_spans",h)}return y.end=new Proxy(y.end,{apply(e,t,n){if(h&&h(y),t instanceof ea)return;const[r,...s]=n,i=Cn(r||we()),o=Un(y).filter(e=>e!==y),a=An(y);if(!o.length||!p)return S(i),Reflect.apply(e,t,[i,...s]);const c=f.getOptions().ignoreSpans,l=null==o?void 0:o.reduce((e,t)=>{const n=An(t);return n.timestamp?c&&yr(n,c)?e:e?Math.max(e,n.timestamp):n.timestamp:e},void 0),d=a.start_timestamp,m=Math.min(d?d+u/1e3:1/0,Math.max(d||-1/0,Math.min(i,l||1/0)));return S(m),Reflect.apply(e,t,[m,...s])}}),c.push(f.on("spanStart",e=>{var t;s||e===y||An(e).timestamp||e instanceof sa&&e.isStandaloneSpan()||Un(y).includes(e)&&(t=e.spanContext().spanId,v(),n.set(t,!0),b(we()+d/1e3))})),c.push(f.on("spanEnd",e=>{var t;s||(t=e.spanContext().spanId,n.has(t)&&n.delete(t),0===n.size&&_(we()+l/1e3))})),c.push(f.on("idleSpanEnableAutoFinish",e=>{e===y&&(a=!0,_(),n.size&&b())})),t.disableAutoFinish||_(),setTimeout(()=>{s||(y.setStatus({code:ln,message:"deadline_exceeded"}),i="finalTimeout",y.end())},u),y}let xa=!1;function Ia(){function e(){const e=Hn(),t=e&&zn(e);if(t){const e="internal_error";o&&j.log(`[Tracing] Root span: ${e} -> Global error occurred`),t.setStatus({code:ln,message:e})}}xa||(e.tag="sentry_tracingErrorCallback",xa=!0,ao(e),uo(e))}const Ca=(e,t,n,r)=>{let s,i;return o=>{t.value>=0&&(o||r)&&(i=t.value-(s??0),(i||void 0===s)&&(s=t.value,t.delta=i,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},Oa=(e=!0)=>{const t=ji.performance?.getEntriesByType?.("navigation")[0];if(!e||t&&t.responseStart>0&&t.responseStart<performance.now())return t},Aa=()=>{const e=Oa();return e?.activationStart??0};function Ma(e,t,n){ji.document&&ji.addEventListener(e,t,n)}function Ra(e,t,n){ji.document&&ji.removeEventListener(e,t,n)}let Na=-1;const Pa=new Set,La=e=>{if(function(e){return"pagehide"===e.type||"hidden"===ji.document?.visibilityState}(e)&&Na>-1){if("visibilitychange"===e.type||"pagehide"===e.type)for(const e of Pa)e();isFinite(Na)||(Na="visibilitychange"===e.type?e.timeStamp:0,Ra("prerenderingchange",La,!0))}},Da=()=>{if(ji.document&&Na<0){const e=Aa(),t=ji.document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter(t=>"hidden"===t.name&&t.startTime>e)[0]?.startTime;Na=t??("hidden"!==ji.document?.visibilityState||ji.document?.prerendering?1/0:0),Ma("visibilitychange",La,!0),Ma("pagehide",La,!0),Ma("prerenderingchange",La,!0)}return{get firstHiddenTime(){return Na},onHidden(e){Pa.add(e)}}},$a=(e,t=-1)=>{const n=Oa();let r="navigate";return n&&(ji.document?.prerendering||Aa()>0?r="prerender":ji.document?.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},ja=new WeakMap;function Ba(e,t){try{return ja.get(e)||ja.set(e,new t),ja.get(e)}catch(e){return new t}}class Fa{constructor(){Fa.prototype.__init.call(this),Fa.prototype.__init2.call(this)}__init(){this._sessionValue=0}__init2(){this._sessionEntries=[]}_processEntry(e){if(e.hadRecentInput)return;const t=this._sessionEntries[0],n=this._sessionEntries[this._sessionEntries.length-1];this._sessionValue&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this._sessionValue+=e.value,this._sessionEntries.push(e)):(this._sessionValue=e.value,this._sessionEntries=[e]),this._onAfterProcessingUnexpectedShift?.(e)}}const Ua=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},za=e=>{let t=!1;return()=>{t||(e(),t=!0)}},Wa=e=>{ji.document?.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Ha=[1800,3e3],qa=[.1,.25];let Va=0,Ja=1/0,Ka=0;const Ga=e=>
1{e.forEach(e=>{e.interactionId&&(Ja=Math.min(Ja,e.interactionId),Ka=Math.max(Ka,e.interactionId),Va=Ka?(Ka-Ja)/7+1:0)})};let Xa;const Ya=()=>Xa?Va:performance.interactionCount||0,Qa=()=>{"interactionCount"in performance||Xa||(Xa=Ua("event",Ga,{type:"event",buffered:!0,durationThreshold:0}))};let Za=0;class ec{constructor(){ec.prototype.__init.call(this),ec.prototype.__init2.call(this)}__init(){this._longestInteractionList=[]}__init2(){this._longestInteractionMap=new Map}_resetInteractions(){Za=Ya(),this._longestInteractionList.length=0,this._longestInteractionMap.clear()}_estimateP98LongestInteraction(){const e=Math.min(this._longestInteractionList.length-1,Math.floor((Ya()-Za)/50));return this._longestInteractionList[e]}_processEntry(e){if(this._onBeforeProcessingEntry?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this._longestInteractionList.at(-1);let n=this._longestInteractionMap.get(e.interactionId);if(n||this._longestInteractionList.length<10||e.duration>t._latency){if(n?e.duration>n._latency?(n.entries=[e],n._latency=e.duration):e.duration===n._latency&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],_latency:e.duration},this._longestInteractionMap.set(n.id,n),this._longestInteractionList.push(n)),this._longestInteractionList.sort((e,t)=>t._latency-e._latency),this._longestInteractionList.length>10){const e=this._longestInteractionList.splice(10);for(const t of e)this._longestInteractionMap.delete(t.id)}this._onAfterProcessingINPCandidate?.(n)}}}const tc=e=>{const t=ji.requestIdleCallback||ji.setTimeout;"hidden"===ji.document?.visibilityState?e():(Ma("visibilitychange",e=za(e),{once:!0,capture:!0}),Ma("pagehide",e,{once:!0,capture:!0}),t(()=>{e(),Ra("visibilitychange",e,{capture:!0}),Ra("pagehide",e,{capture:!0})}))},nc=[200,500];class rc{_processEntry(e){this._onBeforeProcessingEntry?.(e)}}const sc=[2500,4e3],ic=[800,1800],oc=e=>{ji.document?.prerendering?Wa(()=>oc(e)):"complete"!==ji.document?.readyState?addEventListener("load",()=>oc(e),!0):setTimeout(e)},ac={},cc={};let lc,uc,dc,hc;function pc(e,t=!1){return wc("cls",e,vc,lc,t)}function fc(e,t=!1){return wc("lcp",e,_c,uc,t)}function mc(e){return wc("inp",e,Sc,hc)}function gc(e,t){return kc(e,t),cc[e]||(function(e){const t={};"event"===e&&(t.durationThreshold=0),Ua(e,t=>{yc(e,{entries:t})},t)}(e),cc[e]=!0),Tc(e,t)}function yc(e,t){const n=ac[e];if(n?.length)for(const r of n)try{r(t)}catch(t){Ho&&j.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${re(r)}\nError:`,t)}}function vc(){return((e,t={})=>{((e,t={})=>{Wa(()=>{const n=Da(),r=$a("FCP");let s;const i=Ua("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(i.disconnect(),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Aa(),0),r.entries.push(t),s(!0)))});i&&(s=Ca(e,r,Ha,t.reportAllChanges))})})(za(()=>{const n=$a("CLS",0);let r;const s=Da(),i=Ba(t,Fa),o=e=>{for(const t of e)i._processEntry(t);i._sessionValue>n.value&&(n.value=i._sessionValue,n.entries=i._sessionEntries,r())},a=Ua("layout-shift",o);a&&(r=Ca(e,n,qa,t.reportAllChanges),s.onHidden(()=>{o(a.takeRecords()),r(!0)}),ji?.setTimeout?.(r))}))})(e=>{yc("cls",{metric:e}),lc=e},{reportAllChanges:!0})}function _c(){return((e,t={})=>{Wa(()=>{const n=Da(),r=$a("LCP");let s;const i=Ba(t,rc),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)i._processEntry(t),t.startTime<n.firstHiddenTime&&(r.value=Math.max(t.startTime-Aa(),0),r.entries=[t],s())},a=Ua("largest-contentful-paint",o);if(a){s=Ca(e,r,sc,t.reportAllChanges);const n=za(()=>{o(a.takeRecords()),a.disconnect(),s(!0)}),i=e=>{e.isTrusted&&(tc(n),Ra(e.type,i,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])Ma(e,i,{capture:!0})}})})(e=>{yc("lcp",{metric:e}),uc=e},{reportAllChanges:!0})}function bc(){return((e,t={})=>{const n=$a("TTFB"),r=Ca(e,n,ic,t.reportAllChanges);oc(()=>{const e=Oa();e&&(n.value=Math.max(e.responseStart-Aa(),0),n.entries=[e],r(!0))})})(e=>{yc("ttfb",{metric:e}),dc=e})}function Sc(){return((e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=Da();Wa(()=>{Qa();const r=$a("INP");let s;const i=Ba(t,ec),o=e=>{tc(()=>{for(const t of e)i._processEntry(t);const t=i._estimateP98LongestInteraction();t&&t._latency!==r.value&&(r.value=t._latency,r.entries=t.entries,s())})},a=Ua("event",o,{durationThreshold:t.durationThreshold??40});s=Ca(e,r,nc,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(a.takeRecords()),s(!0)}))})})(e=>{yc("inp",{metric:e}),hc=e})}function wc(e,t,n,r,s=!1){let i;return kc(e,t),cc[e]||(i=n(),cc[e]=!0),r&&t({metric:r}),Tc(e,t,s?i:void 0)}function kc(e,t){ac[e]=ac[e]||[],ac[e].push(t)}function Tc(e,t,n){return()=>{n&&n();const r=ac[e];if(!r)return;const s=r.indexOf(t);-1!==s&&r.splice(s,1)}}function Ec(e){return"number"==typeof e&&isFinite(e)}function xc(e,t,n,{...r}){const s=An(e).start_timestamp;return s&&s>t&&"function"==typeof e.updateStartTime&&e.updateStartTime(t),pa(e,()=>{const e=da({startTime:t,...r});return e&&e.end(n),e})}
1function Ic(e){const t=Ge();if(!t)return;const{name:n,transaction:r,attributes:s,startTime:i}=e,{release:o,environment:a,sendDefaultPii:c}=t.getOptions(),l=t.getIntegrationByName("Replay"),u=l?.getReplayId(),d=He(),h=d.getUser(),p=void 0!==h?h.email||h.id||h.ip_address:void 0;let f;try{f=d.getScopeData().contexts.profile.profile_id}catch{}return da({name:n,attributes:{release:o,environment:a,user:p||void 0,profile_id:f||void 0,replay_id:u||void 0,transaction:r,"user_agent.original":ji.navigator?.userAgent,"client.address":c?"{{auto}}":void 0,...s},startTime:i,experimental:{standalone:!0}})}function Cc(){return ji.addEventListener&&ji.performance}function Oc(e){return e/1e3}function Ac(e){try{return PerformanceObserver.supportedEntryTypes.includes(e)}catch{return!1}}function Mc(e,t){let n,r=!1;function s(e){!r&&n&&t(e,n),r=!0}(()=>{const e=e=>{"pagehide"!==e.type&&"hidden"!==ji.document?.visibilityState||s("pagehide")};Ma("visibilitychange",e,{capture:!0,once:!0}),Ma("pagehide",e,{capture:!0,once:!0})})();const i=e.on("beforeStartNavigationSpan",(e,t)=>{t?.isRedirect||(s("navigation"),i(),o())}),o=e.on("afterStartPageLoadSpan",e=>{n=e.spanContext().spanId,o()})}function Rc(e){return e?((Te()||performance.timeOrigin)+e)/1e3:e}function Nc(e){const t={};if(null!=e.nextHopProtocol){const{name:n,version:r}=function(e){let t="unknown",n="unknown",r="";for(const s of e){if("/"===s){[t,n]=e.split("/");break}if(!isNaN(Number(s))){t="h"===r?"http":r,n=e.split(r)[1];break}r+=s}return r===e&&(t=r),{name:t,version:n}}(e.nextHopProtocol);t["network.protocol.version"]=r,t["network.protocol.name"]=n}return Te()||Cc()?.timeOrigin?(n={...t,"http.request.redirect_start":Rc(e.redirectStart),"http.request.redirect_end":Rc(e.redirectEnd),"http.request.worker_start":Rc(e.workerStart),"http.request.fetch_start":Rc(e.fetchStart),"http.request.domain_lookup_start":Rc(e.domainLookupStart),"http.request.domain_lookup_end":Rc(e.domainLookupEnd),"http.request.connect_start":Rc(e.connectStart),"http.request.secure_connection_start":Rc(e.secureConnectionStart),"http.request.connection_end":Rc(e.connectEnd),"http.request.request_start":Rc(e.requestStart),"http.request.response_start":Rc(e.responseStart),"http.request.response_end":Rc(e.responseEnd),"http.request.time_to_first_byte":null!=e.responseStart?e.responseStart/1e3:void 0},Object.fromEntries(Object.entries(n).filter(([,e])=>null!=e))):t;var n}let Pc,Lc,Dc=0,$c={};function jc({recordClsStandaloneSpans:e,recordLcpStandaloneSpans:t,client:n}){const r=Cc();if(r&&Te()){r.mark&&ji.performance.mark("sentry-tracing-init");const s=t?function(e){let t,n=0;if(!Ac("largest-contentful-paint"))return;const r=fc(({metric:e})=>{const r=e.entries[e.entries.length-1];r&&(n=e.value,t=r)},!0);Mc(e,(e,s)=>{!function(e,t,n,r){Ho&&j.log(`Sending LCP span (${e})`);const s=Oc((Te()||0)+(t?.startTime||0)),i=He().getScopeData().transactionName,o=t?C(t.element):"Largest contentful paint",a={[mt]:"auto.http.browser.lcp",[ft]:"ui.webvital.lcp",[Mt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};t&&(t.element&&(a["lcp.element"]=C(t.element)),t.id&&(a["lcp.id"]=t.id),t.url&&(a["lcp.url"]=t.url),null!=t.loadTime&&(a["lcp.loadTime"]=t.loadTime),null!=t.renderTime&&(a["lcp.renderTime"]=t.renderTime),null!=t.size&&(a["lcp.size"]=t.size));const c=Ic({name:o,transaction:i,attributes:a,startTime:s});c&&(c.addEvent("lcp",{[yt]:"millisecond",[vt]:e}),c.end(s))}(n,t,s,e),r()})}(n):fc(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&($c.lcp={value:e.value,unit:"millisecond"},Pc=t)},!0),i=wc("ttfb",({metric:e})=>{e.entries[e.entries.length-1]&&($c.ttfb={value:e.value,unit:"millisecond"})},bc,dc),o=e?function(e){let t,n=0;if(!Ac("layout-shift"))return;const r=pc(({metric:e})=>{const r=e.entries[e.entries.length-1];r&&(n=e.value,t=r)},!0);Mc(e,(e,s)=>{!function(e,t,n,r){Ho&&j.log(`Sending CLS span (${e})`);const s=t?Oc((Te()||0)+t.startTime):we(),i=He().getScopeData().transactionName,o=t?C(t.sources[0]?.node):"Layout shift",a={[mt]:"auto.http.browser.cls",[ft]:"ui.webvital.cls",[Mt]:0,"sentry.pageload.span_id":n,"sentry.report_event":r};
1t?.sources&&t.sources.forEach((e,t)=>{a[`cls.source.${t+1}`]=C(e.node)});const c=Ic({name:o,transaction:i,attributes:a,startTime:s});c&&(c.addEvent("cls",{[yt]:"",[vt]:e}),c.end(s))}(n,t,s,e),r()})}(n):pc(({metric:e})=>{const t=e.entries[e.entries.length-1];t&&($c.cls={value:e.value,unit:""},Lc=t)},!0);return()=>{s?.(),i(),o?.()}}return()=>{}}function Bc(e,t,n,r,s=n){const i=function(e){return"secureConnection"===e?"connectEnd":"fetch"===e?"domainLookupStart":`${e}End`}(n),o=t[i],a=t[`${n}Start`];a&&o&&xc(e,r+Oc(a),r+Oc(o),{op:`browser.${s}`,name:t.name,attributes:{[mt]:"auto.ui.browser.metrics",..."redirect"===n&&null!=t.redirectCount?{"http.redirect_count":t.redirectCount}:{}}})}function Fc(){return"undefined"!=typeof window&&(!(("undefined"==typeof __SENTRY_BROWSER_BUNDLE__||!__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0))||function(){const e=c.process;return"renderer"===(null==e?void 0:e.type)}())}const Uc=[],zc=new Map,Wc=new Map;const Hc={click:"click",pointerdown:"click",pointerup:"click",mousedown:"click",mouseup:"click",touchstart:"click",touchend:"click",mouseover:"hover",mouseout:"hover",mouseenter:"hover",mouseleave:"hover",pointerover:"hover",pointerout:"hover",pointerenter:"hover",pointerleave:"hover",dragstart:"drag",dragend:"drag",drag:"drag",dragenter:"drag",dragleave:"drag",dragover:"drag",drop:"drag",keydown:"press",keyup:"press",keypress:"press",input:"press"},qc=({metric:e})=>{if(null==e.value)return;const t=Oc(e.value);if(t>60)return;const n=e.entries.find(t=>t.duration===e.value&&Hc[t.name]);if(!n)return;const{interactionId:r}=n,s=Hc[n.name],i=Oc(Te()+n.startTime),o=Hn(),a=o?zn(o):void 0,c=null!=r?zc.get(r):void 0,l=c?.span||a,u=l?An(l).description:He().getScopeData().transactionName,d=Ic({name:c?.elementName||C(n.target),transaction:u,attributes:{[mt]:"auto.http.browser.inp",[ft]:`ui.interaction.${s}`,[Mt]:n.duration},startTime:i});d&&(d.addEvent("inp",{[yt]:"millisecond",[vt]:e.value}),d.end(i+t))};const Vc="sentry_previous_trace";function Jc(e){return 1===e.traceFlags}function Kc(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.client||Ge();if(!ei()||!t)return{};const n=ze(l());if(n.getTraceData)return n.getTraceData(e);const r=e.scope||He(),s=e.span||Hn();if(!s&&void 0!==We)return{};const i=s?En(s):function(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return _n(t,r,n)}(r),o=Zt(s?Yn(s):Xn(t,r));if(!yn.test(i))return j.warn("Invalid sentry-trace data. Cannot generate trace data"),{};const a={"sentry-trace":i,baggage:o};return e.propagateTraceparent&&(a.traceparent=s?function(e){const{traceId:t,spanId:n}=e.spanContext();return bn(t,n,Ln(e))}(s):function(e){const{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return bn(t,r,n)}(r)),a}function Gc(e,t,n,r,s){if(!e.fetchData)return;const{method:i,url:o}=e.fetchData,a=tn()&&t(o);if(e.endTimestamp){const t=e.fetchData.__span;if(!t)return;const n=r[t];return void(n&&(a&&(function(e,t){if(t.response){var n;dn(e,t.response.status);const r=null===(n=t.response)||void 0===n||null===(n=n.headers)||void 0===n?void 0:n.get("content-length");if(r){const t=parseInt(r);t>0&&e.setAttribute("http.response_content_length",t)}}else t.error&&e.setStatus({code:ln,message:"internal_error"});e.end()}(n,e),function(e,t,n){var r;const s="object"==typeof n&&null!==n?n.onRequestSpanEnd:void 0;null==s||s(e,{headers:null===(r=t.response)||void 0===r?void 0:r.headers,error:t.error})}(n,e,s)),delete r[t]))}const{spanOrigin:c="auto.http.browser",propagateTraceparent:l=!1}="object"==typeof s?s:{spanOrigin:s},u=!!Hn(),d=a&&u?da(function(e,t,n){if(e.startsWith("data:"))return{name:`${t} ${$i(e)}`,attributes:Yc(e,void 0,t,n)};const r=Pi(e);return{name:`${t} ${r?function(e){if(Ni(e))return e.pathname;const t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}(r):e}`,attributes:Yc(e,r,t,n)}}(o,i,c)):new ea;if(e.fetchData.__span=d.spanContext().spanId,r[d.spanContext().spanId]=d,n(e.fetchData.url)){const t=e.args[0],n={...e.args[1]||{}},r=function(e,t,n,r){const s=Kc({span:n,propagateTraceparent:r}),i=s["sentry-trace"],o=s.baggage,a=s.traceparent;if(!i)return;const c=t.headers||(E(e)?e.headers:void 0);if(c){if(function(e){return"undefined"!=typeof Headers&&k(e,Headers)}(c)){const e=new Headers(c);if(e.get("sentry-trace")||e.set("sentry-trace",i),r&&a&&!e.get("traceparent")&&e.set("traceparent",a),o){const t=e.get("baggage");t?Xc(t)||e.set("baggage",`${t},${o}`):e.set("baggage",o)}return e}if(Array.isArray(c)){const e=[...c];c.find(e=>"sentry-trace"===e[0])||e.push(["sentry-trace",i]),r&&a&&!c.find(e=>"traceparent"===e[0])&&e.push(["traceparent",a]);const t=c.find(e=>"baggage"===e[0]&&Xc(e[1]));return o&&!t&&e.push(["baggage",o]),e}{const e="sentry-trace"in c?c["sentry-trace"]:void 0,t="traceparent"in c?c.traceparent:void 0,n="baggage"in c?c.baggage:void 0,s=n?Array.isArray(n)?[...n]:[n]:[],l=n&&(Array.isArray(n)?n.find(e=>Xc(e)):Xc(n));o&&!l&&s.push(o);const u={...c,"sentry-trace":e??i,baggage:s.length>0?s.join(","):void 0};return r&&a&&!t&&(u.traceparent=a),u}}return{...s}}(t,n,tn()&&u?d:void 0,l);r&&(e.args[1]=n,n.headers=r)}const h=Ge();if(h){const t={input:e.args,response:e.response,startTimestamp:e.startTimestamp,endTimestamp:e.endTimestamp};h.emit("beforeOutgoingRequestSpan",d,t)}return d}function Xc(e){return e.split(",").some(e=>e.trim().startsWith(Xt))}function Yc(e,t,n,r){const s={url:$i(e),type:"fetch","http.method":n,[mt]:r,[ft]:"http.client"};return t&&(Ni(t)||(s["http.url"]=$i(t.href),s["server.address"]=t.host),t.search&&(s["http.query"]=t.search),t.hash&&(s["http.fragment"]=t.hash)),s}const Qc=Symbol.for("sentry__originalRequestBody");function Zc(e){return new URLSearchParams(e).toString()}function el(e,t=j){try{if("string"==typeof e)return[e];if(e instanceof URLSearchParams)return[e.toString()];if(e instanceof FormData)return[Zc(e)];if(!e)return[void 0]}catch(n){return Ho&&t.error(n,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Ho&&t.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}function tl(e=[]){if(e.length>=2&&e[1]&&"object"==typeof e[1]&&"body"in e[1])return e[1].body;if(e.length>=1&&e[0]instanceof Request){const t=e[0][Qc];return void 0!==t?t:void 0}}function nl(e){let t;try{t=e.getAllResponseHeaders()}catch(t){return Ho&&j.error(t,"Failed to get xhr response headers",e),{}}return t?t.split("\r\n").reduce((e,t)=>
1{const[n,r]=t.split(": ");return r&&(e[n.toLowerCase()]=r),e},{}):{}}function rl(e){try{return new URL(e,oi.location.origin).href}catch{return}}function sl(e){try{return new Headers(e)}catch{return}}const il=new WeakMap,ol=new Map,al={traceFetch:!0,traceXHR:!0,enableHTTPTimings:!0,trackFetchStreamPerformance:!1};function cl(e,t){const{traceFetch:n,traceXHR:r,trackFetchStreamPerformance:s,shouldCreateSpanForRequest:i,enableHTTPTimings:o,tracePropagationTargets:a,onRequestSpanStart:c,onRequestSpanEnd:l}={...al,...t},u="function"==typeof i?i:e=>!0,d=e=>function(e,t){const n=A();if(n){let r,s;try{r=new URL(e,n),s=new URL(n).origin}catch{return!1}const i=r.origin===s;return t?de(r.toString(),t)||i&&de(r.pathname,t):i}{const n=!!e.match(/^\/(?!\/)/);return t?de(e,t):n}}(e,a),h={},p=e.getOptions().propagateTraceparent;n&&(e.addEventProcessor(e=>("transaction"===e.type&&e.spans&&e.spans.forEach(e=>{if("http.client"===e.op){const t=ol.get(e.span_id);t&&(e.timestamp=t/1e3,ol.delete(e.span_id))}}),e)),s&&function(){const e="fetch-body-resolved";fi(e,e=>{if(e.response){const t=il.get(e.response);t&&e.endTimestamp&&ol.set(t,e.endTimestamp)}}),mi(e,()=>ki(Ti))}(),wi(t=>{const n=Gc(t,u,d,h,{propagateTraceparent:p,onRequestSpanEnd:l});if(t.response&&t.fetchData.__span&&il.set(t.response,t.fetchData.__span),n){const r=rl(t.fetchData.url),s=r?Li(r).host:void 0;n.setAttributes({"http.url":r?$i(r):void 0,"server.address":s}),o&&ul(n,e),null==c||c(n,{headers:t.headers})}})),r&&Vi(t=>{const n=function(e,t,n,r,s,i){const o=e.xhr,a=null==o?void 0:o[qi];if(!o||o.__sentry_own_request__||!a)return;const{url:c,method:l}=a,u=tn()&&t(c);if(e.endTimestamp){const t=o.__sentry_xhr_span_id__;if(!t)return;const n=r[t];return void(n&&(u&&void 0!==a.status_code&&(dn(n,a.status_code),n.end(),null==i||i(n,{headers:sl(nl(o)),error:e.error})),delete r[t]))}const d=rl(c),h=Li(d||c),p=$i(Di(c)),f=!!Hn(),m=u&&f?da({name:`${l} ${p}`,attributes:{url:$i(c),type:"xhr","http.method":l,"http.url":d?$i(d):void 0,"server.address":null==h?void 0:h.host,[mt]:"auto.http.browser",[ft]:"http.client",...(null==h?void 0:h.search)&&{"http.query":null==h?void 0:h.search},...(null==h?void 0:h.hash)&&{"http.fragment":null==h?void 0:h.hash}}}):new ea;o.__sentry_xhr_span_id__=m.spanContext().spanId,r[o.__sentry_xhr_span_id__]=m,n(c)&&function(e,t,n){const{"sentry-trace":r,baggage:s,traceparent:i}=Kc({span:t,propagateTraceparent:n});r&&function(e,t,n,r){var s;const i=null===(s=e.__sentry_xhr_v3__)||void 0===s?void 0:s.request_headers;if((null==i||!i["sentry-trace"])&&e.setRequestHeader)try{if(e.setRequestHeader("sentry-trace",t),!r||null!=i&&i.traceparent||e.setRequestHeader("traceparent",r),n){const t=null==i?void 0:i.baggage;t&&t.split(",").some(e=>e.trim().startsWith("sentry-"))||e.setRequestHeader("baggage",n)}}catch{}}(e,r,s,i)}(o,tn()&&f?m:void 0,s);const g=Ge();return g&&g.emit("beforeOutgoingRequestSpan",m,e),m}(t,u,d,h,p,l);var r;n&&(o&&ul(n,e),null==c||c(n,{headers:sl(null===(r=t.xhr.__sentry_xhr_v3__)||void 0===r?void 0:r.request_headers)}))})}const ll=300;function ul(e,t){const{url:n}=An(e).data;if(!n||"string"!=typeof n)return;let r=()=>{setTimeout(s)};if(ra(t)){const t=e.end.bind(e);e.end=e=>{const n=e??we();let i=!1;const o=()=>{i||(i=!0,setTimeout(s),t(n),clearTimeout(a))};r=o;const a=setTimeout(o,ll)}}const s=gc("resource",t=>{let{entries:s}=t;s.forEach(t=>{(function(e){return"resource"===e.entryType&&"initiatorType"in e&&"string"==typeof e.nextHopProtocol&&("fetch"===e.initiatorType||"xmlhttprequest"===e.initiatorType)})(t)&&t.name.endsWith(n)&&(e.setAttributes(Nc(t)),r())})})}const dl=/Googlebot|Google-InspectionTool|Storebot-Google|Bingbot|Slurp|DuckDuckBot|Baiduspider|YandexBot|Facebot|facebookexternalhit|LinkedInBot|Twitterbot|Applebot/i,hl={...Ta,instrumentNavigation:!0,instrumentPageLoad:!0,markBackgroundSpan:!0,enableLongTask:!0,enableLongAnimationFrame:!0,enableInp:!0,ignoreResourceSpans:[],ignorePerformanceApiSpans:[],detectRedirects:!0,linkPreviousTrace:"in-memory",consistentTraceSampling:!1,enableReportPageLoaded:!1,_experiments:{},...al},pl=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};"enableElementTiming"in e&&P(()=>{console.warn("[Sentry] `enableElementTiming` is deprecated and no longer has any effect. Use the standalone `elementTimingIntegration` instead.")});const t={name:void 0,source:void 0},n=oi.document,{enableInp:r,enableLongTask:s,enableLongAnimationFrame:i,_experiments:{enableInteractions:o,enableStandaloneClsSpans:a,enableStandaloneLcpSpans:l},beforeStartSpan:u,idleTimeout:d,finalTimeout:h,childSpanTimeout:p,markBackgroun
1dSpan:f,traceFetch:m,traceXHR:g,trackFetchStreamPerformance:y,shouldCreateSpanForRequest:v,enableHTTPTimings:b,ignoreResourceSpans:S,ignorePerformanceApiSpans:w,instrumentPageLoad:k,instrumentNavigation:T,detectRedirects:E,linkPreviousTrace:x,consistentTraceSampling:I,enableReportPageLoaded:O,onRequestSpanStart:R,onRequestSpanEnd:N}={...hl,...e},L=function(){const e=oi.navigator;return!(null==e||!e.userAgent)&&dl.test(e.userAgent)}();let D,$,B;function F(e,r){let s=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];const i="pageload"===r.op,o=r.name,c=u?u(r):r,f=c.attributes||{};if(o!==c.name&&(f[dt]="custom",c.attributes=f),!s){const e=be();return void da({...c,startTime:e}).end(e)}t.name=c.name,t.source=f[dt];const m=Ea(c,{idleTimeout:d,finalTimeout:h,childSpanTimeout:p,disableAutoFinish:i,beforeSpanEnd:t=>{var n;null===(n=D)||void 0===n||n(),function(e,t){const n=Cc(),r=Te();if(!n?.getEntries||!r)return;const s=Oc(r),i=n.getEntries(),{op:o,start_timestamp:a}=An(e);i.slice(Dc).forEach(n=>{const r=Oc(n.startTime),i=Oc(Math.max(0,n.duration));if(!("navigation"===o&&a&&s+r<a))switch(n.entryType){case"navigation":!function(e,t,n){["unloadEvent","redirect","domContentLoadedEvent","loadEvent","connect"].forEach(r=>{Bc(e,t,r,n)}),Bc(e,t,"secureConnection",n,"TLS/SSL"),Bc(e,t,"fetch",n,"cache"),Bc(e,t,"domainLookup",n,"DNS"),function(e,t,n){const r=n+Oc(t.requestStart),s=n+Oc(t.responseEnd),i=n+Oc(t.responseStart);t.responseEnd&&(xc(e,r,s,{op:"browser.request",name:t.name,attributes:{[mt]:"auto.ui.browser.metrics"}}),xc(e,i,s,{op:"browser.response",name:t.name,attributes:{[mt]:"auto.ui.browser.metrics"}}))}(e,t,n)}(e,n,s);break;case"mark":case"paint":case"measure":{!function(e,t,n,r,s,i){if(function(e){if("measure"===e?.entryType)try{return"Components â"===e.detail.devtools.track}catch{return}}(t))return;if(["mark","measure"].includes(t.entryType)&&de(t.name,i))return;const o=Oa(!1),a=Oc(o?o.requestStart:0),c=s+Math.max(n,a),l=s+n,u=l+r,d={[mt]:"auto.resource.browser.metrics"};c!==l&&(d["sentry.browser.measure_happened_before_request"]=!0,d["sentry.browser.measure_start_time"]=c),function(e,t){try{const n=t.detail;if(!n)return;if("object"==typeof n){for(const[t,r]of Object.entries(n))if(r&&_(r))e[`sentry.browser.measure.detail.${t}`]=r;else if(void 0!==r)try{e[`sentry.browser.measure.detail.${t}`]=JSON.stringify(r)}catch{}return}if(_(n))return void(e["sentry.browser.measure.detail"]=n);try{e["sentry.browser.measure.detail"]=JSON.stringify(n)}catch{}}catch{}}(d,t),c<=u&&xc(e,c,u,{name:t.name,op:t.entryType,attributes:d})}(e,n,r,i,s,t.ignorePerformanceApiSpans);const o=Da(),a=n.startTime<o.firstHiddenTime;"first-paint"===n.name&&a&&($c.fp={value:n.startTime,unit:"millisecond"}),"first-contentful-paint"===n.name&&a&&($c.fcp={value:n.startTime,unit:"millisecond"});break}case"resource":!function(e,t,n,r,s,i,o){if("xmlhttprequest"===t.initiatorType||"fetch"===t.initiatorType)return;const a=t.initiatorType?`resource.${t.initiatorType}`:"resource.other";if(o?.includes(a))return;const c={[mt]:"auto.resource.browser.metrics"},l=Li(n);l.protocol&&(c["url.scheme"]=l.protocol.split(":").pop()),l.host&&(c["server.address"]=l.host),c["url.same_origin"]=n.includes(ji.location.origin),function(e,t){[["responseStatus","http.response.status_code"],["transferSize","http.response_transfer_size"],["encodedBodySize","http.response_content_length"],["decodedBodySize","http.decoded_response_content_length"],["renderBlockingStatus","resource.render_blocking_status"],["deliveryType","http.response_delivery_type"]].forEach(([n,r])=>{const s=e[n];null!=s&&("number"==typeof s&&s<2147483647||"string"==typeof s)&&(t[r]=s)})}(t,c);const u={...c,...Nc(t)},d=i+r;xc(e,d,d+s,{name:n.replace(ji.location.origin,""),op:a,attributes:u})}(e,n,n.name,r,i,s,t.ignoreResourceSpans)}}),Dc=Math.max(i.length-1,0),function(e){const t=ji.navigator;if(!t)return;const n=t.connection;n&&(n.effectiveType&&e.setAttribute("effectiveConnectionType",n.effectiveType),n.type&&e.setAttribute("connectionType",n.type),Ec(n.rtt)&&($c["connection.rtt"]={value:n.rtt,unit:"millisecond"})),Ec(t.deviceMemory)&&e.setAttribute("deviceMemory",`${t.deviceMemory} GB`),Ec(t.hardwareConcurrency)&&e.setAttribute("hardwareConcurrency",String(t.hardwareConcurrency))}(e),"pageload"===o&&(function(e){const t=Oa(!1);if(!t)return;const{responseStart:n,requestStart:r}=t;r<=n&&(e["ttfb.requestTime"]={value:n-r,unit:"millisecond"})}($c),t.recordClsOnPageloadSpan||delete $c.cls,t.recordLcpOnPageloadSpan||delete $c.lcp,Object.entries($c).forEac
1h(([e,t])=>{ta(e,t.value,t.unit)}),e.setAttribute("performance.timeOrigin",s),e.setAttribute("performance.activationStart",Aa()),function(e,t){Pc&&t.recordLcpOnPageloadSpan&&(Pc.element&&e.setAttribute("lcp.element",C(Pc.element)),Pc.id&&e.setAttribute("lcp.id",Pc.id),Pc.url&&e.setAttribute("lcp.url",Pc.url.trim().slice(0,200)),null!=Pc.loadTime&&e.setAttribute("lcp.loadTime",Pc.loadTime),null!=Pc.renderTime&&e.setAttribute("lcp.renderTime",Pc.renderTime),e.setAttribute("lcp.size",Pc.size)),Lc?.sources&&t.recordClsOnPageloadSpan&&Lc.sources.forEach((t,n)=>e.setAttribute(`cls.source.${n+1}`,C(t.node)))}(e,t)),Pc=void 0,Lc=void 0,$c={}}(t,{recordClsOnPageloadSpan:!a,recordLcpOnPageloadSpan:!l,ignoreResourceSpans:S,ignorePerformanceApiSpans:w}),bl(e,void 0);const r=He(),s=r.getPropagationContext();r.setPropagationContext({...s,traceId:m.spanContext().traceId,sampled:Ln(m),dsc:Yn(t)}),i&&(B=void 0)},trimIdleSpanEndTimestamp:!O});function g(){n&&["interactive","complete"].includes(n.readyState)&&e.emit("idleSpanEnableAutoFinish",m)}i&&O&&(B=m),bl(e,m),i&&!O&&n&&(n.addEventListener("readystatechange",()=>{g()}),g())}return{name:"BrowserTracing",setup(e){var t;if(L)Yi&&j.log("[Tracing] Skipping browserTracingIntegration setup for bot user agent.");else{if(Ia(),D=jc({recordClsStandaloneSpans:a||!1,recordLcpStandaloneSpans:l||!1,client:e}),r&&function(){if(Cc()&&Te()){const e=mc(qc);return()=>{e()}}}(),i&&c.PerformanceObserver&&null!==(t=PerformanceObserver.supportedEntryTypes)&&void 0!==t&&t.includes("long-animation-frame")?new PerformanceObserver(e=>{const t=Hn();if(t)for(const n of e.getEntries()){if(!n.scripts[0])continue;const e=Oc(Te()+n.startTime),{start_timestamp:r,op:s}=An(t);if("navigation"===s&&r&&e<r)continue;const i=Oc(n.duration),o={[mt]:"auto.ui.browser.metrics"},a=n.scripts[0],{invoker:c,invokerType:l,sourceURL:u,sourceFunctionName:d,sourceCharPosition:h}=a;o["browser.script.invoker"]=c,o["browser.script.invoker_type"]=l,u&&(o["code.filepath"]=u),d&&(o["code.function"]=d),-1!==h&&(o["browser.script.source_char_position"]=h),xc(t,e,e+i,{name:"Main UI thread blocked",op:"ui.long-animation-frame",attributes:o})}}).observe({type:"long-animation-frame",buffered:!0}):s&&gc("longtask",({entries:e})=>{const t=Hn();if(!t)return;const{op:n,start_timestamp:r}=An(t);for(const s of e){const e=Oc(Te()+s.startTime),i=Oc(s.duration);"navigation"===n&&r&&e<r||xc(t,e,e+i,{name:"Main UI thread blocked",op:"ui.long-task",attributes:{[mt]:"auto.ui.browser.metrics"}})}}),o&&gc("event",({entries:e})=>{const t=Hn();if(t)for(const n of e)if("click"===n.name){const e=Oc(Te()+n.startTime),r=Oc(n.duration),s={name:C(n.target),op:`ui.interaction.${n.name}`,startTime:e,attributes:{[mt]:"auto.ui.browser.metrics"}},i=M(n.target);i&&(s.attributes["ui.component_name"]=i),xc(t,e,e+r,s)}}),E&&n){const e=()=>{$=we()};addEventListener("click",e,{capture:!0}),addEventListener("keydown",e,{capture:!0,passive:!0})}e.on("startNavigationSpan",(t,n)=>{if(Ge()!==e)return;if(null!=n&&n.isRedirect)return Yi&&j.warn("[Tracing] Detected redirect, navigation span will not be the root span, but a child span."),void F(e,{op:"navigation.redirect",...t},!1);$=void 0,u(),qe().setPropagationContext({traceId:Ie(),sampleRand:Math.random(),propagationSpanId:tn()?void 0:Ce()});const r=He();r.setPropagationContext({traceId:Ie(),sampleRand:Math.random(),propagationSpanId:tn()?void 0:Ce()}),r.setSDKProcessingMetadata({normalizedRequest:void 0}),F(e,{op:"navigation",...t,parentSpan:null,forceTransaction:!0})}),e.on("startPageLoadSpan",function(t){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(Ge()!==e)return;u();const r=vn(n.sentryTrace||gl("sentry-trace")||yl("sentry-trace"),n.baggage||gl("baggage")||yl("baggage")),s=He();s.setPropagationContext(r),tn()||(s.getPropagationContext().propagationSpanId=Ce()),s.setSDKProcessingMetadata({normalizedRequest:ui()}),F(e,{op:"pageload",...t})}),e.on("endPageloadSpan",()=>{O&&B&&(B.setAttribute(gt,"reportPageLoaded"),B.end())})}function u(){const t=_l(e);t&&!An(t).timestamp&&(Yi&&j.log(`[Tracing] Finishing current active span with op: ${An(t).op}`),t.setAttribute(gt,"cancelled"),t.end())}},afterAllSetup(e){if(L)return;let n=A();if("off"!==x&&function(e,t){let{linkPreviousTrace:n,consistentTraceSampling:r}=t;const s="session-storage"===n;let i=s?function(){try{var e;const t=null===(e=oi.sessionStorage)||void 0===e?void 0:e.getItem(Vc);return JSON.parse(t)}catch{return}}():void 0;e.on("spanStart",e=>{if(zn(e)!==e)return;const t=He().getPropagationContext();i=function(e,t,n){const r=An(t),s={spanContext:t.spanContext(),startTimestamp:r.start_timestamp,sampleRate:function(){try{var e,t;return Number(null===(e=n.dsc)||void 0===e?void 0:e.sample_rate)??Number(null===(t=r.data)||void 0===t?void 0:t[ht])}catch{return 0}}(),sampleRand:n.sampleRand};if(!e)return s;const i=e.spanContext;return i.traceId===r.trace_id?e:(Date.now()/1e3-e.startTimestamp<=3600&&(Yi&&j.log(`Adding previous_trace \`${JSON.stringify(i)}\` link to span \`${JSON.stringify({op:r.op,...t.spanContext()})}\``),t.addLink({context:i,attributes:{[Rt]:"previous_trace"}}),t.setAttribute("sentry.previous_trace",`${i.traceId}-${i.spanId}-${Jc(i)?1:0}`)),s)}(i,e,t),s&&function(e){try{oi.sessionStorage.setItem(Vc,JSON.stringify(e))}catch(e){Yi&&j.warn("Could not store previous trace in sessionStorage",e)}}(i)});let o=!0;r&&e.on("beforeSampling",e=>
1{if(!i)return;const t=He(),n=t.getPropagationContext();o&&n.parentSpanId?o=!1:(t.setPropagationContext({...n,dsc:{...n.dsc,sample_rate:String(i.sampleRate),sampled:String(Jc(i.spanContext))},sampleRand:i.sampleRand}),e.parentSampled=Jc(i.spanContext),e.parentSampleRate=i.sampleRate,e.spanAttributes={...e.spanAttributes,[pt]:i.sampleRate})})}(e,{linkPreviousTrace:x,consistentTraceSampling:I}),oi.location){if(k){const t=Te();fl(e,{name:oi.location.pathname,startTime:t?t/1e3:void 0,attributes:{[dt]:"url",[mt]:"auto.pageload.browser"}})}T&&Gi(t=>{var r;let{to:s,from:i}=t;if(void 0===i&&-1!==(null===(r=n)||void 0===r?void 0:r.indexOf(s)))return void(n=void 0);n=void 0;const o=Pi(s),a=_l(e),c=a&&E&&function(e,t){const n=An(e),r=be();return!(r-n.start_timestamp>Sl)&&!(t&&r-t<=Sl)}(a,$);ml(e,{name:(null==o?void 0:o.pathname)||oi.location.pathname,attributes:{[dt]:"url",[mt]:"auto.navigation.browser"}},{url:s,isRedirect:c})})}f&&(oi.document?oi.document.addEventListener("visibilitychange",()=>{const e=Hn();if(!e)return;const t=zn(e);if(oi.document.hidden&&t){const e="cancelled",{op:n,status:r}=An(t);Yi&&j.log(`[Tracing] Transaction: ${e} -> since tab moved to the background, op: ${n}`),r||t.setStatus({code:ln,message:e}),t.setAttribute("sentry.cancellation_reason","document.hidden"),t.end()}}):Yi&&j.warn("[Tracing] Could not set up background tab detection due to lack of global document")),o&&function(e,t,n,r,s){let i;oi.document&&addEventListener("click",()=>{const o="ui.action.click",a=_l(e);if(a){const e=An(a).op;if(["navigation","pageload"].includes(e))return void(Yi&&j.warn(`[Tracing] Did not create ${o} span because a pageload or navigation span is in progress.`))}i&&(i.setAttribute(gt,"interactionInterrupted"),i.end(),i=void 0),s.name?i=Ea({name:s.name,op:o,attributes:{[dt]:s.source||"url"}},{idleTimeout:t,finalTimeout:n,childSpanTimeout:r}):Yi&&j.warn(`[Tracing] Did not create ${o} transaction because _latestRouteName is missing.`)},{capture:!0})}(e,d,h,p,t),r&&function(){const e=Object.keys(Hc);function t(e){const t=e.target;if(!t)return;const n=C(t),r=Math.round(e.timeStamp);if(Wc.set(r,n),Wc.size>50){const e=Wc.keys().next().value;void 0!==e&&Wc.delete(e)}}Fc()&&e.forEach(e=>{ji.addEventListener(e,t,{capture:!0,passive:!0})});const n=({entries:e})=>{const t=Hn(),n=t&&zn(t);e.forEach(e=>{if(!function(e){return"duration"in e}(e))return;const t=e.interactionId;if(null==t)return;if(zc.has(t))return;const r=e.target?C(e.target):function(e){const t=Math.round(e.startTime);let n=Wc.get(t);if(!n)for(let e=-5;e<=5;e++){const r=Wc.get(t+e);if(r){n=r;break}}return n||"<unknown>"}(e);if(Uc.length>10){const e=Uc.shift();zc.delete(e)}Uc.push(t),zc.set(t,{span:n,elementName:r})})};gc("event",n),gc("first-input",n)}(),cl(e,{traceFetch:m,traceXHR:g,trackFetchStreamPerformance:y,tracePropagationTargets:e.getOptions().tracePropagationTargets,shouldCreateSpanForRequest:v,enableHTTPTimings:b,onRequestSpanStart:R,onRequestSpanEnd:N})}}};function fl(e,t,n){e.emit("startPageLoadSpan",t,n),He().setTransactionName(t.name);const r=_l(e);return r&&e.emit("afterStartPageLoadSpan",r),r}function ml(e,t,n){const{url:r,isRedirect:s}=n||{};e.emit("beforeStartNavigationSpan",t,{isRedirect:s}),e.emit("startNavigationSpan",t,{isRedirect:s});const i=He();return i.setTransactionName(t.name),r&&!s&&i.setSDKProcessingMetadata({normalizedRequest:{...ui(),url:r}}),_l(e)}function gl(e){const t=oi.document,n=null==t?void 0:t.querySelector(`meta[name=${e}]`);return(null==n?void 0:n.getAttribute("content"))||void 0}function yl(e){var t,n,r;const s=null===(t=oi.performance)||void 0===t||null===(n=t.getEntriesByType)||void 0===n?void 0:n.call(t,"navigation")[0],i=null==s||null===(r=s.serverTiming)||void 0===r?void 0:r.find(t=>t.name===e);return null==i?void 0:i.description}const vl="_sentry_idleSpan";function _l(e){return e[vl]}function bl(e,t){F(e,vl,t)}const Sl=1.5;var wl;const kl=1e6,Tl="window"in c&&c.window===c&&"undefined"==typeof importScripts,El=String(0),xl=Tl?"main":"worker",Il=oi.navigator;let Cl="",Ol="",Al="",Ml=(null==Il?void 0:Il.userAgent)||"",Rl="";const Nl=(null==Il?void 0:Il.language)||(null==Il||null===(wl=Il.languages)||void 0===wl?void 0:wl[0])||"",Pl=null==Il?void 0:Il.userAgentData;var Ll;function Dl(e,t,n,r){if("transaction"!==r.type)throw new TypeError("Profiling events may only be attached to transactions, this should never occur.");if(null==n)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${n} instead.`);const s=function(e){var t;const n=null===(t=e.contexts)||void 0===t||null===(t=t.trace)||void 0===t?void 0:t.trace_id;return"string"==typeof n&&32!==n.length&&Yi&&j.log(`[Profiling] Invalid traceId: ${n} on profiled event`),"string"!=typeof n?"":n}(r),i=function(e){return!("thread_metadata"in e)}(c=n)?function(e){let t,n=0;const r={samples:[],stacks:[],frames:[],thread_metadata:{[El]:{name:xl}}},s=e.samples[0];if(!s)return r;const i=s.timestamp,o=Te(),a="number"==typeof performance.timeOrigin?performance.timeOrigin:o||0,c=a-(o||a);
1return e.samples.forEach((s,o)=>{if(void 0===s.stackId)return void 0===t&&(t=n,r.stacks[t]=[],n++),void(r.samples[o]={elapsed_since_start_ns:((s.timestamp+c-i)*kl).toFixed(0),stack_id:t,thread_id:El});let a=e.stacks[s.stackId];const l=[];for(;a;){l.push(a.frameId);const t=e.frames[a.frameId];t&&void 0===r.frames[a.frameId]&&(r.frames[a.frameId]={function:t.name,abs_path:"number"==typeof t.resourceId?e.resources[t.resourceId]:void 0,lineno:t.line,colno:t.column}),a=void 0===a.parentId?void 0:e.stacks[a.parentId]}const u={elapsed_since_start_ns:((s.timestamp+c-i)*kl).toFixed(0),stack_id:n,thread_id:El};r.stacks[n]=l,r.samples[o]=u,n++}),r}(c):c,o=t||("number"==typeof r.start_timestamp?1e3*r.start_timestamp:1e3*we()),a="number"==typeof r.timestamp?1e3*r.timestamp:1e3*we();var c;return{event_id:e,timestamp:new Date(o).toISOString(),platform:"javascript",version:"1",release:r.release||"",environment:r.environment||Gt,runtime:{name:"javascript",version:oi.navigator.userAgent},os:{name:Cl,version:Ol,build_number:Ml},device:{locale:Nl,model:Rl,manufacturer:Ml,architecture:Al,is_emulator:!1},debug_meta:{images:jl(n.resources)},profile:i,transactions:[{name:r.transaction||"",id:r.event_id||pe(),trace_id:s,active_thread_id:El,relative_start_ns:"0",relative_end_ns:(1e6*(a-o)).toFixed(0)}]}}function $l(e){return"pageload"===An(e).op}
1function jl(e){const t=Ge(),n=null==t?void 0:t.getOptions(),r=null==n?void 0:n.stackParser;return r?function(e,t){const n=os(e);if(!n)return[];const r=[];for(const e of t){const t=oe(e);t&&n[t]&&r.push({type:"sourcemap",code_file:e,debug_id:n[t]})}return r}(r,e):[]}function Bl(e){return"number"!=typeof e&&"boolean"!=typeof e||"number"==typeof e&&isNaN(e)?(Yi&&j.warn(`[Profiling] Invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`),!1):!0===e||!1===e||!(e<0||e>1)||(Yi&&j.warn(`[Profiling] Invalid sample rate. Sample rate must be between 0 and 1. Got ${e}.`),!1)}"object"==typeof(Ll=Pl)&&null!==Ll&&"getHighEntropyValues"in Ll&&Pl.getHighEntropyValues(["architecture","model","platform","platformVersion","fullVersionList"]).then(e=>{var t;if(Cl=e.platform||"",Al=e.architecture||"",Rl=e.model||"",Ol=e.platformVersion||"",null!==(t=e.fullVersionList)&&void 0!==t&&t.length){const t=e.fullVersionList[e.fullVersionList.length-1];Ml=`${t.brand} ${t.version}`}}).catch(e=>{});let Fl=!1;function Ul(){const e=oi.Profiler;if("function"!=typeof e)return void(Yi&&j.log("[Profiling] Profiling is not supported by this browser, Profiler interface missing on window object."));const t=Math.floor(3e3);try{return new e({sampleInterval:10,maxBufferSize:t})}catch(e){Yi&&(j.log("[Profiling] Failed to initialize the Profiling constructor, this is likely due to a missing 'Document-Policy': 'js-profiling' header."),j.log("[Profiling] Disabling profiling for current user session.")),Fl=!0}}function zl(e){if(Fl)return Yi&&j.log("[Profiling] Profiling has been disabled for the duration of the current user session."),!1;if(!e.isRecording())return Yi&&j.log("[Profiling] Discarding profile because root span was not sampled."),!1;
1const t=Ge(),n=null==t?void 0:t.getOptions();if(!n)return Yi&&j.log("[Profiling] Profiling disabled, no options found."),!1;const r=n.profilesSampleRate;return Bl(r)?r?!!(!0===r||Math.random()<r)||(Yi&&j.log(`[Profiling] Discarding profile because it's not included in the random sample (sampling rate = ${Number(r)})`),!1):(Yi&&j.log("[Profiling] Discarding profile because a negative sampling decision was inherited or profileSampleRate is set to 0"),!1):(Yi&&j.warn("[Profiling] Discarding profile because of invalid sample rate."),!1)}function Wl(e){return void 0!==e.profilesSampleRate}function Hl(e,t,n,r){return function(e){return e.samples.length<2?(Yi&&j.log("[Profiling] Discarding profile because it contains less than 2 samples"),!1):!!e.frames.length||(Yi&&j.log("[Profiling] Discarding profile because it contains no frames"),!1)}(n)?Dl(e,t,n,r):null}const ql=new Map;function Vl(e){const t=ql.get(e);return t&&ql.delete(e),t}function Jl(e){let t;$l(e)&&(t=1e3*we());const n=Ul();if(!n)return;Yi&&j.log(`[Profiling] started profiling span: ${An(e).description}`);const r=pe();let s=null;async function i(){if(e&&n){if(!s)return n.stop().then(t=>{o&&(oi.clearTimeout(o),o=void 0),Yi&&j.log(`[Profiling] stopped profiling of span: ${An(e).description}`),t?(s=t,function(e,t){if(ql.set(e,t),ql.size>30){const e=ql.keys().next().value;void 0!==e&&ql.delete(e)}}(r,t)):Yi&&j.log(`[Profiling] profiler returned null profile for: ${An(e).description}`,"this may indicate an overlapping span or a call to stopProfiling with a profile title that was never started")}).catch(e=>{Yi&&j.log("[Profiling] error while stopping profiler:",e)});Yi&&j.log("[Profiling] profile for:",An(e).description,"already exists, returning early")}}He().setContext("profile",{profile_id:r,start_timestamp:t});let o=oi.setTimeout(()=>{Yi&&j.log("[Profiling] max profile duration elapsed, stopping profiling for:",An(e).description),i()},3e4);const a=e.end.bind(e);e.end=function(){return e?(i().then(()=>{a()},()=>{a()}),e):a()}}class Kl{constructor(){this._client=void 0,this._profiler=void 0,this._chunkTimer=void 0,this._profilerId=void 0,this._isRunning=!1,this._sessionSampled=!1,this._lifecycleMode=void 0,this._activeRootSpanIds=new Set,this._rootSpanTimeouts=new Map}initialize(e){const t=e.getOptions().profileLifecycle,n=function(e){if(Fl)return Yi&&j.log("[Profiling] Profiling has been disabled for the duration of the current user session as the JS Profiler could not be started."),!1;if("trace"!==e.profileLifecycle&&"manual"!==e.profileLifecycle)return Yi&&j.warn("[Profiling] Session not sampled. Invalid `profileLifecycle` option."),!1;const t=e.profileSessionSampleRate;return Bl(t)?t?Math.random()<=t:(Yi&&j.log("[Profiling] Discarding profile because profileSessionSampleRate is not defined or set to 0"),!1):(Yi&&j.warn("[Profiling] Discarding profile because of invalid profileSessionSampleRate."),!1)}(e.getOptions());Yi&&j.log(`[Profiling] Initializing profiler (lifecycle='${t}').`),n||Yi&&j.log("[Profiling] Session not sampled. Skipping lifecycle profiler initialization."),this._profilerId=pe(),this._client=e,this._sessionSampled=n,this._lifecycleMode=t,"trace"===t&&this._setupTraceLifecycleListeners(e)}start(){"trace"!==this._lifecycleMode?this._isRunning?Yi&&j.warn("[Profiling] Profile session is already running, `uiProfiler.start()` is a no-op."):this._sessionSampled?this._beginProfiling():Yi&&j.warn("[Profiling] Session is not sampled, `uiProfiler.start()` is a no-op."):Yi&&j.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.start()` are ignored in trace mode.')}stop(){"trace"!==this._lifecycleMode?this._isRunning?this._endProfiling():Yi&&j.warn("[Profiling] Profiler is not running, `uiProfiler.stop()` is a no-op."):Yi&&j.warn('[Profiling] `profileLifecycle` is set to "trace". Calls to `uiProfiler.stop()` are ignored in trace mode.')}notifyRootSpanActive(e){if("trace"!==this._lifecycleMode||!this._sessionSampled)return;const t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);const n=this._activeRootSpanIds.size;1===n&&(Yi&&j.log("[Profiling] Detected already active root span during setup. Active root spans now:",n),this._beginProfiling())}_beginProfiling(){if(!this._isRunning){if(this._isRunning=!0,Yi&&j.log("[Profiling] Started profiling with profiler ID:",this._profilerId),Ve().setContext("profile",{profiler_id:this._profilerId}),this._startProfilerInstance(),!this._profiler)return Yi&&j.log("[Profiling] Failed to start JS Profiler; stopping."),void this._resetProfilerInfo();this._startPeriodicChunking()}}_endProfiling(){this._isRunning&&(this._isRunning=!1,this._chunkTimer&&(clearTimeout(this._chunkTimer),this._chunkTimer=void 0),this._clearAllRootSpanTimeouts(),this._collectCurrentChunk().catch(e=>{Yi&&j.error("[Profiling] Failed to collect current profile chunk on `stop()`:",e)}),"manual"===this._lifecycleMode&&Ve().setContext("profile",{}))}_setupTraceLifecycleListeners(e){e.on("spanStart",e=>{if(!this._sessionSampled)return void(Yi&&j.log("[Profiling] Span not profiled because of negative sampling decision for user session."));if(e!==zn(e))return;if(!e.isRecording())return void(Yi&&j.log("[Profiling] Discarding profile because root span was not sampled."));const t=e.spanContext().spanId;if(!t||this._activeRootSpanIds.has(t))return;this._registerTraceRootSpan(t);const n=this._activeRootSpanIds.size;1===n&&(Yi&&j.log(`[Profiling] Root span ${t} started. Profiling active while there are active root spans (count=${n}).`),this._beginProfiling())}),e.on("spanEnd",e=>{if(!this._sessionSampled)return;const t=e.spanContext().spanId;if(!t||!this._activeRootSpanIds.has(t))return;this._activeRootSpanIds.delete(t);const n=this._activeRootSpanIds.size;Yi&&j.log(`[Profiling] Root span with ID ${t} ended. Will continue profiling for as long as there are active root spans (currently: ${n}).`),0===n&&(this._collectCurrentChunk().catch(e=>{Yi&&j.error("[Profiling] Failed to collect current profile chunk on last `spanEnd`:",e)}),this._endProfiling())})}_resetProfilerInfo(){this._isRunning=!1,Ve().setContext("profile",{})}
1_clearAllRootSpanTimeouts(){this._rootSpanTimeouts.forEach(e=>clearTimeout(e)),this._rootSpanTimeouts.clear()}_registerTraceRootSpan(e){this._activeRootSpanIds.add(e);const t=setTimeout(()=>this._onRootSpanTimeout(e),3e5);this._rootSpanTimeouts.set(e,t)}_startProfilerInstance(){var e;if(!1===(null===(e=this._profiler)||void 0===e?void 0:e.stopped))return;const t=Ul();t?this._profiler=t:Yi&&j.log("[Profiling] Failed to start JS Profiler.")}_startPeriodicChunking(){this._isRunning&&(this._chunkTimer=setTimeout(()=>{if(this._collectCurrentChunk().catch(e=>{Yi&&j.error("[Profiling] Failed to collect current profile chunk during periodic chunking:",e)}),this._isRunning){if(this._startProfilerInstance(),!this._profiler)return void this._resetProfilerInfo();this._startPeriodicChunking()}},6e4))}_onRootSpanTimeout(e){this._rootSpanTimeouts.has(e)&&(this._rootSpanTimeouts.delete(e),this._activeRootSpanIds.has(e)&&(Yi&&j.log(`[Profiling] Reached 5-minute timeout for root span ${e}. You likely started a manual root span that never called \`.end()\`.`),this._activeRootSpanIds.delete(e),0===this._activeRootSpanIds.size&&this._endProfiling()))}async _collectCurrentChunk(){const e=this._profiler;if(this._profiler=void 0,e)try{const t=function(e,t,n){var r;if(null==e)throw new TypeError(`Cannot construct profiling event envelope without a valid profile. Got ${e} instead.`);const s=function(e){const t=[];for(let n=0;n<e.frames.length;n++){const r=e.frames[n];r&&(t[n]={function:r.name,abs_path:"number"==typeof r.resourceId?e.resources[r.resourceId]:void 0,lineno:r.line,colno:r.column})}const n=[];for(let t=0;t<e.stacks.length;t++){const r=e.stacks[t];if(!r)continue;const s=[];let i=r;for(;i;)s.push(i.frameId),i=void 0===i.parentId?void 0:e.stacks[i.parentId];n[t]=s}const r=Te(),s="number"==typeof performance.timeOrigin?performance.timeOrigin:r||0,i=s-(r||s),o=[];for(let t=0;t<e.samples.length;t++){const n=e.samples[t];if(!n)continue;const r=(s+(n.timestamp-i))/1e3;o[t]={stack_id:n.stackId??0,thread_id:El,timestamp:r}}return{frames:t,stacks:n,samples:o,thread_metadata:{[El]:{name:xl}}}}(e),i=t.getOptions(),o=null===(r=t.getSdkMetadata)||void 0===r||null===(r=r.call(t))||void 0===r?void 0:r.sdk;return{chunk_id:pe(),client_sdk:{name:(null==o?void 0:o.name)??"sentry.javascript.browser",version:(null==o?void 0:o.version)??"0.0.0"},profiler_id:n||pe(),platform:"javascript",version:"2",release:i.release??"",environment:i.environment??"production",debug_meta:{images:jl(e.resources)},profile:s}}(await e.stop(),this._client,this._profilerId),n=function(e){try{if(!e||"object"!=typeof e)return{reason:"chunk is not an object"};const t=e=>"string"==typeof e&&/^[a-f0-9]{32}$/.test(e);if(!t(e.profiler_id))return{reason:"missing or invalid profiler_id"};if(!t(e.chunk_id))return{reason:"missing or invalid chunk_id"};if(!e.client_sdk)return{reason:"missing client_sdk metadata"};const n=e.profile;return n?Array.isArray(n.frames)&&n.frames.length?Array.isArray(n.stacks)&&n.stacks.length?Array.isArray(n.samples)&&n.samples.length?{valid:!0}:{reason:"profile has no samples"}:{reason:"profile has no stacks"}:{reason:"profile has no frames"}:{reason:"missing profile data"}}catch(e){return{reason:`unknown validation error: ${e}`}}}(t);if("reason"in n)return void(Yi&&j.log("[Profiling] Discarding invalid profile chunk (this is probably a bug in the SDK):",n.reason));this._sendProfileChunk(t),Yi&&j.log("[Profiling] Collected browser profile chunk.")}catch(e){Yi&&j.log("[Profiling] Error while stopping JS Profiler for chunk:",e)}}_sendProfileChunk(e){var t;const n=this._client,r=fr(null===(t=n.getSdkMetadata)||void 0===t?void 0:t.call(n)),s=n.getDsn(),i=n.getOptions().tunnel,o=sr({event_id:pe(),sent_at:(new Date).toISOString(),...r&&{sdk:r},...!!i&&s&&{dsn:Ut(s)}},[[{type:"profile_chunk",platform:"javascript"},e]]);n.sendEnvelope(o).then(null,e=>{Yi&&j.error("Error while sending profile chunk envelope:",e)})}}const Gl=()=>({name:"BrowserProfiling",setup(e){const t=e.getOptions(),n=new Kl;if(Wl(t)||t.profileLifecycle||(t.profileLifecycle="manual"),Wl(t)&&!t.profilesSampleRate)return void(Yi&&j.log("[Profiling] Profiling disabled, no profiling options foun
1d."));const r=Hn(),s=r&&zn(r);if(Wl(t)&&void 0!==t.profileSessionSampleRate&&Yi&&j.warn("[Profiling] Both legacy profiling (`profilesSampleRate`) and UI profiling settings are defined. `profileSessionSampleRate` has no effect when legacy profiling is enabled."),Wl(t))s&&$l(s)&&zl(s)&&Jl(s),e.on("spanStart",e=>{e===zn(e)&&zl(e)&&Jl(e)}),e.on("beforeEnvelope",e=>{if(!ql.size)return;const t=function(e){const t=[];return or(e,(e,n)=>{if("transaction"===n)for(let n=1;n<e.length;n++){var r;const s=e[n];null!=s&&null!==(r=s.contexts)&&void 0!==r&&null!==(r=r.profile)&&void 0!==r&&r.profile_id&&t.push(e[n])}}),t}(e);if(!t.length)return;const n=[];for(const e of t){var r,s;const t=null==e?void 0:e.contexts,i=null==t||null===(r=t.profile)||void 0===r?void 0:r.profile_id,o=null==t||null===(s=t.profile)||void 0===s?void 0:s.start_timestamp;if("string"!=typeof i){Yi&&j.log("[Profiling] cannot find profile for a span without a profile context");continue}if(!i){Yi&&j.log("[Profiling] cannot find profile for a span without a profile context");continue}null!=t&&t.profile&&delete t.profile;const a=Vl(i);if(!a){Yi&&j.log(`[Profiling] Could not retrieve profile for span: ${i}`);continue}const c=Hl(i,o,a,e);c&&n.push(c)}!function(e,t){if(!t.length)return e;for(const n of t)e[1].push([{type:"profile"},n])}(e,n)});else{const r=t.profileLifecycle;if(e.on("startUIProfiler",()=>n.start()),e.on("stopUIProfiler",()=>n.stop()),"manual"===r)n.initialize(e);else if("trace"===r){if(!tn(t))return void(Yi&&j.warn("[Profiling] `profileLifecycle` is 'trace' but tracing is disabled. Set a `tracesSampleRate` or `tracesSampler` to enable span tracing."));n.initialize(e),s&&n.notifyRootSpanActive(s),oi.setTimeout(()=>{const e=Hn(),t=e&&zn(e);t&&n.notifyRootSpanActive(t)},0)}}},processEvent:e=>function(e){var t,n,r;return null!=e&&null!==(t=e.contexts)&&void 0!==t&&t.profile&&e.contexts?(null!==(n=e.contexts.trace)&&void 0!==n&&n.trace_id&&(e.contexts.trace={...e.contexts.trace,data:{...e.contexts.trace.data??{},"thread.id":El,"thread.name":xl}}),null===(r=e.spans)||void 0===r||r.forEach(e=>{e.data={...e.data||{},"thread.id":El,"thread.name":xl}}),e):e}(e)});function Xl(e,t){const n=null==t?void 0:t.getDsn(),r=null==t?void 0:t.getOptions().tunnel;return function(e,t){const n=Pi(e);return!(!n||Ni(n))&&(!!t&&n.host.includes(t.host)&&/(^|&|\?)sentry_key=/.test(n.search))}(e,n)||function(e,t){return!!t&&Yl(e)===Yl(t)}(e,r)}function Yl(e){return"/"===e[e.length-1]?e.slice(0,-1):e}const Ql=c,Zl="sentryReplaySession",eu="Unable to send Replay",tu=15e4,nu=5e3,ru=2e7;var su=Object.defineProperty,iu=(e,t,n)=>((e,t,n)=>t in e?su(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n),ou=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(ou||{});function au(e){const t=e?.host;return Boolean(t?.shadowRoot===e)}function cu(e){return"[object ShadowRoot]"===Object.prototype.toString.call(e)}function lu(e){try{const n=e.rules||e.cssRules;return n?((t=Array.from(n,uu).join("")).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t):null}catch(e){return null}var t}function uu(e){let t;if(function(e){return"styleSheet"in e}(e))try{t=lu(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(e){}else if(function(e){return"selectorText"in e}(e)){let t=e.cssText;const n=e.selectorText.includes(":"),r="string"==typeof e.style.all&&e.style.all;if(r&&(t=function(e){let t="";for(let n=0;n<e.style.length;n++){const r=e.style,s=r[n],i=r.getPropertyPriority(s);t+=`${s}:${r.getPropertyValue(s)}${i?" !important":""};`}return`${e.selectorText} { ${t} }`}(e)),n&&(t=t.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),n||r)return t}return t||e.cssText}class du{constructor(){iu(this,"idNodeMap",new Map),iu(this,"nodeMetaMap",new WeakMap)}getId(e){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);
1this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}}function hu({maskInputOptions:e,tagName:t,type:n}){return"OPTION"===t&&(t="SELECT"),Boolean(e[t.toLowerCase()]||n&&e[n]||"password"===n||"INPUT"===t&&!n&&e.text)}function pu({isMasked:e,element:t,value:n,maskInputFn:r}){let s=n||"";return e?(r&&(s=r(s,t)),"*".repeat(s.length)):s}function fu(e){return e.toLowerCase()}function mu(e){return e.toUpperCase()}const gu="__rrweb_original__";function yu(e){const t=e.type;return e.hasAttribute("data-rr-is-password")?"password":t?fu(t):null}function vu(e,t,n){return"INPUT"!==t||"radio"!==n&&"checkbox"!==n?e.value:e.getAttribute("value")||""}function _u(e,t){let n;try{n=new URL(e,t??window.location.href)}catch(e){return null}const r=n.pathname.match(/\.([0-9a-z]+)(?:$)/i);return r?.[1]??null}const bu={};function Su(e){const t=bu[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const s=t.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(t)}catch(e){}return bu[e]=r.bind(window)}function wu(...e){return Su("setTimeout")(...e)}function ku(...e){return Su("clearTimeout")(...e)}function Tu(e){try{return e.contentDocument}catch(e){}}let Eu=1;const xu=new RegExp("[^a-z0-9-_:]");function Iu(){return Eu++}let Cu,Ou;const Au=/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,Mu=/^(?:[a-z+]+:)?\/\//i,Ru=/^www\..*/i,Nu=/^(data:)([^,]*),(.*)/i;function Pu(e,t){return(e||"").replace(Au,(e,n,r,s,i,o)=>{const a=r||i||o,c=n||s||"";if(!a)return e;if(Mu.test(a)||Ru.test(a))return`url(${c}${a}${c})`;if(Nu.test(a))return`url(${c}${a}${c})`;if("/"===a[0])return`url(${c}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+a}${c})`;const l=t.split("/"),u=a.split("/");l.pop();for(const e of u)"."!==e&&(".."===e?l.pop():l.push(e));return`url(${c}${l.join("/")}${c})`})}
1const Lu=/^[^ \t\n\r\u000c]+/,Du=/^[, \t\n\r\u000c]+/,$u=new WeakMap;function ju(e,t){return t&&""!==t.trim()?Bu(e,t):t}function Bu(e,t){let n=$u.get(e);if(n||(n=e.createElement("a"),$u.set(e,n)),t){if(t.startsWith("blob:")||t.startsWith("data:"))return t}else t="";return n.setAttribute("href",t),n.href}function Fu(e,t,n,r,s,i,o){if(!r)return r;if("src"===n||"href"===n&&("use"!==t||"#"!==r[0]))return ju(e,r);if("xlink:href"===n&&"#"!==r[0])return ju(e,r);if("background"===n&&("table"===t||"td"===t||"th"===t))return ju(e,r);if("srcset"===n)return function(e,t){if(""===t.trim())return t;let n=0;function r(e){let r;const s=e.exec(t.substring(n));return s?(r=s[0],n+=r.length,r):""}const s=[];for(;r(Du),!(n>=t.length);){let i=r(Lu);if(","===i.slice(-1))i=ju(e,i.substring(0,i.length-1)),s.push(i);else{let r="";i=ju(e,i);let o=!1;for(;;){const e=t.charAt(n);if(""===e){s.push((i+r).trim());break}if(o)")"===e&&(o=!1);else{if(","===e){n+=1,s.push((i+r).trim());break}"("===e&&(o=!0)}r+=e,n+=1}}}return s.join(", ")}(e,r);if("style"===n){let t=Pu(r,Bu(e));return o&&o.size>0&&(t=function(e,t){if(!e||0===t.size)return e;try{const n=e.split(";"),r=[];for(let e of n){if(e=e.trim(),!e)continue;const n=e.indexOf(":");if(-1===n){r.push(e);continue}const s=e.slice(0,n).trim();t.has(s)||r.push(e)}return r.join("; ")+(r.length>0&&e.endsWith(";")?";":"")}catch(t){return console.warn("Error filtering CSS properties:",t),e}}(t,o)),t}return"object"===t&&"data"===n?ju(e,r):"function"==typeof i?i(n,r,s):r}function Uu(e,t,n){return("video"===e||"audio"===e)&&"autoplay"===t}function zu(e,t,n=1/0,r=0){return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:zu(e.parentNode,t,n,r+1):-1}function Wu(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"==typeof e){if(r.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}function Hu(e,t,n,r,s,i){try{const o=e.nodeType===e.ELEMENT_NODE?e:e.parentElement;if(null===o)return!1;if("INPUT"===o.tagName){const e=o.getAttribute("autocomplete");if(["current-password","new-password","cc-number","cc-exp","cc-exp-month","cc-exp-year","cc-csc"].includes(e))return!0}let a=-1,c=-1;if(i){if(c=zu(o,Wu(r,s)),c<0)return!0;a=zu(o,Wu(t,n),c>=0?c:1/0)}else{if(a=zu(o,Wu(t,n)),a<0)return!1;c=zu(o,Wu(r,s),a>=0?a:1/0)}return a>=0?!(c>=0)||a<=c:!(c>=0||!i)}catch(e){}return!!i}function qu(e){return null==e?"":e.toLowerCase()}function Vu(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:h=!1,inlineStylesheet:p=!0,maskInputOptions:f={},maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:_={},inlineImages:b=!1,recordCanvas:S=!1,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T=5e3,onBlockedImageLoad:E,onStylesheetLoad:x,stylesheetLoadTimeout:I=5e3,keepIframeSrcFn:C=()=>!1,newlyAddedElement:O=!1,ignoreCSSAttributes:A}=t;let{preserveWhiteSpace:M=!0}=t;const R=function(e,t){const{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskAttributeFn:c,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,inlineStylesheet:p,maskInputOptions:f={},maskTextFn:m,maskInputFn:g,dataURLOptions:y={},inlineImages:v,recordCanvas:_,keepIframeSrcFn:b,newlyAddedElement:S=!1,ignoreCSSAttributes:w}=t,k=function(e,t){if(!t.hasNode(e))return;const n=t.getId(e);return 1===n?void 0:n}(n,r);switch(e.nodeType){case e.DOCUMENT_NODE:return"CSS1Compat"!==e.compatMode?{type:ou.Document,childNodes:[],compatMode:e.compatMode}:{type:ou.Document,childNodes:[]};case e.DOCUMENT_TYPE_NODE:return{type:ou.DocumentType,name:e.name,publicId:e.publicId,systemId:e.systemId,rootId:k};case e.ELEMENT_NODE:return function(e,t){const{doc:n,blockClass:r,blockSelector:s,unblockSelector:i,inlineStylesheet:o,maskInputOptions:a={},maskAttributeFn:c,maskInputFn:l,dataURLOptions:u={},inlineImages:d,recordCanvas:h,keepIframeSrcFn:p,newlyAddedElement:f=!1,rootId:m,maskTextClass:g,unmaskTextClass:y,maskTextSelector:v,unmaskTextSelector:_,ignoreCSSAttributes:b}=t,S=function(e,t,n,r){try{if(r&&e.matches(r))return!1;if("string"==typeof t){if(e.classList.contains(t))return!0}else for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}if(n)return e.matches(n)}catch(e){}return!1}(e,r,s,i),w=function(e){if(e instanceof HTMLFormElement)return"form";const t=fu(e.tagName);return xu.test(t)?"div":t}(e);let k={};const T=e.attributes.length;for(let t=0;t<T;t++){const r=e.attributes[t];r.name&&!Uu(w,r.name,r.value)&&(k[r.name]=Fu(n,w,fu(r.name),r.value,e,c,b))}if("link"===w&&o){const t=Array.from(n.styleSheets).find(t=>t.href===e.href);let r=null;t&&(r=lu(t)),r&&(k.rel=null,k.href=null,k.crossorigin=null,k._cssText=Pu(r,t.href))}if("style"===w&&e.sheet&&!(e.innerText||e.textContent||"").trim().length){const t=lu(e.sheet);t&&(k._cssText=Pu(t,Bu(n)))}if("input"===w||"textarea"===w||"select"===w||"option"===w){const t=e,n=yu(t),r=vu(t,mu(w),n),s=t.checked;if("submit"!==n&&"button"!==n&&r){const e=Hu(t,g,v,y,_,hu({type:n,tagName:mu(w),maskInputOptions:a}));k.value=pu({isMasked:e,element:t,value:r,maskInputFn:l})}
1s&&(k.checked=s)}if("option"===w&&(e.selected&&!a.select?k.selected=!0:delete k.selected),"canvas"===w&&h)if("2d"===e.__context)(function(e){const t=e.getContext("2d");if(!t)return!0;for(let n=0;n<e.width;n+=50)for(let r=0;r<e.height;r+=50){const s=t.getImageData,i=gu in s?s[gu]:s;if(new Uint32Array(i.call(t,n,r,Math.min(50,e.width-n),Math.min(50,e.height-r)).data.buffer).some(e=>0!==e))return!1}return!0})(e)||(k.rr_dataURL=e.toDataURL(u.type,u.quality));else if(!("__context"in e)){const t=e.toDataURL(u.type,u.quality),r=n.createElement("canvas");r.width=e.width,r.height=e.height,t!==r.toDataURL(u.type,u.quality)&&(k.rr_dataURL=t)}if("img"===w&&d){Cu||(Cu=n.createElement("canvas"),Ou=Cu.getContext("2d"));const t=e,r=t.currentSrc||t.getAttribute("src")||"<unknown-src>",s=t.crossOrigin,i=()=>{t.removeEventListener("load",i);try{Cu.width=t.naturalWidth,Cu.height=t.naturalHeight,Ou.drawImage(t,0,0),k.rr_dataURL=Cu.toDataURL(u.type,u.quality)}catch(e){if("anonymous"!==t.crossOrigin)return t.crossOrigin="anonymous",void(t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i));console.warn(`Cannot inline img src=${r}! Error: ${e}`)}"anonymous"===t.crossOrigin&&(s?k.crossOrigin=s:t.removeAttribute("crossorigin"))};t.complete&&0!==t.naturalWidth?i():t.addEventListener("load",i)}if("audio"!==w&&"video"!==w||(k.rr_mediaState=e.paused?"paused":"played",k.rr_mediaCurrentTime=e.currentTime),f||(e.scrollLeft&&(k.rr_scrollLeft=e.scrollLeft),e.scrollTop&&(k.rr_scrollTop=e.scrollTop)),S){const{width:t,height:n}=e.getBoundingClientRect();k={class:k.class,rr_width:`${t}px`,rr_height:`${n}px`}}let E;"iframe"!==w||p(k.src)||(S||Tu(e)||(k.rr_src=k.src),delete k.src);try{customElements.get(w)&&(E=!0)}catch(e){}return{type:ou.Element,tagName:w,attributes:k,childNodes:[],isSVG:(x=e,Boolean("svg"===x.tagName||x.ownerSVGElement)||void 0),needBlock:S,rootId:m,isCustom:E};var x}(e,{doc:n,blockClass:s,blockSelector:i,unblockSelector:o,inlineStylesheet:p,maskAttributeFn:c,maskInputOptions:f,maskInputFn:g,dataURLOptions:y,inlineImages:v,recordCanvas:_,keepIframeSrcFn:b,newlyAddedElement:S,rootId:k,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,ignoreCSSAttributes:w});case e.TEXT_NODE:return function(e,t){const{maskAllText:n,maskTextClass:r,unmaskTextClass:s,maskTextSelector:i,unmaskTextSelector:o,maskTextFn:a,maskInputOptions:c,maskInputFn:l,rootId:u}=t,d=e.parentNode&&e.parentNode.tagName;let h=e.textContent;const p="STYLE"===d||void 0,f="SCRIPT"===d||void 0,m="TEXTAREA"===d||void 0;if(p&&h){try{e.nextSibling||e.previousSibling||e.parentNode.sheet?.cssRules&&(h=lu(e.parentNode.sheet))}catch(t){console.warn(`Cannot get CSS styles from text's parentNode. Error: ${t}`,e)}h=Pu(h,Bu(t.doc))}f&&(h="SCRIPT_PLACEHOLDER");const g=Hu(e,r,i,s,o,n);return p||f||m||!h||!g||(h=a?a(h,e.parentElement):h.replace(/[\S]/g,"*")),m&&h&&(c.textarea||g)&&(h=l?l(h,e.parentNode):h.replace(/[\S]/g,"*")),"OPTION"===d&&h&&(h=pu({isMasked:Hu(e,r,i,s,o,hu({type:null,tagName:d,maskInputOptions:c})),element:e,value:h,maskInputFn:l})),{type:ou.Text,textContent:h||"",isStyle:p,rootId:u}}(e,{doc:n,maskAllText:a,maskTextClass:l,unmaskTextClass:u,maskTextSelector:d,unmaskTextSelector:h,maskTextFn:m,maskInputOptions:f,maskInputFn:g,rootId:k});case e.CDATA_SECTION_NODE:return{type:ou.CDATA,textContent:"",rootId:k};case e.COMMENT_NODE:return{type:ou.Comment,textContent:e.textContent||"",rootId:k};default:return!1}}(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,inlineStylesheet:p,maskInputOptions:f,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,dataURLOptions:_,inlineImages:b,recordCanvas:S,keepIframeSrcFn:C,newlyAddedElement:O,ignoreCSSAttributes:A});if(!R)return console.warn(e,"not serialized"),null;let N;N=r.hasNode(e)?r.getId(e):!function(e,t){if(t.comment&&e.type===ou.Comment)return!0;if(e.type===ou.Element){if(t.script&&("script"===e.tagName||"link"===e.tagName&&("preload"===e.attributes.rel||"modulepreload"===e.attributes.rel)||"link"===e.tagName&&"prefetch"===e.attributes.rel&&"string"==typeof e.attributes.href&&"js"===_u(e.attributes.href)))return!0;
1if(t.headFavicon&&("link"===e.tagName&&"shortcut icon"===e.attributes.rel||"meta"===e.tagName&&(qu(e.attributes.name).match(/^msapplication-tile(image|color)$/)||"application-name"===qu(e.attributes.name)||"icon"===qu(e.attributes.rel)||"apple-touch-icon"===qu(e.attributes.rel)||"shortcut icon"===qu(e.attributes.rel))))return!0;if("meta"===e.tagName){if(t.headMetaDescKeywords&&qu(e.attributes.name).match(/^description|keywords$/))return!0;if(t.headMetaSocial&&(qu(e.attributes.property).match(/^(og|twitter|fb):/)||qu(e.attributes.name).match(/^(og|twitter):/)||"pinterest"===qu(e.attributes.name)))return!0;if(t.headMetaRobots&&("robots"===qu(e.attributes.name)||"googlebot"===qu(e.attributes.name)||"bingbot"===qu(e.attributes.name)))return!0;if(t.headMetaHttpEquiv&&void 0!==e.attributes["http-equiv"])return!0;if(t.headMetaAuthorship&&("author"===qu(e.attributes.name)||"generator"===qu(e.attributes.name)||"framework"===qu(e.attributes.name)||"publisher"===qu(e.attributes.name)||"progid"===qu(e.attributes.name)||qu(e.attributes.property).match(/^article:/)||qu(e.attributes.property).match(/^product:/)))return!0;if(t.headMetaVerification&&("google-site-verification"===qu(e.attributes.name)||"yandex-verification"===qu(e.attributes.name)||"csrf-token"===qu(e.attributes.name)||"p:domain_verify"===qu(e.attributes.name)||"verify-v1"===qu(e.attributes.name)||"verification"===qu(e.attributes.name)||"shopify-checkout-api-token"===qu(e.attributes.name)))return!0}}return!1}(R,v)&&(M||R.type!==ou.Text||R.isStyle||R.textContent.replace(/^\s+|\s+$/gm,"").length)?Iu():-2;const P=Object.assign(R,{id:N});if(r.add(e,P),-2===N)return null;w&&w(e);let L=!h;if(P.type===ou.Element){L=L&&!P.needBlock;const t=e.shadowRoot;t&&cu(t)&&(P.isShadowHost=!0)}if((P.type===ou.Document||P.type===ou.Element)&&L){v.headWhitespace&&P.type===ou.Element&&"head"===P.tagName&&(M=!1);const t={doc:n,mirror:r,blockClass:s,blockSelector:i,maskAllText:a,unblockSelector:o,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:h,inlineStylesheet:p,maskInputOptions:f,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:_,inlineImages:b,recordCanvas:S,preserveWhiteSpace:M,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T,onBlockedImageLoad:E,onStylesheetLoad:x,stylesheetLoadTimeout:I,keepIframeSrcFn:C,ignoreCSSAttributes:A},O=e.childNodes?Array.from(e.childNodes):[];for(const e of O){const n=Vu(e,t);n&&P.childNodes.push(n)}if(function(e){return e.nodeType===e.ELEMENT_NODE}(e)&&e.shadowRoot)for(const n of Array.from(e.shadowRoot.childNodes)){const r=Vu(n,t);r&&(cu(e.shadowRoot)&&(r.isShadow=!0),P.childNodes.push(r))}}if(e.parentNode&&au(e.parentNode)&&cu(e.parentNode)&&(P.isShadow=!0),P.type!==ou.Element||"iframe"!==P.tagName||P.needBlock||function(e,t,n){const r=e.contentWindow;if(!r)return;let s,i=!1;try{s=r.document.readyState}catch(e){return}if("complete"!==s){const r=wu(()=>{i||(t(),i=!0)},n);return void e.addEventListener("load",()=>{ku(r),i=!0,t()})}const o="about:blank";if(r.location.href!==o||e.src===o||""===e.src)return wu(t,0),e.addEventListener("load",t);e.addEventListener("load",t)}(e,()=>{const t=Tu(e);if(t&&k){const n=Vu(t,{doc:t,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:_,inlineImages:b,recordCanvas:S,preserveWhiteSpace:M,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:x,stylesheetLoadTimeout:I,keepIframeSrcFn:C,ignoreCSSAttributes:A});n&&k(e,n)}},T),P.type===ou.Element&&"img"===P.tagName&&!e.complete&&P.needBlock){const t=e,n=()=>{if(t.isConnected&&!t.complete&&E)try{const e=t.getBoundingClientRect();e.width>0&&e.height>0&&E(t,P,e)}catch(e){}t.removeEventListener("load",n)};t.isConnected&&t.addEventListener("load",n)}return P.type===ou.Element&&"link"===P.tagName&&"string"==typeof P.attributes.rel&&("stylesheet"===P.attributes.rel||"preload"===P.attributes.rel&&"string"==typeof P.attributes.href&&"css"===_u(P.attributes.href))&&function(e,t,n){let r,s=!1;try{r=e.sheet}catch(e){return}if(r)return;const i=wu(()=>{s||(t(),s=!0)},n);e.addEventListener("load",()=>{ku(i),s=!0,t()})}(e,()=>{if(x){const t=Vu(e,{doc:n,mirror:r,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:a,maskTextClass:c,unmaskTextClass:l,maskTextSelector:u,unmaskTextSelector:d,skipChild:!1,inlineStylesheet:p,maskInputOptions:f,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:v,dataURLOptions:_,inlineImages:b,recordCanvas:S,preserveWhiteSpace:M,onSerialize:w,onIframeLoad:k,iframeLoadTimeout:T,onStylesheetLoad:x,stylesheetLoadTimeout:I,keepIframeSrcFn:C,ignoreCSSAttributes:A});t&&x(e,t)}},I),P.type===ou.Element&&delete P.needBlock,P}function Ju(e,t,n=document){const r={capture:!0,passive:!0};return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t,r)}const Ku="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let Gu={map:{},getId:()=>(console.error(Ku),-1),getNode:()=>(console.error(Ku),null),removeNodeFromMap(){console.error(Ku)},has:()=>(console.error(Ku),!1),reset(){console.error(Ku)}};function Xu(e,t,n={}){let r=null,s=0;return function(...i){const o=Date.now();s||!1!==n.leading||(s=o);const a=t-(o-s),c=this;a<=0||a>t?(r&&(function(...e){md("clearTimeout")(...e)}
1(r),r=null),s=o,e.apply(c,i)):r||!1===n.trailing||(r=gd(()=>{s=!1===n.leading?0:Date.now(),r=null,e.apply(c,i)},a))}}function Yu(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(e){gd(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>Yu(e,t,i||{},!0)}function Qu(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(Gu=new Proxy(Gu,{get:(e,t,n)=>("map"===t&&console.error(Ku),Reflect.get(e,t,n))}));let Zu=Date.now;function ed(e){const t=e.document;return{left:t.scrollingElement?t.scrollingElement.scrollLeft:void 0!==e.pageXOffset?e.pageXOffset:t?.documentElement.scrollLeft||t?.body?.parentElement?.scrollLeft||t?.body?.scrollLeft||0,top:t.scrollingElement?t.scrollingElement.scrollTop:void 0!==e.pageYOffset?e.pageYOffset:t?.documentElement.scrollTop||t?.body?.parentElement?.scrollTop||t?.body?.scrollTop||0}}function td(){return window.innerHeight||document.documentElement&&document.documentElement.clientHeight||document.body&&document.body.clientHeight}function nd(){return window.innerWidth||document.documentElement&&document.documentElement.clientWidth||document.body&&document.body.clientWidth}function rd(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch(e){return null}}function sd(e,t,n,r,s){if(!e)return!1;const i=rd(e);if(!i)return!1;const o=Wu(t,n);if(!s){const e=r&&i.matches(r);return o(i)&&!e}const a=zu(i,o);let c=-1;return!(a<0)&&(r&&(c=zu(i,Wu(null,r))),a>-1&&c<0||a<c)}function id(e,t){return-2===t.getId(e)}function od(e,t){if(au(e))return!1;const n=t.getId(e);return!t.has(n)||(!e.parentNode||e.parentNode.nodeType!==e.DOCUMENT_NODE)&&(!e.parentNode||od(e.parentNode,t))}function ad(e){return Boolean(e.changedTouches)}function cd(e,t){return Boolean("IFRAME"===e.nodeName&&t.getMeta(e))}function ld(e,t){return Boolean("LINK"===e.nodeName&&e.nodeType===e.ELEMENT_NODE&&e.getAttribute&&"stylesheet"===e.getAttribute("rel")&&t.getMeta(e))}function ud(e){return Boolean(e?.shadowRoot)}/[1-9][0-9]{12}/.test(Date.now().toString())||(Zu=()=>(new Date).getTime());class dd{constructor(){this.id=1,this.styleIDMap=new WeakMap,this.idStyleMap=new Map}getId(e){return this.styleIDMap.get(e)??-1}has(e){return this.styleIDMap.has(e)}add(e,t){if(this.has(e))return this.getId(e);let n;return n=void 0===t?this.id++:t,this.styleIDMap.set(e,n),this.idStyleMap.set(n,e),n}getStyle(e){return this.idStyleMap.get(e)||null}reset(){this.styleIDMap=new WeakMap,this.idStyleMap=new Map,this.id=1}generateId(){return this.id++}}function hd(e){let t=null;return e.getRootNode?.()?.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.getRootNode().host&&(t=e.getRootNode().host),t}function pd(e){const t=e.ownerDocument;return!!t&&(t.contains(e)||function(e){const t=e.ownerDocument;if(!t)return!1;const n=function(e){let t,n=e;for(;t=hd(n);)n=t;return n}(e);return t.contains(n)}(e))}const fd={};function md(e){const t=fd[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const s=t.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(t)}catch(e){}return fd[e]=r.bind(window)}function gd(...e){return md("setTimeout")(...e)}var yd=(e=>(e[e.DomContentLoaded=0]="DomContentLoaded",e[e.Load=1]="Load",e[e.FullSnapshot=2]="FullSnapshot",e[e.IncrementalSnapshot=3]="IncrementalSnapshot",e[e.Meta=4]="Meta",e[e.Custom=5]="Custom",e[e.Plugin=6]="Plugin",e))(yd||{}),vd=(e=>(e[e.Mutation=0]="Mutation",e[e.MouseMove=1]="MouseMove",e[e.MouseInteraction=2]="MouseInteraction",e[e.Scroll=3]="Scroll",e[e.ViewportResize=4]="ViewportResize",e[e.Input=5]="Input",e[e.TouchMove=6]="TouchMove",e[e.MediaInteraction=7]="MediaInteraction",e[e.StyleSheetRule=8]="StyleSheetRule",e[e.CanvasMutation=9]="CanvasMutation",e[e.Font=10]="Font",e[e.Log=11]="Log",e[e.Drag=12]="Drag",e[e.StyleDeclaration=13]="StyleDeclaration",e[e.Selection=14]="Selection",e[e.AdoptedStyleSheet=15]="AdoptedStyleSheet",e[e.CustomElement=16]="CustomElement",e))(vd||{}),_d=(e=>(e[e.MouseUp=0]="MouseUp",e[e.MouseDown=1]="MouseDown",e[e.Click=2]="Click",e[e.ContextMenu=3]="ContextMenu",e[e.DblClick=4]="DblClick",e[e.Focus=5]="Focus",e[e.Blur=6]="Blur",e[e.TouchStart=7]="TouchStart",e[e.TouchMove_Departed=8]="TouchMove_Departed",e[e.TouchEnd=9]="TouchEnd",e[e.TouchCancel=10]="TouchCancel",e))(_d||{}),bd=(e=>(e[e.Mouse=0]="Mouse",e[e.Pen=1]="Pen",e[e.Touch=2]="Touch",e))(bd||{}),Sd=(e=>(e[e.Play=0]="Play",e[e.Pause=1]="Pause",e[e.Seeked=2]="Seeked",e[e.VolumeChange=3]="VolumeChange",e[e.RateChange=4]="RateChange",e))(Sd||{});function wd(e){try{return e.contentDocument}catch(e){}}function kd(e){return"__ln"in e}class Td{constructor(){this.length=0,this.head=null,this.tail=null}get(e){if(e>=this.length)throw new Error("Position outside of list range");let t=this.head;for(let n=0;n<e;n++)t=t?.next||null;return t}addNode(e){const t={value:e,previous:null,next:null};if(e.__ln=t,e.previousSibling&&kd(e.previousSibling)){const n=e.previousSibling.__ln.next;t.next=n,t.previous=e.previousSibling.__ln,e.previousSibling.__ln.next=t,n&&
1(n.previous=t)}else if(e.nextSibling&&kd(e.nextSibling)&&e.nextSibling.__ln.previous){const n=e.nextSibling.__ln.previous;t.previous=n,t.next=e.nextSibling.__ln,e.nextSibling.__ln.previous=t,n&&(n.next=t)}else this.head&&(this.head.previous=t),t.next=this.head,this.head=t;null===t.next&&(this.tail=t),this.length++}removeNode(e){const t=e.__ln;this.head&&(t.previous?(t.previous.next=t.next,t.next?t.next.previous=t.previous:this.tail=t.previous):(this.head=t.next,this.head?this.head.previous=null:this.tail=null),e.__ln&&delete e.__ln,this.length--)}}const Ed=(e,t)=>`${e}@${t}`;class xd{constructor(){this.frozen=!1,this.locked=!1,this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.mapRemoves=[],this.movedMap={},this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.processMutations=e=>{e.forEach(this.processMutation),this.emit()},this.emit=()=>{if(this.frozen||this.locked)return;const e=[],t=new Set,n=new Td,r=e=>{let t=e,n=-2;for(;-2===n;)t=t&&t.nextSibling,n=t&&this.mirror.getId(t);return n},s=s=>{if(!s.parentNode||!pd(s))return;const i=au(s.parentNode)?this.mirror.getId(hd(s)):this.mirror.getId(s.parentNode),o=r(s);if(-1===i||-1===o)return n.addNode(s);const a=Vu(s,{doc:this.doc,mirror:this.mirror,blockClass:this.blockClass,blockSelector:this.blockSelector,maskAllText:this.maskAllText,unblockSelector:this.unblockSelector,maskTextClass:this.maskTextClass,unmaskTextClass:this.unmaskTextClass,maskTextSelector:this.maskTextSelector,unmaskTextSelector:this.unmaskTextSelector,skipChild:!0,newlyAddedElement:!0,inlineStylesheet:this.inlineStylesheet,maskInputOptions:this.maskInputOptions,maskAttributeFn:this.maskAttributeFn,maskTextFn:this.maskTextFn,maskInputFn:this.maskInputFn,slimDOMOptions:this.slimDOMOptions,dataURLOptions:this.dataURLOptions,recordCanvas:this.recordCanvas,inlineImages:this.inlineImages,onSerialize:e=>{cd(e,this.mirror)&&!sd(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)&&this.iframeManager.addIframe(e),ld(e,this.mirror)&&this.stylesheetManager.trackLinkElement(e),ud(s)&&this.shadowDomManager.addShadowRoot(s.shadowRoot,this.doc)},onIframeLoad:(e,t)=>{sd(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(this.iframeManager.attachIframe(e,t),e.contentWindow&&this.canvasManager.addWindow(e.contentWindow),this.shadowDomManager.observeAttachShadow(e))},onStylesheetLoad:(e,t)=>{this.stylesheetManager.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},ignoreCSSAttributes:this.ignoreCSSAttributes});a&&(e.push({parentId:i,nextId:o,node:a}),t.add(a.id))};for(;this.mapRemoves.length;)this.mirror.removeNodeFromMap(this.mapRemoves.shift());for(const e of this.movedSet)Cd(this.removes,e,this.mirror)&&!this.movedSet.has(e.parentNode)||s(e);for(const e of this.addedSet)Od(this.droppedSet,e)||Cd(this.removes,e,this.mirror)?Od(this.movedSet,e)?s(e):this.droppedSet.add(e):s(e);let i=null;for(;n.length;){let e=null;if(i){const t=this.mirror.getId(i.value.parentNode),n=r(i.value);-1!==t&&-1!==n&&(e=i)}if(!e){let t=n.tail;for(;t;){const n=t;if(t=t.previous,n){const t=this.mirror.getId(n.value.parentNode);if(-1===r(n.value))continue;if(-1!==t){e=n;break}{const t=n.value;if(t.parentNode&&t.parentNode.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=t.parentNode.host;if(-1!==this.mirror.getId(r)){e=n;break}}}}}}if(!e){for(;n.head;)n.removeNode(n.head.value);break}i=e.previous,n.removeNode(e.value),s(e.value)}const o={texts:this.texts.map(e=>({id:this.mirror.getId(e.node),value:e.value})).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),attributes:this.attributes.map(e=>{const{attributes:t}=e;if("string"==typeof t.style){const n=JSON.stringify(e.styleDiff),r=JSON.stringify(e._unchangedStyles);n.length<t.style.length&&(n+r).split("var(").length===t.style.split("var(").length&&(t.style=e.styleDiff)}return{id:this.mirror.getId(e.node),attributes:t}}).filter(e=>!t.has(e.id)).filter(e=>this.mirror.has(e.id)),removes:this.removes,adds:e};(o.texts.length||o.attributes.length||o.removes.length||o.adds.length)&&(this.texts=[],this.attributes=[],this.attributeMap=new WeakMap,this.removes=[],this.addedSet=new Set,this.movedSet=new Set,this.droppedSet=new Set,this.movedMap={},this.mutationCb(o))},this.processMutation=e=>{if(!id(e.target,this.mirror))switch(e.type){case"characterData":{const t=e.target.textContent;sd(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||t===e.oldValue||this.texts.push({value:Hu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,this.maskAllText)&&t?this.maskTextFn?this.maskTextFn(t,rd(e.target)):t.replace(/[\S]/g,"*"):t,node:e.target});break}case"attributes":{const t=e.target;let n=e.attributeName,r=e.target.getAttribute(n);if("value"===n){const n=yu(t),s=t.tagName;r=vu(t,s,n);const i=hu({maskInputOptions:this.maskInputOptions,tagName:s,type:n});r=pu({isMasked:Hu(e.target,this.maskTextClass,this.maskTextSelector,this.unmaskTextClass,this.unmaskTextSelector,i),element:t,value:r,maskInputFn:this.maskInputFn})}if(sd(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||r===e.oldValue)return;let s=this.attributeMap.get(e.target);
1if("IFRAME"===t.tagName&&"src"===n&&!this.keepIframeSrcFn(r)){if(wd(t))return;n="rr_src"}if(s||(s={node:e.target,attributes:{},styleDiff:{},_unchangedStyles:{}},this.attributes.push(s),this.attributeMap.set(e.target,s)),"type"===n&&"INPUT"===t.tagName&&"password"===(e.oldValue||"").toLowerCase()&&t.setAttribute("data-rr-is-password","true"),!Uu(t.tagName,n)&&(s.attributes[n]=Fu(this.doc,fu(t.tagName),fu(n),r,t,this.maskAttributeFn),"style"===n)){if(!this.unattachedDoc)try{this.unattachedDoc=document.implementation.createHTMLDocument()}catch(e){this.unattachedDoc=this.doc}const n=this.unattachedDoc.createElement("span");e.oldValue&&n.setAttribute("style",e.oldValue);for(const e of Array.from(t.style)){const r=t.style.getPropertyValue(e),i=t.style.getPropertyPriority(e);r!==n.style.getPropertyValue(e)||i!==n.style.getPropertyPriority(e)?s.styleDiff[e]=""===i?r:[r,i]:s._unchangedStyles[e]=[r,i]}for(const e of Array.from(n.style))""===t.style.getPropertyValue(e)&&(s.styleDiff[e]=!1)}break}case"childList":if(sd(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!0))return;e.addedNodes.forEach(t=>this.genAdds(t,e.target)),e.removedNodes.forEach(t=>{const n=this.mirror.getId(t),r=au(e.target)?this.mirror.getId(e.target.host):this.mirror.getId(e.target);sd(e.target,this.blockClass,this.blockSelector,this.unblockSelector,!1)||id(t,this.mirror)||!function(e,t){return-1!==t.getId(e)}(t,this.mirror)||(this.addedSet.has(t)?(Id(this.addedSet,t),this.droppedSet.add(t)):this.addedSet.has(e.target)&&-1===n||od(e.target,this.mirror)||(this.movedSet.has(t)&&this.movedMap[Ed(n,r)]?Id(this.movedSet,t):this.removes.push({parentId:r,id:n,isShadow:!(!au(e.target)||!cu(e.target))||void 0})),this.mapRemoves.push(t))})}},this.genAdds=(e,t)=>{if(!this.processedNodeManager.inOtherBuffer(e,this)&&!this.addedSet.has(e)&&!this.movedSet.has(e)){if(this.mirror.hasNode(e)){if(id(e,this.mirror))return;this.movedSet.add(e);let n=null;t&&this.mirror.hasNode(t)&&(n=this.mirror.getId(t)),n&&-1!==n&&(this.movedMap[Ed(this.mirror.getId(e),n)]=!0)}else this.addedSet.add(e),this.droppedSet.delete(e);sd(e,this.blockClass,this.blockSelector,this.unblockSelector,!1)||(e.childNodes&&e.childNodes.forEach(e=>this.genAdds(e)),ud(e)&&e.shadowRoot.childNodes.forEach(t=>{this.processedNodeManager.add(t,this),this.genAdds(t,e)}))}}}init(e){["mutationCb","blockClass","blockSelector","unblockSelector","maskAllText","maskTextClass","unmaskTextClass","maskTextSelector","unmaskTextSelector","inlineStylesheet","maskInputOptions","maskAttributeFn","maskTextFn","maskInputFn","keepIframeSrcFn","recordCanvas","inlineImages","slimDOMOptions","dataURLOptions","doc","mirror","iframeManager","stylesheetManager","shadowDomManager","canvasManager","processedNodeManager","ignoreCSSAttributes"].forEach(t=>{this[t]=e[t]})}freeze(){this.frozen=!0,this.canvasManager.freeze()}unfreeze(){this.frozen=!1,this.canvasManager.unfreeze(),this.emit()}isFrozen(){return this.frozen}lock(){this.locked=!0,this.canvasManager.lock()}unlock(){this.locked=!1,this.canvasManager.unlock(),this.emit()}reset(){this.shadowDomManager.reset(),this.canvasManager.reset()}}function Id(e,t){e.delete(t),t.childNodes?.forEach(t=>Id(e,t))}function Cd(e,t,n){return 0!==e.length&&function(e,t,n){let r=t.parentNode;for(;r;){const t=n.getId(r);if(e.some(e=>e.id===t))return!0;r=r.parentNode}return!1}(e,t,n)}function Od(e,t){return 0!==e.size&&Ad(e,t)}function Ad(e,t){const{parentNode:n}=t;return!!n&&(!!e.has(n)||Ad(e,n))}let Md;const Rd=e=>Md?(...t)=>{try{return e(...t)}catch(e){if(Md&&!0===Md(e))return()=>{};throw e}}:e,Nd=[];function Pd(e){try{if("composedPath"in e){const t=e.composedPath();if(t.length)return t[0]}else if("path"in e&&e.path.length)return e.path[0]}catch{}return e&&e.target}function Ld(e,t){const n=new xd;Nd.push(n),n.init(e);let r=window.MutationObserver||window.__rrMutationObserver;const s=window?.Zone?.__symbol__?.("MutationObserver");s&&window[s]&&(r=window[s]);const i=new r(Rd(t=>{e.onMutation&&!1===e.onMutation(t)||n.processMutations.bind(n)(t)}));return i.observe(t,{attributes:!0,attributeOldValue:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0}),i}function Dd({scrollCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){return Ju("scroll",Rd(Xu(Rd(o=>{const a=Pd(o);if(!a||sd(a,r,s,i,!0))return;const c=n.getId(a);if(a===t&&t.defaultView){const n=ed(t.defaultView);e({id:c,x:n.left,y:n.top})}else e({id:c,x:a.scrollLeft,y:a.scrollTop})}),o.scroll||100)),t)}const $d=["INPUT","TEXTAREA","SELECT"],jd=new WeakMap;function Bd({inputCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,ignoreClass:o,ignoreSelector:a,maskInputOptions:c,maskInputFn:l,sampling:u,userTriggeredOnInput:d,maskTextClass:h,unmaskTextClass:p,maskTextSelector:f,unmaskTextSelector:m}){function g(e){let n=Pd(e);const u=e.isTrusted,g=n&&mu(n.tagName);if("OPTION"===g&&(n=n.parentElement),!n||!g||$d.indexOf(g)<0||sd(n,r,s,i,!0))return;const v=n;if(v.classList.contains(o)||a&&v.matches(a))return;const _=yu(n);let b=vu(v,g,_),S=!1;const w=hu({maskInputOptions:c,tagName:g,type:_}),k=Hu(n,h,f,p,m,w);"radio"!==_&&"checkbox"!==_||(S=n.checked),b=pu({isMasked:k,element:n,value:b,maskInputFn:l}),y(n,d?{text:b,isChecked:S,userTriggered:u}:{text:b,isChecked:S});const T=n.name;"radio"===_&&T&&S&&t.querySelectorAll(`input[type="radio"][name="${T}
1"]`).forEach(e=>{if(e!==n){const t=pu({isMasked:k,element:e,value:vu(e,g,_),maskInputFn:l});y(e,d?{text:t,isChecked:!S,userTriggered:!1}:{text:t,isChecked:!S})}})}function y(t,r){const s=jd.get(t);if(!s||s.text!==r.text||s.isChecked!==r.isChecked){jd.set(t,r);const s=n.getId(t);Rd(e)({...r,id:s})}}const v=("last"===u.input?["change"]:["input","change"]).map(e=>Ju(e,Rd(g),t)),_=t.defaultView;if(!_)return()=>{v.forEach(e=>e())};const b=_.Object.getOwnPropertyDescriptor(_.HTMLInputElement.prototype,"value"),S=[[_.HTMLInputElement.prototype,"value"],[_.HTMLInputElement.prototype,"checked"],[_.HTMLSelectElement.prototype,"value"],[_.HTMLTextAreaElement.prototype,"value"],[_.HTMLSelectElement.prototype,"selectedIndex"],[_.HTMLOptionElement.prototype,"selected"]];return b&&b.set&&v.push(...S.map(e=>Yu(e[0],e[1],{set(){Rd(g)({target:this,isTrusted:!1})}},!1,_))),Rd(()=>{v.forEach(e=>e())})}function Fd(e){return function(e,t){if(Hd("CSSGroupingRule")&&e.parentRule instanceof CSSGroupingRule||Hd("CSSMediaRule")&&e.parentRule instanceof CSSMediaRule||Hd("CSSSupportsRule")&&e.parentRule instanceof CSSSupportsRule||Hd("CSSConditionRule")&&e.parentRule instanceof CSSConditionRule){const n=Array.from(e.parentRule.cssRules).indexOf(e);t.unshift(n)}else if(e.parentStyleSheet){const n=Array.from(e.parentStyleSheet.cssRules).indexOf(e);t.unshift(n)}return t}(e,[])}function Ud(e,t,n){let r,s;return e?(e.ownerNode?r=t.getId(e.ownerNode):s=n.getId(e),{styleId:s,id:r}):{}}function zd({mirror:e,stylesheetManager:t},n){let r=null;r="#document"===n.nodeName?e.getId(n):e.getId(n.host);const s="#document"===n.nodeName?n.defaultView?.Document:n.ownerDocument?.defaultView?.ShadowRoot,i=s?.prototype?Object.getOwnPropertyDescriptor(s?.prototype,"adoptedStyleSheets"):void 0;return null!==r&&-1!==r&&s&&i?(Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get(){return i.get?.call(this)},set(e){const n=i.set?.call(this,e);if(null!==r&&-1!==r)try{t.adoptStyleSheets(e,r)}catch(e){}return n}}),Rd(()=>{Object.defineProperty(n,"adoptedStyleSheets",{configurable:i.configurable,enumerable:i.enumerable,get:i.get,set:i.set})})):()=>{}}function Wd(e,t={}){const n=e.doc.defaultView;if(!n)return()=>{};let r;e.recordDOM&&(r=Ld(e,e.doc));const s=function({mousemoveCb:e,sampling:t,doc:n,mirror:r}){if(!1===t.mousemove)return()=>{};const s="number"==typeof t.mousemove?t.mousemove:50,i="number"==typeof t.mousemoveCallback?t.mousemoveCallback:500;let o,a=[];const c=Xu(Rd(t=>{const n=Date.now()-o;e(a.map(e=>(e.timeOffset-=n,e)),t),a=[],o=null}),i),l=Rd(Xu(Rd(e=>{const t=Pd(e),{clientX:n,clientY:s}=ad(e)?e.changedTouches[0]:e;o||(o=Zu()),a.push({x:n,y:s,id:r.getId(t),timeOffset:Zu()-o}),c("undefined"!=typeof DragEvent&&e instanceof DragEvent?vd.Drag:e instanceof MouseEvent?vd.MouseMove:vd.TouchMove)}),s,{trailing:!1})),u=[Ju("mousemove",l,n),Ju("touchmove",l,n),Ju("drag",l,n)];return Rd(()=>{u.forEach(e=>e())})}(e),i=function({mouseInteractionCb:e,doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,sampling:o}){if(!1===o.mouseInteraction)return()=>{};const a=!0===o.mouseInteraction||void 0===o.mouseInteraction?{}:o.mouseInteraction,c=[];let l=null;return Object.keys(_d).filter(e=>Number.isNaN(Number(e))&&!e.endsWith("_Departed")&&!1!==a[e]).forEach(o=>{let a=fu(o);const u=(t=>o=>{const a=Pd(o);if(sd(a,r,s,i,!0))return;let c=null,u=t;if("pointerType"in o){switch(o.pointerType){case"mouse":c=bd.Mouse;break;case"touch":c=bd.Touch;break;case"pen":c=bd.Pen}c===bd.Touch?_d[t]===_d.MouseDown?u="TouchStart":_d[t]===_d.MouseUp&&(u="TouchEnd"):bd.Pen}else ad(o)&&(c=bd.Touch);null!==c?(l=c,(u.startsWith("Touch")&&c===bd.Touch||u.startsWith("Mouse")&&c===bd.Mouse)&&(c=null)):_d[t]===_d.Click&&(c=l,l=null);const d=ad(o)?o.changedTouches[0]:o;if(!d)return;const h=n.getId(a),{clientX:p,clientY:f}=d;Rd(e)({type:_d[u],id:h,x:p,y:f,...null!==c&&{pointerType:c}})})(o);if(window.PointerEvent)switch(_d[o]){case _d.MouseDown:case _d.MouseUp:a=a.replace("mouse","pointer");break;case _d.TouchStart:case _d.TouchEnd:return}c.push(Ju(a,u,t))}),Rd(()=>
vendor: 4,642 bytes, line 1
1{c.forEach(e=>e())})}(e),o=Dd(e),a=function({viewportResizeCb:e},{win:t}){let n=-1,r=-1;return Ju("resize",Rd(Xu(Rd(()=>{const t=td(),s=nd();n===t&&r===s||(e({width:Number(s),height:Number(t)}),n=t,r=s)}),200)),t)}(e,{win:n}),c=Bd(e),l=function({mediaInteractionCb:e,blockClass:t,blockSelector:n,unblockSelector:r,mirror:s,sampling:i,doc:o}){const a=Rd(o=>Xu(Rd(i=>{const a=Pd(i);if(!a||sd(a,t,n,r,!0))return;const{currentTime:c,volume:l,muted:u,playbackRate:d}=a;e({type:o,id:s.getId(a),currentTime:c,volume:l,muted:u,playbackRate:d})}),i.media||500)),c=[Ju("play",a(Sd.Play),o),Ju("pause",a(Sd.Pause),o),Ju("seeked",a(Sd.Seeked),o),Ju("volumechange",a(Sd.VolumeChange),o),Ju("ratechange",a(Sd.RateChange),o)];return Rd(()=>{c.forEach(e=>e())})}(e);let u=()=>{},d=()=>{},h=()=>{},p=()=>{};e.recordDOM&&(u=function({styleSheetRuleCb:e,mirror:t,stylesheetManager:n},{win:r}){if(!r.CSSStyleSheet||!r.CSSStyleSheet.prototype)return()=>{};const s=r.CSSStyleSheet.prototype.insertRule;r.CSSStyleSheet.prototype.insertRule=new Proxy(s,{apply:Rd((r,s,i)=>{const[o,a]=i,{id:c,styleId:l}=Ud(s,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:o,index:a}]}),r.apply(s,i)})});const i=r.CSSStyleSheet.prototype.deleteRule;let o,a;r.CSSStyleSheet.prototype.deleteRule=new Proxy(i,{apply:Rd((r,s,i)=>{const[o]=i,{id:a,styleId:c}=Ud(s,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:o}]}),r.apply(s,i)})}),r.CSSStyleSheet.prototype.replace&&(o=r.CSSStyleSheet.prototype.replace,r.CSSStyleSheet.prototype.replace=new Proxy(o,{apply:Rd((r,s,i)=>{const[o]=i,{id:a,styleId:c}=Ud(s,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replace:o}),r.apply(s,i)})})),r.CSSStyleSheet.prototype.replaceSync&&(a=r.CSSStyleSheet.prototype.replaceSync,r.CSSStyleSheet.prototype.replaceSync=new Proxy(a,{apply:Rd((r,s,i)=>{const[o]=i,{id:a,styleId:c}=Ud(s,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,replaceSync:o}),r.apply(s,i)})}));const c={};qd("CSSGroupingRule")?c.CSSGroupingRule=r.CSSGroupingRule:(qd("CSSMediaRule")&&(c.CSSMediaRule=r.CSSMediaRule),qd("CSSConditionRule")&&(c.CSSConditionRule=r.CSSConditionRule),qd("CSSSupportsRule")&&(c.CSSSupportsRule=r.CSSSupportsRule));const l={};return Object.entries(c).forEach(([r,s])=>{l[r]={insertRule:s.prototype.insertRule,deleteRule:s.prototype.deleteRule},s.prototype.insertRule=new Proxy(l[r].insertRule,{apply:Rd((r,s,i)=>{const[o,a]=i,{id:c,styleId:l}=Ud(s.parentStyleSheet,t,n.styleMirror);return(c&&-1!==c||l&&-1!==l)&&e({id:c,styleId:l,adds:[{rule:o,index:[...Fd(s),a||0]}]}),r.apply(s,i)})}),s.prototype.deleteRule=new Proxy(l[r].deleteRule,{apply:Rd((r,s,i)=>{const[o]=i,{id:a,styleId:c}=Ud(s.parentStyleSheet,t,n.styleMirror);return(a&&-1!==a||c&&-1!==c)&&e({id:a,styleId:c,removes:[{index:[...Fd(s),o]}]}),r.apply(s,i)})})}),Rd(()=>{r.CSSStyleSheet.prototype.insertRule=s,r.CSSStyleSheet.prototype.deleteRule=i,o&&(r.CSSStyleSheet.prototype.replace=o),a&&(r.CSSStyleSheet.prototype.replaceSync=a),Object.entries(c).forEach(([e,t])=>{t.prototype.insertRule=l[e].insertRule,t.prototype.deleteRule=l[e].deleteRule})})}(e,{win:n}),d=zd(e,e.doc),h=function({styleDeclarationCb:e,mirror:t,ignoreCSSAttributes:n,stylesheetManager:r},{win:s}){const i=s.CSSStyleDeclaration.prototype.setProperty;s.CSSStyleDeclaration.prototype.setProperty=new Proxy(i,{apply:Rd((s,o,a)=>{const[c,l,u]=a;if(n.has(c))return i.apply(o,[c,l,u]);const{id:d,styleId:h}=Ud(o.parentRule?.parentStyleSheet,t,r.styleMirror);return(d&&-1!==d||h&&-1!==h)&&e({id:d,styleId:h,set:{property:c,value:l,priority:u},index:Fd(o.parentRule)}),s.apply(o,a)})});const o=s.CSSStyleDeclaration.prototype.removeProperty;return s.CSSStyleDeclaration.prototype.removeProperty=new Proxy(o,{apply:Rd((s,i,a)=>{const[c]=a;if(n.has(c))return o.apply(i,[c]);const{id:l,styleId:u}=Ud(i.parentRule?.parentStyleSheet,t,r.styleMirror);return(l&&-1!==l||u&&-1!==u)&&e({id:l,styleId:u,remove:{property:c},index:Fd(i.parentRule)}),s.apply(i,a)})}),Rd(()=>{s.CSSStyleDeclaration.prototype.setProperty=i,s.CSSStyleDeclaration.prototype.removeProperty=o})}(e,{win:n}),e.collectFonts&&(p=function({fontCb:e,doc:t}){const n=t.defaultView;if(!n)return()=>{};const r=[],s=new WeakMap,i=n.FontFace;n.FontFace=function(e,t,n){const r=new i(e,t,n);return s.set(r,{family:e,buffer:"string"!=typeof t,descriptors:n,fontSource:"string"==typeof t?t:JSON.stringify(Array.from(new Uint8Array(t)))}),r};const o=Qu(t.fonts,"add",function(t){return function(n){return gd(Rd(()=>{const t=s.get(n);t&&(e(t),s.delete(n))}),0),t.apply(this,[n])}});return r.push(()=>{n.FontFace=i}),r.push(o),Rd(()=>
1{r.forEach(e=>e())})}(e)));const f=function(e){const{doc:t,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,selectionCb:o}=e;let a=!0;const c=Rd(()=>{const e=t.getSelection();if(!e||a&&e?.isCollapsed)return;a=e.isCollapsed||!1;const c=[],l=e.rangeCount||0;for(let t=0;t<l;t++){const o=e.getRangeAt(t),{startContainer:a,startOffset:l,endContainer:u,endOffset:d}=o;sd(a,r,s,i,!0)||sd(u,r,s,i,!0)||c.push({start:n.getId(a),startOffset:l,end:n.getId(u),endOffset:d})}o({ranges:c})});return c(),Ju("selectionchange",c)}(e),m=function({doc:e,customElementCb:t}){const n=e.defaultView;return n&&n.customElements?Qu(n.customElements,"define",function(e){return function(n,r,s){try{t({define:{name:n}})}catch(e){}return e.apply(this,[n,r,s])}}):()=>{}}(e),g=[];for(const t of e.plugins)g.push(t.observer(t.callback,n,t.options));return Rd(()=>{Nd.forEach(e=>e.reset()),r?.disconnect(),s(),i(),o(),a(),c(),l(),u(),d(),h(),p(),f(),m(),g.forEach(e=>e())})}function Hd(e){return void 0!==window[e]}function qd(e){return Boolean(void 0!==window[e]&&window[e].prototype&&"insertRule"in window[e].prototype&&"deleteRule"in window[e].prototype)}class Vd{constructor(e){this.generateIdFn=e,this.iframeIdToRemoteIdMap=new WeakMap,this.iframeRemoteIdToIdMap=new WeakMap}getId(e,t,n,r){const s=n||this.getIdToRemoteIdMap(e),i=r||this.getRemoteIdToIdMap(e);let o=s.get(t);return o||(o=this.generateIdFn(),s.set(t,o),i.set(o,t)),o}getIds(e,t){const n=this.getIdToRemoteIdMap(e),r=this.getRemoteIdToIdMap(e);return t.map(t=>this.getId(e,t,n,r))}
1getRemoteId(e,t,n){const r=n||this.getRemoteIdToIdMap(e);if("number"!=typeof t)return t;return r.get(t)||-1}getRemoteIds(e,t){const n=this.getRemoteIdToIdMap(e);return t.map(t=>this.getRemoteId(e,t,n))}reset(e){if(!e)return this.iframeIdToRemoteIdMap=new WeakMap,void(this.iframeRemoteIdToIdMap=new WeakMap);this.iframeIdToRemoteIdMap.delete(e),this.iframeRemoteIdToIdMap.delete(e)}getIdToRemoteIdMap(e){let t=this.iframeIdToRemoteIdMap.get(e);return t||(t=new Map,this.iframeIdToRemoteIdMap.set(e,t)),t}getRemoteIdToIdMap(e){let t=this.iframeRemoteIdToIdMap.get(e);return t||(t=new Map,this.iframeRemoteIdToIdMap.set(e,t)),t}}class Jd{constructor(){this.crossOriginIframeMirror=new Vd(Iu),this.crossOriginIframeRootIdMap=new WeakMap}addIframe(){}addLoadListener(){}attachIframe(){}}class Kd{constructor(e){this.iframes=new WeakMap,this.crossOriginIframeMap=new WeakMap,this.crossOriginIframeMirror=new Vd(Iu),this.crossOriginIframeRootIdMap=new WeakMap,this.mutationCb=e.mutationCb,this.wrappedEmit=e.wrappedEmit,this.stylesheetManager=e.stylesheetManager,this.recordCrossOriginIframes=e.recordCrossOriginIframes,this.crossOriginIframeStyleMirror=new Vd(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror)),this.mirror=e.mirror,this.recordCrossOriginIframes&&window.addEventListener("message",this.handleMessage.bind(this))}addIframe(e){this.iframes.set(e,!0),e.contentWindow&&this.crossOriginIframeMap.set(e.contentWindow,e)}addLoadListener(e){this.loadListener=e}attachIframe(e,t){this.mutationCb({adds:[{parentId:this.mirror.getId(e),nextId:null,node:t}],removes:[],texts:[],attributes:[],isAttachIframe:!0}),this.recordCrossOriginIframes&&e.contentWindow?.addEventListener("message",this.handleMessage.bind(this)),this.loadListener?.(e);const n=wd(e);n&&n.adoptedStyleSheets&&n.adoptedStyleSheets.length>0&&this.stylesheetManager.adoptStyleSheets(n.adoptedStyleSheets,this.mirror.getId(n))}handleMessage(e){const t=e;if("rrweb"!==t.data.type||t.origin!==t.data.origin)return;if(!e.source)return;const n=this.crossOriginIframeMap.get(e.source);if(!n)return;const r=this.transformCrossOriginEvent(n,t.data.event);r&&this.wrappedEmit(r,t.data.isCheckout)}transformCrossOriginEvent(e,t){switch(t.type){case yd.FullSnapshot:{this.crossOriginIframeMirror.reset(e),this.crossOriginIframeStyleMirror.reset(e),this.replaceIdOnNode(t.data.node,e);const n=t.data.node.id;return this.crossOriginIframeRootIdMap.set(e,n),this.patchRootIdOnNode(t.data.node,n),{timestamp:t.timestamp,type:yd.IncrementalSnapshot,data:{source:vd.Mutation,adds:[{parentId:this.mirror.getId(e),nextId:null,node:t.data.node}],removes:[],texts:[],attributes:[],isAttachIframe:!0}}}case yd.Meta:case yd.Load:case yd.DomContentLoaded:return!1;case yd.Plugin:return t;case yd.Custom:return this.replaceIds(t.data.payload,e,["id","parentId","previousId","nextId"]),t;case yd.IncrementalSnapshot:switch(t.data.source){case vd.Mutation:return t.data.adds.forEach(t=>{this.replaceIds(t,e,["parentId","nextId","previousId"]),this.replaceIdOnNode(t.node,e);const n=this.crossOriginIframeRootIdMap.get(e);n&&this.patchRootIdOnNode(t.node,n)}),t.data.removes.forEach(t=>{this.replaceIds(t,e,["parentId","id"])}),t.data.attributes.forEach(t=>{this.replaceIds(t,e,["id"])}),t.data.texts.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case vd.Drag:case vd.TouchMove:case vd.MouseMove:return t.data.positions.forEach(t=>{this.replaceIds(t,e,["id"])}),t;case vd.ViewportResize:return!1;case vd.MediaInteraction:case vd.MouseInteraction:case vd.Scroll:case vd.CanvasMutation:case vd.Input:return this.replaceIds(t.data,e,["id"]),t;case vd.StyleSheetRule:case vd.StyleDeclaration:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleId"]),t;case vd.Font:return t;case vd.Selection:return t.data.ranges.forEach(t=>{this.replaceIds(t,e,["start","end"])}),t;case vd.AdoptedStyleSheet:return this.replaceIds(t.data,e,["id"]),this.replaceStyleIds(t.data,e,["styleIds"]),t.data.styles?.forEach(t=>{this.replaceStyleIds(t,e,["styleId"])}),t}}return!1}replace(e,t,n,r){for(const s of r)(Array.isArray(t[s])||"number"==typeof t[s])&&(Array.isArray(t[s])?t[s]=e.getIds(n,t[s]):t[s]=e.getId(n,t[s]));return t}replaceIds(e,t,n){return this.replace(this.crossOriginIframeMirror,e,t,n)}replaceStyleIds(e,t,n){return this.replace(this.crossOriginIframeStyleMirror,e,t,n)}replaceIdOnNode(e,t){this.replaceIds(e,t,["id","rootId"]),"childNodes"in e&&e.childNodes.forEac
1h(e=>{this.replaceIdOnNode(e,t)})}patchRootIdOnNode(e,t){e.type===ou.Document||e.rootId||(e.rootId=t),"childNodes"in e&&e.childNodes.forEach(e=>{this.patchRootIdOnNode(e,t)})}}class Gd{init(){}addShadowRoot(){}observeAttachShadow(){}reset(){}}class Xd{constructor(e){this.shadowDoms=new WeakSet,this.restoreHandlers=[],this.mutationCb=e.mutationCb,this.scrollCb=e.scrollCb,this.bypassOptions=e.bypassOptions,this.mirror=e.mirror,this.init()}init(){this.reset(),this.patchAttachShadow(Element,document)}addShadowRoot(e,t){if(!cu(e))return;if(this.shadowDoms.has(e))return;this.shadowDoms.add(e),this.bypassOptions.canvasManager.addShadowRoot(e);const n=Ld({...this.bypassOptions,doc:t,mutationCb:this.mutationCb,mirror:this.mirror,shadowDomManager:this},e);this.restoreHandlers.push(()=>n.disconnect()),this.restoreHandlers.push(Dd({...this.bypassOptions,scrollCb:this.scrollCb,doc:e,mirror:this.mirror})),gd(()=>{e.adoptedStyleSheets&&e.adoptedStyleSheets.length>0&&this.bypassOptions.stylesheetManager.adoptStyleSheets(e.adoptedStyleSheets,this.mirror.getId(e.host)),this.restoreHandlers.push(zd({mirror:this.mirror,stylesheetManager:this.bypassOptions.stylesheetManager},e))},0)}observeAttachShadow(e){const t=wd(e),n=function(e){try{return e.contentWindow}catch(e){}}(e);t&&n&&this.patchAttachShadow(n.Element,t)}patchAttachShadow(e,t){const n=this;this.restoreHandlers.push(Qu(e.prototype,"attachShadow",function(e){return function(r){const s=e.call(this,r);return this.shadowRoot&&pd(this)&&n.addShadowRoot(this.shadowRoot,t),s}}))}reset(){this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.shadowDoms=new WeakSet,this.bypassOptions.canvasManager.resetShadowRoots()}}for(var Yd="undefined"==typeof Uint8Array?[]:new Uint8Array(256),Qd=0;Qd<64;Qd++)Yd["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charCodeAt(Qd)]=Qd;class Zd{reset(){}freeze(){}unfreeze(){}lock(){}unlock(){}snapshot(){}addWindow(){}addShadowRoot(){}resetShadowRoots(){}}class eh{constructor(e){this.trackedLinkElements=new WeakSet,this.styleMirror=new dd,this.mutationCb=e.mutationCb,this.adoptedStyleSheetCb=e.adoptedStyleSheetCb}attachLinkElement(e,t){"_cssText"in t.attributes&&this.mutationCb({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:t.attributes}]}),this.trackLinkElement(e)}trackLinkElement(e){this.trackedLinkElements.has(e)||(this.trackedLinkElements.add(e),this.trackStylesheetInLinkElement(e))}adoptStyleSheets(e,t){if(0===e.length)return;const n={id:t,styleIds:[]},r=[];for(const t of e){let e;this.styleMirror.has(t)?e=this.styleMirror.getId(t):(e=this.styleMirror.add(t),r.push({styleId:e,rules:Array.from(t.rules||CSSRule,(e,t)=>({rule:uu(e),index:t}))})),n.styleIds.push(e)}r.length>0&&(n.styles=r),this.adoptedStyleSheetCb(n)}reset(){this.styleMirror.reset(),this.trackedLinkElements=new WeakSet}trackStylesheetInLinkElement(e){}}class th{constructor(){this.nodeMap=new WeakMap,this.active=!1}inOtherBuffer(e,t){const n=this.nodeMap.get(e);return n&&Array.from(n).some(e=>e!==t)}add(e,t){this.active||(this.active=!0,function(...e){md("requestAnimationFrame")(...e)}(()=>{this.nodeMap=new WeakMap,this.active=!1})),this.nodeMap.set(e,(this.nodeMap.get(e)||new Set).add(t))}destroy(){}}let nh,rh;try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}const sh=new du;function ih(e={}){const{emit:t,checkoutEveryNms:n,checkoutEveryNth:r,blockClass:s="rr-block",blockSelector:i=null,unblockSelector:o=null,ignoreClass:a="rr-ignore",ignoreSelector:c=null,maskAllText:l=!1,maskTextClass:u="rr-mask",unmaskTextClass:d=null,maskTextSelector:h=null,unmaskTextSelector:p=null,inlineStylesheet:f=!0,maskAllInputs:m,maskInputOptions:g,slimDOMOptions:y,maskAttributeFn:v,maskInputFn:_,maskTextFn:b,maxCanvasSize:S=null,packFn:w,sampling:k={},dataURLOptions:T={},mousemoveWait:E,recordDOM:x=!0,recordCanvas:I=!1,recordCrossOriginIframes:C=!1,recordAfter:O=("DOMContentLoaded"===e.recordAfter?e.recordAfter:"load"),userTriggeredOnInput:A=!1,collectFonts:M=!1,inl
1ineImages:R=!1,plugins:N,keepIframeSrcFn:P=()=>!1,ignoreCSSAttributes:L=new Set([]),errorHandler:D,onMutation:$,getCanvasManager:j}=e;Md=D;const B=!C||window.parent===window;let F=!1;if(!B)try{window.parent.document&&(F=!1)}catch(e){F=!0}if(B&&!t)throw new Error("emit function is required");if(!B&&!F)return()=>{};void 0!==E&&void 0===k.mousemove&&(k.mousemove=E),sh.reset();const U=!0===m?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0,radio:!0,checkbox:!0}:void 0!==g?g:{},z=!0===y||"all"===y?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaVerification:!0,headMetaAuthorship:"all"===y,headMetaDescKeywords:"all"===y}:y||{};let W;!function(e=window){"NodeList"in e&&!e.NodeList.prototype.forEach&&(e.NodeList.prototype.forEach=Array.prototype.forEach),"DOMTokenList"in e&&!e.DOMTokenList.prototype.forEach&&(e.DOMTokenList.prototype.forEach=Array.prototype.forEach),Node.prototype.contains||(Node.prototype.contains=(...e)=>{let t=e[0];if(!(0 in e))throw new TypeError("1 argument is required");do{if(this===t)return!0}while(t=t&&t.parentNode);return!1})}();let H=0;const q=e=>{for(const t of N||[])t.eventProcessor&&(e=t.eventProcessor(e));return w&&!F&&(e=w(e)),e};nh=(e,s)=>{const i=e;if(i.timestamp=Zu(),!Nd[0]?.isFrozen()||i.type===yd.FullSnapshot||i.type===yd.IncrementalSnapshot&&i.data.source===vd.Mutation||Nd.forEach(e=>e.unfreeze()),B)t?.(q(i),s);else if(F){const e={type:"rrweb",event:q(i),origin:window.location.origin,isCheckout:s};window.parent.postMessage(e,"*")}if(i.type===yd.FullSnapshot)W=i,H=0;else if(i.type===yd.IncrementalSnapshot){if(i.data.source===vd.Mutation&&i.data.isAttachIframe)return;H++;const e=r&&H>=r,t=n&&W&&i.timestamp-W.timestamp>n;(e||t)&&ee(!0)}};const V=e=>{nh({type:yd.IncrementalSnapshot,data:{source:vd.Mutation,...e}})},J=e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.Scroll,...e}}),K=e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.CanvasMutation,...e}}),G=new eh({mutationCb:V,adoptedStyleSheetCb:e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.AdoptedStyleSheet,...e}})}),X="boolean"==typeof __RRWEB_EXCLUDE_IFRAME__&&__RRWEB_EXCLUDE_IFRAME__?new Jd:new Kd({mirror:sh,mutationCb:V,stylesheetManager:G,recordCrossOriginIframes:C,wrappedEmit:nh});for(const e of N||[])e.getMirror&&e.getMirror({nodeMirror:sh,crossOriginIframeMirror:X.crossOriginIframeMirror,crossOriginIframeStyleMirror:X.crossOriginIframeStyleMirror});const Y=new th,Q=function(e,t){try{return e?e(t):new Zd}catch{return console.warn("Unable to initialize CanvasManager"),new Zd}}(j,{mirror:sh,win:window,mutationCb:e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.CanvasMutation,...e}}),recordCanvas:I,blockClass:s,blockSelector:i,unblockSelector:o,maxCanvasSize:S,sampling:k.canvas,dataURLOptions:T,errorHandler:D}),Z="boolean"==typeof __RRWEB_EXCLUDE_SHADOW_DOM__&&__RRWEB_EXCLUDE_SHADOW_DOM__?new Gd:new Xd({mutationCb:V,scrollCb:J,bypassOptions:{onMutation:$,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,inlineStylesheet:f,maskInputOptions:U,dataURLOptions:T,maskAttributeFn:v,maskTextFn:b,maskInputFn:_,recordCanvas:I,inlineImages:R,sampling:k,slimDOMOptions:z,iframeManager:X,stylesheetManager:G,canvasManager:Q,keepIframeSrcFn:P,processedNodeManager:Y,ignoreCSSAttributes:L},mirror:sh}),ee=(e=!1)=>{if(!x)return;nh({type:yd.Meta,data:{href:window.location.href,width:nd(),height:td()}},e),G.reset(),Z.init(),Nd.forEach(e=>e.lock());const t=function(e,t){const{mirror:n=new du,blockClass:r="rr-block",blockSelector:s=null,unblockSelector:i=null,maskAllText:o=!1,maskTextClass:a="rr-mask",unmaskTextClass:c=null,maskTextSelector:l=null,unmaskTextSelector:u=null,inlineStylesheet:d=!0,inlineImages:h=!1,recordCanvas:p=!1,maskAllInputs:f=!1,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOM:v=!1,dataURLOptions:_,preserveWhiteSpace:b,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:k,onBlockedImageLoad:T,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:I=()=>!1,ignoreCSSAttributes:C=new Set([])}=t||{};return Vu(e,{doc:e,mirror:n,blockClass:r,blockSelector:s,unblockSelector:i,maskAllText:o,maskTextClass:a,unmaskTextClass:c,maskTextSelector:l,unmaskTextSelector:u,skipChild:!1,inlineStylesheet:d,maskInputOptions:!0===f?{color:!0,date:!0,"datetime-local":!0,email:!0,month:!0,number:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0,textarea:!0,select:!0}:!1===f?{}:f,maskAttributeFn:m,maskTextFn:g,maskInputFn:y,slimDOMOptions:!0===v||"all"===v?{script:!0,comment:!0,headFavicon:!0,headWhitespace:!0,headMetaDescKeywords:"all"===v,headMetaSocial:!0,headMetaRobots:!0,headMetaHttpEquiv:!0,headMetaAuthorship:!0,headMetaVerification:!0}
1:!1===v?{}:v,dataURLOptions:_,inlineImages:h,recordCanvas:p,preserveWhiteSpace:b,onSerialize:S,onIframeLoad:w,iframeLoadTimeout:k,onBlockedImageLoad:T,onStylesheetLoad:E,stylesheetLoadTimeout:x,keepIframeSrcFn:I,newlyAddedElement:!1,ignoreCSSAttributes:C})}(document,{mirror:sh,blockClass:s,blockSelector:i,unblockSelector:o,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,inlineStylesheet:f,maskAllInputs:U,maskAttributeFn:v,maskInputFn:_,maskTextFn:b,slimDOM:z,dataURLOptions:T,recordCanvas:I,inlineImages:R,onSerialize:e=>{cd(e,sh)&&X.addIframe(e),ld(e,sh)&&G.trackLinkElement(e),ud(e)&&Z.addShadowRoot(e.shadowRoot,document)},onIframeLoad:(e,t)=>{X.attachIframe(e,t),e.contentWindow&&Q.addWindow(e.contentWindow),Z.observeAttachShadow(e)},onStylesheetLoad:(e,t)=>{G.attachLinkElement(e,t)},onBlockedImageLoad:(e,t,{width:n,height:r})=>{V({adds:[],removes:[],texts:[],attributes:[{id:t.id,attributes:{style:{width:`${n}px`,height:`${r}px`}}}]})},keepIframeSrcFn:P,ignoreCSSAttributes:L});if(!t)return console.warn("Failed to snapshot the document");nh({type:yd.FullSnapshot,data:{node:t,initialOffset:ed(window)}}),Nd.forEach(e=>e.unlock()),document.adoptedStyleSheets&&document.adoptedStyleSheets.length>0&&G.adoptStyleSheets(document.adoptedStyleSheets,sh.getId(document))};rh=ee;try{const e=[],t=e=>Rd(Wd)({onMutation:$,mutationCb:V,mousemoveCb:(e,t)=>nh({type:yd.IncrementalSnapshot,data:{source:t,positions:e}}),mouseInteractionCb:e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.MouseInteraction,...e}}),scrollCb:J,viewportResizeCb:e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.ViewportResize,...e}}),inputCb:e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.Input,...e}}),mediaInteractionCb:e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.MediaInteraction,...e}}),styleSheetRuleCb:e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.StyleSheetRule,...e}}),styleDeclarationCb:e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.StyleDeclaration,...e}}),canvasMutationCb:K,fontCb:e=>nh({type:yd.IncrementalSnapshot,data:{source:vd.Font,...e}}),selectionCb:e=>{nh({type:yd.IncrementalSnapshot,data:{source:vd.Selection,...e}})},customElementCb:e=>{nh({type:yd.IncrementalSnapshot,data:{source:vd.CustomElement,...e}})},blockClass:s,ignoreClass:a,ignoreSelector:c,maskAllText:l,maskTextClass:u,unmaskTextClass:d,maskTextSelector:h,unmaskTextSelector:p,maskInputOptions:U,inlineStylesheet:f,sampling:k,recordDOM:x,recordCanvas:I,inlineImages:R,userTriggeredOnInput:A,collectFonts:M,doc:e,maskAttributeFn:v,maskInputFn:_,maskTextFn:b,keepIframeSrcFn:P,blockSelector:i,unblockSelector:o,slimDOMOptions:z,dataURLOptions:T,mirror:sh,iframeManager:X,stylesheetManager:G,shadowDomManager:Z,processedNodeManager:Y,canvasManager:Q,ignoreCSSAttributes:L,plugins:N?.filter(e=>e.observer)?.map(e=>({observer:e.observer,options:e.options,callback:t=>nh({type:yd.Plugin,data:{plugin:e.name,payload:t}})}))||[]},{});X.addLoadListener(n=>{try{e.push(t(n.contentDocument))}catch(e){console.warn(e)}});const n=()=>{ee(),e.push(t(document))};return"interactive"===document.readyState||"complete"===document.readyState?n():(e.push(Ju("DOMContentLoaded",()=>{nh({type:yd.DomContentLoaded,data:{}}),"DOMContentLoaded"===O&&n()})),e.push(Ju("load",()=>{nh({type:yd.Load,data:{}}),"load"===O&&n()},window))),()=>{e.forEach(e=>e()),Y.destroy(),rh=void 0,Md=void 0}}catch(e){console.warn(e)}}var oh,ah;function ch(e){return e>9999999999?e:1e3*e}function lh(e){return e>9999999999?e/1e3:e}function uh(e,t){"sentry.transaction"!==t.category&&(["ui.click","ui.input"].includes(t.category)?e.triggerUserActivity():e.checkAndHandleExpiredSession(),e.addUpdate(()=>(e.throttledAddEvent({type:yd.Custom,timestamp:1e3*(t.timestamp||0),data:{tag:"breadcrumb",payload:tr(t,10,1e3)}}),"console"===t.category)))}function dh(e){return e.closest("button,a")||e}function hh(e){const t=ph(e);return t&&t instanceof Element?dh(t):t}function ph(e){return function(e){return"object"==typeof e&&!!e&&"target"in e}(e)?e.target:e}let fh;ih.mirror=sh,ih.takeFullSnapshot=function(e){if(!rh)throw new Error("please take full snapshot after start recording");rh(e)},(ah=oh||(oh={}))[ah.NotStarted=0]="NotStarted",ah[ah.Running=1]="Running",ah[ah.Stopped=2]="Stopped";const mh=new Set([vd.Mutation,vd.StyleSheetRule,vd.StyleDeclaration,vd.AdoptedStyleSheet,vd.CanvasMutation,vd.Selection,vd.MediaInteraction]);class gh{constructor(e,t,n=uh){this._lastMutation=0,this._lastScroll=0,this._clicks=[],this._timeout=t.timeout/1e3,this._threshold=t.threshold/1e3,this._scrollTimeout=t.scrollTimeout/1e3,this._replay=e,this._ignoreSelector=t.ignoreSelector,this._addBreadcrumbEvent=n}addListeners(){const e=(t=()=>{this._lastMutation=vh()},fh||(fh=[],B(Ql,"open",function(e){return function(...t){if(fh)try{fh.forEach(e
1=>e())}catch{}return e.apply(Ql,t)}})),fh.push(t),()=>{const e=fh?fh.indexOf(t):-1;e>-1&&fh.splice(e,1)});var t;this._teardown=()=>{e(),this._clicks=[],this._lastMutation=0,this._lastScroll=0}}removeListeners(){this._teardown&&this._teardown(),this._checkClickTimeout&&clearTimeout(this._checkClickTimeout)}handleClick(e,t){if(function(e,t){return!yh.includes(e.tagName)||("INPUT"===e.tagName&&!["submit","button"].includes(e.getAttribute("type")||"")||(!("A"!==e.tagName||!(e.hasAttribute("download")||e.hasAttribute("target")&&"_self"!==e.getAttribute("target")))||!(!t||!e.matches(t))))}(t,this._ignoreSelector)||!function(e){return!(!e.data||"number"!=typeof e.data.nodeId||!e.timestamp)}(e))return;const n={timestamp:lh(e.timestamp),clickBreadcrumb:e,clickCount:0,node:t};this._clicks.some(e=>e.node===n.node&&Math.abs(e.timestamp-n.timestamp)<1)||(this._clicks.push(n),1===this._clicks.length&&this._scheduleCheckClicks())}registerMutation(e=Date.now()){this._lastMutation=lh(e)}registerScroll(e=Date.now()){this._lastScroll=lh(e)}registerClick(e){const t=dh(e);this._handleMultiClick(t)}_handleMultiClick(e){this._getClicks(e).forEach(e=>{e.clickCount++})}_getClicks(e){return this._clicks.filter(t=>t.node===e)}_checkClicks(){const e=[],t=vh();this._clicks.forEach(n=>{!n.mutationAfter&&this._lastMutation&&(n.mutationAfter=n.timestamp<=this._lastMutation?this._lastMutation-n.timestamp:void 0),!n.scrollAfter&&this._lastScroll&&(n.scrollAfter=n.timestamp<=this._lastScroll?this._lastScroll-n.timestamp:void 0),n.timestamp+this._timeout<=t&&e.push(n)});for(const t of e){const e=this._clicks.indexOf(t);e>-1&&(this._generateBreadcrumbs(t),this._clicks.splice(e,1))}this._clicks.length&&this._scheduleCheckClicks()}_generateBreadcrumbs(e){const t=this._replay,n=e.scrollAfter&&e.scrollAfter<=this._scrollTimeout,r=e.mutationAfter&&e.mutationAfter<=this._threshold,s=!n&&!r,{clickCount:i,clickBreadcrumb:o}=e;if(s){const n=1e3*Math.min(e.mutationAfter||this._timeout,this._timeout),r=n<1e3*this._timeout?"mutation":"timeout",s={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.slowClickDetected",data:{...o.data,url:Ql.location.href,route:t.getCurrentRoute(),timeAfterClickMs:n,endReason:r,clickCount:i||1}};return void this._addBreadcrumbEvent(t,s)}if(i>1){const e={type:"default",message:o.message,timestamp:o.timestamp,category:"ui.multiClick",data:{...o.data,url:Ql.location.href,route:t.getCurrentRoute(),clickCount:i,metric:!0}};this._addBreadcrumbEvent(t,e)}}_scheduleCheckClicks(){this._checkClickTimeout&&clearTimeout(this._checkClickTimeout),this._checkClickTimeout=Jo(()=>this._checkClicks(),1e3)}}const yh=["A","BUTTON","INPUT"];function vh(){return Date.now()/1e3}function _h(e){return{timestamp:Date.now()/1e3,type:"default",...e}}var bh=(e=>(e[e.Document=0]="Document",e[e.DocumentType=1]="DocumentType",e[e.Element=2]="Element",e[e.Text=3]="Text",e[e.CDATA=4]="CDATA",e[e.Comment=5]="Comment",e))(bh||{});const Sh=new Set(["id","class","aria-label","role","name","alt","title","data-test-id","data-testid","disabled","aria-disabled","data-sentry-component"]);function wh(e){const t={};!e["data-sentry-component"]&&e["data-sentry-element"]&&(e["data-sentry-component"]=e["data-sentry-element"]);for(const n in e)if(Sh.has(n)){let r=n;"data-testid"!==n&&"data-test-id"!==n||(r="testId"),t[r]=e[n]}return t}function kh(e,t){const n=ih.mirror.getId(e),r=n&&ih.mirror.getNode(n),s=r&&ih.mirror.getMeta(r),i=s&&function(e){return e.type===bh.Element}(s)?s:null;return{message:t,data:i?{nodeId:n,node:{id:n,tagName:i.tagName,textContent:Array.from(i.childNodes).map(e=>e.type===bh.Text&&e.textContent).filter(Boolean).map(e=>e.trim()).join(""),attributes:wh(i.attributes)}}:{}}}const Th={resource:function(e){const{entryType:t,initiatorType:n,name:r,responseEnd:s,startTime:i,decodedBodySize:o,encodedBodySize:a,responseStatus:c,transferSize:l}=e;return["fetch","xmlhttprequest"].includes(n)?null:{type:`${t}.${n}`,start:Ih(i),end:Ih(s),name:r,data:{size:l,statusCode:c,decodedBodySize:o,encodedBodySize:a}}},paint:function(e){const{duration:t,entryType:n,name:r,startTime:s}=e,i=Ih(s);return{type:n,name:r,start:i,end:i+t,data:void 0}},navigation:function(e){const{entryType:t,name:n,decodedBodySize:r,duration:s,domComplete:i,encodedBodySize:o,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,domInteractive:l,loadEventStart:u,loadEventEnd:d,redirectCount:h,startTime:p,transferSize:f,type:m}=e;return 0===s?null:{type:`${t}.${m}`,start:Ih(p),end:Ih(i),name:n,data:{size:f,decodedBodySize:r,encodedBodySize:o,duration:s,domInteractive:l,domContentLoadedEventStart:a,domContentLoadedEventEnd:c,loadEventStart:u,loadEventEnd:d,domComplete:i,redirectCount:h}}}};function Eh(e,t){return({metric:n})=>{t.replayPerformanceEntries.push(e(n))}}function xh(e){const t=Th[e.entryType];return t?t(e):null}function Ih(e){return((Te()||Ql.performance.timeOrigin)+e)/1e3}function Ch(e){const t=e.entries[e.entries.length-1];return Rh(e,"largest-contentful-paint",t?.element?[t.element]:void 0)}function Oh(e){return void 0!==e.sources}function Ah(e){const t=[],n=[];for(const r of e.entries)if(Oh(r)){const e=[];for(const t of r.sources)if(t.node){n.push(t.node);const r=ih.mirror.getId(t.node);r&&e.push(r)}t.push({value:r.value,nodeIds:e.length?e:void 0})}return Rh(e,"cumulative-layout-shift",n,t)}function Mh(e){const t=e.entries[e.entries.length-1];return Rh(e,"interaction-to-next-paint",t?.target?[t.target]:void 0)}function Rh(e,t,n,r){const s=e.value,i=e.rating,o=Ih(s);return{type:"web-vital",name:t,start:o,end:o,data:{value:s,size:s,rating:i,nodeIds:n?n.map(e=>ih.mirror.getId(e)):void 0,attributions:r}}}const Nh="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,Ph=["log","warn","error"],Lh="[Replay] ";function Dh(e,t="info"){Oi({category:"console",data:{logger:"replay"},level:t,message:`${Lh}${e}`},{level:t})}const $h=function(){let e=!1,t=!1;const n={exception:()=>{},infoTick:()=>{},setConfig:n=>{e=!!n.captureExceptions,t=!!n.traceInternals}};
1return Nh?(Ph.forEach(e=>{n[e]=(...n)=>{j[e](Lh,...n),t&&Dh(n.join(""),Ai(e))}}),n.exception=(r,...s)=>{s.length&&n.error&&n.error(...s),j.error(Lh,r),e?Fs(r,{mechanism:{handled:!0,type:"auto.function.replay.debug"}}):t&&Dh(r,"error")},n.infoTick=(...e)=>{j.log(Lh,...e),t&&setTimeout(()=>Dh(e[0]),0)}):Ph.forEach(e=>{n[e]=()=>{}}),n}();class jh extends Error{constructor(){super("Event buffer exceeded maximum size of 20000000.")}}class Bh{constructor(){this.events=[],this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return this.events.length>0}get type(){return"sync"}destroy(){this.events=[]}async addEvent(e){const t=JSON.stringify(e).length;if(this._totalSize+=t,this._totalSize>ru)throw new jh;this.events.push(e)}finish(){return new Promise(e=>{const t=this.events;this.clear(),e(JSON.stringify(t))})}clear(){this.events=[],this._totalSize=0,this.hasCheckout=!1}getEarliestTimestamp(){let e=null;for(const{timestamp:t}of this.events)(null===e||t<e)&&(e=t);return null===e?e:ch(e)}}class Fh{constructor(e){this._worker=e,this._id=0}ensureReady(){return this._ensureReadyPromise||(this._ensureReadyPromise=new Promise((e,t)=>{this._worker.addEventListener("message",({data:n})=>{n.success?e():(Nh&&$h.warn("Received worker message with unsuccessful status",n),t(new Error("Received worker message with unsuccessful status")))},{once:!0}),this._worker.addEventListener("error",e=>{Nh&&$h.warn("Failed to load Replay compression worker",e),t(new Error(`Failed to load Replay compression worker: ${e instanceof ErrorEvent&&e.message?e.message:"Unknown error. This can happen due to CSP policy restrictions, network issues, or the worker script failing to load."}`))},{once:!0})})),this._ensureReadyPromise}destroy(){Nh&&$h.log("Destroying compression worker"),this._worker.terminate()}postMessage(e,t){const n=this._getAndIncrementId();return new Promise((r,s)=>{const i=({data:t})=>{const o=t;if(o.method===e&&o.id===n){if(this._worker.removeEventListener("message",i),!o.success)return Nh&&$h.error("Error in compression worker: ",o.response),void s(new Error("Error in compression worker"));r(o.response)}};this._worker.addEventListener("message",i),this._worker.postMessage({id:n,method:e,arg:t})})}_getAndIncrementId(){return this._id++}}class Uh{constructor(e){this._worker=new Fh(e),this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this.waitForCheckout=!1}get hasEvents(){return!!this._earliestTimestamp}get type(){return"worker"}ensureReady(){return this._worker.ensureReady()}destroy(){this._worker.destroy()}addEvent(e){const t=ch(e.timestamp);(!this._earliestTimestamp||t<this._earliestTimestamp)&&(this._earliestTimestamp=t);const n=JSON.stringify(e);return this._totalSize+=n.length,this._totalSize>ru?Promise.reject(new jh):this._sendEventToWorker(n)}finish(){return this._finishRequest()}clear(){this._earliestTimestamp=null,this._totalSize=0,this.hasCheckout=!1,this._worker.postMessage("clear").then(null,e=>{Nh&&$h.exception(e,'Sending "clear" message to worker failed',e)})}getEarliestTimestamp(){return this._earliestTimestamp}_sendEventToWorker(e){return this._worker.postMessage("addEvent",e)}async _finishRequest(){const e=await this._worker.postMessage("finish");return this._earliestTimestamp=null,this._totalSize=0,e}}class zh{constructor(e){this._fallback=new Bh,this._compression=new Uh(e),this._used=this._fallback,this._ensureWorkerIsLoadedPromise=this._ensureWorkerIsLoaded()}get waitForCheckout(){return this._used.waitForCheckout}get type(){return this._used.type}get hasEvents(){return this._used.hasEvents}get hasCheckout(){return this._used.hasCheckout}set hasCheckout(e){this._used.hasCheckout=e}set waitForCheckout(e){this._used.waitForCheckout=e}destroy(){this._fallback.destroy(),this._compression.destroy()}clear(){return this._used.clear()}getEarliestTimestamp(){return this._used.getEarliestTimestamp()}addEvent(e){return this._used.addEvent(e)}async finish(){return await this.ensureWorkerIsLoaded(),this._used.finish()}ensureWorkerIsLoaded(){return this._ensureWorkerIsLoadedPromise}async _ensureWorkerIsLoaded(){try{await this._compression.ensureReady()}catch(e){return void(Nh&&$h.exception(e,"Failed to load the compression worker, falling back to simple buffer"))}await this._switchToCompressionWorker()}async _switchToCompressionWorker(){const{events:e,hasCheckout:t,waitForCheckout:n}=this._fallback,r=[];for(const t of e)r.push(this._compression.addEvent(t));this._compression.hasCheckout=t,this._compression.waitForCheckout=n,this._used=this._compression;try{await Promise.all(r),this._fallback.clear()}catch(e){Nh&&$h.exception(e,"Failed to add events when switching buffers.")}}}function Wh(){try{return"sessionStorage"in Ql&&!!Ql.sessionStorage}catch{return!1}}function Hh(e){return void 0!==e&&Math.random()<e}function qh(e){if(Wh())try{Ql.sessionStorage.setItem(Zl,JSON.stringify(e))}catch{}}function Vh(e){const t=Date.now();return{id:e.id||pe(),started:e.started||t,lastActivity:e.lastActivity||t,segmentId:e.segmentId||0,sampled:e.sampled,previousSessionId:e.previousSessionId,dirty:e.dirty||!1}}function Jh({sessionSampleRate:e,allowBuffering:t,stickySession:n=!1},{previousSessionId:r}={}){const s=function(e,t){return Hh(e)?"session":!!t&&"buffer"}(e,t),i=Vh({sampled:s,previousSessionId:r});return n&&qh(i),i}function Kh(e,t,n=+new Date){return null===e||void 0===t||t<0||0!==t&&e+t<=n}function Gh(e,{maxReplayDuration:t,sessionIdleExpire:n,targetTime:r=Date.now()}){return Kh(e.started,t,r)||Kh(e.lastActivity,n,r)}function Xh(e,{sessionIdleExpire:t,maxReplayDuration:n}){return!!Gh(e,{sessionIdleExpire:t,maxReplayDuration:n})&&("buffer"!==e.sampled||0!==e.segmentId)}function Yh({sessionIdleExpire:e,maxReplayDuration:t,previousSessionId:n},r){const s=r.stickySession&&function(){if(!Wh())return null;try{const e=Ql.sessionStorage.getItem(Zl);if(!e)return null;const t=JSON.parse(e);return Nh&&$h.infoTick("Loading existing session"),Vh(t)}catch{return null}}();return s?Xh(s,{sessionIdleExpire:e,maxReplayDuration:t})?(Nh&&$h.infoTick("Session in sessionStorage is expired, creating new one..."),Jh(r,{previousSessionId:s.id})):s:(Nh&&$h.infoTick("Creating new session"),Jh(r,{previousSessionId:n}))}
1function Qh(e,t,n){return!!ep(e,t)&&(Zh(e,t,n),!0)}async function Zh(e,t,n){const{eventBuffer:r}=e;if(!r||r.waitForCheckout&&!n)return null;const s="buffer"===e.recordingMode;try{n&&s&&r.clear(),n&&(r.hasCheckout=!0,r.waitForCheckout=!1);const i=function(e,t){try{if("function"==typeof t&&function(e){return e.type===yd.Custom}(e))return t(e)}catch(e){return Nh&&$h.exception(e,"An error occurred in the `beforeAddRecordingEvent` callback, skipping the event..."),null}return e}(t,e.getOptions().beforeAddRecordingEvent);if(!i)return;return await r.addEvent(i)}catch(t){const n=t&&t instanceof jh,i=n?"addEventSizeExceeded":"addEvent",o=Ge();if(o){const e=n?"buffer_overflow":"internal_sdk_error";o.recordDroppedEvent(e,"replay")}if(n&&s)return r.clear(),r.waitForCheckout=!0,null;e.handleException(t),await e.stop({reason:i})}}function ep(e,t){if(!e.eventBuffer||e.isPaused()||!e.isEnabled())return!1;const n=ch(t.timestamp);return!(n+e.timeouts.sessionIdlePause<Date.now()||n>e.getContext().initialTimestamp+e.getOptions().maxReplayDuration&&(Nh&&$h.infoTick(`Skipping event with timestamp ${n} because it is after maxReplayDuration`),1))}function tp(e){return!e.type}function np(e){return"transaction"===e.type}function rp(e){return"feedback"===e.type}function sp(e){return!!e.category}function ip(){const e=He().getPropagationContext().dsc;e&&delete e.replay_id;const t=Hn();t&&delete Yn(t).replay_id}function op(e,t){return t.map(({type:t,start:n,end:r,name:s,data:i})=>{const o=e.throttledAddEvent({type:yd.Custom,timestamp:n,data:{tag:"performanceSpan",payload:{op:t,description:s,startTimestamp:n,endTimestamp:r,data:i}}});return"string"==typeof o?Promise.resolve(null):o})}function ap(e,t){e.isEnabled()&&null!==t&&(function(e,t){return(!Nh||!e.getOptions()._experiments.traceInternals)&&Xl(t,Ge())}(e,t.name)||e.addUpdate(()=>(op(e,[t]),!0)))}function cp(e){if(!e)return;const t=new TextEncoder;try{if("string"==typeof e)return t.encode(e).length;if(e instanceof URLSearchParams)return t.encode(e.toString()).length;if(e instanceof FormData){const n=Zc(e);return t.encode(n).length}if(e instanceof Blob)return e.size;if(e instanceof ArrayBuffer)return e.byteLength}catch{}}function lp(e){if(!e)return;const t=parseInt(e,10);return isNaN(t)?void 0:t}function up(e,t){if(!e)return{headers:{},size:void 0,_meta:{warnings:[t]}};const n={...e._meta},r=n.warnings||[];return n.warnings=[...r,t],e._meta=n,e}function dp(e,t){if(!t)return null;const{startTimestamp:n,endTimestamp:r,url:s,method:i,statusCode:o,request:a,response:c}=t;return{type:e,start:n/1e3,end:r/1e3,name:s,data:{method:i,statusCode:o,request:a,response:c}}}function hp(e){return{headers:{},size:e,_meta:{warnings:["URL_SKIPPED"]}}}function pp(e,t,n){if(!t&&0===Object.keys(e).length)return;if(!t)return{headers:e};if(!n)return{headers:e,size:t};const r={headers:e,size:t},{body:s,warnings:i}=function(e){if(!e||"string"!=typeof e)return{body:e};const t=e.length>tu,n=function(e){const t=e[0],n=e[e.length-1];return"["===t&&"]"===n||"{"===t&&"}"===n}(e);if(t){const t=e.slice(0,tu);return n?{body:t,warnings:["MAYBE_JSON_TRUNCATED"]}:{body:`${t}â¦`,warnings:["TEXT_TRUNCATED"]}}if(n)try{return{body:JSON.parse(e)}}catch{}return{body:e}}(n);return r.body=s,i?.length&&(r._meta={warnings:i}),r}function fp(e,t){return Object.entries(e).reduce((n,[r,s])=>{const i=r.toLowerCase();return t.includes(i)&&e[r]&&(n[i]=s),n},{})}function mp(e,t){const n=function(e,t=Ql.document.baseURI){if(e.startsWith("http://")||e.startsWith("https://")||e.startsWith(Ql.location.origin))return e;const n=new URL(e,t);if(n.origin!==new URL(t).origin)return e;const r=n.href;return!e.endsWith("/")&&r.endsWith("/")?r.slice(0,-1):r}(e);return de(n,t)}function gp(e,t){const n={};return t.forEach(t=>{e.get(t)&&(n[t]=e.get(t))}),n}function yp(e,t){if(!e)return{};const n=e.headers;return n?n instanceof Headers?gp(n,t):Array.isArray(n)?{}:fp(n,t):{}}
1function vp(e){const t=Ge();try{const{networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o}=e.getOptions(),a={replay:e,networkDetailAllowUrls:n,networkDetailDenyUrls:r,networkCaptureBodies:s,networkRequestHeaders:i,networkResponseHeaders:o};t&&t.on("beforeAddBreadcrumb",(e,t)=>function(e,t,n){if(t.data)try{(function(e){return"xhr"===e.category})(t)&&function(e){return e?.xhr}(n)&&(function(e,t){const{xhr:n,input:r}=t;if(!n)return;const s=cp(r),i=n.getResponseHeader("content-length")?lp(n.getResponseHeader("content-length")):function(e,t){try{return cp("json"===t&&e&&"object"==typeof e?JSON.stringify(e):e)}catch{return}}(n.response,n.responseType);void 0!==s&&(e.data.request_body_size=s),void 0!==i&&(e.data.response_body_size=i)}(t,n),async function(e,t,n){try{const r=function(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r,input:o,xhr:a}=t,{url:c,method:l,status_code:u=0,request_body_size:d,response_body_size:h}=e.data;if(!c)return null;if(!a||!mp(c,n.networkDetailAllowUrls)||mp(c,n.networkDetailDenyUrls))return{startTimestamp:s,endTimestamp:i,url:c,method:l,statusCode:u,request:hp(d),response:hp(h)};const p=a[qi],f=p?fp(p.request_headers,n.networkRequestHeaders):{},m=fp(nl(a),n.networkResponseHeaders),[g,y]=n.networkCaptureBodies?el(o,$h):[void 0],[v,_]=n.networkCaptureBodies?function(e){const t=[];try{return[e.responseText]}catch(e){t.push(e)}try{return function(e,t){try{if("string"==typeof e)return[e];if(e instanceof Document)return[e.body.outerHTML];if("json"===t&&e&&"object"==typeof e)return[JSON.stringify(e)];if(!e)return[void 0]}catch(t){return Nh&&$h.exception(t,"Failed to serialize body",e),[void 0,"BODY_PARSE_ERROR"]}return Nh&&$h.log("Skipping network body because of body type",e),[void 0,"UNPARSEABLE_BODY_TYPE"]}(e.response,e.responseType)}catch(e){t.push(e)}return Nh&&$h.warn("Failed to get xhr response body",...t),[void 0]}(a):[void 0],b=pp(f,d,g),S=pp(m,h,v);return{startTimestamp:s,endTimestamp:i,url:c,method:l,statusCode:u,request:y?up(b,y):b,response:_?up(S,_):S}}(e,t,n),s=dp("resource.xhr",r);ap(n.replay,s)}catch(e){Nh&&$h.exception(e,"Failed to capture xhr breadcrumb")}}(t,n,e)),function(e){return"fetch"===e.category}(t)&&function(e){return e?.response}(n)&&(function(e,t){const{input:n,response:r}=t,s=cp(n?tl(n):void 0),i=r?lp(r.headers.get("content-length")):void 0;void 0!==s&&(e.data.request_body_size=s),void 0!==i&&(e.data.response_body_size=i)}(t,n),async function(e,t,n){try{const r=await async function(e,t,n){const r=Date.now(),{startTimestamp:s=r,endTimestamp:i=r}=t,{url:o,method:a,status_code:c=0,request_body_size:l,response_body_size:u}=e.data,d=mp(o,n.networkDetailAllowUrls)&&!mp(o,n.networkDetailDenyUrls),h=d?function({networkCaptureBodies:e,networkRequestHeaders:t},n,r){const s=n?(o=t,1===(i=n).length&&"string"!=typeof i[0]?yp(i[0],o):2===i.length?yp(i[1],o):{}):{};var i,o;if(!e)return pp(s,r,void 0);const a=tl(n),[c,l]=el(a,$h),u=pp(s,r,c);return l?up(u,l):u}(n,t.input,l):hp(l),p=await async function(e,{networkCaptureBodies:t,networkResponseHeaders:n},r,s){if(!e&&void 0!==s)return hp(s);const i=r?gp(r.headers,n):{};if(!r||!t&&void 0!==s)return pp(i,s,void 0);const[o,a]=await async function(e){const t=function(e){try{return e.clone()}catch(e){Nh&&$h.exception(e,"Failed to clone response body")}}(e);if(!t)return[void 0,"BODY_PARSE_ERROR"];try{const e=await function(e){return new Promise((t,n)=>{const r=Jo(()=>n(new Error("Timeout while trying to read response body")),500);(async function(e){return await e.text()})(e).then(e=>t(e),e=>n(e)).finally(()=>clearTimeout(r))})}(t);return[e]}catch(e){return e instanceof Error&&e.message.indexOf("Timeout")>-1?(Nh&&$h.warn("Parsing text body from response timed out"),[void 0,"BODY_PARSE_TIMEOUT"]):(Nh&&$h.exception(e,"Failed to get text body from response"),[void 0,"BODY_PARSE_ERROR"])}}(r),c=function(e,{networkCaptureBodies:t,responseBodySize:n,captureDetails:r,headers:s}){try{const i=e?.length&&void 0===n?cp(e):n;return r?pp(s,i,t?e:void 0):hp(i)}catch(e){return Nh&&$h.exception(e,"Failed to serialize response body"),pp(s,n,void 0)}}(o,{networkCaptureBodies:t,responseBodySize:s,captureDetails:e,headers:i});return a?up(c,a):c}(d,n,t.response,u);return{startTimestamp:s,endTimestamp:i,url:o,method:a,statusCode:c,request:h,response:p}}
1(e,t,n),s=dp("resource.fetch",r);ap(n.replay,s)}catch(e){Nh&&$h.exception(e,"Failed to capture fetch breadcrumb")}}(t,n,e))}catch(e){Nh&&$h.exception(e,"Error when enriching network breadcrumb")}}(a,e,t))}catch{}}function _p(e){const{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}=e,s=Date.now()/1e3;return{type:"memory",name:"memory",start:s,end:s,data:{memory:{jsHeapSizeLimit:t,totalJSHeapSize:n,usedJSHeapSize:r}}}}const bp=c.navigator;function Sp(e){let t=!1;return(n,r)=>{if(!e.checkAndHandleExpiredSession())return void(Nh&&$h.warn("Received replay event after session expired."));const s=r||!t;t=!0,e.clickDetector&&function(e,t){try{if(!function(e){return 3===e.type}(t))return;const{source:n}=t.data;if(mh.has(n)&&e.registerMutation(t.timestamp),n===vd.Scroll&&e.registerScroll(t.timestamp),function(e){return e.data.source===vd.MouseInteraction}(t)){const{type:n,id:r}=t.data,s=ih.mirror.getNode(r);s instanceof HTMLElement&&n===_d.Click&&e.registerClick(s)}}catch{}}(e.clickDetector,n),e.addUpdate(()=>{if("buffer"===e.recordingMode&&s&&e.setInitialState(),!Qh(e,n,s))return!0;if(!s)return!1;const t=e.session;if(function(e,t){t&&0===e.session?.segmentId&&Qh(e,function(e){const t=e.getOptions();return{type:yd.Custom,timestamp:Date.now(),data:{tag:"options",payload:{shouldRecordCanvas:e.isRecordingCanvas(),sessionSampleRate:t.sessionSampleRate,errorSampleRate:t.errorSampleRate,useCompressionOption:t.useCompression,blockAllMedia:t.blockAllMedia,maskAllText:t.maskAllText,maskAllInputs:t.maskAllInputs,useCompression:!!e.eventBuffer&&"worker"===e.eventBuffer.type,networkDetailHasUrls:t.networkDetailAllowUrls.length>0,networkCaptureBodies:t.networkCaptureBodies,networkRequestHasHeaders:t.networkRequestHeaders.length>0,networkResponseHasHeaders:t.networkResponseHeaders.length>0}}}}(e),!1)}(e,s),"buffer"===e.recordingMode&&t&&e.eventBuffer&&!t.dirty){const n=e.eventBuffer.getEarliestTimestamp();n&&(Nh&&$h.log(`Updating session start time to earliest event in buffer to ${new Date(n)}`),t.started=n,e.getOptions().stickySession&&qh(t))}return t?.previousSessionId||"session"===e.recordingMode&&e.flush(),!0})}}class wp extends Error{constructor(e){super(`Transport returned status code ${e}`)}}class kp extends Error{constructor(e){super("Rate limit hit"),this.rateLimits=e}}class Tp extends Error{constructor(){super("Session is too long, not sending replay")}}async function Ep(e,t={count:0,interval:5e3}){const{recordingData:n,onError:r}=e;if(n.length)try{return await async function({recordingData:e,replayId:t,segmentId:n,eventContext:r,timestamp:s,session:i}){const o=function({recordingData:e,headers:t}){let n;const r=`${JSON.stringify(t)}\n`;if("string"==typeof e)n=`${r}${e}`;else{const t=(new TextEncoder).encode(r);n=new Uint8Array(t.length+e.length),n.set(t),n.set(e,t.length)}return n}({recordingData:e,headers:{segment_id:n}}),{urls:a,errorIds:c,traceIds:l,initialTimestamp:u}=r,d=Ge(),h=He(),p=d?.getTransport(),f=d?.getDsn();if(!(d&&p&&f&&i.sampled))return Promise.resolve({});const m={type:"replay_event",replay_start_timestamp:u/1e3,timestamp:s/1e3,error_ids:c,trace_ids:l,urls:a,replay_id:t,segment_id:n,replay_type:i.sampled},g=await async function({client:e,scope:t,replayId:n,event:r}){const s={event_id:n,integrations:"object"!=typeof e._integrations||null===e._integrations||Array.isArray(e._integrations)?void 0:Object.keys(e._integrations)};e.emit("preprocessEvent",r,s);const i=await as(e.getOptions(),r,s,t,e,qe());if(!i)return null;e.emit("postprocessEvent",i,s),i.platform=i.platform||"javascript";const o=e.getSdkMetadata(),{name:a,version:c,settings:l}=o?.sdk||{};return i.sdk={...i.sdk,name:a||"sentry.javascript.unknown",version:c||"0.0.0",settings:l},i}({scope:h,client:d,replayId:t,event:m});if(!g)return d.recordDroppedEvent("event_processor","replay"),Nh&&$h.log("An event processor returned `null`, will not send event."),Promise.resolve({});delete g.sdkProcessingMetadata;const y=function(e,t,n,r){return sr(mr(e,fr(e),r,n),[[{type:"replay_event"},e],[{type:"replay_recording",length:"string"==typeof t?(new TextEncoder).encode(t).length:t.length},t]])}(g,o,f,d.getOptions().tunnel);let v;try{v=await p.send(y)}catch(e){const t=new Error(eu);try{t.cause=e}catch{}throw t}const _=Yr({},v);if(Xr(_,"replay"))throw new kp(_);if("number"==typeof v.statusCode&&(v.statusCode<200||v.statusCode>=300))throw new wp(v.statusCode);return v}(e),!0}catch(n){if(n instanceof wp||n instanceof kp)throw n;if(Ws("Replays",{_retryCount:t.count}),r&&r(n),t.count>=3){const e=new Error(`${eu} - max retries exceeded`);try{e.cause=n}catch{}throw e}return t.interval*=++t.count,new Promise((n,r)=>{Jo(async()=>{try{await Ep(e,t),n(!0)}catch(e){r(e)}},t.interval)})}}const xp="__THROTTLED";class Ip{constructor({options:e,recordingOptions:t}){this.eventBuffer=null,this.performanceEntries=[],this.replayPerformanceEntries=[],this.recordingMode="session",this.timeouts={sessionIdlePause:3e5,sessionIdleExpire:9e5},this._lastActivity=Date.now(),this._isEnabled=!1,this._isPaused=!1,this._requiresManualStart=!1,this._hasInitializedCoreListeners=!1,this._context={errorIds:new Set,traceIds:new Set,urls:[],initialTimestamp:Date.now(),initialUrl:""},this._recordingOptions=t,this._options=e,this._debouncedFlush=function(e,t,n){return function(e,t,n){let r,s,i;const o=null!=n&&n.maxWait?Math.max(n.maxWait,t):0,a=(null==n?void 0:n.setTimeoutImpl)||setTimeout;function c(){return l(),r=e(),r}function l(){void 0!==s&&clearTimeout(s),void 0!==i&&clearTimeout(i),s=i=void 0}function u(){return s&&clearTimeout(s),s=a(c,t),o&&void 0===i&&(i=a(c,o)),r}return u.cancel=l,u.flush=function(){return void 0!==s||void 0!==i?c():r},u}(e,t,{...n,setTimeoutImpl:Jo})}(()=>this._flush(),this._options.flushMinDelay,{maxWait:this._options.flushMaxDelay}),this._throttledAddEvent=function(e,t,n){const r=new Map;let s=!1;return(...i)=>{const o=Math.floor(Date.now()/1e3);if((e=>{const t=e-n;r.forEach((e,n)=>{n<t&&r.delete(n)})})(o),[...r.values()].reduce((e,t)=>
1e+t,0)>=t){const e=s;return s=!0,e?"__SKIPPED":xp}s=!1;const a=r.get(o)||0;return r.set(o,a+1),e(...i)}}((e,t)=>function(e,t,n){return ep(e,t)?Zh(e,t,n):Promise.resolve(null)}(this,e,t),300,5);const{slowClickTimeout:n,slowClickIgnoreSelectors:r}=this.getOptions(),s=n?{threshold:Math.min(3e3,n),timeout:n,scrollTimeout:300,ignoreSelector:r?r.join(","):""}:void 0;if(s&&(this.clickDetector=new gh(this,s)),Nh){const t=e._experiments;$h.setConfig({captureExceptions:!!t.captureExceptions,traceInternals:!!t.traceInternals})}this._handleVisibilityChange=()=>{"visible"===Ql.document.visibilityState?this._doChangeToForegroundTasks():this._doChangeToBackgroundTasks()},this._handleWindowBlur=()=>{const e=_h({category:"ui.blur"});this._doChangeToBackgroundTasks(e)},this._handleWindowFocus=()=>{const e=_h({category:"ui.focus"});this._doChangeToForegroundTasks(e)},this._handleKeyboardEvent=e=>{!function(e,t){if(!e.isEnabled())return;e.updateUserActivity();const n=function(e){const{metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i,target:o}=e;if(!o||function(e){return"INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable}(o)||!i)return null;const a=t||r||s,c=1===i.length;if(!a&&c)return null;const l=C(o,{maxStringLength:200})||"<unknown>";return _h({category:"ui.keyDown",message:l,data:{...kh(o,l).data,metaKey:t,shiftKey:n,ctrlKey:r,altKey:s,key:i}})}(t);n&&uh(e,n)}(this,e)}}getContext(){return this._context}isEnabled(){return this._isEnabled}isPaused(){return this._isPaused}isRecordingCanvas(){return Boolean(this._canvas)}getOptions(){return this._options}handleException(e){Nh&&$h.exception(e),this._options.onError&&this._options.onError(e)}initializeSampling(e){const{errorSampleRate:t,sessionSampleRate:n}=this._options,r=t<=0&&n<=0;this._requiresManualStart=r,r||(this._initializeSessionForSampling(e),this.session?!1!==this.session.sampled&&(this.recordingMode="buffer"===this.session.sampled&&0===this.session.segmentId?"buffer":"session",Nh&&$h.infoTick(`Starting replay in ${this.recordingMode} mode`),this._initializeRecording()):Nh&&$h.exception(new Error("Unable to initialize and create session")))}start(){if(this._isEnabled&&"session"===this.recordingMode)return void(Nh&&$h.log("Recording is already in progress"));if(this._isEnabled&&"buffer"===this.recordingMode)return void(Nh&&$h.log("Buffering is in progress, call `flush()` to save the replay"));Nh&&$h.infoTick("Starting replay in session mode"),this._updateUserActivity();const e=Yh({maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire},{stickySession:this._options.stickySession,sessionSampleRate:1,allowBuffering:!1});this.session=e,this.recordingMode="session",this._initializeRecording()}startBuffering(){if(this._isEnabled)return void(Nh&&$h.log("Buffering is in progress, call `flush()` to save the replay"));Nh&&$h.infoTick("Starting replay in buffer mode");const e=Yh({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration},{stickySession:this._options.stickySession,sessionSampleRate:0,allowBuffering:!0});this.session=e,this.recordingMode="buffer",this._initializeRecording()}startRecording(){try{const e=this._canvas;this._stopRecording=ih({...this._recordingOptions,..."buffer"===this.recordingMode?{checkoutEveryNms:6e4}:this._options._experiments.continuousCheckout&&{checkoutEveryNms:Math.max(36e4,this._options._experiments.continuousCheckout)},emit:Sp(this),.../iPhone|iPad|iPod/i.test(bp?.userAgent??"")||/Macintosh/i.test(bp?.userAgent??"")&&bp?.maxTouchPoints&&bp?.maxTouchPoints>1?{sampling:{mousemove:!1}}:{},onMutation:this._onMutationHandler.bind(this),...e?{recordCanvas:e.recordCanvas,getCanvasManager:e.getCanvasManager,sampling:e.sampling,dataURLOptions:e.dataURLOptions}:{}})}catch(e){this.handleException(e)}}stopRecording(){try{return this._stopRecording&&(this._stopRecording(),this._stopRecording=void 0),!0}catch(e){return this.handleException(e),!1}}async stop({forceFlush:e=!1,reason:t}={}){if(this._isEnabled){this._isEnabled=!1,this.recordingMode="buffer";try{Nh&&$h.log("Stopping Replay"+(t?` triggered by ${t}`:"")),ip(),this._removeListeners(),this.stopRecording(),this._debouncedFlush.cancel(),e&&await this._flush({force:!0}),this.eventBuffer?.destroy(),this.eventBuffer=null,n=this,function(){if(Wh())try{Ql.sessionStorage.removeItem(Zl)}catch{}}(),n.session=void 0}catch(e){this.handleException(e)}}var n}pause(){this._isPaused||(this._isPaused=!0,this.stopRecording(),Nh&&$h.log("Pausing replay"))}resume(){this._isPaused&&this._checkSession()&&(this._isPaused=!1,this.startRecording(),Nh&&$h.log("Resuming replay"))}async sendBufferedReplayOrFlush({continueRecording:e=!0}={}){if("session"===this.recordingMode)return this.flushImmediate();const t=Date.now();Nh&&$h.log("Converting buffer to session"),await this.flushImmediate();const n=this.stopRecording();e&&n&&"session"!==this.recordingMode&&(this.recordingMode="session",this.session&&(this.session.dirty=!1,this._updateUserActivity(t),this._updateSessionActivity(t),this._maybeSaveSession()),this.startRecording())}addUpdate(e){const t=e();"buffer"!==this.recordingMode&&this._isEnabled&&!0!==t&&this._debouncedFlush()}triggerUserActivity(){if(this._updateUserActivity(),this._stopRecording)this.checkAndHandleExpiredSession(),this._updateSessionActivity();else{if(!this._checkSession())return;this.resume()}}updateUserActivity(){this._updateUserActivity(),this._updateSessionActivity()}conditionalFlush(){return"buffer"===this.recordingMode?Promise.resolve():this.flushImmediate()}flush(){return this._debouncedFlush()}flushImmediate(){return this._debouncedFlush(),this._debouncedFlush.flush()}cancelFlush(){this._debouncedFlush.cancel()}getSessionId(e){if(!e||!1!==this.session?.sampled)return this.session?.id}
1checkAndHandleExpiredSession(){if(!this._lastActivity||!Kh(this._lastActivity,this.timeouts.sessionIdlePause)||"session"!==this.session?.sampled)return!!this._checkSession();this.pause()}setInitialState(){const e=`${Ql.location.pathname}${Ql.location.hash}${Ql.location.search}`,t=`${Ql.location.origin}${e}`;this.performanceEntries=[],this.replayPerformanceEntries=[],this._clearContext(),this._context.initialUrl=t,this._context.initialTimestamp=Date.now(),this._context.urls.push(t)}throttledAddEvent(e,t){const n=this._throttledAddEvent(e,t);if(n===xp){const e=_h({category:"replay.throttled"});this.addUpdate(()=>!Qh(this,{type:5,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e,metric:!0}}))}return n}getCurrentRoute(){const e=this.lastActiveSpan||Hn(),t=e&&zn(e),n=(t&&An(t).data||{})[dt];if(t&&n&&["route","custom"].includes(n))return An(t).description}_initializeRecording(){this.setInitialState(),this._updateSessionActivity(),this.eventBuffer=function({useCompression:e,workerUrl:t}){if(e&&window.Worker){const e=function(e){try{const t=e||("undefined"!=typeof __SENTRY_EXCLUDE_REPLAY_WORKER__&&__SENTRY_EXCLUDE_REPLAY_WORKER__?"":function(){const e=new Blob(['
vendor: 10,329 bytes, line 1
1var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),s=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),a=function(t,e){for(var i=new n(31),s=0;s<31;++s)i[s]=e+=1<<t[s-1];var a=new r(i[30]);for(s=1;s<30;++s)for(var o=i[s];o<i[s+1];++o)a[o]=o-i[s]<<5|s;return{b:i,r:a}},o=a(e,2),h=o.b,f=o.r;h[28]=258,f[258]=28;for(var l=a(i,0).r,u=new n(32768),c=0;c<32768;++c){var v=(43690&c)>>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,s=0,a=new n(r);s<i;++s)t[s]&&++a[t[s]-1];var o,h=new n(r);for(s=1;s<r;++s)h[s]=h[s-1]+a[s-1]<<1;if(e){o=new n(1<<r);var f=15-r;for(s=0;s<i;++s)if(t[s])for(var l=s<<4|t[s],c=r-t[s],v=h[t[s]-1]++<<c,d=v|(1<<c)-1;v<=d;++v)o[u[v]>>f]=l}else for(o=new n(i),s=0;s<i;++s)t[s]&&(o[s]=u[h[t[s]-1]++]>>15-t[s]);return o},p=new t(288);for(c=0;c<144;++c)p[c]=8;for(c=144;c<256;++c)p[c]=9;for(c=256;c<280;++c)p[c]=7;for(c=280;c<288;++c)p[c]=8;var g=new t(32);for(c=0;c<32;++c)g[c]=5;var w=d(p,9,0),y=d(g,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=["unexpected EOF","invalid block type","invalid length/literal","invalid distance","stream finished","no stream handler",,"no callback","invalid UTF-8 data","extra field too long","date not in range 1980-2099","filename too long","stream finishing","invalid zip data"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},_=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},x=function(r,e){for(var i=[],s=0;s<r.length;++s)r[s]&&i.push({s:s,f:r[s]});var a=i.length,o=i.slice();if(!a)return{t:F,l:0};if(1==a){var h=new t(i[0].s+1);return h[i[0].s]=1,{t:h,l:1}}i.sort(function(t,n){return t.f-n.f}),i.push({s:-1,f:25001});var f=i[0],l=i[1],u=0,c=1,v=2;for(i[0]={s:-1,f:f.f+l.f,l:f,r:l};c!=a-1;)f=i[i[u].f<i[v].f?u++:v++],l=i[u!=c&&i[u].f<i[v].f?u++:v++],i[c++]={s:-1,f:f.f+l.f,l:f,r:l};var d=o[0].s;for(s=1;s<a;++s)o[s].s>d&&(d=o[s].s);var p=new n(d+1),g=A(i[c-1],p,0);if(g>e){s=0;var w=0,y=g-e,m=1<<y;for(o.sort(function(t,n){return p[n.s]-p[t.s]||t.f-n.f});s<a;++s){var b=o[s].s;if(!(p[b]>e))break;w+=m-(1<<g-p[b]),p[b]=e}for(w>>=y;w>0;){var M=o[s].s;p[M]<e?w-=1<<e-p[M]++-1:++s}for(;s>=0&&w;--s){var E=o[s].s;p[E]==e&&(--p[E],++w)}g=e}return{t:new t(p),l:g}},A=function(t,n,r){return-1==t.s?Math.max(A(t.l,n,r+1),A(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,s=t[0],a=1,o=function(t){e[i++]=t},h=1;h<=r;++h)if(t[h]==s&&h!=r)++a;else{if(!s&&a>2){for(;a>138;a-=138)o(32754);a>2&&(o(a>10?a-11<<5|28690:a-3<<5|12305),a=0)}else if(a>3){for(o(s),--a;a>6;a-=6)o(8304);a>2&&(o(a-3<<5|8208),a=0)}for(;a--;)o(s);a=1,s=t[h]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e<n.length;++e)r+=t[e]*n[e];return r},k=function(t,n,r){var e=r.length,i=m(n+2);t[i]=255&e,t[i+1]=e>>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var s=0;s<e;++s)t[i+s+4]=r[s];return 8*(i+4+e)},U=function(t,r,a,o,h,f,l,u,c,v,m){z(r,m++,a),++h[256];for(var b=x(h,15),M=b.t,E=b.l,A=x(f,15),U=A.t,C=A.l,F=D(M),I=F.c,S=F.n,L=D(U),O=L.c,j=L.n,q=new n(19),B=0;B<I.length;++B)++q[31&I[B]];for(B=0;B<O.length;++B)++q[31&O[B]];for(var G=x(q,7),H=G.t,J=G.l,K=19;K>4&&!H[s[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(h,p)+T(f,g)+l,X=T(h,M)+T(f,U)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X<W)),m+=2,X<W){N=d(M,E,0),P=M,Q=d(U,C,0),R=U;var Y=d(H,J,0);z(r,m,S-257),z(r,m+5,j-1),z(r,m+10,K-4),m+=14;for(B=0;B<K;++B)z(r,m+3*B,H[s[B]]);m+=3*K;for(var Z=[I,O],$=0;$<2;++$){var tt=Z[$];for(B=0;B<tt.length;++B){var nt=31&tt[B];z(r,m,Y[nt]),m+=H[nt],nt>15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=w,P=p,Q=y,R=g;for(B=0;B<u;++B){var rt=o[B];if(rt>255){_(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;_(r,m,Q[et]),m+=R[et],et>3&&(_(r,m,rt>>5&8191),m+=i[et])}else _(r,m,N[rt]),m+=P[rt]}return _(r,m,N[256]),m+P[256]},C=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,s=0|r.length,a=0;a!=s;){for(var o=Math.min(a+2655,s);a<o;++a)i+=e+=r[a];e=(65535&e)+15*(e>>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(s,a,o,h,u){if(!u&&(u={l:1},a.dictionary)){var c=a.dictionary.subarray(-32768),v=new t(c.length+s.length);v.set(c),v.set(s,c.length),s=v,u.w=c.length}return function(s,a,o,h,u,c){var v=c.z||s.length,d=new t(h+v+5*(1+Math.ceil(v/7e3))+u),p=d.subarray(h,d.length-u),g=c.l,w=7&(c.r||0);if(a){w&&(p[0]=c.r>>3);for(var y=C[a-1],M=y>>13,E=8191&y,z=(1<<o)-1,_=c.p||new n(32768),x=c.h||new n(z+1),A=Math.ceil(o/3),D=2*A,T=function(t){return(s[t]^s[t+1]<<A^s[t+2]<<D)&z},F=new r(25e3),I=new n(288),S=new n(32),L=0,O=0,j=c.i||0,q=0,B=c.w||0,G=0;j+2<v;++j){var H=T(j),J=32767&j,K=x[H];if(_[J]=K,x[H]=J,B<=j){var N=v-j;if((L>7e3||q>24576)&&(N>423||!g)){w=U(s,p,0,F,I,S,O,q,G,j-G,w),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(s[j+Q]==s[j+Q-W]){for(var $=0;$<Z&&s[j+$]==s[j+$-W];++$);if($>Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;P<tt;++P){var rt=j-W+P&32767,et=rt-_[rt]&32767;et>nt&&(nt=et,K=rt)}}}W+=(J=K)-(K=_[J])&32767}if(R){F[q++]=268435456|f[Q]<<18|l[R];var it=31&f[Q],st=31&l[R];O+=e[it]+i[st],++I[257+it],++S[st],B=j+Q,++L}else F[q++]=s[j],++I[s[j]]}}for(j=Math.max(j,B);j<v;++j)F[q++]=s[j],++I[s[j]];w=U(s,p,g,F,I,S,O,q,G,j-G,w),g||(c.r=7&w|p[w/8|0]<<3,w-=7,c.h=x,c.p=_,c.i=j,c.w=B)}else{for(j=c.w||0;j<v+g;j+=65535){var at=j+65535;at>=v&&(p[w/8|0]=g,at=v),w=k(p,w+1,s.subarray(j,at))}c.i=v}return b(d,0,h+m(w)+u)}(s,null==a.level?6:a.level,null==a.mem?u.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(s.length)))):20:12+a.mem,o,h,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if("function"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var s=this.b.length-this.s.z;this.b.set(n.subarray(0,s),this.s.z),this.s.z=this.b.length,this.p(this.b,!1),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(s),32768),this.s.z=n.length-s+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n.prototype.flush=function(){this.ondata||E(5),this.s.l&&E(4),this.p(this.b,!1),this.s.w=this.s.i,this.s.i-=2},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e<n.length;++e)r=I[255&r^n[e]]^r>>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,s=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),a=s.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(s,n),O(s,a-8,r.d()),O(s,a-4,e),s}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t.prototype.flush=function(){j.prototype.flush.call(this)},t}(),G="undefined"!=typeof TextEncoder&&new TextEncoder,H="undefined"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(G)return G.encode(n);for(var e=n.length,i=new t(n.length+(n.length>>1)),s=0,a=function(t){i[s++]=t},o=0;o<e;++o){if(s+5>i.length){var h=new t(s+8+(e-o<<1));h.set(i),i=h}var f=n.charCodeAt(o);f<128||r?a(f):f<2048?(a(192|f>>6),a(128|63&f)):f>55295&&f<57344?(a(240|(f=65536+(1047552&f)|1023&n.charCodeAt(++o))>>18),a(128|f>>12&63),a(128|f>>6&63),a(128|63&f)):(a(224|f>>12),a(128|f>>6&63),a(128|63&f))}return b(i,0,s)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error("Adding invalid event");const n=this._hasEvents?",":"";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push("]",!0);const t=function(t){let n=0;for(const r of t)n+=r.length;const r=new Uint8Array(n);for(let n=0,e=0,i=t.length;n<i;n++){const i=t[n];r.set(i,e),e+=i.length}return r}(this._deflatedData);return this._init(),t}_init(){this._hasEvents=!1,this._deflatedData=[],this.deflate=new B,this.deflate.ondata=(t,n)=>{this._deflatedData.push(t)},this.stream=new J((t,n)=>{this.deflate.push(t,n)}),this.stream.push("[")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener("message",function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&"function"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}}),postMessage({id:void 0,method:"init",success:!0,response:void 0});
1']);return URL.createObjectURL(e)}());if(!t)return;Nh&&$h.log("Using compression worker"+(e?` from ${e}`:""));const n=new Worker(t);return new zh(n)}catch(e){Nh&&$h.exception(e,"Failed to create compression worker")}}(t);if(e)return e}return Nh&&$h.log("Using simple buffer"),new Bh}({useCompression:this._options.useCompression,workerUrl:this._options.workerUrl}),this._removeListeners(),this._addListeners(),this._isEnabled=!0,this._isPaused=!1,this.startRecording()}_initializeSessionForSampling(e){const t=this._options.errorSampleRate>0,n=Yh({sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration,previousSessionId:e},{stickySession:this._options.stickySession,sessionSampleRate:this._options.sessionSampleRate,allowBuffering:t});this.session=n}_checkSession(){if(!this.session)return!1;const e=this.session;return!Xh(e,{sessionIdleExpire:this.timeouts.sessionIdleExpire,maxReplayDuration:this._options.maxReplayDuration})||(this._refreshSession(e),!1)}async _refreshSession(e){this._isEnabled&&(await this.stop({reason:"refresh session"}),this.initializeSampling(e.id))}_addListeners(){try{Ql.document.addEventListener("visibilitychange",this._handleVisibilityChange),Ql.addEventListener("blur",this._handleWindowBlur),Ql.addEventListener("focus",this._handleWindowFocus),Ql.addEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.addListeners(),this._hasInitializedCoreListeners||(function(e){const t=Ge(
1);zi((e=>t=>{if(!e.isEnabled())return;const n=function(e){const{target:t,message:n}=function(e){const t="click"===e.name;let n,r=null;try{r=t?hh(e.event):ph(e.event),n=C(r,{maxStringLength:200})||"<unknown>"}catch{n="<unknown>"}return{target:r,message:n}}(e);return _h({category:`ui.${e.name}`,...kh(t,n)})}(t);if(!n)return;const r="click"===t.name,s=r?t.event:void 0;var i,o,a;!(r&&e.clickDetector&&s?.target)||s.altKey||s.metaKey||s.ctrlKey||s.shiftKey||(i=e.clickDetector,o=n,a=hh(t.event),i.handleClick(o,a)),uh(e,n)})(e)),Gi(function(e){return t=>{if(!e.isEnabled())return;const n=function(e){const{from:t,to:n}=e,r=Date.now()/1e3;return{type:"navigation.push",start:r,end:r,name:n,data:{previous:t}}}(t);null!==n&&(e.getContext().urls.push(n.name),e.triggerUserActivity(),e.addUpdate(()=>(op(e,[n]),!1)))}}(e)),function(e){const t=Ge();t&&t.on("beforeAddBreadcrumb",t=>function(e,t){if(!e.isEnabled()||!sp(t))return;const n=function(e){return!sp(e)||["fetch","xhr","sentry.event","sentry.transaction"].includes(e.category)||e.category.startsWith("ui.")?null:"console"===e.category?function(e){const t=e.data?.arguments;if(!Array.isArray(t)||0===t.length)return _h(e);let n=!1;const r=t.map(e=>{if(!e)return e;if("string"==typeof e)return e.length>nu?(n=!0,`${e.slice(0,nu)}â¦`):e;if("object"==typeof e)try{const t=tr(e,7);return JSON.stringify(t).length>nu?(n=!0,`${JSON.stringify(t,null,2).slice(0,nu)}â¦`):t}catch{}return e});return _h({...e,data:{...e.data,arguments:r,...n?{_meta:{warnings:["CONSOLE_ARG_TRUNCATED"]}}:{}}})}(e):_h(e)}(t);n&&uh(e,n)}(e,t))}(e),vp(e),ti(function(e){return Object.assign((t,n)=>{if(!e.isEnabled()||e.isPaused())return t;if(function(e){return"replay_event"===e.type}(t))return delete t.breadcrumbs,t;if(!tp(t)&&!np(t)&&!rp(t))return t;if(!e.checkAndHandleExpiredSession())return ip(),t;if(rp(t))return e.flush(),t.contexts.feedback.replay_id=e.getSessionId(),function(e,t){e.triggerUserActivity(),e.addUpdate(()=>!t.timestamp||(e.throttledAddEvent({type:yd.Custom,timestamp:1e3*t.timestamp,data:{tag:"breadcrumb",payload:{timestamp:t.timestamp,type:"default",category:"sentry.feedback",data:{feedbackId:t.event_id}}}}),!1))}(e,t),t;if(function(e,t){return!(e.type||!e.exception?.values?.length||!t.originalException?.__rrweb__)}(t,n)&&!e.getOptions()._experiments.captureExceptions)return Nh&&$h.log("Ignoring error from rrweb internals",t),null;const r=function(e,t){return"buffer"===e.recordingMode&&t.message!==eu&&!(!t.exception||t.type)&&Hh(e.getOptions().errorSampleRate)}(e,t);if((r||"session"===e.recordingMode)&&(t.tags={...t.tags,replayId:e.getSessionId()}),r&&"buffer"===e.recordingMode&&"buffer"===e.session?.sampled){const t=e.session;t.dirty=!0,e.getOptions().stickySession&&qh(t)}return t},{id:"Replay"})}(e)),t&&(t.on("beforeSendEvent",function(e){return t=>{e.isEnabled()&&tp(t)&&function(e,t){const n=t.exception?.values?.[0]?.value;"string"==typeof n&&(n.match(/(reactjs\.org\/docs\/error-decoder\.html\?invariant=|react\.dev\/errors\/)(418|419|422|423|425)/)||n.match(/(does not match server-rendered HTML|Hydration failed because)/i))&&uh(e,_h({category:"replay.hydrate-error",data:{url:A()}}))}(e,t)}}(e)),t.on("afterSendEvent",function(e){return(t,n)=>{if(!e.isEnabled()||!tp(t)&&!np(t))return;const r=n.statusCode;!r||r<200||r>=300||(np(t)?function(e,t){const n=e.getContext();t.contexts?.trace?.trace_id&&n.traceIds.size<100&&n.traceIds.add(t.contexts.trace.trace_id)}(e,t):function(e,t){const n=e.getContext();if(t.event_id&&n.errorIds.size<100&&n.errorIds.add(t.event_id),"buffer"!==e.recordingMode||!t.tags?.replayId)return;const{beforeErrorSampling:r}=e.getOptions();("function"!=typeof r||r(t))&&Jo(async()=>{try{await e.sendBufferedReplayOrFlush()}catch(t){e.handleException(t)}})}(e,t))}}(e)),t.on("createDsc",t=>{const n=e.getSessionId();n&&e.isEnabled()&&"session"===e.recordingMode&&e.checkAndHandleExpiredSession()&&(t.replay_id=n)}),t.on("spanStart",t=>{e.lastActiveSpan=t}),t.on("spanEnd",t=>{e.lastActiveSpan=t}),t.on("beforeSendFeedback",async(t,n)=>{const r=e.getSessionId();n?.includeReplay&&e.isEnabled()&&r&&t.contexts?.feedback&&("api"===t.contexts.feedback.source&&await e.sendBufferedReplayOrFlush(),t.contexts.feedback.replay_id=r)}),t.on("openFeedbackWidget",async()=>{await e.sendBufferedReplayOrFlush()}))}(this),this._hasInitializedCoreListeners=!0)}catch(e){this.handleException(e)}this._performanceCleanupCallback=function(e){function t(t){e.performanceEntries.includes(t)||e.performanceEntries.push(t)}function n({entries:e}){e.forEach(t)}const r=[];
1return["navigation","paint","resource"].forEach(e=>{r.push(gc(e,n))}),r.push(fc(Eh(Ch,e)),pc(Eh(Ah,e)),mc(Eh(Mh,e))),()=>{r.forEach(e=>e())}}(this)}_removeListeners(){try{Ql.document.removeEventListener("visibilitychange",this._handleVisibilityChange),Ql.removeEventListener("blur",this._handleWindowBlur),Ql.removeEventListener("focus",this._handleWindowFocus),Ql.removeEventListener("keydown",this._handleKeyboardEvent),this.clickDetector&&this.clickDetector.removeListeners(),this._performanceCleanupCallback&&this._performanceCleanupCallback()}catch(e){this.handleException(e)}}_doChangeToBackgroundTasks(e){this.session&&(Gh(this.session,{maxReplayDuration:this._options.maxReplayDuration,sessionIdleExpire:this.timeouts.sessionIdleExpire})||(e&&this._createCustomBreadcrumb(e),this.conditionalFlush()))}_doChangeToForegroundTasks(e){this.session&&(this.checkAndHandleExpiredSession()?e&&this._createCustomBreadcrumb(e):Nh&&$h.log("Document has become active, but session has expired"))}_updateUserActivity(e=Date.now()){this._lastActivity=e}_updateSessionActivity(e=Date.now()){this.session&&(this.session.lastActivity=e,this._maybeSaveSession())}_createCustomBreadcrumb(e){this.addUpdate(()=>{this.throttledAddEvent({type:yd.Custom,timestamp:e.timestamp||0,data:{tag:"breadcrumb",payload:e}})})}_addPerformanceEntries(){let e=(t=this.performanceEntries,t.map(xh).filter(Boolean)).concat(this.replayPerformanceEntries);var t;if(this.performanceEntries=[],this.replayPerformanceEntries=[],this._requiresManualStart){const t=this._context.initialTimestamp/1e3;e=e.filter(e=>e.start>=t)}return Promise.all(op(this,e))}_clearContext(){this._context.errorIds.clear(),this._context.traceIds.clear(),this._context.urls=[]}_updateInitialTimestampFromEventBuffer(){const{session:e,eventBuffer:t}=this;if(!e||!t||this._requiresManualStart)return;if(e.segmentId)return;const n=t.getEarliestTimestamp();n&&n<this._context.initialTimestamp&&(this._context.initialTimestamp=n)}_popEventContext(){const e={initialTimestamp:this._context.initialTimestamp,initialUrl:this._context.initialUrl,errorIds:Array.from(this._context.errorIds),traceIds:Array.from(this._context.traceIds),urls:this._context.urls};return this._clearContext(),e}async _runFlush(){const e=this.getSessionId();if(this.session&&this.eventBuffer&&e){if(await this._addPerformanceEntries(),this.eventBuffer?.hasEvents&&(await async function(e){try{return Promise.all(op(e,[_p(Ql.performance.memory)]))}catch{return[]}}(this),this.eventBuffer&&e===this.getSessionId()))try{this._updateInitialTimestampFromEventBuffer();const t=Date.now();if(t-this._context.initialTimestamp>this._options.maxReplayDuration+3e4)throw new Tp;const n=this._popEventContext(),r=this.session.segmentId++;this._maybeSaveSession();const s=await this.eventBuffer.finish();await Ep({replayId:e,recordingData:s,segmentId:r,eventContext:n,session:this.session,timestamp:t,onError:e=>this.handleException(e)})}catch(e){this.handleException(e),this.stop({reason:"sendReplay"});
1const t=Ge();if(t){let n;n=e instanceof kp?"ratelimit_backoff":e instanceof Tp?"invalid":"send_error",t.recordDroppedEvent(n,"replay")}}}else Nh&&$h.error("No session or eventBuffer found to flush.")}async _flush({force:e=!1}={}){if(!this._isEnabled&&!e)return;if(!this.checkAndHandleExpiredSession())return void(Nh&&$h.error("Attempting to finish replay event after session expired."));if(!this.session)return;const t=this.session.started,n=Date.now()-t;this._debouncedFlush.cancel();const r=n<this._options.minReplayDuration,s=n>this._options.maxReplayDuration+5e3;if(r||s)return Nh&&$h.log(`Session duration (${Math.floor(n/1e3)}s) is too ${r?"short":"long"}, not sending replay.`),void(r&&this._debouncedFlush());const i=this.eventBuffer;i&&0===this.session.segmentId&&!i.hasCheckout&&Nh&&$h.log("Flushing initial segment without checkout.");const o=!!this._flushLock;this._flushLock||(this._flushLock=this._runFlush());try{await this._flushLock}catch(e){this.handleException(e)}finally{this._flushLock=void 0,o&&this._debouncedFlush()}}_maybeSaveSession(){this.session&&this._options.stickySession&&qh(this.session)}_onMutationHandler(e){const{ignoreMutations:t}=this._options._experiments;if(t?.length&&e.some(e=>{const n=function(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch{return null}}(e.target),r=t.join(",");return n?.matches(r)}))return!1;const n=e.length,r=this._options.mutationLimit,s=r&&n>r;if(n>this._options.mutationBreadcrumbLimit||s){const e=_h({category:"replay.mutations",data:{count:n,limit:s}});this._createCustomBreadcrumb(e)}return!s||(this.stop({reason:"mutationLimit",forceFlush:"session"===this.recordingMode}),!1)}}function Cp(e,t){return[...e,...t].join(",")}const Op='img,image,svg,video,object,picture,embed,map,audio,link[rel="icon"],link[rel="apple-touch-icon"]',Ap=["content-length","content-type","accept"],Mp=Symbol.for("sentry__originalRequestBody");let Rp=!1,Np=!1;const Pp=e=>new Lp(e);class Lp{constructor({flushMinDelay:e=5e3,flushMaxDelay:t=5500,minReplayDuration:n=4999,maxReplayDuration:r=36e5,stickySession:s=!0,useCompression:i=!0,workerUrl:o,_experiments:a={},maskAllText:c=!0,maskAllInputs:l=!0,blockAllMedia:u=!0,mutationBreadcrumbLimit:d=750,mutationLimit:h=1e4,slowClickTimeout:p=7e3,slowClickIgnoreSelectors:f=[],networkDetailAllowUrls:m=[],networkDetailDenyUrls:g=[],networkCaptureBodies:y=!0,networkRequestHeaders:v=[],networkResponseHeaders:_=[],mask:b=[],maskAttributes:S=["title","placeholder","aria-label"],unmask:w=[],block:k=[],unblock:T=[],ignore:E=[],maskFn:x,beforeAddRecordingEvent:I,beforeErrorSampling:C,onError:O,attachRawBodyFromRequest:A=!1}={}){this.name="Replay";const M=function({mask:e,unmask:t,block:n,unblock:r,ignore:s}){return{maskTextSelector:Cp(e,[".sentry-mask","[data-sentry-mask]"]),unmaskTextSelector:Cp(t,[]),blockSelector:Cp(n,[".sentry-block","[data-sentry-block]","base","iframe[srcdoc]:not([src])"]),unblockSelector:Cp(r,[]),ignoreSelector:Cp(s,[".sentry-ignore","[data-sentry-ignore]",'input[type="file"]'])}}({mask:b,unmask:w,block:k,unblock:T,ignore:E});if(this._recordingOptions={maskAllInputs:l,maskAllText:c,maskInputOptions:{password:!0},maskTextFn:x,maskInputFn:x,maskAttributeFn:(e,t,n)=>function({el:e,key:t,maskAttributes:n,maskAllText:r,privacyOptions:s,value:i}){return r?s.unmaskTextSelector&&e.matches(s.unmaskTextSelector)?i:n.includes(t)||"value"===t&&"INPUT"===e.tagName&&["submit","button"].includes(e.getAttribute("type")||"")?i.replace(/[\S]/g,"*"):i:i}({maskAttributes:S,maskAllText:c,privacyOptions:M,key:e,value:t,el:n}),...M,slimDOMOptions:"all",inlineStylesheet:!0,inlineImages:!1,collectFonts:!0,errorHandler:e=>{try{e.__rrweb__=!0}catch{}},recordCrossOriginIframes:Boolean(a.recordCrossOriginIframes)},this._initialOptions={flushMinDelay:e,flushMaxDelay:t,minReplayDuration:Math.min(n,5e4),maxReplayDuration:Math.min(r,3
16e5),stickySession:s,useCompression:i,workerUrl:o,blockAllMedia:u,maskAllInputs:l,maskAllText:c,mutationBreadcrumbLimit:d,mutationLimit:h,slowClickTimeout:p,slowClickIgnoreSelectors:f,networkDetailAllowUrls:m,networkDetailDenyUrls:g,networkCaptureBodies:y,networkRequestHeaders:Dp(v),networkResponseHeaders:Dp(_),beforeAddRecordingEvent:I,beforeErrorSampling:C,onError:O,attachRawBodyFromRequest:A,_experiments:a},this._initialOptions.blockAllMedia&&(this._recordingOptions.blockSelector=this._recordingOptions.blockSelector?`${this._recordingOptions.blockSelector},${Op}`:Op,this._recordingOptions.ignoreCSSAttributes=new Set(["background-image"])),this._isInitialized&&Fc())throw new Error("Multiple Sentry Session Replay instances are not supported");this._isInitialized=!0}get _isInitialized(){return Rp}set _isInitialized(e){Rp=e}afterAllSetup(e){Fc()&&!this._replay&&(this._initialOptions.attachRawBodyFromRequest&&function(){if("undefined"==typeof Request||Np)return;const e=Request;try{const t=function(t,n){const r=new e(t,n);return null!=n?.body&&(r[Mp]=n.body),r};t.prototype=e.prototype,c.Request=t,Np=!0}catch{}}(),this._setup(e),this._initialize(e))}start(){this._replay&&this._replay.start()}startBuffering(){this._replay&&this._replay.startBuffering()}stop(){return this._replay?this._replay.stop({forceFlush:"session"===this._replay.recordingMode}):Promise.resolve()}flush(e){return this._replay?this._replay.isEnabled()?this._replay.sendBufferedReplayOrFlush(e):(this._replay.start(),Promise.resolve()):Promise.resolve()}getReplayId(e){if(this._replay?.isEnabled())return this._replay.getSessionId(e)}getRecordingMode(){if(this._replay?.isEnabled())return this._replay.recordingMode}_initialize(e){this._replay&&(this._maybeLoadFromReplayCanvasIntegration(e),this._replay.initializeSampling())}_setup(e){const t=function(e,t){const n=t.getOptions(),r={sessionSampleRate:0,errorSampleRate:0,...e},s=gn(n.replaysSessionSampleRate),i=gn(n.replaysOnErrorSampleRate);return null==s&&null==i&&P(()=>{console.warn("Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.")}),null!=s&&(r.sessionSampleRate=s),null!=i&&(r.errorSampleRate=i),r}(this._initialOptions,e);this._replay=new Ip({options:t,recordingOptions:this._recordingOptions})}_maybeLoadFromReplayCanvasIntegration(e){try{const t=e.getIntegrationByName("ReplayCanvas");if(!t)return;this._replay._canvas=t.getOptions()}catch{}}}function Dp(e){return[...Ap,...e.map(e=>e.toLowerCase())]}function $p(){const e=Ge();return e?.getIntegrationByName("Replay")}const jp=100,Bp=10,Fp="flag.evaluation.";function Up(e){if(e.type)return e;const t=He().getScopeData().contexts.flags,n=t?t.values:[];return n.length?(void 0===e.contexts&&(e.contexts={}),e.contexts.flags={values:[...n]},e):e}function zp(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:jp;const r=He().getScopeData().contexts;r.flags||(r.flags={values:[]}),function(e,t,n,r){if("boolean"!=typeof n)return;if(e.length>r)return void(o&&j.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`));const s=e.findIndex(e=>e.flag===t);-1!==s&&e.splice(s,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}(r.flags.values,e,t,n)}function Wp(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Bp;if("boolean"!=typeof t)return;const r=Hn();if(!r)return;const s=An(r).data;(`${Fp}${e}`in s||Object.keys(s).filter(e=>e.startsWith(Fp)).length<n)&&r.setAttribute(`${Fp}${e}`,t)}const Hp=()=>
1({name:"LaunchDarkly",processEvent:(e,t,n)=>Up(e)});function qp(){return{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:(e,t,n)=>{zp(e,t.value),Wp(e,t.value)}}}function Vp(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:He();const{message:r,name:s,email:i,url:o,source:a,associatedEventId:c,tags:l}=e,u={contexts:{feedback:{contact_email:i,name:s,message:r,url:o,source:a,associated_event_id:c}},type:"feedback",level:"info",tags:l},d=(null==n?void 0:n.getClient())||Ge();return d&&d.emit("beforeSendFeedback",u,t),n.captureEvent(u,t)}const Jp=c,Kp=Jp.document,Gp=Jp.navigator,Xp="Report a Bug",Yp=(e,t={includeReplay:!0})=>{if(!e.message)throw new Error("Unable to submit feedback with empty message");const n=Ge();if(!n)throw new Error("No client setup, cannot send feedback.");e.tags&&Object.keys(e.tags).length&&He().setTags(e.tags);const r=Vp({source:"api",url:A(),...e},t);return new Promise((e,t)=>{const s=setTimeout(()=>t("Unable to determine if Feedback was correctly sent."),3e4),i=n.on("afterSendEvent",(n,o)=>{if(n.event_id===r)return clearTimeout(s),i(),o?.statusCode&&o.statusCode>=200&&o.statusCode<300?e(r):t(403===o?.statusCode?"Unable to send feedback. This could be because this domain is not in your list of allowed domains.":"Unable to send feedback. This could be because of network issues, or because you are using an ad-blocker.")})})},Qp="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function Zp(e,t){return{...e,...t,tags:{...e.tags,...t.tags},onFormOpen:()=>{t.onFormOpen?.(),e.onFormOpen?.()},onFormClose:()=>{t.onFormClose?.(),e.onFormClose?.()},onSubmitSuccess:(n,r)=>{t.onSubmitSuccess?.(n,r),e.onSubmitSuccess?.(n,r)},onSubmitError:n=>{t.onSubmitError?.(n),e.onSubmitError?.(n)},onFormSubmitted:()=>{t.onFormSubmitted?.(),e.onFormSubmitted?.()},themeDark:{...e.themeDark,...t.themeDark},themeLight:{...e.themeLight,...t.themeLight}}}function ef(e,t){return Object.entries(t).forEach(([t,n])=>{e.setAttributeNS(null,t,n)}),e}const tf="rgba(88, 74, 192, 1)",nf={foreground:"#2b2233",background:"#ffffff",accentForeground:"white",accentBackground:tf,successColor:"#268d75",errorColor:"#df3338",border:"1.5px solid rgba(41, 35, 47, 0.13)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(95%)"},rf={foreground:"#ebe6ef",background:"#29232f",accentForeground:"white",accentBackground:tf,successColor:"#2da98c",errorColor:"#f55459",border:"1.5px solid rgba(235, 230, 239, 0.15)",boxShadow:"0px 4px 24px 0px rgba(43, 34, 51, 0.12)",outline:"1px auto var(--accent-background)",interactiveFilter:"brightness(150%)"};function sf(e){return`\n --foreground: ${e.foreground};\n --background: ${e.background};\n --accent-foreground: ${e.accentForeground};\n --accent-background: ${e.accentBackground};\n --success-color: ${e.successColor};\n --error-color: ${e.errorColor};\n --border: ${e.border};\n --box-shadow: ${e.boxShadow};\n --outline: ${e.outline};\n --interactive-filter: ${e.interactiveFilter};\n `}function of({colorScheme:e,themeDark:t,themeLight:n,styleNonce:r}){const s=Kp.createElement("style");return s.textContent=`\n:host {\n --font-family: system-ui, 'Helvetica Neue', Arial, sans-serif;\n --font-size: 14px;\n --z-index: 100000;\n\n --page-margin: 16px;\n --inset: auto 0 0 auto;\n --actor-inset: var(--inset);\n\n font-family: var(--font-family);\n font-size: var(--font-size);\n\n ${"system"!==e?`color-scheme: only ${e};`:""}\n\n ${sf("dark"===e?{...rf,...t}:{...nf,...n})}\n}\n\n${"system"===e?`\n@media (prefers-color-scheme: dark) {\n :host {\n color-scheme: only dark;\n\n ${sf({...rf,...t})}\n }\n}`:""}\n`,r&&s.setAttribute("nonce",r),s}const af=({lazyLoadIntegration:e,getModalIntegration:t,getScreenshotIntegration:n})=>({id:r="sentry-feedback",autoInject:s=!0,showBranding:i=!0,isEmailRequired:o=!1,isNameRequired:a=!1,showEmail:c=!0,showName:l=!0,enableScreenshot:u=!0,useSentryUser:d={email:"email",name:"username"},tags:h,styleNonce:p,scriptNonce:f,colorScheme:m="system",themeLight:g={},themeDark:y={},addScreenshotButtonLabel:v="Add a screenshot",cancelButtonLabel:_="Cancel",confirmButtonLabel:b="Confirm",emailLabel:S="Email",emailPlaceholder:w="[email protected]",formTitle:k="Report a Bug",isRequiredLabel:T="(required)",messageLabel:E="Description",messagePlaceholder:x="What's the bug? What did you expect?",nameLabel:I="Name",namePlaceholder:C="Your Name",removeScreenshotButtonLabel:O="Remove screenshot",submitButtonLabel:A="Send Bug Report",successMessageText:M="Thank y
1ou for your report!",triggerLabel:R=Xp,triggerAriaLabel:N="",highlightToolText:P="Highlight",hideToolText:L="Hide",removeHighlightText:D="Remove",onFormOpen:$,onFormClose:B,onSubmitSuccess:F,onSubmitError:U,onFormSubmitted:z}={})=>{const W={id:r,autoInject:s,showBranding:i,isEmailRequired:o,isNameRequired:a,showEmail:c,showName:l,enableScreenshot:u,useSentryUser:d,tags:h,styleNonce:p,scriptNonce:f,colorScheme:m,themeDark:y,themeLight:g,triggerLabel:R,triggerAriaLabel:N,cancelButtonLabel:_,submitButtonLabel:A,confirmButtonLabel:b,formTitle:k,emailLabel:S,emailPlaceholder:w,messageLabel:E,messagePlaceholder:x,nameLabel:I,namePlaceholder:C,successMessageText:M,isRequiredLabel:T,addScreenshotButtonLabel:v,removeScreenshotButtonLabel:O,highlightToolText:P,hideToolText:L,removeHighlightText:D,onFormClose:B,onFormOpen:$,onSubmitError:U,onSubmitSuccess:F,onFormSubmitted:z};let H=null,q=null,V=[];const J=e=>{if(!H){const t=Kp.createElement("div");t.id=String(e.id),Kp.body.appendChild(t),H=t.attachShadow({mode:"open"}),q=of(e),H.appendChild(q)}return H},K=async r=>{const s=r.enableScreenshot&&!(/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(Gp.userAgent)||/Macintosh/i.test(Gp.userAgent)&&Gp.maxTouchPoints&&Gp.maxTouchPoints>1||!isSecureContext);let i,o;try{i=(t?t():await e("feedbackModalIntegration",f))(),tt(i)}catch{throw Qp&&j.error("[Feedback] Error when trying to load feedback integrations. Try using `feedbackSyncIntegration` in your `Sentry.init`."),new Error("[Feedback] Missing feedback modal integration!")}try{const t=s?n?n():await e("feedbackScreenshotIntegration",f):void 0;t&&(o=t(),tt(o))}catch{Qp&&j.error("[Feedback] Missing feedback screenshot integration. Proceeding without screenshots.")}const a=i.createDialog({options:{...r,onFormClose:()=>{a?.close(),r.onFormClose?.()},onFormSubmitted:()=>{a?.close(),r.onFormSubmitted?.()}},screenshotIntegration:o,sendFeedback:Yp,shadow:J(r)});return a},G=(e,t={})=>{const n=Zp(W,t),r="string"==typeof e?Kp.querySelector(e):"function"==typeof e.addEventListener?e:null;if(!r)throw Qp&&j.error("[Feedback] Unable to attach to target element"),new Error("Unable to attach to target element");let s=null;const i=async()=>{s||(s=await K({...n,onFormSubmitted:()=>{s?.removeFromDom(),n.onFormSubmitted?.()}})),s.appendToDom(),s.open()};r.addEventListener("click",i);const o=()=>{V=V.filter(e=>e!==o),s?.removeFromDom(),s=null,r.removeEventListener("click",i)};return V.push(o),o},X=(e={})=>{const t=Zp(W,e),n=J(t),r=function({triggerLabel:e,triggerAriaLabel:t,shadow:n,styleNonce:r}){const s=Kp.createElement("button");if(s.type="button",s.className="widget__actor",s.ariaHidden="false",s.ariaLabel=t||e||Xp,s.appendChild(function(){const e=e=>Jp.document.createElementNS("http://www.w3.org/2000/svg",e),t=ef(e("svg"),{width:"20",height:"20",viewBox:"0 0 20 20",fill:"var(--actor-color, var(--foreground))"}),n=ef(e("g"),{clipPath:"url(#clip0_57_80)"}),r=ef(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M15.6622 15H12.3997C12.2129 14.9959 12.031 14.9396 11.8747 14.8375L8.04965 12.2H7.49956V19.1C7.4875 19.3348 7.3888 19.5568 7.22256 19.723C7.05632 19.8892 6.83435 19.9879 6.59956 20H2.04956C1.80193 19.9968 1.56535 19.8969 1.39023 19.7218C1.21511 19.5467 1.1153 19.3101 1.11206 19.0625V12.2H0.949652C0.824431 12.2017 0.700142 12.1783 0.584123 12.1311C0.468104 12.084 0.362708 12.014 0.274155 11.9255C0.185602 11.8369 0.115689 11.7315 0.0685419 11.6155C0.0213952 11.4995 -0.00202913 11.3752 -0.00034808 11.25V3.75C-0.00900498 3.62067 0.0092504 3.49095 0.0532651 3.36904C0.0972798 3.24712 0.166097 3.13566 0.255372 3.04168C0.344646 2.94771 0.452437 2.87327 0.571937 2.82307C0.691437 2.77286 0.82005 2.74798 0.949652 2.75H8.04965L11.8747 0.1625C12.031 0.0603649 12.2129 0.00407221 12.3997 0H15.6622C15.9098 0.00323746 16.1464 0.103049 16.3215 0.278167C16.4966 0.453286 16.5964 0.689866 16.5997 0.9375V3.25269C17.3969 3.42959 18.1345 3.83026 18.7211 4.41679C19.5322 5.22788 19.9878 6.32796 19.9878 7.47502C19.9878 8.62209 19.5322 9.72217 18.7211 10.5333C18.1345 11.1198 17.3969 11.5205 16.5997 11.6974V14.0125C16.6047 14.1393 16.5842 14.2659 16.5395 14.3847C16.4948 14.5035 16.4268 14.6121 16.3394 14.7042C16.252 14.7962 16.147 14.8698 16.0307 14.9206C15.9144 14.9714 15.7891 14.9984 15.6622 15ZM1.89695 10.325H1.88715V4.625H8.33715C8.52423 4.62301 8.70666 4.56654 8.86215 4.4625L12.6872 1.875H14.7247V13.125H12.6872L8.86215 10.4875C8.70666 10.3835 8.52423 10.327 8.33715 10.325H2.20217C2.15205 10.3167 2.10102 10.3125 2.04956 10.3125C1.9981 10.3125 1.94708 10.3167 1.89695 10.325ZM2.98706 12.2V18.1625H5.66206V12.2H2.98706ZM16.5997 9.93612V5.01393C16.6536 5.02355 16.7072 5.03495 16.7605 5.04814C17.1202 5.13709 17.45
156 5.30487 17.7425 5.53934C18.0293 5.77381 18.2605 6.06912 18.4192 6.40389C18.578 6.73866 18.6603 7.10452 18.6603 7.47502C18.6603 7.84552 18.578 8.21139 18.4192 8.54616C18.2605 8.88093 18.0293 9.17624 17.7425 9.41071C17.4556 9.64518 17.1202 9.81296 16.7605 9.90191C16.7072 9.91509 16.6536 9.9265 16.5997 9.93612Z"});t.appendChild(n).appendChild(r);const s=e("defs"),i=ef(e("clipPath"),{id:"clip0_57_80"}),o=ef(e("rect"),{width:"20",height:"20",fill:"white"});return i.appendChild(o),s.appendChild(i),t.appendChild(s).appendChild(i).appendChild(o),t}()),e){const t=Kp.createElement("span");t.appendChild(Kp.createTextNode(e)),s.appendChild(t)}const i=function(e){const t=Kp.createElement("style");return t.textContent='\n.widget__actor {\n position: fixed;\n z-index: var(--z-index);\n margin: var(--page-margin);\n inset: var(--actor-inset);\n\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 16px;\n\n font-family: inherit;\n font-size: var(--font-size);\n font-weight: 600;\n line-height: 1.14em;\n text-decoration: none;\n\n background: var(--actor-background, var(--background));\n border-radius: var(--actor-border-radius, 1.7em/50%);\n border: var(--actor-border, var(--border));
1\n box-shadow: var(--actor-box-shadow, var(--box-shadow));\n color: var(--actor-color, var(--foreground));\n fill: var(--actor-color, var(--foreground));\n cursor: pointer;\n opacity: 1;\n transition: transform 0.2s ease-in-out;\n transform: translate(0, 0) scale(1);\n}\n.widget__actor[aria-hidden="true"] {\n opacity: 0;\n pointer-events: none;\n visibility: hidden;\n transform: translate(0, 16px) scale(0.98);\n}\n\n.widget__actor:hover {\n background: var(--actor-hover-background, var(--background));\n filter: var(--interactive-filter);\n}\n\n.widget__actor svg {\n width: 1.14em;\n height: 1.14em;\n}\n\n@media (max-width: 600px) {\n .widget__actor span {\n display: none;\n }\n}\n',e&&t.setAttribute("nonce",e),t}(r);return{el:s,appendToDom(){n.appendChild(i),n.appendChild(s)},removeFromDom(){s.remove(),i.remove()},show(){s.ariaHidden="false"},hide(){s.ariaHidden="true"}}}({triggerLabel:t.triggerLabel,triggerAriaLabel:t.triggerAriaLabel,shadow:n,styleNonce:p});return G(r.el,{...t,onFormOpen(){r.hide()},onFormClose(){r.show()},onFormSubmitted(){r.show()}}),r};return{name:"Feedback",setupOnce(){Fc()&&W.autoInject&&("loading"===Kp.readyState?Kp.addEventListener("DOMContentLoaded",()=>X().appendToDom()):X().appendToDom())},attachTo:G,createWidget(e={}){const t=X(Zp(W,e));return t.appendToDom(),t},createForm:async(e={})=>K(Zp(W,e)),setTheme(e){if(W.colorScheme=e,H){const e=of(W);q?H.replaceChild(e,q):H.prepend(e),q=e}},remove(){H&&(H.parentElement?.remove(),H=null,q=null),V.forEach(e=>e()),V=[]}}};function cf(){const e=Ge();return e?.getIntegrationByName("Feedback")}var lf,uf,df,hf,pf,ff,mf,gf={},yf=[],vf=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,_f=Array.isArray;function bf(e,t){for(var n in t)e[n]=t[n];return e}function Sf(e){var t=e.parentNode;t&&t.removeChild(e)}function wf(e,t,n){var r,s,i,o={};for(i in t)"key"==i?r=t[i]:"ref"==i?s=t[i]:o[i]=t[i];if(arguments.length>2&&(o.children=arguments.length>3?lf.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===o[i]&&(o[i]=e.defaultProps[i]);return kf(e,o,r,s,null)}function kf(e,t,n,r,s){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==s?++df:s,__i:-1,__u:0};return null==s&&null!=uf.vnode&&uf.vnode(i),i}function Tf(e){return e.children}function Ef(e,t){this.props=e,this.context=t}function xf(e,t){if(null==t)return e.__?xf(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?xf(e):null}function If(e,t,n){var r,s=e.__v,i=s.__e,o=e.__P;if(o)return(r=bf({},s)).__v=s.__v+1,uf.vnode&&uf.vnode(r),jf(o,r,s,e.__n,void 0!==o.ownerSVGElement,32&s.__u?[i]:null,t,null==i?xf(s):i,!!(32&s.__u),n),r.__.__k[r.__i]=r,r.__d=void 0,r.__e!=i&&Cf(r),r}function Cf(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break}return Cf(e)}}function Of(e){(!e.__d&&(e.__d=!0)&&hf.push(e)&&!Af.__r++||pf!==uf.debounceRendering)&&((pf=uf.debounceRendering)||ff)(Af)}function Af(){var e,t,n,r=[],s=[];for(hf.sort(mf);e=hf.shift();)e.__d&&(n=hf.length,t=If(e,r,s)||t,0===n||hf.length>n?(Bf(r,t,s),s.length=r.length=0,t=void 0,hf.sort(mf)):t&&uf.__c&&uf.__c(t,yf));t&&Bf(r,t,s),Af.__r=0}function Mf(e,t,n,r,s,i,o,a,c,l,u){var d,h,p,f,m,g=r&&r.__k||yf,y=t.length;for(n.__d=c,function(e,t,n){var r,s,i,o,a,c=t.length,l=n.length,u=l,d=0;for(e.__k=[],r=0;r<c;r++)null!=(s=e.__k[r]=null==(s=t[r])||"boolean"==typeof s||"function"==typeof s?null:"string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?kf(null,s,null,null,s):_f(s)?kf(Tf,{children:s},null,null,null):void 0===s.constructor&&s.__b>0?kf(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s)?(s.__=e,s.__b=e.__b+1,a=Nf(s,n,o=r+d,u),s.__i=a,i=null,-1!==a&&(u--,(i=n[a])&&(i.__u|=131072)),null==i||null===i.__v?(-1==a&&d--,"function"!=typeof s.type&&(s.__u|=65536)):a!==o&&(a===o+1?d++:a>o?u>
vendor: 7,261 bytes, line 1
1c-o?d+=a-o:d--:d=a<o&&a==o-1?a-o:0,a!==r+d&&(s.__u|=65536))):(i=n[r])&&null==i.key&&i.__e&&(i.__e==e.__d&&(e.__d=xf(i)),Uf(i,i,!1),n[r]=null,u--);if(u)for(r=0;r<l;r++)null!=(i=n[r])&&!(131072&i.__u)&&(i.__e==e.__d&&(e.__d=xf(i)),Uf(i,i))}(n,t,g),c=n.__d,d=0;d<y;d++)null!=(p=n.__k[d])&&"boolean"!=typeof p&&"function"!=typeof p&&(h=-1===p.__i?gf:g[p.__i]||gf,p.__i=d,jf(e,p,h,s,i,o,a,c,l,u),f=p.__e,p.ref&&h.ref!=p.ref&&(h.ref&&Ff(h.ref,null,p),u.push(p.ref,p.__c||f,p)),null==m&&null!=f&&(m=f),65536&p.__u||h.__k===p.__k?c=Rf(p,c,e):"function"==typeof p.type&&void 0!==p.__d?c=p.__d:f&&(c=f.nextSibling),p.__d=void 0,p.__u&=-196609);n.__d=c,n.__e=m}function Rf(e,t,n){var r,s;if("function"==typeof e.type){for(r=e.__k,s=0;r&&s<r.length;s++)r[s]&&(r[s].__=e,t=Rf(r[s],t,n));return t}e.__e!=t&&(n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function Nf(e,t,n,r){var s=e.key,i=e.type,o=n-1,a=n+1,c=t[n];if(null===c||c&&s==c.key&&i===c.type)return n;if(r>(null==c||131072&c.__u?0:1))for(;o>=0||a<t.length;){if(o>=0){if((c=t[o])&&!(131072&c.__u)&&s==c.key&&i===c.type)return o;o--}if(a<t.length){if((c=t[a])&&!(131072&c.__u)&&s==c.key&&i===c.type)return a;a++}}return-1}function Pf(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||vf.test(t)?n:n+"px"}function Lf(e,t,n,r,s){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||Pf(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||Pf(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=Date.now(),e.addEventListener(t,i?$f:Df,i)):e.removeEventListener(t,i?$f:Df,i);else{if(s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!==t&&"height"!==t&&"href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&"rowSpan"!==t&&"colSpan"!==t&&"role"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!==t[4]?e.removeAttribute(t):e.setAttribute(t,n))}}function Df(e){if(this.l){var t=this.l[e.type+!1];if(e.t){if(e.t<=t.u)return}else e.t=Date.now();return t(uf.event?uf.event(e):e)}}function $f(e){if(this.l)return this.l[e.type+!0](uf.event?uf.event(e):e)}function jf(e,t,n,r,s,i,o,a,c,l){var u,d,h,p,f,m,g,y,v,_,b,S,w,k,T,E=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),i=[a=t.__e=n.__e]),(u=uf.__b)&&u(t);e:if("function"==typeof E)try{if(y=t.props,v=(u=E.contextType)&&r[u.__c],_=u?v?v.props.value:u.__:r,n.__c?g=(d=t.__c=n.__c).__=d.__E:("prototype"in E&&E.prototype.render?t.__c=d=new E(y,_):(t.__c=d=new Ef(y,_),d.constructor=E,d.render=zf),v&&v.sub(d),d.props=y,d.state||(d.state={}),d.context=_,d.__n=r,h=d.__d=!0,d.__h=[],d._sb=[]),null==d.__s&&(d.__s=d.state),null!=E.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=bf({},d.__s)),bf(d.__s,E.getDerivedStateFromProps(y,d.__s))),p=d.props,f=d.state,d.__v=t,h)null==E.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==E.getDerivedStateFromProps&&y!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,_),!d.__e&&(null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,_)||t.__v===n.__v)){for(t.__v!==n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach(function(e){e&&(e.__=t)}),b=0;b<d._sb.length;b++)d.__h.push(d._sb[b]);d._sb=[],d.__h.length&&o.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,_),null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,f,m)})}if(d.context=_,d.props=y,d.__P=e,d.__e=!1,S=uf.__r,w=0,"prototype"in E&&E.prototype.render){for(d.state=d.__s,d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),k=0;k<d._sb.length;k++)d.__h.push(d._sb[k]);d._sb=[]}else do{d.__d=!1,S&&S(t),u=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++w<25);d.state=d.__s,null!=d.getChildContext&&(r=bf(bf({},r),d.getChildContext())),h||null==d.getSnapshotBeforeUpdate||(m=d.getSnapshotBeforeUpdate(p,f)),Mf(e,_f(T=null!=u&&u.type===Tf&&null==u.key?u.props.children:u)?T:[T],t,n,r,s,i,o,a,c,l),d.base=t.__e,t.__u&=-161,d.__h.length&&o.push(d),g&&(d.__E=d.__=null)}catch(e){t.__v=null,c||null!=i?(t.__e=a,t.__u|=c?160:32,i[i.indexOf(a)]=null):(t.__e=n.__e,t.__k=n.__k),uf.__e(e,t,n)}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=function(e,t,n,r,s,i,o,a,c){var l,u,d,h,p,f,m,g=n.props,y=t.props,v=t.type;if("svg"===v&&(s=!0),null!=i)for(l=0;l<i.length;l++)if((p=i[l])&&"setAttribute"in p==!!v&&(v?p.localName===v:3===p.nodeType)){e=p,i[l]=null;break}if(null==e){if(null===v)return document.createTextNode(y);e=s?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,y.is&&y),i=null,a=!1}if(null===v)g===y||a&&e.data===y||(e.data=y);else{if(i=i&&lf.call(e.childNodes),g=n.props||gf,!a&&null!=i)for(g={},l=0;l<e.attributes.length;l++)g[(p=e.attributes[l]).name]=p.value;for(l in g)p=g[l],"children"==l||("dangerouslySetInnerHTML"==l?d=p:"key"===l||l in y||Lf(e,l,null,p,s));for(l in y)p=y[l],"children"==l?h=p:"dangerouslySetInnerHTML"==l?u=p:"value"==l?f=p:"checked"==l?m=p:"key"===l||a&&"function"!=typeof p||g[l]===p||Lf(e,l,p,g[l],s);if(u)a||d&&(u.__html===d.__html||u.__html===e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(d&&(e.innerHTML=""),Mf(e,_f(h)?h:[h],t,n,r,s&&"foreignObject"!==v,i,o,i?i[0]:n.__k&&xf(n,0),a,c),null!=i)for(l=i.length;l--;)null!=i[l]&&Sf(i[l]);a||(l="value",void 0!==f&&(f!==e[l]||"progress"===v&&!f||"option"===v&&f!==g[l])&&Lf(e,l,f,g[l],!1),l="checked",void 0!==m&&m!==e[l]&&Lf(e,l,m,g[l],!1))}return e}(n.__e,t,n,r,s,i,o,c,l);(u=uf.diffed)&&u(t)}function Bf(e,t,n){for(var r=0;r<n.length;r++)Ff(n[r],n[++r],n[++r]);uf.__c&&uf.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){uf.__e(e,t.__v)}})}function Ff(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){uf.__e(e,n)}}function Uf(e,t,n){var r,s;if(uf.unmount&&uf.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||Ff(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){uf.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(s=0;s<r.length;s++)r[s]&&Uf(r[s],t,n||"function"!=typeof e.type);n||null==e.__e||Sf(e.__e),e.__=e.__e=e.__d=void 0}function zf(e,t,n){return this.constructor(e,n)}lf=yf.slice,uf={__e:function(e,t,n,r){for(var s,i,o;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&null!=i.getDerivedStateFromError&&(s.setState(i.getDerivedStateFromError(e)),o=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,r||{}),o=s.__d),o)return s.__E=s}catch(t){e=t}throw e}},df=0,Ef.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=bf({},this.state),"function"==typeof e&&(e=e(bf({},n),this.props)),e&&bf(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Of(this))},Ef.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Of(this))},Ef.prototype.render=Tf,hf=[],ff="function"==typeof Promise?Promise.prototype.then.bind(Prom
1ise.resolve()):setTimeout,mf=function(e,t){return e.__v.__b-t.__v.__b},Af.__r=0;var Wf,Hf,qf,Vf,Jf=0,Kf=[],Gf=[],Xf=uf,Yf=Xf.__b,Qf=Xf.__r,Zf=Xf.diffed,em=Xf.__c,tm=Xf.unmount,nm=Xf.__;function rm(e,t){Xf.__h&&Xf.__h(Hf,e,Jf||t),Jf=0;var n=Hf.__H||(Hf.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:Gf}),n.__[e]}function sm(e){return Jf=1,im(mm,e)}function im(e,t,n){var r=rm(Wf++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):mm(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=Hf,!Hf.u)){var s=function(e,t,n){if(!r.__c.__H)return!0;var s=r.__c.__H.__.filter(function(e){return!!e.__c});if(s.every(function(e){return!e.__N}))return!i||i.call(this,e,t,n);var o=!1;return s.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),!(!o&&r.__c.props===e)&&(!i||i.call(this,e,t,n))};Hf.u=!0;var i=Hf.shouldComponentUpdate,o=Hf.componentWillUpdate;Hf.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,s(e,t,n),i=r}o&&o.call(this,e,t,n)},Hf.shouldComponentUpdate=s}return r.__N||r.__}function om(e,t){var n=rm(Wf++,4);!Xf.__s&&fm(n.__H,t)&&(n.__=e,n.i=t,Hf.__h.push(n))}function am(e,t){var n=rm(Wf++,7);return fm(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function cm(e,t){return Jf=8,am(function(){return e},t)}function lm(){for(var e;e=Kf.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(hm),e.__H.__h.forEach(pm),e.__H.__h=[]}catch(t){e.__H.__h=[],Xf.__e(t,e.__v)}}Xf.__b=function(e){Hf=null,Yf&&Yf(e)},Xf.__=function(e,t){t.__k&&t.__k.__m&&(e.__m=t.__k.__m),nm&&nm(e,t)},Xf.__r=function(e){Qf&&Qf(e),Wf=0;var t=(Hf=e.__c).__H;t&&(qf===Hf?(t.__h=[],Hf.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.__V=Gf,e.__N=e.i=void 0})):(t.__h.forEach(hm),t.__h.forEach(pm),t.__h=[],Wf=0)),qf=Hf},Xf.diffed=function(e){Zf&&Zf(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==Kf.push(t)&&Vf===Xf.requestAnimationFrame||((Vf=Xf.requestAnimationFrame)||dm)(lm)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.__V!==Gf&&(e.__=e.__V),e.i=void 0,e.__V=Gf})),qf=Hf=null},Xf.__c=function(e,t){t.some(function(e){try{e.__h.forEach(hm),e.__h=e.__h.filter(function(e){return!e.__||pm(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],Xf.__e(n,e.__v)}}),em&&em(e,t)},Xf.unmount=function(e){tm&&tm(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{hm(e)}catch(e){t=e}}),n.__H=void 0,t&&Xf.__e(t,n.__v))};var um="function"==typeof requestAnimationFrame;function dm(e){var t,n=function(){clearTimeout(r),um&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);um&&(t=requestAnimationFrame(n))}function hm(e){var t=Hf,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),Hf=t}function pm(e){var t=Hf;e.__c=e.__(),Hf=t}function fm(e,t){return!e||e.length!==t.length||t.some(function(t,n){return t!==e[n]})}function mm(e,t){return"function"==typeof t?t(e):t}const gm=Object.defineProperty({__proto__:null,useCallback:cm,useContext:function(e){var t=Hf.context[e.__c],n=rm(Wf++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(Hf)),t.props.value):e.__},useDebugValue:function(e,t){Xf.useDebugValue&&Xf.useDebugValue(t?t(e):e)},useEffect:function(e,t){var n=rm(Wf++,3);!Xf.__s&&fm(n.__H,t)&&(n.__=e,n.i=t,Hf.__H.__h.push(n))},useErrorBoundary:function(e){var t=rm(Wf++,10),n=sm();return t.__=e,Hf.componentDidCatch||(Hf.componentDidCatch=function(e,r){t.__&&t.__(e,r),n[1](e)}),[n[0],function(){n[1](void 0)}]},useId:function(){var e=rm(Wf++,11);if(!e.__){for(var t=Hf.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__},useImperativeHandle:function(e,t,n){Jf=6,om(function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},null==n?n:n.concat(e))},useLayoutEffect:om,useMemo:am,useReducer:im,useRef:function(e){return Jf=5,am(function(){return{current:e}},[])},useState:sm},Symbol.toStringTag,{value:"Module"});function ym(){const e=e=>Kp.createElementNS("http://www.w3.org/2000/svg",e),t=ef(e("svg"),{width:"32",height:"30",viewBox:"0 0 72 66",fill:"inherit"}),n=ef(e("path"),{transform:"translate(11, 11)",d:"M29,2.26a4.67,4.67,0,0,0-8,0L14.42,13.53A32.21,32.21,0,0,1,32.17,40.19H27.55A27.68,27.68,0,0,0,12.09,17.47L6,28a15.92,15.92,0,0,1,9.23,12.17H4.62A.76.76,0,0,1,4,39.06l2.94-5a10.74,10.74,0,0,0-3.36-1.9l-2.91,5a4.54,4.54,0,0,0,1.69,6.24A4.66,4.66,0,0,0,4.62,44H19.15a19.4,19.4,0,0,0-8-17.31l2.31-4A23.87,23.87,0,0,1,23.76,44H36.07a35.88,35.88,0,0,0-16.41-31.8l4.67-8a.77.77,0,0,1,1.05-.27c.53.29,20.29,34.77,20.66,35.17a.76.76,0,0,1-.68,1.13H40.6q.09,1.91,0,3.81h4.78A4.59,4.59,0,0,0,50,39.43a4.49,4.49,0,0,0-.62-2.28Z"});return t.appendChild(n),t}function vm({options:e}){const t=am(()=>({__html:ym().outerHTML}),[]);return wf("h2",{class:"dialog__header"},wf("span",{class:"dialog__title"},e.formTitle),e.showBranding?wf("a",{class:"brand-link",target:"_blank",href:"https://sentry.io/welcome/",title:"Powered by Sentry",rel:"noopener noreferrer",dangerouslySetInnerHTML:t}):null)}function _m(e,t){const n=e.get(t);return"string"==typeof n?n.trim():""}function bm({options:e,defaultEmail:t,defaultName:n,onFormClose:r,onSubmit:s,onSubmitSuccess:i,onSubmitError:o,showEmail
1:a,showName:c,screenshotInput:l}){const{tags:u,addScreenshotButtonLabel:d,removeScreenshotButtonLabel:h,cancelButtonLabel:p,emailLabel:f,emailPlaceholder:m,isEmailRequired:g,isNameRequired:y,messageLabel:v,messagePlaceholder:_,nameLabel:b,namePlaceholder:S,submitButtonLabel:w,isRequiredLabel:k}=e,[T,E]=sm(!1),[x,I]=sm(null),[C,O]=sm(!1),A=l?.input,[M,R]=sm(null),N=cm(e=>{R(e),O(!1)},[]),P=cm(e=>{const t=function(e,t){const n=[];return t.isNameRequired&&!e.name&&n.push(t.nameLabel),t.isEmailRequired&&!e.email&&n.push(t.emailLabel),e.message||n.push(t.messageLabel),n}(e,{emailLabel:f,isEmailRequired:g,isNameRequired:y,messageLabel:v,nameLabel:b});return t.length>0?I(`Please enter in the following required fields: ${t.join(", ")}`):I(null),0===t.length},[f,g,y,v,b]),L=cm(async e=>{E(!0);try{if(e.preventDefault(),!(e.target instanceof HTMLFormElement))return;const t=new FormData(e.target),n=await(l&&C?l.value():void 0),r={name:_m(t,"name"),email:_m(t,"email"),message:_m(t,"message"),attachments:n?[n]:void 0};if(!P(r))return;try{const e=await s({name:r.name,email:r.email,message:r.message,source:"widget",tags:u},{attachments:r.attachments});i(r,e)}catch(e){Qp&&j.error(e),I(e),o(e)}}finally{E(!1)}},[l&&C,i,o]);return wf("form",{class:"form",onSubmit:L},A&&C?wf(A,{onError:N}):null,wf("fieldset",{class:"form__right","data-sentry-feedback":!0,disabled:T},wf("div",{class:"form__top"},x?wf("div",{class:"form__error-container"},x):null,c?wf("label",{for:"name",class:"form__label"},wf(Sm,{label:b,isRequiredLabel:k,isRequired:y}),wf("input",{class:"form__input",defaultValue:n,id:"name",name:"name",placeholder:S,required:y,type:"text"})):wf("input",{"aria-hidden":!0,value:n,name:"name",type:"hidden"}),a?wf("label",{for:"email",class:"form__label"},wf(Sm,{label:f,isRequiredLabel:k,isRequired:g}),wf("input",{class:"form__input",defaultValue:t,id:"email",name:"email",placeholder:m,required:g,type:"email"})):wf("input",{"aria-hidden":!0,value:t,name:"email",type:"hidden"}),wf("label",{for:"message",class:"form__label"},wf(Sm,{label:v,isRequiredLabel:k,isRequired:!0}),wf("textarea",{autoFocus:!0,class:"form__input form__input--textarea",id:"message",name:"message",placeholder:_,required:!0,rows:5})),A?wf("label",{for:"screenshot",class:"form__label"},wf("button",{class:"btn btn--default",disabled:T,type:"button",onClick:()=>{R(null),O(e=>!e)}},C?h:d),M?wf("div",{class:"form__error-container"},M.message):null):null),wf("div",{class:"btn-group"},wf("button",{class:"btn btn--primary",disabled:T,type:"submit"},w),wf("button",{class:"btn btn--default",disabled:T,type:"button",onClick:r},p))))}function Sm({label:e,isRequired:t,isRequiredLabel:n}){return wf("span",{class:"form__label__text"},e,t&&wf("span",{class:"form__label__text--required"},n))}function wm(){const e=e=>Jp.document.createElementNS("http://www.w3.org/2000/svg",e),t=ef(e("svg"),{width:"16",height:"17",viewBox:"0 0 16 17",fill:"inherit"}),n=ef(e("g"),{clipPath:"url(#clip0_57_156)"}),r=ef(e("path"),{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M3.55544 15.1518C4.87103 16.0308 6.41775 16.5 8 16.5C10.1217 16.5 12.1566 15.6571 13.6569 14.1569C15.1571 12.6566 16 10.6217 16 8.5C16 6.91775 15.5308 5.37103 14.6518 4.05544C13.7727 2.73985 12.5233 1.71447 11.0615 1.10897C9.59966 0.503466 7.99113 0.34504 6.43928 0.653721C4.88743 0.962403 3.46197 1.72433 2.34315 2.84315C1.22433 3.96197 0.462403 5.38743 0.153721 6.93928C-0.15496 8.49113 0.00346625 10.0997 0.608967 11.5615C1.21447 13.0233 2.23985 14.2727 3.55544 15.1518ZM4.40546 3.1204C5.46945 2.40946 6.72036 2.03 8 2.03C9.71595 2.03 11.3616 2.71166 12.575 3.92502C13.7883 5.13838 14.47 6.78405 14.47 8.5C14.47 9.77965 14.0905 11.0306 13.3796 12.0945C12.6687 13.1585 11.6582 13.9878 10.476 14.4775C9.29373 14.9672 7.99283 15.0953 6.73777 14.8457C5.48271 14.596 4.32987 13.9798 3.42502 13.075C2.52018 12.1701 1.90397 11.0173 1.65432 9.76224C1.40468 8.50718 1.5328 7.20628 2.0225 6.02404C2.5122 4.8418 3.34148 3.83133 4.40546 3.1204Z"}),s=ef(e("path"),{d:"M6.68775 12.4297C6.78586 12.4745 6.89218 12.4984 7 12.5C7.11275 12.4955 7.22315 12.4664 7.32337 12.4145C7.4236 12.3627 7.51121 12.2894 7.58 12.2L12 5.63999C12.0848 5.47724 12.1071 5.28902 12.0625 5.11098C12.0178 4.93294 11.9095 4.77744 11.7579 4.67392C11.6064 4.57041 11.4221 4.52608 11.24 4.54931C11.0579 4.57254 10.8907 4.66173
110.77 4.79999L6.88 10.57L5.13 8.56999C5.06508 8.49566 4.98613 8.43488 4.89768 8.39111C4.80922 8.34735 4.713 8.32148 4.61453 8.31498C4.51605 8.30847 4.41727 8.32147 4.32382 8.35322C4.23038 8.38497 4.14413 8.43484 4.07 8.49999C3.92511 8.63217 3.83692 8.81523 3.82387 9.01092C3.81083 9.2066 3.87393 9.39976 4 9.54999L6.43 12.24C6.50187 12.3204 6.58964 12.385 6.68775 12.4297Z"});t.appendChild(n).append(s,r);const i=e("defs"),o=ef(e("clipPath"),{id:"clip0_57_156"}),a=ef(e("rect"),{width:"16",height:"16",fill:"white",transform:"translate(0 0.5)"});return o.appendChild(a),i.appendChild(o),t.appendChild(i).appendChild(o).appendChild(a),t}function km({open:e,onFormSubmitted:t,...n}){const r=n.options,s=am(()=>({__html:wm().outerHTML}),[]),[i,o]=sm(null),a=cm(()=>{i&&(clearTimeout(i),o(null)),t()},[i]),c=cm((e,r)=>{n.onSubmitSuccess(e,r),o(setTimeout(()=>{t(),o(null)},5e3))},[t]);return wf(Tf,null,i?wf("div",{class:"success__position",onClick:a},wf("div",{class:"success__content"},r.successMessageText,wf("span",{class:"success__icon",dangerouslySetInnerHTML:s}))):wf("dialog",{class:"dialog",onClick:r.onFormClose,open:e},wf("div",{class:"dialog__position"},wf("div",{class:"dialog__content",onClick:e=>{e.stopPropagation()}},wf(vm,{options:r}),wf(bm,{...n,onSubmitSuccess:c})))))}const Tm=()=>({name:"FeedbackModal",setupOnce(){},createDialog:({options:e,screenshotIntegration:t,sendFeedback:n,shadow:r})=>{const s=r,i=e.useSentryUser,o=function(){const e=He().getUser(),t=qe().getUser(),n=Ve().getUser();return e&&Object.keys(e).length?e:t&&Object.keys(t).length?t:n}(),a=Kp.createElement("div"),c=function(e){const t=Kp.createElement("style");return t.textContent="\n:host {\n --dialog-inset: var(--inset);\n}\n\n\n.dialog {\n position: fixed;\n z-index: var(--z-index);\n margin: 0;\n inset: 0;\n\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 0;\n height: 100vh;\n width: 100vw;\n\n color: var(--dialog-color, var(--foreground));\n fill: var(--dialog-color, var(--foreground));\n line-height: 1.75em;\n\n background-color: rgba(0, 0, 0, 0.05);\n border: none;\n inset: 0;\n opacity: 1;\n transition: opacity 0.2s ease-in-out;\n}\n\n.dialog__position {\n position: fixed;\n z-index: var(--z-index);\n inset: var(--dialog-inset);\n padding: var(--page-margin);\n display: flex;\n max-height: calc(100vh - (2 * var(--page-margin)));\n}\n@media (max-width: 600px) {\n .dialog__position {\n inset: var(--page-margin);\n padding: 0;\n }\n}\n\n.dialog__position:has(.editor) {\n inset: var(--page-margin);\n padding: 0;\n}\n\n.dialog:not([open]) {\n opacity: 0;\n pointer-events: none;\n visibility: hidden;\n}\n.dialog:not([open]) .dialog__content {\n transform: translate(0, -16px) scale(0.98);\n}\n\n.dialog__content {\n display: flex;\n flex-direction: column;\n gap: 16px;\n padding: var(--dialog-padding, 24px);\n max-width: 100%;\n width: 100%;\n max-height: 100%;\n overflow: auto;\n\n background: var(--dialog-background, var(--background));\n border-radius: var(--dialog-border-radius, 20px);\n border: var(--dialog-border, var(--border));
1\n box-shadow: var(--dialog-box-shadow, var(--box-shadow));\n transform: translate(0, 0) scale(1);\n transition: transform 0.2s ease-in-out;\n}\n\n\n\n.dialog__header {\n display: flex;\n gap: 4px;\n justify-content: space-between;\n font-weight: var(--dialog-header-weight, 600);\n margin: 0;\n}\n.dialog__title {\n align-self: center;\n width: var(--form-width, 272px);\n}\n\n@media (max-width: 600px) {\n .dialog__title {\n width: auto;\n }\n}\n\n.dialog__position:has(.editor) .dialog__title {\n width: auto;\n}\n\n\n.brand-link {\n display: inline-flex;\n}\n.brand-link:focus-visible {\n outline: var(--outline);\n}\n\n\n.form {\n display: flex;\n overflow: auto;\n flex-direction: row;\n gap: 16px;\n flex: 1 0;\n}\n\n.form fieldset {\n border: none;\n margin: 0;\n padding: 0;\n}\n\n.form__right {\n flex: 0 0 auto;\n display: flex;\n overflow: auto;\n flex-direction: column;\n justify-content: space-between;\n gap: 20px;\n width: var(--form-width, 100%);\n}\n\n.dialog__position:has(.editor) .form__right {\n width: var(--form-width, 272px);\n}\n\n.form__top {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n\n.form__error-container {\n color: var(--error-color);\n fill: var(--error-color);\n}\n\n.form__label {\n display: flex;\n flex-direction: column;\n gap: 4px;\n margin: 0px;\n}\n\n.form__label__text {\n display: flex;\n gap: 4px;\n align-items: center;\n}\n\n.form__label__text--required {\n font-size: 0.85em;\n}\n\n.form__input {\n font-family: inherit;\n line-height: inherit;\n background: transparent;\n box-sizing: border-box;\n border: var(--input-border, var(--border));\n border-radius: var(--input-border-radius, 6px);\n color: var(--input-color, inherit);\n fill: var(--input-color, inherit);\n font-size: var(--input-font-size, inherit);\n font-weight: var(--input-font-weight, 500);\n padding: 6px 12px;\n}\n\n.form__input::placeholder {\n opacity: 0.65;\n color: var(--input-placeholder-color, inherit);\n filter: var(--interactive-filter);\n}\n\n.form__input:focus-visible {\n outline: var(--input-focus-outline, var(--outline));\n}\n\n.form__input--textarea {\n font-family: inherit;\n resize: vertical;\n}\n\n.error {\n color: var(--error-color);\n fill: var(--error-color);\n}\n\n\n.btn-group {\n display: grid;\n gap: 8px;\n}\n\n.btn {\n line-height: inherit;\n border: var(--button-border, var(--border));\n border-radius: var(--button-border-radius, 6px);\n cursor: pointer;\n font-family: inherit;\n font-size: var(--button-font-size, inherit);\n font-weight: var(--button-font-weight, 600);\n padding: var(--button-padding, 6px 16px);\n}\n.btn[disabled] {\n opacity: 0.6;\n pointer-events: none;\n}\n\n.btn--primary {\n color: var(--button-primary-color, var(--accent-foreground));\n fill: var(--button-primary-color, var(--accent-foreground));\n background: var(--button-primary-background, var(--accent-background));\n border: var(--button-primary-border, var(--border));\n border-radius: var(--button-primary-border-radius, 6px);\n font-weight: var(--button-primary-font-weight, 500);\n}\n.btn--primary:hover {\n color: var(--button-primary-hover-color, var(--accent-foreground));\n fill: var(--button-primary-hover-color, var(--accent-foreground));\n background: var(--button-primary-hover-background, var(--accent-background));\n filter: var(--interactive-filter);\n}\n.btn--primary:focus-visible {\n background: var(--button-primary-hover-background, var(--accent-background));\n filter: var(--interactive-filter);\n outline: var(--button-primary-focus-outline, var(--outline));\n}\n\n.btn--default {\n color: var(--button-color, var(--foreground));\n fill: var(--button-color, var(--foreground));\n background: var(--button-background, var(--background));\n border: var(--button-border, var(--border));\n border-radius: var(--button-border-radius, 6px);\n font-weight: var(--button-font-weight, 500);\n}\n.btn--default:hover {\n color: var(--button-color, var(--foreground));\n fill: var(--button-color, var(--foreground));\n background: var(--button-hover-background, var(--background));\n filter: var(--interactive-filter);\n}\n.btn--default:focus-visible {\n background: var(--button-hover-background, var(--background));\n filter: var(--interactive-filter);\n outline: var(--button-focus-outline, var(--outline));\n}\n\n\n.success__position {\n position: fixed;\n inset: var(--dialog-inset);\n padding: var(--page-margin);\n z-index: var(--z-index);\n}\n.success__content {\n background: var(--success-background, var(--background));\n border: var(--success-border, var(--border));\n border-radius: var(--success-border-radius, 1.7em/50%);
1\n box-shadow: var(--success-box-shadow, var(--box-shadow));\n font-weight: var(--success-font-weight, 600);\n color: var(--success-color);\n fill: var(--success-color);\n padding: 12px 24px;\n line-height: 1.75em;\n\n display: grid;\n align-items: center;\n grid-auto-flow: column;\n gap: 6px;\n cursor: default;\n}\n\n.success__icon {\n display: flex;\n}\n\n",e&&t.setAttribute("nonce",e),t}(e.styleNonce);let l="";const u={get el(){return a},appendToDom(){s.contains(c)||s.contains(a)||(s.appendChild(c),s.appendChild(a))},removeFromDom(){a.remove(),c.remove(),Kp.body.style.overflow=l},open(){h(!0),e.onFormOpen?.(),Ge()?.emit("openFeedbackWidget"),l=Kp.body.style.overflow,Kp.body.style.overflow="hidden"},close(){h(!1),Kp.body.style.overflow=l}},d=t?.createInput({h:wf,hooks:gm,dialog:u,options:e}),h=t=>{!function(e,t){var n,r,s;uf.__&&uf.__(e,t),n=t.__k,r=[],s=[],jf(t,e=t.__k=wf(Tf,null,[e]),n||gf,gf,void 0!==t.ownerSVGElement,n?null:t.firstChild?lf.call(t.childNodes):null,r,n?n.__e:t.firstChild,!1,s),e.__d=void 0,Bf(r,e,s)}(wf(km,{options:e,screenshotInput:d,showName:e.showName||e.isNameRequired,showEmail:e.showEmail||e.isEmailRequired,defaultName:String(i&&o?.[i.name]||""),defaultEmail:String(i&&o?.[i.email]||""),onFormClose:()=>{h(!1),e.onFormClose?.()},onSubmit:n,onSubmitSuccess:(t,n)=>{h(!1),e.onSubmitSuccess?.(t,n)},onSubmitError:t=>{e.onSubmitError?.(t)},onFormSubmitted:()=>{e.onFormSubmitted?.()},open:t}),a)};return u}});function Em(e){const t=Kp.createElement("style"),n="#1A141F",r="#302735";return t.textContent=`\n.editor {\n display: flex;\n flex-grow: 1;\n flex-direction: column;\n}\n\n.editor__image-container {\n justify-items: center;\n padding: 15px;\n position: relative;\n height: 100%;\n border-radius: var(--menu-border-radius, 6px);\n\n background-color: ${n};\n background-image: repeating-linear-gradient(\n -145deg,\n transparent,\n transparent 8px,\n ${n} 8px,\n ${n} 11px\n ),\n repeating-linear-gradient(\n -45deg,\n transparent,\n transparent 15px,\n ${r} 15px,\n ${r} 16px\n );\n}\n\n.editor__canvas-container {\n width: 100%;\n height: 100%;\n position: relative;\n display: flex;\n align-items: center;\n justify-content: center;\n}\n\n.editor__canvas-container > * {\n object-fit: contain;\n position: absolute;\n}\n\n.editor__tool-container {\n padding-top: 8px;\n display: flex;\n justify-content: center;\n}\n\n.editor__tool-bar {\n display: flex;\n gap: 8px;\n}\n\n.editor__tool {\n display: flex;\n padding: 8px 12px;\n justify-content: center;\n align-items: center;\n border: var(--button-border, var(--border));\n border-radius: var(--button-border-radius, 6px);\n background: var(--button-background, var(--background));\n color: var(--button-color, var(--foreground));\n}\n\n.editor__tool--active {\n background: var(--button-primary-background, var(--accent-background));\n color: var(--button-primary-color, var(--accent-foreground));\n}\n\n.editor__rect {\n position: absolute;\n z-index: 2;\n}\n\n.editor__rect button {\n opacity: 0;\n position: absolute;\n top: -12px;\n right: -12px;\n cursor: pointer;\n padding: 0;\n z-index: 3;\n border: none;\n background: none;\n}\n\n.editor__rect:hover button {\n opacity: 1;\n}\n`,e&&t.setAttribute("nonce",e),t}function xm(e,t,n){if(!e)return;const r=e.getContext("2d",t);r&&n(e,r)}function Im(e,t){xm(e,{alpha:!0},(e,n)=>{n.drawImage(t,0,0,t.width,t.height,0,0,e.width,e.height)})}function Cm(e,t,n){xm(e,{alpha:!0},(e,r)=>{n.length&&(r.fillStyle="rgba(0, 0, 0, 0.25)",r.fillRect(0,0,e.width,e.height)),n.forEach(e=>{!function(e,t,n){switch(e.type){case"highlight":t.shadowColor="rgba(0, 0, 0, 0.7)",t.shadowBlur=50,t.fillStyle=n,t.fillRect(e.x-1,e.y-1,e.w+2,e.h+2),t.clearRect(e.x,e.y,e.w,e.h);break;case"hide":t.fillStyle="rgb(0, 0, 0)",t.fillRect(e.x,e.y,e.w,e.h)}}(e,r,t)})})}function Om({h:e,hooks:t,outputBuffer:n,dialog:r,options:s}){const i=function({hooks:e}){return function({onBeforeScreenshot:t,onScreenshot:n,onAfterScreenshot:r,onError:s}){const i=function(){const[t,n]=e.useState(Jp.devicePixelRatio??1);return e.useEffect(()=>{const e=()=>{n(Jp.devicePixelRatio)},t=matchMedia(`(resolution: ${Jp.devicePixelRatio}dppx)`);return t.addEventListener("change",e),()=>{t.removeEventListener("change",e)}},[]),t}();e.useEffect(()=>{(async()=>{t();const e=await Gp.mediaDevices.getDisplayMedia({video:{width:Jp.innerWidth*i,height:Jp.innerHeight*i},audio:!1,monitorTypeSurfaces:"exclude",preferCurrentTab:!0,selfBrowserSurface:"include",surfaceSwitching:"exclude"}),s=Kp.createElement("video");await new Promise((t,r)=>{s.srcObject=e,s.onloadedmetadata=()=>
1{n(s,i),e.getTracks().forEach(e=>e.stop()),t()},s.play().catch(r)}),r()})().catch(s)},[])}}({hooks:t}),o=function({h:e}){return function({action:t,setAction:n,options:r}){return e("div",{class:"editor__tool-container"},e("div",{class:"editor__tool-bar"},e("button",{type:"button",class:"editor__tool "+("highlight"===t?"editor__tool--active":""),onClick:()=>{n("highlight"===t?"":"highlight")}},r.highlightToolText),e("button",{type:"button",class:"editor__tool "+("hide"===t?"editor__tool--active":""),onClick:()=>{n("hide"===t?"":"hide")}},r.hideToolText)))}}({h:e}),a=function({h:e}){return function(){return e("svg",{"data-test-id":"icon-close",viewBox:"0 0 16 16",fill:"#2B2233",height:"25px",width:"25px"},e("circle",{r:"7",cx:"8",cy:"8",fill:"white"}),e("path",{strokeWidth:"1.5",d:"M8,16a8,8,0,1,1,8-8A8,8,0,0,1,8,16ZM8,1.53A6.47,6.47,0,1,0,14.47,8,6.47,6.47,0,0,0,8,1.53Z"}),e("path",{strokeWidth:"1.5",d:"M5.34,11.41a.71.71,0,0,1-.53-.22.74.74,0,0,1,0-1.06l5.32-5.32a.75.75,0,0,1,1.06,1.06L5.87,11.19A.74.74,0,0,1,5.34,11.41Z"}),e("path",{strokeWidth:"1.5",d:"M10.66,11.41a.74.74,0,0,1-.53-.22L4.81,5.87A.75.75,0,0,1,5.87,4.81l5.32,5.32a.74.74,0,0,1,0,1.06A.71.71,0,0,1,10.66,11.41Z"}))}}({h:e}),c={__html:Em(s.styleNonce).innerText},l=r.el.style,u=({screenshot:r})=>{const[i,l]=t.useState("highlight"),[u,d]=t.useState([]),h=t.useRef(null),p=t.useRef(null),f=t.useRef(null),m=t.useRef(null),[g,y]=t.useState(1),v=t.useMemo(()=>{const e=Kp.getElementById(s.id);if(!e)return"white";const t=getComputedStyle(e);return t.getPropertyValue("--button-primary-background")||t.getPropertyValue("--accent-background")},[s.id]);t.useLayoutEffect(()=>{const e=()=>{const t=h.current;t&&(xm(r.canvas,{alpha:!1},e=>{const n=Math.min(t.clientWidth/e.width,t.clientHeight/e.height);y(n)}),0!==t.clientHeight&&0!==t.clientWidth||setTimeout(e,0))};return e(),Jp.addEventListener("resize",e),()=>{Jp.removeEventListener("resize",e)}},[r]);const _=t.useCallback((e,t)=>{xm(e,{alpha:!0},(e,n)=>{n.scale(t,t),e.width=r.canvas.width,e.height=r.canvas.height})},[r]);t.useEffect(()=>{_(p.current,r.dpi),Im(p.current,r.canvas)},[r]),t.useEffect(()=>{_(f.current,r.dpi),xm(f.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),Cm(f.current,v,u)},[u,v]),t.useEffect(()=>{_(n,r.dpi),Im(n,r.canvas),xm(Kp.createElement("canvas"),{alpha:!0},(e,t)=>{t.scale(r.dpi,r.dpi),e.width=r.canvas.width,e.height=r.canvas.height,Cm(e,v,u),Im(n,e)})},[u,r,v]);const b=t.useCallback(e=>t=>{t.preventDefault(),t.stopPropagation(),d(t=>{const n=[...t];return n.splice(e,1),n})},[]),S={width:r.canvas.width*g+"px",height:r.canvas.height*g+"px"},w=e=>{e.stopPropagation()};return e("div",{class:"editor"},e("style",{nonce:s.styleNonce,dangerouslySetInnerHTML:c}),e("div",{class:"editor__image-container"},e("div",{class:"editor__canvas-container",ref:h},e("canvas",{ref:p,id:"background",style:S}),e("canvas",{ref:f,id:"foreground",style:S}),e("div",{ref:m,onMouseDown:e=>{if(!i||!m.current)return;const t=m.current.getBoundingClientRect(),n={type:i,x:e.offsetX/g,y:e.offsetY/g},r=(e,n)=>{const r=(n.clientX-t.x)/g,s=(n.clientY-t.y)/g;return{type:e.type,x:Math.min(e.x,r),y:Math.min(e.y,s),w:Math.abs(r-e.x),h:Math.abs(s-e.y)}},s=e=>{xm(f.current,{alpha:!0},(e,t)=>{t.clearRect(0,0,e.width,e.height)}),Cm(f.current,v,[...u,r(n,e)])},o=e=>{const t=r(n,e);t.w*g>=1&&t.h*g>=1&&d(e=>[...e,t]),Kp.removeEventListener("mousemove",s),Kp.removeEventListener("mouseup",o)};Kp.addEventListener("mousemove",s),Kp.addEventListener("mouseup",o)},style:S},u.map((t,n)=>e("div",{key:n,class:"editor__rect",style:{top:t.y*g+"px",left:t.x*g+"px",width:t.w*g+"px",height:t.h*g+"px"}},e("button",{"aria-label":s.removeHighlightText,onClick:b(n),onMouseDown:w,onMouseUp:w,type:"button"},e(a,null))))))),e(o,{options:s,action:i,setAction:l}))};return function({onError:r}){const[s,o]=t.useState();return i({onBeforeScreenshot:t.useCallback(()=>{l.display="none"},[]),onScreenshot:t.useCallback((e,t)=>{xm(Kp.createElement("canvas"),{alpha:!1},(n,r)=>{r.scale(t,t),n.width=e.videoWidth,n.height=e.videoHeight,r.drawImage(e,0,0,n.width,n.height),o({canvas:n,dpi:t})}),n.width=e.videoWidth,n.height=e.videoHeight},[]),onAfterScreenshot:t.useCallback(()=>{l.display="block"},[]),onError:t.useCallback(e=>{l.display="block",r(e)},[])}),s?e(u,{screenshot:s}):e("div",null)}}const Am=()=>({name:"FeedbackScreenshot",setupOnce(){},createInput:({h:e,hooks:t,dialog:n,options:r})=>{const s=Kp.createElement("canvas");return{input:Om({h:e,hooks:t,outputBuffer:s,dialog:n,options:r}),value:async()=>{const e=await new Promise(e=>
1{s.toBlob(e,"image/png")});if(e)return{data:new Uint8Array(await e.arrayBuffer()),filename:"screenshot.png",contentType:"application/png"}}}}}),Mm=["replayIntegration","replayCanvasIntegration","feedbackIntegration","feedbackModalIntegration","feedbackScreenshotIntegration","captureConsoleIntegration","contextLinesIntegration","linkedErrorsIntegration","dedupeIntegration","extraErrorDataIntegration","graphqlClientIntegration","httpClientIntegration","reportingObserverIntegration","rewriteFramesIntegration","browserProfilingIntegration","moduleMetadataIntegration","instrumentAnthropicAiClient","instrumentOpenAiClient","instrumentGoogleGenAIClient","instrumentLangGraph","createLangChainCallbackHandler","instrumentLangChainEmbeddings"],Rm={replayCanvasIntegration:"replay-canvas",feedbackModalIntegration:"feedback-modal",feedbackScreenshotIntegration:"feedback-screenshot"},Nm=oi;async function Pm(e,t){const n=Mm.includes(e)?function(e){return Rm[e]||e.replace("Integration","").toLowerCase()}(e):void 0,r=Nm.Sentry=Nm.Sentry||{};if(!n)throw new Error(`Cannot lazy load integration: ${e}`);const s=r[e];if("function"==typeof s&&!("_isShim"in s))return s;const i=function(e){var t;const n=Ge(),r=(null==n||null===(t=n.getOptions())||void 0===t?void 0:t.cdnBaseUrl)||"https://browser.sentry-cdn.com";return new URL(`/${a}/${e}.min.js`,r).toString()}(n),o=oi.document.createElement("script");o.src=i,o.crossOrigin="anonymous",o.referrerPolicy="strict-origin",t&&o.setAttribute("nonce",t);const c=new Promise((e,t)=>{o.addEventListener("load",()=>e()),o.addEventListener("error",t)}),l=oi.document.currentScript,u=oi.document.body||oi.document.head||(null==l?void 0:l.parentElement);if(!u)throw new Error(`Could not find parent element to insert lazy-loaded ${e} script`);u.appendChild(o);try{await c}catch{throw new Error(`Error when loading integration: ${e}`)}const d=r[e];if("function"!=typeof d)throw new Error(`Could not load integration: ${e}`);return d}const Lm=af({lazyLoadIntegration:Pm}),Dm=af({getModalIntegration:()=>Tm,getScreenshotIntegration:()=>Am}),$m="MULTIPLEXED_TRANSPORT_EXTRA_KEY";function jm(e,t){let n;return or(e,(e,r)=>(t.includes(r)&&(n=Array.isArray(e)?e[1]:void 0),!!n)),n}function Bm(e,t){return n=>{const r=e(n),s=new Map,i=t||(e=>{var t;const n=e.getEvent();return null!=n&&null!==(t=n.extra)&&void 0!==t&&t[$m]&&Array.isArray(n.extra[$m])?n.extra[$m]:[]});function o(t,r){const i=r?`${t}:${r}`:t;let o=s.get(i);if(!o){const a=zt(t);if(!a)return;const c=Kt(a,n.tunnel);o=r?function(e,t){return n=>{const r=e(n);return{...r,send:async e=>{const n=jm(e,["event","transaction","profile","replay_event"]);return n&&(n.release=t),r.send(e)}}}}(e,r)({...n,url:c}):e({...n,url:c}),s.set(i,o)}return[t,o]}return{send:async function(e){const t=i({envelope:e,getEvent:function(t){const n=null!=t&&t.length?t:["event"];return jm(e,n)}}).map(e=>"string"==typeof e?o(e,void 0):o(e.dsn,e.release)).filter(e=>!!e),n=t.length?t:[["",r]];return(await Promise.all(n.map(t=>{let[n,r]=t;return r.send(function(e,t){return sr(t?{...e[0],dsn:t}:e[0],e[1])}(e,n))})))[0]},flush:async function(e){const t=[...s.values(),r];return(await Promise.all(t.map(t=>t.flush(e)))).every(e=>e)}}}}const Fm=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.levels||R,n=e.handled??!0;return{name:"CaptureConsole",setup(e){"console"in c&&yi(r=>{let{args:s,level:i}=r;Ge()===e&&t.includes(i)&&function(e,t,n){const r=Ai(t),s=new Error,i={level:Ai(t),extra:{arguments:e}};Je(o=>{if(o.addEventProcessor(e=>(e.logger="console",ye(e,{handled:n,type:"auto.core.capture_console"}),e)),"assert"===t){if(!e[0]){const t=`Assertion failed: ${le(e.slice(1)," ")||"console.assert"}`;o.setExtra("arguments",e.slice(1)),o.captureMessage(t,r,{captureContext:i,syntheticException:s})}return}const a=e.find(e=>e instanceof Error);if(a)return void Fs(a,i);const c=le(e," ");o.captureMessage(c,r,{captureContext:i,syntheticException:s})})}(s,i,n)})}}};function Um(e,t,n){return"util"in c&&"function"==typeof c.util.format?c.util.format(...e):function(e,t,n){return e.map(e=>_(e)?String(e):JSON.stringify(tr(e,t,n))).join(" ")}(e,t,n)}function zm(e){return/%[sdifocO]/.test(e)}function Wm(e,t){const n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((e,t)=>{n[`sentry.message.parameter.${t}`]=e}),n}const Hm={[mt]:"auto.log.console"},qm=function(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).levels||R;return{name:"ConsoleLogs",setup(t){const{enableLogs:n,normalizeDepth:r=3,normalizeMaxBreadth:s=1e3}=t.getOptions();n?yi(n=>{let{args:i,level:o}=n;
1if(Ge()!==t||!e.includes(o))return;const a=i[0],c=i.slice(1);if("assert"===o)return void(a||Rr({level:"error",message:c.length>0?`Assertion failed: ${Um(c,r,s)}`:"Assertion failed",attributes:Hm}));const l="log"===o,u=i.length>1&&"string"==typeof i[0]&&!zm(i[0]),d={...Hm,...u?Wm(a,c):{}};Rr({level:l?"info":o,message:Um(i,r,s),severityNumber:l?10:void 0,attributes:d})}):o&&j.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled")}}},Vm=["trace","debug","info","warn","error","fatal"];function Jm(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=new Set(e.levels??Vm),n=e.client;return{log(e){const{type:r,level:s,message:i,args:o,tag:a,date:c,...l}=e,u=n||Ge();if(!u)return;const d=function(e,t){if("verbose"===e)return"debug";if("silent"===e)return"trace";if(e){const t=Km[e];if(t)return t}if("number"==typeof t){const e=Gm[t];if(e)return e}return"info"}(r,s);if(!t.has(d))return;const{normalizeDepth:h=3,normalizeMaxBreadth:p=1e3}=u.getOptions(),f={};for(const[e,t]of Object.entries(l))f[e]=tr(t,h,p);f["sentry.origin"]="auto.log.consola",a&&(f["consola.tag"]=a),r&&(f["consola.type"]=r),null!=s&&"number"==typeof s&&(f["consola.level"]=s);const m=function(e,t,n){const{message:r,attributes:s,messageTemplate:i,messageParameters:o}=e,a={};if(i&&o){const e=Wm(i,o);for(const[r,s]of Object.entries(e))a[r]=r.startsWith("sentry.message.parameter.")?tr(s,t,n):s}else o&&o.length>0&&o.forEach((e,r)=>{a[`sentry.message.parameter.${r}`]=tr(e,t,n)});return{message:r,attributes:{...tr(s,t,n),...a}}}(function(e,t,n){if(null==e||!e.length)return{message:""};const r=Um(e,t,n),s=e[0];if(b(s)){const t="string"==typeof e[1]?2:1;return{message:r,attributes:s,messageParameters:e.slice(t)}}{const t=e.slice(1),n=t.length>0&&"string"==typeof s&&!zm(s);return{message:r,messageTemplate:n?s:void 0,messageParameters:n?t:void 0}}}(o,h,p),h,p);null!=m&&m.attributes&&Object.assign(f,m.attributes),Rr({level:d,message:(null==m?void 0:m.message)||i||o&&Um(o,h,p)||"",attributes:f})}}}const Km={silent:"trace",fatal:"fatal",error:"error",warn:"warn",log:"info",info:"info",success:"info",fail:"error",ready:"info",start:"info",box:"info",debug:"debug",trace:"trace",verbose:"debug",critical:"fatal",notice:"info"},Gm={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"},Xm="gen_ai.prompt",Ym="gen_ai.system",Qm="gen_ai.request.model",Zm="gen_ai.request.stream",eg="gen_ai.request.temperature",tg="gen_ai.request.max_tokens",ng="gen_ai.request.frequency_penalty",rg="gen_ai.request.presence_penalty",sg="gen_ai.request.top_p",ig="gen_ai.request.top_k",og="gen_ai.request.encoding_format",ag="gen_ai.request.dimensions",cg="gen_ai.response.finish_reasons",lg="gen_ai.response.model",ug="gen_ai.response.id",dg="gen_ai.response.stop_reason",hg="gen_ai.usage.input_tokens",pg="gen_ai.usage.output_tokens",fg="gen_ai.usage.total_tokens",mg="gen_ai.operation.name",gg="sentry.sdk_meta.gen_ai.input.messages.original_length",yg="gen_ai.input.messages",vg="gen_ai.system_instructions",_g="gen_ai.response.text",bg="gen_ai.request.available_tools",Sg="gen_ai.response.streaming",wg="gen_ai.response.tool_calls",kg="gen_ai.agent.name",Tg="gen_ai.pipeline.name",Eg="gen_ai.conversation.id",xg="gen_ai.usage.cache_creation_input_tokens",Ig="gen_ai.usage.cache_read_input_tokens",Cg="gen_ai.invoke_agent",Og="gen_ai.embeddings.input",Ag="gen_ai.embeddings",Mg="gen_ai.tool.name",Rg="gen_ai.tool.input",Ng="gen_ai.tool.output";function Pg(e){return!(!e||"object"!=typeof e)&&(function(e){return"type"in e&&"string"==typeof e.type&&"source"in e&&Pg(e.source)}(e)||Dg(e)||function(e){return"image_url"in e&&("string"==typeof e.image_url?e.image_url.startsWith("data:"):Lg(e))}(e)||$g(e)||jg(e)||function(e){return"media_type"in e&&"string"==typeof e.media_type&&"data"in e}(e)||function(e){return"type"in e&&"file"===e.type&&"mediaType"in e&&"string"==typeof e.mediaType&&"data"in e&&"string"==typeof e.data&&!e.data.startsWith("http://")&&!e.data.startsWith("https://")}(e)||function(e){return"type"in e&&"image"===e.type&&"image"in e&&"string"==typeof e.image&&!e.image.startsWith("http://")&&!e.image.startsWith("https://")}(e)||function(e){return"type"in e&&("blob"===e.type||"base64"===e.type)}(e)||function(e){return"b64_json"in e}(e)||function(e){return"type"in e&&"result"in e&&"image_generation"===e.type}(e)||function(e){return"uri"in e&&"string"==typeof e.uri&&e.uri.startsWith("data:")}(e))}function Lg(e){return"image_url"in e&&!!e.image_url&&"object"==typeof e.image_url&&"url"in e.image_url&&"string"==typeof e.image_url.url&&e.
1image_url.url.startsWith("data:")}function Dg(e){return"inlineData"in e&&!!e.inlineData&&"object"==typeof e.inlineData&&"data"in e.inlineData&&"string"==typeof e.inlineData.data}function $g(e){return"type"in e&&"input_audio"===e.type&&"input_audio"in e&&!!e.input_audio&&"object"==typeof e.input_audio&&"data"in e.input_audio&&"string"==typeof e.input_audio.data}function jg(e){return"type"in e&&"file"===e.type&&"file"in e&&!!e.file&&"object"==typeof e.file&&"file_data"in e.file&&"string"==typeof e.file.file_data}const Bg="[Blob substitute]",Fg=["image_url","data","content","b64_json","result","uri","image"];function Ug(e){const t={...e};Pg(t.source)&&(t.source=Ug(t.source)),Dg(e)&&(t.inlineData={...e.inlineData,data:Bg}),Lg(e)&&(t.image_url={...e.image_url,url:Bg}),$g(e)&&(t.input_audio={...e.input_audio,data:Bg}),jg(e)&&(t.file={...e.file,file_data:Bg});for(const e of Fg)"string"==typeof t[e]&&(t[e]=Bg);return t}const zg=2e4,Wg=e=>(new TextEncoder).encode(e).length,Hg=e=>Wg(JSON.stringify(e));function qg(e,t){if(Wg(e)<=t)return e;let n=0,r=e.length,s="";for(;n<=r;){const i=Math.floor((n+r)/2),o=e.slice(0,i);Wg(o)<=t?(s=o,n=i+1):r=i-1}return s}function Vg(e){return"string"==typeof e?e:"text"in e&&"string"==typeof e.text?e.text:""}function Jg(e,t){return"string"==typeof e?t:{...e,text:t}}function Kg(e){return null!==e&&"object"==typeof e&&"content"in e&&Array.isArray(e.content)}function Gg(e){return null!==e&&"object"==typeof e&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function Xg(e,t){if(!e)return[];if("string"==typeof e){const n=qg(e,t);return n?[n]:[]}return"object"!=typeof e?[]:function(e){return null!==e&&"object"==typeof e&&"content"in e&&"string"==typeof e.content}(e)?function(e,t){const n={...e,content:""},r=t-Hg(n);if(r<=0)return[];const s=qg(e.content,r);return[{...e,content:s}]}(e,t):Kg(e)||Gg(e)?function(e,t){const{key:n,items:r}=function(e){return"parts"in e&&Array.isArray(e.parts)?{key:"parts",items:e.parts}:"content"in e&&Array.isArray(e.content)?{key:"content",items:e.content}:{key:null,items:[]}}(e);if(null===n||0===r.length)return[];const s=r.map(e=>Jg(e,""));let i=t-Hg({...e,[n]:s});if(i<=0)return[];const o=[];for(const e of r){const t=Vg(e),n=Wg(t);if(!(n<=i)){if(0===o.length){const n=qg(t,i);n&&o.push(Jg(e,n));break}break}o.push(e),i-=n}return o.length<=0?[]:[{...e,[n]:o}]}(e,t):[]}function Yg(e){return e.map(e=>{let t;return e&&"object"==typeof e&&(Kg(e)?t={...e,content:Yg(e.content)}:"content"in e&&Pg(e.content)&&(t={...e,content:Ug(e.content)}),Gg(e)&&(t={...t??e,parts:Yg(e.parts)}),Pg(t)?t=Ug(t):Pg(e)&&(t=Ug(e))),t??e})}function Qg(e,t){if(!Array.isArray(e)||0===e.length)return e;const n=t-2,r=Yg([e[e.length-1]]),s=r[0];return Hg(s)<=n?r:Xg(s,n)}function Zg(e){return Qg(e,zg)}function ey(e){var t;const n=Boolean(null===(t=Ge())||void 0===t?void 0:t.getOptions().sendDefaultPii);return{...e,recordInputs:(null==e?void 0:e.recordInputs)??n,recordOutputs:(null==e?void 0:e.recordOutputs)??n}}function ty(e,t){return e?`${e}.${t}`:t}function ny(e,t,n){if(!e.isRecording())return;const r={[Sg]:!0};t.responseId&&(r[ug]=t.responseId),t.responseModel&&(r[lg]=t.responseModel),void 0!==t.promptTokens&&(r[hg]=t.promptTokens),void 0!==t.completionTokens&&(r[pg]=t.completionTokens),void 0!==t.totalTokens?r[fg]=t.totalTokens:void 0===t.promptTokens&&void 0===t.completionTokens&&void 0===t.cacheCreationInputTokens&&void 0===t.cacheReadInputTokens||(r[fg]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)),t.finishReasons.length&&(r[cg]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[_g]=t.responseTexts.join("")),n&&t.toolCalls.length&&(r[wg]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function ry(e){if("string"==typeof e)return qg(e,zg);if(Array.isArray(e)){const t=Zg(e);return JSON.stringify(t)}return JSON.stringify(e)}function sy(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};const t=e.findIndex(e=>e&&"object"==typeof e&&"role"in e&&"system"===e.role);if(-1===t)return{systemInstructions:void 0,filteredMessages:e};const n=e[t],r="string"==typeof n.content?n.content:void 0!==n.content?JSON.stringify(n.content):void 0;return r?{systemInstructions:JSON.stringify([{type:"text",content:r}]),filteredMessages:[...e.slice(0,t),...e.slice(t+1)]}:{systemInstructions:void 0,filteredMessages:e}}function iy(e,t,n){return w(e)?new Proxy(e,{get(e,r){const s=r in Promise.prototype||r===Symbol.toStringTag?t:e,i=Reflect.get(s,r);return"withResponse"===r&&"function"==typeof i?function(){return async function(e,t,n){const r=e.catch(e=>{throw Fs(e,{mechanism:{handled:!1,type:n}}),e}),s=await t,i=await r;return i&&"object"==typeof i&&"data"in i?{...i,data:s}:s}(i.call(e),t,n)}:"function"==typeof i?i.bind(s):i}}):t}const oy="auto.ai.langchain",ay={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"},cy=(e,t,n)=>{null!=n&&(e[t]=n)},ly=(e,t,n)=>{const r=Number(n);Number.isNaN(r)||(e[t]=r)};function uy(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch{return String(e)}}function dy(e){if(Array.isArray(e))try{const t=e.map(e=>e&&"object"==typeof e&&Pg(e)?Ug(e):e);return JSON.stringify(t)}catch{return String(e)}return uy(e)}function hy(e){const t=e.toLowerCase();return ay[t]??t}function py(e){return e.includes("System")?"system":e.includes("Human")?"user":e.includes("AI")||e.includes("Assistant")?"assistant":e.includes("Function")?"function":e.includes("Tool")?"tool":"user"}function fy(e){if(e&&!Array.isArray(e))return e.invocation_params}function my(e){return e.map(e=>{var t;const n=e._getType;if("function"==typeof n)return{role:hy(n.call(e)),content:dy(e.content)};if(1===e.lc&&e.kwargs){var r;const t=e.id,n=Array.isArray(t)&&t.length>0?t[t.length-1]:"";return{role:hy("string"==typeof n?py(n):"user"),content:dy(null===(r=e.kwargs)||void 0===r?void 0:r.content)}}if(e.type)return{role:hy(String(e.type).toLowerCase()),content:dy(e.content)};if(e.role)return{role:hy(String(e.role)),content:dy(e.content)};const s=null===(t=e.constructor)||void 0===t?void 0:t.name;return s&&"Object"!==s?{role:hy(py(s)),content:dy(e.content)}:{role:"user",content:dy(e.content)}})}function gy(e,t,n){const r={},s="kwargs"in e?e.kwargs:void 0,i=(null==t?void 0:t.temperature)??(null==n?void 0:n.ls_temperature)??(null==s?void 0:s.temperature);ly(r,eg,i);const o=(null==t?void 0:t.max_tokens)??(null==n?void 0:n.ls_max_tokens)??(null==s?void 0:s.max_tokens);ly(r,tg,o);const a=(null==t?void 0:t.top_p)??(null==s?void 0:s.top_p);ly(r,sg,a);const c=null==t?void 0:t.frequency_penalty;ly(r,ng,c);const l=null==t?void 0:t.presence_penalty;return ly(r,rg,l),t&&"stream"in t&&cy(r,Zm,Boolean(t.stream)),r}
1function yy(e,t,n,r,s){return{[Ym]:uy(e??"langchain"),[mg]:"chat",[Qm]:uy(t),[mt]:oy,...gy(n,r,s)}}function vy(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{recordInputs:t,recordOutputs:n}=ey(e),r=new Map,s=e=>{const t=r.get(e);null!=t&&t.isRecording()&&(t.end(),r.delete(e))},i={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(e,n,s,i,o,a,c,l){const u=fy(a),d=function(e,t,n,r,s){const i=yy(null==s?void 0:s.ls_provider,(null==r?void 0:r.model)??(null==s?void 0:s.ls_model_name)??"unknown",e,r,s);if(n&&Array.isArray(t)&&t.length>0){cy(i,gg,t.length);const e=t.map(e=>({role:"user",content:e}));cy(i,yg,uy(e))}return i}(e,n,t,u,c),h=d[Qm];ua({name:`${d[mg]} ${h}`,op:"gen_ai.chat",attributes:{...d,[ft]:"gen_ai.chat"}},e=>(r.set(s,e),e))},handleChatModelStart(e,n,s,i,o,a,c,l){const u=fy(a),d=function(e,t,n,r,s){var i;const o=yy((null==s?void 0:s.ls_provider)??(null===(i=e.id)||void 0===i?void 0:i[2]),(null==r?void 0:r.model)??(null==s?void 0:s.ls_model_name)??"unknown",e,r,s);if(n&&Array.isArray(t)&&t.length>0){const e=my(t.flat()),{systemInstructions:n,filteredMessages:r}=sy(e);n&&cy(o,vg,n);const s=Array.isArray(r)?r.length:0;cy(o,gg,s);const i=Zg(r);cy(o,yg,uy(i))}return o}(e,n,t,u,c),h=d[Qm];ua({name:`${d[mg]} ${h}`,op:"gen_ai.chat",attributes:{...d,[ft]:"gen_ai.chat"}},e=>(r.set(s,e),e))},handleLLMEnd(e,t,i,o,a){const c=r.get(t);if(null!=c&&c.isRecording()){const r=function(e,t){var n,r,s;if(!e)return;const i={};if(Array.isArray(e.generations)){const n=e.generations.flat().map(e=>{var t,n;return null!==(t=e.generationInfo)&&void 0!==t&&t.finish_reason?e.generationInfo.finish_reason:null!==(n=e.generation_info)&&void 0!==n&&n.finish_reason?e.generation_info.finish_reason:null}).filter(e=>"string"==typeof e);if(n.length>0&&cy(i,cg,uy(n)),function(e,t){const n=[],r=e.flat();for(const e of r){var s;const t=null===(s=e.message)||void 0===s?void 0:s.content;if(Array.isArray(t))for(const e of t){const t=e;"tool_use"===t.type&&n.push(t)}}n.length>0&&cy(t,wg,uy(n))}(e.generations,i),t){const t=e.generations.flat().map(e=>{var t;return e.text??(null===(t=e.message)||void 0===t?void 0:t.content)}).filter(e=>"string"==typeof e);t.length>0&&cy(i,_g,uy(t))}}!function(e,t){if(!e)return;const n=e.tokenUsage,r=e.usage;if(n)ly(t,hg,n.promptTokens),ly(t,pg,n.completionTokens),ly(t,fg,n.totalTokens);else if(r){ly(t,hg,r.input_tokens),ly(t,pg,r.output_tokens);const e=Number(r.input_tokens),n=Number(r.output_tokens),s=(Number.isNaN(e)?0:e)+(Number.isNaN(n)?0:n);s>0&&ly(t,fg,s),void 0!==r.cache_creation_input_tokens&&ly(t,xg,r.cache_creation_input_tokens),void 0!==r.cache_read_input_tokens&&ly(t,Ig,r.cache_read_input_tokens)}}(e.llmOutput,i);const o=e.llmOutput,a=null===(n=e.generations)||void 0===n||null===(n=n[0])||void 0===n?void 0:n[0],c=null==a?void 0:a.message,l=(null==o?void 0:o.model_name)??(null==o?void 0:o.model)??(null==c||null===(r=c.response_metadata)||void 0===r?void 0:r.model_name);l&&cy(i,lg,l);const u=(null==o?void 0:o.id)??(null==c?void 0:c.id);u&&cy(i,ug,u);const d=(null==o?void 0:o.stop_reason)??(null==c||null===(s=c.response_metadata)||void 0===s?void 0:s.finish_reason);return d&&cy(i,dg,uy(d)),i}(e,n);r&&c.setAttributes(r),s(t)}},handleLLMError(e,t){const n=r.get(t);null!=n&&n.isRecording()&&(n.setStatus({code:ln,message:"internal_error"}),s(t)),Fs(e,{mechanism:{handled:!1,type:`${oy}.llm_error_handler`}})},handleChainStart(e,n,s,i,o,a,c,l){const u=l||e.name||"unknown_chain",d={[mt]:"auto.ai.langchain","langchain.chain.name":u};t&&(d["langchain.chain.inputs"]=JSON.stringify(n)),ua({name:`chain ${u}`,op:"gen_ai.invoke_agent",attributes:{...d,[ft]:"gen_ai.invoke_agent"}},e=>(r.set(s,e),e))},handleChainEnd(e,t){const i=r.get(t);null!=i&&i.isRecording()&&(n&&i.setAttributes({"langchain.chain.outputs":JSON.stringify(e)}),s(t))},handleChainError(e,t){const n=r.get(t);null!=n&&n.isRecording()&&(n.setStatus({code:ln,message:"internal_error"}),s(t)),Fs(e,{mechanism:{handled:!1,type:`${oy}.chain_error_handler`}})},handleToolStart(e,n,s,i){const o=e.name||"unknown_tool",a={[mt]:oy,[Mg]:o};t&&(a[Rg]=n),ua({name:`execute_tool ${o}`,op:"gen_ai.execute_tool",attributes:{...a,[ft]:"gen_ai.execute_tool"}},e=>(r.set(s,e),e))},handleToolEnd(e,t){const i=r.get(t);null!=i&&i.isRecording()&&(n&&i.setAttributes({[Ng]:JSON.stringify(e)}),s(t))},handleToolError(e,t){const n=r.get(t);null!=n&&n.isRecording()&&(n.setStatus({code:ln,message:"internal_error"}),s(t)),Fs(e,{mechanism:{handled:!1,type:`${oy}.tool_error_handler`}})},copy:()=>i,toJSON:()=>
1({lc:1,type:"not_implemented",id:i.lc_id}),toJSONNotImplemented:()=>({lc:1,type:"not_implemented",id:i.lc_id})};return i}const _y=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const{depth:t=3,captureErrorCause:n=!0}=e;return{name:"ExtraErrorData",processEvent(e,r,s){const{maxValueLength:i}=s.getOptions();return function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,s=arguments.length>4?arguments[4]:void 0;if(!t.originalException||!p(t.originalException))return e;const i=t.originalException.name||t.originalException.constructor.name,o=by(t.originalException,r,s);if(o){const t={...e.contexts},r=tr(o,n);return b(r)&&(F(r,"__sentry_skip_normalization__",!0),t[i]=r),{...e,contexts:t}}return e}(e,r,t,n,i)}}};function by(e,t,n){try{const r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],s={};for(const t of Object.keys(e)){if(-1!==r.indexOf(t))continue;const i=e[t];s[t]=p(i)||"string"==typeof i?n?ae(`${i}`,n):`${i}`:i}if(t&&void 0!==e.cause)if(p(e.cause)){const t=e.cause.name||e.cause.constructor.name;s.cause={[t]:by(e.cause,!1,n)}}else s.cause=e.cause;if("function"==typeof e.toJSON){const t=e.toJSON();for(const e of Object.keys(t)){const n=t[e];s[e]=p(n)?n.toString():n}}return s}catch(e){o&&j.error("Unable to extract extra data from the Error object:",e)}return null}const Sy=()=>
1({name:"FeatureFlags",processEvent:(e,t,n)=>Up(e),addFeatureFlag(e,t){zp(e,t),Wp(e,t)}}),wy={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"},"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}},ky={invalid_request_error:"invalid_argument",authentication_error:"unauthenticated",permission_error:"permission_denied",not_found_error:"not_found",request_too_large:"failed_precondition",rate_limit_error:"resource_exhausted",api_error:"internal_error",overloaded_error:"unavailable"};function Ty(e){return e&&ky[e]||"internal_error"}function Ey(e,t,n,r){if(!e||"object"!=typeof e)return;const s=function(e,t){var n;return"type"in e&&"string"==typeof e.type&&"error"===e.type&&(t.setStatus({code:ln,message:Ty(null===(n=e.error)||void 0===n?void 0:n.type)}),Fs(e.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}),!0)}(e,r);s||(function(e,t){if("message_delta"===e.type&&e.usage&&"output_tokens"in e.usage&&"number"==typeof e.usage.output_tokens&&(t.completionTokens=e.usage.output_tokens),e.message){const n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.stop_reason&&t.finishReasons.push(n.stop_reason),n.usage&&("number"==typeof n.usage.input_tokens&&(t.promptTokens=n.usage.input_tokens),"number"==typeof n.usage.cache_creation_input_tokens&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),"number"==typeof n.usage.cache_read_input_tokens&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}(e,t),function(e,t){"content_block_start"===e.type&&"number"==typeof e.index&&e.content_block&&("tool_use"!==e.content_block.type&&"server_tool_use"!==e.content_block.type||(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]}))}(e,t),function(e,t,n){if("content_block_delta"===e.type&&e.delta){if("number"==typeof e.index&&"partial_json"in e.delta&&"string"==typeof e.delta.partial_json){const n=t.activeToolBlocks[e.index];n&&n.inputJsonParts.push(e.delta.partial_json)}n&&"string"==typeof e.delta.text&&t.responseTexts.push(e.delta.text)}}(e,t,n),function(e,t){if("content_block_stop"!==e.type||"number"!=typeof e.index)return;const n=t.activeToolBlocks[e.index];if(!n)return;const r=n.inputJsonParts.join("");let s;try{s=r?JSON.parse(r):{}}catch{s={__unparsed:r}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:s}),delete t.activeToolBlocks[e.index]}(e,t))}function xy(e,t){const n=function(e){const{system:t,messages:n,input:r}=e,s="string"==typeof t?[{role:"system",content:e.system}]:[],i=Array.isArray(r)?r:null!=r?[r]:void 0,o=Array.isArray(n)?n:null!=n?[n]:[];return[...s,...i??o]}(t);!function(e,t){if(Array.isArray(t)&&0===t.length)return;const{systemInstructions:n,filteredMessages:r}=sy(t);n&&e.setAttributes({[vg]:n});const s=Array.isArray(r)?r.length:1;e.setAttributes({[yg]:ry(r),[gg]:s})}(e,n),"prompt"in t&&e.setAttributes({[Xm]:JSON.stringify(t.prompt)})}function Iy(e,t,n){t&&"object"==typeof t&&("type"in t&&"error"===t.type?function(e,t){t.error&&(e.setStatus({code:ln,message:Ty(t.error.type)}),Fs(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}(e,t):(n&&function(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[_g]:t.content.map(e=>e.text).filter(e=>!!e).join("")});const n=[];for(const e of t.content)"tool_use"!==e.type&&"server_tool_use"!==e.type||n.push(e);n.length>0&&e.setAttributes({[wg]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[_g]:t.completion}),"input_tokens"in t&&e.setAttributes({[_g]:JSON.stringify(t.input_tokens)})}(e,t),function(e,t){"id"in t&&"model"in t&&(e.setAttributes({[ug]:t.id,[lg]:t.model}),"usage"in t&&t.usage&&function(e,t,n,r,s){if(void 0!==t&&e.setAttributes({[hg]:t}),void 0!==n&&e.setAttributes({[pg]:n}),void 0!==t||void 0!==n||void 0!==r||void 0!==s){const i=(t??0)+(n??0)+(r??0)+(s??0);e.setAttributes({[fg]:i})}}(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}(e,t)))}function Cy(e,t,n){throw Fs(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:n}}}),t.isRecording()&&(t.setStatus({code:ln,message:"internal_error"}),t.end()),e}
1function Oy(e,t,n,r,s){return new Proxy(e,{apply(i,o,a){const c=n.operation||"unknown",l=function(e,t,n){const r={[Ym]:"anthropic",[mg]:n,[mt]:"auto.ai.anthropic"};if(e.length>0&&"object"==typeof e[0]&&null!==e[0]){const t=e[0];t.tools&&Array.isArray(t.tools)&&(r[bg]=JSON.stringify(t.tools)),r[Qm]=t.model??"unknown","temperature"in t&&(r[eg]=t.temperature),"top_p"in t&&(r[sg]=t.top_p),"stream"in t&&(r[Zm]=t.stream),"top_k"in t&&(r[ig]=t.top_k),"frequency_penalty"in t&&(r[ng]=t.frequency_penalty),"max_tokens"in t&&(r[tg]=t.max_tokens)}else r[Qm]="models.retrieve"===t||"models.get"===t?e[0]:"unknown";return r}(a,t,c),u=l[Qm]??"unknown",d="object"==typeof a[0]?a[0]:void 0,h=Boolean(null==d?void 0:d.stream),p=!0===n.streaming;if(h||p)return function(e,t,n,r,s,i,o,a,c,l,u){const d={name:`${i} ${s[Qm]??"unknown"}`,op:`gen_ai.${i}`,attributes:s};if(l&&!u){let t;const s=ua(d,s=>(t=e.apply(n,r),c.recordInputs&&a&&xy(s,a),(async()=>{try{return async function*(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(const s of e)Ey(s,r,n,t),yield s}finally{ny(t,r,n)}}(await t,s,c.recordOutputs??!1)}catch(e){return Cy(e,s,o)}})()));return iy(t,s,"auto.ai.anthropic")}return ua(d,e=>{try{return c.recordInputs&&a&&xy(e,a),function(e,t,n){const r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",e=>{Ey(e,r,n,t)}),e.on("message",()=>{ny(t,r,n)}),e.on("error",e=>{Fs(e,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:ln,message:"internal_error"}),t.end())}),e}(t.apply(n,r),e,c.recordOutputs??!1)}catch(t){return Cy(t,e,o)}})}(e,i,r,a,l,c,t,d,s,h,p);let f;const m=la({name:`${c} ${u}`,op:`gen_ai.${c}`,attributes:l},e=>(f=i.apply(r,a),s.recordInputs&&d&&xy(e,d),f.then(t=>(Iy(e,t,s.recordOutputs),t),e=>{throw Fs(e,{mechanism:{handled:!1,type:"auto.ai.anthropic",data:{function:t}}}),e})));return iy(f,m,"auto.ai.anthropic")}})}function Ay(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return new Proxy(e,{get(e,r){const s=e[r],i=ty(t,String(r)),o=wy[i];return"function"==typeof s&&o?Oy(s,i,o,e,n):"function"==typeof s?s.bind(e):s&&"object"==typeof s?Ay(s,i,n):s}})}function My(e,t){return Ay(e,"",ey(t))}const Ry={"models.generateContent":{operation:"generate_content"},"models.generateContentStream":{operation:"generate_content",streaming:!0},"models.embedContent":{operation:"embeddings"},"chats.create":{proxyResultPath:"chat"},"chat.sendMessage":{operation:"chat"},"chat.sendMessageStream":{operation:"chat",streaming:!0}},Ny="google_genai";function Py(e,t,n,r){e&&!function(e,t){const n=null==e?void 0:e.promptFeedback;if(null!=n&&n.blockReason){const e=n.blockReasonMessage??n.blockReason;return t.setStatus({code:ln,message:"internal_error"}),Fs(`Content blocked: ${e}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}(e,r)&&(function(e,t){"string"==typeof e.responseId&&(t.responseId=e.responseId),"string"==typeof e.modelVersion&&(t.responseModel=e.modelVersion);const n=e.usageMetadata;n&&("number"==typeof n.promptTokenCount&&(t.promptTokens=n.promptTokenCount),"number"==typeof n.candidatesTokenCount&&(t.completionTokens=n.candidatesTokenCount),"number"==typeof n.totalTokenCount&&(t.totalTokens=n.totalTokenCount))}(e,t),function(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(const s of e.candidates??[]){null!=s&&s.finishReason&&!t.finishReasons.includes(s.finishReason)&&t.finishReasons.push(s.finishReason);for(const e of(null==s||null===(r=s.content)||void 0===r?void 0:r.parts)??[]){var r;n&&e.text&&t.responseTexts.push(e.text),e.functionCall&&t.toolCalls.push({type:"function",id:e.functionCall.id,name:e.functionCall.name,arguments:e.functionCall.args})}}}
1(e,t,n))}function Ly(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"user";return"string"==typeof e?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(e=>Ly(e,t)):"object"==typeof e&&e?"role"in e&&"string"==typeof e.role?[e]:"parts"in e?[{...e,role:t}]:[{role:t,content:e}]:[]}function Dy(e,t){if("model"in e&&"string"==typeof e.model)return e.model;if(t&&"object"==typeof t){const e=t;if("model"in e&&"string"==typeof e.model)return e.model;if("modelVersion"in e&&"string"==typeof e.modelVersion)return e.modelVersion}return"unknown"}function $y(e,t,n){if(n){const n=t.contents;return void(null!=n&&e.setAttribute(Og,"string"==typeof n?n:JSON.stringify(n)))}const r=[];if("config"in t&&t.config&&"object"==typeof t.config&&"systemInstruction"in t.config&&t.config.systemInstruction&&r.push(...Ly(t.config.systemInstruction,"system")),"history"in t&&r.push(...Ly(t.history,"user")),"contents"in t&&r.push(...Ly(t.contents,"user")),"message"in t&&r.push(...Ly(t.message,"user")),Array.isArray(r)&&r.length){const{systemInstructions:t,filteredMessages:n}=sy(r);t&&e.setAttribute(vg,t);const s=Array.isArray(n)?n.length:0;e.setAttributes({[gg]:s,[yg]:JSON.stringify(Zg(n))})}}function jy(e,t,n,r,s){const i="embeddings"===n.operation;return new Proxy(e,{apply(e,o,a){const c=n.operation||"unknown",l=a[0],u=function(e,t,n){const r={[Ym]:Ny,[mg]:e,[mt]:"auto.ai.google_genai"};if(t){if(r[Qm]=Dy(t,n),"config"in t&&"object"==typeof t.config&&t.config){const e=t.config;if(Object.assign(r,function(e){const t={};return"temperature"in e&&"number"==typeof e.temperature&&(t[eg]=e.temperature),"topP"in e&&"number"==typeof e.topP&&(t[sg]=e.topP),"topK"in e&&"number"==typeof e.topK&&(t[ig]=e.topK),"maxOutputTokens"in e&&"number"==typeof e.maxOutputTokens&&(t[tg]=e.maxOutputTokens),"frequencyPenalty"in e&&"number"==typeof e.frequencyPenalty&&(t[ng]=e.frequencyPenalty),"presencePenalty"in e&&"number"==typeof e.presencePenalty&&(t[rg]=e.presencePenalty),t}(e)),"tools"in e&&Array.isArray(e.tools)){const t=e.tools.flatMap(e=>e.functionDeclarations);r[bg]=JSON.stringify(t)}}}else r[Qm]=Dy({},n);return r}(c,l,r),d=u[Qm]??"unknown";return n.streaming?ua({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},async n=>{try{return s.recordInputs&&l&&$y(n,l,i),async function*(e,t,n){const r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(const s of e)Py(s,r,n,t),yield s}finally{ny(t,r,n)}}(await e.apply(r,a),n,Boolean(s.recordOutputs))}catch(e){throw n.setStatus({code:ln,message:"internal_error"}),Fs(e,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}}),n.end(),e}}):la({name:`${c} ${d}`,op:`gen_ai.${c}`,attributes:u},n=>(s.recordInputs&&l&&$y(n,l,i),aa(()=>e.apply(r,a),e=>{Fs(e,{mechanism:{handled:!1,type:"auto.ai.google_genai",data:{function:t}}})},()=>{},e=>{i||function(e,t,n){if(t&&"object"==typeof t){if(t.modelVersion&&e.setAttribute(lg,t.modelVersion),t.usageMetadata&&"object"==typeof t.usageMetadata){const n=t.usageMetadata;"number"==typeof n.promptTokenCount&&e.setAttributes({[hg]:n.promptTokenCount}),"number"==typeof n.candidatesTokenCount&&e.setAttributes({[pg]:n.candidatesTokenCount}),"number"==typeof n.totalTokenCount&&e.setAttributes({[fg]:n.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){const n=t.candidates.map(e=>{var t;return null!==(t=e.content)&&void 0!==t&&t.parts&&Array.isArray(e.content.parts)?e.content.parts.map(e=>"string"==typeof e.text?e.text:"").filter(e=>e.length>0).join(""):""}).filter(e=>e.length>0);n.length>0&&e.setAttributes({[_g]:n.join("")})}if(n&&t.functionCalls){const n=t.functionCalls;Array.isArray(n)&&n.length>0&&e.setAttributes({[wg]:JSON.stringify(n)})}}}(n,e,s.recordOutputs)})))}})}function By(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return new Proxy(e,{get:(e,r,s)=>{const i=Reflect.get(e,r,s),o=ty(t,String(r)),a=Ry[o];if("function"==typeof i&&a){const t=a.operation?jy(i,o,a,e,n):i.bind(e);return a.proxyResultPath?function(){const e=t(...arguments);return e&&"object"==typeof e?By(e,a.proxyResultPath,n):e}:t}return"function"==typeof i?i.bind(e):i&&"object"==typeof i?By(i,o,n):i}})}function Fy(e,t){return By(e,"",ey(t))}function Uy(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{recordInputs:n}=ey(t);return new Proxy(e,{apply(e,t,r){const s=function(e){const t=e??{},n={[mt]:oy,[ft]:Ag,[mg]:"embeddings",[Qm]:t.model??"unknown"};return n[Ym]=function(e){var t;const n=(null===(t=e.constructor)||void 0===t?void 0:t.name)??"";return n.includes("OpenAI")?"openai":n.includes("Google")?"google_genai":n.includes("Mistral")?"mistralai":n.includes("Vertex")?"google_vertexai":n.includes("Bedrock")?"aws_bedrock":n.includes("Ollama")?"ollama":n.includes("Cloudflare")?"cloudflare":n.includes("Cohere")?"cohere":"langchain"}(t),"dimensions"in t&&(n[ag]=t.dimensions),"encodingFormat"in t&&(n[og]=t.encodingFormat),n}(t),i=s[Qm]||"unknown";if(n){const e=r[0];null!=e&&(s[Og]="string"==typeof e?e:JSON.stringify(e))}return la({name:`embeddings ${i}`,op:Ag,attributes:s},()=>Reflect.apply(e,t,r).then(void 0,e=>{throw Fs(e,{mechanism:{handled:!1,type:"auto.ai.langchain"}}),e}))}})}function zy(e,t){const n=e;return"function"==typeof n.embedQuery&&(n.embedQuery=Uy(n.embedQuery,t)),"function"==typeof n.embedDocuments&&(n.embedDocuments=Uy(n.embedDocuments,t)),e}const Wy="auto.ai.langgraph";function Hy(e){const t=e;let n=0,r=0,s=0;if(t.usage_metadata&&"object"==typeof t.usage_metadata){const e=t.usage_metadata;return"number"==typeof e.input_tokens&&(n=e.input_tokens),"number"==typeof e.output_tokens&&(r=e.output_tokens),"number"==typeof e.total_tokens&&(s=e.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:s}}if(t.response_metadata&&"object"==typeof t.response_metadata){const e=t.response_metadata;if(e.tokenUsage&&"object"==typeof e.tokenUsage){const t=e.tokenUsage;"number"==typeof t.promptTokens&&(n=t.promptTokens),"number"==typeof t.completionTokens&&(r=t.completionTokens),"number"==typeof t.totalTokens&&(s=t.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:s}}function qy(e,t){const n=t;if(n.response_metadata&&"object"==typeof n.response_metadata){const t=n.response_metadata;t.model_name&&"string"==typeof t.model_name&&e.setAttribute(lg,t.model_name),t.finish_reason&&"string"==typeof t.finish_reason&&e.setAttribute(cg,[t.finish_reason])}}function Vy(e,t){return new Proxy(e,{apply:(e,n,r)=>la({op:"gen_ai.create_agent",name:"create_agent",attributes:{[mt]:Wy,[ft]:"gen_ai.create_agent",[mg]:"create_agent"}},s=>{try{const i=Reflect.apply(e,n,r),o=r.length>0?r[0]:{};null!=o&&o.name&&"string"==typeof o.name&&(s.setAttribute(kg,o.name),s.updateName(`create_agent ${o.name}`));const a=i.invoke;return a&&"function"==typeof a&&(i.invoke=function(e,t,n,r){return new Proxy(e,{apply:(e,s,i)=>la({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[mt]:Wy,[ft]:Cg,[mg]:"invoke_agent"}},async o=>{try{var a;const c=null==n?void 0:n.name;c&&"string"==typeof c&&(o.setAttribute(Tg,c),o.setAttribute(kg,c),o.updateName(`invoke_agent ${c}`));const l=i.length>1?i[1]:void 0,u=null==l?void 0:l.configurable,d=null==u?void 0:u.thread_id;d&&"string"==typeof d&&o.setAttribute(Eg,d);const h=function(e){var t,n;if(null===(t=e.builder)||void 0===t||null===(t=t.nodes)||void 0===t||null===(t=t.tools)||void 0===t||null===(t=t.runnable)||void 0===t||!t.tools)return null;const r=null===(n=e.builder)||void 0===n||null===(n=n.nodes)||void 0===n||null===(n=n.tools)||void 0===n||null===(n=n.runnable)||void 0===n?void 0:n.tools;return r&&Array.isArray(r)&&0!==r.length?r.map(e=>{var t,n,r;return{name:null===(t=e.lc_kwargs)||void 0===t?void 0:t.name,description:null===(n=e.lc_kwargs)||void 0===n?void 0:n.description,schema:null===(r=e.lc_kwargs)||void 0===r?void 0:r.schema}}):null}(t);h&&o.setAttribute(bg,JSON.stringify(h));const p=r.recordInputs,f=r.recordOutputs,m=i.length>0?(null===(a=i[0])||void 0===a?void 0:a.messages)??[]:[];if(m&&p){const e=my(m),{systemInstructions:t,filteredMessages:n}=sy(e);t&&o.setAttribute(vg,t);const r=Zg(n),s=Array.isArray(n)?n.length:0;o.setAttributes({[yg]:JSON.stringify(r),[gg]:s})}const g=await Reflect.apply(e,s,i);return f&&function(e,t,n){const r=null==n?void 0:n.messages;if(!r||!Array.isArray(r))return;const s=(null==t?void 0:t.length)??0,i=r.length>s?r.slice(s):[];if(0===i.length)return;const o=function(e){if(!e||0===e.length)return null;const t=[];for(const n of e)if(n&&"object"==typeof n){const e=n.tool_calls;e&&Array.isArray(e)&&t.push(...e)}return t.length>0?t:null}(i);o&&e.setAttribute(wg,JSON.stringify(o));const a=my(i);e.setAttribute(_g,JSON.stringify(a));let c=0,l=0,u=0;for(const t of i){const n=Hy(t);c+=n.inputTokens,l+=n.outputTokens,u+=n.totalTokens,qy(e,t)}c>0&&e.setAttribute(hg,c),l>0&&e.setAttribute(pg,l),u>0&&e.setAttribute(fg,u)}(o,m??null,g),g}catch(e){throw o.setStatus({code:ln,message:"internal_error"}),Fs(e,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),e}})})}(a.bind(i),i,o,t)),i}catch(e){throw s.setStatus({code:ln,message:"internal_error"}),Fs(e,{mechanism:{handled:!1,type:"auto.ai.langgraph.error"}}),e}})})}function Jy(e,t){return e.compile=Vy(e.compile,ey(t)),e}const Ky={"responses.create":{operation:"chat"}
1,"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},Gy=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta","response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"];function Xy(e){return null!==e&&"object"==typeof e&&"type"in e&&"string"==typeof e.type&&e.type.startsWith("response.")}function Yy(e){return null!==e&&"object"==typeof e&&"object"in e&&"chat.completion.chunk"===e.object}function Qy(e,t){for(const n of e){const e=n.index;if(void 0!==e&&n.function)if(e in t.chatCompletionToolCalls){const r=t.chatCompletionToolCalls[e];n.function.arguments&&null!=r&&r.function&&(r.function.arguments+=n.function.arguments)}else t.chatCompletionToolCalls[e]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}}}}function Zy(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(const i of e.choices??[]){var r,s;n&&(null!==(r=i.delta)&&void 0!==r&&r.content&&t.responseTexts.push(i.delta.content),null!==(s=i.delta)&&void 0!==s&&s.tool_calls&&Qy(i.delta.tool_calls,t)),i.finish_reason&&t.finishReasons.push(i.finish_reason)}}function ev(e,t,n,r){if(!e||"object"!=typeof e)return void t.eventTypes.push("unknown:non-object");if(e instanceof Error)return r.setStatus({code:ln,message:"internal_error"}),void Fs(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});if(!("type"in e))return;const s=e;if(Gy.includes(s.type)){if(n&&("response.output_item.done"===s.type&&"item"in s&&t.responsesApiToolCalls.push(s.item),"response.output_text.delta"===s.type&&"delta"in s&&s.delta))t.responseTexts.push(s.delta);else if("response"in s){const{response:e}=s;t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.input_tokens,t.completionTokens=e.usage.output_tokens,t.totalTokens=e.usage.total_tokens),e.status&&t.finishReasons.push(e.status),n&&e.output_text&&t.responseTexts.push(e.output_text)}}else t.eventTypes.push(s.type)}function tv(e,t,n){if("embeddings"===n&&"input"in t){const n=t.input;if(null==n)return;if("string"==typeof n&&0===n.length)return;if(Array.isArray(n)&&0===n.length)return;return void e.setAttribute(Og,"string"==typeof n?n:JSON.stringify(n))}const r="input"in t?t.input:"messages"in t?t.messages:void 0;if(!r)return;if(Array.isArray(r)&&0===r.length)return;const{systemInstructions:s,filteredMessages:i}=sy(r);s&&e.setAttribute(vg,s);const o=ry(i);e.setAttribute(yg,o),Array.isArray(i)?e.setAttribute(gg,i.length):e.setAttribute(gg,1)}function nv(e,t,n,r,s){return function(){for(var i=arguments.length,a=new Array(i),c=0;c<i;c++)a[c]=arguments[c];const l=n.operation||"unknown",u=function(e,t){const n={[Ym]:"openai",[mg]:t,[mt]:"auto.ai.openai"};if(e.length>0&&"object"==typeof e[0]&&null!==e[0]){const t=e[0],r=function(e){const t=[...Array.isArray(e.tools)?e.tools:[],...e.web_search_options&&"object"==typeof e.web_search_options?[{type:"web_search_options",...e.web_search_options}]:[]];if(0!==t.length)try{return JSON.stringify(t)}catch(e){return void(o&&j.error("Failed to serialize OpenAI tools:",e))}}(t);r&&(n[bg]=r),Object.assign(n,function(e){const t={[Qm]:e.model??"unknown"};"temperature"in e&&(t[eg]=e.temperature),"top_p"in e&&(t[sg]=e.top_p),"frequency_penalty"in e&&(t[ng]=e.frequency_penalty),"presence_penalty"in e&&(t[rg]=e.presence_penalty),"stream"in e&&(t[Zm]=e.stream),"encoding_format"in e&&(t[og]=e.encoding_format),"dimensions"in e&&(t[ag]=e.dimensions);const n=function(e){return"conversation"in e&&"string"==typeof e.conversation?e.conversation:"previous_response_id"in e&&"string"==typeof e.previous_response_id?e.previous_response_id:void 0}(e);return n&&(t[Eg]=n),t}(t))}else n[Qm]="unknown";return n}(a,l),d=u[Qm]||"unknown",h=a[0],p=h&&"object"==typeof h&&!0===h.stream,f={name:`${l} ${d}`,op:`gen_ai.${l}`,attributes:u};if(p){let n;const i=ua(f,i=>(n=e.apply(r,a),s.recordInputs&&h&&tv(i,h,l),(async()=>
1{try{return async function*(e,t,n){const r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(const s of e)Yy(s)?Zy(s,r,n):Xy(s)&&ev(s,r,n,t),yield s}finally{const e=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];ny(t,{...r,toolCalls:e},n)}}(await n,i,s.recordOutputs??!1)}catch(e){throw i.setStatus({code:ln,message:"internal_error"}),Fs(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream",data:{function:t}}}),i.end(),e}})()));return iy(n,i,"auto.ai.openai")}let m;const g=la(f,n=>(m=e.apply(r,a),s.recordInputs&&h&&tv(n,h,l),m.then(e=>(function(e,t,n){if(!t||"object"!=typeof t)return;const r=t,s={};if("string"==typeof r.id&&(s[ug]=r.id),"string"==typeof r.model&&(s[lg]=r.model),"conversation"===r.object&&"string"==typeof r.id&&(s[Eg]=r.id),r.usage&&"object"==typeof r.usage){const e=r.usage,t=e.prompt_tokens??e.input_tokens;"number"==typeof t&&(s[hg]=t);const n=e.completion_tokens??e.output_tokens;"number"==typeof n&&(s[pg]=n),"number"==typeof e.total_tokens&&(s[fg]=e.total_tokens)}if(Array.isArray(r.choices)){const e=r.choices,t=e.map(e=>e.finish_reason).filter(e=>"string"==typeof e);if(t.length>0&&(s[cg]=JSON.stringify(t)),n){const t=e.map(e=>{const t=e.message;return(null==t?void 0:t.content)||""});s[_g]=JSON.stringify(t);const n=e.map(e=>{const t=e.message;return null==t?void 0:t.tool_calls}).filter(e=>Array.isArray(e)&&e.length>0).flat();n.length>0&&(s[wg]=JSON.stringify(n))}}if("string"==typeof r.status&&(s[cg]||(s[cg]=JSON.stringify([r.status]))),n&&("string"!=typeof r.output_text||s[_g]||(s[_g]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!s[wg])){const e=r.output.filter(e=>"function_call"===(null==e?void 0:e.type));e.length>0&&(s[wg]=JSON.stringify(e))}e.setAttributes(s)}(n,e,s.recordOutputs),e),e=>{throw Fs(e,{mechanism:{handled:!1,type:"auto.ai.openai",data:{function:t}}}),e})));return iy(m,g,"auto.ai.openai")}}function rv(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2?arguments[2]:void 0;return new Proxy(e,{get(e,r){const s=e[r],i=ty(t,String(r)),o=Ky[i];return"function"==typeof s&&o?nv(s,i,o,e,n):"function"==typeof s?s.bind(e):s&&"object"==typeof s?rv(s,i,n):s}})}function sv(e,t){return rv(e,"",ey(t))}const iv=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],ov=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],av={eq:"eq",neq:"neq",gt:"gt",gte:"gte",lt:"lt",lte:"lte",like:"like","like(all)":"likeAllOf","like(any)":"likeAnyOf",ilike:"ilike","ilike(all)":"ilikeAllOf","ilike(any)":"ilikeAnyOf",is:"is",in:"in",cs:"contains",cd:"containedBy",sr:"rangeGt",nxl:"rangeGte",sl:"rangeLt",nxr:"rangeLte",adj:"rangeAdjacent",ov:"overlaps",fts:"",plfts:"plain",phfts:"phrase",wfts:"websearch",not:"not"},cv=["select","insert","upsert","update","delete"];function lv(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function uv(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function dv(e,t){if(""===t||"*"===t)return"select(*)";if("select"===e)return`select(${t})`;if("or"===e||e.endsWith(".or"))return`${e}${t}`;const[n,...r]=t.split(".");let s;return s=null!=n&&n.startsWith("fts")?"textSearch":null!=n&&n.startsWith("plfts")?"textSearch[plain]":null!=n&&n.startsWith("phfts")?"textSearch[phrase]":null!=n&&n.startsWith("wfts")?"textSearch[websearch]":n&&av[n]||"filter",`${s}(${e}, ${r.join(".")})`}function hv(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return new Proxy(e,{apply:(n,r,s)=>la({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[mt]:"auto.db.supabase",[ft]:"db","db.system":"postgresql","db.operation":`auth.${t?"admin.":""}${e.name}`}},e=>Reflect.apply(n,r,s).then(t=>(t&&"object"==typeof t&&"error"in t&&t.error?(e.setStatus({code:ln}),Fs(t.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):e.setStatus({code:cn}),e.end(),t)).catch(t=>{throw e.setStatus({code:ln}),e.end(),Fs(t,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),t}).then(...s))})}function pv(e){uv(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(e,t,n){var r;const s=cv,i=t,o=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};switch(e){case"GET":return"select";case"POST":var n;return null!==(n=t.Prefer)&&void 0!==n&&n.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}(i.method,i.headers);if(!s.includes(o))return Reflect.apply(e,t,n);if(null==i||null===(r=i.url)||void 0===r||!r.pathname||"string"!=typeof i.url.pathname)return Reflect.apply(e,t,n);const a=i.url.pathname.split("/"),c=a.length>0?a[a.length-1]:"",l=[];
1for(const[e,t]of i.url.searchParams.entries())l.push(dv(e,t));const u=Object.create(null);if(b(i.body))for(const[e,t]of Object.entries(i.body))u[e]=t;const d=`${"select"===o?"":`${o}${u?"(...) ":""}`}${l.join(" ")} from(${c})`,h={"db.table":c,"db.schema":i.schema,"db.url":i.url.origin,"db.sdk":i.headers["X-Client-Info"],"db.system":"postgresql","db.operation":o,[mt]:"auto.db.supabase",[ft]:"db"};return l.length&&(h["db.query"]=l),Object.keys(u).length&&(h["db.body"]=u),la({name:d,attributes:h},r=>Reflect.apply(e,t,[]).then(e=>{if(r&&(e&&"object"==typeof e&&"status"in e&&dn(r,e.status||500),r.end()),null!=e&&e.error){const t=new Error(e.error.message);e.error.code&&(t.code=e.error.code),e.error.details&&(t.details=e.error.details);const n={};l.length&&(n.query=l),Object.keys(u).length&&(n.body=u),Fs(t,e=>(e.addEventProcessor(e=>(ye(e,{handled:!1,type:"auto.db.supabase.postgres"}),e)),e.setContext("supabase",n),e))}const t={type:"supabase",category:`db.${o}`,message:d},n={};return l.length&&(n.query=l),Object.keys(u).length&&(n.body=u),Object.keys(n).length&&(t.data=n),Oi(t),e},e=>{throw r&&(dn(r,500),r.end()),e}).then(...n))}}),lv(e.prototype.then))}const fv=e=>{var t;e?(uv((t=e.constructor===Function?e:e.constructor).prototype.from)||(t.prototype.from=new Proxy(t.prototype.from,{apply(e,t,n){const r=Reflect.apply(e,t,n);return function(e){for(const t of cv)uv(e.prototype[t])||(e.prototype[t]=new Proxy(e.prototype[t],{apply(e,n,r){const s=Reflect.apply(e,n,r),i=s.constructor;return o&&j.log(`Instrumenting ${t} operation's PostgRESTFilterBuilder`),pv(i),s}}),lv(e.prototype[t]))}(r.constructor),r}}),lv(t.prototype.from)),function(e){const t=e.auth;if(t&&!uv(e.auth)){for(const n of iv){const r=t[n];r&&"function"==typeof e.auth[n]&&(e.auth[n]=hv(r))}for(const n of ov){const r=t.admin[n];r&&"function"==typeof e.auth.admin[n]&&(e.auth.admin[n]=hv(r,!0))}lv(e.auth)}}(e)):o&&j.warn("Supabase integration was not installed because no Supabase client was provided.")},mv=e=>{return t=e.supabaseClient,{setupOnce(){fv(t)},name:"Supabase"};var t};function gv(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];const s=new String(String.raw(e,...n));return s.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),s.__sentry_template_values__=n,s}const yv=gv;function vv(e,t,n,r,s){Rr({level:e,message:t,attributes:n,severityNumber:s},r)}function _v(e,t){let{scope:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};vv("trace",e,t,n)}function bv(e,t){let{scope:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};vv("debug",e,t,n)}function Sv(e,t){let{scope:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};vv("info",e,t,n)}function wv(e,t){let{scope:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};vv("warn",e,t,n)}function kv(e,t){let{scope:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};vv("error",e,t,n)}function Tv(e,t){let{scope:n}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};vv("fatal",e,t,n)}function Ev(e,t,n,r){!function(e,t){const n=(null==t?void 0:t.scope)??He(),r=(null==t?void 0:t.captureSerializedMetric)??jr,s=(null==n?void 0:n.getClient())??Ge();if(!s)return void(o&&j.warn("No client available to capture metric."));const{_experiments:i,enableMetrics:a,beforeSendMetric:c}=s.getOptions();if(!(a??(null==i?void 0:i.enableMetrics)??1))return void(o&&j.warn("metrics option not enabled, metric will not be captured."));const{user:l,attributes:u}=wr(qe(),n),d=function(e,t,n){var r;const{release:s,environment:i}=t.getOptions(),o={...e.attributes};$r(o,"user.id",n.id,!1),$r(o,"user.email",n.email,!1),$r(o,"user.name",n.username,!1),$r(o,"sentry.release",s),$r(o,"sentry.environment",i);const{name:a,version:c}=(null===(r=t.getSdkMetadata())||void 0===r?void 0:r.sdk)??{};$r(o,"sentry.sdk.name",a),$r(o,"sentry.sdk.version",c);const l=t.getIntegrationByName("Replay"),u=null==l?void 0:l.getReplayId(!0);return $r(o,"sentry.replay_id",u),u&&"buffer"===(null==l?void 0:l.getRecordingMode())&&$r(o,"sentry._internal.replay_is_buffering",!0),{...e,attributes:o}}(e,s,l);s.emit("processMetric",d);const h=c||(null==i?void 0:i.beforeSendMetric),p=h?h(d):d;if(!p)return void(o&&j.log("`beforeSendMetric` returned `null`, will not send metric."));const f=function(e,t,n,r){const[,s]=Ir(t,n),i=Me(n),o=i?i.spanContext().traceId:null==s?void 0:s.trace_id,a=i?i.spanContext().spanId:void 0,c=we(),l=xr(c);return{timestamp:c,trace_id:o??"",span_id:a,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...rn(r),...rn(e.attributes,"skip-undefined"),[l.key]:l.value}}}(p,s,n,u);o&&j.log("[Metric]",f),r(s,f),s.emit("afterCaptureMetric",p)}({type:e,name:t,value:n,unit:null==r?void 0:r.unit,attributes:null==r?void 0:r.attributes},{scope:null==r?void 0:r.scope})}function xv(e){Ev("counter",e,arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,arguments.length>2?arguments[2]:void 0)}function Iv(e,t,n){Ev("gauge",e,t,n)}function Cv(e,t,n){Ev("distribution",e,t,n)}const Ov=new Map,Av=new Set;function Mv(e,t){var n;null===(n=t.exception)||void 0===n||null===(n=n.values)||void 0===n||n.forEac
1h(t=>{var n;null===(n=t.stacktrace)||void 0===n||null===(n=n.frames)||void 0===n||n.forEach(t=>{if(!t.filename||t.module_metadata)return;const n=function(e,t){return function(e){if(c._sentryModuleMetadata)for(const t of Object.keys(c._sentryModuleMetadata)){const n=c._sentryModuleMetadata[t];if(Av.has(t))continue;Av.add(t);const r=e(t);for(const e of r.reverse())if(e.filename){Ov.set(e.filename,n);break}}}(e),Ov.get(t)}(e,t.filename);n&&(t.module_metadata=n)})})}function Rv(e){var t;null===(t=e.exception)||void 0===t||null===(t=t.values)||void 0===t||t.forEach(e=>{var t;null===(t=e.stacktrace)||void 0===t||null===(t=t.frames)||void 0===t||t.forEach(e=>{delete e.module_metadata})})}const Nv=()=>({name:"ModuleMetadata",setup(e){e.on("beforeEnvelope",e=>{or(e,(e,t)=>{if("event"===t){const t=Array.isArray(e)?e[1]:void 0;t&&(Rv(t),e[1]=t)}})}),e.on("applyFrameMetadata",t=>{t.type||Mv(e.getOptions().stackParser,t)})}});const Pv=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Lv(){let e="",t=!1;for(let n=arguments.length-1;n>=-1&&!t;n--){const r=n>=0?n<0||arguments.length<=n?void 0:arguments[n]:"/";r&&(e=`${r}/${e}`,t="/"===r.charAt(0))}return e=function(e,t){let n=0;for(let t=e.length-1;t>=0;t--){const r=e[t];"."===r?e.splice(t,1):".."===r?(e.splice(t,1),n++):n&&(e.splice(t,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}(e.split("/").filter(e=>!!e),!t).join("/"),(t?"/":"")+e||"."}function Dv(e){let t=0;for(;t<e.length&&""===e[t];t++);let n=e.length-1;for(;n>=0&&""===e[n];n--);return t>n?[]:e.slice(t,n-t+1)}const $v=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.root,n=e.prefix||"app:///",r="window"in c&&!!c.window,s=e.iteratee||function(e){let{isBrowser:t,root:n,prefix:r}=e;return e=>{if(!e.filename)return e;const s=/^[a-zA-Z]:\\/.test(e.filename)||e.filename.includes("\\")&&!e.filename.includes("/"),i=/^\//.test(e.filename);if(t){if(n){const t=e.filename;0===t.indexOf(n)&&(e.filename=t.replace(n,r))}}else if(s||i){const t=s?e.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):e.filename,i=n?function(e,t){e=Lv(e).slice(1),t=Lv(t).slice(1);const n=Dv(e.split("/")),r=Dv(t.split("/")),s=Math.min(n.length,r.length);let i=s;for(let e=0;e<s;e++)if(n[e]!==r[e]){i=e;break}let o=[];for(let e=i;e<n.length;e++)o.push("..");return o=o.concat(r.slice(i)),o.join("/")}(n,t):function(e){let t=function(e){const t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=Pv.exec(t);return n?n.slice(1):[]}(e)[2]||"";return t}(t);e.filename=`${r}${i}`}return e}}({isBrowser:r,root:t,prefix:n});return{name:"RewriteFrames",processEvent(e){let t=e;return e.exception&&Array.isArray(e.exception.values)&&(t=function(e){try{return{...e,exception:{...e.exception,values:e.exception.values.map(e=>{return{...e,...e.stacktrace&&{stacktrace:(t=e.stacktrace,{...t,frames:null==t||null===(n=t.frames)||void 0===n?void 0:n.map(e=>s(e))})}};var t,n})}}}catch{return e}}(t)),t}}},jv=e=>({name:"ThirdPartyErrorsFilter",setup(e){e.on("beforeEnvelope",e=>{or(e,(e,t)=>{if("event"===t){const t=Array.isArray(e)?e[1]:void 0;t&&(Rv(t),e[1]=t)}})}),e.on("applyFrameMetadata",t=>{t.type||Mv(e.getOptions().stackParser,t)})},processEvent(t){const n=function(e,t){const n=se(e);if(n)return n.filter((e,n)=>!(!e.filename||null==e.lineno&&null==e.colno&&null==e.instruction_addr||t&&function(e,t){if(0!==t||!e.context_line||!e.filename)return!1;if(!e.filename.includes("sentry")||!e.filename.includes("helpers")||!e.context_line.includes(Uv))return!1;if(e.pre_context){const t=e.pre_context.length;for(let r=0;r<t;r++){var n;if(null!==(n=e.pre_context[r])&&void 0!==n&&n.includes(Fv))return!0}}return!1}(e,n))).map(e=>e.module_metadata?Object.keys(e.module_metadata).filter(e=>e.startsWith(Bv)).map(e=>e.slice(Bv.length)):[])}(t,e.ignoreSentryInternalFrames);if(n){const r=n["drop-error-if-contains-third-party-frames"===e.behaviour||"apply-tag-if-contains-third-party-frames"===e.behaviour?"some":"every"](t=>!t.some(t=>e.filterKeys.includes(t)));if(r){if("drop-error-if-contains-third-party-frames"===e.behaviour||"drop-error-if-exclusively-contains-third-party-frames"===e.behaviour)return null;t.tags={...t.tags,third_party_code:!0}}}return t}}),Bv="_sentryBundlerPluginAppKey:",Fv="Attempt to invoke user-land function",Uv="fn.apply(this, wrappedArguments)";function zv(e){return{...e,path:"path"in e&&Array.isArray(e.path)?e.path.join("."):void 0,keys:"keys"in e?JSON.stringify(e.keys):void 0,unionErrors:"unionErrors"in e?JSON.stringify(e.unionErrors):void 0}}function Wv(e){return e.map(e=>"number"==typeof e?"<array>":e).join(".")}function Hv(e){const t=new Set;for(const n of e.issues){const e=Wv(n.path);e.length>0&&t.add(e)}const n=Array.from(t);if(0===n.length){let t="variable";if(e.issues.length>0){const n=e.issues[0];void 0!==n&&"expected"in n&&"string"==typeof n.expected&&(t=n.expected)}return`Failed to validate ${t}`}return`Failed to validate keys: ${ae(n.join(", "),100)}`}const qv=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=e.limit??10;return{name:"ZodErrors",processEvent:(n,r)=>function(e){var t;let n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=arguments.length>2?arguments[2]:void 0,s=arguments.length>3?arguments[3]:void 0;if(!(null!==(t=r.exception)&&void 0!==t&&t.values&&s.originalException&&(i=s.originalException,p(i)&&"ZodError"===i.name&&Array.isArray(i.issues))&&0!==s.originalException.issues.length))return r;var i;try{const t=(n?s.originalException.issues:s.originalException.issues.slice(0,e)).map(zv);return n&&(Array.isArray(s.attachments)||(s.attachments=[]),s.attachments.push({f
1ilename:"zod_issues.json",data:JSON.stringify({issues:t})})),{...r,exception:{...r.exception,values:[{...r.exception.values[0],value:Hv(s.originalException)},...r.exception.values.slice(1)]},extra:{...r.extra,"zoderror.issues":t.slice(0,e)}}}catch(e){return{...r,extra:{...r.extra,"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:e instanceof Error?`${e.name}: ${e.message}\n${e.stack}`:"unknown"}}}}}(t,e.saveZodIssuesAsAttachment,n,r)}},Vv={startProfiler:function(){const e=Ge();e?e.getIntegrationByName("BrowserProfiling")?e.emit("startUIProfiler"):Yi&&j.warn("BrowserProfiling integration is not available"):Yi&&j.warn("No Sentry client available, profiling is not started")},stopProfiler:function(){const e=Ge();e?e.getIntegrationByName("BrowserProfiling")?e.emit("stopUIProfiler"):Yi&&j.warn("ProfilingIntegration is not available"):Yi&&j.warn("No Sentry client available, profiling is not started")}};function Jv(e,t){let{metadata:n,tunnel:r,dsn:s}=t;const i={event_id:e.event_id,sent_at:(new Date).toISOString(),...(null==n?void 0:n.sdk)&&{sdk:{name:n.sdk.name,version:n.sdk.version}},...!!r&&!!s&&{dsn:Ut(s)}},o=function(e){return[{type:"user_report"},e]}(e);return sr(i,[o])}function Kv(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=oi.document,n=(null==t?void 0:t.head)||(null==t?void 0:t.body);if(!n)return void(Yi&&j.error("[showReportDialog] Global document not defined"));const r=He(),s=Ge(),i=null==s?void 0:s.getDsn();if(!i)return void(Yi&&j.error("[showReportDialog] DSN not configured"));const o={...e,user:{...r.getUser(),...e.user},eventId:e.eventId||Xs()},a=oi.document.createElement("script");a.async=!0,a.crossOrigin="anonymous",a.src=function(e,t){const n=qt(e);if(!n)return"";const r=`${Jt(n)}embed/error-page/`;let s=`dsn=${Ut(n)}`;for(const e in t)if("dsn"!==e&&"onClose"!==e)if("user"===e){const e=t.user;if(!e)continue;e.name&&(s+=`&name=${encodeURIComponent(e.name)}`),e.email&&(s+=`&email=${encodeURIComponent(e.email)}`)}else s+=`&${encodeURIComponent(e)}=${encodeURIComponent(t[e])}`;return`${r}?${s}`}(i,o);const{onLoad:c,onClose:l}=o;if(c&&(a.onload=c),l){const e=t=>{if("__sentry_reportdialog_closed__"===t.data)try{l()}finally{oi.removeEventListener("message",e)}};oi.addEventListener("message",e)}n.appendChild(a)}const Gv=c,Xv=new WeakMap,Yv=function(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).types||["crash","deprecation","intervention"];function t(e){if(Xv.has(Ge()))for(const t of e)Je(e=>{e.setExtra("url",t.url);const n=`ReportingObserver [${t.type}]`;let r="No details available";if(t.body){const n={};for(const e in t.body)n[e]=t.body[e];if(e.setExtra("body",n),"crash"===t.type){const e=t.body;r=[e.crashId||"",e.reason||""].join(" ").trim()||r}else r=t.body.message||r}Us(`${n}: ${r}`)})}return{name:"ReportingObserver",setupOnce(){"ReportingObserver"in _i&&new Gv.ReportingObserver(t,{buffered:!0,types:e}).observe()},setup(e){Xv.set(e,!0)}}},Qv=function(){const e={failedRequestStatusCodes:[[500,599]],failedRequestTargets:[/.*/],...arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}};return{name:"HttpClient",setup(t){!function(e,t){Si()&&wi(n=>{if(Ge()!==e)return;const{response:r,args:s,error:i,virtualError:o}=n,[a,c]=s;r&&function(e,t,n,r,s){if(n_(e,n.status,n.url)){const e=function(e,t){return!t&&e instanceof Request||e instanceof Request&&e.bodyUsed?e:new Request(e,t)}(t,r);let i,o,a,c;s_()&&([i,a]=Zv("Cookie",e),[o,c]=Zv("Set-Cookie",n)),zs(r_({url:e.url,method:e.method,status:n.status,requestHeaders:i,responseHeaders:o,requestCookies:a,responseCookies:c,error:s,type:"fetch"}))}}(t,a,r,c,i||o)},!1)}(t,e),function(e,t){"XMLHttpRequest"in c&&Vi(n=>{if(Ge()!==e)return;const{error:r,virtualError:s}=n,i=n.xhr,o=i[qi];if(!o)return;const{method:a,request_headers:c}=o;try{!function(e,t,n,r,s){if(n_(e,t.status,t.responseURL)){let e,i,o;if(s_()){try{const e=t.getResponseHeader("Set-Cookie")||t.getResponseHeader("set-cookie")||void 0;e&&(i=t_(e))}catch{}try{o=function(e){const t=e.getAllResponseHeaders();return t?t.split("\r\n").reduce((e,t)=>
1{const[n,r]=t.split(": ");return n&&r&&(e[n]=r),e},{}):{}}(t)}catch{}e=r}zs(r_({url:t.responseURL,method:n,status:t.status,requestHeaders:e,responseHeaders:o,responseCookies:i,error:s,type:"xhr"}))}}(t,i,a,c,r||s)}catch(e){Yi&&j.warn("Error while extracting response event form XHR response",e)}})}(t,e)}}};function Zv(e,t){const n=function(e){const t={};return e.forEach((e,n)=>{t[n]=e}),t}(t.headers);let r;try{const t=n[e]||n[e.toLowerCase()]||void 0;t&&(r=t_(t))}catch{}return[n,r]}function e_(e){if(e){const t=e["Content-Length"]||e["content-length"];if(t)return parseInt(t,10)}}function t_(e){return e.split("; ").reduce((e,t)=>{const[n,r]=t.split("=");return n&&r&&(e[n]=r),e},{})}function n_(e,t,n){return function(e,t){return e.some(e=>"number"==typeof e?e===t:t>=e[0]&&t<=e[1])}(e.failedRequestStatusCodes,t)&&(r=e.failedRequestTargets,s=n,r.some(e=>"string"==typeof e?s.includes(e):e.test(s)))&&!Xl(n,Ge());var r,s}function r_(e){const t=Ge(),n=t&&e.error&&e.error instanceof Error?e.error.stack:void 0,r=n&&t?t.getOptions().stackParser(n,0,1):void 0,s=`HTTP Client Error with status code: ${e.status}`,i={message:s,exception:{values:[{type:"Error",value:s,stacktrace:r?{frames:r}:void 0}]},request:{url:e.url,method:e.method,headers:e.requestHeaders,cookies:e.requestCookies},contexts:{response:{status_code:e.status,headers:e.responseHeaders,cookies:e.responseCookies,body_size:e_(e.responseHeaders)}}};return ye(i,{type:`auto.http.client.${e.type}`,handled:!1}),i}function s_(){const e=Ge();return!!e&&Boolean(e.getOptions().sendDefaultPii)}const i_=c,o_=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=null!=e.frameContextLines?e.frameContextLines:7;return{name:"ContextLines",processEvent:e=>function(e,t){var n;const r=i_.document,s=i_.location&&Di(i_.location.href);if(!r||!s)return e;const i=null===(n=e.exception)||void 0===n?void 0:n.values;if(null==i||!i.length)return e;const o=r.documentElement.innerHTML;if(!o)return e;const a=["<!DOCTYPE html>","<html>",...o.split("\n"),"</html>"];return i.forEach(e=>{const n=e.stacktrace;null!=n&&n.frames&&(n.frames=n.frames.map(e=>function(e,t,n,r){return e.filename===n&&e.lineno&&t.length?(function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;if(void 0===t.lineno)return;const r=e.length,s=Math.max(Math.min(r-1,t.lineno-1),0);t.pre_context=e.slice(Math.max(0,s-n),s).map(e=>ce(e,0));const i=Math.min(r-1,s);t.context_line=ce(e[i],t.colno||0),t.post_context=e.slice(Math.min(s+1,r),s+1+n).map(e=>ce(e,0))}(t,e,r),e):e}(e,a,s,t)))}),e}(e,t)}};function a_(e){if(d_(e))return`persisted ${e.operationName}`;if(u_(e)){const{query:t,operationName:n}=e,{operationName:r=n,operationType:s}=function(e){const t=e.match(/^(?:\s*)(query|mutation|subscription)(?:\s*)(\w+)(?:\s*)[{(]/);if(t)return{operationType:t[1],operationName:t[2]};const n=e.match(/^(?:\s*)(query|mutation|subscription)(?:\s*)[{(]/);return n?{operationType:n[1],operationName:void 0}:{operationType:void 0,operationName:void 0}}(t);return r?`${s} ${r}`:`${s}`}return"unknown"}function c_(e){let t;if("xhr"in e){const n=e.xhr[qi];t=n&&el(n.body)[0]}else t=el(tl(e.input))[0];return t}function l_(e){return"object"==typeof e&&null!==e}function u_(e){return l_(e)&&"string"==typeof e.query}function d_(e){return l_(e)&&"string"==typeof e.operationName&&l_(e.extensions)&&l_(e.extensions.persistedQuery)&&"string"==typeof e.extensions.persistedQuery.sha256Hash&&"number"==typeof e.extensions.persistedQuery.version}function h_(e){try{const t=JSON.parse(e);return u_(t)||d_(t)?t:void 0}catch{return}}const p_=e=>({name:"GraphQLClient",setup(t){!function(e,t){e.on("beforeOutgoingRequestSpan",(e,n)=>{const r=An(e).data||{};if("http.client"!==r[ft])return;const s=r["url.full"]||r["http.url"],i=r["http.request.method"]||r["http.method"];if(!y(s)||!y(i))return;const{endpoints:o}=t,a=de(s,o),c=c_(n);if(a&&c){const t=h_(c);if(t){const n=a_(t);e.updateName(`${i} ${s} (${n})`),u_(t)&&e.setAttribute("graphql.document",t.query),d_(t)&&(e.setAttribute("graphql.persisted_query.hash.sha256",t.extensions.persistedQuery.sha256Hash),e.setAttribute("graphql.persisted_query.version",t.extensions.persistedQuery.version))}}})}(t,e),function(e,t){e.on("beforeOutgoingRequestBreadcrumb",(e,n)=>{const{category:r,type:s,data:i}=e;if("http"===s&&("fetch"===r||"xhr"===r)){const e=null==i?void 0:i.url,{endpoints:r}
1=t,s=de(e,r),o=c_(n);if(s&&i&&o){const e=h_(o);if(!i.graphql&&e){const t=a_(e);i["graphql.operation"]=t,u_(e)&&(i["graphql.document"]=e.query),d_(e)&&(i["graphql.persisted_query.hash.sha256"]=e.extensions.persistedQuery.sha256Hash,i["graphql.persisted_query.version"]=e.extensions.persistedQuery.version)}}}})}(t,e)}});var f_=Object.defineProperty,m_=(e,t,n)=>((e,t,n)=>t in e?f_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n)(e,"symbol"!=typeof t?t+"":t,n);function g_(e,t,n=1/0,r=0){return e?e.nodeType!==e.ELEMENT_NODE||r>n?-1:t(e)?r:g_(e.parentNode,t,n,r+1):-1}function y_(e,t){return n=>{const r=n;if(null===r)return!1;try{if(e)if("string"==typeof e){if(r.matches(`.${e}`))return!0}else if(function(e,t){for(let n=e.classList.length;n--;){const r=e.classList[n];if(t.test(r))return!0}return!1}(r,e))return!0;return!(!t||!r.matches(t))}catch{return!1}}}const v_="Please stop import mirror directly. Instead of that,\r\nnow you can use replayer.getMirror() to access the mirror instance of a replayer,\r\nor you can use record.mirror to access the mirror instance during recording.";let __={map:{},getId:()=>(console.error(v_),-1),getNode:()=>(console.error(v_),null),removeNodeFromMap(){console.error(v_)},has:()=>(console.error(v_),!1),reset(){console.error(v_)}};function b_(e,t,n,r,s=window){const i=s.Object.getOwnPropertyDescriptor(e,t);return s.Object.defineProperty(e,t,r?n:{set(e){x_(()=>{n.set.call(this,e)},0),i&&i.set&&i.set.call(this,e)}}),()=>b_(e,t,i||{},!0)}function S_(e,t,n){try{if(!(t in e))return()=>{};const r=e[t],s=n(r);return"function"==typeof s&&(s.prototype=s.prototype||{},Object.defineProperties(s,{__rrweb_original__:{enumerable:!1,value:r}})),e[t]=s,()=>{e[t]=r}}catch{return()=>{}}}function w_(e,t,n,r,s){if(!e)return!1;const i=function(e){if(!e)return null;try{return e.nodeType===e.ELEMENT_NODE?e:e.parentElement}catch(e){return null}}(e);if(!i)return!1;const o=y_(t,n);if(!s){const e=r&&i.matches(r);return o(i)&&!e}const a=g_(i,o);let c=-1;return!(a<0)&&(r&&(c=g_(i,y_(null,r))),a>-1&&c<0||a<c)}"undefined"!=typeof window&&window.Proxy&&window.Reflect&&(__=new Proxy(__,{get:(e,t,n)=>("map"===t&&console.error(v_),Reflect.get(e,t,n))})),Date.now().toString();const k_={};function T_(e){const t=k_[e];if(t)return t;const n=window.document;let r=window[e];if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const s=t.contentWindow;s&&s[e]&&(r=s[e]),n.head.removeChild(t)}catch(e){}return k_[e]=r.bind(window)}function E_(...e){return T_("requestAnimationFrame")(...e)}function x_(...e){return T_("setTimeout")(...e)}var I_=(e=>(e[e["2D"]=0]="2D",e[e.WebGL=1]="WebGL",e[e.WebGL2=2]="WebGL2",e))(I_||{});let C_;const O_=e=>C_?(...t)=>{try{return e(...t)}catch(e){if(C_&&!0===C_(e))return()=>{};throw e}}:e;for(var A_="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",M_="undefined"==typeof Uint8Array?[]:new Uint8Array(256),R_=0;R_<64;R_++)M_[A_.charCodeAt(R_)]=R_;const N_=new Map,P_=(e,t,n)=>{if(!e||!$_(e,t)&&"object"!=typeof e)return;const r=function(e,t){let n=N_.get(e);return n||(n=new Map,N_.set(e,n)),n.has(t)||n.set(t,[]),n.get(t)}(n,e.constructor.name);let s=r.indexOf(e);return-1===s&&(s=r.length,r.push(e)),s};function L_(e,t,n){if(e instanceof Array)return e.map(e=>L_(e,t,n));if(null===e)return e;if(e instanceof Float32Array||e instanceof Float64Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Uint8Array||e instanceof Uint16Array||e instanceof Int16Array||e instanceof Int8Array||e instanceof Uint8ClampedArray)return{rr_type:e.constructor.name,args:[Object.values(e)]};if(e instanceof ArrayBuffer)return{rr_type:e.constructor.name,base64:function(e){var t,n=new Uint8Array(e),r=n.length,s="";for(t=0;t<r;t+=3)s+=A_[n[t]>>2],s+=A_[(3&n[t])<<4|n[t+1]>>4],s+=A_[(15&n[t+1])<<2|n[t+2]>>6],s+=A_[63&n[t+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s}(e)};if(e instanceof DataView)return{rr_type:e.constructor.name,args:[L_(e.buffer,t,n),e.byteOffset,e.byteLength]};if(e instanceof HTMLImageElement){const t=e.constructor.name,{src:n}=e;return{rr_type:t,src:n}}return e instanceof HTMLCanvasElement?{rr_type:"HTMLImageElement",src:e.toDataURL()}:e instanceof ImageData?{rr_type:e.constructor.name,args:[L_(e.data,t,n),e.width,e.height]}:$_(e,t)||"object"==typeof e?{rr_type:e.constructor.name,index:P_(e,t,n)}:e}const D_=(e,t,n)=>e.map(e=>L_(e,t,n)),$_=(e,t)=>
1{const n=["WebGLActiveInfo","WebGLBuffer","WebGLFramebuffer","WebGLProgram","WebGLRenderbuffer","WebGLShader","WebGLShaderPrecisionFormat","WebGLTexture","WebGLUniformLocation","WebGLVertexArrayObject","WebGLVertexArrayObjectOES"].filter(e=>"function"==typeof t[e]);return Boolean(n.find(n=>e instanceof t[n]))};function j_(e,t,n,r,s){const i=[];try{const o=S_(e.HTMLCanvasElement.prototype,"getContext",function(e){return function(i,...o){if(!w_(this,t,n,r,!0)){const e=function(e){return"experimental-webgl"===e?"webgl":e}(i);if("__context"in this||(this.__context=e),s&&["webgl","webgl2"].includes(e))if(o[0]&&"object"==typeof o[0]){const e=o[0];e.preserveDrawingBuffer||(e.preserveDrawingBuffer=!0)}else o.splice(0,1,{preserveDrawingBuffer:!0})}return e.apply(this,[i,...o])}});i.push(o)}catch{console.error("failed to patch HTMLCanvasElement.prototype.getContext")}return()=>{i.forEach(e=>e())}}function B_(e,t,n,r,s,i,o,a){const c=[],l=Object.getOwnPropertyNames(e);for(const o of l)if(!["isContextLost","canvas","drawingBufferWidth","drawingBufferHeight"].includes(o))try{if("function"!=typeof e[o])continue;const l=S_(e,o,function(e){return function(...c){const l=e.apply(this,c);if(P_(l,a,this),"tagName"in this.canvas&&!w_(this.canvas,r,s,i,!0)){const e=D_(c,a,this),r={type:t,property:o,args:e};n(this.canvas,r)}return l}});c.push(l)}catch{const r=b_(e,o,{set(e){n(this.canvas,{type:t,property:o,args:[e],setter:!0})}});c.push(r)}return c}class F_{constructor(e){this.pendingCanvasMutations=new Map,this.rafStamps={latestId:0,invokeId:null},this.shadowDoms=new Set,this.windowsSet=new WeakSet,this.windows=[],this.restoreHandlers=[],this.frozen=!1,this.locked=!1,this.snapshotInProgressMap=new Map,this.worker=null,this.lastSnapshotTime=0,this.processMutation=(e,t)=>{!(this.rafStamps.invokeId&&this.rafStamps.latestId!==this.rafStamps.invokeId)&&this.rafStamps.invokeId||(this.rafStamps.invokeId=this.rafStamps.latestId),this.pendingCanvasMutations.has(e)||this.pendingCanvasMutations.set(e,[]),this.pendingCanvasMutations.get(e).push(t)};const{enableManualSnapshot:t,sampling:n="all",win:r,recordCanvas:s,errorHandler:i}=e;e.sampling=n,this.mutationCb=e.mutationCb,this.mirror=e.mirror,this.options=e,i&&(C_=i),(s&&"number"==typeof n||t)&&(this.worker=this.initFPSWorker()),this.addWindow(r),t||O_(()=>{s&&"all"===n&&(this.startRAFTimestamping(),this.startPendingCanvasMutationFlusher()),s&&"number"==typeof n&&this.initCanvasFPSObserver()})()}reset(){this.pendingCanvasMutations.clear(),this.restoreHandlers.forEach(e=>{try{e()}catch(e){}}),this.restoreHandlers=[],this.windowsSet=new WeakSet,this.windows=[],this.shadowDoms=new Set,this.worker?.terminate(),this.worker=null,this.snapshotInProgressMap=new Map}freeze(){this.frozen=!0}unfreeze(){this.frozen=!1}lock(){this.locked=!0}unlock(){this.locked=!1}addWindow(e){const{sampling:t="all",blockClass:n,blockSelector:r,unblockSelector:s,recordCanvas:i,enableManualSnapshot:o}=this.options;if(!this.windowsSet.has(e)){if(o)return this.windowsSet.add(e),void this.windows.push(new WeakRef(e));O_(()=>{if(i&&"all"===t&&this.initCanvasMutationObserver(e,n,r,s),i&&"number"==typeof t){const t=j_(e,n,r,s,!0);this.restoreHandlers.push(()=>{t()})}})(),this.windowsSet.add(e),this.windows.push(new WeakRef(e))}}addShadowRoot(e){this.shadowDoms.add(new WeakRef(e))}resetShadowRoots(){this.shadowDoms=new Set}snapshot(e,t){t?.skipRequestAnimationFrame?this.takeSnapshot(performance.now(),!0,e):E_(t=>this.takeSnapshot(t,!0,e))}initFPSWorker(){const e=new Worker(function(){const e=new Blob(['for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t="undefined"==typeof Uint8Array?[]:new Uint8Array(256),a=0;a<64;a++)t[e.charCodeAt(a)]=a;var n=function(t){var a,n=new Uint8Array(t),r=n.length,s="";for(a=0;a<r;a+=3)s+=e[n[a]>>2],s+=e[(3&n[a])<<4|n[a+1]>>4],s+=e[(15&n[a+1])<<2|n[a+2]>>6],s+=e[63&n[a+2]];return r%3==2?s=s.substring(0,s.length-1)+"=":r%3==1&&(s=s.substring(0,s.length-2)+"=="),s};const r=new Map,s=new Map;const i=self;i.onmessage=async function(e){if(!("OffscreenCanvas"in globalThis))return i.postMessage({id:e.data.id});{const{id:t,bitmap:a,width:o,height:f,maxCanvasSize:c,dataURLOptions:g}=e.data,u=async function(e,t,a){const r=e+"-"+t;
1if("OffscreenCanvas"in globalThis){if(s.has(r))return s.get(r);const i=new OffscreenCanvas(e,t);i.getContext("2d");const o=await i.convertToBlob(a),f=await o.arrayBuffer(),c=n(f);return s.set(r,c),c}return""}(o,f,g),[h,d]=function(e,t,a){if(!a)return[e,t];const[n,r]=a;if(e<=n&&t<=r)return[e,t];let s=e,i=t;return s>n&&(i=Math.floor(n*t/e),s=n),i>r&&(s=Math.floor(r*e/t),i=r),[s,i]}(o,f,c),l=new OffscreenCanvas(h,d),w=l.getContext("bitmaprenderer"),p=h===o&&d===f?a:await createImageBitmap(a,{resizeWidth:h,resizeHeight:d,resizeQuality:"low"});w?.transferFromImageBitmap(p),a.close();const y=await l.convertToBlob(g),v=y.type,b=await y.arrayBuffer(),m=n(b);if(p.close(),!r.has(t)&&await u===m)return r.set(t,m),i.postMessage({id:t});if(r.get(t)===m)return i.postMessage({id:t});i.postMessage({id:t,type:v,base64:m,width:o,height:f}),r.set(t,m)}};']);return URL.createObjectURL(e)}());return e.onmessage=e=>{const t=e.data,{id:n}=t;if(this.snapshotInProgressMap.set(n,!1),!("base64"in t))return;const{base64:r,type:s,width:i,height:o}=t;this.mutationCb({id:n,type:I_["2D"],commands:[{property:"clearRect",args:[0,0,i,o]},{property:"drawImage",args:[{rr_type:"ImageBitmap",args:[{rr_type:"Blob",data:[{rr_type:"ArrayBuffer",base64:r}],type:s}]},0,0,i,o]}]})},e}initCanvasFPSObserver(){let e;if(!this.windows.length&&!this.shadowDoms.size)return;const t=n=>{this.takeSnapshot(n,!1),e=E_(t)};e=E_(t),this.restoreHandlers.push(()=>{e&&cancelAnimationFrame(e)})}initCanvasMutationObserver(e,t,n,r){const s=j_(e,t,n,r,!1),i=function(e,t,n,r,s){const i=[],o=Object.getOwnPropertyNames(t.CanvasRenderingContext2D.prototype);for(const a of o)try{if("function"!=typeof t.CanvasRenderingContext2D.prototype[a])continue;const o=S_(t.CanvasRenderingContext2D.prototype,a,function(i){return function(...o){return w_(this.canvas,n,r,s,!0)||x_(()=>{const n=D_(o,t,this);e(this.canvas,{type:I_["2D"],property:a,args:n})},0),i.apply(this,o)}});i.push(o)}catch{const n=b_(t.CanvasRenderingContext2D.prototype,a,{set(t){e(this.canvas,{type:I_["2D"],property:a,args:[t],setter:!0})}});i.push(n)}return()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,r),o=function(e,t,n,r,s){const i=[];return i.push(...B_(t.WebGLRenderingContext.prototype,I_.WebGL,e,n,r,s,0,t)),void 0!==t.WebGL2RenderingContext&&i.push(...B_(t.WebGL2RenderingContext.prototype,I_.WebGL2,e,n,r,s,0,t)),()=>{i.forEach(e=>e())}}(this.processMutation.bind(this),e,t,n,r,this.mirror);this.restoreHandlers.push(()=>{s(),i(),o()})}getCanvasElements(e,t,n){const r=[],s=s=>{s.querySelectorAll("canvas").forEach(s=>{w_(s,e,t,n,!0)||r.push(s)})};for(const e of this.windows){const t=e.deref();let n;try{n=t&&t.document}catch{}n&&s(n)}for(const e of this.shadowDoms){const t=e.deref();t&&s(t)}return r}takeSnapshot(e,t,n){const{sampling:r,blockClass:s,blockSelector:i,unblockSelector:o,dataURLOptions:a,maxCanvasSize:c}=this.options,l=1e3/("all"===r?2:r||2);return!(this.lastSnapshotTime&&e-this.lastSnapshotTime<l)&&(this.lastSnapshotTime=e,(n?[n]:this.getCanvasElements(s,i,o)).forEach(e=>{const n=this.mirror.getId(e);if(this.mirror.hasNode(e)&&e.width&&e.height&&!this.snapshotInProgressMap.get(n)){if(this.snapshotInProgressMap.set(n,!0),!t&&["webgl","webgl2"].includes(e.__context)){const t=e.getContext(e.__context);!1===t?.getContextAttributes()?.preserveDrawingBuffer&&t.clear(t.COLOR_BUFFER_BIT)}createImageBitmap(e).then(t=>{this.worker?.postMessage({id:n,bitmap:t,width:e.width,height:e.height,dataURLOptions:a,maxCanvasSize:c},[t])}).catch(e=>{O_(()=>{throw this.snapshotInProgressMap.delete(n),e})()})}}),!0)}startPendingCanvasMutationFlusher(){E_(()=>this.flushPendingCanvasMutations())}startRAFTimestamping(){const e=t=>{this.rafStamps.latestId=t,E_(e)};E_(e)}flushPendingCanvasMutations(){this.pendingCanvasMutations.forEach((e,t)=>{const n=this.mirror.getId(t);this.flushPendingCanvasMutationFor(t,n)}),E_(()=>this.flushPendingCanvasMutations())}flushPendingCanvasMutationFor(e,t){if(this.frozen||this.locked)return;const n=this.pendingCanvasMutations.get(e);if(!n||-1===t)return;const r=n.map(e=>{const{type:t,...n}=e;return n}),{type:s}=n[0];this.mutationCb({id:t,type:s,commands:r}),this.pendingCanvasMutations.delete(e)}}try{if(2!==Array.from([1],e=>2*e)[0]){const e=document.createElement("iframe");document.body.appendChild(e),Array.from=e.contentWindow?.Array.from||Array.from,document.body.removeChild(e)}}catch(e){console.debug("Unable to override Array.from",e)}var U_;new class{constructor(){m_(this,"idNodeMap",new Map),m_(this,"nodeMetaMap",new WeakMap)}getId(e){if(!e)return-1;const t=this.getMeta(e)?.id;return t??-1}getNode(e){return this.idNodeMap.get(e)||null}getIds(){return Array.from(this.idNodeMap.keys())}getMeta(e){return this.nodeMetaMap.get(e)||null}removeNodeFromMap(e){const t=this.getId(e);
1this.idNodeMap.delete(t),e.childNodes&&e.childNodes.forEach(e=>this.removeNodeFromMap(e))}has(e){return this.idNodeMap.has(e)}hasNode(e){return this.nodeMetaMap.has(e)}add(e,t){const n=t.id;this.idNodeMap.set(n,e),this.nodeMetaMap.set(e,t)}replace(e,t){const n=this.getNode(e);if(n){const e=this.nodeMetaMap.get(n);e&&this.nodeMetaMap.set(t,e)}this.idNodeMap.set(e,t)}reset(){this.idNodeMap=new Map,this.nodeMetaMap=new WeakMap}},function(e){e[e.NotStarted=0]="NotStarted",e[e.Running=1]="Running",e[e.Stopped=2]="Stopped"}(U_||(U_={}));const z_={low:{sampling:{canvas:1},dataURLOptions:{type:"image/webp",quality:.25}},medium:{sampling:{canvas:2},dataURLOptions:{type:"image/webp",quality:.4}},high:{sampling:{canvas:4},dataURLOptions:{type:"image/webp",quality:.5}}},W_=1280,H_=(e={})=>{const[t,n]=e.maxCanvasSize||[],r={quality:e.quality||"medium",enableManualSnapshot:e.enableManualSnapshot,maxCanvasSize:[t?Math.min(t,W_):W_,n?Math.min(n,W_):W_]};let s,i;const o=new Promise(e=>i=e);return{name:"ReplayCanvas",getOptions(){const{quality:e,enableManualSnapshot:t,maxCanvasSize:n}=r;return{enableManualSnapshot:t,recordCanvas:!0,getCanvasManager:e=>{const r=new F_({...e,enableManualSnapshot:t,maxCanvasSize:n,errorHandler:e=>{try{"object"==typeof e&&(e.__rrweb__=!0)}catch{}}});return s=r,i(r),r},...z_[e]||z_.medium}},async snapshot(e,t){(s||await o).snapshot(e,t)}}},q_=()=>({name:"ElementTiming",setup(){Cc()&&Te()&&gc("element",({entries:e})=>{for(const t of e){const e=t;if(!e.identifier)continue;const n=e.identifier,r=e.name,s=e.renderTime,i=e.loadTime,o={"sentry.origin":"auto.ui.browser.element_timing","ui.element.identifier":n};r&&(o["ui.element.paint_type"]=r),e.id&&(o["ui.element.id"]=e.id),e.element&&(o["ui.element.type"]=e.element.tagName.toLowerCase()),e.url&&(o["ui.element.url"]=e.url),e.naturalWidth&&(o["ui.element.width"]=e.naturalWidth),e.naturalHeight&&(o["ui.element.height"]=e.naturalHeight),s>0&&Cv("ui.element.render_time",s,{unit:"millisecond",attributes:o}),i>0&&Cv("ui.element.load_time",i,{unit:"millisecond",attributes:o})}})}});function V_(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Ge();null==e||e.emit("endPageloadSpan")}function J_(e){const t=Hn();if(t===e)return;const n=He();e.end=new Proxy(e.end,{apply:(e,r,s)=>(Ae(n,t),Reflect.apply(e,r,s))}),Ae(n,e)}function K_(e){return!!e.trace_id&&!!e.public_key}class G_{constructor(e,t){this._traceBuckets=new Map,this._client=e;const{maxSpanLimit:n,flushInterval:r,maxTraceWeightInBytes:s}=t??{};this._maxSpanLimit=n&&n>0&&n<=1e3?n:1e3,this._flushInterval=r&&r>0?r:5e3,this._maxTraceWeight=s&&s>0?s:5e6,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(e=>{clearTimeout(e.timeout)}),this._traceBuckets.clear()})}add(e){const t=e.trace_id;let n=this._traceBuckets.get(t);n||(n={spans:new Set,size:0,timeout:qr(setTimeout(()=>{this.flush(t)},this._flushInterval))},this._traceBuckets.set(t,n)),n.spans.add(e),n.size+=function(e){let t=156;if(t+=2*e.name.length,t+=sn(e.attributes),e.links&&e.links.length>0){const n=e.links[0],r=null==n?void 0:n.attributes;t+=(100+(r?sn(r):0))*e.links.length}return t}(e),(n.spans.size>=this._maxSpanLimit||n.size>=this._maxTraceWeight)&&this.flush(t)}drain(){this._traceBuckets.size&&(o&&j.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((e,t)=>{this.flush(t)}))}flush(e){var t;const n=this._traceBuckets.get(e);if(!n)return;if(!n.spans.size)return void this._removeTrace(e);const r=Array.from(n.spans),s=null===(t=r[0])||void 0===t?void 0:t._segmentSpan;if(!s)return o&&j.warn("No segment span reference found on span JSON, cannot compute DSC"),void this._removeTrace(e);const i=Yn(s),a=r.map(e=>{const{_segmentSpan:t,...n}=e;return n}),c=function(e,t,n){const r=n.getDsn(),s=n.getOptions().tunnel,i=fr(n.getOptions()._metadata);return sr({sent_at:(new Date).toISOString(),...K_(t)&&{trace:t},...i&&{sdk:i},...!!s&&r&&{dsn:Ut(r)}},[[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{items:e}]])}(a,i,this._client);o&&j.log(`Sending span envelope for trace ${e} with ${a.length} spans`),this._client.sendEnvelope(c).then(null,e=>{o&&j.error("Error while sending streamed span envelope:",e)}),this._removeTrace(e)}_removeTrace(e){const t=this._traceBuckets.get(e);t&&clearTimeout(t.timeout),this._traceBuckets.delete(e)}}function X_(e,t){const n=e.attributes??(e.attributes={});
1Object.entries(t).forEach(e=>{let[t,r]=e;null==r||t in n||(n[t]=r)})}const Y_=()=>({name:"SpanStreaming",beforeSetup(e){const t=e.getOptions();t.traceLifecycle||(Yi&&j.log('[SpanStreaming] set `traceLifecycle` to "stream"'),t.traceLifecycle="stream")},setup(e){const t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!ra(e))return r.traceLifecycle="static",void(Yi&&j.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`));const s=r.beforeSendSpan;if(s&&!er(s))return r.traceLifecycle="static",void(Yi&&j.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`));const i=new G_(e);e.on("afterSpanEnd",t=>{Ln(t)&&i.add(function(e,t){var n;const r=Mn(e),s=Wn(e),i=Mn(s),{isolationScope:o,scope:a}=mn(e);!function(e,t,n,r){var s,i,o,a,c,l;const u=n.getSdkMetadata(),{release:d,environment:h,sendDefaultPii:p}=n.getOptions();X_(e,{[_t]:d,[bt]:h,[St]:t.name,[wt]:t.span_id,[kt]:null==u||null===(s=u.sdk)||void 0===s?void 0:s.name,[Tt]:null==u||null===(i=u.sdk)||void 0===i?void 0:i.version,...p?{[Et]:null===(o=r.user)||void 0===o?void 0:o.id,[xt]:null===(a=r.user)||void 0===a?void 0:a.email,[It]:null===(c=r.user)||void 0===c?void 0:c.ip_address,[Ct]:null===(l=r.user)||void 0===l?void 0:l.username}:{},...r.attributes})}(r,i,t,wr(o,a)),r.is_segment&&t.emit("processSegmentSpan",r),t.emit("processSpan",r);const{beforeSendSpan:c}=t.getOptions(),l=c&&er(c)?function(e,t){return t(e)||(qn(),e)}(r,c):r,u=null===(n=l.attributes)||void 0===n?void 0:n[dt];return u&&X_(l,{"sentry.span.source":u}),{...(d=l,{...d,attributes:rn(d.attributes),links:null===(h=d.links)||void 0===h?void 0:h.map(e=>({...e,attributes:rn(e.attributes)}))}),_segmentSpan:s};var d,h}(t,e))}),e.on("afterSegmentSpanEnd",e=>{const t=e.spanContext().traceId;setTimeout(()=>{i.flush(t)},500)})}}),Q_=100,Z_=5e3,eb=36e5;function tb(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function nb(e){return tb(e.getAllKeys())}function rb(e){let t;function n(){return null==t&&(t=function(e,t){const n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);const r=tb(n);return e=>r.then(n=>e(n.transaction(t,"readwrite").objectStore(t)))}(e.dbName||"sentry-offline",e.storeName||"queue")),t}return{push:async t=>{try{const r=lr(t);await function(e,t,n){return e(e=>nb(e).then(r=>{if(!(r.length>=n))return e.put(t,Math.max(...r,0)+1),tb(e.transaction)}))}(n(),r,e.maxQueueSize||30)}catch{}},unshift:async t=>{try{const r=lr(t);await function(e,t,n){return e(e=>nb(e).then(r=>{if(!(r.length>=n))return e.put(t,Math.min(...r,0)-1),tb(e.transaction)}))}(n(),r,e.maxQueueSize||30)}catch{}},shift:async()=>{try{const e=await function(e){return e(e=>nb(e).then(t=>{const n=t[0];if(null!=n)return tb(e.get(n)).then(t=>(e.delete(n),tb(e.transaction).then(()=>t)))}))}(n());if(e)return function(e){let t="string"==typeof e?cr(e):e;function n(e){const n=t.subarray(0,e);return t=t.subarray(e+1),n}function r(){let e=t.indexOf(10);return e<0&&(e=t.length),JSON.parse(function(e){const t=u(c);return t.decodePolyfill?t.decodePolyfill(e):(new TextDecoder).decode(e)}(n(e)))}const s=r(),i=[];for(;t.length;){const e=r(),t="number"==typeof e.length?e.length:void 0;i.push([e,t?n(t):r()])}return[s,i]}(e)}catch{}}}}function sb(){return function(e){return t=>{const n=e({...t,createStore:rb});return oi.addEventListener("online",async e=>{await n.flush()}),n}}(function(e){function t(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];o&&j.log("[Offline]:",...t)}return n=>{const r=e(n);if(!n.createStore)throw new Error("No `createStore` function was provided");const s=n.createStore(n);let i,o=Z_;function a(e){i&&clearTimeout(i),i=qr(setTimeout(async()=>{i=void 0;const e=await s.shift();e&&(t("Attempting to send previously queued event"),e[0].sent_at=(new Date).toISOString(),l(e,!0).catch(e=>{t("Failed to retry sending",e)}))},e))}function c(){i||(a(o),o=Math.min(2*o,eb))}async function l(e){let i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!i&&ar(e,["replay_event","replay_recording"]))return await s.push(e),a(Q_),{};
1try{if(n.shouldSend&&!1===await n.shouldSend(e))throw new Error("Envelope not sent because `shouldSend` callback returned false");const t=await r.send(e);let s=Q_;var l,u;if(t)if(null!==(l=t.headers)&&void 0!==l&&l["retry-after"])s=Gr(t.headers["retry-after"]);else if(null!==(u=t.headers)&&void 0!==u&&u["x-sentry-rate-limits"])s=6e4;else if((t.statusCode||0)>=400)return t;return a(s),o=Z_,t}catch(r){if(await function(e,t,r){return!ar(e,["client_report"])&&(!n.shouldStore||n.shouldStore(e,t,r))}(e,r,o))return i?await s.unshift(e):await s.push(e),c(),t("Error sending. Event queued.",r),{};throw r}}return n.flushAtStartup&&c(),{send:l,flush:e=>(void 0===e&&(o=Z_,a(Q_)),r.flush(e))}}}(arguments.length>0&&void 0!==arguments[0]?arguments[0]:Go))}const ib=function(){const e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).sidecarUrl||"http://localhost:8969/stream";return{name:"SpotlightBrowser",setup:()=>{Yi&&j.log("Using Sidecar URL",e)},processEvent:e=>function(e){var t;return Boolean("transaction"===e.type&&e.spans&&(null===(t=e.contexts)||void 0===t?void 0:t.trace)&&"ui.action.click"===e.contexts.trace.op&&e.spans.some(e=>{let{description:t}=e;return null==t?void 0:t.includes("#sentry-spotlight")}))}(e)?null:e,afterAllSetup:t=>{!function(e,t){const n=Vo("fetch");let r=0;e.on("beforeEnvelope",e=>{r>3?j.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests:",r):n(t,{method:"POST",body:lr(e),headers:{"Content-Type":"application/x-sentry-envelope"},mode:"cors"}).then(e=>{e.status>=200&&e.status<400&&(r=0)},e=>{r++,j.error("Sentry SDK can't connect to Sidecar is it running? See: https://spotlightjs.com/sidecar/npx/",e)})})}(t,e)}}},ob=()=>
1({name:"OpenFeature",processEvent:(e,t,n)=>Up(e)});class ab{after(e,t){zp(t.flagKey,t.value),Wp(t.flagKey,t.value)}error(e,t,n){zp(e.flagKey,e.defaultValue),Wp(e.flagKey,e.defaultValue)}}const cb=e=>{let{featureFlagClientClass:t}=e;return{name:"Unleash",setupOnce(){B(t.prototype,"isEnabled",lb)},processEvent:(e,t,n)=>Up(e)}};function lb(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const s=n[0],i=e.apply(this,n);return"string"==typeof s&&"boolean"==typeof i?(zp(s,i),Wp(s,i)):Yi&&j.error(`[Feature Flags] UnleashClient.isEnabled does not match expected signature. arg0: ${s} (${typeof s}), result: ${i} (${typeof i})`),i}}function ub(e){return function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const s=n[0],i=e.apply(this,n);return"string"==typeof s&&"boolean"==typeof i&&(zp(s,i),Wp(s,i)),i}}const db=e=>{let{growthbookClass:t}=e;return(e=>{let{growthbookClass:t}=e;return{name:"GrowthBook",setupOnce(){const e=t.prototype;"function"==typeof e.isOn&&B(e,"isOn",ub),"function"==typeof e.getFeatureValue&&B(e,"getFeatureValue",ub)}
1,processEvent:(e,t,n)=>Up(e)}})({growthbookClass:t})},hb=e=>{let{featureFlagClient:t}=e;return{name:"Statsig",setup(e){t.on("gate_evaluation",e=>{zp(e.gate.name,e.gate.value),Wp(e.gate.name,e.gate.value)})},processEvent:(e,t,n)=>Up(e)}};async function pb(){const e=Ge();if(!e)return"no-client-active";if(!e.getDsn())return"no-dsn-configured";const t=e.getOptions().tunnel||"https://o447951.ingest.sentry.io/api/4509632503087104/envelope/?sentry_version=7&sentry_key=c1dfb07d783ad5325c245c1fd3725390&sentry_client=sentry.javascript.browser%2F1.33.7";try{await fa(()=>fetch(t,{body:"{}",method:"POST",mode:"cors",credentials:"omit"}))}catch{return"sentry-unreachable"}}const fb=e=>{let{worker:t}=e;return{name:"WebWorker",setupOnce:()=>{(Array.isArray(t)?t:[t]).forEach(e=>mb(e))},addWorker:e=>mb(e)}};function mb(e){e.addEventListener("message",e=>{if(function(e){if(!b(e)||!0!==e._sentryMessage)return!1;const t="_sentryDebugIds"in e,n="_sentryModuleMetadata"in e,r="_sentryWorkerError"in e,s="_sentryWasmImages"in e;return!!(t||n||r||s)&&(!(t&&!b(e._sentryDebugIds)&&void 0!==e._sentryDebugIds)&&(!(n&&!b(e._sentryModuleMetadata)&&void 0!==e._sentryModuleMetadata)&&(!(r&&!b(e._sentryWorkerError))&&!!(!s||Array.isArray(e._sentryWasmImages)&&e._sentryWasmImages.every(e=>b(e)&&"string"==typeof e.code_file)))))}(e.data)){if(e.stopImmediatePropagation(),e.data._sentryDebugIds&&(Yi&&j.log("Sentry debugId web worker message received",e.data),oi._sentryDebugIds={...e.data._sentryDebugIds,...oi._sentryDebugIds}),e.data._sentryModuleMetadata&&(Yi&&j.log("Sentry module metadata web worker message received",e.data),oi._sentryModuleMetadata={...e.data._sentryModuleMetadata,...oi._sentryModuleMetadata}),e.data._sentryWasmImages){Yi&&j.log("Sentry WASM images web worker message received",e.data);const t=oi._sentryWasmImages||[],n=e.data._sentryWasmImages.filter(e=>b(e)&&"string"==typeof e.code_file&&!t.some(t=>t.code_file===e.code_file));oi._sentryWasmImages=[...t,...n]}e.data._sentryWorkerError&&(Yi&&j.log("Sentry worker rejection message received",e.data._sentryWorkerError),function(e){const t=Ge(
1);if(!t)return;const n=t.getOptions().stackParser,r=t.getOptions().attachStacktrace,s=e.reason,i=_(s)?mo(s):$s(n,s,void 0,r,!0);i.level="error",e.filename&&(i.contexts={...i.contexts,worker:{filename:e.filename}}),zs(i,{originalException:s,mechanism:{handled:!1,type:"auto.browser.web_worker.onunhandledrejection"}}),Yi&&j.log("Captured worker unhandled rejection",s)}(e.data._sentryWorkerError))}})}function gb(e){let{self:t}=e;t.postMessage({_sentryMessage:!0,_sentryDebugIds:t._sentryDebugIds??void 0,_sentryModuleMetadata:t._sentryModuleMetadata??void 0}),t.addEventListener("unhandledrejection",e=>{var n;const r={reason:fo(e),filename:null===(n=t.location)||void 0===n?void 0:n.href};t.postMessage({_sentryMessage:!0,_sentryWorkerError:r}),Yi&&j.log("[Sentry Worker] Forwarding unhandled rejection to parent",r)}),Yi&&j.log("[Sentry Worker] Registered worker with unhandled rejection handling")}function yb(){return window.location.hostname.includes("app.napkin.ai")||"true"===new URLSearchParams(window.location.search).get("isProduction")}const vb=/^(?:RangeError:\s*)?Position -?\d+ out of range$/,_b=/observer|flush/,bb=/prosemirror-view/i,Sb=/tiptap\.bundle\.js|text-web-lib\/tiptap\/bundle\.js/i;function wb(e,t){const n=e.toLowerCase();if(n.includes("domobserver"))return!0;const r=t.toLowerCase();return bb.test(r)?_b.test(n):!!Sb.test(r)&&n.includes("observer")}function kb(e){const t=e.toLowerCase();return t.includes("firebase/auth")||t.includes("indexeddblocalpersistence")||t.includes("auth-web-lib")}function Tb(e,t,n){try{const r=n.toLowerCase();if("string"==typeof e.message&&e.message.toLowerCase().includes(r))return!0;if(t&&t.originalException){const e=t.originalException;if(e&&"string"==typeof e.message&&e.message.toLowerCase().includes(r))return!0}if(e.exception&&Array.isArray(e.exception.values))for(const t of e.exception.values)if(t.stacktrace&&Array.isArray(t.stacktrace.frames))for(const e of t.stacktrace.frames)if("string"==typeof e.filename&&e.filename.toLowerCase().includes(r)||"string"==typeof e.function&&e.function.toLowerCase().includes(r))return!0;if("string"==typeof e.culprit&&e.culprit.toLowerCase().includes(r))return!0}catch(e){console.error("[Sentry] Error in _eventComingFromSrc: ",e)}return!1}window.NapkinSentry={errorHashes:{},init:function(){try{Yo({dsn:yb()?"https://02d72dcf91f3ffafdfa130e080a6f809@o4507804332654592.ingest.de.sentry.io/4507825891246160":"https://f7b31574b55e1d3a86ce2e969584fc2b@o4507804332654592.ingest.de.sentry.io/4507804354609232",release:window.gitCommit||"unknown",integrations:[pl(),Gl(),Pp({maskAllText:!1,blockAllMedia:!1,networkRequestHeaders:["X-Napkin-Workspace-Id"],networkResponseHeaders:["X-Napkin-Workspace-Id"]}),qp()],sendDefaultPii:!0,tracesSampleRate:.1,tracePropagationTargets:["localhost",/^https:\/\/napkin\.ai\/api/],replaysSessionSampleRate:0,replaysOnErrorSampleRate:1,profilesSampleRate:1,ignoreErrors:["ResizeObserver loop limit exceeded","ResizeObserver loop completed with undelivered notifications","Non-Error promise rejection captured with value","Error looking up record in object store by key range","WKWebView API client did not respond to this postMessage","Invalid call to runtime.sendMessage()","Invalid event type from worker: undefined","Unexpected EOF","NS_ERROR_FILE_CORRUPTED","NS_ERROR_NOT_INITIALIZED","NS_ERROR_ABORT","NS_ERROR_FAILURE","NS_ERROR_UNEXPECTED","NS_ERROR_FILE_NOT_DIRECTORY","The operation is insecure.","Failed to execute 'write' on 'Clipboard': Document is not focused.","sendBeacon",/^Method not found$/,"Failed to execute 'insertRule' on 'CSSStyleSheet'","hookGeo",'can\'t redefine non-configurable property "geolocation"',"Invalid or unexpected token","TypeError: Illegal invocation","Unexpected token","Expected '}' to end a body of a","Unexpected identifier 'https","Unexpected identifier 'newStore","Unexpected identifier 't2","missing ) after argument list","unexpected token: keyword 'return'","Unterminated regular expression literal '/micromess","Unexpected end of script","Unexpected end of input","Promise.resolve is not a function","Failed to fetch","Load failed","AbortError","NetworkError when attempting to fetch resource.","NS_ERROR_FILE_NOT_FOUND","Connection to Indexed Database server lost. Refresh the page to try again","Database deleted by request of the user","Encountered full disk while opening backing store for indexedDB.open.","Encountered disk full while committing transaction","Unable to open database file on disk","Internal error opening backing store for indexedDB.open.","Internal error deleting database.","Object store cannot be found in the database","The operation failed for reasons unrelated to the database itself","FILE_E
1RROR_NO_SPACE","secret is not defined","zaloJSV2","Stylesheet append timeout","LaunchDarklyFlagFetchError","GA is not defined","Invalid content for node type paragraph","Failed to execute 'collapse' on 'Selection'","null is not an object (evaluating 'o.type')","Cannot read properties of null (reading 'type')","Called contentMatchAt on a node with invalid content","Content hole not allowed in a leaf node spec","is larger than the node's length","undefined is not an object (evaluating 'n.nodeType')","Cannot read properties of null (reading 'pmViewDesc')","Cannot read properties of undefined (reading '_focused')","__spreadArray",'can\'t redefine non-configurable property "get"',"auth/network-request-failed","grecaptcha is not defined",'Policy with name "default" already exists',"IFrameMessageHandler","onReady is not defined","onHide is not defined","onSystemThemeChanged is not defined","Cannot read properties of undefined (reading 'checker')","the message channel closed before a response was received","Identifier 'nativeIframe' has already been declared","Identifier 'Shop' has already been declared","Cannot redefine property: userAgent","Cannot redefine property: webdriver","a0_0x","xbrowser is not defined","extDomain is not defined","window.webkit.messageHandlers","The WKWebView was deallocated before the message was delivered","kCFErrorDomainCFNetwork","Attempting to change value of a readonly property.","Can only call Window.structuredClone on instances of Window","The object does not support the operation or argument.","Error: Error","No error message","TypeError: window.checkLogin is not a function","TypeError: null is not an object (evaluating 'l.formElement')","Origin is only applicable schemes http and https: file://","Object captured as promise rejection with keys:","(type=error) captured as promise rejection","(type=unhandledrejection) captured as promise rejection","AbortController is not a constructor","window.performance.getEntriesByName","jb","_chromeNamespace","contentWindow","Can't find variable: post","Can't find variable: GM_getValue","Can't find variable: unsafeWindow","Can't find variable: gmo","undefined is not an object (evaluating 'a.K')","undefined is not an object (evaluating 'a.J')","null is not an object (evaluating 'e.contentDocument.body')","webVitals.getCLS is not a function","webVitals is not defined","entries.at is not a function","jQuery is not defined","$ is not defined","$ is not a function","customDispatchEvent is not defined","Java bridge method invocation error","Java object is gone","WebViewJavascriptBridge is not defined","Java exception was raised during method invocation","GetHTMLElementsAtPoint","Data cannot be cloned","window[objectName][methodName] is not a function","window[functionName] is not a function","Blocked a frame with origin","WebAssembly","TricentisAlertAlerter","TricentisShadowDomUnlocker","UCShellJava.sdkEventFire","There is no clipping info for given tab","zp_token","repeatInterval_c","shadowDOMUnlocker is not defined","toscaAlertAlerter is not defined","Mx is not defined","_0x563ad2 is not defined","LIDNotifyId is not defined","nativeInitedNotify is not defined","frappe is not defined","ethereum","HTMLOUT is not defined","wsimtgo","yandexReadabilityChecker","_logicalFormForControl","GM_listValues","WeixinJSBridge","getCosmeticsFilters","applyAdblockCode",/^Cannot read properties of null (reading 'document')$/,/^f is undefined$/,"change_ua","Menu caption text is required!","Not allowed to access cross-origin stylesheet","webtranslation_detect","args.site.enabledFeatures is undefined","executerAntiinfobulle","miui/","IdleDeadline","type 'JSNull' is not a subtype of type 'FutureOr<JSObject>'","clearRemoteRecord","Cannot add property name, object is not extensible","Cannot declare a const variable twice","property 'replace' is a read-only and non-configurable data property","[Cloudflare Turnstile] Error: 300010","translateNotifyDetectionError","WX_Trans_id","Module load timeout:","Receiving end does not exist","Invalid call to browser.storage.local.set()","Firebase App named '[DEFAULT]' already exists","INTERNAL ASSERTION FAILED: Expected a class definition","auth/user-token-expired","A listener indicated an asynchronous response by returning true"],beforeSend(e,t){try{if(e.message&&window.NapkinSentry.errorHashes[e.message]>5)return null;window.NapkinSentry.errorHashes[e.message]=window.NapkinSentry.errorHashes[e.message]?window.NapkinSentry.errorHashes[e.message]+1:1}catch(e){console.error("[Sentry] Error in beforeSend: ",e)}if(function(e,t){const n=t&&t.originalException&&t.originalException.message||e&&e.message||"";if("string"!=typeof n||!/^(error:\s*)?out of memory$/i.test(n.trim()))return!1;const r=t&&t.originalException&&t.originalException.stack;return("string"!=typeof r||!r.trim())&&0===(e&&e.exception&&Array.isArray(e.exception.values)?e.exception.values:[]).flatMap(e=>e.stacktrace&&Array.isArray(e.stacktrace.frames)?e.stacktrace.frames:[]).length}(e,t))return console.warn("[Sentry] Ignoring stackless browser out-of-memory error"),null;if(function(e,t){var n,r,s;const i=null==e||null===(n=e.exception)||void 0===n?void 0:n.values,o=Array.isArray(i)?i:[];if(![null==t||null===(r=t.originalException)||void 0===r?void 0:r.message,null==e?void 0:e.message,...o.map(e=>e.value)].some(e=>"string"==typeof e&&vb.test(e.trim())))return!1;const a=null==t||null===(s=t.originalException)||void 0===s?void 0:s.stack;return!("string"!=typeof a||!a.split("\n").some(e=>wb(e,e)))||o.some(e=>{var t;const n=null==e||null===(t=e.stacktrace)||void 0===t?void 0:t.frames;return Array.isArray(n)&&n.some(e=>{const t="string"==typeof(null==e?void 0:e.function)?e.function:"",n="string"==typeof(null==e?void 0:e.filename)?e.filename:"",r="string"==typeof(null==e?void 0:e.abs_path)?e.abs_path:"";return wb(t,n)||wb(t,r)})})}(e,t))return console.warn("[Sentry] Ignoring ProseMirror DOMObserver position error"),null;if(function(e,t){const n=e&&e.exception&&Array.isArray(e.exception.values)?e.exception.values:[];if(![t&&t.originalException&&t.originalException.message,e&&e.message,...n.map(e=>e&&e.value)].some(e=>"string"==typeof e&&/database(?: connection)? is closing/i.test(e)))return!1;const r=t&&t.originalException&&t.originalException.stack;return!("string"!=typeof r||!kb(r))||n.some(e=>(e&&e.stacktrace&&Array.isArray(e.stacktrace.frames)?e.stacktrace.frames:[]).some(e=>
1kb([e.filename,e.function].filter(Boolean).join(" "))))}(e,t))return console.warn("[Sentry] Ignoring Firebase IndexedDB persistence noise"),null;const n=t&&t.originalException&&t.originalException.message||e.message||"";return"string"==typeof n&&n.includes("Maximum call stack size exceeded")&&!(e.exception&&Array.isArray(e.exception.values)?e.exception.values:[]).flatMap(e=>e.stacktrace&&Array.isArray(e.stacktrace.frames)?e.stacktrace.frames:[]).some(e=>"string"==typeof e.filename&&e.filename.includes("main.dart.js"))?(console.warn("[Sentry] Ignoring in-app-browser stack overflow error"),null):Tb(e,t,"file://")?(console.warn("[Sentry] Ignoring local file error: ",e.message),null):Tb(e,t,"blob:")?(console.warn("[Sentry] Ignoring blob file error: ",e.message),null):Tb(e,t,"chrome-extension://")?(console.warn("[Sentry] Ignoring chrome extension error: ",e.message),null):Tb(e,t,"moz-extension://")?(console.warn("[Sentry] Ignoring firefox extension error: ",e.message),null):Tb(e,t,"clarity.js")?(console.warn("[Sentry] Ignoring clarity.js error: ",e.message),null):Tb(e,t,"@sentry-internal")||Tb(e,t,"@sentry")?(console.warn("[Sentry] Ignoring sentry-internal error: ",e.message),null):Tb(e,t,"bundle/m.js")?(console.warn("[Sentry] Ignoring monitoring bundle error: ",e.message),null):Tb(e,t,"gtm.js")?(console.warn("[Sentry] Ignoring Google Tag Manager error: ",e.message),null):Tb(e,t,"prosemirror-transform")||Tb(e,t,"prosemirror-view")?(console.warn("[Sentry] Ignoring prosemirror error: ",e.message),null):Tb(e,t,"translate.googleapis.com")||Tb(e,t,"translate_http")||Tb(e,t,"translate.datong.info")||Tb(e,t,"intercomcdn.com")||Tb(e,t,"undefined is not an object (evaluating 'a.J')")||Tb(e,t,"rocket-loader.min.js")||Tb(e,t,"u.c.b.r.o.w.s.e.r")?null:e},beforeBreadcrumb(e,t){try{if("console"===e.category&&"debug"===e.level)return null}catch(e){}return e}}),console.debug("[Sentry] Loaded");try{const e=window.__napkin_sentry_queue||[];if(Array.isArray(e)&&e.length>0){console.debug("[Sentry] Flushing early error queue (exceptions/rejections only):",e.length),e.forEach(e=>{try{if(!e)return;if("exception"===e.type){const t=e.error;t instanceof Error?Fs(t):console.debug("[Sentry] Skipping early exception (not an Error instance):",e)}else if("rejection"===e.type){const t=e.reason;t instanceof Error?Fs(t):console.debug("[Sentry] Skipping early rejection (not an Error instance):",e)}}catch(e){console.error("[Sentry] Error in flushing early queue: ",e)}});try{window.__napkin_sentry_queue=[]}catch(e){}}}catch(e){console.error("[Sentry] Error flushing early queue: ",e)}}catch(e){console.error("[Sentry] Error in loading Sentry: ",e)}if(window.location.search.includes("debug-session=true"))try{$p().start(),Js("debug-record","true"),console.debug("[Sentry] Session Replay Started from debug-session=true query parameter");const e=window.location.search.match(/email=([^&]*)/);e&&(Ks({email:e[1]}),console.debug("[Sentry] User email set for the session replay",e[1]))}catch(e){console.error("[Sentry] Error in starting the session replay: ",e)}},getClient:function(){return i}};function Eb(e,t,n){return(t=function(e){var t=function(e){if("object"!=typeof e||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var n=t.call(e,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class xb{constructor(){this.lastTs=0,this.lastSuffix=1,this.backDict={},this.getKey=e=>{let t=!1;const n=`__${e}`;if(!this.backDict[n]){t=!0;const e=Date.now()%10**11;let r=e;r===this.lastTs?(r=1e4*r+this.lastSuffix,this.lastSuffix+=1):this.lastSuffix=1,this.backDict[n]=r,this.lastTs=e}return[this.backDict[n],t]}}}class Ib{constructor(e){this.sendSetAttribute=(e,t,n)=>{if(this.isDictDisabled){const r=[12,e,t,n];return this.app.send(r)}{const r=[35,e,this.applyDict(t),this.applyDict(n)];return this.app.send(r)}},this.app=e.app,this.isDictDisabled=e.isDictDisabled,this.dict=new xb}applyDict(e){const[t,n]=this.dict.getKey(e);return n&&this.app.send([34,t,e]),t}clear(){this.dict=new xb}}class Cb{constructor(e,t){this.app=e,this.startParams=t,this.conditions=[],this.hasStarted=!1,this.createConditionFromFilter=e=>{const t=Ab(e);if(t.type)return t},this.durationInts=[]}setConditions(e){this.conditions=e}async fetchConditions(e,t){try{const n=await fetch(`${this.app.options.ingestPoint}/v1/web/conditions/${e}`,{method:"GET",headers:{Authorization:`Bearer ${t}`}}),{conditions:r}=await n.json(),s=[];
1r.forEach(e=>{e.filters.forEach(t=>{let n;"fetch"===t.type?(n={type:"network_request",subConditions:[],name:e.name},t.filters.forEach(e=>{const t=this.createConditionFromFilter(e);t&&n.subConditions.push(t)})):n=this.createConditionFromFilter(t),n&&("session_duration"===n.type&&this.processDuration(n.value[0],e.name),s.push({...n,name:e.name}))})}),this.conditions=s}catch(e){this.app.debug.error("Critical: cannot fetch start conditions")}}trigger(e){if(!this.hasStarted)try{this.hasStarted=!0,this.app.start(this.startParams,void 0,e)}catch(e){this.app.debug.error(e)}}processMessage(e){if(!this.hasStarted)switch(e[0]){case 78:this.jsExceptionEvent(e);break;case 27:this.customEvent(e);break;case 68:this.clickEvent(e);break;case 122:this.pageLocationEvent(e);break;case 83:this.networkRequest(e)}}processFlags(e){const t=this.conditions.filter(e=>"feature_flag"===e.type);t.length&&t.forEach(t=>{const n=Ob[t.operator];n&&e.find(e=>n(e.key,t.value))&&this.trigger(t.name)})}clearDurationInt(e){clearInterval(e),this.durationInts=this.durationInts.filter(t=>t!==e)}processDuration(e,t){const n=setInterval(()=>{performance.now()>e&&(this.clearDurationInt(n),this.trigger(t))},1e3);this.durationInts.push(n),this.app.attachStopCallback(()=>this.clearDurationInt(n))}networkRequest(e){const t=this.conditions.filter(e=>"network_request"===e.type);t.length&&t.forEach(t=>{const n=t.subConditions.filter(e=>"isAny"!==e.operator);n.length?n.every(t=>{let n;switch(t.key){case"url":n=e[3];break;case"status":n=e[6];break;case"method":n=e[2];break;case"duration":n=e[8]}const r=Ob[t.operator];if(r&&r(n,t.value))return!0})&&this.trigger(t.name):0===n.length&&t.subConditions.length&&this.trigger(t.name)})}customEvent(e){const t=this.conditions.filter(e=>"custom_event"===e.type);t.length&&t.forEach(t=>{const n=Ob[t.operator];n&&(n(e[1],t.value)||n(e[2],t.value))&&this.trigger(t.name)})}clickEvent(e){const t=this.conditions.filter(e=>"click"===e.type);t.length&&t.forEach(t=>{const n=Ob[t.operator];n&&(n(e[3],t.value)||n(e[4],t.value))&&this.trigger(t.name)})}pageLocationEvent(e){const t=this.conditions.filter(e=>"visited_url"===e.type);t&&t.forEach(t=>{const n=Ob[t.operator];n&&n(e[1],t.value)&&this.trigger(t.name)})}jsExceptionEvent(e){const t=[e[1],e[2],e[3]],n=this.conditions.filter(e=>"exception"===e.type);n&&n.forEach(e=>{const n=Ob[e.operator];n&&t.some(t=>n(t,e.value))&&this.trigger(e.name)}
1)}}const Ob={is:(e,t)=>t.some(t=>e.includes(t)),isAny:()=>!0,isNot:(e,t)=>!t.some(t=>e.includes(t)),contains:(e,t)=>t.some(t=>e.includes(t)),notContains:(e,t)=>!t.some(t=>e.includes(t)),startsWith:(e,t)=>t.some(t=>e.startsWith(t)),endsWith:(e,t)=>t.some(t=>e.endsWith(t)),greaterThan:(e,t)=>e>t,greaterOrEqual:(e,t)=>e>=t,lessOrEqual:(e,t)=>e<=t,lessThan:(e,t)=>e<t},Ab=e=>{const t={on:"is",notOn:"isNot",">":"greaterThan","<":"lessThan","=":"is","<=":"lessOrEqual",">=":"greaterOrEqual"},n=e=>{if(Object.keys(t).includes(e))return t[e]};let r={type:"",operator:"",value:e.value,key:""};switch(e.type){case"click":r={type:"click",operator:n(e.operator),value:e.value,key:""};break;case"location":r={type:"visited_url",operator:e.operator,value:e.value,key:""};break;case"custom":r={type:"custom_event",operator:e.operator,value:e.value,key:""};break;case"metadata":r={type:"featureFlag"===e.source?"feature_flag":e.type,operator:e.operator,value:e.value,key:""};break;case"error":r={type:"exception",operator:e.operator,value:e.value,key:""};break;case"duration":r={type:"session_duration",value:e.value,key:"",operator:"is"};break;case"fetchUrl":r={type:"network_request",key:"url",operator:e.operator,value:e.value};break;case"fetchStatusCode":r={type:"network_request",key:"status",operator:n(e.operator),value:e.value};break;case"fetchMethod":r={type:"network_request",key:"method",operator:n(e.operator),value:e.value};break;case"fetchDuration":r={type:"network_request",key:"duration",operator:n(e.operator),value:e.value}}return r},Mb={htmlmasked:"hidden",masked:"obscured"},Rb=!("undefined"==typeof window),Nb=Rb&&navigator.userAgent.match(/firefox|fxios/i);let Pb=Rb?Date.now()-performance.now():0;
1function Lb(){Pb=Date.now()-performance.now()}function Db(){return Pb}const $b=Rb&&performance.now?()=>Math.round(performance.now()+Pb):()=>Date.now(),jb="repeat"in String.prototype?e=>"*".repeat(e.length):e=>e.replace(/./g,"*");function Bb(e){return e?e.trim().replace(/\s+/g," "):""}function Fb(e){return e.startsWith("https://")||e.startsWith("http://")}const Ub="https://docs.openreplay.com",zb={};function Wb(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"/";zb[e]||(console.warn(`OpenReplay: ${e} is deprecated. ${t?`Please, use ${t} instead.`:""} Visit ${Ub}${n} for more information.`),zb[e]=!0)}function Hb(e,t){if(!t||0===t.length)return"";const n=[];for(const r of t){const t=e.getAttribute(r);null!==t&&n.push(`[${r}=${t}]`)}return n.join("")}function qb(e){return e.classList&&0!==e.classList.length?"."+Array.from(e.classList).join("."):""}function Vb(e){let t=e.getAttribute("data-openreplay-label");return null!==t||(t=e.getAttribute("data-asayer-label"),null!==t&&Wb('"data-asayer-label" attribute','"data-openreplay-label" attribute',"/")),t}function Jb(e,t){const n=`data-openreplay-${t}`;return!!e.hasAttribute(n)&&(Mb[t]&&Wb(`"${n}" attribute`,`"${Mb[t]}" attribute`,"/en/sdk/sanitize-data"),!0)}function Kb(e){try{return e instanceof HTMLIFrameElement?e.contentDocument:e instanceof Window?e.document:e instanceof Document?e.defaultView:"nodeType"in e?e.nodeType:"addEventListener"in e&&e.addEventListener,!0}catch(e){if(e instanceof DOMException&&"SecurityError"===e.name)return!1}return!0}function Gb(e){return e.toString(16).padStart(2,"0")}function Xb(){try{return window.self&&window.top&&window.self!==window.top}catch(e){return!0}}function Yb(e){return window.Zone&&"__symbol__"in window.Zone?window.Zone.__symbol__(e):e}function Qb(e,t){if(t)return new MutationObserver(e);{const t=Yb("MutationObserver");return new window[t](e)}}function Zb(e,t,n,r,s){if(!Kb(e))return;let i="addEventListener";s||(i=Yb("addEventListener"));try{e[i]?e[i](t,n,r):e.addEventListener(t,n,r)}catch(n){const r=n.message;console.error(`Openreplay: ${r}; if this error is caused by an IframeObserver, ignore it`,t,e)}}function eS(e,t,n,r,s){if(!Kb(e))return;let i="removeEventListener";s||(i=Yb("removeEventListener"));try{e[i]?e[i](t,n,r):e.removeEventListener(t,n,r)}catch(n){const r=n.message;console.error(`Openreplay: ${r}; if this error is caused by an IframeObserver, ignore it`,t,e)}}const tS=new class{constructor(){this.taskQueue=[],this.isRunning=!1}addTask(e){this.taskQueue.push(e),this.runTasks()}runTasks(){if(this.isRunning||0===this.taskQueue.length)return;this.isRunning=!0;const e=()=>{if(0===this.taskQueue.length)return void(this.isRunning=!1);const t=this.taskQueue.shift();Promise.resolve(t()).then(()=>{requestAnimationFrame(()=>e())})};e()}};function nS(e){tS.addTask(e)}function rS(e,t){const n={...e};for(const r in t)if(t.hasOwnProperty(r)){const s=t[r],i=e[r];"object"!=typeof s||Array.isArray(s)||null===s?n[r]=s:n[r]=rS(i||{},s)}return n}function sS(e){return[0,e]}function iS(e,t,n,r,s){return[8,e,t,n,r,s]}function oS(e,t,n){return[9,e,t,n]}function aS(e){return[11,e]}function cS(e,t,n){return[12,e,t,n]}function lS(e,t){return[13,e,t]}function uS(e,t){return[22,e,t]}function dS(e,t){return[27,e,t]}function hS(e,t){return[30,e,t]}function pS(e,t,n,r){return[57,e,t,n,r]}function fS(e){return[58,e]}function mS(e,t,n,r){return[60,e,t,n,r]}function gS(e,t,n){return[61,e,t,n]}function yS(e,t){return[65,e,t]}function vS(e,t){return[70,e,t]}function _S(e,t,n){return[71,e,t,n]}function bS(e,t,n,r){return[73,e,t,n,r]}function SS(e,t){return[75,e,t]}function wS(e,t){return[76,e,t]}function kS(e,t){return[77,e,t]}function TS(e,t,n,r){return[78,e,t,n,r]}function ES(e,t,n,r,s,i,o,a,c){return[83,e,t,n,r,s,i,o,a,c]}function xS(e,t,n,r,s,i,o,a,c,l,u,d,h,p,f,m,g){return[85,e,t,n,r,s,i,o,a,c,l,u,d,h,p,f,m,g]}function IS(e,t,n){return[113,e,t,n]}function CS(e){return[115,e]}function OS(e){return[117,e]}function AS(e){return[118,e]}const MS=Rb&&"performance"in window&&"memory"in performance?performance:{memory:{}},RS=Rb?1024*(navigator.deviceMemory||0):0,NS=MS.memory.jsHeapSizeLimit||0;class PS{constructor(){this.tags=[],this.byId=new Map,this.byDataAttr=new Map,this.byClass=new Map,this.fallback=[]}setTags(e){this.tags=e,this.byId.clear(),this.byDataAttr.clear(),this.byClass.clear(),this.fallback=[];for(const t of e){const e=LS(t.selector);if(e)if(e.startsWith("#"))this.byId.set(e.slice(1),t);else if(e.startsWith("[data-"))this.byDataAttr.set(e,t);else{const n=DS(e);n?this.byClass.set(n,t):this.fallback.push(t)}else this.fallback.push(t)}}getTags(){return this.tags}match(e){const t=this.matchExact(e);if(t)return t;if(e.parentElement){const t=this.matchExact(e.parentElement);if(t)return t}const n=e.children;for(let e=0;e<n.length;e++){const t=this.matchExact(n[e]);if(t)return t}return null}matchExact(e){if(e.id&&this.byId.has(e.id)){const t=this.byId.get(e.id);if($S(e,t.selector)&&jS(t))return t}if(this.byDataAttr.size>0){const t=e.attributes;for(let n=0;n<t.length;n++){const r=t[n];if(r.name.startsWith("data-")){const t=`[${r.name}="${r.value}"]`;if(this.byDataAttr.has(t)){const n=this.byDataAttr.get(t);if($S(e,n.selector)&&jS(n))return n}}}}if(this.byClass.size>0&&e.classList)for(let t=0;t<e.classList.length;t++){const n=e.classList[t];if(this.byClass.has(n)){const t=this.byClass.get(n);if($S(e,t.selector)&&jS(t))return t}}for(const t of this.fallback)if($S(e,t.selector)&&jS(t))return t;return null}clear(){this.tags=[],this.byId.clear(),this.byDataAttr.clear(),this.byClass.clear(),this.fallback=[]}}function LS(e){var t;const n=e.trim();if(!n)return null;const r=n.split(/\s*[>+~ ]\s*/);return(null===(t=r[r.length-1])||void 0===t?void 0:t.trim())||null}function DS(e){const t=e.match(/\.([a-zA-Z_-][\w-]*)/);return t?t[1]:null}function $S(e,t){try{return e.matches(t)}catch{return!1}}function jS(e){if(!e.location)return!0;try{const t=e.location;return t.startsWith("/")?window.location.pathname===t:window.location.href===t}catch{return!0}}const BS="__or__watched_tags__";class FS{constructor(e){this.interval=null,this.tags=[],this.matcher=new PS,this.sessionStorage=e.sessionStorage,this.errLog=e.errLog,this.onTag=e.onTag;const t=JSON.parse(e.sessionStorage.getItem(BS)??"[]");this.setTags(t),this.observer=new IntersectionObserver(e=>
1{e.forEach(e=>{if(e.isIntersecting&&e.target){const t=e.target.__or_watcher_tagname;t&&this.onTagRendered(t),this.observer.unobserve(e.target)}})})}async fetchTags(e,t){return fetch(`${e}/v1/web/tags`,{method:"GET",headers:{Authorization:`Bearer ${t}`}}).then(e=>e.json()).then(e=>{let{tags:t}=e;if(t&&t.length){this.setTags(t);const e=JSON.stringify(t);this.sessionStorage.setItem(BS,e||"")}}).catch(e=>this.errLog(e))}setTags(e){this.tags=e,this.matcher.setTags(e),this.interval&&(clearInterval(this.interval),this.interval=null),this.interval=setInterval(()=>{this.tags.forEach(e=>{if(!jS(e))return;const t=document.querySelectorAll(e.selector);if(t.length>0){const n=t[0];n.__or_watcher_tagname=e.id,this.observer.observe(n)}})},500)}onTagRendered(e){const t=this.tags.find(t=>t.id===e);t&&(this.tags=this.tags.filter(t=>t.id!==e),!jS(t))||this.onTag(e)}clear(){this.tags=[],this.matcher.clear(),this.interval&&(clearInterval(this.interval),this.interval=null),this.observer.disconnect()}}function US(e){return!!e&&null!=e.nodeType}function zS(e){return"http://www.w3.org/2000/svg"===e.namespaceURI||"svg"===e.localName}function WS(e){return e.nodeType===Node.ELEMENT_NODE}function HS(e){return e.nodeType===Node.TEXT_NODE}function qS(e){return e.nodeType===Node.DOCUMENT_NODE}function VS(e){return e.nodeType===Node.DOCUMENT_NODE||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE}function JS(e,t){return e.localName===t}class KS{constructor(e,t){this.app=e,this.options=t,this.snapshots={},this.intervals=new Map,this.observers=new Map,this.uploadQueue=0,this.MAX_CONCURRENT_UPLOADS=2,this.MAX_QUEUE_SIZE=50,this.pendingBatches=[],this.isProcessingQueue=!1,this.resanitizeCanvas=(e,t)=>{if(JS(e,"canvas"))if(this.app.sanitizer.isObscured(t)||this.app.sanitizer.isHidden(t)){if(this.snapshots[t]||this.observers.has(t)){const e=this.observers.get(t);e&&(e.disconnect(),this.observers.delete(t)),this.cleanupCanvas(t)}}else this.snapshots[t]||this.observers.has(t)||this.captureCanvas(e)},this.restartTracking=()=>{this.clear(),this.app.nodes.scanTree(this.captureCanvas)},this.captureCanvas=e=>{const t=this.app.nodes.getID(e);if(!t||!JS(e,"canvas"))return;if(this.app.sanitizer.isObscured(t)||this.app.sanitizer.isHidden(t)||this.snapshots[t])return;const n=new IntersectionObserver(e=>{e.forEach(e=>{e.isIntersecting?this.snapshots[t]&&this.snapshots[t].createdAt?this.snapshots[t].paused=!1:this.recordCanvas(e.target,t):this.snapshots[t]&&(this.snapshots[t].paused=!0)})});this.observers.set(t,n),n.observe(e)},this.recordCanvas=(e,t)=>{const n=this.app.timestamp();this.snapshots[t]={images:[],createdAt:n,paused:!1,dummy:document.createElement("canvas"),isCapturing:!1,isStopped:!1};const r=[119,t.toString(),n];this.app.send(r);const s=e,i=e=>{!this.snapshots[t]||this.snapshots[t].isCapturing||this.snapshots[t].isStopped||(this.snapshots[t].isCapturing=!0,function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"medium",n=arguments.length>2?arguments[2]:void 0,r=arguments.length>5?arguments[5]:void 0;const s=`image/${arguments.length>4?arguments[4]:void 0}`;if(arguments.length>3&&void 0!==arguments[3]&&arguments[3]){const i=window.devicePixelRatio||1;n.width=e.width/i,n.height=e.height/i;const o=n.getContext("2d");if(!o)return"";o.clearRect(0,0,n.width,n.height),o.drawImage(e,0,0,n.width,n.height),n.toBlob(r,s,GS[t])}else e.toBlob(r,s,GS[t])}(e,this.options.quality,this.snapshots[t].dummy,this.options.fixedScaling,this.fileExt,e=>{this.snapshots[t]&&(this.snapshots[t].isCapturing=!1),e&&this.snapshots[t]&&!this.snapshots[t].isStopped&&(this.snapshots[t].images.push({id:this.app.timestamp(),data:e}),this.snapshots[t].images.length>9&&(this.sendSnaps(this.snapshots[t].images,t,this.snapshots[t].createdAt),this.snapshots[t].images=[]))}))},o=setInterval(()=>{const n=this.snapshots[t];return!n||n.isStopped?(this.app.debug.log("Canvas is not present in {snapshots}"),void this.cleanupCanvas(t)):document.contains(s)?void(n.paused||(this.options.useAnimationFrame?requestAnimationFrame(()=>{i(s)}):i(s))):(this.app.debug.log("Canvas element not in sync",s,e),void this.cleanupCanvas(t))},this.interval);this.intervals.set(t,o)},this.fileExt="webp",this.interval=1e3/t.fps}startTracking(){setTimeout(()=>{this.app.nodes.scanTree(this.captureCanvas),this.app.nodes.attachNodeCallback(this.captureCanvas),this.app.attachResanitizeCallback(this.resanitizeCanvas)},125)}sendSnaps(e,t,n){0!==Object.keys(this.snapshots).length&&(this.pendingBatches.length>=this.MAX_QUEUE_SIZE?this.app.debug.warn("Upload queue full, dropping canvas batch"):(this.pendingBatches.push({images:e,canvasId:t,createdAt:n}),this.isProcessingQueue||this.processUploadQueue()))}async processUploadQueue(){for(this.isProcessingQueue=!0;this.pendingBatches.length>0;){if(this.uploadQueue>=this.MAX_CONCURRENT_UPLOADS){await new Promise(e=>setTimeout(e,100));continue}const e=this.pendingBatches.shift();if(!e)break;this.uploadBatch(e.images,e.canvasId,e.createdAt)}this.isProcessingQueue=!1}
1async uploadBatch(e,t,n){if(this.options.isDebug){const r=await async function(e){const t=[];let n=0;for(const r of e){if(!r.data)continue;const e=await r.data.arrayBuffer();t.push(e),n+=12+e.byteLength}if(0===n)return null;const r=new ArrayBuffer(n),s=new DataView(r),i=new Uint8Array(r);let o=0;for(let n=0;n<e.length;n++){if(!e[n].data)continue;const r=t.shift(),a=e[n].id;s.setUint32(o,a%4294967296,!0),s.setUint32(o+4,Math.floor(a/4294967296),!0),o+=8,s.setUint32(o,r.byteLength,!0),o+=4,i.set(new Uint8Array(r),o),o+=r.byteLength}return r}(e);if(r){const e=`${n}_${t}.${this.fileExt}.frames`,s=URL.createObjectURL(new Blob([r])),i=document.createElement("a");i.href=s,i.download=e,i.style.display="none",document.body.appendChild(i),i.click(),document.body.removeChild(i),URL.revokeObjectURL(s)}}let r;if(this.options.framesSupport){const s=[];let i=0;for(const t of e){if(!t.data)continue;const e=await t.data.arrayBuffer();s.push(e),i+=12+e.byteLength}if(0===i)return;const o=new ArrayBuffer(i),a=new DataView(o),c=new Uint8Array(o);let l=0;for(let t=0;t<e.length;t++){if(!e[t].data)continue;const n=s.shift(),r=e[t].id;a.setUint32(l,r%4294967296,!0),a.setUint32(l+4,Math.floor(r/4294967296),!0),l+=8,a.setUint32(l,n.byteLength,!0),l+=4,c.set(new Uint8Array(n),l),l+=n.byteLength}r=new FormData,r.append("type","frames");const u=`${n}_${t}.${this.fileExt}.frames`;r.append("frames",new Blob([o]),u)}else r=new FormData,e.forEach(e=>{const s=e.data;if(!s)return;const i=`${n}_${t}_${e.id}.${this.fileExt}`;r.append("snapshot",s,i)});const s=()=>{this.app.debug.log("Restarting tracker; token expired"),this.app.stop(!1),setTimeout(()=>{this.app.start({},!0)},250)};this.uploadQueue++,fetch(this.app.options.ingestPoint+"/v1/web/images",{method:"POST",headers:{Authorization:`Bearer ${this.app.session.getSessionToken()??""}`},body:r}).then(e=>401!==e.status||s()).catch(e=>{this.app.debug.error("error saving canvas",e)}).finally(()=>{this.uploadQueue--})}cleanupCanvas(e){var t;this.snapshots[e]&&(this.snapshots[e].isStopped=!0);const n=this.intervals.get(e);n&&(clearInterval(n),this.intervals.delete(e));const r=this.observers.get(e);if(r&&(r.disconnect(),this.observers.delete(e)),null!==(t=this.snapshots[e])&&void 0!==t&&t.dummy){const t=this.snapshots[e].dummy;t.width=0,t.height=0}delete this.snapshots[e]}clear(){Object.keys(this.snapshots).forEach(e=>{const t=parseInt(e,10),n=this.snapshots[t];n&&n.images.length>0&&(this.sendSnaps(n.images,t,n.createdAt),n.images=[])}),Object.keys(this.snapshots).forEach(e=>{const t=parseInt(e,10);this.cleanupCanvas(t)}),this.intervals.clear(),this.observers.clear(),this.snapshots={}}}const GS={low:.35,medium:.55,high:.8};class XS{constructor(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.shouldLog=e=>this.level>=e,this.info=function(){e.shouldLog(5)&&console.info(...arguments)},this.log=function(){e.shouldLog(4)&&console.log(...arguments)},this.warn=function(){e.shouldLog(3)&&console.warn(...arguments)},this.error=function(){e.shouldLog(2)&&console.error(...arguments)},this.level=t}}const YS={interval:3e4,batchSize:2500,enabled:!0};class QS{constructor(e,t,n){this.nodes=e,this.unregisterNode=t,this.isScanning=!1,this.start=()=>{this.options.enabled&&(this.stop(),this.interval=setInterval(()=>{this.isScanning||(this.isScanning=!0,function(e,t,n,r,s){const i=e.entries();!function e(){let o=0,a=i.next();for(;!a.done&&o<t;){const e=a.value[1];e&&n(e),o++,a=i.next()}o>0?r(setTimeout(e,50)):s()}()}(this.nodes,this.options.batchSize,e=>{const t=function(e){try{var t;if(!e.isConnected)return[!1,"not connected"];const n=e.nodeType===Node.DOCUMENT_NODE,r=n?e.defaultView:null===(t=e.ownerDocument)||void 0===t?void 0:t.defaultView,s=n?e:e.ownerDocument;return r?r.closed?[!1,"window closed"]:null!=s&&s.documentElement.isConnected?[!0,"ok"]:[!1,"documentElement not connected"]:[!1,"no window"]}catch(e){return[!1,e]}}(e)[0];t||this.unregisterNode(e)},e=>{this.batchTimeout=e},()=>{this.batchTimeout=void 0,this.isScanning=!1}))},this.options.interval))},this.stop=()=>{this.interval&&clearInterval(this.interval),this.batchTimeout&&(clearTimeout(this.batchTimeout),this.batchTimeout=void 0),this.isScanning=!1},this.options={...YS,...n}}}const ZS=127;class ew{constructor(e){var t=this;this.nodes=new Map,this.totalNodeAmount=0,this.nodeCallbacks=[],this.elementListeners=new Map,this.nextNodeId=0,this.attachNodeCallback=e=>this.nodeCallbacks.push(e),this.scanTree=e=>
1{this.nodes.forEach(t=>t?e(t):void 0)},this.attachNodeListener=function(e,n,r){let s=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];const i=t.getID(e);if(void 0===i)return;Zb(e,n,r,s,t.forceNgOff);let o=t.elementListeners.get(i);void 0===o&&(o=[],t.elementListeners.set(i,o)),o.push([n,r,s])},this.createFrameId=(e,t)=>function(e,t){if(e<0||e>3)throw new RangeError("OR: nesting level overflow, max 4");if(t<0||t>ZS)throw new RangeError("OR: frame order overflow, max 128");return((3&e)<<29|(t&ZS)<<22)>>>0}(e,t),this.unregisterNode=e=>{const t=e[this.node_id];if(void 0!==t){e[this.node_id]=void 0,delete e[this.node_id],this.nodes.delete(t);const n=this.elementListeners.get(t);void 0!==n&&(this.elementListeners.delete(t),n.forEach(t=>eS(e,t[0],t[1],t[2],this.forceNgOff))),this.totalNodeAmount--}return t},this.node_id=e.node_id,this.forceNgOff=e.forceNgOff,this.maintainer=new QS(this.nodes,this.unregisterNode,e.maintainer),this.maintainer.start()}crossdomainMode(e,t){this.nextNodeId=this.createFrameId(e,t)}registerNode(e){const t=e[this.node_id],n=void 0===t||this.nodes.get(t)!==e;let r=t;return n&&(r=this.nextNodeId,this.totalNodeAmount++,this.nextNodeId++,this.nodes.set(r,e),e[this.node_id]=r),[r,n]}cleanTree(){for(const[e,t]of this.nodes)t&&!document.contains(t)&&this.unregisterNode(t)}callNodeCallbacks(e,t){this.nodeCallbacks.forEach(n=>n(e,t))}getID(e){if(e)return e[this.node_id]}isBound(e){if(!e)return!1;const t=e[this.node_id];return void 0!==t&&this.nodes.get(t)===e}getNode(e){return this.nodes.get(e)}getNodeCount(){return this.totalNodeAmount}clear(){for(const[e,t]of this.nodes)t&&this.unregisterNode(t);this.nextNodeId=0,this.nodes.clear()}}let tw=99e6;function nw(e){return VS(e)&&!!e.adoptedStyleSheets}let rw=15;function sw(){return rw++}const iw=new Map;var ow;!function(e){e[e.Plain=0]="Plain",e[e.Obscured=1]="Obscured",e[e.Hidden=2]="Hidden"}(ow||(ow={}));const aw=e=>e.trim().replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff\s]/g,"*");class cw{constructor(e){var t;this.levels=new Map,this.app=e.app;this.privateMode=(null===(t=e.options)||void 0===t?void 0:t.privateMode)??!1,this.options=Object.assign({obscureTextEmails:!0,obscureTextNumbers:!1,privateMode:!1,domSanitizer:void 0},e.options)}computeLevel(e,t){if(this.options.privateMode){if(WS(e)&&!Jb(e,"unmask"))return ow.Obscured;if(HS(e)&&!Jb(e.parentNode,"unmask"))return ow.Obscured}let n=ow.Plain;if((t>=ow.Obscured||WS(e)&&(Jb(e,"masked")||Jb(e,"obscured")))&&(n=ow.Obscured),(t===ow.Hidden||WS(e)&&(Jb(e,"htmlmasked")||Jb(e,"hidden")))&&(n=ow.Hidden),void 0!==this.options.domSanitizer&&WS(e)){const t=this.options.domSanitizer(e);t===ow.Obscured&&n<ow.Obscured&&(n=ow.Obscured),t===ow.Hidden&&(n=ow.Hidden)}return n}getLevel(e){return this.levels.get(e)??ow.Plain}setLevel(e,t){const n=this.getLevel(e);return t===ow.Plain?this.levels.delete(e):this.levels.set(e,t),n}handleNode(e,t,n){const r=this.computeLevel(n,this.getLevel(t));r>this.getLevel(e)&&this.setLevel(e,r)}sanitize(e,t){return this.getLevel(e)>=ow.Obscured?aw(t):(this.options.obscureTextNumbers&&(t=t.replace(/\d/g,"0")),this.options.obscureTextEmails&&(t=t.replace(/[^\s@]+@[^\s@]+\.[^\s@]+/g,e=>{const t=e.lastIndexOf("@"),n=e.slice(0,t),r=e.slice(t+1).split(".").map(e=>jb(e)).join(".");return`${jb(n)}@${r}`})),t)}isObscured(e){return this.getLevel(e)>=ow.Obscured}isHidden(e){return this.getLevel(e)===ow.Hidden}getInnerTextSecure(e){const t=this.app.nodes.getID(e);return t?this.sanitize(t,e.innerText):""}clear(){this.levels.clear()}}const lw={},uw={};function dw(e){if(function(e){return e.nodeType===Node.COMMENT_NODE}(e))return!0;if(HS(e))return!1;if(!WS(e))return!0;const t=e.tagName.toUpperCase();if("LINK"===t){const t=e.getAttribute("rel"),n=e.getAttribute("as");return!(null!=t&&t.includes("stylesheet")||"style"===n||"font"===n)}return"SCRIPT"===t||"NOSCRIPT"===t||"META"===t||"TITLE"===t||"BASE"===t}function hw(e){return!!VS(e)||!dw(e)}const pw=new Set(["button","reset","submit","checkbox","radio"]);var fw,mw;!function(e){e[e.New=0]="New",e[e.Removed=1]="Removed",e[e.Changed=2]="Changed"}(fw||(fw={}));class gw{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.app=e,this.isTopContext=t,this.commited=[],this.recents=new Map,this.indexes=[],this.attributesMap=new Map,this.textSet=new Set,this.slotMap=new Map,this.disableSprites=!1,this.inlineRemoteCss=!1,this.inlinerOptions=void 0,this.domParser=new DOMParser,this.generation=0,this.throttling=!0,this.throttledSetNodeData=function(e){const t=new Map,n=new Map,r=new Map,s=function(s){const i=Date.now(),o=30-(i-(t.get(s)??
10));for(var a=arguments.length,c=new Array(a>1?a-1:0),l=1;l<a;l++)c[l-1]=arguments[l];if(r.set(s,c),o<=0)n.has(s)&&(clearTimeout(n.get(s)),n.delete(s)),t.set(s,i),r.delete(s),e(s,...c);else if(!n.has(s)){const i=setTimeout(()=>{n.delete(s);const i=r.get(s);r.delete(s),t.delete(s),e(s,...i)},o);n.set(s,i)}};return s.clear=()=>{for(const e of n.values())clearTimeout(e);n.clear(),r.clear(),t.clear()},s}((e,t,n)=>this.sendNodeData(e,t,n)),this.throttling=!Boolean(n.disableThrottling),this.disableSprites=Boolean(n.disableSprites),this.inlineRemoteCss=Boolean(n.inlineRemoteCss),this.inlinerOptions=n.inlinerOptions,this.observer=Qb(this.app.safe(e=>{for(const t of e)try{const e=t.target,n=t.type;if(!hw(e))continue;if("childList"===n){for(let e=0;e<t.removedNodes.length;e++)hw(t.removedNodes[e])&&this.bindNode(t.removedNodes[e]);for(let e=0;e<t.addedNodes.length;e++)this.bindTree(t.addedNodes[e]);continue}const r=this.app.nodes.getID(e);if(void 0===r)continue;if(this.recents.has(r)||this.recents.set(r,fw.Changed),"attributes"===n){const e=t.attributeName;if(null===e)continue;let n=this.attributesMap.get(r);void 0===n&&this.attributesMap.set(r,n=new Set),n.add(e);continue}if("characterData"===n){this.textSet.add(r);continue}}catch(e){t.target}this.commitNodes()}),this.app.options.forceNgOff)}clear(){this.commited.length=0,this.recents.clear(),this.indexes.length=1,this.attributesMap.clear(),this.textSet.clear()}handleIframeSrcChange(e){const t=e.contentDocument;if(t&&void 0!==this.app.nodes.getID(t)){const n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>dw(e)||void 0===this.app.nodes.getID(e)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let r=0;const s=this.app.nodes.getNodeCount(),i=e.contentDocument,o=this.app.nodes.unregisterNode.bind(this.app.nodes);for(;n.nextNode();)i.contains(n.currentNode)||(r+=1,o(n.currentNode));const a=Math.floor(r/s*100);a>30&&this.app.send(CS(a))}}sendNodeAttribute(e,t,n,r){if(zS(t))return n.startsWith("xlink:")&&(n=n.substring(6)),null===r?void this.app.send(lS(e,n)):function(e){return"use"===e.localName}(t)&&"href"===n&&!this.disableSprites?void async function(e,t,n){try{const r=e.getAttribute("xlink:href")||e.getAttribute("href");if(!r)return void console.debug("Openreplay: xlink:href or href not found on <use>.");let[s,i]=r.split("#");if(!s&&!i)return void console.warn("Openreplay: Invalid xlink:href or href found on <use>.");const o=s?`url:${s}#${i}#${t}`:`doc:${i}#${t}`;if(lw[o])return lw[o];if(!s&&i){let e;e=r.startsWith("#")?`#${CSS.escape(r.substring(1))}`:CSS.escape(r);const t=document.querySelector(e);if(t){const e=`\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="${t.getAttribute("viewBox")||"0 0 24 24"}">\n ${t.innerHTML}\n </svg>\n `;return lw[o]=e,e}return void console.warn("Openreplay: Sprite symbol not found in the document.")}let a;if(uw[s])1===uw[s]?await new Promise(e=>{let t=0;const n=setInterval(()=>{t>100&&(clearInterval(n),e(!1)),1!==uw[s]?(a=uw[s],clearInterval(n),e(!0)):t++},100)}):a=uw[s]??'<svg xmlns="http://www.w3.org/2000/svg"></svg>';else{uw[s]=1;try{const e=await fetch(s),t=await e.text();a=n.parseFromString(t,"image/svg+xml"),uw[s]=a}catch(e){throw delete uw[s],e}}if(!a)return;const c=a.getElementById(i);if(!c)return console.debug("Openreplay: Symbol not found in SVG."),"";{const e=`\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="${c.getAttribute("viewBox")||"0 0 24 24"}">\n ${c.innerHTML}\n </svg>\n `;return lw[o]=e,e}}catch(e){console.error("Openreplay: Error processing <use> element:",e)}}(t,"svgtext",this.domParser).then(t=>{t&&this.app.send(cS(e,n,`_$OPENREPLAY_SPRITE$_${t}`))}).catch(e=>{console.error("Openreplay: Error parsing <use> element:",e)}):void("href"===n?(r.length>1e5&&(r=""),this.app.send(mS(e,n,r,this.app.getBaseHref()))):this.app.attributeSender.sendSetAttribute(e,n,r));if("src"!==n&&"srcset"!==n&&"integrity"!==n&&"crossorigin"!==n&&"autocomplete"!==n&&"on"!==n.substring(0,2)&&("value"!==n||!function(e){return JS(e,"input")&&!pw.has(e.type)}(t)))if(null!==r)if("style"===n||"href"===n&&JS(t,"link")){if("rel"in t&&"stylesheet"===t.rel&&this.inlineRemoteCss){const n=this.generation;return void setTimeout(()=>{var r,s;!function(e,t,n,r,s,i,o,a,c){const l=a?null:r();a||i(l,t);const u=e.sheet;if(u&&!o)try{const e=p(u);if(e)return void h(e)}catch(e){}function d(){const t=()=>{const t=e.sheet;if(t)try{const e=p(t);if(e)return void(a&&c?c(e,tw++):h(e))}catch(e){}};e.sheet?t():e.addEventListener("load",function n(){e.removeEventListener("load",n),t()})}function h(e){const t=function(e){const t=[];let n=!1,r=!1,s="",i=0,o="";for(let a=0;a<e.length;a++){const c=e[a],l=e[a+1]||"";r||"/"!==c||"*"!==l?n?"*"===c&&"/"===l&&(n=!1,a++):r||'"'!==c&&"'"!==c?r?(o+=c,c===s&&"\\"!==e[a-1]&&(r=!1)):(o+=c,"{"===c?i++:"}"===c&&(i--,0===i&&(t.push(o.trim()),o=""))):(r=!0,s=c,o+=c):(n=!0,a++)}
1return o.trim()&&t.push(o.trim()),t}(e=e.replace(/\/\*[\s\S]*?\*\//g,""));for(let e=0;e<t.length;e++)s(l,t[e],e,n)}function p(e){try{const n=e.rules||e.cssRules;if(!n)return null;let r=e.href;!r&&e.ownerNode&&e.ownerNode.ownerDocument&&(r=e.ownerNode.ownerDocument.location.href);const s=Array.from(n,e=>function(e,t){if(function(e){return"styleSheet"in e}(e)){let t;try{t=p(e.styleSheet)||function(e){const{cssText:t}=e;if(t.split('"').length<3)return t;const n=["@import",`url(${JSON.stringify(e.href)})`];return""===e.layerName?n.push("layer"):e.layerName&&n.push(`layer(${e.layerName})`),e.supportsText&&n.push(`supports(${e.supportsText})`),e.media.length&&n.push(e.media.mediaText),n.join(" ")+";"}(e)}catch(n){t=e.cssText}return e.styleSheet.href?f(t,e.styleSheet.href):t}{let n=e.cssText;return function(e){return"selectorText"in e}(e)&&e.selectorText.includes(":")&&(n=n.replace(/(\[(?:[\w-]+)[^\\])(:(?:[\w-]+)\])/gm,"$1\\$2")),t?f(n,t):n}}(e,r)).join("");return(t=s).includes(" background-clip: text;")&&!t.includes(" -webkit-background-clip: text;")&&(t=t.replace(/\sbackground-clip:\s*text;/g," -webkit-background-clip: text; background-clip: text;")),t}catch(e){return null}var t}function f(e,t){if(!e)return"";const n=/^(?:[a-z+]+:)?\/\//i,r=/^www\..*/i,s=/^(data:)([^,]*),(.*)/i;return e.replace(/url\((?:(')([^']*)'|(")(.*?)"|([^)]*))\)/gm,(e,i,o,a,c,l)=>{const u=o||c||l,d=i||a||"";if(!u)return e;if(n.test(u)||r.test(u))return`url(${d}${u}${d})`;if(s.test(u))return`url(${d}${u}${d})`;if("/"===u[0])return`url(${d}${function(e){let t="";return t=e.indexOf("//")>-1?e.split("/").slice(0,3).join("/"):e.split("/")[0],t=t.split("?")[0],t}(t)+u}${d})`;const h=t.split("/"),p=u.split("/");h.pop();for(const e of p)"."!==e&&(".."===e?h.pop():h.push(e));return`url(${d}${h.join("/")}${d})`})}e.href?fetch(e.href).then(e=>{if(!e.ok)throw new Error(`response status ${e.status}`);return e.text()}).then(e=>{a&&c?c(e,tw++):h(e)}).catch(t=>{console.error(`OpenReplay: Failed to fetch CSS from ${e.href}:`,t),d()}):d()}(t,e,this.app.getBaseHref(),sw,(e,t,r,s)=>{this.generation===n&&this.app.send(bS(e,t,r,s))},(e,t)=>{this.generation===n&&this.app.send(wS(e,t))},null===(r=this.inlinerOptions)||void 0===r?void 0:r.forceFetch,null===(s=this.inl
1inerOptions)||void 0===s?void 0:s.forcePlain,(t,r)=>{this.generation===n&&(this.app.send(oS(r,e,0)),this.app.send(gS(r,t,this.app.getBaseHref())))})},0)}this.app.send(mS(e,n,r,this.app.getBaseHref()))}else("href"===n||r.length>1e5)&&(r=""),["alt","placeholder"].includes(n)&&this.app.sanitizer.privateMode&&(r=r.replaceAll(/./g,"*")),this.app.attributeSender.sendSetAttribute(e,n,r);else this.app.send(lS(e,n))}sendNodeData(e,t,n){JS(t,"style")?this.app.send(gS(e,n,this.app.getBaseHref())):(n=this.app.sanitizer.sanitize(e,n),this.app.send(function(e,t){return[14,e,t]}(e,n)))}bindNode(e){const[t,n]=this.app.nodes.registerNode(e);WS(e)&&JS(e,"slot")&&this.app.nodes.attachNodeListener(e,"slotchange",()=>{e.assignedNodes({flatten:!0}).forEach(e=>{const t=this.app.nodes.getID(e);void 0!==t&&this.recents.set(t,fw.Changed)})}),n?this.recents.set(t,fw.New):this.recents.get(t)!==fw.New&&this.recents.set(t,fw.Removed)}bindTree(e){if(!hw(e))return;this.bindNode(e);const t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>dw(e)||this.app.nodes.isBound(e)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);for(;t.nextNode();)this.bindNode(t.currentNode)}unbindTree(e){const t=this.app.nodes.unregisterNode(e);if(void 0!==t&&this.slotMap.delete(t),void 0!==t&&this.recents.get(t)===fw.Removed){this.app.send(aS(t));const n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>dw(e)||void 0===this.app.nodes.getID(e)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1);let r=0;const s=this.app.nodes.getNodeCount();for(;n.nextNode();)r+=1,this.app.nodes.unregisterNode(n.currentNode);const i=Math.floor(r/s*100);i>30&&this.app.send(CS(i))}}_commitNode(e,t){if(VS(t))return!0;let n=t.assignedSlot;const r=t.parentNode;let s;if(!JS(t,"html")||!this.isTopContext){if(null===r)return this.unbindTree(t),!1;if(s=this.app.nodes.getID(r),void 0===s)return this.unbindTree(t),!1;if(!this.commitNode(s))return this.unbindTree(t),!1;if(this.app.sanitizer.handleNode(e,s,t),this.app.sanitizer.isHidden(s))return!1}let i=t.previousSibling;for(;null!==i;){const t=this.app.nodes.getID(i);if(void 0!==t){this.commitNode(t),this.indexes[e]=this.indexes[t]+1;break}i=i.previousSibling}null===i&&(this.indexes[e]=0);const o=this.recents.get(e),a=o===fw.New,c=this.indexes[e];if(void 0===c)throw"commitNode: missing node index";if(a){if(WS(t)){let n=t;if(void 0!==s){if(this.app.sanitizer.isHidden(e)){const e=n.clientWidth,r=n.clientHeight;n=t.cloneNode(),n.style.width=`${e}px`,n.style.height=`${r}px`}"rel"in n&&"stylesheet"===n.rel&&this.inlineRemoteCss?this.app.send(iS(e,s,c,"STYLE",!1)):this.app.send(iS(e,s,c,n.tagName,zS(t)))}for(let t=0;t<n.attributes.length;t++){const r=n.attributes[t];this.sendNodeAttribute(e,n,r.nodeName,r.value)}}else HS(t)&&(this.app.send(oS(e,s,c)),this.throttling?this.throttledSetNodeData(e,r,t.data):this.sendNodeData(e,r,t.data));if(n){const t=this.app.nodes.getID(n);void 0!==t&&(this.slotMap.set(e,t),this.app.send(yS(e,t)))}return!0}if(o===fw.Removed&&void 0!==s)if(this.app.send(function(e,t,n){return[10,e,t,n]}(e,s,c)),n){const t=this.app.nodes.getID(n);void 0!==t&&this.slotMap.get(e)!==t&&(this.slotMap.set(e,t),this.app.send(yS(e,t)))}else this.slotMap.has(e)&&(this.slotMap.delete(e),this.app.send(yS(e,0)));const l=this.attributesMap.get(e);if(void 0!==l){if(!WS(t))throw"commitNode: node is not an element";for(const n of l)this.sendNodeAttribute(e,t,n,t.getAttribute(n))}
1if(this.textSet.has(e)){if(!HS(t))throw"commitNode: node is not a text";this.throttling?this.throttledSetNodeData(e,r,t.data):this.sendNodeData(e,r,t.data)}return!0}commitNode(e){const t=this.app.nodes.getNode(e);if(!t)return!1;const n=this.commited[e];return void 0!==n?n:this.commited[e]=this._commitNode(e,t)}commitNodes(){let e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];for(const[n,r]of this.recents.entries())this.commitNode(n),r===fw.New&&(e=this.app.nodes.getNode(n))&&this.app.nodes.callNodeCallbacks(e,t);this.clear()}observeRoot(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:e;this.observer.observe(e,{childList:!0,attributes:!0,characterData:!0,subtree:!0,attributeOldValue:!1,characterDataOldValue:!1}),this.bindTree(n),t(this.app.nodes.getID(e)),this.commitNodes(!0)}resanitizeSubtree(e){if(!hw(e))return;const t=e.parentNode,n=null!==t?this.app.nodes.getID(t):void 0,r=void 0!==n?this.app.sanitizer.getLevel(n):ow.Plain;this.resanitizeNode(e,r)}resanitizeNode(e,t){if(dw(e))return;const n=this.app.nodes.getID(e);if(void 0===n)return;const r=this.app.sanitizer.computeLevel(e,t),s=this.app.sanitizer.getLevel(n),i=s===ow.Hidden,o=r===ow.Hidden;if(i===o){if(!o){s!==r&&(this.app.sanitizer.setLevel(n,r),this.reemitNode(n,e));for(let t=e.firstChild;null!==t;t=t.nextSibling)this.resanitizeNode(t,r)}}else this.recreateSubtree(e)}recreateSubtree(e){const t=this.app.nodes.getID(e);void 0!==t&&(this.app.send(aS(t)),this.clearSubtreeRegistration(e),this.bindTree(e),this.commitNodes())}clearSubtreeRegistration(e){const t=e=>{const t=this.app.nodes.getID(e);void 0!==t&&this.app.sanitizer.setLevel(t,ow.Plain),this.app.nodes.unregisterNode(e)},n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT+NodeFilter.SHOW_TEXT,{acceptNode:e=>dw(e)||void 0===this.app.nodes.getID(e)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},!1),r=[];for(;n.nextNode();)r.push(n.currentNode);t(e),r.forEach(t)}reemitNode(e,t){if(HS(t)){const n=t.parentNode;return void(null!==n&&WS(n)&&this.sendNodeData(e,n,t.data))}WS(t)&&this.app.callResanitizeCallbacks(t,e)}disconnect(){const e=this.observer.takeRecords();if(e.length){const t=[];for(const n of e)for(let e=0;e<n.addedNodes.length;e++){const r=n.addedNodes[e];r.tagName&&t.length<10&&t.push(r.tagName)}}this.observer.disconnect(),this.clear(),this.throttledSetNodeData.clear(),this.generation++}resetThrottledSetNodeData(){this.throttledSetNodeData.clear()}}class yw extends gw{observe(e){const t=e.contentDocument,n=this.app.nodes.getID(e);t&&void 0!==n&&this.observeRoot(t,e=>{void 0!==e?(this.docId=e,this.app.send(vS(n,e))):this.app.debug.log("OpenReplay: Iframe document not bound")})}syntheticObserve(e,t){this.observeRoot(t,t=>{void 0!==t?this.app.send(vS(e,t)):this.app.debug.log("OpenReplay: Iframe document not bound")})}}class vw extends gw{observe(e){const t=e.shadowRoot,n=this.app.nodes.getID(e);t&&void 0!==n&&this.observeRoot(t,e=>{void 0!==e?this.app.send(vS(n,e)):this.app.debug.error("OpenReplay: Shadow Root was not bound")})}}class _w{constructor(){this.states=new WeakMap}calcOffset(e){let t=0,n=0;if(e.parent&&([t,n]=this.calcOffset(e.parent)),!e.offset){const{left:t,top:n}=e.iFrame.getBoundingClientRect();e.offset=[t,n]}const[r,s]=e.offset;return[t+r,n+s]}getDocumentOffset(e){const t=this.states.get(e);return t?this.calcOffset(t):[0,0]}observe(e){var t;const n=e.contentDocument;if(!n)return;const r=e.ownerDocument,s={offset:null,iFrame:e,parent:this.states.get(r)||null,clear:()=>{var e;r.removeEventListener("scroll",i),null===(e=r.defaultView)||void 0===e||e.removeEventListener("resize",i)}},i=()=>{s.offset=null};r.addEventListener("scroll",i),null===(t=r.defaultView)||void 0===t||t.addEventListener("resize",i),this.states.set(n,s)}clear(){this.states=new WeakMap}}function bw(e,t){switch(e){case mw.Inline:return{inlineRemoteCss:!0,inlinerOptions:{forceFetch:!1,forcePlain:!1}};case mw.InlineFetched:return{inlineRemoteCss:!0,inlinerOptions:{forceFetch:!0,forcePlain:!1}};case mw.PlainFetched:return{inlineRemoteCss:!0,inlinerOptions:{forceFetch:!0,forcePlain:!0}};case mw.Unset:return/^https?:\/\/(localhost|127\.0\.0\.1)(:\d+)?\/?/.test(window.location.href)?(t("Enabling InlineCssMode.PlainFetched by default on localhost to preserve css styles, refer to https://docs.openreplay.com/en/troubleshooting/localhost/ for details, set InlineCssMode to 0 to skip this behavior"),{inlineRemoteCss:!0,inlinerOptions:{forceFetch:!0,forcePlain:!0}}):{inlineRemoteCss:!1,inlinerOptions:{forceFetch:!1,forcePlain:!1}};case mw.Disabled:default:return{inlineRemoteCss:!1,inlinerOptions:{forceFetch:!1,forcePlain:!1}}}}!function(e){e[e.Unset=-1]="Unset",e[e.Disabled=0]="Disabled",e[e.Inline=1]="Inline",e[e.InlineFetched=2]="InlineFetched",e[e.PlainFetched=3]="PlainFetched"}(mw||(mw={}));const Sw=Rb?Element.prototype.attachShadow:()=>new ShadowRoot;class ww extends gw{constructor(e){const t=Object.assign({captureIFrames:!0,disableSprites:!1,inl
1ineCss:0},e.options),n={disableSprites:t.disableSprites,disableThrottling:t.disableThrottling,...bw(t.inlineCss,console.warn)};super(e.app,!0,n),this.iframeOffsets=new _w,this.contextCallbacks=[],this.contextsSet=new WeakSet,this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.docObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.app=e.app,this.options=t,this.app.nodes.attachNodeCallback(e=>{JS(e,"iframe")&&(this.options.captureIFrames&&!Jb(e,"obscured")||Jb(e,"capture"))&&this.handleIframe(e)}),this.app.nodes.attachNodeCallback(e=>{WS(e)&&null!==e.shadowRoot&&this.handleShadowRoot(e.shadowRoot)})}attachContextCallback(e){this.contextCallbacks.push(e)}getDocumentOffset(e){return this.iframeOffsets.getDocumentOffset(e)}handleIframe(e){const t=this.app.safe(()=>setTimeout(()=>{const t=this.app.nodes.getID(e);if(void 0===t||!function(e){try{return Boolean(e.contentDocument)}catch(e){return!1}}(e))return;const n=e.contentWindow,r=e.contentDocument;if(!r)return void this.app.debug.warn("no doc for iframe found",e);if(r&&this.docObservers.has(r))return void this.app.debug.info("doc already observed for",t);const s=new yw(this.app,!1,{disableSprites:this.options.disableSprites,...bw(this.options.inlineCss,console.warn)});this.iframeObservers.set(e,s),this.docObservers.set(r,s),this.iframeObserversArr.push(s),s.observe(e),this.iframeOffsets.observe(e),n&&n===n.window&&!this.contextsSet.has(n)&&(this.contextsSet.add(n),this.contextCallbacks.forEach(e=>e(n)))},250));e.addEventListener("load",t),t()}handleShadowRoot(e){const t=new vw(this.app,!1,{disableSprites:this.options.disableSprites,...bw(this.options.inlineCss,console.warn)});this.shadowRootObservers.set(e,t),t.observe(e.host)}observe(){const e=this;Element.prototype.attachShadow=function(){const t=Sw.apply(this,arguments);return e.handleShadowRoot(t),t},this.resetThrottledSetNodeData(),this.app.nodes.clear(),this.observeRoot(window.document,()=>{this.app.send([7]),this.app.nodes.callNodeCallbacks(document,!0)},window.document.documentElement),this.app.send(cS(0,"orloaded","true"))}crossdomainObserve(e,t,n){const r=this;Element.prototype.attachShadow=function(){const e=Sw.apply(this,arguments);return r.handleShadowRoot(e),e},this.app.nodes.clear(),this.app.nodes.crossdomainMode(n,t);const s=new yw(this.app,!1,{disableSprites:this.options.disableSprites,...bw(this.options.inlineCss,console.warn)});this.iframeObservers.set(window.document,s),s.syntheticObserve(e,window.document)}disconnect(){this.iframeOffsets.clear(),Element.prototype.attachShadow=Sw,this.iframeObserversArr.forEach(e=>e.disconnect()),this.iframeObserversArr=[],this.iframeObservers=new WeakMap,this.shadowRootObservers=new WeakMap,this.docObservers=new WeakMap,super.disconnect()}}const kw="_$_";class Tw{constructor(e){this.metadata={},this.userID=null,this.callbacks=[],this.timestamp=0,this.getPageNumber=()=>{const e=this.app.sessionStorage.getItem(this.options.session_pageno_key);if(null!=e)return parseInt(e)},this.incPageNo=()=>{let e=this.getPageNumber();return void 0===e?e=0:e++,this.app.sessionStorage.setItem(this.options.session_pageno_key,e.toString()),e},this.getSessionToken=e=>{const t=this.token||this.app.sessionStorage.getItem(this.options.session_token_key);if(e&&t){const n=t.split(kw)[1];if(!n||n!==e)return this.app.sessionStorage.removeItem(this.options.session_token_key),void(this.token=void 0)}return(t?t.split(kw)[0]:null)||void 0},this.getRawTokenWithProject=()=>this.token||this.app.sessionStorage.getItem(this.options.session_token_key),this.setSessionToken=(e,t)=>{this.token=`${e}${kw}${t}`,this.app.sessionStorage.setItem(this.options.session_token_key,`${e}${kw}${t}`)},this.app=e.app,this.options=e.options,this.createTabId()}attachUpdateCallback(e){this.callbacks.push(e)}handleUpdate(e){null==e.userID&&delete e.userID,null==e.sessionID&&delete e.sessionID,this.callbacks.forEach(t=>t(e))}assign(e){void 0!==e.userID&&(this.userID=e.userID),void 0!==e.metadata&&Object.entries(e.metadata).forEach(e=>{let[t,n]=e;return this.metadata[t]=n}),void 0!==e.sessionID&&(this.sessionID=e.sessionID),void 0!==e.timestamp&&(this.timestamp=e.timestamp),void 0!==e.projectID&&(this.projectID=e.projectID),this.handleUpdate(e)}setMetadata(e,t){this.metadata[e]=t,this.handleUpdate({metadata:{[e]:t}})}setUserID(e){this.userID=e,this.handleUpdate({userID:e})}setUserInfo(e){this.userInfo=e}applySessionHash(e){const t=decodeURI(e).split("&");let n=e,r="100500";2==t.length&&([r,n]=t),r&&n&&(this.app.sessionStorage.setItem(this.options.session_token_key,n),this.app.sessionStorage.setItem(this.options.session_pageno_key,r))}getSessionHash(){const e=this.getPageNumber(),t=this.getRawTokenWithProject();if(void 0!==e&&void 0!==t)return encodeURI(String(e)+"&"+t)}getTabId(){return this.tabId||this.createTabId(),this.tabId}regenerateTabId(){const e=function(){const e=new Uint8Array(6),t=window.crypto||window.msCrypto;return t?(t.getRandomValues(e),Array.from(e,Gb).join("")):Array.from({length:12},()=>Gb(Math.floor(16*Math.random()))).join("")}();this.app.sessionStorage.setItem(this.options.session_tabid_key,e),this.tabId=e}createTabId(){const e=this.app.sessionStorage.getItem(this.options.session_tabid_key);e?this.tabId=e:this.regenerateTabId()}getInfo(){return{sessionID:this.sessionID,metadata:this.metadata,userID:this.userID,timestamp:this.timestamp,projectID:this.projectID}}reset(){this.app.sessionStorage.removeItem(this.options.session_token_key),this.metadata={},this.userID=null,this.sessionID=void 0,this.timestamp=0}}class Ew{constructor(e){this.app=e,this.timer=null,this.callbacks=[]}attach(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=arguments.length>3?arguments[3]:void 0;r&&(e=e.bind(r)),n&&(e=this.app.safe(e)),this.callbacks.unshift(t?function(e,t){let n=0;return()=>{n++>=t&&(n=0,e())}}(e,t):e)}start(){null===this.timer&&(this.timer=setInterval(()=>
1this.callbacks.forEach(e=>{e&&e()}),30))}stop(){null!==this.timer&&(clearInterval(this.timer),this.timer=null)}}const xw="canceled",Iw="or_buffer_1",Cw=e=>({reason:e,success:!1}),Ow=e=>({...e,success:!0});var Aw;function Mw(){const e=-1*(new Date).getTimezoneOffset(),t=e>=0?"+":"-",n=Math.floor(Math.abs(e)/60),r=Math.abs(e)%60;return`UTC${t}${String(n).padStart(2,"0")}:${String(r).padStart(2,"0")}`}!function(e){e[e.NotActive=0]="NotActive",e[e.Starting=1]="Starting",e[e.Active=2]="Active",e[e.ColdStart=3]="ColdStart"}(Aw||(Aw={}));const Rw=e=>new Promise(t=>setTimeout(t,e)),Nw={ask:"never-gonna-give-you-up",resp:"never-gonna-let-you-down",reg:"never-gonna-run-around-and-desert-you",iframeSignal:"tracker inside a child iframe",iframeId:"getting node id for child iframe",iframeBatch:"batch of messages from an iframe window",parentAlive:"signal that parent is live",killIframe:"stop tracker inside frame",startIframe:"start tracker inside frame",iframeDebug:"iframe debug snapshot",polling:"hello-how-are-you-im-under-the-water-please-help-me",reset:"reset-your-session-please"},Pw=Object.fromEntries(Object.entries(Nw).map(e=>{let[t,n]=e;return[n,t]}));class Lw{get tagMatcher(){return this.tagWatcher.matcher}constructor(e,t,n,r,s){var i,o,a=this;this.signalError=r,this.insideIframe=s,this.resanitizeCallbacks=[],this.messages=[],this.bufferedMessages1=[],this.bufferedMessages2=[],this.startCallbacks=[],this.stopCallbacks=[],this.commitCallbacks=[],this.activityState=Aw.NotActive,this.version="18.1.0",this.socketMode=!1,this.compressionThreshold=24e3,this.bc=null,this.canvasRecorder=null,this.conditionsManager=null,this.canStart=!1,this.rootId=null,this.pageFrames=[],this.frameOderNumber=0,this.frameLevel=0,this.emptyBatchCounter=0,this.lastHiddenAt=null,this.parentActive=!1,this.checkStatus=()=>this.parentActive,this.lastTokenReceived=null,this.lastParentMsgAt=0,this.lastSentToParentAt=0,this.iframeDebugInterval=null,this.emitIframeDebug=()=>{var e;if(!this.insideIframe||null===(e=this.options.crossdomain)||void 0===e||!e.enabled)return;const t=Date.now(),n=e=>e?t-e:null,r={ctx:this.contextId,active:this.active(),state:Aw[this.activityState],parentActive:this.parentActive,rootId:this.rootId,frameOrder:this.frameOderNumber,token:this.lastTokenReceived?{tok:this.lastTokenReceived.tok,agoMs:t-this.lastTokenReceived.at}:null,lastParentMsgAgoMs:n(this.lastParentMsgAt),lastSentToParentAgoMs:n(this.lastSentToParentAt)},s=JSON.stringify(r);let i;try{i=btoa(s)}catch{i=s}try{var o;window.parent.postMessage({line:Nw.iframeDebug,context:this.contextId,debug:i},(null===(o=this.options.crossdomain)||void 0===o?void 0:o.parentDomain)??"*"),this.markSentToParent()}catch(e){this.debug.error("iframe debug post failed",e)}},this.parentCrossDomainFrameListener=e=>{const{data:t}=e;if(t&&e.source!==window){if(t.line!==Nw.startIframe&&t.line!==Nw.parentAlive&&t.line!==Nw.iframeId&&t.line!==Nw.killIframe||(this.lastParentMsgAt=Date.now()),t.line===Nw.startIframe){if(this.activityState===Aw.Starting)return;try{this.active()&&this.stop(),t.token&&(this.session.setSessionToken(t.token,this.projectKey),this.lastTokenReceived={tok:String(t.token).slice(-8),at:Date.now()}),void 0!==t.id&&(this.rootId=t.id),this.allowAppStart(),this.start()}catch(e){console.error("children frame restart failed:",e)}}t.line===Nw.parentAlive&&(this.parentActive=!0),t.line===Nw.iframeId&&(this.parentActive=!0,this.rootId=t.id,this.session.setSessionToken(t.token,this.projectKey),this.lastTokenReceived={tok:String(t.token).slice(-8),at:Date.now()},this.frameOderNumber=t.frameOrderNumber,this.frameLevel=t.frameLevel,this.debug.log("starting iframe tracking",t),this.allowAppStart()),t.line===Nw.killIframe&&this.active()&&this.stop()}},this.trackedFrames=[],this.everTrackedFrames=new Set,this.frameLastSeen=new Map,this.frameOrigin=new Map,this.frameAnyLastSeen=new Map,this.frameBatchLastSeen=new Map,this.frameLastSent=new Map,this.xdomainDebugInterval=null,this.reAdoptCooldown=new Map,this.RE_ADOPT_COOLDOWN_MS=2e3,this.frameAlloc=new Map,this.usedOrdersByLevel=new Map,this.FRAME_STALE_MS=1500,this.XDOMAIN_DEBUG_RETENTION_MS=6e5,this.emitCrossdomainDebug=()=>{var e;if(this.insideIframe||null===(e=this.options.crossdomain)||void 0===e||!e.enabled||!this.active())return;const t=Date.now(),n=e=>void 0===e?null:t-e,r=new Set(this.trackedFrames),s=new Set([...this.trackedFrames,...this.frameAnyLastSeen.keys(),...this.frameLastSent.keys()]),i=Array.from(s).map((e,s)=>{const i=this.frameLastSent.get(e),o=this.frameAlloc.get(e);return{n:o?o.order:s+1,level:o?o.level:null,id:this.frameOrigin.get(e)||e||`#${s+1}`,tracked:r.has(e),lastAnyMsgAgoMs:n(this.frameAnyLastSeen.get(e)),lastBatchAgoMs:n(this.frameBatchLastSeen.get(e)),lastSent:i?{line:i.line,agoMs:t-i.t}:null}}
1),o=t-this.XDOMAIN_DEBUG_RETENTION_MS;for(const e of s){var a;if(r.has(e))continue;const t=this.frameAnyLastSeen.get(e)??0,n=(null===(a=this.frameLastSent.get(e))||void 0===a?void 0:a.t)??0;Math.max(t,n)<o&&(this.frameOrigin.delete(e),this.frameAnyLastSeen.delete(e),this.frameBatchLastSeen.delete(e),this.frameLastSent.delete(e),this.reAdoptCooldown.delete(e),this.everTrackedFrames.delete(e),this.freeFrameOrder(e))}const c={t,count:i.length,frames:i},l=JSON.stringify(c);let u;try{u=btoa(l)}catch{u=l}this.send(uS("info",`[OR_XDOMAIN_DEBUG] ${u}`))},this.crossDomainIframeListener=e=>{if(e.source===window)return;const{data:t}=e;if(t&&(t.context&&(this.frameAnyLastSeen.set(t.context,Date.now()),e.origin&&!this.frameOrigin.has(t.context)&&this.frameOrigin.set(t.context,e.origin)),t.line!==Nw.polling&&t.line!==Nw.iframeSignal||!t.context||this.frameLastSeen.set(t.context,Date.now()),this.active()))if(t.line!==Nw.iframeDebug){if(t.line===Nw.iframeSignal){var n;null===(n=e.source)||void 0===n||n.postMessage({ping:!0,line:Nw.parentAlive},"*"),this.recordSentToFrame(t.context,Nw.parentAlive);(async()=>{if(null===e.source)return console.error("Couldnt connect to event.source for child iframe tracking");const n=await this.checkNodeId(e.source);if(n)try{var r;this.trackedFrames.includes(t.context)?this.debug.log("Trying to observe already added iframe; ignore if its a restart"):this.trackedFrames.push(t.context),this.everTrackedFrames.add(t.context),await this.waitStarted();const s=this.session.getSessionToken(this.projectKey),i=this.frameLevel+1,o=this.allocateFrameOrder(t.context,i),a={line:Nw.iframeId,id:n,token:s,frameOrderNumber:o,frameLevel:i};this.debug.log("Got child frame signal; nodeId",n,e.source,a),null===(r=e.source)||void 0===r||r.postMessage(a,"*"),this.recordSentToFrame(t.context,Nw.iframeId)}catch(e){console.error(e)}else this.debug.log("Couldnt get node id for iframe",e.source)})()}if(t.line===Nw.iframeBatch){t.context&&this.frameBatchLastSeen.set(t.context,Date.now());const n=t.messages,r=[];n.forEach(t=>{if(20===t[0]){let n=t;this.pageFrames.forEach(r=>{if(r.contentWindow===e.source){const[e,s,i]=t,{left:o,top:a}=r.getBoundingClientRect();n=[e,s+o,i+a]}}),r.push(n)}if(68===t[0]){let n=t;this.pageFrames.forEach(r=>{if(r.contentWindow===e.source){const[e,s,i,o,a,c,l]=t,{left:u,top:d,width:h,height:p}=r.getBoundingClientRect(),f=(c/100*h+u)/document.documentElement.scrollWidth,m=(l/100*p+d)/document.documentElement.scrollHeight;n=[e,s,i,o,a,Math.round(1e3*f)/10,Math.round(1e3*m)/10]}}),r.push(n)}[28,29,30].includes(t[0])||r.push(t)}),this.messages.push(...r)}if(t.line===Nw.polling){if(t.context&&this.everTrackedFrames.has(t.context)&&!this.trackedFrames.includes(t.context))return void this.reAdoptOrphanFrame(e,t.context);if(!this.pollingQueue.order.length)return;this.pruneStaleFrames();const n=new Set(this.trackedFrames);for(;this.pollingQueue.order.length>0;){const e=this.pollingQueue.order[0];if(this.pollingQueue[e]=this.pollingQueue[e].filter(e=>n.has(e)),0!==this.pollingQueue[e].length)break;delete this.pollingQueue[e],this.pollingQueue.order.shift()}if(!this.pollingQueue.order.length)return;const s=this.pollingQueue.order[0];if(this.pollingQueue[s].includes(t.context)){var r;this.pollingQueue[s]=this.pollingQueue[s].filter(e=>e!==t.context);const n={line:s};if(s===Nw.startIframe){n.token=this.session.getSessionToken(this.projectKey);const t=this.pageFrames.find(t=>t.contentWindow===e.source)||Array.from(document.querySelectorAll("iframe")).find(t=>t.contentWindow===e.source);if(t){const e=t[this.options.node_id];void 0!==e&&(n.id=e)}}null===(r=e.source)||void 0===r||r.postMessage(n,"*"),this.recordSentToFrame(t.context,s),0===this.pollingQueue[s].length&&(delete this.pollingQueue[s],this.pollingQueue.order.shift())}}}else this.send(uS("info",`[OR_XDOMAIN_IFRAME_DEBUG] ${t.debug}`))},this.pollingQueue={order:[]},this.addCommand=e=>{this.pruneStaleFrames(),this.pollingQueue[e]?this.pollingQueue[e]=Array.from(new Set([...this.pollingQueue[e],...this.trackedFrames])):(this.pollingQueue.order.push(e),this.pollingQueue[e]=[...this.trackedFrames])},this.bootChildrenFrames=async()=>{await this.waitStarted(),this.addCommand(Nw.startIframe)},this.killChildrenFrames=()=>{this.addCommand(Nw.killIframe)},this.signalIframeTracker=()=>{var e;const t=this.session.getTabId();window.parent.postMessage({line:Nw.iframeSignal,source:t,context:this.contextId},(null===(e=this.options.crossdomain)||void 0===e?void 0:e.parentDomain)??"*"),this.markSentToParent();let n=0,r=250,s=0,i=!1;const o=()=>{var e;i||this.checkStatus()?i=!0:(window.parent.postMessage({line:Nw.iframeSignal,source:t,context:this.contextId},(null===(e=this.options.crossdomain)||void 0===e?void 0:e.parentDomain)??"*"),this.markSentToParent(),this.debug.info("Trying to signal to parent, attempt:",n+1),n++)};for(let e=0;e<10;e++){if(this.checkStatus()){i=!0;break}s+=r,setTimeout(()=>{o()},s),r*=1.5}},this.startTimeout=null,this.restart=function(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];a.stop(!1),a.waitStatus(Aw.NotActive).then(()=>{a.allowAppStart();const t=e?{...a.prevOpts,forceNew:!0}:a.prevOpts;a.start(t,!0).then(t=>{e&&(a.prevOpts={...a.prevOpts,forceNew:!1}),a.debug.info("Session restart",t)}).catch(e=>{a.debug.error("Session restart failed",e)})})},this.handlePageShow=e=>{if(e&&e.persisted&&this.activityState!==Aw.NotActive)try{const e=null!=this.lastHiddenAt?Date.now()-this.lastHiddenAt:null;this.lastHiddenAt=null;const t=this.options.bfcacheRestartThreshold??18e5;null===e||e>=t?(this.debug.info("OpenReplay: restarting session after bfcache restore",{frozenMs:e}),this.restart(!0)):this.debug.info("OpenReplay: resuming session after bfcache restore",{frozenMs:e})}catch(e){this._debug("bfcache_restore",e)}},this.send=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];var n;a.activityState!==Aw.NotActive&&(a.activityState===Aw.ColdStart?(a.bufferedMessages1.push(e),a.singleBuffer||a.bufferedMessages2.push(e),null===(n=a.conditionsManager)||void 0===n||n.processMessage(e)):a.messages.push(e),a.activityState===Aw.Active&&t&&a.commit())},this.coldStartCommitN=0,this.delay=0,this.attachStartCallback=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(e=a.safe(e)),a.startCallbacks.push(e)},this.attachStopCallback=function(e){arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(e=a.safe(e)),a.stopCallbacks.push(e)},this.attachEventListener=function(e,t,n){let r=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],s=!(arguments.length>4&&void 0!==arguments[4])||arguments[4];r&&(n=a.safe(n)),a.attachStartCallback(()=>e?Zb(e,t,n,s,a.options.forceNgOff):null,r),a.attachStopCallback(()=>e?eS(e,t,n,s,a.options.forceNgOff):null,r)},this.coldInterval=null,this.orderNumber=0,this.coldStartTs=0,this.singleBuffer=!1,this.onSessionSent=()=>{},this.prevOpts={},this.restartCanvasTracking=()=>{var e;null===(e=this.canvasRecorder)||void 0===e||e.restartTracking()},this.attachResanitizeCallback=e=>{this.resanitizeCallbacks.push(e)},this.callResanitizeCallbacks=(e,t)=>{this.resanitizeCallbacks.forEach(n=>n(e,t))},this.resanitize=e=>{const t=e??(Rb?document.documentElement:void 0);t&&this.observer.resanitizeSubtree(t)},this.checkSanitization=e=>{const t=this.nodes.getID(e);if(void 0!==t)return this.sanitizer.getLevel(t)}
1,this.flushBuffer=async e=>new Promise((t,n)=>{if(0===e.length)return void t(null);let r=1;for(;r<e.length&&0!==e[r][0];)r++;nS(()=>{try{const n=e.splice(0,r);this.postToWorker(n.map(e=>[...e])),t(null)}catch(e){this._debug("flushBuffer",e),n(new Error("flushBuffer failed"))}})}),this.contextId=Math.random().toString(36).slice(2),this.projectKey=e,this.networkOptions=n.network;const c={revID:"",node_id:"__openreplay_id",session_token_key:"__openreplay_token",session_pageno_key:"__openreplay_pageno",session_reset_key:"__openreplay_reset",session_tabid_key:"__openreplay_tabid",local_uuid_key:"__openreplay_uuid",ingestPoint:"https://api.openreplay.com/ingest",resourceBaseHref:null,__is_snippet:!1,__debug_report_edp:null,__debug__:0,__local_debug:!1,localStorage:null,sessionStorage:null,forceSingleTab:!1,bfcacheRestartThreshold:18e5,assistSocketHost:"",captureIFrames:!0,obscureTextEmails:!1,obscureTextNumbers:!1,disableStringDict:!1,crossdomain:{parentDomain:"*"},canvas:{disableCanvas:!1,fixedCanvasScaling:!1,__save_canvas_locally:!1,useAnimationFrame:!1},forceNgOff:!1,inlineCss:mw.Unset,disableSprites:!1,disableThrottling:!1};if(this.options=rS(c,n),!this.insideIframe&&!this.options.forceSingleTab&&globalThis&&"BroadcastChannel"in globalThis){const e=location.hostname.split(".").slice(-2).join("_");this.bc=new BroadcastChannel(`rick_${e}`)}else this.options.forceSingleTab&&this.allowAppStart();this.revID=this.options.revID,this.localStorage=this.options.localStorage??window.localStorage,this.sessionStorage=this.options.sessionStorage??window.sessionStorage,this.sanitizer=new cw({app:this,options:n}),this.nodes=new ew({node_id:this.options.node_id,forceNgOff:Boolean(n.forceNgOff),maintainer:null===(i=this.options.nodes)||void 0===i?void 0:i.maintainer}),this.observer=new ww({app:this,options:n}),this.ticker=new Ew(this),this.ticker.attach(()=>this.commit()),this.debug=new XS(this.options.__debug__),this.session=new Tw({app:this,options:this.options}),this.attributeSender=new Ib({app:this,isDictDisabled:Boolean(this.options.disableStringDict||(null===(o=this.options.crossdomain)||void 0===o?void 0:o.enabled))}),this.tagWatcher=new FS({sessionStorage:this.sessionStorage,errLog:this.debug.error,onTag:e=>this.send([120,e])}),this.session.attachUpdateCallback(e=>{let{userID:t,metadata:n}=e;if(null!=t){if(!t||"string"!=typeof t||0===t.trim().length)return void this.debug.warn("Invalid userID (must be type string), ignoring.");this.send([28,t])}null!=n&&Object.entries(n).forEach(e=>{let[t,n]=e;return this.send(hS(t,n))})}),null!=t&&this.session.applySessionHash(t);const l=this.session.getTabId();var u;this.insideIframe?(window.addEventListener("message",this.parentCrossDomainFrameListener),window.addEventListener("message",this.crossDomainIframeListener),setInterval(()=>{var e;window.parent.postMessage({line:Nw.polling,context:this.contextId},(null===(e=n.crossdomain)||void 0===e?void 0:e.parentDomain)??"*"),this.markSentToParent()},250),this.iframeDebugInterval&&clearInterval(this.iframeDebugInterval),this.iframeDebugInterval=setInterval(this.emitIframeDebug,6e4)):(this.initWorker(),window.addEventListener("message",this.crossDomainIframeListener),null!==(u=this.options.crossdomain)&&void 0!==u&&u.enabled&&(this.xdomainDebugInterval&&clearInterval(this.xdomainDebugInterval),this.xdomainDebugInterval=setInterval(this.emitCrossdomainDebug,6e4))),null!==this.bc&&(this.bc.postMessage({line:Nw.ask,source:l,context:this.contextId,projectKey:this.projectKey}),this.startTimeout=setTimeout(()=>{this.allowAppStart()},250),this.bc.onmessage=e=>{if(e.data.context!==this.contextId&&this.projectKey===e.data.projectKey){if(this.debug.log(e),e.data.line===Nw.resp){const t=e.data.token;this.session.setSessionToken(t,this.projectKey),this.allowAppStart()}if(e.data.line===Nw.reg){const t=e.data.token;this.session.regenerateTabId(),this.session.setSessionToken(t,this.projectKey),this.allowAppStart()}if(e.data.line===Nw.ask){const t=this.session.getSessionToken(this.projectKey);t&&this.bc&&this.bc.postMessage({line:e.data.source===l?Nw.reg:Nw.resp,token:t,source:l,context:this.contextId,projectKey:this.projectKey})}if(e.data.line===Nw.reset){const t=e.data.token;this.debug.log("Received reset signal from another tab"),this.session.setSessionToken(t,this.projectKey),this.restart()}}else this.debug.log("same ctx event",e)})}markSentToParent(){this.lastSentToParentAt=Date.now()}allocateFrameOrder(e,t){const n=this.frameAlloc.get(e);if(void 0!==n)return n.order;let r=this.usedOrdersByLevel.get(t);r||(r=new Set,this.usedOrdersByLevel.set(t,r));let s=-1;for(let e=1;e<=ZS;e++)if(!r.has(e)){s=e;break}if(-1===s){let n=null,r=1/0;const i=new Set(this.trackedFrames);this.frameAlloc.forEach((e,s)=>{if(e.level!==t||i.has(s))return;
1const o=this.frameAnyLastSeen.get(s)??0;o<r&&(r=o,n=s)}),null!==n?(s=this.frameAlloc.get(n).order,this.frameAlloc.delete(n),this.debug.error("OR: frame order space exhausted, evicting",n,"for",e)):(s=ZS,this.debug.error("OR: frame order overflow, reusing max order for",e))}return r.add(s),this.frameAlloc.set(e,{order:s,level:t}),s}freeFrameOrder(e){var t;const n=this.frameAlloc.get(e);n&&(this.frameAlloc.delete(e),null===(t=this.usedOrdersByLevel.get(n.level))||void 0===t||t.delete(n.order))}pruneStaleFrames(){const e=Date.now()-this.FRAME_STALE_MS;this.trackedFrames=this.trackedFrames.filter(t=>{const n=this.frameLastSeen.get(t);return void 0!==n&&n>=e||(this.frameLastSeen.delete(t),!1)})}recordSentToFrame(e,t){e&&this.frameLastSent.set(e,{line:Pw[t]??t,t:Date.now()})}reAdoptOrphanFrame(e,t){var n;const r=Date.now();if(r-(this.reAdoptCooldown.get(t)??0)<this.RE_ADOPT_COOLDOWN_MS)return;this.reAdoptCooldown.set(t,r);const s={line:Nw.startIframe,token:this.session.getSessionToken(this.projectKey)},i=this.pageFrames.find(t=>t.contentWindow===e.source)||Array.from(document.querySelectorAll("iframe")).find(t=>t.contentWindow===e.source);if(i){const e=i[this.options.node_id];void 0!==e&&(s.id=e)}null===(n=e.source)||void 0===n||n.postMessage(s,"*"),this.recordSentToFrame(t,Nw.startIframe),this.debug.log("Re-adopting orphaned crossdomain iframe",t)}allowAppStart(){this.canStart=!0,this.startTimeout&&(clearTimeout(this.startTimeout),this.startTimeout=null)}async checkNodeId(e){let t;if(this.pageFrames.length>0&&(t=this.pageFrames.find(t=>t.contentWindow===e)),!t||!this.pageFrames.length){const n=Array.from(document.querySelectorAll("iframe"));this.pageFrames=n,t=n.find(t=>t.contentWindow===e)}if(!t)return null;let n=0;for(;n<100;){const e=t[this.options.node_id];if(void 0!==e)return n=100,e;n++,await Rw(100)}return null}initWorker(){try{this.worker=new Worker(URL.createObjectURL(new Blob(['!function(){"use strict";class t{constructor(t,s,i,e=10,n=250,h,r){this.onUnauthorised=s,this.onFailure=i,this.MAX_ATTEMPTS_COUNT=e,this.ATTEMPT_TIMEOUT=n,this.onCompress=h,this.pageNo=r,this.attemptsCount=0,this.busy=!1,this.queue=[],this.token=null,this.lastBatchNum=0,this.inflightKeepaliveBytes=0,this.ingestURL=t+"/v1/web/i",this.isCompressing=void 0!==h}getQueueStatus(){return 0===this.queue.length&&!this.busy}authorise(t){this.token=t,this.busy||this.sendNext()}push(t,s="player",i){if(this.busy||!this.token)this.queue.push({batch:t,dataType:s,split:i});else if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t,s,i);else{const e=++this.lastBatchNum;this.sendBatch(t,!1,e,s,i)}}sendNext(){const t=this.queue.shift();if(t)if(this.busy=!0,this.isCompressing&&this.onCompress)this.onCompress(t.batch,t.dataType,t.split);else{const s=++this.lastBatchNum;this.sendBatch(t.batch,!1,s,t.dataType,t.split)}else this.busy=!1}retry(t,s,i,e="player",n){if(this.attemptsCount>=this.MAX_ATTEMPTS_COUNT)return void this.onFailure(`Failed to send batch after ${this.attemptsCount} attempts.`);this.attemptsCount++;const h=new Uint8Array(t);setTimeout((()=>this.sendBatch(h,s,i,e,n)),this.ATTEMPT_TIMEOUT*this.attemptsCount)}sendBatch(t,s,i,e="player",n){var h,r,a;if(0===t.length)return console.error("OpenReplay: refusing to send 0-byte batch.",{batchNum:i,dataType:e,isCompressed:s,batch:t}),this.attemptsCount=0,void this.sendNext();const u=(null!==(h=null==i?void 0:i.toString())&&void 0!==h?h:"0").match(/^([^_]+)(?:_([^_]+))?/),o=null!==(r=null==u?void 0:u[1])&&void 0!==r?r:"0",l=(null==u?void 0:u[2])?u[2]:"";this.busy=!0;const c={Authorization:`Bearer ${this.token}`,DataType:e};if(s&&(c["Content-Encoding"]="gzip"),null===this.token)return void setTimeout((()=>{this.sendBatch(t,s,`${null!=i?i:"noBatchNum"}_newToken`,e,n)}),500);const d=t.length<65536&&this.inflightKeepaliveBytes+t.length<=65536;d&&(this.inflightKeepaliveBytes+=t.length);const p=()=>{d&&(this.inflightKeepaliveBytes-=t.length)},f=t.byteLength;let g=this.ingestURL;g+=`?batch=${null!==(a=this.pageNo)&&void 0!==a?a:0}`,g+=`_${o}`,g+=`_${f}`,g+="_"+(d?"kyes":"kno"),l&&(g+=`_${l}`),void 0!==n&&(g+=`&split=${n}`),fetch(g,{body:t,method:"POST",headers:c,keepalive:d}).then((h=>{var r;if(p(),null===(r=h.body)||void 0===r||r.cancel().catch((()=>{})),401===h.status)return this.busy=!1,void this.onUnauthorised();h.status>=400?this.retry(t,s,`${null!=i?i:"noBatchNum"}_network:${h.status}`,e,n):(this.attemptsCount=0,this.sendNext())})).catch((h=>{p(),console.warn("OpenReplay:",h),this.retry(t,s,`${null!=i?i:"noBatchNum"}_reject:${h.message}`,e,n)}))}sendCompressed(t,s="player",i){const e=++this.lastBatchNum;this.sendBatch(t,!0,e,s,i)}sendUncompressed(t,s="player",i){const e=++this.lastBatchNum;this.sendBatch(t,!1,e,s,i)}clean(){this.sendNext(),setTimeout((()=>{this.token=null,this.queue.length=0}),10)}}const s=new Set([60,61,71,73]),i=new Set([21,22,40,41,44,45,46,47,48,79,83,84,85,87,89,116,120,121,123]),e=new Set([17,23,24,27,28,29,30,42,63,64,78,112,115,124]),n="function"==typeof TextEncoder?new TextEncoder:{encode(t){const s=t.length,i=new Uint8Array(3*s);let e=-1;for(let n=0,h=0,r=0;r!==s;){if(n=t.charCodeAt(r),r+=1,n>=55296&&n<=56319){if(r===s){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;break}if(h=t.charCodeAt(r),!(h>=56320&&h<=57343)){i[e+=1]=239,i[e+=1]=191,i[e+=1]=189;continue}
1if(n=1024*(n-55296)+h-56320+65536,r+=1,n>65535){i[e+=1]=240|n>>>18,i[e+=1]=128|n>>>12&63,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n;continue}}n<=127?i[e+=1]=0|n:n<=2047?(i[e+=1]=192|n>>>6,i[e+=1]=128|63&n):(i[e+=1]=224|n>>>12,i[e+=1]=128|n>>>6&63,i[e+=1]=128|63&n)}return i.subarray(0,e+1)}};class h{constructor(t){this.size=t,this.offset=0,this.checkpointOffset=0,this.data=new Uint8Array(t)}getCurrentOffset(){return this.offset}getCurrentCheckpoint(){return this.checkpointOffset}checkpoint(){this.checkpointOffset=this.offset}get isEmpty(){return 0===this.offset}skip(t){return this.offset+=t,this.offset<=this.size}set(t,s){this.data.set(t,s)}boolean(t){return this.data[this.offset++]=+t,this.offset<=this.size}uint(t){for((t<0||t>Number.MAX_SAFE_INTEGER)&&(t=0);t>=128;)this.data[this.offset++]=t%256|128,t=Math.floor(t/128);return this.data[this.offset++]=t,this.offset<=this.size}int(t){return t=Math.round(t),this.uint(t>=0?2*t:-2*t-1)}string(t){const s=n.encode(t),i=s.byteLength;return!(!this.uint(i)||this.offset+i>this.size)&&(this.data.set(s,this.offset),this.offset+=i,!0)}reset(){this.offset=0,this.checkpointOffset=0}rewind(t,s){t>this.offset||s>this.checkpointOffset||(this.offset=t,this.checkpointOffset=s)}flush(){const t=this.data.slice(0,this.checkpointOffset);return this.reset(),t}}class r extends h{encode(t){switch(t[0]){case 0:case 11:case 114:case 115:return this.uint(t[1]);case 4:case 44:case 47:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3]);case 5:case 20:case 65:case 70:case 75:case 76:case 77:return this.uint(t[1])&&this.uint(t[2]);case 6:return this.int(t[1])&&this.int(t[2]);case 7:return!0;case 8:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.string(t[4])&&this.boolean(t[5]);case 9:case 10:case 24:case 35:case 51:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3]);case 12:case 52:case 61:case 71:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3]);case 13:case 14:case 17:case 34:case 36:case 50:case 54:return this.uint(t[1])&&this.string(t[2]);case 16:return this.uint(t[1])&&this.int(t[2])&&this.int(t[3]);case 18:return this.uint(t[1])&&this.string(t[2])&&this.int(t[3]);case 19:return this.uint(t[1])&&this.boolean(t[2]);case 21:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8]);case 22:case 27:case 30:case 41:case 45:case 46:case 43:case 63:case 64:case 79:case 124:return this.string(t[1])&&this.string(t[2]);case 23:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 28:case 29:case 42:case 117:case 118:return this.string(t[1]);case 40:return this.string(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 48:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.int(t[5]);case 49:return this.int(t[1])&&this.int(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 53:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8]);case 55:return this.boolean(t[1]);case 57:case 60:return this.uint(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 58:case 120:return this.int(t[1]);case 68:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])&&this.uint(t[6]);case 69:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3])&&this.string(t[4]);case 73:return this.uint(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 78:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4]);case 81:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.int(t[4])&&this.string(t[5]);case 83:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.string(t[5])&&this.uint(t[6])&&this.uint(t[7])&&this.uint(t[8])&&this.uint(t[9]);case 84:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.uint(t[4])&&this.string(t[5])&&this.string(t[6]);case 85:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8])&&this.uint(t[9])&&this.boolean(t[10])&&this.uint(t[11])&&this.uint(t[12])&&this.uint(t[13])&&this.uint(t[14])&&this.uint(t[15])&&this.uint(t[16])&&this.uint(t[17]);case 87:return this.string(t[1])&&this.int(t[2])&&this.int(t[3]);case 89:return this.string(t[1])&&this.int(t[2])&&this.int(t[3])&&this.int(t[4])&&this.int(t[5])&&this.string(t[6]);case 112:return this.uint(t[1])&&this.string(t[2])&&this.boolean(t[3])&&this.string(t[4])&&this.int(t[5])&&this.int(t[6]);case 113:return this.uint(t[1])&&this.uint(t[2])&&this.string(t[3]);case 116:return this.uint(t[1])&&this.uint(t[2])&&this.uint(t[3])&&this.uint(t[4])&&this.uint(t[5])&&this.uint(t[6])&&this.string(t[7])&&this.string(t[8])&&this.uint(t[9])&&this.boolean(t[10]);case 119:return this.string(t[1])&&this.uint(t[2]);case 121:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.uint(t[4]);case 122:return this.string(t[1])&&this.string(t[2])&&this.uint(t[3])&&this.string(t[4]);case 123:return this.string(t[1])&&this.string(t[2])&&this.string(t[3])&&this.string(t[4])&&this.uint(t[5])}}}class a{constructor(t,s,i){this.bufferSize=t,this.version=s,this.dataType=i,this.sizeBuffer=new Uint8Array(3),this.snap=null,this.hasNonTimestamp=!1,this.lastPushedTs=0,this.encoder=new r(t)}push(t,s){const i=this.encoder,e=null===this.snap,n=i.getCurrentOffset(),h=i.getCurrentCheckpoint();if(e){const t={pageNo:s.pageNo,firstIndex:s.index,timestamp:s.timestamp,url:s.url,tabId:s.tabId};if(!this.writeHeader(t))return i.rewind(n,h),!1;this.snap=t,this.lastPushedTs=s.timestamp}return 0===t[0]||s.timestamp===this.lastPushedTs||this.writeMessageWithSize([0,s.timestamp])?this.writeMessageWithSize(t)?(this.lastPushedTs=s.timestamp,0!==t[0]&&(this.hasNonTimestamp=!0),!0):(i.rewind(n,h),e&&(this.snap=null),!1):(i.rewind(n,h),!1)}hasContent(){return null!==this.snap&&this.hasNonTimestamp}size(){return null===this.snap?0:this.encoder.getCurrentOffset()}flush(){if(!this.hasContent())return this.reset(),null;const t=this.encoder.flush();return this.snap=null,this.hasNonTimestamp=!1,this.lastPushedTs=0,t}reset(){this.encoder.reset(),this.snap=null,this.hasNonTimestamp=!1,this.lastPushedTs=0}writeHeader(t){const s=this.encoder,i=[81,this.version,t.pageNo,t.firstIndex,t.timestamp,t.url];return!!s.uint(i[0])&&(!!s.encode(i)&&(!(s.getCurrentOffset()>this.bufferSize)&&(s.checkpoint(),!!this.writeMessageWithSize([0,t.timestamp])&&!!this.writeMessageWithSize([118,t.tabId])
1)))}writeMessageWithSize(t){const s=this.encoder;if(!s.uint(t[0])||!s.skip(3))return!1;const i=s.getCurrentOffset();if(!s.encode(t))return!1;const e=s.getCurrentOffset(),n=e-i;return n>16777215?(console.warn("OpenReplay: max message size overflow."),!1):!(e>this.bufferSize)&&(this.writeSizeAt(n,i-3),s.checkpoint(),!0)}writeSizeAt(t,s){for(let s=0;s<3;s++)this.sizeBuffer[s]=t>>8*s;this.encoder.set(this.sizeBuffer,s)}}class u{constructor(t,s,i,e,n,h,r=!1,u){this.pageNo=t,this.timestamp=s,this.url=i,this.onBatch=e,this.tabId=n,this.onOfflineEnd=h,this.localDebug=r,this.onLocalSave=u,this.nextIndex=0,this.beaconSize=2e5,this.beaconSizeLimit=1e6,this.protocolVersion=1,this.visualSent=!1,this.signalSeen=!1,this.heldOther=[],this.playerBuilder=new a(this.beaconSize,this.playerVersion(),"player"),this.assetBuilder=new a(this.beaconSize,3,"assets"),this.devtoolsBuilder=new a(this.beaconSize,4,"devtools"),this.analyticsBuilder=new a(this.beaconSize,5,"analytics")}initActive(){return 2===this.protocolVersion&&!this.visualSent}playerVersion(){return 2===this.protocolVersion?2:1}currentCtx(){return{pageNo:this.pageNo,index:this.nextIndex,timestamp:this.timestamp,url:this.url,tabId:this.tabId}}setBeaconSizeLimit(t){this.beaconSizeLimit=t}setProtocolVersion(t){if(this.protocolVersion!==t){if(this.protocolVersion=t,2===t&&!this.signalSeen)return this.playerBuilder.reset(),this.assetBuilder.reset(),this.playerBuilder=new a(this.beaconSizeLimit,this.playerVersion(),"player"),void(this.assetBuilder=new a(this.beaconSizeLimit,3,"assets"));2===t&&(this.visualSent=!0),this.playerBuilder.reset(),this.playerBuilder=new a(this.beaconSize,this.playerVersion(),"player")}}writeMessage(t){if(-1===t[0])return this.finaliseBatch(),this.onOfflineEnd();if(12===t[0]&&"orloaded"===t[2])return void(this.initActive()?this.finalizeVisual():this.signalSeen=!0);0===t[0]&&(this.timestamp=t[1]),122===t[0]&&(this.url=t[1]);const s=this.routeMessage(t);this.pushTo(s,t)}routeMessage(t){if(2===this.protocolVersion){const n=t[0];if(s.has(n))return this.assetBuilder;if(i.has(n))return this.devtoolsBuilder;if(e.has(n))return this.analyticsBuilder}return this.playerBuilder}pushTo(t,s){const i=this.currentCtx();if(this.initActive())return void this.pushDuringInit(t,s,i);if(t.push(s,i))return void this.nextIndex++;if(t===this.assetBuilder&&this.flushBuilder(this.playerBuilder),this.flushBuilder(t),t.push(s,i))return void this.nextIndex++;const e=new a(this.beaconSizeLimit,t.version,t.dataType);if(!e.push(s,i))return void console.warn("OpenReplay: beacon size overflow. Skipping large message.",s);this.nextIndex++;const n=e.flush();n&&(t===this.assetBuilder&&this.flushBuilder(this.playerBuilder),this.emitBatch(n,t.dataType,!1))}pushDuringInit(t,s,i){const e=t===this.playerBuilder||t===this.assetBuilder;if(t.push(s,i))return this.nextIndex++,void(e&&this.playerBuilder.size()+this.assetBuilder.size()>=this.beaconSizeLimit&&this.finalizeVisual());if(e)return this.finalizeVisual(),void this.pushTo(this.routeMessage(s),s);if(this.flushBuilderToHeld(t),t.push(s,i))return void this.nextIndex++;const n=new a(this.beaconSizeLimit,t.version,t.dataType);if(!n.push(s,i))return void console.warn("OpenReplay: beacon size overflow. Skipping large message.",s);this.nextIndex++;const h=n.flush();h&&this.heldOther.push({batch:h,dataType:t.dataType})}flushBuilderToHeld(t){const s=t.flush();s&&this.heldOther.push({batch:s,dataType:t.dataType})}finalizeVisual(t=!1){const s=this.playerBuilder.flush(),i=this.assetBuilder.flush();if(this.visualSent=!0,this.playerBuilder=new a(this.beaconSize,this.playerVersion(),"player"),this.assetBuilder=new a(this.beaconSize,3,"assets"),s&&i){const e=new Uint8Array(s.length+i.length);e.set(s,0),e.set(i,s.length),this.emitBatch(e,"visual",t,s.length)}else s?this.emitBatch(s,"visual",t):i&&this.emitBatch(i,"assets",t);for(const s of this.heldOther)this.emitBatch(s.batch,s.dataType,t);this.heldOther.length=0,this.flushBuilder(this.devtoolsBuilder,t),this.flushBuilder(this.analyticsBuilder,t)}flushBuilder(t,s=!1){const i=t.flush();return!!i&&(this.emitBatch(i,t.dataType,s),!0)}emitBatch(t,s,i,e){this.localDebug&&this.onLocalSave&&this.onLocalSave(`${s}-${Date.now()}`,t.slice()),this.onBatch(t,i,s,e)}finaliseBatch(t=!1){this.initActive()?this.finalizeVisual(t):(this.flushBuilder(this.playerBuilder,t),this.flushBuilder(this.assetBuilder,t),this.flushBuilder(this.devtoolsBuilder,t),this.flushBuilder(this.analyticsBuilder,t))}clean(){this.playerBuilder.reset(),this.assetBuilder.reset(),this.devtoolsBuilder.reset(),this.analyticsBuilder.reset(),this.heldOther.length=0,this.visualSent=!1,this.signalSeen=!1}}var o;
1!function(t){t[t.NotActive=0]="NotActive",t[t.Starting=1]="Starting",t[t.Stopping=2]="Stopping",t[t.Active=3]="Active",t[t.Stopped=4]="Stopped"}(o||(o={}));let l=null,c=null,d=o.NotActive;function p(t){c&&c.finaliseBatch(t)}function f(){return new Promise((t=>{d=o.Stopping,null!==y&&(clearInterval(y),y=null),c&&(c.clean(),c=null),l&&(l.clean(),setTimeout((()=>{l=null}),20)),setTimeout((()=>{d=o.NotActive,t(null)}),100)}))}function g(){[o.Stopped,o.Stopping].includes(d)||(postMessage("a_stop"),f().then((()=>{postMessage("a_start")})))}let m,y=null;self.onmessage=({data:s})=>{var i;if("stop"===s)return p(),void f().then((()=>{d=o.Stopped}));if("forceFlushBatch"!==s)if("closing"!==s){if(!Array.isArray(s)){if("compressed"===s.type){if(!l)return console.debug("OR WebWorker: sender not initialised. Compressed batch."),void g();s.batch&&l.sendCompressed(s.batch,s.dataType,s.split)}if("uncompressed"===s.type){if(!l)return console.debug("OR WebWorker: sender not initialised. Uncompressed batch."),void g();s.batch&&l.sendUncompressed(s.batch,s.dataType,s.split)}return"start"===s.type?(d=o.Starting,l=new t(s.ingestPoint,(()=>{g()}),(t=>{!function(t){postMessage({type:"failure",reason:t}),f()}(t)}),s.connAttemptCount,s.connAttemptGap,((t,s,i)=>{postMessage({type:"compress",batch:t,dataType:s,split:i},[t.buffer])}),s.pageNo),c=new u(s.pageNo,s.timestamp,s.url,((t,s,i="player",e)=>{l&&(s?l.sendUncompressed(t,i,e):l.push(t,i,e))}),s.tabId,(()=>postMessage({type:"queue_empty"})),null!==(i=s.localDebug)&&void 0!==i&&i,((t,s)=>{postMessage({type:"local_save",name:t,batch:s},[s.buffer])})),null===y&&(y=setInterval(p,3e4)),d=o.Active):"auth"===s.type?l?c?(l.authorise(s.token),s.beaconSizeLimit&&c.setBeaconSizeLimit(s.beaconSizeLimit),void(s.protocolVersion&&c.setProtocolVersion(s.protocolVersion))):(console.debug("OR WebWorker: writer not initialised. Received auth."),void g()):(console.debug("OR WebWorker: sender not initialised. Received auth."),void g()):void 0}if(c){const t=c;s.forEach((s=>{55===s[0]&&(s[1]?m=setTimeout((()=>g()),18e5):clearTimeout(m)),t.writeMessage(s)}))}else postMessage("not_init"),g()}else p(!0);else p()}}();\n'],{type:"text/javascript"}))),this.worker.onerror=e=>{this._debug("webworker_error",e)},this.worker.onmessage=e=>{let{data:t}=e;this.handleWorkerMsg(t)};let e=!1;const t=()=>{e||(e=!0,setTimeout(()=>{e=!1},500),this.worker&&this.worker.postMessage("closing"))};this.attachEventListener(document.body,"mouseleave",t,!1,!1),this.attachEventListener(window,"pagehide",()=>{this.lastHiddenAt=Date.now(),t()},!1,!1),this.attachEventListener(window,"pageshow",this.handlePageShow,!1,!1),this.attachEventListener(document,"visibilitychange",e=>"hidden"===document.visibilityState&&t(),!1)}catch(e){this._debug("worker_start",e)}}handleWorkerMsg(e){if("a_stop"===e)this.stop(!1);else if("a_start"===e)this.waitStatus(Aw.NotActive).then(()=>{this.allowAppStart(),this.start(this.prevOpts,!0).then(e=>{this.debug.info("Worker restart, session too long",e)}).catch(e=>{this.debug.error("Worker restart failed",e)})});else if("not_init"===e)this.debug.warn("OR WebWorker: writer not initialised. Restarting tracker");else if("failure"===e.type)this.stop(!1),this.debug.error("worker_failed",e.reason),this._debug("worker_failed",e.reason);else if("compress"===e.type){const n=e.batch,r=e.dataType,s=e.split,i=n.byteLength,o="CompressionStream"in globalThis;if(i>this.compressionThreshold&&o){const e=new Blob([n]).stream().pipeThrough(new CompressionStream("gzip"));new Response(e).arrayBuffer().then(e=>{var t;null===(t=this.worker)||void 0===t||t.postMessage({type:"compressed",batch:new Uint8Array(e),dataType:r,split:s})}).catch(e=>{var t;this.debug.error("Openreplay compression error:",e),null===(t=this.worker)||void 0===t||t.postMessage({type:"uncompressed",batch:n,dataType:r,split:s})})}else{var t;null===(t=this.worker)||void 0===t||t.postMessage({type:"uncompressed",batch:n,dataType:r,split:s})}}else if("local_save"===e.type){const t=new Blob([e.batch],{type:"application/octet-stream"}),n=URL.createObjectURL(t),r=document.createElement("a");r.href=n,r.download=e.name,r.click(),URL.revokeObjectURL(n)}else"queue_empty"===e.type&&this.onSessionSent()}_debug(e,t){null!==this.options.__debug_report_edp&&fetch(this.options.__debug_report_edp,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({context:e,error:`${t}`})}),this.debug.error("OpenReplay error: ",e,t)}_nCommit(){if(this.socketMode)return this.messages.unshift(sS(this.timestamp()),AS(this.session.getTabId())),this.commitCallbacks.forEach(e
1=>e(this.messages)),void(this.messages.length=0);var e;if(this.insideIframe)return window.parent.postMessage({line:Nw.iframeBatch,messages:this.messages,context:this.contextId},(null===(e=this.options.crossdomain)||void 0===e?void 0:e.parentDomain)??"*"),this.markSentToParent(),this.commitCallbacks.forEach(e=>e(this.messages)),void(this.messages.length=0);if(void 0!==this.worker)if(this.messages.length){this.emptyBatchCounter=0;try{nS(()=>{var e;this.messages.length&&(this.messages.unshift(sS(this.timestamp()),AS(this.session.getTabId())),null===(e=this.worker)||void 0===e||e.postMessage(this.messages),this.commitCallbacks.forEach(e=>e(this.messages)),this.messages.length=0)})}catch(e){this._debug("worker_commit",e),this.stop(!0),setTimeout(()=>{this.start()},500)}}else{if(this.emptyBatchCounter<1e3)return void this.emptyBatchCounter++;this.emptyBatchCounter=0;try{var t;null===(t=this.worker)||void 0===t||t.postMessage([sS(this.timestamp()),AS(this.session.getTabId())])}catch(e){this._debug("worker_keepalive",e)}}}_cStartCommit(){if(this.coldStartCommitN+=1,2===this.coldStartCommitN){const e=[sS(this.timestamp()),AS(this.session.getTabId())];this.bufferedMessages1.push(...e),this.bufferedMessages2.push(...e),this.coldStartCommitN=0}}commit(){this.activityState===Aw.ColdStart?this._cStartCommit():this._nCommit()}postToWorker(e){var t;null===(t=this.worker)||void 0===t||t.postMessage(e),this.commitCallbacks.forEach(t=>t(e))}timestamp(){return $b()+this.delay}safe(e){const t=this;return function(){try{for(var n=arguments.length,r=new Array(n),s=0;s<n;s++)r[s]=arguments[s];e.apply(this,r)}catch(e){t._debug("safe_fn_call",e)}}}attachCommitCallback(e){this.commitCallbacks.push(e)}checkRequiredVersion(e){const t=e.split(/[.-]/),n=this.version.split(/[.-]/);for(let e=0;e<3;e++){if(isNaN(Number(n[e]))||isNaN(Number(t[e])))return!1;if(Number(n[e])>Number(t[e]))return!0;if(Number(n[e])<Number(t[e]))return!1}return!0}getTrackerInfo(){return{userUUID:this.localStorage.getItem(this.options.local_uuid_key),projectKey:this.projectKey,revID:this.revID,trackerVersion:this.version,isSnippet:this.options.__is_snippet}}getSessionInfo(){return{...this.session.getInfo(),...this.getTrackerInfo()}}getSessionToken(){return this.session.getSessionToken(this.projectKey)}getSessionID(){return this.session.getInfo().sessionID||void 0}getSessionURL(e){const{projectID:t,sessionID:n,timestamp:r}=this.session.getInfo();if(!t||!n)return void this.debug.error("OpenReplay error: Unable to build session URL");const s=this.options.ingestPoint,i=(/api\.openreplay\.com/.test(s)?"https://app.openreplay.com/ingest":s).replace(/ingest$/,`${t}/session/${n}`);return null!=e&&e.withCurrentTime?`${i}?jumpto=${$b()-r}`:i}getHost(){return new URL(this.options.ingestPoint).host}getProjectKey(){return this.projectKey}getBaseHref(){var e;return"string"==typeof this.options.resourceBaseHref?this.options.resourceBaseHref:(this.options.resourceBaseHref,document.baseURI?document.baseURI:(null===(e=document.head)||void 0===e||null===(e=e.getElementsByTagName("base")[0])||void 0===e?void 0:e.getAttribute("href"))||location.origin+location.pathname)}resolveResourceURL(e){const t=new URL(this.getBaseHref());return t.pathname+="/"+new URL(e).pathname,t.pathname.replace(/\/+/g,"/"),t.toString()}isServiceURL(e){return e.startsWith(this.options.ingestPoint)}active(){return this.activityState===Aw.Active}resetNextPageSession(e){e?this.sessionStorage.setItem(this.options.session_reset_key,"t"):this.sessionStorage.removeItem(this.options.session_reset_key)}getSessionVersionHash(){return`2x${this.version}`}checkSessionToken(e){const t=this.getSessionVersionHash(),n=null!==this.sessionStorage.getItem(this.options.session_reset_key);let r=e||n;const s=this.session.getSessionToken(this.projectKey);if(s){const e=this.sessionStorage.getItem(`${this.options.session_token_key}_version`);r=!e||e!==t,this.sessionStorage.setItem(`${this.options.session_token_key}_version`,t)}return r||!s}async coldStart(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;this.singleBuffer=!1;const n=this.checkSessionToken(e.forceNew);t&&await this.setupConditionalStart(e);const r=()=>{this.orderNumber+=1,Lb(),this.coldStartTs=$b(),this.orderNumber%2==0?(this.bufferedMessages1.length=0,this.bufferedMessages1.push(sS(this.timestamp())),this.bufferedMessages1.push(AS(this.session.getTabId()))):(this.bufferedMessages2.length=0,this.bufferedMessages2.push(sS(this.timestamp())),this.bufferedMessages2.push(AS(this.session.getTabId()))),this.stop(!1),this.activityState=Aw.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata}),n||(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(OS(this.session.getTabId()))),this.observer.observe(),this.ticker.start()};this.coldInterval=setInterval(()=>{r()},3e4),r()}async setupConditionalStart(e){var t;this.conditionsManager=new Cb(this,e);const n=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:$b(),doNotRecord:!0,bufferDiff:0,userID:this.session.getInfo().userID,token:void 0,deviceMemory:RS,jsHeapSizeLimit:NS,timezone:Mw(),width:window.screen.width,height:window.screen.height})}),{token:r,userBrowser:s,userCity:i,userCountry:o,userDevice:a,userOS:c,userState:l,projectID:u}=await n.json();this.session.assign({projectID:u}),this.session.setUserInfo({userBrowser:s,userCity:i,userCountry:o,userDevice:a,userOS:c,userState:l});const d={sessionToken:r,userUUID:"",sessionID:""};
1this.startCallbacks.forEach(e=>e(d)),await(null===(t=this.conditionsManager)||void 0===t?void 0:t.fetchConditions(u,r)),await this.tagWatcher.fetchTags(this.options.ingestPoint,r)}offlineRecording(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;this.onSessionSent=t,this.singleBuffer=!0;const n=this.checkSessionToken(e.forceNew);Lb(),this.coldStartTs=$b();const r=this.localStorage.getItem(Iw);if(r){const e=JSON.parse(r);this.bufferedMessages1=Array.isArray(e)?e:this.bufferedMessages1,this.localStorage.removeItem(Iw)}this.bufferedMessages1.push(sS(this.timestamp())),this.bufferedMessages1.push(AS(this.session.getTabId())),this.activityState=Aw.ColdStart,e.sessionHash&&this.session.applySessionHash(e.sessionHash),e.forceNew&&this.session.reset(),this.session.assign({userID:e.userID,metadata:e.metadata});const s={sessionToken:"",userUUID:"",sessionID:""};return this.startCallbacks.forEach(e=>e(s)),n||this.send(OS(this.session.getTabId())),this.observer.observe(),this.ticker.start(),{saveBuffer:this.saveBuffer,getBuffer:this.getBuffer,setBuffer:this.setBuffer}}saveBuffer(){this.localStorage.setItem(Iw,JSON.stringify(this.bufferedMessages1))}getBuffer(){return this.bufferedMessages1}setBuffer(e){this.bufferedMessages1=e}async uploadOfflineRecording(){var e,t;this.stop(!1);const n=$b();null===(e=this.worker)||void 0===e||e.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:this.coldStartTs,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId(),localDebug:this.options.__local_debug});const r=await fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:n,doNotRecord:!1,bufferDiff:n-this.coldStartTs,userID:this.session.getInfo().userID,token:void 0,deviceMemory:RS,jsHeapSizeLimit:NS,timezone:Mw()})}),{token:s,userBrowser:i,userCity:o,userCountry:a,userDevice:c,userOS:l,userState:u,beaconSizeLimit:d,projectID:h,protocolVersion:p}=await r.json();for(null===(t=this.worker)||void 0===t||t.postMessage({type:"auth",token:s,beaconSizeLimit:d,protocolVersion:p}),this.session.assign({projectID:h}),this.session.setUserInfo({userBrowser:i,userCity:o,userCountry:a,userDevice:c,userOS:l,userState:u});this.bufferedMessages1.length>0;)await this.flushBuffer(this.bufferedMessages1);this.postToWorker([[-1]]),this.clearBuffers()}async _start(){var e;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>2?arguments[2]:void 0;0!==Object.keys(t).length&&(this.prevOpts=t),t.startCallback&&(this.userStartCallback=t.startCallback);const r=this.activityState===Aw.ColdStart;if(r&&this.coldInterval&&clearInterval(this.coldInterval),!this.worker&&!this.insideIframe){const e="No worker found: perhaps, CSP is not set.";return this.signalError(e,[]),Promise.resolve(Cw(e))}if(this.activityState===Aw.Active||this.activityState===Aw.Starting){const e="OpenReplay: trying to call `start()` on the instance that has been started already.";return Promise.resolve(Cw(e))}this.activityState=Aw.Starting,r||Lb(),t.sessionHash&&this.session.applySessionHash(t.sessionHash),t.forceNew&&this.session.reset();const s=t.userID?t.userID.trim():void 0;this.session.assign({userID:s||void 0,metadata:t.metadata});const i=$b();null===(e=this.worker)||void 0===e||e.postMessage({type:"start",pageNo:this.session.incPageNo(),ingestPoint:this.options.ingestPoint,timestamp:r?this.coldStartTs:i,url:document.URL,connAttemptCount:this.options.connAttemptCount,connAttemptGap:this.options.connAttemptGap,tabId:this.session.getTabId(),localDebug:this.options.__local_debug});const o=this.session.getSessionToken(this.projectKey),a=this.checkSessionToken(t.forceNew);this.sessionStorage.removeItem(this.options.session_reset_key),this.debug.log("OpenReplay: starting session; need new session id?",a,"session token: ",o);try{var c,l;const e=await window.fetch(this.options.ingestPoint+"/v1/web/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...this.getTrackerInfo(),timestamp:i,doNotRecord:!1,bufferDiff:this.coldStartTs?i-this.coldStartTs:0,userID:this.session.getInfo().userID,token:a?void 0:o,deviceMemory:RS,jsHeapSizeLimit:NS,timezone:Mw(),condition:n,assistOnly:t.assistOnly??this.socketMode,width:window.screen.width,height:window.screen.height,referrer:document.referrer})});if(200!==e.status){const t=await e.text(),n=t===xw?xw:`Server error: ${e.status}. ${t}`;return Cw(n)}if(!this.worker&&!this.insideIframe){const e="no worker found after start request (this should not happen in real world)";return this.signalError(e,[]),Cw(e)}const{token:s,userUUID:p,projectID:f,beaconSizeLimit:m,compressionThreshold:g,delay:y,sessionID:v,startTimestamp:_,userBrowser:b,userCity:S,userCountry:w,userDevice:k,userOS:T,userState:E,canvasEnabled:x,canvasQuality:I,canvasFPS:C,framesSupport:O,assistOnly:A,protocolVersion:M}=await e.json();if("string"!=typeof s||"string"!=typeof p||"number"!=typeof _&&void 0!==_||"string"!=typeof v||"number"!=typeof y||"number"!=typeof m&&void 0!==m){const t=`Incorrect server response: ${JSON.stringify(e)}`;return this.signalError(t,[]),Cw(t)}var u,d,h;this.delay=y,this.session.setSessionToken(s,this.projectKey),this.sessionStorage.setItem(`${this.options.session_token_key}
1_version`,this.getSessionVersionHash()),o&&o!==s&&(null===(u=this.bc)||void 0===u||u.postMessage({type:Nw.reset,token:s})),this.session.setUserInfo({userBrowser:b,userCity:S,userCountry:w,userDevice:k,userOS:T,userState:E}),this.session.assign({sessionID:v,timestamp:_||i,projectID:f}),A?(this.socketMode=!0,null===(d=this.worker)||void 0===d||d.postMessage("stop")):null===(h=this.worker)||void 0===h||h.postMessage({type:"auth",token:s,beaconSizeLimit:m,protocolVersion:M}),a||s!==o||(this.debug.log("continuing session on new tab",this.session.getTabId()),this.send(OS(this.session.getTabId()))),Object.entries(this.session.getInfo().metadata).forEach(e=>{let[t,n]=e;return this.send(hS(t,n))}),this.localStorage.setItem(this.options.local_uuid_key,p),this.compressionThreshold=g;const R={sessionToken:s,userUUID:p,sessionID:v};if(this.startCallbacks.forEach(e=>e(R)),this.userStartCallback&&this.userStartCallback(Ow(R)),this.activityState=Aw.Active,null!==(c=this.options.crossdomain)&&void 0!==c&&c.enabled&&this.bootChildrenFrames(),x&&!this.options.canvas.disableCanvas&&(this.canvasRecorder=this.canvasRecorder??new KS(this,{fps:C,quality:I,isDebug:this.options.canvas.__save_canvas_locally,fixedScaling:this.options.canvas.fixedCanvasScaling,useAnimationFrame:this.options.canvas.useAnimationFrame,framesSupport:!!O})),r){const e=this.bufferedMessages1.length>this.bufferedMessages2.length?this.bufferedMessages1:this.bufferedMessages2;for(;e.length>0;)await this.flushBuffer(e);this.clearBuffers(),this.commit()}return this.insideIframe&&this.rootId?this.observer.crossdomainObserve(this.rootId,this.frameOderNumber,this.frameLevel):this.observer.observe(),this.ticker.start(),null===(l=this.canvasRecorder)||void 0===l||l.startTracking(),this.tagWatcher.fetchTags(this.options.ingestPoint,s),Ow(R)}catch(e){if(this.stop(),this.session.reset(),!e)return console.error("Unknown error during start"),this.signalError("Unknown error",[]),Cw("Unknown error");if(e===xw)return this.signalError(xw,[]),Cw(xw);this._debug("session_start",e);const t=e instanceof Error?e.message:e.toString();return this.signalError(t,[]),Cw(t)}}async waitStart(){return new Promise(e=>{const t=setInterval(()=>{this.canStart&&(clearInterval(t),e(!0))},100)})}async waitStarted(){return this.waitStatus(Aw.Active)}async waitStatus(e){return new Promise(t=>{const n=()=>{this.activityState===e?t(!0):setTimeout(n,25)};n()})}async start(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];if(this.activityState===Aw.Active||this.activityState===Aw.Starting){const e="OpenReplay: trying to call `start()` on the instance that has been started already.";return Promise.resolve(Cw(e))}return this.insideIframe&&this.signalIframeTracker(),document.hidden?new Promise(e=>{const n=async()=>{document.hidden||(await this.waitStart(),document.removeEventListener("visibilitychange",n),e(this._start(...t)))};document.addEventListener("visibilitychange",n)}):(await this.waitStart(),this._start(...t))}forceFlushBatch(){var e;null===(e=this.worker)||void 0===e||e.postMessage("forceFlushBatch")}getTabId(){return this.session.getTabId()}clearBuffers(){this.bufferedMessages1.length=0,this.bufferedMessages2.length=0}trackWs(e){var t=this;const n=e;return function(e,r){let s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"down";"string"!=typeof e||"string"!=typeof r||r.length>5242880||e.length>255||t.send(function(e,t,n,r,s,i){return[84,e,t,n,r,s,i]}("websocket",n,r,t.timestamp(),s,e))}}stop(){let e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];if(this.activityState!==Aw.NotActive)try{var t,n;null!==(t=this.options.crossdomain)&&void 0!==t&&t.enabled&&this.killChildrenFrames(),this.attributeSender.clear(),this.sanitizer.clear(),this.observer.disconnect(),this.nodes.clear(),this.ticker.stop(),this.stopCallbacks.forEach(e=>e()),this.tagWatcher.clear(),this.worker&&e&&this.worker.postMessage("stop"),null===(n=this.canvasRecorder)||void 0===n||n.clear(),this.messages.length=0,this.parentActive=!1,this.pageFrames=[]}finally{this.activityState=Aw.NotActive,this.debug.log("OpenReplay tracking stopped.")}}}const Dw=Rb&&"InstallTrigger"in window?e=>e.message+"\n"+e.stack:e=>e.stack||e.message;function $w(e){return void 0===e?"undefined":null===e?"null":e instanceof Error?Dw(e):Array.isArray(e)?`Array(${e.length})`:String(e)}function jw(e){if(void 0===e)return"undefined";if(null===e)return"null";if(e instanceof Error)return Dw(e);if(Array.isArray(e))return`Array(${e.length})[${e.slice(0,10).map($w).join(", ")}]`;if("object"==typeof e){const t=[];let n=0;for(const r in e){if(10===++n)break;const s=e[r];t.push(r+": "+$w(s))}return"{"+t.join(", ")+"}"}return e.toString()}const Bw=["log","info","warn","error","debug","assert"];function Fw(e,t){const n=Object.assign({consoleMethods:Bw,consoleThrottling:30},t);
1if(!Array.isArray(n.consoleMethods)||0===n.consoleMethods.length)return;const r=e.safe((t,n)=>{let r=function(e){return"string"==typeof e[0]&&e.unshift(e.shift().replace(/%(o|s|f|d|i)/g,(t,n)=>{const r=e.shift();if(void 0===r)return t;switch(n){case"o":return jw(r);case"s":return $w(r);case"f":return function(e){return"number"!=typeof e?"NaN":e.toString()}(r);case"d":case"i":return function(e){return"number"!=typeof e?"NaN":Math.floor(e).toString()}(r);default:return t}})),e.map(jw).join(" ")}(n);e.sanitizer.privateMode&&(r=r.replaceAll(/./g,"*")),e.send(uS(t,r))});let s=0;const i=()=>{s=0};e.attachStartCallback(i),e.ticker.attach(i,33,!1);const o=[],a=e.safe(t=>((t,i)=>{const a={apply:function(e,t,o){Reflect.apply(e,i,o),s+=1,s>n.consoleThrottling||r(e.name,o)}};n.consoleMethods.forEach(n=>{if(-1===Bw.indexOf(n))return void e.debug.error(`OpenReplay: unsupported console method "${n}"`);const r=i.console[n];t[n]=new Proxy(r,a),o.push(()=>{t[n]=r})})})(t.console,t));let c=!1;const l=()=>{c||(c=!0,a(window))};l(),e.attachStartCallback(l),e.attachStopCallback(()=>{c=!1,o.forEach(e=>e()),o.length=0}),e.observer.attachContextCallback(a)}const Uw=/(^|@)\S+:\d+/,zw=/^\s*at .*(\S+:\d+|\(native\))/m,Ww=/^(eval@)?(\[native code\])?$/;function Hw(e){if(!e.includes(":"))return[e,void 0,void 0];const t=/(.+?)(?::(\d+))?(?::(\d+))?$/.exec(e.replace(/[()]/g,""));return[t[1],t[2]||void 0,t[3]||void 0]}function qw(e,t){return e}function Vw(e){return[{columnNumber:e.colno,lineNumber:e.lineno,fileName:e.filename,functionName:"",source:""}]}function Jw(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=t;try{r=function(e){return function(e){if(void 0!==e.stacktrace||void 0!==e["opera#sourceloc"])return!(t=e).stacktrace||t.message.includes("\n")&&t.message.split("\n").length>t.stacktrace.split("\n").length?function(e){const t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[];for(let e=2,s=n.length;e<s;e+=2){const s=t.exec(n[e]);s&&r.push({file:s[2],line:+s[1],raw:n[e]})}return qw(r)}(t):t.stack?function(e){return qw(e.stack.split("\n").filter(e=>!!e.match(Uw)&&!e.match(/^Error created at/))).map(e=>{const t=e.split("@"),n=Hw(t.pop()),r=t.shift()||"",s=r.replace(/<anonymous function(: (\w+))?>/,"$2").replace(/\([^)]*\)/g,"")||void 0;let i;return r.match(/\(([^)]*)\)/)&&(i=r.replace(/^[^(]+\(([^)]*)\)$/,"$1")),{function:s,args:void 0===i||"[arguments not available]"===i?void 0:i.split(","),file:n[0],line:n[1]?+n[1]:void 0,col:n[2]?+n[2]:void 0,raw:e}})}(t):function(e){const t=/Line (\d+).*script (?:in )?(\S+)(?:: In function (\S+))?$/i,n=e.stacktrace.split("\n"),r=[];for(let e=0,s=n.length;e<s;e+=2){const s=t.exec(n[e]);s&&r.push({function:s[3]||void 0,file:s[2],line:s[1]?+s[1]:void 0,raw:n[e]})}return qw(r)}(t);var t;if(e.stack&&e.stack.match(zw))return function(e){return qw(e.stack.split("\n").filter(e=>!!e.match(zw))).map(e=>{e.includes("(eval ")&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^()]*)|(,.*$)/g,""));let t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").replace(/^.*?\s+/,"");const n=t.match(/ (\(.+\)$)/);t=n?t.replace(n[0],""):t;const r=Hw(n?n[1]:t);return{function:n&&t||void 0,file:["eval","<anonymous>"].includes(r[0])?void 0:r[0],line:r[1]?+r[1]:void 0,col:r[2]?+r[2]:void 0,raw:e}})}(e);if(e.stack)return function(e){return qw(e.stack.split("\n").filter(e=>!e.match(Ww))).map(e=>{if(e.includes(" > eval")&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval:\d+:\d+/g,":$1")),e.includes("@")||e.includes(":")){const t=/(([^\n\r"\u2028\u2029]*".[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*(?:@[^\n\r"\u2028\u2029]*"[^\n\r@\u2028\u2029]*)*(?:[\n\r\u2028\u2029][^@]*)?)?[^@]*)@/,n=e.match(t),r=n&&n[1]?n[1]:void 0,s=Hw(e.replace(t,""));return{function:r,file:s[0],line:s[1]?+s[1]:void 0,col:s[2]?+s[2]:void 0,raw:e}}return{function:e}})}(e);throw new Error("Cannot parse given Error object")}(e).map(e=>({functionName:e.function,args:e.args,fileName:e.file,lineNumber:e.line,columnNumber:e.col,source:e.raw}))}(e)}catch(e){}return TS(e.name,e.message,JSON.stringify(r),JSON.stringify(n))}function Kw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(e instanceof ErrorEvent){if(e.error instanceof Error)return Jw(e.error,Vw(e),n);{let[t,r]=e.message.split(":");return r||(t="Error",r=e.message),TS(t,r,JSON.stringify(Vw(e)),JSON.stringify(n))}}if("PromiseRejectionEvent"in t&&e instanceof t.PromiseRejectionEvent){if(e.reason instanceof Error)return Jw(e.reason,[],n);{let t;try{t=JSON.stringify(e.reason)}catch(n){t=String(e.reason)}return TS("Unhandled Promise Rejection",t,"[]",JSON.stringify(n))}}return null}function Gw(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document.location;return(e=e.trim()).startsWith("//")||e.startsWith("http://")||e.startsWith("https://")||e.startsWith("data:")?e:e.startsWith("/")?t.origin+e:t.origin+t.pathname+e}const Xw=["text","password","email","search","number","range","date","tel","time"];function Yw(e){return!!JS(e,"textarea")||!!JS(e,"input")&&Xw.includes(e.type)}const Qw=Rb&&"labels"in HTMLInputElement.prototype?e=>{let t=e;for(;null!==(t=t.parentNode);)if(JS(t,"label"))return t;const n=e.labels;if(null!==n&&1===n.length)return n[0]}:e=>{let t=e;for(;null!==(t=t.parentNode);)if(JS(t,"label"))return t;const n=e.id;if(n){const t=e.ownerDocument.querySelectorAll('label[for="'+n+'"]');if(null!==t&&1===t.length)return t[0]}};function Zw(e,t){const n=Vb(e);if(null!==n)return Bb(n).slice(0,100);const r=Hb(e,t);if(r)return r;if(e.id)return`#${e.id}`;const s=qb(e);if(s)return s;const i=Qw(e);return Bb(e.name||e.placeholder||i&&i.innerText||e.type||"").slice(0,100)}function ek(e,t){const n=Object.assign({obscureInputNumbers:!0,obscureInputEmails:!0,defaultInputMode:1,obscureInputDates:!1},t),r=new Map;function s(t,r){let s=r.value,i=n.defaultInputMode;"password"===r.type||e.sanitizer.isHidden(t)?i=2:(e.sanitizer.isObscured(t)||0===i&&(n.obscureInputNumbers&&"date"!==r.type&&/\d\d\d\d/.test(s)||n.obscureInputDates&&"date"===r.type||n.obscureInputEmails&&("email"===r.type||~s.indexOf("@"))))&&(i=1);let o=0;switch(i){case 2:o=-1,s="";break;case 1:o=s.length,s=""}return{value:s,mask:o}}function i(t,n){const{value:r,mask:i}=s(t,n);e.send(function(e,t,n){return[18,e,t,n]}(t,r,i))}const o=new Map,a=new Map,c=new Map;function l(e,t){o.get(e)!==t.value&&(o.set(e,t.value),i(e,t))}function u(t,n){a.get(t)!==n&&(a.set(t,n),e.send(function(e,t){return[19,e,t]}(t,n)))}function d(e,t){c.get(e)!==t.value&&(c.set(e,t.value),i(e,t))}e.attachStopCallback(()=>{o.clear(),a.clear(),c.clear(),r.clear()}),e.ticker.attach(()=>{o.forEach((t,n)=>{const r=e.nodes.getNode(n);if(!r)return o.delete(n);l(n,r)}),a.forEach((t,n)=>{const r=e.nodes.getNode(n);if(!r)return a.delete(n);u(n,r.checked)}
1),c.forEach((t,n)=>{const r=e.nodes.getNode(n);if(!r)return c.delete(n);d(n,r)})},3),e.attachResanitizeCallback((e,t)=>{(Yw(e)||JS(e,"select"))&&i(t,e)}),e.nodes.attachNodeCallback(e.safe(t=>{const i=e.nodes.getID(t);if(void 0!==i){if(JS(t,"select")&&(d(i,t),e.nodes.attachNodeListener(t,"change",()=>d(i,t))),Yw(t)){l(i,t);let o=0,a=0,c=0;const u=()=>{o=$b()},d=()=>{0===a&&0!==o&&(a=$b()-o)},h=()=>{0!==o&&(c=$b()-o),function(t,i,o,a){const{value:c,mask:l}=s(t,i);let u=function(t,n){const s=r.get(t);if(void 0!==s)return s;const i=e.tagMatcher.match(n);return i?(r.set(t,i.selector),i.selector):null}(t,i)||Zw(i,n.customAttributes);e.sanitizer.privateMode&&(u=u.replaceAll(/./g,"*")),e.send(function(e,t,n,r,s,i){return[112,e,t,n,r,s,i]}(t,c,0!==l,u,o,a))}(i,t,a,c),a=0,c=0,o=0};return e.nodes.attachNodeListener(t,"focus",u),e.nodes.attachNodeListener(t,"input",d),void e.nodes.attachNodeListener(t,"change",h)}return function(e){if(!JS(e,"input"))return!1;const t=e.type;return"checkbox"===t||"radio"===t}(t)?(u(i,t.checked),void e.nodes.attachNodeListener(t,"change",()=>u(i,t.checked))):void 0}}))}const tk="undefined"!=typeof CSS&&CSS.escape||(e=>e),nk=new WeakMap;function rk(e){const t=e.tagName.toUpperCase();return"BUTTON"===t||"A"===t||"LI"===t||"SELECT"===t||"TR"===t||"TH"===t||null!=e.onclick||"button"===e.getAttribute("role")}function sk(e,t){return e instanceof Element?function(e,t){let n=e;for(;null!==n&&n!==t.documentElement;){if(Jb(n,"masked"))return null;n=n.parentElement}if(zS(e)){let t=e.ownerSVGElement;for(;null!==t;)e=t,t=t.ownerSVGElement}for(n=e;null!==n&&n!==t.documentElement;){const e=n.tagName.toUpperCase();if("LABEL"===e)return null;if("INPUT"===e)return n;if(rk(n)||null!==Vb(n))return n;n=n.parentElement}return e===t.documentElement?null:e}(e,t):null}function ik(e,t){const{disableClickmaps:n=!1,customAttributes:r}=t||{};let s,i=-1,o=-1,a=!1,c=null,l=0,u={},d=0,h=0,p=0,f=0;e.attachStartCallback(()=>{s=setInterval(()=>function(){const t=f/225;d?(p>4&&(t-d)/225>.008&&e.send([114,$b()]),f=0,p=0,d=t):d=t}(),225)}),e.attachStopCallback(()=>{i=-1,o=-1,a=!1,c=null,u={},s&&clearInterval(s)});const m=()=>{a&&(e.send(function(e,t){return[20,e,t]}(i,o)),a=!1)},g=function(t){const s=arguments.length>1&&void 0!==arguments[1]&&arguments[1]?e.attachEventListener.bind(e):e.nodes.attachNodeListener.bind(e.nodes);s(t.documentElement,"mouseover",e=>{const n=sk(e.target,t);n!==c&&(c=n,l=performance.now())}),s(t,"mousemove",n=>{const[r,s]=e.observer.getDocumentOffset(t);i=n.clientX+r,o=n.clientY+s,a=!0;const c=Math.sign(n.movementX);f+=Math.abs(n.movementX)+Math.abs(n.movementY),c!==h&&(h=c,p++)},!1),s(t,"click",s=>{const i=sk(s.target,t);if(!s.clientX&&!s.clientY||null===i)return;const o=e.nodes.getID(i);if(void 0!==o){const a=s.pageX,d=s.pageY,h=t.documentElement.scrollWidth,p=t.documentElement.scrollHeight,f=ok(a/h),g=ok(d/p);m();const y=function(t){const n=Vb(t);if(null!==n)return n;if(JS(t,"input"))return Zw(t,r);const s=Hb(t,r);if(s)return s;if(t.id)return`#${t.id}`;const i=qb(t);if(i)return i;if(rk(t)){let n="";return t instanceof HTMLElement&&(n=e.sanitizer.getInnerTextSecure(t)),Bb(n).slice(0,100)}return""}(i);e.send(function(e,t,n,r,s,i){return[68,e,t,n,r,s,i]}(o,c===i?Math.round(performance.now()-l):0,e.sanitizer.privateMode?y.replaceAll(/./g,"*"):y,rk(i)&&!n?function(t,n){if(u[t])return u[t];const r=e.tagMatcher.match(n);return u[t]=r?r.selector:function(e){return function(e){if(!e||1!==e.nodeType)return!1;if(e.id)return`#${tk(e.id)}`;const t=Array.from(e.attributes).find(e=>e.name.startsWith("data-"));if(t)return`[${t.name}="${tk(t.value)}"]`;const n=[];for(;e&&1===e.nodeType&&e!==e.ownerDocument;){var r;if(e.id){n.unshift(`#${tk(e.id)}`);break}const t=e.tagName.toLowerCase();if(null!==(r=e.classList)&&void 0!==r&&r.length)for(const r of e.classList)if(ck(r)&&ak(r,e.ownerDocument))return n.unshift(`${t}.${tk(r)}`),n.join(" > ");const s=lk(e);if(s)n.unshift(`${t}.${tk(s)}`);else if(e===e.ownerDocument.body||e===e.ownerDocument.documentElement)n.unshift(t);else{let r=1;for(let n=e.previousElementSibling;n;n=n.previousElementSibling)n.tagName.toLowerCase()===t&&r++;n.unshift(`${t}:nth-of-type(${r})`)}e=e.parentNode}return n.join(" > ")}(e)||""}(n)}(o,i):"",f,g),!0)}c=null})};e.nodes.attachNodeCallback(e=>{qS(e)&&g(e)}),g(document,!0),e.ticker.attach(m,(null==t?void 0:t.trackingOffset)||7)}function ok(e){return Math.round(1e4*e)}function ak(e,t){let n=nk.get(t);if(n||(n=Object.create(null),nk.set(t,n)),e in n)return n[e];const r=1===t.querySelectorAll(`.${tk(e)}`).length;return n[e]=r,r}function ck(e){if(/^[a-z\-]{3,}$/i.test(e)){const t=e.split(/-|[A-Z]/);for(const e of t){if(e.length<=2)return!1;if(/[^aeiou]{4,}/i.test(e))return!1}return!0}return!1}function lk(e){var t;if(null===(t=e.classList)||void 0===t||!t.length||!e.parentNode)return null;const n=e.parentNode.children;e:for(const t of e.classList)if(ck(t)&&ak(t,e.ownerDocument)){for(const s of n){var r;if(s!==e&&null!==(r=s.classList)&&void 0!==r&&r.contains(t))continue e}return t}return null}let uk=-1;const dk=e=>{addEventListener("pageshow",t=>{t.persisted&&(uk=t.timeStamp,e(t))},!0)},hk=(e,t,n,r)=>{let s,i;return o=>{t.value>=0&&(o||r)&&(i=t.value-(s??0),(i||void 0===s)&&(s=t.value,t.delta=i,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},pk=e=>{requestAnimationFrame(()=>requestAnimationFrame(()=>e()))},fk=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},mk=()=>{const e=fk();return(null==e?void 0:e.activationStart)??0},gk=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:-1;const n=fk();let r="navigate";return uk>=0?r="back-forward-cache":n&&(document.prerendering||mk()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},yk=new WeakMap;function vk(e,t){return yk.get(e)||yk.set(e,new t),yk.get(e)}class _k{constructor(){Eb(this,"t",void 0),Eb(this,"i",0),Eb(this,"o",[])}h(e){var t;if(e.hadRecentInput)return;const n=this.o[0],r=this.o.at(-1);this.i&&n&&r&&e.startTime-r.startTime<1e3&&e.startTime-n.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),null===(t=this.t)||void 0===t||t.call(this,e)}}const bk=function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver(e=>{Promise.resolve().then(()=>{t(e.getEntries())})});return r.observe({type:e,buffered:!0,...n}),r}}catch{}},Sk=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let wk=-1;const kk=new Set,Tk=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,Ek=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of kk)e();isFinite(wk)||(wk="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",Ek,!0))}},xk=()=>
1{if(wk<0){var e;const t=mk(),n=document.prerendering||null===(e=globalThis.performance.getEntriesByType("visibility-state").filter(e=>"hidden"===e.name&&e.startTime>t)[0])||void 0===e?void 0:e.startTime;wk=n??Tk(),addEventListener("visibilitychange",Ek,!0),addEventListener("prerenderingchange",Ek,!0),dk(()=>{setTimeout(()=>{wk=Tk()})})}return{get firstHiddenTime(){return wk},onHidden(e){kk.add(e)}}},Ik=e=>{document.prerendering?addEventListener("prerenderingchange",()=>e(),!0):e()},Ck=[1800,3e3],Ok=[.1,.25];let Ak=0,Mk=1/0,Rk=0;const Nk=e=>{for(const t of e)t.interactionId&&(Mk=Math.min(Mk,t.interactionId),Rk=Math.max(Rk,t.interactionId),Ak=Rk?(Rk-Mk)/7+1:0)};let Pk;const Lk=()=>Pk?Ak:performance.interactionCount??0;let Dk=0;class $k{constructor(){Eb(this,"u",[]),Eb(this,"l",new Map),Eb(this,"m",void 0),Eb(this,"p",void 0)}v(){Dk=Lk(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((Lk()-Dk)/50));return this.u[e]}h(e){var t;if(null!==(t=this.m)&&void 0!==t&&t.call(this,e),!e.interactionId&&"first-input"!==e.entryType)return;const n=this.u.at(-1);let r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>n.P){var s;if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),this.u.sort((e,t)=>t.P-e.P),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}null===(s=this.p)||void 0===s||s.call(this,r)}}}const jk=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=Sk(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t(()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})}))},Bk=[200,500];class Fk{constructor(){Eb(this,"m",void 0)}h(e){var t;null===(t=this.m)||void 0===t||t.call(this,e)}}const Uk=[2500,4e3],zk=[800,1800],Wk=e=>{document.prerendering?Ik(()=>Wk(e)):"complete"!==document.readyState?addEventListener("load",()=>Wk(e),!0):setTimeout(e)};function Hk(e,t){const n=Object.assign({captureResourceTimings:!0,capturePageLoadTimings:!0,capturePageRenderTimings:!0,excludedResourceUrls:[]},t);if("PerformanceObserver"in window||(n.captureResourceTimings=!1),!n.captureResourceTimings)return;let r={};function s(t){var s;if(t.duration<0||!Fb(t.name)||e.isServiceURL(t.name))return;null!==r&&(r[t.name]=t.startTime+t.duration);let i=!1;if(null===(s=n.excludedResourceUrls)||void 0===s||s.forEach(e=>{t.name.startsWith(e)&&(i=!0)}),i)return;let o=0;o=t.connectEnd&&t.connectEnd>t.domainLookupEnd?Math.max(0,t.requestStart-t.connectEnd):Math.max(0,t.requestStart-t.domainLookupEnd);const a={queueing:t.requestStart-t.fetchStart,dnsLookup:t.domainLookupEnd-t.domainLookupStart,initialConnection:t.connectEnd-t.connectStart,ssl:t.secureConnectionStart>0?t.connectEnd-t.secureConnectionStart:0,ttfb:t.responseStart-t.requestStart,contentDownload:t.responseEnd-t.responseStart,total:t.duration??t.responseEnd-t.startTime,stalled:o},c=n.resourceNameSanitizer?n.resourceNameSanitizer(t.name):t.name,l=t.responseStatus&&304===t.responseStatus||t.deliveryType&&"cache"===t.deliveryType||0===t.transferSize&&t.decodedBodySize>0,u=t.responseStatus&&t.responseStatus>=400?-111:t.decodedBodySize||0;e.send(xS(t.startTime+Db(),t.duration,a.ttfb,t.transferSize>t.encodedBodySize?t.transferSize-t.encodedBodySize:0,t.encodedBodySize||0,u,e.sanitizer.privateMode?t.name.replaceAll(/./g,"*"):c,t.initiatorType,t.transferSize,l,a.queueing,a.dnsLookup,a.initialConnection,a.ssl,a.contentDownload,a.total,a.stalled))}const i=new PerformanceObserver(e=>e.getEntries().forEach(s));function o(t){if(e.active())return e.send((n=t.name,r=String(t.value),[124,n,r]));var n,r}e.attachStartCallback(function(e){let{sessionID:t}=e;i.observe({type:"resource",buffered:!0}),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=xk();!function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ik(()=>{const n=xk();let r,s=gk("FCP");const i=bk("paint",e=>{for(const t of e)"first-contentful-paint"===t.name&&(i.disconnect(),t.startTime<n.firstHiddenTime&&(s.value=Math.max(t.startTime-mk(),0),s.entries.push(t),r(!0)))});i&&(r=hk(e,s,Ck,t.reportAllChanges),dk(n=>{s=gk("FCP"),r=hk(e,s,Ck,t.reportAllChanges),pk(()=>{s.value=performance.now()-n.timeStamp,r(!0)})}))})}(Sk(()=>{let r,s=gk("CLS",0);const i=vk(t,_k),o=e=>{for(const t of e)i.h(t);i.i>s.value&&(s.value=i.i,s.entries=i.o,r())},a=bk("layout-shift",o);a&&(r=hk(e,s,Ok,t.reportAllChanges),n.onHidden(()=>{o(a.takeRecords()),r(!0)}),dk(()=>{i.i=0,s=gk("CLS",0),r=hk(e,s,Ok,t.reportAllChanges),pk(()=>r())}),setTimeout(r))}))}(o),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=xk();Ik(()=>{"interactionCount"in performance||Pk||(Pk=bk("event",Nk,{type:"event",buffered:!0,durationThreshold:0}));let r,s=gk("INP");const i=vk(t,$k),o=e=>{jk(()=>{for(const t of e)i.h(t);const t=i.L();t&&t.P!==s.value&&(s.value=t.P,s.entries=t.entries,r())})},a=bk("event",o,{durationThreshold:t.durationThreshold??40});r=hk(e,s,Bk,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden(()=>{o(a.takeRecords()),r(!0)}),dk(()=>{i.v(),s=gk("INP"),r=hk(e,s,Bk,t.reportAllChanges)}))})}(o),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Ik(()=>{const n=xk();let r,s=gk("LCP");const i=vk(t,Fk),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)i.h(t),t.startTime<n.firstHiddenTime&&(s.value=Math.max(t.startTime-mk(),0),s.entries=[t],r())},a=bk("largest-contentful-paint",o);if(a){r=hk(e,s,Uk,t.reportAllChanges);const n=Sk(()=>{o(a.takeRecords()),a.disconnect(),r(!0)}),i=e=>{e.isTrusted&&(jk(n),removeEventListener(e.type,i,{capture:!0}))};
1for(const e of["keydown","click","visibilitychange"])addEventListener(e,i,{capture:!0});dk(n=>{s=gk("LCP"),r=hk(e,s,Uk,t.reportAllChanges),pk(()=>{s.value=performance.now()-n.timeStamp,r(!0)})})}})}(o),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=gk("TTFB"),r=hk(e,n,zk,t.reportAllChanges);Wk(()=>{const s=fk();s&&(n.value=Math.max(s.responseStart-mk(),0),n.entries=[s],r(!0),dk(()=>{n=gk("TTFB",0),r=hk(e,n,zk,t.reportAllChanges),r(!0)}))})}(o)}),e.attachStopCallback(function(){i.disconnect()});let a=0,c=0;if(n.capturePageLoadTimings){let t=!1;e.ticker.attach(()=>{if(!t&&(0!==a&&0!==c||performance.getEntriesByType("paint").forEach(e=>{const{name:t,startTime:n}=e;switch(t){case"first-paint":a=n;break;case"first-contentful-paint":c=n}}),performance.timing.loadEventEnd||performance.now()>3e4)){t=!0;const{navigationStart:n,requestStart:r,responseStart:s,responseEnd:i,domContentLoadedEventStart:o,domContentLoadedEventEnd:l,loadEventStart:u,loadEventEnd:d}=performance.timing;e.send(function(e,t,n,r,s,i,o,a,c){return[23,e,t,n,r,s,i,o,a,c]}(r-n||0,s-n||0,i-n||0,o-n||0,l-n||0,u-n||0,d-n||0,a,c))}},30)}if(n.capturePageRenderTimings){let t=0,n=0,s=0,i=null,o=!1;e.ticker.attach(()=>{if(o)return;const l=performance.now();if(null!==r&&(t=Math.max.apply(null,Object.keys(r).map(e=>r[e])),l-t>1e3&&(i=function(e){const t=[],n=document.getElementsByTagName("*"),r=/url\(("[^"]*"|'[^']*'|[^)]*)\)/i;for(let s=0;s<n.length;s++){const i=n[s];let o="";if(JS(i,"img")&&(o=i.currentSrc||i.src),!o){const e=getComputedStyle(i).getPropertyValue("background-image");if(e){const t=r.exec(e);null!==t&&(o=t[1],(o.startsWith('"')||o.startsWith("'"))&&(o=o.substr(1,o.length-2)))}}if(!o)continue;const a="data:image"===o.substr(0,10)?0:e[o];if(void 0===a)continue;const c=i.getBoundingClientRect(),l=Math.max(c.top,0),u=Math.max(c.left,0),d=Math.min(c.bottom,window.innerHeight||document.documentElement&&document.documentElement.clientHeight||0),h=Math.min(c.right,window.innerWidth||document.documentElement&&document.documentElement.clientWidth||0);if(d<=l||h<=u)continue;const p=(d-l)*(h-u);t.push({time:a,area:p})}return t}(r),r=null)),null!==s&&(l-s>50&&(n=l),s=l-n>5e3?null:l),null!==i&&null===s||l>3e4){o=!0,r=null;const l=null===i?0:function(e,t){let n=Math.max(document.documentElement&&document.documentElement.clientWidth||0,window.innerWidth||0)*Math.max(document.documentElement&&document.documentElement.clientHeight||0,window.innerHeight||0)/10,r=n*e;for(let s=0;s<t.length;s++){const{time:i,area:o}=t[s];n+=o,r+=o*(i>e?i:e)}return 0===n?0:r/n}(c||a,i),{domContentLoadedEventEnd:u,navigationStart:d}=performance.timing,h=null===s?Math.max(n,c,u-d||0):0;e.send(function(e,t,n){return[24,e,t,n]}(l,c>t?c:t,h))}})}}function qk(e){const t=e.defaultView;return[t&&t.scrollX||e.documentElement&&e.documentElement.scrollLeft||e.body&&e.body.scrollLeft||0,t&&t.scrollY||e.documentElement&&e.documentElement.scrollTop||e.body&&e.body.scrollTop||0]}const Vk=e=>{const t=["jwt","password","reset-password","invitation","secret","token"];try{const n=new URL(e);return n.searchParams.forEach((e,r)=>{t.includes(r.toLowerCase())&&n.searchParams.set(r,"*".repeat(e.length))}),n.toString()}catch{return e}},Jk={checkCssInterval:200,scanInMemoryCSS:!1,checkLimit:void 0};const Kk=new Set(["password","pass","pwd","mdp","token","bearer","jwt","api_key","api-key","apiKey","secret","ssn","zip","zipcode","x-api-key","www-authenticate","x-csrf-token","x-requested-with","x-forwarded-for","x-real-ip","cookie","authorization","auth","proxy-authorization","set-cookie","account_key"]);function Gk(e){if("number"==typeof e){const t=function(e){return 1+(0|Math.log10((e^e>>31)-(e>>31)))}(e);return"9".repeat(t)}return"string"==typeof e?e.replace(/[^\f\n\r\t\v\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff\s]/g,"*"):e}function Xk(e){const t={};if(Array.isArray(e))e.forEach(e=>{let{name:n,value:r}=e;Kk.has(n.toLowerCase())?t[n]=Gk(r):t[n]=r});else for(const[n,r]of Object.entries(e))Kk.has(n.toLowerCase())?t[n]=Gk(r):t[n]=r;return t}function Yk(e){if(!e)return e;let t,n=!1;try{t=JSON.parse(e),n=!0}catch(e){}if(n)return Qk(t),JSON.stringify(t);if("string"!=typeof e||!e.includes("?")||!e.includes("="))return e;try{const t=new URLSearchParams(e);for(const e of t.keys())if(Kk.has(e.toLowerCase())){const n=Gk(t.get(e));t.set(e,n)}return t.toString()}catch(t){return e}}function Qk(e){if(Array.isArray(e))e.forEach(Qk);else if(e&&"object"==typeof e)for(const t in e)Object.hasOwn(e,t)&&(Kk.has(t.toLowerCase())?e[t]=Gk(e[t]):null!==e[t]&&"object"==typeof e[t]&&Qk(e[t]))}function Zk(e){if(!e)return"";try{const t=new URL(e);if(t.searchParams)for(const e of t.searchParams.keys())Kk.has(e.toLowerCase())&&t.searchParams.set(e,"******");return t.toString()}catch(t){return e}}class eT{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0;this.ignoredHeaders=e,this.setSessionTokenHeader=t,this.sanitize=n,this.id="",this.name="",this.method="",this.url="",this.status=0,this.statusText="",this.cancelState=0,this.readyState=0,this.header={},this.responseType="",this.requestType="xhr",this.requestHeader={},this.responseSize=0,this.responseSizeText="",this.startTime=0,this.endTime=0,this.duration=0,this.getData={},this.requestData=null}getMessage(){const{reqHs:e,resHs:t}=this.writeHeaders(),n="GET"===this.method?JSON.stringify((Qk(r=this.getData),r)):Yk(this.requestData);var r;const s={headers:Xk(e),body:n},i={headers:Xk(t),body:Yk(this.response)},o=this.sanitize({url:Zk(this.url),method:this.method,status:this.status,request:s,response:i});if(!o)return null;const a=o.url.includes("/graphql")||Object.values(o.request.headers).some(e=>e&&"string"==typeof e&&e.includes("application/graphql-response"));if(a&&o.response.body&&"string"==typeof o.response.body){const e=o.response.body.includes("errors");o.status=e?400:200,this.requestType="graphql"}return{requestType:this.requestType,method:o.method,url:o.url,request:JSON.stringify(o.request),response:JSON.stringify(o.response),status:o.status,startTime:this.startTime,duration:this.duration,responseSize:this.responseSize}}writeHeaders(){const e={};Object.entries(this.requestHeader).forEach(t=>{let[n,r]=t;this.isHeaderIgnored(n)||(e[n]=r)}),this.setSessionTokenHeader((t,n)=>{e[t]=n});const t={};
1return Object.entries(this.header).forEach(e=>{let[n,r]=e;this.isHeaderIgnored(n)||(t[n]=r)}),{reqHs:e,resHs:t}}isHeaderIgnored(e){return Array.isArray(this.ignoredHeaders)?this.ignoredHeaders.map(e=>e.toLowerCase()).includes(e.toLowerCase()):this.ignoredHeaders}}const tT=(e,t)=>{let n="";switch(e){case"":case"text":case"json":"string"==typeof t?n=t:rT(t)||Array.isArray(t)?n=JSON.stringify(t):void 0!==t&&(n=Object.prototype.toString.call(t));break;default:void 0!==t&&(n=Object.prototype.toString.call(t))}return n},nT=e=>{if(!e)return null;let t;try{if("string"==typeof e){"{"!==e[0]&&"["!==e[0]||(t=e);const n=e.split("&");t=1===n.length?e:n.join(",")}else if(null==(n=e)||ArrayBuffer.isView(n)||"undefined"==typeof Symbol||"function"!=typeof n[Symbol.iterator])t=e instanceof Blob||e instanceof ReadableStream||ArrayBuffer.isView(e)||e instanceof ArrayBuffer?"byte data":rT(e)?e:"can't parse body "+typeof e;else{const n=[];for(const[t,r]of e)n.push(`${t}=${"string"==typeof r?r:"[object Object]"}`);t=n.join(",")}return t}catch(e){return"can't parse body"}var n};function rT(e){return null!==e&&"object"==typeof e}function sT(e){return e<=0?"":e>=1e6?(e/1e3/1e3).toFixed(1)+" MB":e>=1e3?(e/1e3).toFixed(1)+" KB":`${e}B`}const iT=e=>(e.startsWith("//")&&(e=`${new URL(window.location.href).protocol}${e}`),e.startsWith("http")?new URL(e):new URL(e,window.location.href)),oT=e=>e instanceof Blob?e.type:e instanceof FormData?"multipart/form-data":e instanceof URLSearchParams?"application/x-www-form-urlencoded;charset=UTF-8":"text/plain;charset=UTF-8";class aT{constructor(e,t,n,r,s){this.ignoredHeaders=e,this.setSessionTokenHeader=t,this.sanitize=n,this.sendMessage=r,this.isServiceUrl=s}apply(e,t,n){const r=n[0],s=n[1],i=new eT(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);if(this.isServiceUrl(r))return e.apply(t,n);const o=iT(r);if(i.method="POST",i.url=r,i.name=(o.pathname.split("/").pop()||"")+o.search,i.requestType="beacon",i.requestHeader={"Content-Type":oT(s)},i.status=0,i.statusText="Pending",o.search&&o.searchParams){i.getData={};for(const[e,t]of o.searchParams)i.getData[e]=t}i.requestData=nT(s),i.startTime||(i.startTime=performance.now());const a=e.apply(t,n);a?(i.endTime=performance.now(),i.duration=i.endTime-(i.startTime||i.endTime),i.status=0,i.statusText="Sent",i.readyState=4):(i.status=500,i.statusText="Unknown");const c=i.getMessage();return c&&this.sendMessage(c),a}}class cT{static create(e,t,n,r,s,i){if(e)return new Proxy(e,new aT(t,n,r,s,i))}}class lT{constructor(e,t){this.resp=e,this.item=t}set(e,t,n){return Reflect.set(e,t,n)}get(e,t){const n=Reflect.get(e,t);if("arrayBuffer"===t||"blob"===t)return"function"==typeof n?n.bind(e):n;switch(t){case"formData":case"json":case"text":return()=>(this.item.responseType=t.toLowerCase(),n.apply(e).then(e=>(this.item.response=tT(this.item.responseType,e),e)))}return"function"==typeof n?n.bind(e):n}}class uT{constructor(e,t,n,r,s,i){this.ignoredHeaders=e,this.setSessionTokenHeader=t,this.sanitize=n,this.sendMessage=r,this.isServiceUrl=s,this.tokenUrlMatcher=i}apply(e,t,n){var r;const s=n[0],i=n[1];if(!s||"string"!=typeof s&&!(null==s?void 0:s.url))return e.apply(window,n);if(s instanceof URL||"string"==typeof s?this.isServiceUrl(String(s)):this.isServiceUrl(String(s.url)))return e.apply(window,n);const o=new eT(this.ignoredHeaders,this.setSessionTokenHeader,this.sanitize);this.beforeFetch(o,s,i);const a=(n[0]instanceof Request?n[0].signal:void 0)||(null===(r=n[1])||void 0===r?void 0:r.signal);let c=!1;const l=()=>{if(c)return;c=!0,o.endTime=performance.now(),o.duration=o.endTime-(o.startTime||o.endTime),o.status=0,o.statusText="Aborted",o.readyState=0;const e=o.getMessage();e&&this.sendMessage(e)};return a&&(a.aborted?l():a.addEventListener("abort",l,{once:!0})),this.setSessionTokenHeader((e,t)=>{if(void 0===this.tokenUrlMatcher||this.tokenUrlMatcher(o.url))return void 0===n[1]&&n[0]instanceof Request?n[0].headers.append(e,t):(n[1]||(n[1]={}),void 0===n[1].headers&&(n[1]=Object.assign(Object.assign({},n[1]),{headers:{}})),void(n[1].headers instanceof Headers?n[1].headers.append(e,t):Array.isArray(n[1].headers)?n[1].headers.push([e,t]):n[1].headers[e]=t))}),e.apply(window,n).then(this.afterFetch(o,()=>{c=!0}
1)).catch(e=>{if(o.endTime=performance.now(),o.duration=o.endTime-(o.startTime||o.endTime),e&&"AbortError"===e.name&&(o.status=0,o.statusText="Aborted",o.readyState=0,!c)){const e=o.getMessage();e&&this.sendMessage(e)}throw e})}beforeFetch(e,t,n){let r,s="GET",i={};if("string"==typeof t?(s=(null==n?void 0:n.method)||"GET",r=iT(t),i=(null==n?void 0:n.headers)||{}):(s=t.method||"GET",r=iT(t.url),i=t.headers),e.method=s,e.requestType="fetch",e.requestHeader=i,e.url=r.toString(),e.name=(r.pathname.split("/").pop()||"")+r.search,e.status=0,e.statusText="Pending",e.readyState=1,e.startTime||(e.startTime=performance.now()),"[object Headers]"===Object.prototype.toString.call(i)){e.requestHeader={};for(const[t,n]of i)e.requestHeader[t]=n}else e.requestHeader=i;if(r.search&&r.searchParams){e.getData={};for(const[t,n]of r.searchParams)e.getData[t]=n}(null==n?void 0:n.body)&&(e.requestData=nT(n.body))}afterFetch(e,t){return n=>{t&&(null==t||t()),e.endTime=performance.now(),e.duration=e.endTime-(e.startTime||e.endTime),e.status=n.status,e.statusText=String(n.status);let r=!1;e.header={};for(const[t,s]of n.headers)e.header[t]=s,r=s.toLowerCase().indexOf("chunked")>-1||r;r?e.readyState=3:(e.readyState=4,this.handleResponseBody(n.clone(),e).then(t=>{e.responseSize="string"==typeof t?t.length:t.byteLength,e.responseSizeText=sT(e.responseSize),e.response=tT(e.responseType,t);const n=e.getMessage();n&&this.sendMessage(n)}).catch(t=>{if("AbortError"!==t.name)throw t;{e.status=0,e.statusText="Aborted",e.readyState=0;const t=e.getMessage();t&&this.sendMessage(t)}}));const s=(n.headers.get("content-type")||"").toLowerCase();return s.includes("application/json")||s.startsWith("text/")?new Proxy(n,new lT(n,e)):n}}handleResponseBody(e,t){const n=e.headers.get("content-type");return n&&n.includes("application/json")?(t.responseType="json",e.text()):n&&(n.includes("text/html")||n.includes("text/plain"))?(t.responseType="text",e.text()):(t.responseType="arraybuffer",e.arrayBuffer())}}class dT{static create(e,t,n,r,s,i){return new Proxy(fetch,new uT(e,t,n,r,s,i))}}var hT;!function(e){e[e.UNSENT=0]="UNSENT",e[e.OPENED=1]="OPENED",e[e.HEADERS_RECEIVED=2]="HEADERS_RECEIVED",e[e.LOADING=3]="LOADING",e[e.DONE=4]="DONE"}(hT||(hT={}));class pT{constructor(e,t,n,r,s,i,o){this.ignoredHeaders=t,this.setSessionTokenHeader=n,this.sanitize=r,this.sendMessage=s,this.isServiceUrl=i,this.tokenUrlMatcher=o,this.XMLReq=e,this.XMLReq.onreadystatechange=()=>{this.onReadyStateChange()},this.XMLReq.onabort=()=>{this.onAbort()},this.XMLReq.ontimeout=()=>{this.onTimeout()},this.item=new eT(t,n,r),this.item.requestType="xhr"}get(e,t){switch(t){case"open":return this.getOpen(e);case"send":return this.setSessionTokenHeader((t,n)=>{(void 0===this.tokenUrlMatcher||this.tokenUrlMatcher(this.item.url))&&1===e.readyState&&e.setRequestHeader(t,n)}),this.getSend(e);case"setRequestHeader":return this.getSetRequestHeader(e);default:const n=Reflect.get(e,t);return"function"==typeof n?n.bind(e):n}}set(e,t,n){switch(t){case"onreadystatechange":return this.setOnReadyStateChange(e,t,n);case"onabort":return this.setOnAbort(e,t,n);case"ontimeout":return this.setOnTimeout(e,t,n)}return Reflect.set(e,t,n)}onReadyStateChange(){if(this.item.url&&this.isServiceUrl(this.item.url))return;this.item.readyState=this.XMLReq.readyState,this.item.responseType=this.XMLReq.responseType,this.item.endTime=performance.now(),this.item.duration=this.item.endTime-this.item.startTime,this.updateItemByReadyState();const e=this.item.responseType||"";if(""!==e&&"text"!==e&&"json"!==e||setTimeout(()=>{this.item.response=tT(e,this.XMLReq.response)},0),this.XMLReq.readyState===hT.DONE){const e=this.item.getMessage();e&&this.sendMessage(e)}}onAbort(){this.item.cancelState=1,this.item.statusText="Abort";const e=this.item.getMessage();e&&this.sendMessage(e)}onTimeout(){this.item.cancelState=3,this.item.statusText="Timeout";const e=this.item.getMessage();e&&this.sendMessage(e)}getOpen(e){var t=this;const n=Reflect.get(e,"open");return function(){for(var r,s,i,o=arguments.length,a=new Array(o),c=0;c<o;c++)a[c]=arguments[c];const l=a[0],u=a[1];return t.item.method=l?l.toUpperCase():"GET",t.item.url=(null===(r=u.toString)||void 0===r?void 0:r.call(u))||"",t.item.name=null!==(i=null===(s=t.item.url)||void 0===s?void 0:s.replace(new RegExp("/*$"),"").split("/").pop())&&void 0!==i?i:"",t.item.getData=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};rT(t)||(t={});let n=e?e.split("?"):[];if(n.shift(),n.length>0){n=n.join("?").split("&");for(const e of n){const n=e.split("=");try{t[n[0]]=decodeURIComponent(n[1])}catch(e){t[n[0]]=n[1]}}}return t}(t.item.url,{}),n.apply(e,a)}}getSend(e){var t=this;const n=Reflect.get(e,"send");return function(){for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];const o=s[0];return t.item.requestData=nT(o),n.apply(e,s)}}getSetRequestHeader(e){var t=this;const n=Reflect.get(e,"setRequestHeader");return function(){t.item.requestHeader||(t.item.requestHeader={});for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return t.item.requestHeader[s[0]]=s[1],n.apply(e,s)}}setOnReadyStateChange(e,t,n){var r=this;return Reflect.set(e,t,function(){r.onReadyStateChange();for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];null==n||n.apply(e,s)})}setOnAbort(e,t,n){var r=this;return Reflect.set(e,t,function(){r.onAbort();for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];n.apply(e,s)})}setOnTimeout(e,t,n){var r=this;return Reflect.set(e,t,function(){r.onTimeout();for(var t=arguments.length,s=new Array(t),i=0;i<t;i++)s[i]=arguments[i];n.apply(e,s)})}updateItemByReadyState(){switch(this.XMLReq.readyState){case hT.UNSENT:case hT.OPENED:this.item.status=hT.UNSENT,this.item.statusText="Pending",this.item.startTime||(this.item.startTime=performance.now());break;case hT.HEADERS_RECEIVED:this.item.status=this.XMLReq.status,this.item.statusText="Loading",this.item.header={};const e=(this.XMLReq.getAllResponseHeaders()||"").split("\n");for(let t=0;t<e.length;t++){const n=e[t];if(!n)continue;const r=n.split(": "),s=r[0];this.item.header[s]=r.slice(1).join(": ")}break;case hT.LOADING:this.item.status=this.XMLReq.status,this.item.statusText="Loading";const t=this.XMLReq.response;if(t){const e="string"==typeof t?t.length:t instanceof ArrayBuffer?t.byteLength:"undefined"!=typeof Blob&&t instanceof Blob?t.size:0;e&&(this.item.responseSize=e,this.item.responseSizeText=sT(this.item.responseSize))}break;case hT.DONE:this.item.status=this.XMLReq.status||this.item.status||0,this.item.statusText=String(this.item.status),this.item.endTime=performance.now(),this.item.duration=this.item.endTime-(this.item.startTime||this.item.endTime);const n=this.XMLReq.response,r=this.XMLReq.responseType||"";if(""!==r&&"text"!==r&&"json"!==r||(this.item.response=n),n){const e="string"==typeof n?n.length:n instanceof ArrayBuffer?n.byteLength:"undefined"!=typeof Blob&&n instanceof Blob?n.size:0;e&&(this.item.responseSize=e,this.item.responseSizeText=sT(e))}break;default:this.item.status=this.XMLReq.status,this.item.statusText="Unknown"}}}class fT{static create(e,t,n,r,s,i){return new Proxy(XMLHttpRequest,{construct(o){const a=new o;return new Proxy(a,new pT(a,e,t,n,r,s,i))}})}}const mT=e=>{const t=`Openreplay: Can't find ${e} in global context.`;console.warn(t)},gT=Symbol("OpenReplayProxyOriginal"),yT=e=>(e=>!!e&&void 0!==e[gT])(e)?e[gT]:e,vT=(e,t)=>
1(e[gT]=t,e);function _T(e){return e.__or_req_data__||(e.__or_req_data__={body:void 0,headers:{}}),e.__or_req_data__}function bT(e){return"string"==typeof e?e.toUpperCase():"GET"}function ST(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(t.disabled)return;const n=Object.assign({failuresOnly:!1,ignoreHeaders:["cookie","set-cookie","authorization"],capturePayload:!1,sessionTokenHeader:!1,captureInIframes:!0,axiosInstances:void 0,useProxy:!0},t);!1===n.useProxy&&e.debug.warn("Network module is migrating to proxy api, to gradually migrate and test it set useProxy to true");const r=n.ignoreHeaders,s=Array.isArray(r)?e=>r.includes(e):()=>r,i=!0===n.sessionTokenHeader?"X-OpenReplay-SessionToken":n.sessionTokenHeader;function o(t){if(i){const n=e.getSessionToken();n&&e.safe(t)(i,n)}}function a(t){if(n.capturePayload&&!e.sanitizer.privateMode||(delete t.request.body,delete t.response.body),n.sanitizer){const e=t.response.body;if("string"==typeof e)try{t.response.body=JSON.parse(e)}catch{}return n.sanitizer(t)}return t}function c(t){if(t&&"string"!=typeof t.body)try{t.body=JSON.stringify(t.body)}catch{t.body="<unable to stringify>",e.notify.warn("Openreplay fetch couldn't stringify body:",t.body)}return JSON.stringify(t)}const l=t=>{if(n.useProxy)return function(e,t,n,r,s,i){let o=arguments.length>6&&void 0!==arguments[6]?arguments[6]:{xhr:!0,fetch:!0,beacon:!0},a=arguments.length>7?arguments[7]:void 0;var c;if(e){if(o.xhr){const o=yT(e.XMLHttpRequest);o?e.XMLHttpRequest=vT(fT.create(t,n,r,s,i,a),o):mT("XMLHttpRequest")}if(o.fetch){const o=yT(e.fetch);o?e.fetch=vT(dT.create(t,n,r,s,i,a),o):mT("fetch")}if(o.beacon&&(null===(c=e.navigator)||void 0===c?void 0:c.sendBeacon)){const o=yT(e.navigator.sendBeacon);e.navigator.sendBeacon=vT(cT.create(o,t,n,r,s,i),o)}}}(t,!!e.sanitizer.privateMode||n.ignoreHeaders,o,a,t=>{if(n.failuresOnly&&t.status<400)return;const r=e.sanitizer.privateMode?"************":t.url;e.send(ES(t.requestType,t.method,r,t.request,t.response,t.status,t.startTime+Db(),t.duration,t.responseSize))},t=>e.isServiceURL(t),{xhr:!0,fetch:!0,beacon:!0},n.tokenUrlMatcher);const i=t.fetch.bind(t);t.fetch=function(t){let l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!("string"==typeof t||t instanceof URL)||e.isServiceURL(String(t)))return i(t,l);o(function(e,t){void 0===l.headers&&(l.headers={}),l.headers instanceof Headers?l.headers.append(e,t):Array.isArray(l.headers)?l.headers.push([e,t]):l.headers[e]=t});const u=performance.now();return i(t,l).then(i=>{const o=performance.now()-u;if(n.failuresOnly&&i.status<400)return i;const d=i.clone();return d.text().then(n=>{const i={},h={};if(!0!==r){const e=e=>{let[t,n]=e;s(t)||(i[t]=n)};l.headers instanceof Headers?l.headers.forEach((t,n)=>e([n,t])):Array.isArray(l.headers)?l.headers.forEach(e):"object"==typeof l.headers&&Object.entries(l.headers).forEach(e),d.headers.forEach((e,t)=>{s(t)||(h[t]=e)})}const p=bT(l.method),f=a({url:String(t),method:p,status:d.status,request:{headers:i,body:l.body||null},response:{headers:h,body:n}});f&&e.send(ES("fetch",p,String(f.url),c(f.request),c(f.response),d.status,u+Db(),o,0))}).catch(t=>e.debug.error("Could not process Fetch response:",t)),i})};const l=t.XMLHttpRequest.prototype.open,u=t.XMLHttpRequest.prototype.setRequestHeader,d=t.XMLHttpRequest.prototype.send;n.axiosInstances||(t.XMLHttpRequest.prototype.open=function(t,n){const r=this;o((e,t)=>r.setRequestHeader(e,t));let i=0;return r.addEventListener("loadstart",e=>{i=e.timeStamp}),r.addEventListener("load",e.safe(o=>{const{headers:l,body:u}=_T(r),d=i>0?o.timeStamp-i:0,h=(r.getAllResponseHeaders()||"").trim().split(/[\r\n]+/),p={};h.forEach(function(e){const t=e.split(": "),n=t.shift();s(n)||(p[n]=t.join(": "))});const f=bT(t),m=a({url:String(n),method:f,status:r.status,request:{headers:l,body:u||null},response:{headers:p,body:r.response}});m&&e.send(ES("xhr",f,String(m.url),c(m.request),c(m.response),r.status,i+Db(),d,0))})),l.apply(this,arguments)},t.XMLHttpRequest.prototype.send=function(e){return _T(this).body=e,d.apply(this,arguments)},t.XMLHttpRequest.prototype.setRequestHeader=function(e,t){return s(e)||(_T(this).headers[e]=t),u.apply(this,arguments)})};
1l(window),n.axiosInstances&&n.axiosInstances.forEach(t=>{!function(e,t,n,r,s){function i(t){e.debug.log("Openreplay: capturing axios response data",t);const{headers:i,data:o,method:a,url:c,baseURL:l}=t.config,{data:u,headers:d,status:h,response:p}=t,{data:f,headers:m,status:g}=p||{},y=n.ignoreHeaders,v=Array.isArray(y)?e=>y.includes(e):()=>y;function _(e,t){v(t[0])||(e[t[0]]=t[1])}let b={},S={};i.toJSON?b=i.toJSON():i instanceof Headers?i.forEach((e,t)=>_(b,[t,e])):Array.isArray(i)?i.forEach(e=>_(b,e)):"object"==typeof i&&Object.entries(i).forEach(e=>_(b,e));const w=m||d;w.toJSON?S=w.toJSON():w instanceof Headers?w.forEach((e,t)=>_(S,[t,e])):Array.isArray(w)?w.forEach(e=>_(S,e)):"object"==typeof w&&Object.entries(w).forEach(e=>{let[t,n]=e;v(t)||(S[t]=n)});const k=r({url:c,method:a||"",status:h||g||0,request:{headers:b,body:o},response:{headers:S,body:f||u}});if(!k)return void e.debug.log("Openreplay: empty request/response info, skipping");const T=t.config.__openreplay_timing,E=performance.now()-T;e.debug.log("Openreplay: final req object",k),e.send(ES("xhr",String(a),String(k.url),s(k.request),s(k.response),k.status,T+Db(),E,0))}e.debug.log("Openreplay: attaching axios spy to instance",t);const o=t.interceptors.request.use(function(t){if(e.debug.log("Openreplay: capturing API request",t),t.__openreplay_timing=performance.now(),n.sessionTokenHeader){const r="string"==typeof n.sessionTokenHeader?n.sessionTokenHeader:"X-OpenReplay-Session-Token",s=e.getSessionToken();s&&t.headers.set(r,s)}return t},function(t){e.debug.log("Openreplay: failed API request, skipping",t)},{synchronous:!0}),a=t.interceptors.response.use(function(e){return n.failuresOnly||i(e),e},function(t){var n,r;return e.debug.log("Openreplay: capturing API request error",t),null!==(r=n=t)&&"object"==typeof r&&!0===n.isAxiosError&&Boolean(t.response)?i(t.response):t instanceof Error&&e.send(Jw(t,[])),Promise.reject(t)},{synchronous:!0});e.attachStopCallback(()=>{var e,n,r,s;null===(e=(n=t.interceptors.request).eject)||void 0===e||e.call(n,o),null===(r=(s=t.interceptors.response).eject)||void 0===r||r.call(s,a)})}(e,t,n,a,c)}),n.captureInIframes&&e.observer.attachContextCallback(e.safe(l))}const wT=["composite","computedOffset","easing","offset"];function kT(e){const t=null===e;return Boolean(e&&"object"==typeof e&&!Array.isArray(e)&&!t)}function TT(){const e=(new Date).getTimezoneOffset(),t=Math.abs(Math.floor(e/60)),n=Math.abs(e%60);return`UTC${e<=0?"+":"-"}${t.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`}const ET="$__or__initial_ref__$",xT="$__or__distinct_device_id__$",IT="$__or__utm_params__$",CT="$__or__super_properties__$",OT="$__or__user_id__$",AT="window"in globalThis?window:{navigator:{userAgent:""},screen:{},document:{cookie:""},location:{search:""}},MT="document"in globalThis?document:{referrer:""},RT=["google","bing","yahoo","baidu","yandex","duckduckgo","ecosia","ask","aol","wolframalpha","startpage","swisscows","qwant","lycos","dogpile","info","teoma","webcrawler","naver","seznam","perplexity"];class NT{constructor(e,t){this.localStorage=e,this.sessionStorage=t,this.user_id=null,this.setUserId=e=>{this.user_id=e,this.sessionStorage.setItem(OT,e??"")},this.resetUserId=e=>{this.user_id=null,e&&(this.deviceId=this.getDistinctDeviceId(!0))},this.getDistinctDeviceId=e=>{const t=this.localStorage.getItem(xT);if(t&&!e)return t;{const e=`${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}-${Math.random().toString(36).slice(2)}`;return this.localStorage.setItem(xT,e),e}},this.getReferrer=()=>{const e=this.sessionStorage.getItem(ET);if(e)return e;{const e=MT.referrer;return this.sessionStorage.setItem(ET,e),e}},this.parseUTM=()=>{const e=this.sessionStorage.getItem(IT);if(e){const t=JSON.parse(e);this.utmSource=t.utm_source,this.utmMedium=t.utm_medium,this.utmCampaign=t.utm_campaign}else{const e=new URLSearchParams(AT.location.search);this.utmSource=e.get("utm_source")||null,this.utmMedium=e.get("utm_medium")||null,this.utmCampaign=e.get("utm_campaign")||null;const t={utm_source:this.utmSource,utm_medium:this.utmMedium,utm_campaign:this.utmCampaign};this.sessionStorage.setItem(IT,JSON.stringify(t))}}
1,this.getSearchEngine=e=>{for(const t of RT)if(e.includes(t))return t;return null},this.getSuperProperties=()=>{const e=this.localStorage.getItem(CT);return e?JSON.parse(e):{}},this.saveSuperProperties=e=>{this.localStorage.setItem(CT,JSON.stringify(e))},this.clearSuperProperties=()=>{this.localStorage.setItem(CT,JSON.stringify({}))};const{width:n,height:r,browser:s,browserVersion:i,browserMajorVersion:o,os:a,osVersion:c,mobile:l}=function(e,t){let n=0,r=0,s="";e.screen.width&&(n=e.screen.width,r=e.screen.height,s=`${n} x ${r}`);const i=e.navigator.appVersion??"0",o=e.navigator.userAgent??"unknown";let a,c,l,u=e.navigator.appName??"unknown",d=String(parseFloat(i));-1!==(c=o.indexOf("YaBrowser"))?(u="Yandex",d=o.substring(c+10)):-1!==(c=o.indexOf("SamsungBrowser"))?(u="Samsung",d=o.substring(c+15)):-1!==(c=o.indexOf("UCBrowser"))?(u="UC Browser",d=o.substring(c+10)):-1!==(c=o.indexOf("OPR"))?(u="Opera",d=o.substring(c+4)):-1!==(c=o.indexOf("Opera"))?(u="Opera",d=o.substring(c+6),-1!==(c=o.indexOf("Version"))&&(d=o.substring(c+8))):-1!==(c=o.indexOf("Edge"))?(u="Microsoft Legacy Edge",d=o.substring(c+5)):-1!==(c=o.indexOf("Edg"))?(u="Microsoft Edge",d=o.substring(c+4)):-1!==(c=o.indexOf("MSIE"))?(u="Microsoft Internet Explorer",d=o.substring(c+5)):-1!==(c=o.indexOf("Chrome"))?(u="Chrome",d=o.substring(c+7)):-1!==(c=o.indexOf("Safari"))?(u="Safari",d=o.substring(c+7),-1!==(c=o.indexOf("Version"))&&(d=o.substring(c+8))):-1!==(c=o.indexOf("Firefox"))?(u="Firefox",d=o.substring(c+8)):-1!==o.indexOf("Trident/")?(u="Microsoft Internet Explorer",d=o.substring(o.indexOf("rv:")+3)):(a=o.lastIndexOf(" ")+1)<(c=o.lastIndexOf("/"))&&(u=o.substring(a,c),d=o.substring(c+1),u.toLowerCase()===u.toUpperCase()&&(u=e.navigator.appName)),-1!==(l=d.indexOf(";"))&&(d=d.substring(0,l)),-1!==(l=d.indexOf(" "))&&(d=d.substring(0,l)),-1!==(l=d.indexOf(")"))&&(d=d.substring(0,l));let h=parseInt(d,10);isNaN(h)&&(d=String(parseFloat(i)),h=parseInt(i,10));const p=/Mobile|mini|Fennec|Android|iP(ad|od|hone)/.test(i);let f=e.navigator.cookieEnabled||!1;void 0!==navigator.cookieEnabled||f||(e.document.cookie="testcookie",f=-1!==e.document.cookie.indexOf("testcookie"));let m="-";const g=[{s:"Windows 10",r:/(Windows 10.0|Windows NT 10.0)/},{s:"Windows 8.1",r:/(Windows 8.1|Windows NT 6.3)/},{s:"Windows 8",r:/(Windows 8|Windows NT 6.2)/},{s:"Windows 7",r:/(Windows 7|Windows NT 6.1)/},{s:"Windows Vista",r:/Windows NT 6.0/},{s:"Windows Server 2003",r:/Windows NT 5.2/},{s:"Windows XP",r:/(Windows NT 5.1|Windows XP)/},{s:"Windows 2000",r:/(Windows NT 5.0|Windows 2000)/},{s:"Windows ME",r:/(Win 9x 4.90|Windows ME)/},{s:"Windows 98",r:/(Windows 98|Win98)/},{s:"Windows 95",r:/(Windows 95|Win95|Windows_95)/},{s:"Windows NT 4.0",r:/(Windows NT 4.0|WinNT4.0|WinNT|Windows NT)/},{s:"Windows CE",r:/Windows CE/},{s:"Windows 3.11",r:/Win16/},{s:"Android",r:/Android/},{s:"Open BSD",r:/OpenBSD/},{s:"Sun OS",r:/SunOS/},{s:"Chrome OS",r:/CrOS/},{s:"Linux",r:/(Linux|X11(?!.*CrOS))/},{s:"iOS",r:/(iPhone|iPad|iPod)/},{s:"Mac OS X",r:/Mac OS X/},{s:"Mac OS",r:/(Mac OS|MacPPC|MacIntel|Mac_PowerPC|Macintosh)/},{s:"QNX",r:/QNX/},{s:"UNIX",r:/UNIX/},{s:"BeOS",r:/BeOS/},{s:"OS/2",r:/OS\/2/},{s:"Search Bot",r:/(nuhk|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask Jeeves\/Teoma|ia_archiver)/}];for(const e of g)if(e.r.test(o)){m=e.s;break}let y="-";if(/Windows/.test(m)){const n=/Windows (.*)/.exec(m);if(n&&n[1]&&(y=n[1],"10"===y&&"userAgentData"in e.navigator)){const e=navigator;e.userAgentData&&e.userAgentData.getHighEntropyValues(["platformVersion"]).then(e=>{const n=parseInt(e.platformVersion.split(".")[0],10)<13?"10":"11";y=n,null==t||t(n)}).catch(()=>{})}m="Windows"}switch(m){case"Mac OS":case"Mac OS X":case"Android":{const e=/(?:Android|Mac OS|Mac OS X|MacPPC|MacIntel|Mac_PowerPC|Macintosh) ([\.\_\d]+)/.exec(o);y=e&&e[1]?e[1]:"-";break}case"iOS":{const e=/OS (\d+)_(\d+)_?(\d+)?/.exec(i);e&&e[1]&&(y=`${e[1]}.${e[2]}.${parseInt(e[3]||"0",10)}`);break}}return{screen:s,width:n,height:r,browser:u,browserVersion:d,browserMajorVersion:h,mobile:p,os:m,osVersion:y,cookies:f}}(AT,e=>{this.osVersion=e}),u=this.sessionStorage.getItem(OT);u&&(this.user_id=u),this.os=a,this.osVersion=c,this.browser=`${s}`,this.browserVersion=`${i} (${o})`,this.platform=l?"mobile":"desktop",this.screenHeight=r,this.screenWidth=n,this.initialReferrer=this.getReferrer(),this.deviceId=this.getDistinctDeviceId(),this.searchEngine=this.getSearchEngine(this.initialReferrer),this.parseUTM()}get all(){return{os:this.os,os_version:this.osVersion,browser:this.browser,browser_version:this.browserVersion,platform:this.platform,screen_height:this.screenHeight,screen_width:this.screenWidth,initial_referrer:this.initialReferrer,utm_source:this.utmSource,utm_medium:this.utmMedium,utm_campaign:this.utmCampaign,user_id:this.user_id,distinct_id:this.deviceId,sdk_edition:"web",sdk_version:"18.1.0",t
1imezone:TT(),search_engine:this.searchEngine}}get defaultPropertyKeys(){return Object.keys(this.all)}get distinctId(){return this.deviceId}}const PT="user_actions",LT="events",DT=(e,t,n,r)=>{if(e===PT)return{category:e,data:{type:t,user_id:r.user_id,payload:r.properties,timestamp:n}};if(!r)throw new Error("Payload is required for event creation");return{category:e,data:{name:r.name,payload:r.properties,timestamp:n}}},$T=["properties","token","timestamp"];class jT{constructor(e,t,n){this.constantProperties=e,this.getTimestamp=t,this.batcher=n,this.ownProperties={},this.sendEvent=(e,t,n)=>{const r={};if(t){if(!kT(t))throw new Error("Properties must be an object");Object.entries(t).forEach(e=>{let[t,n]=e;this.constantProperties.defaultPropertyKeys.includes(t)||(r[t]=n)})}const s={name:e,properties:{...this.ownProperties,...r}},i=DT(LT,void 0,this.getTimestamp(),s);null!=n&&n.send_immediately?this.batcher.sendImmediately(i):this.batcher.addEvent(i)},this.setProperty=(e,t)=>{let n=!1;kT(e)&&Object.entries(e).forEach(e=>{let[t,r]=e;this.constantProperties.defaultPropertyKeys.includes(t)||(this.ownProperties[t]=r,n=!0)}),"string"==typeof e&&void 0!==t&&(this.constantProperties.defaultPropertyKeys.includes(e)||(this.ownProperties[e]=t,n=!0)),n&&this.constantProperties.saveSuperProperties(this.ownProperties)},this.setPropertiesOnce=(e,t)=>{let n=!1;kT(e)&&Object.entries(e).forEach(e=>{let[t,r]=e;this.ownProperties[t]||$T.includes(t)||(this.ownProperties[t]=r,n=!0)}),"string"==typeof e&&void 0!==t&&(this.ownProperties[e]||$T.includes(e)||(this.ownProperties[e]=t,n=!0)),n&&this.constantProperties.saveSuperProperties(this.ownProperties)},this.unsetProperties=e=>{let t=!1;Array.isArray(e)?e.forEach(e=>{this.ownProperties[e]&&!$T.includes(e)&&(delete this.ownProperties[e],t=!0)}):this.ownProperties[e]&&!$T.includes(e)&&(delete this.ownProperties[e],t=!0),t&&this.constantProperties.saveSuperProperties(this.ownProperties)},this.reset=()=>{this.ownProperties={},this.constantProperties.clearSuperProperties()},this.register=this.setProperty,this.register_once=this.setPropertiesOnce,this.unregister=this.unsetProperties,this.track=this.sendEvent,this.ownProperties=this.constantProperties.getSuperProperties()}}class BT{constructor(e,t,n,r){this.constantProperties=e,this.getTimestamp=t,this.onId=n,this.batcher=r,this.ownProperties={},this.identify=(e,t)=>{if(!e||"string"!=typeof e)throw new Error("OR SDK: user_id (string) is required for .identify()");this.constantProperties.user_id&&this.constantProperties.user_id!==e&&this.reset(),this.constantProperties.setUserId(e),null!=t&&t.fromTracker||this.onId(e);const n=DT(PT,"identity",this.getTimestamp(),{user_id:e});this.batcher.addEvent(n)},this.reset=e=>{this.constantProperties.resetUserId(e),this.ownProperties={}},this.deleteUser=()=>{const e=this.constantProperties.user_id;if(!e)return;this.constantProperties.setUserId(null),this.ownProperties={};const t=DT(PT,"delete_user",void 0,{user_id:e});this.batcher.addEvent(t),this.reset()},this.setProperties=(e,t)=>{if(!e)throw new Error("OR SDK: no user properties provided to set");const n={};if("string"==typeof e&&e&&t)n[e]=t;else{if(!kT(e))throw new Error("OR SDK: invalid user properties provided to set");Object.assign(n,e)}Object.entries(n).forEach(e=>{let[t,n]=e;this.constantProperties.defaultPropertyKeys.includes(t)||(this.ownProperties[t]=n)});const r=DT(PT,"set_property",void 0,{user_id:this.user_id,properties:n});this.batcher.addEvent(r)},this.setPropertiesOnce=e=>{if(!kT(e))throw new Error("Properties must be an object");Object.entries(e).forEach(e=>{let[t,n]=e;this.constantProperties.defaultPropertyKeys.includes(t)||this.ownProperties[t]||(this.ownProperties[t]=n)});const t=DT(PT,"set_property_once",void 0,{user_id:this.user_id,properties:e});this.batcher.addEvent(t)},this.appendValues=(e,t)=>{!this.constantProperties.defaultPropertyKeys.includes(e)&&this.ownProperties[e]&&(Array.isArray(this.ownProperties[e])?this.ownProperties[e].push(t):this.ownProperties[e]=[this.ownProperties[e],t]);const n=DT(PT,"append_property",void 0,{properties:{[e]:t},user_id:this.user_id});this.batcher.addEvent(n)},this.appendUniqueValues=(e,t)=>{if(!this.ownProperties[e])return;Array.isArray(this.ownProperties[e])?this.ownProperties[e].includes(t)||this.appendValues(e,t):this.ownProperties[e]!==t&&this.appendValues(e,t);const n=DT(PT,"append_unique_property",void 0,{properties:{[e]:t},user_id:this.user_id});this.batcher.addEvent(n)},this.increment=(e,t)=>
1{if(this.ownProperties[e]||(this.ownProperties[e]=0),this.ownProperties[e]&&"number"!=typeof this.ownProperties[e])throw new Error("OR SDK: Property must be a number to increment");this.ownProperties[e]+=t;const n=DT(PT,"increment_property",void 0,{user_id:this.user_id,properties:{[e]:t}});this.batcher.addEvent(n)},this.union=this.appendUniqueValues,this.set=this.setProperties,this.set_once=this.setPropertiesOnce,this.append=this.appendValues,this.incrementBy=this.increment}get user_id(){return this.constantProperties.user_id}}class FT{constructor(e,t,n,r){this.backendUrl=e,this.getToken=t,this.init=n,this.standalone=r,this.autosendInterval=5e3,this.retryTimeout=3e3,this.retryLimit=3,this.apiEdp="/v1/sdk/i",this.batch={[PT]:[],[LT]:[]},this.intervalId=null,this.stopped=!1,this.paused=!1,this.onVisibilityChange=()=>{document.hidden?(this.flush(!0),this.paused=!0):this.paused=!1}}getBatches(){return this.batch[PT]=this.dedupePeopleEvents(),{data:{[PT]:[...this.batch[PT]],[LT]:[...this.batch[LT]]}}}addEvent(e){this.batch[e.category].push(e.data)}sendImmediately(e){this.sendBatch({[e.category]:[e.data]})}dedupePeopleEvents(){const e=this.batch[PT],t=[],n=[];for(let r of e)"identity"===r.type?n.length>0?(t.push(...this.squashPeopleEvents(n),r),n.length=0):t.push(r):n.push(r);return n.length>0&&t.push(...this.squashPeopleEvents(n)),t}squashPeopleEvents(e){if(!e||0===e.length)return[];const t=new Map;for(let n of e){const e=t.get(n.type);if(e){if("increment_property"===n.type){const r=Object.entries(e.payload),s=Object.entries(n.payload),i=new Set([...r.map(e=>{let[t]=e;return t}),...s.map(e=>{let[t]=e;return t})]),o={};i.forEach(t=>{const r="number"==typeof e.payload[t]?e.payload[t]:0,s="number"==typeof n.payload[t]?n.payload[t]:0;o[t]=r+s}),t.set(n.type,{type:n.type,timestamp:n.timestamp,payload:o});continue}t.set(n.type,{type:n.type,timestamp:n.timestamp,payload:{...e.payload??{},...n.payload??{}}})}else t.set(n.type,n)}return Array.from(t.values())}sendBatch(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],n=arguments.length>2?arguments[2]:void 0;if(this.stopped)return void(null==n||n());const r=e;let s=0;const i=()=>{const e=this.getToken();if(e)return s++,fetch(`${this.backendUrl}${this.apiEdp}`,{method:"POST",keepalive:t,headers:{"Content-Type":"application/json",Authorization:`Bearer ${e}`},body:JSON.stringify(r)}).then(async e=>{if(401===e.status){const t=await e.json().catch(()=>null);return this.standalone||"token expired"!==(null==t?void 0:t.error)?s<this.retryLimit?this.init().then(()=>{i()}):void(null==n||n()):void this.stop()}if(403===e.status)return s<this.retryLimit?this.init().then(()=>{i()}):void(null==n||n());if(!e.ok)throw new Error(`HTTP error! status: ${e.status}`)}).catch(()=>{s<this.retryLimit?setTimeout(()=>{i()},this.retryTimeout):null==n||n()});null==n||n()};i()}startAutosend(){this.intervalId&&clearInterval(this.intervalId),this.paused=document.hidden,document.addEventListener("visibilitychange",this.onVisibilityChange),this.intervalId=setInterval(()=>{this.paused||this.flush()},this.autosendInterval)}flush(){let e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];const t=Object.keys(this.batch);if(t.every(e=>0===this.batch[e].length))return;const n=this.getBatches(),r={[PT]:[...n.data[PT]],[LT]:[...n.data[LT]]};t.forEach(e=>{this.batch[e]=[]}),this.sendBatch(n,e,()=>this.requeue(r))}requeue(e){this.stopped||(this.batch[PT]=[...e[PT],...this.batch[PT]],this.batch[LT]=[...e[LT],...this.batch[LT]])}stop(){this.flush(),this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),document.removeEventListener("visibilitychange",this.onVisibilityChange),this.stopped=!0}restart(){this.stopped=!1,this.startAutosend()}}const UT="__or_sdk_analytics_token";class zT{constructor(e){this.token=null,this.standalone=!1,this._getToken=()=>this.standalone?this.token:this.getToken(),this._getTimestamp=()=>this.standalone?Date.now():this.getTimestamp(),this.init=async()=>{if(this.standalone){const e=this.constantProperties.all,t="/v1/sdk/start",n={projectKey:this.projectKey,defaultFields:e},r=await fetch(t,{method:"POST",body:JSON.stringify(n)});if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);const s=await r.json();if(!s.token)throw new Error("No token received from server");this.token=s.token,this.sessionStorage.setItem(UT,s.token)}else this.batcher.startAutosend()},this.onStart=()=>{this.standalone||this.batcher.restart()},this.onStop=()=>{this.standalone||this.batcher.stop()},this.reset=()=>{this.people.reset(!0),this.events.reset(),this.batcher.stop(),this.standalone&&(this.token=null,this.sessionStorage.setItem(UT,""))},this.identify=e=>this.people.identify(e),this.track=(e,t,n)=>this.events.track(e,t,n),this.sessionStorage=e.sessionStorage||sessionStorage,this.localStorage=e.localStorage||localStorage,this.backendUrl=e.ingestPoint,this.projectKey=e.projectKey,this.getToken=e.getToken||(()=>""),this.getTimestamp=e.getTimestamp||(()=>Date.now()),this.setUserId=e.setUserId||(()=>{}),this.standalone=!e.notStandalone,this.token=this.sessionStorage.getItem(UT),this.constantProperties=new NT(this.localStorage,this.sessionStorage),this.batcher=new FT(this.backendUrl,this._getToken,this.init,this.standalone),this.events=new jT(this.constantProperties,this._getTimestamp,this.batcher),this.people=new BT(this.constantProperties,this._getTimestamp,this.setUserId,this.batcher),e.notStandalone&&this.init()}}const WT="/en/sdk";class HT{constructor(e){var t,n,r,s=this;if(this.options=e,this.app=null,this.analytics=null,this.crossdomainMode=!1,this.checkDoNotTrack=()=>this.options.respectDoNotTrack&&("1"==navigator.doNotTrack||"1"==window.doNotTrack),this.signalStartIssue=(e,t)=>
1{const n=this.checkDoNotTrack();console.log("Tracker couldn't start due to:",JSON.stringify({trackerVersion:"18.1.0",projectKey:this.options.projectKey,doNotTrack:n,reason:t.length?`missing api: ${t.join(",")}`:e}))},this.restartCanvasTracking=()=>{null!==this.app&&this.app.restartCanvasTracking()},this.resanitize=e=>{null!==this.app&&this.app.resanitize(e)},this.checkSanitization=e=>{if(null!==this.app)return this.app.checkSanitization(e)},this.getSessionURL=e=>{if(null!==this.app)return this.app.getSessionURL(e)},this.setUserID=e=>{var t;"string"==typeof e&&null!==this.app&&(this.app.session.setUserID(e),null===(t=this.analytics)||void 0===t||t.people.identify(e,{fromTracker:!0}))},this.identify=this.setUserID,this.track=(e,t,n)=>{var r;return null===(r=this.analytics)||void 0===r?void 0:r.track(e,t,n)},this.userID=e=>{Wb("'userID' method","'setUserID' method","/"),this.setUserID(e)},this.handleError=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(null!==s.app)if(e instanceof Error){const n=Jw(e,[],t);s.app.send(n)}else if(e instanceof ErrorEvent||"PromiseRejectionEvent"in window&&e instanceof PromiseRejectionEvent){const n=Kw(e,void 0,t);null!=n&&s.app.send(n)}},this.incident=e=>{var t,n,r;null!==this.app&&this.app.send((t=e.label??"",n=e.startTime,r=e.endTime??e.startTime,[87,t,n,r]))},this.analyticsToken=null,this.setAnalyticsToken=e=>{this.analyticsToken=e},this.getAnalyticsToken=()=>{return this.analyticsToken?this.analyticsToken:(null===(e=this.app)||void 0===e?void 0:e.session.getSessionToken())??"";var e},this.crossdomainMode=Boolean(Xb()&&(null===(t=e.crossdomain)||void 0===t?void 0:t.enabled)),!Rb||!function(e){if(null==e)return console.error(`OpenReplay: invalid options argument type. Please, check documentation on ${Ub}${WT}`),!1;if("string"!=typeof e.projectKey)if("number"!=typeof e.projectKey){if("number"!=typeof e.projectID)return console.error(`OpenReplay: projectKey is missing or wrong type (string is expected). Please, check ${Ub}${WT} for more information.`),!1;e.projectKey=e.projectID.toString(),Wb("`projectID` option","`projectKey` option",WT)}else console.warn("OpenReplay: projectKey is expected to have a string type."),e.projectKey=e.projectKey.toString();return null!=e.sessionToken&&Wb("`sessionToken` option","`sessionHash` start() option","/"),!0}(e))return;if(window.__OPENREPLAY__||!this.crossdomainMode&&Xb()&&(()=>{try{var e;return Boolean(null===(e=window.top)||void 0===e?void 0:e.document)}catch{return!1}})()&&window.top.__OPENREPLAY__)return void console.error("OpenReplay: one tracker instance has been initialised already");if(!e.__DISABLE_SECURE_MODE&&"https:"!==location.protocol)return void console.error("OpenReplay: Your website must be publicly accessible and running on SSL in order for OpenReplay to properly capture and replay the user session. You can disable this check by setting `__DISABLE_SECURE_MODE` option to `true` if you are testing in localhost. Keep in mind, that asset files on a local machine are not available to the outside world. This might affect tracking if you use css files.");const i=[],o=["Map","Set","MutationObserver","performance","timing","startsWith","Blob","Worker"];if(this.checkDoNotTrack())i.push("doNotTrack");else for(const e of o)if("timing"===e){if("performance"in window&&!(e in performance)){i.push(e);break}}else if("startsWith"===e){if(!(e in String.prototype)){i.push(e);break}}else if(!(e in window)){i.push(e);break}if(i.length>0){const e=i.join(",");return console.error(`OpenReplay: browser doesn't support API required for tracking or doNotTrack is set to 1. Reason: ${e}`),void this.signalStartIssue("missing_api",i)}const a=new Lw(e.projectKey,e.sessionToken,e,this.signalStartIssue,this.crossdomainMode);if(this.app=a,e.projectKey&&null!==(n=e.analytics)&&void 0!==n&&n.active){var c;let t=!1;if(e.ingestPoint||(t=!0),e.ingestPoint){const n="api.openreplay.com";new URL(e.ingestPoint).hostname===n&&(t=!0)}const n="https://api.openreplay.com/ingest";this.analytics=new zT({localStorage:e.localStorage??localStorage,sessionStorage:e.sessionStorage??sessionStorage,getToken:()=>this.getAnalyticsToken(),getTimestamp:()=>{var e;return(null===(e=this.app)||void 0===e?void 0:e.timestamp())??Date.now()},setUserId:e=>{var t;null===(t=this.app)||void 0===t||t.session.setUserID(e)},notStandalone:!0,ingestPoint:t?n:(null===(c=e.analytics)||void 0===c?void 0:c.ingestPoint)??e.ingestPoint??n,projectKey:e.projectKey}),a.attachStartCallback(()=>{var e;null===(e=this.analytics)||void 0===e||e.onStart()}),a.attachStopCallback(()=>{var e;null===(e=this.analytics)||void 0===e||e.onStop()})}this.crossdomainMode||(function(e,t){let n,r,s,i,o=document.referrer;const a=(null==t?void 0:t.urlSanitizer)||Vk,c=(null==t?void 0:t.t
1itleSanitizer)||(e=>e),l=e.safe(()=>{const r=document.URL;if(r!==n){if(n=r,null!=t&&t.replaceHashSymbol){const e=new URL(r),t=e.hash.startsWith("#/")?e.hash.slice(2):"",s=t?"/"+t.replace(/^\/+/,""):"",i=e.origin+e.pathname.replace(/\/$/,"")+s+e.search;n=i}const s=a(n),l=e.sanitizer.privateMode?aw(document.title):c(document.title),u=e.sanitizer.privateMode?aw(s):s,d=e.sanitizer.privateMode?aw(o):o;e.send(function(e,t,n,r){return[122,e,t,n,r]}(u,d,i,l)),i=0,o=n}}),u=e.safe(()=>{const{innerWidth:t,innerHeight:n}=window;t===r&&n===s||(r=t,s=n,e.send(function(e,t){return[5,e,t]}(r,s)))}),d=void 0===document.hidden?Function.prototype:e.safe(()=>e.send([55,document.hidden]));e.attachStartCallback(()=>{n=null,i=Db(),r=s=-1,l(),u(),d()}),void 0!==document.hidden&&e.attachEventListener(document,"visibilitychange",d,!1,!1),e.ticker.attach(l,1,!1),e.ticker.attach(u,5,!1)}(a,e.urls),function(e){const t=navigator.connection||navigator.mozConnection||navigator.webkitConnection;if(void 0===t)return;const n=()=>{var n,r;e.send((n=Math.round(1e3*t.downlink),r=t.effectiveType||"unknown",[54,n,r]))};e.attachStartCallback(()=>{n(),t.addEventListener("change",n)}),e.attachStopCallback(()=>{t.removeEventListener("change",n)})}(a),function(e,t){if(!Object.assign({capturePerformance:!0},t).capturePerformance)return;const n=Rb&&"function"==typeof window.requestAnimationFrame?window.requestAnimationFrame.bind(window):null,r=Rb&&"function"==typeof window.cancelAnimationFrame?window.cancelAnimationFrame.bind(window):null;let s=!1,i=0,o=0,a=null,c=!1;const l=()=>{a=null,s&&-1!==i&&(i++,c||u())},u=()=>{n&&null===a&&(c=!0,a=n(l),c=!1)};e.ticker.attach(()=>{s&&-1!==o&&o++},0,!1);const d=()=>{s&&(e.send(function(e,t,n,r){return[49,e,t,n,r]}(i,o,MS.memory.totalJSHeapSize||0,MS.memory.usedJSHeapSize||0)),document.hidden?i=o=-1:(i=o=0,u()))};e.attachStartCallback(()=>{s=!0,i=o=-1,d()}),e.attachStopCallback(()=>{s=!1,i=o=0,null!==a&&r&&r(a),a=null}),e.ticker.attach(d,165,!1),void 0!==document.hidden&&e.attachEventListener(document,"visibilitychange",d,!1,!1)}(a,e),function(e){function t(){document.hidden||(e.debug.log("Openreplay: tab change to"+e.session.getTabId()),e.send(OS(e.session.getTabId())))}e.attachStartCallback(()=>{t()}),e.attachEventListener(window,"focus",t,!1,!1)}(a)),ik(a,{...e.mouse,customAttributes:e.customAttributes}),function(e,t){let n=!1;const r=new Map;function s(e){US(e)&&(WS(e)&&r.set(e,[e.scrollLeft,e.scrollTop]),qS(e)&&r.set(e,qk(e)))}const i=e.safe(()=>{t||e.send(function(e,t){return[6,e,t]}(...qk(document)))}),o=e.safe((t,n)=>{const r=e.nodes.getID(n);void 0!==r&&e.send(function(e,t,n){return[16,e,t,n]}(r,t[0],t[1]))});e.attachStartCallback(i),e.attachStopCallback(()=>{n=!1,r.clear()}),e.nodes.attachNodeCallback((t,n)=>{n&&(WS(t)&&t.scrollLeft+t.scrollTop>0?r.set(t,[t.scrollLeft,t.scrollTop]):qS(t)&&r.set(t,qk(t))),VS(t)&&e.nodes.attachNodeListener(t,"scroll",e=>{s(e.target)})}),e.attachEventListener(document,"scroll",e=>{const t=e.target;t!==document?s(t):n=!0}),e.ticker.attach(()=>{n&&(i(),n=!1),r.forEach(o),r.clear()},5,!1)}(a,this.crossdomainMode),function(e,t){if(null===e)return;if(!window.CSSStyleSheet)return void e.send((n="no_stylesheet_prototype_in_window",r="",[63,n,r]));var n,r;const s={...Jk,...t},i=new Map;let o=null;const a=new Set,c=s.checkCssInterval||200;let l={};function u(){if(!s.scanInMemoryCSS)return;const t=a.values();for(const n of t)try{const t=iw.get(n);if(!t)continue;if(s.checkLimit&&(l[t]=(l[t]??0)+1,l[t]>s.checkLimit)){a.delete(n);continue}for(let r=0;r<n.cssRules.length;r++)try{const s=n.cssRules[r],o=`${t}:${r}`,a=i.get(o),c=s.cssText;a!==c&&(void 0!==a?(e.send(SS(t,r)),e.send(bS(t,c,r,e.getBaseHref()))):e.send(bS(t,c,r,e.getBaseHref())),i.set(o,c))}catch(e){}const r=Array.from(i.keys()).filter(e=>e.startsWith(`${t}:`));for(const e of r)parseInt(e.split(":")[1],10)>=n.cssRules.length&&i.delete(e)}catch(e){a.delete(n)}}const d=/{\s*}/;function h(e){return d.test(e)}const p=e.safe((t,n,r)=>{const s=iw.get(t);s&&("string"==typeof r?(e.send(bS(s,r,n,e.getBaseHref())),h(r)&&(i.set(`${s}:${n}`,r),a.add(t))):(e.send(SS(s,n)),i.has(`${s}:${n}`)&&i.delete(`${s}:${n}`)))}),f=e.safe(t=>{let n=t;for(;n.parentRule;)n=n.parentRule;const r=n.parentStyleSheet;if(!r)return;const s=iw.get(r);if(!s)return;const o=n.cssText,c=Array.from(r.cssRules).indexOf(n);c>=0&&(e.send(bS(s,o,c,e.getBaseHref())),e.send(SS(s,c+1)),h(o)&&(i.set(`${s}:${c}`,o),a.add(r)))}),m=e.safe(e=>{if(e.__css_tracking_patched__)return;e.__css_tracking_patched__=!0;const{insertRule:t,deleteRule:n}=e.CSSStyleSheet.prototype,{insertRule:r,deleteRule:s}=e.CSSGroupingRule.prototype;e.CSSStyleSheet.prototype.insertRule=function(e){let n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const r=t.call(this,e,n);return p(this,r,e),r},e.CSSStyleSheet.prototype.deleteRule=function(e){return p(this,e),n.call(this,e)},e.CSSGroupingRule.prototype.insertRule=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;const n=r.call(this,e,t);return f(this),n},e.CSSGroupingRule.prototype.deleteRule=function(e){const t=s.call(this,e);return f(this),t}});m(window),e.observer.attachContextCallback(m),e.nodes.attachNodeCallback(t=>{if(!JS(t,"style")||!t.sheet)return;if(null!==t.textContent&&t.textContent.trim().length>0)return;const n=e.nodes.getID(t);if(!n)return;const r=t.sheet;let s;try{s=r.cssRules}catch(t){return void e.debug.log("Couldnt access stylesheet during initial scan",t)}const i=sw();iw.set(r,i),e.send(wS(i,n));for(let t=0;t<s.length;t++)try{p(r,t,s[t].cssText)}catch(t){e.debug.log("Couldnt access stylesheet rule during initial scan",t)}}),setTimeout(function(){!o&&s.scanInMemoryCSS&&(o=window.setInterval(u,c))},50),e.attachStopCallback(()=>{o&&(clearInterval(o),o=null),i.clear()})}(a,e.css),function(e){if(null===e)return;if(!nw(document))return;const t=new Map,n=n=>setTimeout(()=>{let r=e.nodes.getID(n);if(n===document&&(r=0),void 0===r)return;let s=t.get(r);s||(s=[]);const i=[],o=n.adoptedStyleSheets;if(o&&Symbol.iterator in o)for(const t of o){let n=iw.get(t);const o=!n;if(n||(n=sw(),iw.set(t,n)),s.includes(n)||e.send(wS(n,r)),o)try{const r=t.cssRules;for(let t=0;t<r.length;t++)e.send(bS(n,r[t].cssText,t,e.getBaseHref()))}catch(t){e.debug.log("Couldnt access adopted stylesheet",t)}i.push(n)}if(Symbol.iterator in s)for(const t of s)i.includes(t)||e.send(kS(t,r));t.set(r,i)},20);function r(e){const t=Object.getOwnPropertyDescriptor(e,"adoptedStyleSheets");t&&Object.defineProperty(e,"adoptedStyleSheets",{...t,set:function(e){const r=t.set.call(this,e);return n(this),r}})}const s=t=>{if(t.__openreplay_adpss_patched__)return;t.__openreplay_adpss_patched__=!0,r(t.Document.prototype),r(t.ShadowRoot.prototype);const{replace:n,replaceSync:s}=t.CSSStyleSheet.prototype;t.CSSStyleSheet.prototype.replace=function(t){return n.call(this,t).then(n=>{const r=iw.get(this);return r&&e.send(_S(r,t,e.getBaseHref())),n})},t.CSSStyleSheet.prototype.replaceSync=function(t){const n=iw.get(this);return n&&e.send(_S(n,t,e.getBaseHref())),s.call(this,t)}};s(window),e.observer.attachContextCallback(e.safe(s)),e.attachStopCallback(()=>{iw.clear(),t.clear()}),e.attachStartCallback(()=>{n(document)}),e.nodes.attachNodeCallback(e=>{nw(e)&&n(e)})}(a),Fw(a,e),function(e,t){function n(t){function n(n){const r=Kw(n,t);null!=r&&e.send(r)}try{e.attachEventListener(t,"unhandledrejection",n),e.attachEventListener(t,"error",n)}catch(e){console.error("Error while attaching to error proto contexts",e)}}Object.assign({captureExceptions:!0},t).captureExceptions&&(e.observer.attachContextCallback(n),n(window))}(a,e),function(e){function t(t,n){e.attributeSender.sendSetAttribute(t,"src","https://static.openreplay.com/tracker/placeholder.jpeg");const{width:r,height:s}=n.getBoundingClientRect();n.hasAttribute("width")||e.attributeSender.sendSetAttribute(t,"width",String(r)),n.hasAttribute("height")||e.attributeSender.sendSetAttribute(t,"height",String(s))}const n=function(t,n){const{srcset:r}=n;if(!r)return;const s=r.split(r.match(/,\s+/)?/,\s+/:",").map(e=>Gw(e)).join(", ");e.attributeSender.sendSetAttribute(t,"srcset",s)},r=function(n,r){r.src.length>1e5&&t(n,r),e.send(mS(n,"src",r.src,e.getBaseHref()))},s=e.safe(function(t){const n=Gw(t.src||"");Fb(n)&&e.send(xS(e.timestamp(),0,0,0,0,0,n,"img",0,!1,0,0,0,0,0,0,0))}),i=e.safe(function(i){const o=e.nodes.getID(i);var a;
1void 0!==o&&i.complete&&(0!==i.naturalHeight||0!==i.naturalWidth||(a=i.src,Nb&&(a.startsWith("data:image/svg+xml")||a.match(/.svg$|/i)))?e.sanitizer.isHidden(o)||e.sanitizer.isObscured(o)?t(o,i):(r(o,i),n(o,i)):s(i))}),o=Qb(e.safe(t=>{for(const s of t)if("attributes"===s.type){const t=s.target,i=e.nodes.getID(t);if(void 0===i)continue;"src"===s.attributeName&&r(i,t),"srcset"===s.attributeName&&n(i,t)}}),e.options.forceNgOff);e.attachStopCallback(()=>{o.disconnect()}),e.nodes.attachNodeCallback(t=>{JS(t,"img")&&(e.nodes.attachNodeListener(t,"error",()=>s(t)),e.nodes.attachNodeListener(t,"load",()=>i(t)),i(t),o.observe(t,{attributes:!0,attributeFilter:["src","srcset"]}))}),e.attachResanitizeCallback(e=>{JS(e,"img")&&i(e)})}(a),ek(a,e),Hk(a,e),function(e,t){if(!t.longTasks||!("PerformanceObserver"in window))return;const n=t=>{var n,r,s,i,o,a;e.send((n=t.name,r=t.duration,s=t.blockingDuration,i=t.firstUIEventTimestamp,o=t.startTime,a=JSON.stringify(t.scripts??[]),[89,n,r,s,i,o,a]))},r=new PerformanceObserver(e=>{e.getEntries().forEach(e=>{"long-animation-frame"===e.entryType&&n(e)})});e.attachStartCallback(()=>{performance.getEntriesByType("long-animation-frame").forEach(e=>{n(e)}),r.observe({entryTypes:["long-animation-frame"]})}),e.attachStopCallback(()=>{r.disconnect()})}(a,e),function(e){function t(t){const n=e.nodes.getID(t);void 0!==n&&e.send(fS(n))}let n=!1;e.nodes.attachNodeCallback(r=>{JS(r,"body")&&(e.nodes.attachNodeListener(r,"focus",e=>{US(e.target)&&(t(e.target),n=!1)}),e.nodes.attachNodeListener(r,"blur",t=>{null===t.relatedTarget&&(n=!0,setTimeout(()=>{n&&e.send(fS(-1))},0))}))}),e.attachStartCallback(()=>{let e=document.activeElement;for(;e&&JS(e,"iframe")&&e.contentDocument;)e=e.contentDocument.activeElement;e&&e!==e.ownerDocument.body&&t(e)},!0)}(a),function(e){if(!window.FontFace)return;const t=new Map,n=n=>{class r extends n.FontFace{constructor(){for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];if("string"==typeof s[1]){let r="";s[2]&&e.safe(()=>{r=JSON.stringify(s[2])});const i=[s[0],s[1],r],o=t.get(n.document)||[];o.push(i),t.set(n.document,o);const a=n===window?0:e.nodes.getID(n.document);if(void 0===a)return;e.active()&&e.send(pS(a,...i))}super(...s)}}n.FontFace=r};e.observer.attachContextCallback(n),n(window),e.nodes.attachNodeCallback(e.safe(n=>{if(!qS(n))return;const r=t.get(n);if(!r)return;const s=n.defaultView===window?0:e.nodes.getID(n);void 0!==s&&r.forEach(t=>{e.send(pS(s,...t))})}))}(a),(null===(r=e.network)||void 0===r?void 0:r.disabled)||ST(a,e.network),function(e){e.attachEventListener(document,"selectionchange",()=>{const t=document.getSelection();if(null===t||t.isCollapsed)e.send(IS(-1,-1,""));else{const n=e.nodes.getID(t.anchorNode),r=e.nodes.getID(t.focusNode),s=t.toString().replace(/\s+/g," ");n&&r&&e.send(IS(n,r,s))}})}(a),function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{allElements:n=!1}=t;let r=new WeakSet,s=new WeakSet;function i(t,n,r){s.has(t)||(s.add(t),t.addEventListener("finish",()=>{const s=t.effect.getKeyframes().at(-1);if(!s)return;if(!(n&&n instanceof Element&&n.isConnected))return;const i=getComputedStyle(n),o=Object.keys(s).filter(e=>!wT.includes(e)),a={};var c,l;o.forEach(e=>{a[e]=i[e]}),e.send((c=r,l=JSON.stringify(a),[36,c,l]))},{once:!0}))}function o(e,t){e.getAnimations({subtree:!1}).forEach(n=>i(n,e,t))}e.nodes.attachNodeCallback(t=>{if((n||t.nodeName.includes("-"))&&"getAnimations"in t){const n=t.getAnimations({subtree:!1}),s=e.nodes.getID(t);n.length>0&&!r.has(t)&&s&&(r.add(t),o(t,s),t.addEventListener("animationstart",()=>o(t,s)))}});const a=Element.prototype.animate;Element.prototype.animate=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];const s=a.apply(this,n),o=e.nodes.getID(this);return o?(i(s,this,o),s):s},e.attachStopCallback(()=>{Element.prototype.animate=a,r=new WeakSet,s=new WeakSet})}(a,e.webAnimations),window.__OPENREPLAY__=this;const l=window.open;(e.autoResetOnWindowOpen||e.resetTabOnWindowOpen)&&(a.attachStartCallback(()=>{const t=a.getTabId(),n=a.sessionStorage??window.sessionStorage;window.open=function(){e.autoResetOnWindowOpen&&a.resetNextPageSession(!0),e.resetTabOnWindowOpen&&n.removeItem(e.session_tabid_key||"__openreplay_tabid"),a.resetNextPageSession(!1),n.setItem(e.session_tabid_key||"__openreplay_tabid",t);for(var r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return l.call(window,...s)}}),a.attachStopCallback(()=>{window.open=l}))}use(e){return e(this.app,this.options)}isActive(){return null!==this.app&&this.app.active()}trackWs(e){if(null!==this.app)return this.app.trackWs(e)}start(e){var t;return this.browserEnvCheck()?null===this.app?Promise.reject("Browser doesn't support required api, or doNotTrack is active."):(null!=e&&e.userID&&(this.app.session.setUserID(e.userID),null===(t=this.analytics)||void 0===t||t.people.identify(e.userID,{fromTracker:!0})),this.app.start(e)):Promise.reject("Trying to start not in browser.")}browserEnvCheck(){return!!Rb||(console.error(`OpenReplay: you are trying to start Tracker on a node.js environment. If you want to use OpenReplay with SSR, please, use componentDidMount or useEffect API for placing the \`tracker.start()\` line. Check documentation on ${Ub}${WT}`),!1)}coldStart(e,t){return this.browserEnvCheck()?null===this.app?Promise.reject("Tracker not initialized"):void this.app.coldStart(e,t):Promise.reject("Trying to start not in browser.")}startOfflineRecording(e,t){return this.browserEnvCheck()?null===this.app?Promise.reject("Tracker not initialized"):this.app.offlineRecording(e,t):Promise.reject("Trying to start not in browser.")}uploadOfflineRecording(){if(null!==this.app)return this.app.uploadOfflineRecording()}stop(){if(null!==this.app)return this.app.stop(),this.app.session.getSessionHash()}forceFlushBatch(){null!==this.app&&this.app.forceFlushBatch()}getSessionToken(){return null===this.app?null:this.app.getSessionToken()}getSessionInfo(){return null===this.app?null:this.app.session.getInfo()}getSessionID(){return null===this.app?null:this.app.getSessionID()}getTabId(){return null===this.app?null:this.app.getTabId()}sessionID(){return Wb("'sessionID' method","'getSessionID' method","/"),this.get
1SessionID()}setUserAnonymousID(e){"string"==typeof e&&null!==this.app&&this.app.send(function(e){return[29,e]}(e))}userAnonymousID(e){Wb("'userAnonymousID' method","'setUserAnonymousID' method","/"),this.setUserAnonymousID(e)}setMetadata(e,t){"string"==typeof e&&"string"==typeof t&&null!==this.app&&this.app.session.setMetadata(e,t)}metadata(e,t){Wb("'metadata' method","'setMetadata' method","/"),this.setMetadata(e,t)}event(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if("string"==typeof e&&null!==this.app){if(n)return this.issue(e,t);if(!t||"string"==typeof t)return this.app.send(dS(e,t));try{if("or_timestamp"in t){var r;const n=(null===(r=this.getSessionInfo())||void 0===r?void 0:r.timestamp)??0;t.or_timestamp-n<0&&console.error(`OpenReplay: event ${e} has or_timestamp (${t.or_timestamp}) before session start (${n}). It will be ignored.`)}t=JSON.stringify(t)}catch(e){}this.app.send(dS(e,t))}}issue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if("string"==typeof e&&null!==this.app){try{t=JSON.stringify(t)}catch(e){return}this.app.send(function(e,t){return[64,e,t]}(e,t))}}}new class{constructor(){this.instance=null,this.isConfigured=!1,this.setUserID=e=>{Rb&&this.ensureConfigured()&&this.instance&&this.instance.setUserID(e)},this.identify=this.setUserID,this.track=(e,t,n)=>{var r;Rb&&this.ensureConfigured()&&this.instance&&(null===(r=this.instance.analytics)||void 0===r||r.track(e,t,n))}}configure(e){Rb&&(this.isConfigured?console.warn("OpenReplay: Tracker is already configured. You should only call configure once."):e.projectKey?(this.instance=new HT(e),this.isConfigured=!0):console.error("OpenReplay: Missing required projectKey option"))}get options(){var e;return(null===(e=this.instance)||void 0===e?void 0:e.options)||null}start(e){return Rb?this.ensureConfigured()&&this.instance?this.instance.start(e).catch(e=>({success:!1,reason:"string"==typeof e?e:String(e)})):Promise.resolve({success:!1,reason:"Tracker not configured"}):Promise.resolve({success:!1,reason:"Not in browser environment"})}stop(){if(Rb&&this.ensureConfigured()&&this.instance)return this.instance.stop()}get analytics(){var e;return(null===(e=this.instance)||void 0===e?void 0:e.analytics)??null}setMetadata(e,t){Rb&&this.ensureConfigured()&&this.instance&&this.instance.setMetadata(e,t)}getSessionURL(e){if(Rb&&this.ensureConfigured()&&this.instance)return this.instance.getSessionURL(e)}getSessionID(){return Rb&&this.ensureConfigured()&&this.instance?this.instance.getSessionID():null}getSessionToken(){return Rb&&this.ensureConfigured()&&this.instance?this.instance.getSessionToken():null}event(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];Rb&&this.ensureConfigured()&&this.instance&&this.instance.event(e,t,n)}issue(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;Rb&&this.ensureConfigured()&&this.instance&&this.instance.issue(e,t)}handleError(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};Rb&&this.ensureConfigured()&&this.instance&&this.instance.handleError(e,t)}restartCanvasTracking(){Rb&&this.ensureConfigured()&&this.instance&&this.instance.restartCanvasTracking()}setUserAnonymousID(e){Rb&&this.ensureConfigured()&&this.instance&&this.instance.setUserAnonymousID(e)}isActive(){return!!(Rb&&this.ensureConfigured()&&this.instance)&&this.instance.isActive()}getInstance(){return this.ensureConfigured()&&Rb?this.instance:null}coldStart(e,t){if(Rb&&this.ensureConfigured()&&this.instance)return this.instance.coldStart(e,t)}trackWs(e){return Rb&&this.ensureConfigured()&&this.instance?this.instance.trackWs(e):()=>{}}ensureConfigured(){return!(!this.isConfigured&&Rb&&(console.warn('OpenReplay: Tracker must be configured before use. Call tracker.configure({projectKey: "your-project-key"}) first.'),1))}use(e){return Rb&&this.ensureConfigured()&&this.instance?this.instance.use(e):e(null)}startOfflineRecording(){if(Rb&&this.ensureConfigured()&&this.instance)return this.instance.startOfflineRecording(...arguments)}uploadOfflineRecording(){if(Rb&&this.ensureConfigured()&&this.instance)return this.instance.uploadOfflineRecording()}forceFlushBatch(){if(Rb&&this.ensureConfigured()&&this.instance)return this.instance.forceFlushBatch()}getSessionInfo(){return Rb&&this.ensureConfigured()&&this.instance?this.instance.getSessionInfo():null}getTabId(){return Rb&&this.ensureConfigured()&&this.instance?this.instance.getTabId():null}resanitize(e){if(Rb&&this.ensureConfigured()&&this.instance)return this.instance.resanitize(e)}checkSanitization(e){if(Rb&&this.ensureConfigured()&&this.instance)return this.instance.checkSanitization(e)}incident(e){Rb&&this.ensureConfigured()&&this.instance&&this.instance.incident(e)}setAnalyticsToken(e){Rb&&this.ensureConfigured()&&this.instance&&this.instance.setAnalyticsToken(e)}getAnalyticsToken(){if(Rb&&this.ensureConfigured()&&this.instance)return this.instance.getAnalyticsToken()}};const qT=["v","c","gc","av","ava","mode","step","source","lang","locale","cc","page","pageId","workspaceID"];function VT(e){try{const t=new URL(e,window.location.origin);let n=!1;for(const e of[...t.searchParams.keys()])qT.includes(e)||(t.searchParams.set(e,"[redacted]"),n=!0);return n?t.toString():e}catch(t){return e}}const JT=["accept","accept-language","content-length","content-type","x-napkin-client-version","x-napkin-workspace-id"];function KT(e){const t={};if(!e)return t;for(const n in e){if(!JT.includes(String(n).toLowerCase()))continue;const r=e[n];t[n]=Array.isArray(r)?r.join(", "):String(r)}return t}function GT(e){try{e.url=VT(e.url),e.request&&(e.request.headers=KT(e.request.headers),e.request.body=null),e.response&&(e.response.headers=KT(e.response.headers),e.response.body=null)}catch(e){return console.error("[OpenReplay] Error in network sanitizer: ",e),null}return e}window.NapkinOR={isReady:!1,_consented:!1,_starting:!1,init:function(){try{let e=window.location.hostname;if(e.includes("local"))return void console.debug("Skipping OpenReplay on local environment.",e);this.tracker=new HT({projectKey:yb()?"cbgbztuPekV3M03yAwgW":"sIYm7m3QcT2tIXsUb9tx",ingestPoint:"https://or.api.napkin.ai/ingest",disableSprites:!0,capturePerformance:!0,consoleThrottling:500,resolveURL:VT,__DISABLE_SECURE_MODE:!0!==yb(),network:{capturePayload:!1,sanitizer:GT}}),console.debug("[OpenReplay] Loaded (waiting for consent before starting)")}catch(e){console.error("[OpenReplay] Error in init: ",e)}},start:function(){this.tracker?(this._consented=!0,this.isReady?console.debug("[OpenReplay] Start: already started"):this._starting?console.debug("[OpenReplay] Start: already starting"):(this._starting=!0,this.tracker.start().then(()=>
1{if(this._starting=!1,this.isReady=!0,this._consented){if(console.debug("[OpenReplay] Started",this.tracker.getSessionURL()),window.NapkinSentry){var e=window.NapkinSentry.getClient();e&&(e.setTag("openReplaySessionID",this.tracker.getSessionID()),e.setTag("openReplaySessionToken",this.tracker.getSessionToken()))}}else this.stop()}).catch(e=>{this._starting=!1,console.error("[OpenReplay] Error in start: ",e)}))):console.debug("[OpenReplay] Start: no tracker instance")},stop:function(){if(this._consented=!1,this.tracker)if(this.isReady)try{this.tracker.stop()}catch(e){console.error("[OpenReplay] Error in stop: ",e)}finally{this.isReady=!1,console.debug("[OpenReplay] Stopped")}else console.debug("[OpenReplay] Stop: not started");else console.debug("[OpenReplay] Stop: no tracker instance")},getClient:function(){return this.tracker}},window.NapkinOR.init(),yb()?window.NapkinSentry.init():console.log("[Sentry] Sentry is not loaded in development mode")})(); 2//# sourceMappingURL=m.js.map?t=a10cff039
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.