hypothesis 1.985.0 → 1.989.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,80 +13,80 @@ const t=R(e.location.href),n=["annotations","group","query","appType","openSideb
13
13
  K.reset=()=>{Y={}};var X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Z=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};function J(e,t,n,r){const o=t.find((e=>"__world__"===e.id));o&&e.unshift(o);const i=e.map((e=>e.id));t=t.filter((e=>!i.includes(e.id))),t.forEach((e=>e.isMember=!1)),e.forEach((e=>e.isMember=!0));const a=e.concat(t);return a.forEach((e=>{e.canLeave=!!function(e){const t=P(e);return!t||!!t.allowLeavingGroups}(r)&&"private"===e.type})),a.forEach((e=>e.isScopedToUri=function(e,t){if(e.scopes&&e.scopes.uri_patterns.length>0&&t)return function(e,t){return void 0!==t.find((t=>e.match(t.split("*").map(Z).join(".*"))))}(t,e.scopes.uri_patterns);return!0}(e,n))),a}let Q=[];function ee(e,t,n){const r=(e=>({changeFocusModeUser:t=>{var n;e.changeFocusModeUser(t)
14
14
  ;const r=null!==(n=null==t?void 0:t.groups)&&void 0!==n?n:[],o=function(e,t){return function(e,t){return t.filter((t=>e.includes(t.id)||t.groupid&&e.includes(t.groupid)))}(e,t).map((e=>e.id))}(r,e.allGroups());r.length&&!o.length&&console.error("No matching groups found in list of filtered group IDs"),e.filterGroups(o)}}))(e);function o(e){let n=t.rpcAllowedOrigins||[];if(null==(o=e.data)||"object"!=typeof o||"2.0"!==o.jsonrpc)return;var o;if(!n.includes(e.origin))return void K(`Ignoring JSON-RPC request from non-whitelisted origin ${e.origin}`);let i=e.data;e.source.postMessage(function(e){const t=r[e.method];if(void 0===t)return{jsonrpc:"2.0",id:e.id,error:{code:-32601,message:"Method not found"}};e.params?t(...e.params):t();return{jsonrpc:"2.0",result:"ok",id:e.id}}(i),e.origin)}Q.forEach((e=>{o(e)})),Q=[],window.removeEventListener("message",te),n.addEventListener("message",o)}function te(e){Q.push(e)}ee.$inject=["store","settings","$window"];var ne=function(e,t){return ne=Object.setPrototypeOf||{
15
15
  __proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},ne(e,t)};function re(e,t){function n(){this.constructor=e}ne(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var oe,ie=function(){return ie=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ie.apply(this,arguments)};function ae(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)
16
- }finally{if(o)throw o.error}}return a}function le(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(se(arguments[t]));return e}!function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(oe||(oe={}));var ce=["fatal","error","warning","log","info","debug","critical"];function ue(){return"undefined"!=typeof __SENTRY_NO_DEBUG__&&!__SENTRY_BROWSER_BUNDLE__}function he(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var de={};function pe(){return he()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:de}var me=Object.prototype.toString;function fe(e){switch(me.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Ce(e,Error)}}function ge(e,t){return me.call(e)==="[object "+t+"]"}function ve(e){return ge(e,"ErrorEvent")}function ye(e){
17
- return ge(e,"DOMError")}function _e(e){return ge(e,"String")}function be(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function we(e){return ge(e,"Object")}function xe(e){return"undefined"!=typeof Event&&Ce(e,Event)}function ke(e){return"undefined"!=typeof Element&&Ce(e,Element)}function Se(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function Ce(e,t){try{return e instanceof t}catch(e){return!1}}function Ae(e,t){try{for(var n=e,r=[],o=0,i=0,a=" > ".length,s=void 0;n&&o++<5&&!("html"===(s=Ee(n,t))||o>1&&i+r.length*a+s.length>=80);)r.push(s),i+=s.length,n=n.parentNode;return r.reverse().join(" > ")}catch(e){return"<unknown>"}}function Ee(e,t){var n,r,o,i,a,s=e,l=[];if(!s||!s.tagName)return"";l.push(s.tagName.toLowerCase());var c=t&&t.length?t.filter((function(e){return s.getAttribute(e)})).map((function(e){return[e,s.getAttribute(e)]})):null;if(c&&c.length)c.forEach((function(e){l.push("["+e[0]+'="'+e[1]+'"]')}));else if(s.id&&l.push("#"+s.id),
18
- (n=s.className)&&_e(n))for(r=n.split(/\s+/),a=0;a<r.length;a++)l.push("."+r[a]);var u=["type","name","title","alt"];for(a=0;a<u.length;a++)o=u[a],(i=s.getAttribute(o))&&l.push("["+o+'="'+i+'"]');return l.join("")}var Te=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){return e.__proto__=t,e}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e});var Ne=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return r.message=t,r.name=n.prototype.constructor.name,Te(r,n.prototype),r}return re(t,e),t}(Error),Le=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Me(e,t){void 0===t&&(t=!1);var n=e.host,r=e.path,o=e.pass,i=e.port,a=e.projectId;return e.protocol+"://"+e.publicKey+(t&&o?":"+o:"")+"@"+n+(i?":"+i:"")+"/"+(r?r+"/":r)+a}function ze(e){return"user"in e&&!("publicKey"in e)&&(e.publicKey=e.user),{user:e.publicKey||"",protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",
19
- path:e.path||"",projectId:e.projectId}}function Oe(e){var t="string"==typeof e?function(e){var t=Le.exec(e);if(!t)throw new Ne("Invalid Sentry Dsn: "+e);var n=se(t.slice(1),6),r=n[0],o=n[1],i=n[2],a=void 0===i?"":i,s=n[3],l=n[4],c=void 0===l?"":l,u="",h=n[5],d=h.split("/");if(d.length>1&&(u=d.slice(0,-1).join("/"),h=d.pop()),h){var p=h.match(/^\d+/);p&&(h=p[0])}return ze({host:s,pass:a,path:u,projectId:h,port:c,protocol:r,publicKey:o})}(e):ze(e);return function(e){if(ue()){var t=e.port,n=e.projectId,r=e.protocol;if(["protocol","publicKey","host","projectId"].forEach((function(t){if(!e[t])throw new Ne("Invalid Sentry Dsn: "+t+" missing")})),!n.match(/^\d+$/))throw new Ne("Invalid Sentry Dsn: Invalid projectId "+n);if(!function(e){return"http"===e||"https"===e}(r))throw new Ne("Invalid Sentry Dsn: Invalid protocol "+r);if(t&&isNaN(parseInt(t,10)))throw new Ne("Invalid Sentry Dsn: Invalid port "+t)}}(t),t}var Ie=pe(),Re="Sentry Logger ";function Pe(e){var t=pe();if(!("console"in t))return e()
20
- ;var n=t.console,r={};["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var o=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),o}var De=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Pe((function(){Ie.console.log(Re+"[Log]: "+e.join(" "))}))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Pe((function(){Ie.console.warn(Re+"[Warn]: "+e.join(" "))}))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Pe((function(){Ie.console.error(Re+"[Error]: "+e.join(" "))}))},e}();Ie.__SENTRY__=Ie.__SENTRY__||{};var Be=Ie.__SENTRY__.logger||(Ie.__SENTRY__.logger=new De);function Fe(e){try{
21
- return e&&"function"==typeof e&&e.name||"<anonymous>"}catch(e){return"<anonymous>"}}function je(e,t){return void 0===t&&(t=0),"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function He(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r<e.length;r++){var o=e[r];try{n.push(String(o))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function qe(e,t){return!!_e(e)&&(ge(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function Ue(e,t,n){if(t in e){var r=e[t],o=n(r);if("function"==typeof o)try{Ge(o,r)}catch(e){}e[t]=o}}function $e(e,t,n){Object.defineProperty(e,t,{value:n})}function Ge(e,t){var n=t.prototype||{};e.prototype=t.prototype=n,$e(e,"__sentry_original__",t)}function Ve(e){return e.__sentry_original__}function We(e){if(fe(e)){var t=e,n={message:t.message,name:t.name,stack:t.stack};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}if(xe(e)){var o=e,i={};i.type=o.type;try{
22
- i.target=ke(o.target)?Ae(o.target):Object.prototype.toString.call(o.target)}catch(e){i.target="<unknown>"}try{i.currentTarget=ke(o.currentTarget)?Ae(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(e){i.currentTarget="<unknown>"}for(var a in"undefined"!=typeof CustomEvent&&Ce(e,CustomEvent)&&(i.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a]);return i}return e}function Ye(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function Ke(e,t,n){void 0===t&&(t=3),void 0===n&&(n=102400);var r=Je(e,t);return Ye(r)>n?Ke(e,t-1,n):r}function Xe(e,t){
23
- return"domain"===t&&e&&"object"==typeof e&&e._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!=typeof global&&e===global?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":we(n=e)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?"[Function: "+Fe(e)+"]":"symbol"==typeof e?"["+String(e)+"]":"bigint"==typeof e?"[BigInt: "+String(e)+"]":e;var n}function Ze(e,t,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=function(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(var r=0;r<t.length;r++)if(t[r]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(var r=0;r<t.length;r++)if(t[r]===n){t.splice(r,1);break}}]}()),0===n)return function(e){if("string"==typeof e)return e;var t=Object.prototype.toString.call(e)
24
- ;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var n=Xe(e);return be(n)?n:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var o=Xe(t,e);if(be(o))return o;var i=We(t),a=Array.isArray(t)?[]:{};if(r[0](t))return"[Circular ~]";for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(a[s]=Ze(s,i[s],n-1,r));return r[1](t),a}function Je(e,t){try{return JSON.parse(JSON.stringify(e,(function(e,n){return Ze(e,n,t)})))}catch(e){return"**non-serializable**"}}function Qe(e,t){void 0===t&&(t=40);var n=Object.keys(We(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return je(n[0],t);for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length?o:je(o,t)}return""}function et(e){var t,n;if(we(e)){var r=e,o={};try{for(var i=ae(Object.keys(r)),a=i.next();!a.done;a=i.next()){var s=a.value;void 0!==r[s]&&(o[s]=et(r[s]))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}
25
- return o}return Array.isArray(e)?e.map(et):e}function tt(){if(!("fetch"in pe()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function nt(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function rt(){if(!tt())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}var ot,it=pe(),at={},st={};function lt(e){if(!st[e])switch(st[e]=!0,e){case"console":!function(){if(!("console"in it))return;["debug","info","warn","error","log","assert"].forEach((function(e){e in it.console&&Ue(it.console,e,(function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];ut("console",{args:n,level:e}),t&&Function.prototype.apply.call(t,it.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in it))return;var e=ut.bind(null,"dom"),t=ft(e,!0);it.document.addEventListener("click",t,!1),it.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((function(t){
26
- var n=it[t]&&it[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ue(n,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{var i=this,a=i.__sentry_instrumentation_handlers__=i.__sentry_instrumentation_handlers__||{},s=a[n]=a[n]||{refCount:0};if(!s.handler){var l=ft(e);s.handler=l,t.call(this,n,l,o)}s.refCount+=1}catch(e){}return t.call(this,n,r,o)}})),Ue(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var o=this,i=o.__sentry_instrumentation_handlers__||{},a=i[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete o.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in it))return;var e=XMLHttpRequest.prototype;Ue(e,"open",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this,o=t[1],i=r.__sentry_xhr__={
27
- method:_e(t[0])?t[0].toUpperCase():t[0],url:t[1]};_e(o)&&"POST"===i.method&&o.match(/sentry_key/)&&(r.__sentry_own_request__=!0);var a=function(){if(4===r.readyState){try{i.status_code=r.status}catch(e){}ut("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:r})}};return"onreadystatechange"in r&&"function"==typeof r.onreadystatechange?Ue(r,"onreadystatechange",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return a(),e.apply(r,t)}})):r.addEventListener("readystatechange",a),e.apply(r,t)}})),Ue(e,"send",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),ut("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!function(){if(!tt())return!1;var e=pe();if(nt(e.fetch))return!0;var t=!1,n=e.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,
28
- n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=nt(r.contentWindow.fetch)),n.head.removeChild(r)}catch(e){ue()&&Be.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}())return;Ue(it,"fetch",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r={args:t,fetchData:{method:ht(t),url:dt(t)},startTimestamp:Date.now()};return ut("fetch",ie({},r)),e.apply(it,t).then((function(e){return ut("fetch",ie(ie({},r),{endTimestamp:Date.now(),response:e})),e}),(function(e){throw ut("fetch",ie(ie({},r),{endTimestamp:Date.now(),error:e})),e}))}}))}();break;case"history":!function(){if(!function(){var e=pe(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}())return;var e=it.onpopstate;function t(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.length>2?t[2]:void 0;if(r){var o=ot,i=String(r);ot=i,ut("history",{from:o,to:i})}
29
- return e.apply(this,t)}}it.onpopstate=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=it.location.href,o=ot;if(ot=r,ut("history",{from:o,to:r}),e)try{return e.apply(this,t)}catch(e){}},Ue(it.history,"pushState",t),Ue(it.history,"replaceState",t)}();break;case"error":gt=it.onerror,it.onerror=function(e,t,n,r,o){return ut("error",{column:r,error:o,line:n,msg:e,url:t}),!!gt&&gt.apply(this,arguments)};break;case"unhandledrejection":vt=it.onunhandledrejection,it.onunhandledrejection=function(e){return ut("unhandledrejection",e),!vt||vt.apply(this,arguments)};break;default:Be.warn("unknown instrumentation type:",e)}}function ct(e,t){at[e]=at[e]||[],at[e].push(t),lt(e)}function ut(e,t){var n,r;if(e&&at[e])try{for(var o=ae(at[e]||[]),i=o.next();!i.done;i=o.next()){var a=i.value;try{a(t)}catch(t){ue()&&Be.error("Error while triggering instrumentation handler.\nType: "+e+"\nName: "+Fe(a)+"\nError: "+t)}}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{
30
- if(n)throw n.error}}}function ht(e){return void 0===e&&(e=[]),"Request"in it&&Ce(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function dt(e){return void 0===e&&(e=[]),"string"==typeof e[0]?e[0]:"Request"in it&&Ce(e[0],Request)?e[0].url:String(e[0])}var pt,mt;function ft(e,t){return void 0===t&&(t=!1),function(n){if(n&&mt!==n&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===pt||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(mt,n))&&(e({event:n,name:r,global:t}),mt=n),clearTimeout(pt),pt=it.setTimeout((function(){pt=void 0}),1e3)}}}var gt=null;var vt=null;function yt(){var e=pe(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),
16
+ }finally{if(o)throw o.error}}return a}function le(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(se(arguments[t]));return e}function ce(){return"undefined"!=typeof __SENTRY_NO_DEBUG__&&!__SENTRY_BROWSER_BUNDLE__}function ue(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}!function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(oe||(oe={}));var he={};function de(){return ue()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:he}var pe=Object.prototype.toString;function me(e){switch(pe.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Se(e,Error)}}function fe(e,t){return pe.call(e)==="[object "+t+"]"}function ge(e){return fe(e,"ErrorEvent")}function ve(e){return fe(e,"DOMError")}function ye(e){return fe(e,"String")}function _e(e){
17
+ return null===e||"object"!=typeof e&&"function"!=typeof e}function be(e){return fe(e,"Object")}function we(e){return"undefined"!=typeof Event&&Se(e,Event)}function xe(e){return"undefined"!=typeof Element&&Se(e,Element)}function ke(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function Se(e,t){try{return e instanceof t}catch(e){return!1}}function Ce(e,t){try{for(var n=e,r=[],o=0,i=0,a=" > ".length,s=void 0;n&&o++<5&&!("html"===(s=Ae(n,t))||o>1&&i+r.length*a+s.length>=80);)r.push(s),i+=s.length,n=n.parentNode;return r.reverse().join(" > ")}catch(e){return"<unknown>"}}function Ae(e,t){var n,r,o,i,a,s=e,l=[];if(!s||!s.tagName)return"";l.push(s.tagName.toLowerCase());var c=t&&t.length?t.filter((function(e){return s.getAttribute(e)})).map((function(e){return[e,s.getAttribute(e)]})):null;if(c&&c.length)c.forEach((function(e){l.push("["+e[0]+'="'+e[1]+'"]')}));else if(s.id&&l.push("#"+s.id),(n=s.className)&&ye(n))for(r=n.split(/\s+/),a=0;a<r.length;a++)l.push("."+r[a]);var u=["type","name","title","alt"]
18
+ ;for(a=0;a<u.length;a++)o=u[a],(i=s.getAttribute(o))&&l.push("["+o+'="'+i+'"]');return l.join("")}var Ee=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){return e.__proto__=t,e}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e});var Te=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return r.message=t,r.name=n.prototype.constructor.name,Ee(r,n.prototype),r}return re(t,e),t}(Error),Ne=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Le(e,t){void 0===t&&(t=!1);var n=e.host,r=e.path,o=e.pass,i=e.port,a=e.projectId;return e.protocol+"://"+e.publicKey+(t&&o?":"+o:"")+"@"+n+(i?":"+i:"")+"/"+(r?r+"/":r)+a}function Me(e){return"user"in e&&!("publicKey"in e)&&(e.publicKey=e.user),{user:e.publicKey||"",protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function ze(e){var t="string"==typeof e?function(e){var t=Ne.exec(e)
19
+ ;if(!t)throw new Te("Invalid Sentry Dsn: "+e);var n=se(t.slice(1),6),r=n[0],o=n[1],i=n[2],a=void 0===i?"":i,s=n[3],l=n[4],c=void 0===l?"":l,u="",h=n[5],d=h.split("/");if(d.length>1&&(u=d.slice(0,-1).join("/"),h=d.pop()),h){var p=h.match(/^\d+/);p&&(h=p[0])}return Me({host:s,pass:a,path:u,projectId:h,port:c,protocol:r,publicKey:o})}(e):Me(e);return function(e){if(ce()){var t=e.port,n=e.projectId,r=e.protocol;if(["protocol","publicKey","host","projectId"].forEach((function(t){if(!e[t])throw new Te("Invalid Sentry Dsn: "+t+" missing")})),!n.match(/^\d+$/))throw new Te("Invalid Sentry Dsn: Invalid projectId "+n);if(!function(e){return"http"===e||"https"===e}(r))throw new Te("Invalid Sentry Dsn: Invalid protocol "+r);if(t&&isNaN(parseInt(t,10)))throw new Te("Invalid Sentry Dsn: Invalid port "+t)}}(t),t}var Oe=["fatal","error","warning","log","info","debug","critical"],Ie=de(),Re="Sentry Logger ";function Pe(e){var t=de();if(!("console"in t))return e();var n=t.console,r={}
20
+ ;["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var o=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),o}var De=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Pe((function(){Ie.console.log(Re+"[Log]: "+e.join(" "))}))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Pe((function(){Ie.console.warn(Re+"[Warn]: "+e.join(" "))}))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Pe((function(){Ie.console.error(Re+"[Error]: "+e.join(" "))}))},e}();Ie.__SENTRY__=Ie.__SENTRY__||{};var Be=Ie.__SENTRY__.logger||(Ie.__SENTRY__.logger=new De);function Fe(e){try{
21
+ return e&&"function"==typeof e&&e.name||"<anonymous>"}catch(e){return"<anonymous>"}}function je(e,t){return void 0===t&&(t=0),"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function He(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r<e.length;r++){var o=e[r];try{n.push(String(o))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function qe(e,t){return!!ye(e)&&(fe(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function Ue(e,t,n){if(t in e){var r=e[t],o=n(r);if("function"==typeof o)try{Ge(o,r)}catch(e){}e[t]=o}}function $e(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function Ge(e,t){var n=t.prototype||{};e.prototype=t.prototype=n,$e(e,"__sentry_original__",t)}function Ve(e){return e.__sentry_original__}function We(e){if(me(e)){var t=e,n={message:t.message,name:t.name,stack:t.stack};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}if(we(e)){var o=e,i={};i.type=o.type;try{
22
+ i.target=xe(o.target)?Ce(o.target):Object.prototype.toString.call(o.target)}catch(e){i.target="<unknown>"}try{i.currentTarget=xe(o.currentTarget)?Ce(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(e){i.currentTarget="<unknown>"}for(var a in"undefined"!=typeof CustomEvent&&Se(e,CustomEvent)&&(i.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a]);return i}return e}function Ye(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function Ke(e,t,n){void 0===t&&(t=3),void 0===n&&(n=102400);var r=Je(e,t);return Ye(r)>n?Ke(e,t-1,n):r}function Xe(e,t){
23
+ return"domain"===t&&e&&"object"==typeof e&&e._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!=typeof global&&e===global?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":be(n=e)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?"[Function: "+Fe(e)+"]":"symbol"==typeof e?"["+String(e)+"]":"bigint"==typeof e?"[BigInt: "+String(e)+"]":e;var n}function Ze(e,t,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=function(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(var r=0;r<t.length;r++)if(t[r]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(var r=0;r<t.length;r++)if(t[r]===n){t.splice(r,1);break}}]}()),0===n)return function(e){if("string"==typeof e)return e;var t=Object.prototype.toString.call(e)
24
+ ;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var n=Xe(e);return _e(n)?n:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var o=Xe(t,e);if(_e(o))return o;var i=We(t),a=Array.isArray(t)?[]:{};if(r[0](t))return"[Circular ~]";for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(a[s]=Ze(s,i[s],n-1,r));return r[1](t),a}function Je(e,t){try{return JSON.parse(JSON.stringify(e,(function(e,n){return Ze(e,n,t)})))}catch(e){return"**non-serializable**"}}function Qe(e,t){void 0===t&&(t=40);var n=Object.keys(We(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return je(n[0],t);for(var r=n.length;r>0;r--){var o=n.slice(0,r).join(", ");if(!(o.length>t))return r===n.length?o:je(o,t)}return""}function et(e){var t,n;if(be(e)){var r=e,o={};try{for(var i=ae(Object.keys(r)),a=i.next();!a.done;a=i.next()){var s=a.value;void 0!==r[s]&&(o[s]=et(r[s]))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}
25
+ return o}return Array.isArray(e)?e.map(et):e}function tt(){if(!("fetch"in de()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(e){return!1}}function nt(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function rt(){if(!tt())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(e){return!1}}var ot,it=de(),at={},st={};function lt(e){if(!st[e])switch(st[e]=!0,e){case"console":!function(){if(!("console"in it))return;["debug","info","warn","error","log","assert"].forEach((function(e){e in it.console&&Ue(it.console,e,(function(t){return function(){for(var n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];ut("console",{args:n,level:e}),t&&t.call(it.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in it))return;var e=ut.bind(null,"dom"),t=ft(e,!0);it.document.addEventListener("click",t,!1),it.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((function(t){var n=it[t]&&it[t].prototype
26
+ ;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ue(n,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{var i=this,a=i.__sentry_instrumentation_handlers__=i.__sentry_instrumentation_handlers__||{},s=a[n]=a[n]||{refCount:0};if(!s.handler){var l=ft(e);s.handler=l,t.call(this,n,l,o)}s.refCount+=1}catch(e){}return t.call(this,n,r,o)}})),Ue(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{var o=this,i=o.__sentry_instrumentation_handlers__||{},a=i[t];a&&(a.refCount-=1,a.refCount<=0&&(e.call(this,t,a.handler,r),a.handler=void 0,delete i[t]),0===Object.keys(i).length&&delete o.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in it))return;var e=XMLHttpRequest.prototype;Ue(e,"open",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this,o=t[1],i=r.__sentry_xhr__={
27
+ method:ye(t[0])?t[0].toUpperCase():t[0],url:t[1]};ye(o)&&"POST"===i.method&&o.match(/sentry_key/)&&(r.__sentry_own_request__=!0);var a=function(){if(4===r.readyState){try{i.status_code=r.status}catch(e){}ut("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:r})}};return"onreadystatechange"in r&&"function"==typeof r.onreadystatechange?Ue(r,"onreadystatechange",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return a(),e.apply(r,t)}})):r.addEventListener("readystatechange",a),e.apply(r,t)}})),Ue(e,"send",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),ut("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!function(){if(!tt())return!1;var e=de();if(nt(e.fetch))return!0;var t=!1,n=e.document;if(n&&"function"==typeof n.createElement)try{var r=n.createElement("iframe");r.hidden=!0,
28
+ n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=nt(r.contentWindow.fetch)),n.head.removeChild(r)}catch(e){ce()&&Be.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return t}())return;Ue(it,"fetch",(function(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r={args:t,fetchData:{method:ht(t),url:dt(t)},startTimestamp:Date.now()};return ut("fetch",ie({},r)),e.apply(it,t).then((function(e){return ut("fetch",ie(ie({},r),{endTimestamp:Date.now(),response:e})),e}),(function(e){throw ut("fetch",ie(ie({},r),{endTimestamp:Date.now(),error:e})),e}))}}))}();break;case"history":!function(){if(!function(){var e=de(),t=e.chrome,n=t&&t.app&&t.app.runtime,r="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!n&&r}())return;var e=it.onpopstate;function t(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t.length>2?t[2]:void 0;if(r){var o=ot,i=String(r);ot=i,ut("history",{from:o,to:i})}
29
+ return e.apply(this,t)}}it.onpopstate=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=it.location.href,o=ot;if(ot=r,ut("history",{from:o,to:r}),e)try{return e.apply(this,t)}catch(e){}},Ue(it.history,"pushState",t),Ue(it.history,"replaceState",t)}();break;case"error":gt=it.onerror,it.onerror=function(e,t,n,r,o){return ut("error",{column:r,error:o,line:n,msg:e,url:t}),!!gt&&gt.apply(this,arguments)};break;case"unhandledrejection":vt=it.onunhandledrejection,it.onunhandledrejection=function(e){return ut("unhandledrejection",e),!vt||vt.apply(this,arguments)};break;default:Be.warn("unknown instrumentation type:",e)}}function ct(e,t){at[e]=at[e]||[],at[e].push(t),lt(e)}function ut(e,t){var n,r;if(e&&at[e])try{for(var o=ae(at[e]||[]),i=o.next();!i.done;i=o.next()){var a=i.value;try{a(t)}catch(t){ce()&&Be.error("Error while triggering instrumentation handler.\nType: "+e+"\nName: "+Fe(a)+"\nError: "+t)}}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{
30
+ if(n)throw n.error}}}function ht(e){return void 0===e&&(e=[]),"Request"in it&&Se(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function dt(e){return void 0===e&&(e=[]),"string"==typeof e[0]?e[0]:"Request"in it&&Se(e[0],Request)?e[0].url:String(e[0])}var pt,mt;function ft(e,t){return void 0===t&&(t=!1),function(n){if(n&&mt!==n&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===pt||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(mt,n))&&(e({event:n,name:r,global:t}),mt=n),clearTimeout(pt),pt=it.setTimeout((function(){pt=void 0}),1e3)}}}var gt=null;var vt=null;function yt(){var e=de(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),
31
31
  n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function _t(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function bt(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function wt(e){var t=e.message,n=e.event_id;if(t)return t;var r=bt(e);return r?r.type&&r.value?r.type+": "+r.value:r.type||r.value||n||"<unknown>":n||"<unknown>"}function xt(e,t,n){var r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function kt(e,t){var n=bt(e);if(n){var r=n.mechanism;if(n.mechanism=ie(ie(ie({},{type:"generic",
32
- handled:!0}),r),t),t&&"data"in t){var o=ie(ie({},r&&r.data),t.data);n.mechanism.data=o}}}function St(e){if(e&&e.__sentry_captured__)return!0;try{$e(e,"__sentry_captured__",!0)}catch(e){}return!1}function Ct(e){return new Et((function(t){t(e)}))}function At(e){return new Et((function(t,n){n(e)}))}var Et=function(){function e(e){var t=this;this._state=0,this._handlers=[],this._resolve=function(e){t._setResult(1,e)},this._reject=function(e){t._setResult(2,e)},this._setResult=function(e,n){0===t._state&&(Se(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._executeHandlers=function(){if(0!==t._state){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e[0]||(1===t._state&&e[1](t._value),2===t._state&&e[2](t._value),e[0]=!0)}))}};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.prototype.then=function(t,n){var r=this;return new e((function(e,o){r._handlers.push([!1,function(n){if(t)try{e(t(n))}catch(e){o(e)}else e(n)},function(t){if(n)try{e(n(t))
33
- }catch(e){o(e)}else o(t)}]),r._executeHandlers()}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var o,i;return n.then((function(e){i=!1,o=e,t&&t()}),(function(e){i=!0,o=e,t&&t()})).then((function(){i?r(o):e(o)}))}))},e}();function Tt(e){var t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return At(new Ne("Not adding Promise due to buffer limit reached."));var o=r();return-1===t.indexOf(o)&&t.push(o),o.then((function(){return n(o)})).then(null,(function(){return n(o).then(null,(function(){}))})),o},drain:function(e){return new Et((function(n,r){var o=t.length;if(!o)return n(!0);var i=setTimeout((function(){e&&e>0&&n(!1)}),e);t.forEach((function(e){Ct(e).then((function(){--o||(clearTimeout(i),n(!0))}),r)}))}))}}}function Nt(e){return"warn"===e?oe.Warning:function(e){return-1!==ce.indexOf(e)}(e)?e:oe.Log}var Lt={nowSeconds:function(){
34
- return Date.now()/1e3}};var Mt=he()?function(){try{return(e=module,t="perf_hooks",e.require(t)).performance}catch(e){return}var e,t}():function(){var e=pe().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),zt=void 0===Mt?Lt:{nowSeconds:function(){return(Mt.timeOrigin+Mt.now())/1e3}},Ot=Lt.nowSeconds.bind(Lt),It=zt.nowSeconds.bind(zt);!function(){var e=pe().performance;if(e&&e.now){var t=36e5,n=e.now(),r=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=o<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(i||s<t)&&(o<=s&&e.timeOrigin)}}();var Rt=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=le(t._breadcrumbs),n._tags=ie({},t._tags),n._extra=ie({},t._extra),n._contexts=ie({},t._contexts),
32
+ handled:!0}),r),t),t&&"data"in t){var o=ie(ie({},r&&r.data),t.data);n.mechanism.data=o}}}function St(e){if(e&&e.__sentry_captured__)return!0;try{$e(e,"__sentry_captured__",!0)}catch(e){}return!1}function Ct(e){return new Et((function(t){t(e)}))}function At(e){return new Et((function(t,n){n(e)}))}var Et=function(){function e(e){var t=this;this._state=0,this._handlers=[],this._resolve=function(e){t._setResult(1,e)},this._reject=function(e){t._setResult(2,e)},this._setResult=function(e,n){0===t._state&&(ke(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._executeHandlers=function(){if(0!==t._state){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e[0]||(1===t._state&&e[1](t._value),2===t._state&&e[2](t._value),e[0]=!0)}))}};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.prototype.then=function(t,n){var r=this;return new e((function(e,o){r._handlers.push([!1,function(n){if(t)try{e(t(n))}catch(e){o(e)}else e(n)},function(t){if(n)try{e(n(t))
33
+ }catch(e){o(e)}else o(t)}]),r._executeHandlers()}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var o,i;return n.then((function(e){i=!1,o=e,t&&t()}),(function(e){i=!0,o=e,t&&t()})).then((function(){i?r(o):e(o)}))}))},e}();function Tt(e){var t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return At(new Te("Not adding Promise due to buffer limit reached."));var o=r();return-1===t.indexOf(o)&&t.push(o),o.then((function(){return n(o)})).then(null,(function(){return n(o).then(null,(function(){}))})),o},drain:function(e){return new Et((function(n,r){var o=t.length;if(!o)return n(!0);var i=setTimeout((function(){e&&e>0&&n(!1)}),e);t.forEach((function(e){Ct(e).then((function(){--o||(clearTimeout(i),n(!0))}),r)}))}))}}}function Nt(e){return"warn"===e?oe.Warning:function(e){return-1!==Oe.indexOf(e)}(e)?e:oe.Log}var Lt={nowSeconds:function(){
34
+ return Date.now()/1e3}};var Mt=ue()?function(){try{return(e=module,t="perf_hooks",e.require(t)).performance}catch(e){return}var e,t}():function(){var e=de().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),zt=void 0===Mt?Lt:{nowSeconds:function(){return(Mt.timeOrigin+Mt.now())/1e3}},Ot=Lt.nowSeconds.bind(Lt),It=zt.nowSeconds.bind(zt);!function(){var e=de().performance;if(e&&e.now){var t=36e5,n=e.now(),r=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=o<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(i||s<t)&&(o<=s&&e.timeOrigin)}}();var Rt=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=le(t._breadcrumbs),n._tags=ie({},t._tags),n._extra=ie({},t._extra),n._contexts=ie({},t._contexts),
35
35
  n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=le(t._eventProcessors),n._requestSession=t._requestSession),n},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(e){return this._requestSession=e,this},e.prototype.setTags=function(e){return this._tags=ie(ie({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=ie(ie({},this._tags),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){
36
36
  return this._extra=ie(ie({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=ie(ie({},this._extra),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var n;return null===t?delete this._contexts[e]:this._contexts=ie(ie({},this._contexts),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e=this.getSpan();return e&&e.transaction},e.prototype.setSession=function(e){
37
- return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=ie(ie({},this._tags),t._tags),this._extra=ie(ie({},this._extra),t._extra),this._contexts=ie(ie({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):we(t)&&(t=t,this._tags=ie(ie({},this._tags),t.tags),this._extra=ie(ie({},this._extra),t.extra),this._contexts=ie(ie({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},
37
+ return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=ie(ie({},this._tags),t._tags),this._extra=ie(ie({},this._extra),t._extra),this._contexts=ie(ie({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):be(t)&&(t=t,this._tags=ie(ie({},this._tags),t.tags),this._extra=ie(ie({},this._extra),t.extra),this._contexts=ie(ie({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},
38
38
  this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r=ie({timestamp:Ot()},e);return this._breadcrumbs=le(this._breadcrumbs,[r]).slice(-n),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){if(this._extra&&Object.keys(this._extra).length&&(e.extra=ie(ie({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=ie(ie({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=ie(ie({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=ie(ie({},this._contexts),e.contexts)),this._level&&(e.level=this._level),
39
- this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=ie({trace:this._span.getTraceContext()},e.contexts);var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags=ie({transaction:n},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=le(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(le(Pt(),this._eventProcessors),e,t)},e.prototype.setSDKProcessingMetadata=function(e){return this._sdkProcessingMetadata=ie(ie({},this._sdkProcessingMetadata),e),this},e.prototype._notifyEventProcessors=function(e,t,n,r){var o=this;return void 0===r&&(r=0),new Et((function(i,a){var s=e[r];if(null===t||"function"!=typeof s)i(t);else{var l=s(ie({},t),n);Se(l)?l.then((function(t){return o._notifyEventProcessors(e,t,n,r+1).then(i)})).then(null,a):o._notifyEventProcessors(e,l,n,r+1).then(i).then(null,a)}}))},e.prototype._notifyScopeListeners=function(){var e=this
40
- ;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function Pt(){var e=pe();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function Dt(e){Pt().push(e)}var Bt=function(){function e(e){this.errors=0,this.sid=yt(),this.duration=0,this.status="ok",this.init=!0,this.ignoreDuration=!1;var t=It();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),
39
+ this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=ie({trace:this._span.getTraceContext()},e.contexts);var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags=ie({transaction:n},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=le(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(le(Pt(),this._eventProcessors),e,t)},e.prototype.setSDKProcessingMetadata=function(e){return this._sdkProcessingMetadata=ie(ie({},this._sdkProcessingMetadata),e),this},e.prototype._notifyEventProcessors=function(e,t,n,r){var o=this;return void 0===r&&(r=0),new Et((function(i,a){var s=e[r];if(null===t||"function"!=typeof s)i(t);else{var l=s(ie({},t),n);ke(l)?l.then((function(t){return o._notifyEventProcessors(e,t,n,r+1).then(i)})).then(null,a):o._notifyEventProcessors(e,l,n,r+1).then(i).then(null,a)}}))},e.prototype._notifyScopeListeners=function(){var e=this
40
+ ;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function Pt(){var e=de();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function Dt(e){Pt().push(e)}var Bt=function(){function e(e){this.errors=0,this.sid=yt(),this.duration=0,this.status="ok",this.init=!0,this.ignoreDuration=!1;var t=It();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),
41
41
  this.timestamp=e.timestamp||It(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:yt()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):"ok"===this.status?this.update({status:"exited"}):this.update()},e.prototype.toJSON=function(){return et({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),
42
42
  status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})},e}(),Ft=function(){function e(e,t,n){void 0===t&&(t=new Rt),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,e&&this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version<e},e.prototype.bindClient=function(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()},e.prototype.pushScope=function(){var e=Rt.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e},e.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){
43
43
  return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=yt(),r=t;if(!t){var o=void 0;try{throw new Error("Sentry syntheticException")}catch(e){o=e}r={originalException:e,syntheticException:o}}return this._invokeClient("captureException",e,ie(ie({},r),{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var r=this._lastEventId=yt(),o=n;if(!n){var i=void 0;try{throw new Error(e)}catch(e){i=e}o={originalException:e,syntheticException:i}}return this._invokeClient("captureMessage",e,t,ie(ie({},o),{event_id:r})),r},e.prototype.captureEvent=function(e,t){var n=yt();return"transaction"!==e.type&&(this._lastEventId=n),this._invokeClient("captureEvent",e,ie(ie({},t),{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop(),r=n.scope,o=n.client;if(r&&o){
44
44
  var i=o.getOptions&&o.getOptions()||{},a=i.beforeBreadcrumb,s=void 0===a?null:a,l=i.maxBreadcrumbs,c=void 0===l?100:l;if(!(c<=0)){var u=Ot(),h=ie({timestamp:u},e),d=s?Pe((function(){return s(h,t)})):h;null!==d&&r.addBreadcrumb(d,c)}}},e.prototype.setUser=function(e){var t=this.getScope();t&&t.setUser(e)},e.prototype.setTags=function(e){var t=this.getScope();t&&t.setTags(e)},e.prototype.setExtras=function(e){var t=this.getScope();t&&t.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getScope();n&&n.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getScope();n&&n.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getScope();n&&n.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop(),n=t.scope,r=t.client;n&&r&&e(n)},e.prototype.run=function(e){var t=Ht(this);try{e(this)}finally{Ht(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){
45
- return Be.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e){return this._callExtensionMethod("startSpan",e)},e.prototype.startTransaction=function(e,t){return this._callExtensionMethod("startTransaction",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(e){if(void 0===e&&(e=!1),e)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&n.close(),this._sendSessionUpdate(),t&&t.setSession()},e.prototype.startSession=function(e){var t=this.getStackTop(),n=t.scope,r=t.client,o=r&&r.getOptions()||{},i=o.release,a=o.environment,s=(pe().navigator||{}).userAgent,l=new Bt(ie(ie(ie({release:i,environment:a},n&&{user:n.getUser()}),s&&{userAgent:s}),e));if(n){var c=n.getSession&&n.getSession();c&&"ok"===c.status&&c.update({status:"exited"}),this.endSession(),n.setSession(l)}return l},
46
- e.prototype._sendSessionUpdate=function(){var e=this.getStackTop(),t=e.scope,n=e.client;if(t){var r=t.getSession&&t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},e.prototype._invokeClient=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.getStackTop(),i=o.scope,a=o.client;a&&a[e]&&(t=a)[e].apply(t,le(n,[i]))},e.prototype._callExtensionMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=jt(),o=r.__SENTRY__;if(o&&o.extensions&&"function"==typeof o.extensions[e])return o.extensions[e].apply(this,t);Be.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function jt(){var e=pe();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Ht(e){var t=jt(),n=$t(t);return Gt(t,e),n}function qt(){var e=jt();return Ut(e)&&!$t(e).isOlderThan(4)||Gt(e,new Ft),he()?function(e){try{var t=jt().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return $t(e)
45
+ return Be.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e){return this._callExtensionMethod("startSpan",e)},e.prototype.startTransaction=function(e,t){return this._callExtensionMethod("startTransaction",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(e){if(void 0===e&&(e=!1),e)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&n.close(),this._sendSessionUpdate(),t&&t.setSession()},e.prototype.startSession=function(e){var t=this.getStackTop(),n=t.scope,r=t.client,o=r&&r.getOptions()||{},i=o.release,a=o.environment,s=(de().navigator||{}).userAgent,l=new Bt(ie(ie(ie({release:i,environment:a},n&&{user:n.getUser()}),s&&{userAgent:s}),e));if(n){var c=n.getSession&&n.getSession();c&&"ok"===c.status&&c.update({status:"exited"}),this.endSession(),n.setSession(l)}return l},
46
+ e.prototype._sendSessionUpdate=function(){var e=this.getStackTop(),t=e.scope,n=e.client;if(t){var r=t.getSession&&t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},e.prototype._invokeClient=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.getStackTop(),i=o.scope,a=o.client;a&&a[e]&&(t=a)[e].apply(t,le(n,[i]))},e.prototype._callExtensionMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=jt(),o=r.__SENTRY__;if(o&&o.extensions&&"function"==typeof o.extensions[e])return o.extensions[e].apply(this,t);Be.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function jt(){var e=de();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Ht(e){var t=jt(),n=$t(t);return Gt(t,e),n}function qt(){var e=jt();return Ut(e)&&!$t(e).isOlderThan(4)||Gt(e,new Ft),ue()?function(e){try{var t=jt().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return $t(e)
47
47
  ;if(!Ut(n)||$t(n).isOlderThan(4)){var r=$t(e).getStackTop();Gt(n,new Ft(r.client,Rt.clone(r.scope)))}return $t(n)}catch(t){return $t(e)}}(e):$t(e)}function Ut(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function $t(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new Ft),e.__SENTRY__.hub}function Gt(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}function Vt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=qt();if(r&&r[e])return r[e].apply(r,le(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function Wt(e,t){var n;try{throw new Error("Sentry syntheticException")}catch(e){n=e}return Vt("captureException",e,{captureContext:t,originalException:e,syntheticException:n})}function Yt(e,t){Vt("setExtra",e,t)}function Kt(e){Vt("withScope",e)}function Xt(e){var t=e.protocol?e.protocol+":":"",n=e.port?":"+e.port:"";return t+"//"+e.host+n+(e.path?"/"+e.path:"")+"/api/"}
48
48
  function Zt(e,t){return""+Xt(e)+e.projectId+"/"+t+"/"}function Jt(e){return t={sentry_key:e.publicKey,sentry_version:"7"},Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&");var t}function Qt(e){return function(e){return Zt(e,"store")}(e)+"?"+Jt(e)}function en(e,t){return t||function(e){return Zt(e,"envelope")}(e)+"?"+Jt(e)}var tn=[];function nn(e){return e.reduce((function(e,t){return e.every((function(e){return t.name!==e.name}))&&e.push(t),e}),[])}function rn(e){var t={};return function(e){var t=e.defaultIntegrations&&le(e.defaultIntegrations)||[],n=e.integrations,r=le(nn(t));Array.isArray(n)?r=le(r.filter((function(e){return n.every((function(t){return t.name!==e.name}))})),nn(n)):"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var o=r.map((function(e){return e.name})),i="Debug";return-1!==o.indexOf(i)&&r.push.apply(r,le(r.splice(o.indexOf(i),1))),r}(e).forEach((function(e){t[e.name]=e,function(e){-1===tn.indexOf(e.name)&&(e.setupOnce(Dt,qt),
49
- tn.push(e.name),Be.log("Integration installed: "+e.name))}(e)})),$e(t,"initialized",!0),t}var on="Not capturing exception because it's already been captured.",an=function(){function e(e,t){this._integrations={},this._numProcessing=0,this._backend=new e(t),this._options=t,t.dsn&&(this._dsn=Oe(t.dsn))}return e.prototype.captureException=function(e,t,n){var r=this;if(!St(e)){var o=t&&t.event_id;return this._process(this._getBackend().eventFromException(e,t).then((function(e){return r._captureEvent(e,t,n)})).then((function(e){o=e}))),o}Be.log(on)},e.prototype.captureMessage=function(e,t,n,r){var o=this,i=n&&n.event_id,a=be(e)?this._getBackend().eventFromMessage(String(e),t,n):this._getBackend().eventFromException(e,n);return this._process(a.then((function(e){return o._captureEvent(e,n,r)})).then((function(e){i=e}))),i},e.prototype.captureEvent=function(e,t,n){if(!(t&&t.originalException&&St(t.originalException))){var r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((function(e){r=e}))),r}
50
- Be.log(on)},e.prototype.captureSession=function(e){this._isEnabled()?"string"!=typeof e.release?ue()&&Be.warn("Discarded session because of missing or non-string release"):(this._sendSession(e),e.update({init:!1})):ue()&&Be.warn("SDK not enabled, will not capture session.")},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.getTransport=function(){return this._getBackend().getTransport()},e.prototype.flush=function(e){var t=this;return this._isClientDoneProcessing(e).then((function(n){return t.getTransport().close(e).then((function(e){return n&&e}))}))},e.prototype.close=function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))},e.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=rn(this._options))},e.prototype.getIntegration=function(e){try{return this._integrations[e.id]||null}catch(t){
49
+ tn.push(e.name),Be.log("Integration installed: "+e.name))}(e)})),$e(t,"initialized",!0),t}var on="Not capturing exception because it's already been captured.",an=function(){function e(e,t){this._integrations={},this._numProcessing=0,this._backend=new e(t),this._options=t,t.dsn&&(this._dsn=ze(t.dsn))}return e.prototype.captureException=function(e,t,n){var r=this;if(!St(e)){var o=t&&t.event_id;return this._process(this._getBackend().eventFromException(e,t).then((function(e){return r._captureEvent(e,t,n)})).then((function(e){o=e}))),o}Be.log(on)},e.prototype.captureMessage=function(e,t,n,r){var o=this,i=n&&n.event_id,a=_e(e)?this._getBackend().eventFromMessage(String(e),t,n):this._getBackend().eventFromException(e,n);return this._process(a.then((function(e){return o._captureEvent(e,n,r)})).then((function(e){i=e}))),i},e.prototype.captureEvent=function(e,t,n){if(!(t&&t.originalException&&St(t.originalException))){var r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((function(e){r=e}))),r}
50
+ Be.log(on)},e.prototype.captureSession=function(e){this._isEnabled()?"string"!=typeof e.release?ce()&&Be.warn("Discarded session because of missing or non-string release"):(this._sendSession(e),e.update({init:!1})):ce()&&Be.warn("SDK not enabled, will not capture session.")},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.getTransport=function(){return this._getBackend().getTransport()},e.prototype.flush=function(e){var t=this;return this._isClientDoneProcessing(e).then((function(n){return t.getTransport().close(e).then((function(e){return n&&e}))}))},e.prototype.close=function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))},e.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=rn(this._options))},e.prototype.getIntegration=function(e){try{return this._integrations[e.id]||null}catch(t){
51
51
  return Be.warn("Cannot retrieve integration "+e.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(e,t){var n,r,o=!1,i=!1,a=t.exception&&t.exception.values;if(a){i=!0;try{for(var s=ae(a),l=s.next();!l.done;l=s.next()){var c=l.value.mechanism;if(c&&!1===c.handled){o=!0;break}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}var u="ok"===e.status;(u&&0===e.errors||u&&o)&&(e.update(ie(ie({},o&&{status:"crashed"}),{errors:e.errors||Number(i||o)})),this.captureSession(e))},e.prototype._sendSession=function(e){this._getBackend().sendSession(e)},e.prototype._isClientDoneProcessing=function(e){var t=this;return new Et((function(n){var r=0,o=setInterval((function(){0==t._numProcessing?(clearInterval(o),n(!0)):(r+=1,e&&r>=e&&(clearInterval(o),n(!1)))}),1)}))},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},
52
52
  e.prototype._prepareEvent=function(e,t,n){var r=this,o=this.getOptions().normalizeDepth,i=void 0===o?3:o,a=ie(ie({},e),{event_id:e.event_id||(n&&n.event_id?n.event_id:yt()),timestamp:e.timestamp||Ot()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var s=t;n&&n.captureContext&&(s=Rt.clone(s).update(n.captureContext));var l=Ct(a);return s&&(l=s.applyToEvent(a,n)),l.then((function(e){return"number"==typeof i&&i>0?r._normalizeEvent(e,i):e}))},e.prototype._normalizeEvent=function(e,t){if(!e)return null;var n=ie(ie(ie(ie(ie({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((function(e){return ie(ie({},e),e.data&&{data:Je(e.data,t)})}))}),e.user&&{user:Je(e.user,t)}),e.contexts&&{contexts:Je(e.contexts,t)}),e.extra&&{extra:Je(e.extra,t)});return e.contexts&&e.contexts.trace&&(n.contexts.trace=e.contexts.trace),e.sdkProcessingMetadata=ie(ie({},e.sdkProcessingMetadata),{baseClientNormalized:!0}),n},e.prototype._applyClientOptions=function(e){
53
53
  var t=this.getOptions(),n=t.environment,r=t.release,o=t.dist,i=t.maxValueLength,a=void 0===i?250:i;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==o&&(e.dist=o),e.message&&(e.message=je(e.message,a));var s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=je(s.value,a));var l=e.request;l&&l.url&&(l.url=je(l.url,a))},e.prototype._applyIntegrationsMetadata=function(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=le(e.sdk.integrations||[],t))},e.prototype._sendEvent=function(e){this._getBackend().sendEvent(e)},e.prototype._captureEvent=function(e,t,n){return this._processEvent(e,t,n).then((function(e){return e.event_id}),(function(e){Be.error(e)}))},e.prototype._processEvent=function(e,t,n){var r=this,o=this.getOptions(),i=o.beforeSend,a=o.sampleRate,s=this.getTransport();function l(e,t){s.recordLostEvent&&s.recordLostEvent(e,t)}
54
- if(!this._isEnabled())return At(new Ne("SDK not enabled, will not capture event."));var c="transaction"===e.type;return!c&&"number"==typeof a&&Math.random()>a?(l("sample_rate","event"),At(new Ne("Discarding event because it's not included in the random sample (sampling rate = "+a+")"))):this._prepareEvent(e,n,t).then((function(n){if(null===n)throw l("event_processor",e.type||"event"),new Ne("An event processor returned null, will not send event.");return t&&t.data&&!0===t.data.__sentry__||c||!i?n:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(Se(e))return e.then((function(e){if(!we(e)&&null!==e)throw new Ne(t);return e}),(function(e){throw new Ne("beforeSend rejected with "+e)}));if(!we(e)&&null!==e)throw new Ne(t);return e}(i(n,t))})).then((function(t){if(null===t)throw l("before_send",e.type||"event"),new Ne("`beforeSend` returned `null`, will not send event.");var o=n&&n.getSession&&n.getSession();return!c&&o&&r._updateSessionFromEvent(o,t),r._sendEvent(t),t
55
- })).then(null,(function(e){if(e instanceof Ne)throw e;throw r.captureException(e,{data:{__sentry__:!0},originalException:e}),new Ne("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)}))},e.prototype._process=function(e){var t=this;this._numProcessing+=1,e.then((function(e){return t._numProcessing-=1,e}),(function(e){return t._numProcessing-=1,e}))},e}();var sn=function(){function e(){}return e.prototype.sendEvent=function(e){return Ct({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:"skipped"})},e.prototype.close=function(e){return Ct(!0)},e}(),ln=function(){function e(e){this._options=e,this._options.dsn||Be.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype.eventFromException=function(e,t){throw new Ne("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(e,t,n){
56
- throw new Ne("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(e){this._transport.sendEvent(e).then(null,(function(e){ue()&&Be.error("Error while sending event: "+e)}))},e.prototype.sendSession=function(e){this._transport.sendSession?this._transport.sendSession(e).then(null,(function(e){ue()&&Be.error("Error while sending session: "+e)})):ue()&&Be.warn("Dropping session because custom transport doesn't implement sendSession")},e.prototype.getTransport=function(){return this._transport},e.prototype._setupTransport=function(){return new sn},e}();function cn(e){if(e.metadata&&e.metadata.sdk){var t=e.metadata.sdk;return{name:t.name,version:t.version}}}function un(e,t){var n,r=cn(t),o=e.type||"event",i="transaction"===o||!!t.tunnel,a=(e.sdkProcessingMetadata||{}).transactionSampling||{},s=a.method,l=a.rate;!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=le(e.sdk.integrations||[],t.integrations||[]),
57
- e.sdk.packages=le(e.sdk.packages||[],t.packages||[]))}(e,t.metadata.sdk),e.tags=e.tags||{},e.extra=e.extra||{},e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized||(e.tags.skippedNormalization=!0),delete e.sdkProcessingMetadata;try{n=JSON.stringify(e)}catch(t){e.tags.JSONStringifyError=!0,e.extra.JSONStringifyError=t;try{n=JSON.stringify(Je(e))}catch(e){var c=e;n=JSON.stringify({message:"JSON.stringify error after renormalization",extra:{message:c.message,stack:c.stack}})}}var u={body:n,type:o,url:i?en(t.dsn,t.tunnel):Qt(t.dsn)};if(i){var h=JSON.stringify(ie(ie({event_id:e.event_id,sent_at:(new Date).toISOString()},r&&{sdk:r}),!!t.tunnel&&{dsn:Me(t.dsn)}))+"\n"+JSON.stringify({type:o,sample_rates:[{id:s,rate:l}]})+"\n"+u.body;u.body=h}return u}var hn,dn=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){hn=Function.prototype.toString,Function.prototype.toString=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ve(this)||this
58
- ;return hn.apply(n,e)}},e.id="FunctionToString",e}(),pn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],mn=function(){function e(t){void 0===t&&(t={}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(){Dt((function(t){var n=qt();if(!n)return t;var r=n.getIntegration(e);if(r){var o=n.getClient(),i=o?o.getOptions():{},a="function"==typeof r._mergeOptions?r._mergeOptions(i):{};return"function"!=typeof r._shouldDropEvent?t:r._shouldDropEvent(t,a)?null:t}return t}))},e.prototype._shouldDropEvent=function(e,t){return this._isSentryError(e,t)?(ue()&&Be.warn("Event dropped due to being internal Sentry Error.\nEvent: "+wt(e)),!0):this._isIgnoredError(e,t)?(ue()&&Be.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+wt(e)),!0):this._isDeniedUrl(e,t)?(ue()&&Be.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+wt(e)+".\nUrl: "+this._getEventFilterUrl(e)),
59
- !0):!this._isAllowedUrl(e,t)&&(ue()&&Be.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+wt(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0)},e.prototype._isSentryError=function(e,t){if(!t.ignoreInternal)return!1;try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1},e.prototype._isIgnoredError=function(e,t){return!(!t.ignoreErrors||!t.ignoreErrors.length)&&this._getPossibleEventMessages(e).some((function(e){return t.ignoreErrors.some((function(t){return qe(e,t)}))}))},e.prototype._isDeniedUrl=function(e,t){if(!t.denyUrls||!t.denyUrls.length)return!1;var n=this._getEventFilterUrl(e);return!!n&&t.denyUrls.some((function(e){return qe(n,e)}))},e.prototype._isAllowedUrl=function(e,t){if(!t.allowUrls||!t.allowUrls.length)return!0;var n=this._getEventFilterUrl(e);return!n||t.allowUrls.some((function(e){return qe(n,e)}))},e.prototype._mergeOptions=function(e){return void 0===e&&(e={}),{
60
- allowUrls:le(this._options.whitelistUrls||[],this._options.allowUrls||[],e.whitelistUrls||[],e.allowUrls||[]),denyUrls:le(this._options.blacklistUrls||[],this._options.denyUrls||[],e.blacklistUrls||[],e.denyUrls||[]),ignoreErrors:le(this._options.ignoreErrors||[],e.ignoreErrors||[],pn),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},e.prototype._getPossibleEventMessages=function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},n=t.type,r=void 0===n?"":n,o=t.value,i=void 0===o?"":o;return[""+i,r+": "+i]}catch(t){return ue()&&Be.error("Cannot extract message for event "+wt(e)),[]}return[]},e.prototype._getLastValidUrl=function(e){void 0===e&&(e=[]);for(var t=e.length-1;t>=0;t--){var n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null},e.prototype._getEventFilterUrl=function(e){try{if(e.stacktrace)return this._getLastValidUrl(e.stacktrace.frames);var t;try{
61
- t=e.exception.values[0].stacktrace.frames}catch(e){}return t?this._getLastValidUrl(t):null}catch(t){return ue()&&Be.error("Cannot extract url for event "+wt(e)),null}},e.id="InboundFilters",e}(),fn=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,vn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,yn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,_n=/\((\S*)(?::(\d+))(?::(\d+))\)/,bn=/Minified React error #\d+;/i;function wn(e){var t=null,n=0;e&&("number"==typeof e.framesToPop?n=e.framesToPop:bn.test(e.message)&&(n=1));try{if(t=function(e){if(!e||!e.stacktrace)return null
62
- ;for(var t,n=e.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,i=n.split("\n"),a=[],s=0;s<i.length;s+=2){var l=null;(t=r.exec(i[s]))?l={url:t[2],func:t[3],args:[],line:+t[1],column:null}:(t=o.exec(i[s]))&&(l={url:t[6],func:t[3]||t[4],args:t[5]?t[5].split(","):[],line:+t[1],column:+t[2]}),l&&(!l.func&&l.line&&(l.func="?"),a.push(l))}if(!a.length)return null;return{message:Sn(e),name:e.name,stack:a}}(e),t)return kn(t,n)}catch(e){}try{if(t=function(e){var t,n;if(!e||!e.stack)return null;for(var r,o,i,a=[],s=e.stack.split("\n"),l=0;l<s.length;++l){if(o=fn.exec(s[l])){var c=o[2]&&0===o[2].indexOf("native");o[2]&&0===o[2].indexOf("eval")&&(r=_n.exec(o[2]))&&(o[2]=r[1],o[3]=r[2],o[4]=r[3]);var u=o[2]&&0===o[2].indexOf("address at ")?o[2].substr("address at ".length):o[2],h=o[1]||"?";h=(t=se(xn(h,u),2))[0],i={url:u=t[1],func:h,args:c?[o[2]]:[],line:o[3]?+o[3]:null,column:o[4]?+o[4]:null}
63
- }else if(o=vn.exec(s[l]))i={url:o[2],func:o[1]||"?",args:[],line:+o[3],column:o[4]?+o[4]:null};else{if(!(o=gn.exec(s[l])))continue;o[3]&&o[3].indexOf(" > eval")>-1&&(r=yn.exec(o[3]))?(o[1]=o[1]||"eval",o[3]=r[1],o[4]=r[2],o[5]=""):0!==l||o[5]||void 0===e.columnNumber||(a[0].column=e.columnNumber+1);u=o[3],h=o[1]||"?";h=(n=se(xn(h,u),2))[0],i={url:u=n[1],func:h,args:o[2]?o[2].split(","):[],line:o[4]?+o[4]:null,column:o[5]?+o[5]:null}}!i.func&&i.line&&(i.func="?"),a.push(i)}if(!a.length)return null;return{message:Sn(e),name:e.name,stack:a}}(e),t)return kn(t,n)}catch(e){}return{message:Sn(e),name:e&&e.name,stack:[],failed:!0}}var xn=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};function kn(e,t){try{return ie(ie({},e),{stack:e.stack.slice(t)})}catch(t){return e}}function Sn(e){var t=e&&e.message
64
- ;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Cn(e){var t=En(e.stack),n={type:e.name,value:e.message};return t&&t.length&&(n.stacktrace={frames:t}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function An(e){return{exception:{values:[Cn(e)]}}}function En(e){if(!e||!e.length)return[];var t=e,n=t[0].func||"",r=t[t.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map((function(e){return{colno:null===e.column?void 0:e.column,filename:e.url||t[0].url,function:e.func||"?",in_app:!0,lineno:null===e.line?void 0:e.line}})).reverse()}function Tn(e,t,n){var r;if(void 0===n&&(n={}),ve(e)&&e.error)return r=An(wn(e=e.error));if(ye(e)||ge(e,"DOMException")){var o=e;if("stack"in e)r=An(wn(e));else{var i=o.name||(ye(o)?"DOMError":"DOMException"),a=o.message?i+": "+o.message:i;xt(r=Nn(a,t,n),a)}
65
- return"code"in o&&(r.tags=ie(ie({},r.tags),{"DOMException.code":""+o.code})),r}return fe(e)?r=An(wn(e)):we(e)||xe(e)?(r=function(e,t,n){var r={exception:{values:[{type:xe(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+Qe(e)}]},extra:{__serialized__:Ke(e)}};if(t){var o=En(wn(t).stack);r.stacktrace={frames:o}}return r}(e,t,n.isRejection),kt(r,{synthetic:!0}),r):(xt(r=Nn(e,t,n),""+e,void 0),kt(r,{synthetic:!0}),r)}function Nn(e,t,n){void 0===n&&(n={});var r={message:e};if(n.attachStacktrace&&t){var o=En(wn(t).stack);r.stacktrace={frames:o}}return r}var Ln,Mn=pe();function zn(){if(Ln)return Ln;if(nt(Mn.fetch))return Ln=Mn.fetch.bind(Mn);var e=Mn.document,t=Mn.fetch;if(e&&"function"==typeof e.createElement)try{var n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){
66
- ue()&&Be.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Ln=t.bind(Mn)}function On(e,t){if("[object Navigator]"===Object.prototype.toString.call(Mn&&Mn.navigator)&&"function"==typeof Mn.navigator.sendBeacon)return Mn.navigator.sendBeacon.bind(Mn.navigator)(e,t);if(tt()){var n=zn();n(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(e){console.error(e)}))}else;}function In(e){return"event"===e?"error":e}var Rn=pe(),Pn=function(){function e(e){var t,n,r,o=this;this.options=e,this._buffer=Tt(30),this._rateLimits={},this._outcomes={},this._api=(t=e.dsn,n=e._metadata,r=e.tunnel,{initDsn:t,metadata:n||{},dsn:Oe(t),tunnel:r}),this.url=Qt(this._api.dsn),this.options.sendClientReports&&Rn.document&&Rn.document.addEventListener("visibilitychange",(function(){"hidden"===Rn.document.visibilityState&&o._flushOutcomes()}))}return e.prototype.sendEvent=function(e){return this._sendRequest(un(e,this._api),e)},e.prototype.sendSession=function(e){
67
- return this._sendRequest(function(e,t){var n=cn(t),r="aggregates"in e?"sessions":"session";return{body:JSON.stringify(ie(ie({sent_at:(new Date).toISOString()},n&&{sdk:n}),!!t.tunnel&&{dsn:Me(t.dsn)}))+"\n"+JSON.stringify({type:r})+"\n"+JSON.stringify(e),type:r,url:en(t.dsn,t.tunnel)}}(e,this._api),e)},e.prototype.close=function(e){return this._buffer.drain(e)},e.prototype.recordLostEvent=function(e,t){var n;if(this.options.sendClientReports){var r=In(t)+":"+e;Be.log("Adding outcome: "+r),this._outcomes[r]=(null!=(n=this._outcomes[r])?n:0)+1}},e.prototype._flushOutcomes=function(){if(this.options.sendClientReports){var e=this._outcomes;if(this._outcomes={},Object.keys(e).length){Be.log("Flushing outcomes:\n"+JSON.stringify(e,null,2));var t=en(this._api.dsn,this._api.tunnel),n=JSON.stringify(ie({},this._api.tunnel&&{dsn:Me(this._api.dsn)}))+"\n"+JSON.stringify({type:"client_report"})+"\n"+JSON.stringify({timestamp:Ot(),discarded_events:Object.keys(e).map((function(t){var n=se(t.split(":"),2),r=n[0];return{
68
- reason:n[1],category:r,quantity:e[t]}}))});try{On(t,n)}catch(e){Be.error(e)}}else Be.log("No outcomes to flush")}},e.prototype._handleResponse=function(e){var t,n=e.requestType,r=e.response,o=e.headers,i=e.resolve,a=e.reject,s=(t=r.status)>=200&&t<300?"success":429===t?"rate_limit":t>=400&&t<500?"invalid":t>=500?"failed":"unknown";this._handleRateLimit(o)&&ue()&&Be.warn("Too many "+n+" requests, backing off until: "+this._disabledUntil(n)),"success"!==s?a(r):i({status:s})},e.prototype._disabledUntil=function(e){var t=In(e);return this._rateLimits[t]||this._rateLimits.all},e.prototype._isRateLimited=function(e){return this._disabledUntil(e)>new Date(Date.now())},e.prototype._handleRateLimit=function(e){var t,n,r,o,i=Date.now(),a=e["x-sentry-rate-limits"],s=e["retry-after"];if(a){try{for(var l=ae(a.trim().split(",")),c=l.next();!c.done;c=l.next()){var u=c.value.split(":",2),h=parseInt(u[0],10),d=1e3*(isNaN(h)?60:h);try{for(var p=(r=void 0,ae(u[1].split(";"))),m=p.next();!m.done;m=p.next()){var f=m.value
69
- ;this._rateLimits[f||"all"]=new Date(i+d)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return!0}return!!s&&(this._rateLimits.all=new Date(i+function(e,t){if(!t)return 6e4;var n=parseInt(""+t,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+t);return isNaN(r)?6e4:r-e}(i,s)),!0)},e}(),Dn=function(e){function t(t,n){void 0===n&&(n=zn());var r=e.call(this,t)||this;return r._fetch=n,r}return re(t,e),t.prototype._sendRequest=function(e,t){var n=this;if(this._isRateLimited(e.type))return this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var r={body:e.body,method:"POST",referrerPolicy:rt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),
70
- void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add((function(){return new Et((function(t,o){n._fetch(e.url,r).then((function(r){var i={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:e.type,response:r,headers:i,resolve:t,reject:o})})).catch(o)}))})).then(void 0,(function(t){throw t instanceof Ne?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(Pn),Bn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re(t,e),t.prototype._sendRequest=function(e,t){var n=this;return this._isRateLimited(e.type)?(this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429})):this._buffer.add((function(){return new Et((function(t,r){var o=new XMLHttpRequest
71
- ;for(var i in o.onreadystatechange=function(){if(4===o.readyState){var i={"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")};n._handleResponse({requestType:e.type,response:o,headers:i,resolve:t,reject:r})}},o.open("POST",e.url),n.options.headers)Object.prototype.hasOwnProperty.call(n.options.headers,i)&&o.setRequestHeader(i,n.options.headers[i]);o.send(e.body)}))})).then(void 0,(function(t){throw t instanceof Ne?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(Pn),Fn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re(t,e),t.prototype.eventFromException=function(e,t){return function(e,t,n){var r=Tn(t,n&&n.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return kt(r),r.level=oe.Error,n&&n.event_id&&(r.event_id=n.event_id),Ct(r)}(this._options,e,t)},t.prototype.eventFromMessage=function(e,t,n){return void 0===t&&(t=oe.Info),function(e,t,n,r){
72
- void 0===n&&(n=oe.Info);var o=Nn(t,r&&r.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),Ct(o)}(this._options,e,t,n)},t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=ie(ie({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,sendClientReports:this._options.sendClientReports,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(t):tt()?new Dn(t):new Bn(t)},t}(ln),jn=pe(),Hn=0;function qn(){return Hn>0}function Un(){Hn+=1,setTimeout((function(){Hn-=1}))}function $n(e,t,n){if(void 0===t&&(t={}),"function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(Ve(e))return e}catch(t){return e}var o=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var o=r.map((function(e){return $n(e,t)}));return e.apply(this,o)}catch(e){throw Un(),
73
- Kt((function(n){n.addEventProcessor((function(e){return t.mechanism&&(xt(e,void 0,void 0),kt(e,t.mechanism)),e.extra=ie(ie({},e.extra),{arguments:r}),e})),Wt(e)})),e}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i])}catch(e){}Ge(o,e),$e(e,"__sentry_wrapped__",o);try{Object.getOwnPropertyDescriptor(o,"name").configurable&&Object.defineProperty(o,"name",{get:function(){return e.name}})}catch(e){}return o}function Gn(e){if(void 0===e&&(e={}),jn.document)if(e.eventId)if(e.dsn){var t=jn.document.createElement("script");t.async=!0,t.src=function(e,t){var n=Oe(e),r=Xt(n)+"embed/error-page/",o="dsn="+Me(n);for(var i in t)if("dsn"!==i)if("user"===i){if(!t.user)continue;t.user.name&&(o+="&name="+encodeURIComponent(t.user.name)),t.user.email&&(o+="&email="+encodeURIComponent(t.user.email))}else o+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i]);return r+"?"+o}(e.dsn,e),e.onLoad&&(t.onload=e.onLoad);var n=jn.document.head||jn.document.body;n&&n.appendChild(t)
74
- }else ue()&&Be.error("Missing dsn option in showReportDialog call");else ue()&&Be.error("Missing eventId option in showReportDialog call")}var Vn=function(){function e(t){this.name=e.id,this._installFunc={onerror:Wn,onunhandledrejection:Yn},this._options=ie({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50;var e=this._options;for(var t in e){var n=this._installFunc[t];n&&e[t]&&(Xn(t),n(),this._installFunc[t]=void 0)}},e.id="GlobalHandlers",e}();function Wn(){ct("error",(function(e){var t=se(Jn(),2),n=t[0],r=t[1];if(n.getIntegration(Vn)){var o=e.msg,i=e.url,a=e.line,s=e.column,l=e.error;if(!(qn()||l&&l.__sentry_own_request__)){var c=void 0===l&&_e(o)?function(e,t,n,r){var o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=ve(e)?e.message:e,a="Error",s=i.match(o);s&&(a=s[1],i=s[2]);return Kn({exception:{values:[{type:a,value:i}]}},t,n,r)}(o,i,a,s):Kn(Tn(l||o,void 0,{attachStacktrace:r,
75
- isRejection:!1}),i,a,s);c.level=oe.Error,Zn(n,l,c,"onerror")}}}))}function Yn(){ct("unhandledrejection",(function(e){var t=se(Jn(),2),n=t[0],r=t[1];if(n.getIntegration(Vn)){var o=e;try{"reason"in e?o=e.reason:"detail"in e&&"reason"in e.detail&&(o=e.detail.reason)}catch(e){}if(qn()||o&&o.__sentry_own_request__)return!0;var i=be(o)?{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(o)}]}}:Tn(o,void 0,{attachStacktrace:r,isRejection:!0});i.level=oe.Error,Zn(n,o,i,"onunhandledrejection")}}))}function Kn(e,t,n,r){var o=e.exception=e.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,h=_e(t)&&t.length>0?t:function(){var e=pe();try{return e.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:h,function:"?",in_app:!0,lineno:u}),e}function Xn(e){ue()&&Be.log("Global Handler attached: "+e)}
76
- function Zn(e,t,n,r){kt(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function Jn(){var e=qt(),t=e.getClient();return[e,t&&t.getOptions().attachStacktrace]}var Qn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],er=function(){function e(t){this.name=e.id,this._options=ie({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var e=pe();this._options.setTimeout&&Ue(e,"setTimeout",tr),this._options.setInterval&&Ue(e,"setInterval",tr),this._options.requestAnimationFrame&&Ue(e,"requestAnimationFrame",nr),
77
- this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&Ue(XMLHttpRequest.prototype,"send",rr);var t=this._options.eventTarget;t&&(Array.isArray(t)?t:Qn).forEach(or)},e.id="TryCatch",e}();function tr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0];return t[0]=$n(r,{mechanism:{data:{function:Fe(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function nr(e){return function(t){return e.call(this,$n(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Fe(e)},handled:!0,type:"instrument"}}))}}function rr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this,o=["onload","onerror","onprogress","onreadystatechange"];return o.forEach((function(e){e in r&&"function"==typeof r[e]&&Ue(r,e,(function(t){var n={mechanism:{data:{function:e,handler:Fe(t)},handled:!0,type:"instrument"}},r=Ve(t);return r&&(n.mechanism.data.handler=Fe(r)),$n(t,n)}))})),e.apply(this,t)}}function or(e){var t=pe(),n=t[e]&&t[e].prototype
78
- ;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ue(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=$n(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:Fe(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.call(this,n,$n(r,{mechanism:{data:{function:"addEventListener",handler:Fe(r),target:e},handled:!0,type:"instrument"}}),o)}})),Ue(n,"removeEventListener",(function(e){return function(t,n,r){var o=n;try{var i=o&&o.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(e){}return e.call(this,t,o,r)}})))}var ir=function(){function e(t){this.name=e.id,this._options=ie({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(e){this._options.sentry&&qt().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:wt(e)},{event:e})},e.prototype.setupOnce=function(){
79
- this._options.console&&ct("console",ar),this._options.dom&&ct("dom",function(e){function t(t){var n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?Ae(t.event.target,r):Ae(t.event,r)}catch(e){n="<unknown>"}0!==n.length&&qt().addBreadcrumb({category:"ui."+t.name,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this._options.dom)),this._options.xhr&&ct("xhr",sr),this._options.fetch&&ct("fetch",lr),this._options.history&&ct("history",cr)},e.id="Breadcrumbs",e}();function ar(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:Nt(e.level),message:He(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message="Assertion failed: "+(He(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1)}qt().addBreadcrumb(t,{input:e.args,level:e.level})}function sr(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;var t=e.xhr.__sentry_xhr__||{},n=t.method,r=t.url,o=t.status_code,i=t.body
80
- ;qt().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:o},type:"http"},{xhr:e.xhr,input:i})}else;}function lr(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?qt().addBreadcrumb({category:"fetch",data:e.fetchData,level:oe.Error,type:"http"},{data:e.error,input:e.args}):qt().addBreadcrumb({category:"fetch",data:ie(ie({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})))}function cr(e){var t=pe(),n=e.from,r=e.to,o=_t(t.location.href),i=_t(n),a=_t(r);i.path||(i=o),o.protocol===a.protocol&&o.host===a.host&&(r=a.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),qt().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}var ur=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._key=t.key||"cause",this._limit=t.limit||5}return e.prototype.setupOnce=function(){Dt((function(t,n){var r=qt().getIntegration(e);return r?function(e,t,n,r){
81
- if(!(n.exception&&n.exception.values&&r&&Ce(r.originalException,Error)))return n;var o=hr(t,r.originalException,e);return n.exception.values=le(o,n.exception.values),n}(r._key,r._limit,t,n):t}))},e.id="LinkedErrors",e}();function hr(e,t,n,r){if(void 0===r&&(r=[]),!Ce(t[n],Error)||r.length+1>=e)return r;var o=Cn(wn(t[n]));return hr(e,t[n],n,le([o],r))}var dr=pe(),pr=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){Dt((function(t){if(qt().getIntegration(e)){if(!dr.navigator&&!dr.location&&!dr.document)return t;var n=t.request&&t.request.url||dr.location&&dr.location.href,r=(dr.document||{}).referrer,o=(dr.navigator||{}).userAgent,i=ie(ie(ie({},t.request&&t.request.headers),r&&{Referer:r}),o&&{"User-Agent":o}),a=ie(ie({},n&&{url:n}),{headers:i});return ie(ie({},t),{request:a})}return t}))},e.id="UserAgent",e}(),mr=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(t,n){t((function(t){var r=n().getIntegration(e);if(r){try{if(function(e,t){if(!t)return!1
82
- ;if(function(e,t){var n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!gr(e,t))return!1;if(!fr(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){var n=vr(t),r=vr(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!gr(e,t))return!1;if(!fr(e,t))return!1;return!0}(e,t))return!0;return!1}(t,r._previousEvent))return Be.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){return r._previousEvent=t}return r._previousEvent=t}return t}))},e.id="Dedupe",e}();function fr(e,t){var n=yr(e),r=yr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,(r=r).length!==n.length)return!1;for(var o=0;o<r.length;o++){var i=r[o],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function gr(e,t){var n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function vr(e){
83
- return e.exception&&e.exception.values&&e.exception.values[0]}function yr(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}else if(e.stacktrace)return e.stacktrace.frames}var _r=function(e){function t(t){void 0===t&&(t={});return t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:"6.17.4"}],version:"6.17.4"},e.call(this,Fn,t)||this}return re(t,e),t.prototype.showReportDialog=function(e){void 0===e&&(e={}),pe().document&&(this._isEnabled()?Gn(ie(ie({},e),{dsn:e.dsn||this.getDsn()})):Be.error("Trying to call showReportDialog with Sentry Client disabled"))},t.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",e.prototype._prepareEvent.call(this,t,n,r)},t.prototype._sendEvent=function(t){var n=this.getIntegration(ir);n&&n.addSentryBreadcrumb(t),e.prototype._sendEvent.call(this,t)},t}(an),br=[new mn,new dn,new er,new ir,new Vn,new ur,new mr,new pr]
84
- ;function wr(e){if(void 0===e&&(e={}),void 0===e.defaultIntegrations&&(e.defaultIntegrations=br),void 0===e.release){var t=pe();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0),function(e,t){!0===t.debug&&Be.enable();var n=qt(),r=n.getScope();r&&r.update(t.initialScope);var o=new e(t);n.bindClient(o)}(_r,e),e.autoSessionTracking&&function(){if(void 0===pe().document)return void(ue()&&Be.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var e=qt();if(!e.captureSession)return;xr(e),ct("history",(function(e){var t=e.from,n=e.to;void 0!==t&&t!==n&&xr(qt())}))}()}function xr(e){e.startSession({ignoreDuration:!0}),e.captureSession()}function kr(e){const t=t=>{const{data:n}=t;if(n&&"hypothesis-error"===(null==n?void 0:n.type)){const{context:t,error:r}=n;e(r instanceof Error?r:function(e){const t=new Error(e.message);return t.stack=e.stack,t
85
- }(r),t)}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}let Sr=0;function Cr(e){!function(e){Vt("setUser",e)}(e)}!function(){function e(e){var t=!0,n=!1,r=null,o={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function i(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function a(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!o[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function l(e){e.hasAttribute("data-focus-visible-added")&&(e.classList.remove("focus-visible"),e.removeAttribute("data-focus-visible-added"))}function c(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=!0)}function u(e){t=!1}function h(e){
86
- i(e.target)&&(t||a(e.target))&&s(e.target)}function d(e){i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(r),r=window.setTimeout((function(){n=!1}),100),l(e.target))}function p(e){"hidden"===document.visibilityState&&(n&&(t=!0),m())}function m(){document.addEventListener("mousemove",g),document.addEventListener("mousedown",g),document.addEventListener("mouseup",g),document.addEventListener("pointermove",g),document.addEventListener("pointerdown",g),document.addEventListener("pointerup",g),document.addEventListener("touchmove",g),document.addEventListener("touchstart",g),document.addEventListener("touchend",g)}function f(){document.removeEventListener("mousemove",g),document.removeEventListener("mousedown",g),document.removeEventListener("mouseup",g),document.removeEventListener("pointermove",g),document.removeEventListener("pointerdown",g),document.removeEventListener("pointerup",g),
87
- document.removeEventListener("touchmove",g),document.removeEventListener("touchstart",g),document.removeEventListener("touchend",g)}function g(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1,f())}document.addEventListener("keydown",c,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",p,!0),m(),e.addEventListener("focus",h,!0),e.addEventListener("blur",d,!0),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(e){
88
- (t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}"undefined"!=typeof document&&e(document)}(),"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.6.5",n,{Fragment:m,Component:f});var Ar={};function Er(e){return e.type===m?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var Tr=[],Nr=[];function Lr(){return Tr.length>0?Tr[Tr.length-1]:null}var Mr=!1;function zr(e){return"function"==typeof e.type&&e.type!=m}function Or(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+Er(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":Mr||(Mr=!0,console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.")),e+"\n"}),"")}
89
- var Ir="function"==typeof WeakMap,Rr=f.prototype.setState;f.prototype.setState=function(e,t){return null==this.__v?null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+Or(Lr())):null==this.__P&&console.warn('Can\'t call "this.setState" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+Or(this.__v)),Rr.call(this,e,t)};var Pr=f.prototype.forceUpdate;function Dr(e){var t=e.props,n=Er(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var i=t[o];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+o+"="+JSON.stringify(i)}var a=t.children;return"<"+n+r+(a&&a.length?">..</"+n+">":" />")}f.prototype.forceUpdate=function(e){
54
+ if(!this._isEnabled())return At(new Te("SDK not enabled, will not capture event."));var c="transaction"===e.type;return!c&&"number"==typeof a&&Math.random()>a?(l("sample_rate","event"),At(new Te("Discarding event because it's not included in the random sample (sampling rate = "+a+")"))):this._prepareEvent(e,n,t).then((function(n){if(null===n)throw l("event_processor",e.type||"event"),new Te("An event processor returned null, will not send event.");return t&&t.data&&!0===t.data.__sentry__||c||!i?n:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(ke(e))return e.then((function(e){if(!be(e)&&null!==e)throw new Te(t);return e}),(function(e){throw new Te("beforeSend rejected with "+e)}));if(!be(e)&&null!==e)throw new Te(t);return e}(i(n,t))})).then((function(t){if(null===t)throw l("before_send",e.type||"event"),new Te("`beforeSend` returned `null`, will not send event.");var o=n&&n.getSession&&n.getSession();return!c&&o&&r._updateSessionFromEvent(o,t),r._sendEvent(t),t
55
+ })).then(null,(function(e){if(e instanceof Te)throw e;throw r.captureException(e,{data:{__sentry__:!0},originalException:e}),new Te("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)}))},e.prototype._process=function(e){var t=this;this._numProcessing+=1,e.then((function(e){return t._numProcessing-=1,e}),(function(e){return t._numProcessing-=1,e}))},e}();var sn=function(){function e(){}return e.prototype.sendEvent=function(e){return Ct({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:"skipped"})},e.prototype.close=function(e){return Ct(!0)},e}(),ln=function(){function e(e){this._options=e,this._options.dsn||Be.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype.eventFromException=function(e,t){throw new Te("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(e,t,n){
56
+ throw new Te("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(e){this._transport.sendEvent(e).then(null,(function(e){ce()&&Be.error("Error while sending event: "+e)}))},e.prototype.sendSession=function(e){this._transport.sendSession?this._transport.sendSession(e).then(null,(function(e){ce()&&Be.error("Error while sending session: "+e)})):ce()&&Be.warn("Dropping session because custom transport doesn't implement sendSession")},e.prototype.getTransport=function(){return this._transport},e.prototype._setupTransport=function(){return new sn},e}();function cn(e){if(e.metadata&&e.metadata.sdk){var t=e.metadata.sdk;return{name:t.name,version:t.version}}}function un(e,t){var n,r=cn(t),o=e.type||"event",i="transaction"===o||!!t.tunnel,a=(e.sdkProcessingMetadata||{}).transactionSampling||{},s=a.method,l=a.rate;!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=le(e.sdk.integrations||[],t.integrations||[]),
57
+ e.sdk.packages=le(e.sdk.packages||[],t.packages||[]))}(e,t.metadata.sdk),e.tags=e.tags||{},e.extra=e.extra||{},e.sdkProcessingMetadata&&e.sdkProcessingMetadata.baseClientNormalized||(e.tags.skippedNormalization=!0),delete e.sdkProcessingMetadata;try{n=JSON.stringify(e)}catch(t){e.tags.JSONStringifyError=!0,e.extra.JSONStringifyError=t;try{n=JSON.stringify(Je(e))}catch(e){var c=e;n=JSON.stringify({message:"JSON.stringify error after renormalization",extra:{message:c.message,stack:c.stack}})}}var u={body:n,type:o,url:i?en(t.dsn,t.tunnel):Qt(t.dsn)};if(i){var h=JSON.stringify(ie(ie({event_id:e.event_id,sent_at:(new Date).toISOString()},r&&{sdk:r}),!!t.tunnel&&{dsn:Le(t.dsn)}))+"\n"+JSON.stringify({type:o,sample_rates:[{id:s,rate:l}]})+"\n"+u.body;u.body=h}return u}var hn,dn=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){hn=Function.prototype.toString,Function.prototype.toString=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var n=Ve(this)||this
58
+ ;return hn.apply(n,e)}},e.id="FunctionToString",e}(),pn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],mn=function(){function e(t){void 0===t&&(t={}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(){Dt((function(t){var n=qt();if(!n)return t;var r=n.getIntegration(e);if(r){var o=n.getClient(),i=o?o.getOptions():{},a="function"==typeof r._mergeOptions?r._mergeOptions(i):{};return"function"!=typeof r._shouldDropEvent?t:r._shouldDropEvent(t,a)?null:t}return t}))},e.prototype._shouldDropEvent=function(e,t){return this._isSentryError(e,t)?(ce()&&Be.warn("Event dropped due to being internal Sentry Error.\nEvent: "+wt(e)),!0):this._isIgnoredError(e,t)?(ce()&&Be.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+wt(e)),!0):this._isDeniedUrl(e,t)?(ce()&&Be.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+wt(e)+".\nUrl: "+this._getEventFilterUrl(e)),
59
+ !0):!this._isAllowedUrl(e,t)&&(ce()&&Be.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+wt(e)+".\nUrl: "+this._getEventFilterUrl(e)),!0)},e.prototype._isSentryError=function(e,t){if(!t.ignoreInternal)return!1;try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1},e.prototype._isIgnoredError=function(e,t){return!(!t.ignoreErrors||!t.ignoreErrors.length)&&this._getPossibleEventMessages(e).some((function(e){return t.ignoreErrors.some((function(t){return qe(e,t)}))}))},e.prototype._isDeniedUrl=function(e,t){if(!t.denyUrls||!t.denyUrls.length)return!1;var n=this._getEventFilterUrl(e);return!!n&&t.denyUrls.some((function(e){return qe(n,e)}))},e.prototype._isAllowedUrl=function(e,t){if(!t.allowUrls||!t.allowUrls.length)return!0;var n=this._getEventFilterUrl(e);return!n||t.allowUrls.some((function(e){return qe(n,e)}))},e.prototype._mergeOptions=function(e){return void 0===e&&(e={}),{
60
+ allowUrls:le(this._options.whitelistUrls||[],this._options.allowUrls||[],e.whitelistUrls||[],e.allowUrls||[]),denyUrls:le(this._options.blacklistUrls||[],this._options.denyUrls||[],e.blacklistUrls||[],e.denyUrls||[]),ignoreErrors:le(this._options.ignoreErrors||[],e.ignoreErrors||[],pn),ignoreInternal:void 0===this._options.ignoreInternal||this._options.ignoreInternal}},e.prototype._getPossibleEventMessages=function(e){if(e.message)return[e.message];if(e.exception)try{var t=e.exception.values&&e.exception.values[0]||{},n=t.type,r=void 0===n?"":n,o=t.value,i=void 0===o?"":o;return[""+i,r+": "+i]}catch(t){return ce()&&Be.error("Cannot extract message for event "+wt(e)),[]}return[]},e.prototype._getLastValidUrl=function(e){void 0===e&&(e=[]);for(var t=e.length-1;t>=0;t--){var n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null},e.prototype._getEventFilterUrl=function(e){try{if(e.stacktrace)return this._getLastValidUrl(e.stacktrace.frames);var t;try{
61
+ t=e.exception.values[0].stacktrace.frames}catch(e){}return t?this._getLastValidUrl(t):null}catch(t){return ce()&&Be.error("Cannot extract url for event "+wt(e)),null}},e.id="InboundFilters",e}(),fn=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,vn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,yn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,_n=/\((\S*)(?::(\d+))(?::(\d+))\)/,bn=/Minified React error #\d+;/i;function wn(e){var t=null,n=0;e&&("number"==typeof e.framesToPop?n=e.framesToPop:bn.test(e.message)&&(n=1));try{if(t=function(e){if(!e||!e.stacktrace)return null
62
+ ;for(var t,n=e.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,i=n.split("\n"),a=[],s=0;s<i.length;s+=2){var l=null;(t=r.exec(i[s]))?l={url:t[2],func:t[3],line:+t[1],column:null}:(t=o.exec(i[s]))&&(l={url:t[5],func:t[3]||t[4],line:+t[1],column:+t[2]}),l&&(!l.func&&l.line&&(l.func="?"),a.push(l))}if(!a.length)return null;return{message:Sn(e),name:e.name,stack:a}}(e),t)return kn(t,n)}catch(e){}try{if(t=function(e){var t,n,r;if(!e||!e.stack)return null;var o,i,a,s=[],l=e.stack.split("\n");try{for(var c=ae(l),u=c.next();!u.done;u=c.next()){var h=u.value;if(i=fn.exec(h)){i[2]&&0===i[2].indexOf("eval")&&(o=_n.exec(i[2]))&&(i[2]=o[1],i[3]=o[2],i[4]=o[3]);var d=se(xn(i[1]||"?",i[2]),2),p=d[0];a={url:m=d[1],func:p,line:i[3]?+i[3]:null,column:i[4]?+i[4]:null}}else if(i=vn.exec(h))a={url:i[2],func:i[1]||"?",line:+i[3],column:i[4]?+i[4]:null};else{if(!(i=gn.exec(h)))continue
63
+ ;i[3]&&i[3].indexOf(" > eval")>-1&&(o=yn.exec(i[3]))&&(i[1]=i[1]||"eval",i[3]=o[1],i[4]=o[2],i[5]="");var m=i[3];p=i[1]||"?";p=(r=se(xn(p,m),2))[0],a={url:m=r[1],func:p,line:i[4]?+i[4]:null,column:i[5]?+i[5]:null}}s.push(a)}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}if(!s.length)return null;return{message:Sn(e),name:e.name,stack:s}}(e),t)return kn(t,n)}catch(e){}return{message:Sn(e),name:e&&e.name,stack:[],failed:!0}}var xn=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};function kn(e,t){try{return ie(ie({},e),{stack:e.stack.slice(t)})}catch(t){return e}}function Sn(e){var t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Cn(e){var t=En(e.stack),n={type:e.name,value:e.message};return t&&t.length&&(n.stacktrace={frames:t}),
64
+ void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function An(e){return{exception:{values:[Cn(e)]}}}function En(e){if(!e||!e.length)return[];var t=e,n=t[0].func||"",r=t[t.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map((function(e){return{colno:null===e.column?void 0:e.column,filename:e.url||t[0].url,function:e.func||"?",in_app:!0,lineno:null===e.line?void 0:e.line}})).reverse()}function Tn(e,t,n){var r;if(void 0===n&&(n={}),ge(e)&&e.error)return r=An(wn(e=e.error));if(ve(e)||fe(e,"DOMException")){var o=e;if("stack"in e)r=An(wn(e));else{var i=o.name||(ve(o)?"DOMError":"DOMException"),a=o.message?i+": "+o.message:i;xt(r=Nn(a,t,n),a)}return"code"in o&&(r.tags=ie(ie({},r.tags),{"DOMException.code":""+o.code})),r}return me(e)?r=An(wn(e)):be(e)||we(e)?(r=function(e,t,n){var r={exception:{values:[{type:we(e)?e.constructor.name:n?"UnhandledRejection":"Error",
65
+ value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+Qe(e)}]},extra:{__serialized__:Ke(e)}};if(t){var o=En(wn(t).stack);r.stacktrace={frames:o}}return r}(e,t,n.isRejection),kt(r,{synthetic:!0}),r):(xt(r=Nn(e,t,n),""+e,void 0),kt(r,{synthetic:!0}),r)}function Nn(e,t,n){void 0===n&&(n={});var r={message:e};if(n.attachStacktrace&&t){var o=En(wn(t).stack);r.stacktrace={frames:o}}return r}var Ln,Mn=de();function zn(){if(Ln)return Ln;if(nt(Mn.fetch))return Ln=Mn.fetch.bind(Mn);var e=Mn.document,t=Mn.fetch;if(e&&"function"==typeof e.createElement)try{var n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){ce()&&Be.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Ln=t.bind(Mn)}function On(e,t){
66
+ if("[object Navigator]"===Object.prototype.toString.call(Mn&&Mn.navigator)&&"function"==typeof Mn.navigator.sendBeacon)return Mn.navigator.sendBeacon.bind(Mn.navigator)(e,t);if(tt()){var n=zn();n(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(e){console.error(e)}))}else;}function In(e){return"event"===e?"error":e}var Rn=de(),Pn=function(){function e(e){var t,n,r,o=this;this.options=e,this._buffer=Tt(30),this._rateLimits={},this._outcomes={},this._api=(t=e.dsn,n=e._metadata,r=e.tunnel,{initDsn:t,metadata:n||{},dsn:ze(t),tunnel:r}),this.url=Qt(this._api.dsn),this.options.sendClientReports&&Rn.document&&Rn.document.addEventListener("visibilitychange",(function(){"hidden"===Rn.document.visibilityState&&o._flushOutcomes()}))}return e.prototype.sendEvent=function(e){return this._sendRequest(un(e,this._api),e)},e.prototype.sendSession=function(e){return this._sendRequest(function(e,t){var n=cn(t),r="aggregates"in e?"sessions":"session";return{body:JSON.stringify(ie(ie({
67
+ sent_at:(new Date).toISOString()},n&&{sdk:n}),!!t.tunnel&&{dsn:Le(t.dsn)}))+"\n"+JSON.stringify({type:r})+"\n"+JSON.stringify(e),type:r,url:en(t.dsn,t.tunnel)}}(e,this._api),e)},e.prototype.close=function(e){return this._buffer.drain(e)},e.prototype.recordLostEvent=function(e,t){var n;if(this.options.sendClientReports){var r=In(t)+":"+e;Be.log("Adding outcome: "+r),this._outcomes[r]=(null!=(n=this._outcomes[r])?n:0)+1}},e.prototype._flushOutcomes=function(){if(this.options.sendClientReports){var e=this._outcomes;if(this._outcomes={},Object.keys(e).length){Be.log("Flushing outcomes:\n"+JSON.stringify(e,null,2));var t=en(this._api.dsn,this._api.tunnel),n=JSON.stringify(ie({},this._api.tunnel&&{dsn:Le(this._api.dsn)}))+"\n"+JSON.stringify({type:"client_report"})+"\n"+JSON.stringify({timestamp:Ot(),discarded_events:Object.keys(e).map((function(t){var n=se(t.split(":"),2),r=n[0];return{reason:n[1],category:r,quantity:e[t]}}))});try{On(t,n)}catch(e){Be.error(e)}}else Be.log("No outcomes to flush")}},
68
+ e.prototype._handleResponse=function(e){var t,n=e.requestType,r=e.response,o=e.headers,i=e.resolve,a=e.reject,s=(t=r.status)>=200&&t<300?"success":429===t?"rate_limit":t>=400&&t<500?"invalid":t>=500?"failed":"unknown";this._handleRateLimit(o)&&ce()&&Be.warn("Too many "+n+" requests, backing off until: "+this._disabledUntil(n)),"success"!==s?a(r):i({status:s})},e.prototype._disabledUntil=function(e){var t=In(e);return this._rateLimits[t]||this._rateLimits.all},e.prototype._isRateLimited=function(e){return this._disabledUntil(e)>new Date(Date.now())},e.prototype._handleRateLimit=function(e){var t,n,r,o,i=Date.now(),a=e["x-sentry-rate-limits"],s=e["retry-after"];if(a){try{for(var l=ae(a.trim().split(",")),c=l.next();!c.done;c=l.next()){var u=c.value.split(":",2),h=parseInt(u[0],10),d=1e3*(isNaN(h)?60:h);try{for(var p=(r=void 0,ae(u[1].split(";"))),m=p.next();!m.done;m=p.next()){var f=m.value;this._rateLimits[f||"all"]=new Date(i+d)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{
69
+ if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return!0}return!!s&&(this._rateLimits.all=new Date(i+function(e,t){if(!t)return 6e4;var n=parseInt(""+t,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+t);return isNaN(r)?6e4:r-e}(i,s)),!0)},e}(),Dn=function(e){function t(t,n){void 0===n&&(n=zn());var r=e.call(this,t)||this;return r._fetch=n,r}return re(t,e),t.prototype._sendRequest=function(e,t){var n=this;if(this._isRateLimited(e.type))return this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var r={body:e.body,method:"POST",referrerPolicy:rt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add((function(){return new Et((function(t,o){
70
+ n._fetch(e.url,r).then((function(r){var i={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:e.type,response:r,headers:i,resolve:t,reject:o})})).catch(o)}))})).then(void 0,(function(t){throw t instanceof Te?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(Pn),Bn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re(t,e),t.prototype._sendRequest=function(e,t){var n=this;return this._isRateLimited(e.type)?(this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429})):this._buffer.add((function(){return new Et((function(t,r){var o=new XMLHttpRequest;for(var i in o.onreadystatechange=function(){if(4===o.readyState){var i={"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),
71
+ "retry-after":o.getResponseHeader("Retry-After")};n._handleResponse({requestType:e.type,response:o,headers:i,resolve:t,reject:r})}},o.open("POST",e.url),n.options.headers)Object.prototype.hasOwnProperty.call(n.options.headers,i)&&o.setRequestHeader(i,n.options.headers[i]);o.send(e.body)}))})).then(void 0,(function(t){throw t instanceof Te?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(Pn),Fn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re(t,e),t.prototype.eventFromException=function(e,t){return function(e,t,n){var r=Tn(t,n&&n.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return kt(r),r.level=oe.Error,n&&n.event_id&&(r.event_id=n.event_id),Ct(r)}(this._options,e,t)},t.prototype.eventFromMessage=function(e,t,n){return void 0===t&&(t=oe.Info),function(e,t,n,r){void 0===n&&(n=oe.Info);var o=Nn(t,r&&r.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return o.level=n,
72
+ r&&r.event_id&&(o.event_id=r.event_id),Ct(o)}(this._options,e,t,n)},t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=ie(ie({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,sendClientReports:this._options.sendClientReports,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(t):tt()?new Dn(t):new Bn(t)},t}(ln),jn=de(),Hn=0;function qn(){return Hn>0}function Un(){Hn+=1,setTimeout((function(){Hn-=1}))}function $n(e,t,n){if(void 0===t&&(t={}),"function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(Ve(e))return e}catch(t){return e}var o=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var o=r.map((function(e){return $n(e,t)}));return e.apply(this,o)}catch(e){throw Un(),Kt((function(n){n.addEventProcessor((function(e){return t.mechanism&&(xt(e,void 0,void 0),kt(e,t.mechanism)),
73
+ e.extra=ie(ie({},e.extra),{arguments:r}),e})),Wt(e)})),e}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i])}catch(e){}Ge(o,e),$e(e,"__sentry_wrapped__",o);try{Object.getOwnPropertyDescriptor(o,"name").configurable&&Object.defineProperty(o,"name",{get:function(){return e.name}})}catch(e){}return o}function Gn(e){if(void 0===e&&(e={}),jn.document)if(e.eventId)if(e.dsn){var t=jn.document.createElement("script");t.async=!0,t.src=function(e,t){var n=ze(e),r=Xt(n)+"embed/error-page/",o="dsn="+Le(n);for(var i in t)if("dsn"!==i)if("user"===i){if(!t.user)continue;t.user.name&&(o+="&name="+encodeURIComponent(t.user.name)),t.user.email&&(o+="&email="+encodeURIComponent(t.user.email))}else o+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i]);return r+"?"+o}(e.dsn,e),e.onLoad&&(t.onload=e.onLoad);var n=jn.document.head||jn.document.body;n&&n.appendChild(t)}else ce()&&Be.error("Missing dsn option in showReportDialog call");else ce()&&Be.error("Missing eventId option in showReportDialog call")}
74
+ var Vn=function(){function e(t){this.name=e.id,this._installFunc={onerror:Wn,onunhandledrejection:Yn},this._options=ie({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50;var e=this._options;for(var t in e){var n=this._installFunc[t];n&&e[t]&&(Xn(t),n(),this._installFunc[t]=void 0)}},e.id="GlobalHandlers",e}();function Wn(){ct("error",(function(e){var t=se(Jn(),2),n=t[0],r=t[1];if(n.getIntegration(Vn)){var o=e.msg,i=e.url,a=e.line,s=e.column,l=e.error;if(!(qn()||l&&l.__sentry_own_request__)){var c=void 0===l&&ye(o)?function(e,t,n,r){var o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=ge(e)?e.message:e,a="Error",s=i.match(o);s&&(a=s[1],i=s[2]);return Kn({exception:{values:[{type:a,value:i}]}},t,n,r)}(o,i,a,s):Kn(Tn(l||o,void 0,{attachStacktrace:r,isRejection:!1}),i,a,s);c.level=oe.Error,Zn(n,l,c,"onerror")}}}))}function Yn(){ct("unhandledrejection",(function(e){var t=se(Jn(),2),n=t[0],r=t[1]
75
+ ;if(n.getIntegration(Vn)){var o=e;try{"reason"in e?o=e.reason:"detail"in e&&"reason"in e.detail&&(o=e.detail.reason)}catch(e){}if(qn()||o&&o.__sentry_own_request__)return!0;var i=_e(o)?{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(o)}]}}:Tn(o,void 0,{attachStacktrace:r,isRejection:!0});i.level=oe.Error,Zn(n,o,i,"onunhandledrejection")}}))}function Kn(e,t,n,r){var o=e.exception=e.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,h=ye(t)&&t.length>0?t:function(){var e=de();try{return e.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:h,function:"?",in_app:!0,lineno:u}),e}function Xn(e){ce()&&Be.log("Global Handler attached: "+e)}function Zn(e,t,n,r){kt(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function Jn(){var e=qt(),t=e.getClient()
76
+ ;return[e,t&&t.getOptions().attachStacktrace]}var Qn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],er=function(){function e(t){this.name=e.id,this._options=ie({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var e=de();this._options.setTimeout&&Ue(e,"setTimeout",tr),this._options.setInterval&&Ue(e,"setInterval",tr),this._options.requestAnimationFrame&&Ue(e,"requestAnimationFrame",nr),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&Ue(XMLHttpRequest.prototype,"send",rr);var t=this._options.eventTarget
77
+ ;t&&(Array.isArray(t)?t:Qn).forEach(or)},e.id="TryCatch",e}();function tr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0];return t[0]=$n(r,{mechanism:{data:{function:Fe(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function nr(e){return function(t){return e.call(this,$n(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Fe(e)},handled:!0,type:"instrument"}}))}}function rr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this,o=["onload","onerror","onprogress","onreadystatechange"];return o.forEach((function(e){e in r&&"function"==typeof r[e]&&Ue(r,e,(function(t){var n={mechanism:{data:{function:e,handler:Fe(t)},handled:!0,type:"instrument"}},r=Ve(t);return r&&(n.mechanism.data.handler=Fe(r)),$n(t,n)}))})),e.apply(this,t)}}function or(e){var t=de(),n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Ue(n,"addEventListener",(function(t){return function(n,r,o){try{
78
+ "function"==typeof r.handleEvent&&(r.handleEvent=$n(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:Fe(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.call(this,n,$n(r,{mechanism:{data:{function:"addEventListener",handler:Fe(r),target:e},handled:!0,type:"instrument"}}),o)}})),Ue(n,"removeEventListener",(function(e){return function(t,n,r){var o=n;try{var i=o&&o.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(e){}return e.call(this,t,o,r)}})))}var ir=function(){function e(t){this.name=e.id,this._options=ie({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(e){this._options.sentry&&qt().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:wt(e)},{event:e})},e.prototype.setupOnce=function(){this._options.console&&ct("console",ar),this._options.dom&&ct("dom",function(e){function t(t){var n,r="object"==typeof e?e.serializeAttribute:void 0
79
+ ;"string"==typeof r&&(r=[r]);try{n=t.event.target?Ce(t.event.target,r):Ce(t.event,r)}catch(e){n="<unknown>"}0!==n.length&&qt().addBreadcrumb({category:"ui."+t.name,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this._options.dom)),this._options.xhr&&ct("xhr",sr),this._options.fetch&&ct("fetch",lr),this._options.history&&ct("history",cr)},e.id="Breadcrumbs",e}();function ar(e){var t={category:"console",data:{arguments:e.args,logger:"console"},level:Nt(e.level),message:He(e.args," ")};if("assert"===e.level){if(!1!==e.args[0])return;t.message="Assertion failed: "+(He(e.args.slice(1)," ")||"console.assert"),t.data.arguments=e.args.slice(1)}qt().addBreadcrumb(t,{input:e.args,level:e.level})}function sr(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;var t=e.xhr.__sentry_xhr__||{},n=t.method,r=t.url,o=t.status_code,i=t.body;qt().addBreadcrumb({category:"xhr",data:{method:n,url:r,status_code:o},type:"http"},{xhr:e.xhr,input:i})}else;}function lr(e){
80
+ e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?qt().addBreadcrumb({category:"fetch",data:e.fetchData,level:oe.Error,type:"http"},{data:e.error,input:e.args}):qt().addBreadcrumb({category:"fetch",data:ie(ie({},e.fetchData),{status_code:e.response.status}),type:"http"},{input:e.args,response:e.response})))}function cr(e){var t=de(),n=e.from,r=e.to,o=_t(t.location.href),i=_t(n),a=_t(r);i.path||(i=o),o.protocol===a.protocol&&o.host===a.host&&(r=a.relative),o.protocol===i.protocol&&o.host===i.host&&(n=i.relative),qt().addBreadcrumb({category:"navigation",data:{from:n,to:r}})}var ur=function(){function e(t){void 0===t&&(t={}),this.name=e.id,this._key=t.key||"cause",this._limit=t.limit||5}return e.prototype.setupOnce=function(){Dt((function(t,n){var r=qt().getIntegration(e);return r?function(e,t,n,r){if(!(n.exception&&n.exception.values&&r&&Se(r.originalException,Error)))return n;var o=hr(t,r.originalException,e);return n.exception.values=le(o,n.exception.values),n
81
+ }(r._key,r._limit,t,n):t}))},e.id="LinkedErrors",e}();function hr(e,t,n,r){if(void 0===r&&(r=[]),!Se(t[n],Error)||r.length+1>=e)return r;var o=Cn(wn(t[n]));return hr(e,t[n],n,le([o],r))}var dr=de(),pr=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){Dt((function(t){if(qt().getIntegration(e)){if(!dr.navigator&&!dr.location&&!dr.document)return t;var n=t.request&&t.request.url||dr.location&&dr.location.href,r=(dr.document||{}).referrer,o=(dr.navigator||{}).userAgent,i=ie(ie(ie({},t.request&&t.request.headers),r&&{Referer:r}),o&&{"User-Agent":o}),a=ie(ie({},n&&{url:n}),{headers:i});return ie(ie({},t),{request:a})}return t}))},e.id="UserAgent",e}(),mr=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(t,n){t((function(t){var r=n().getIntegration(e);if(r){try{if(function(e,t){if(!t)return!1;if(function(e,t){var n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!gr(e,t))return!1;if(!fr(e,t))return!1;return!0
82
+ }(e,t))return!0;if(function(e,t){var n=vr(t),r=vr(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!gr(e,t))return!1;if(!fr(e,t))return!1;return!0}(e,t))return!0;return!1}(t,r._previousEvent))return Be.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(e){return r._previousEvent=t}return r._previousEvent=t}return t}))},e.id="Dedupe",e}();function fr(e,t){var n=yr(e),r=yr(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(n=n,(r=r).length!==n.length)return!1;for(var o=0;o<r.length;o++){var i=r[o],a=n[o];if(i.filename!==a.filename||i.lineno!==a.lineno||i.colno!==a.colno||i.function!==a.function)return!1}return!0}function gr(e,t){var n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function vr(e){return e.exception&&e.exception.values&&e.exception.values[0]}function yr(e){var t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return
83
+ }else if(e.stacktrace)return e.stacktrace.frames}var _r=function(e){function t(t){void 0===t&&(t={});return t._metadata=t._metadata||{},t._metadata.sdk=t._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:"6.17.7"}],version:"6.17.7"},e.call(this,Fn,t)||this}return re(t,e),t.prototype.showReportDialog=function(e){void 0===e&&(e={}),de().document&&(this._isEnabled()?Gn(ie(ie({},e),{dsn:e.dsn||this.getDsn()})):Be.error("Trying to call showReportDialog with Sentry Client disabled"))},t.prototype._prepareEvent=function(t,n,r){return t.platform=t.platform||"javascript",e.prototype._prepareEvent.call(this,t,n,r)},t.prototype._sendEvent=function(t){var n=this.getIntegration(ir);n&&n.addSentryBreadcrumb(t),e.prototype._sendEvent.call(this,t)},t}(an),br=[new mn,new dn,new er,new ir,new Vn,new ur,new mr,new pr];function wr(e){if(void 0===e&&(e={}),void 0===e.defaultIntegrations&&(e.defaultIntegrations=br),void 0===e.release){var t=de()
84
+ ;t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0),function(e,t){!0===t.debug&&Be.enable();var n=qt(),r=n.getScope();r&&r.update(t.initialScope);var o=new e(t);n.bindClient(o)}(_r,e),e.autoSessionTracking&&function(){if(void 0===de().document)return void(ce()&&Be.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));var e=qt();if(!e.captureSession)return;xr(e),ct("history",(function(e){var t=e.from,n=e.to;void 0!==t&&t!==n&&xr(qt())}))}()}function xr(e){e.startSession({ignoreDuration:!0}),e.captureSession()}function kr(e){const t=t=>{const{data:n}=t;if(n&&"hypothesis-error"===(null==n?void 0:n.type)){const{context:t,error:r}=n;e(r instanceof Error?r:function(e){const t=new Error(e.message);return t.stack=e.stack,t}(r),t)}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}let Sr=0;function Cr(e){
85
+ !function(e){Vt("setUser",e)}(e)}!function(){function e(e){var t=!0,n=!1,r=null,o={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function i(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function a(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!o[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function l(e){e.hasAttribute("data-focus-visible-added")&&(e.classList.remove("focus-visible"),e.removeAttribute("data-focus-visible-added"))}function c(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=!0)}function u(e){t=!1}function h(e){i(e.target)&&(t||a(e.target))&&s(e.target)}function d(e){
86
+ i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(r),r=window.setTimeout((function(){n=!1}),100),l(e.target))}function p(e){"hidden"===document.visibilityState&&(n&&(t=!0),m())}function m(){document.addEventListener("mousemove",g),document.addEventListener("mousedown",g),document.addEventListener("mouseup",g),document.addEventListener("pointermove",g),document.addEventListener("pointerdown",g),document.addEventListener("pointerup",g),document.addEventListener("touchmove",g),document.addEventListener("touchstart",g),document.addEventListener("touchend",g)}function f(){document.removeEventListener("mousemove",g),document.removeEventListener("mousedown",g),document.removeEventListener("mouseup",g),document.removeEventListener("pointermove",g),document.removeEventListener("pointerdown",g),document.removeEventListener("pointerup",g),document.removeEventListener("touchmove",g),document.removeEventListener("touchstart",g),
87
+ document.removeEventListener("touchend",g)}function g(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1,f())}document.addEventListener("keydown",c,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",p,!0),m(),e.addEventListener("focus",h,!0),e.addEventListener("blur",d,!0),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}"undefined"!=typeof document&&e(document)}(),
88
+ "undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.6.5",n,{Fragment:m,Component:f});var Ar={};function Er(e){return e.type===m?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var Tr=[],Nr=[];function Lr(){return Tr.length>0?Tr[Tr.length-1]:null}var Mr=!1;function zr(e){return"function"==typeof e.type&&e.type!=m}function Or(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+Er(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":Mr||(Mr=!0,console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.")),e+"\n"}),"")}var Ir="function"==typeof WeakMap,Rr=f.prototype.setState;f.prototype.setState=function(e,t){
89
+ return null==this.__v?null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+Or(Lr())):null==this.__P&&console.warn('Can\'t call "this.setState" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+Or(this.__v)),Rr.call(this,e,t)};var Pr=f.prototype.forceUpdate;function Dr(e){var t=e.props,n=Er(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var i=t[o];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+o+"="+JSON.stringify(i)}var a=t.children;return"<"+n+r+(a&&a.length?">..</"+n+">":" />")}f.prototype.forceUpdate=function(e){
90
90
  return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+Or(Lr())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+Or(this.__v)),Pr.call(this,e)},function(){!function(){var e=n.__b,t=n.diffed,r=n.__,o=n.vnode,i=n.__r;n.diffed=function(e){zr(e)&&Nr.pop(),Tr.pop(),t&&t(e)},n.__b=function(t){zr(t)&&Tr.push(t),e&&e(t)},n.__=function(e,t){Nr=[],r&&r(e,t)},n.vnode=function(e){e.__o=Nr.length>0?Nr[Nr.length-1]:null,o&&o(e)},n.__r=function(e){zr(e)&&Nr.push(e),i&&i(e)}}();var e=!1,t=n.__b,r=n.diffed,o=n.vnode,i=n.__e,a=n.__,s=n.__h,l=Ir?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,c=[];n.__e=function(e,t,n){if(t&&t.__c&&"function"==typeof e.then){var r=e
91
91
  ;e=new Error("Missing Suspense. The throwing component was: "+Er(t));for(var o=t;o;o=o.__)if(o.__c&&o.__c.__c){e=r;break}if(e instanceof Error)throw e}try{i(e,t,n),"function"!=typeof e.then&&setTimeout((function(){throw e}))}catch(e){throw e}},n.__=function(e,t){if(!t)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var n;switch(t.nodeType){case 1:case 11:case 9:n=!0;break;default:n=!1}if(!n){var r=Er(e);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+t+" instead: render(<"+r+" />, "+t+");")}a&&a(e,t)},n.__b=function(n){var r=n.type,o=function e(t){return t?"function"==typeof t.type?e(t.__):t:{}}(n.__);if(e=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+Dr(n)+"\n\n"+Or(n));if(null!=r&&"object"==typeof r){
92
92
  if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+Er(n)+" = "+Dr(r)+";\n let vnode = <My"+Er(n)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+Or(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if("thead"!==r&&"tfoot"!==r&&"tbody"!==r||"table"===o.type?"tr"===r&&"thead"!==o.type&&"tfoot"!==o.type&&"tbody"!==o.type&&"table"!==o.type?console.error("Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent."+Dr(n)+"\n\n"+Or(n)):"td"===r&&"tr"!==o.type?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+Dr(n)+"\n\n"+Or(n)):"th"===r&&"tr"!==o.type&&console.error("Improper nesting of table. Your <th> should have a <tr>."+Dr(n)+"\n\n"+Or(n)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+Dr(n)+"\n\n"+Or(n)),
@@ -557,7 +557,7 @@ t.addEventListener("touchstart",i,c),t.addEventListener("wheel",i,c)),a&&Mp(t),i
557
557
  },s=t>0?`${o} (${t} available)`:o;return po(bo,{classes:qr("text-color-text","SelectionTab",{"is-selected":r}),onClick:a,onMouseDown:a,pressed:!!r,role:"tab",tabIndex:0,title:s,children:po(m,{children:[e,t>0&&!n&&po("span",{className:"text-tiny",style:"position:relative;bottom:3px;left:2px",children:t})]})})}var jp=ri((function({annotationsService:e,isLoading:t,settings:n}){const r=ii(),o=r.selectedTab(),i=r.noteCount(),a=r.annotationCount(),s=r.orphanCount(),l=r.isWaitingToAnchorAnnotations(),c=e=>{r.clearSelection(),r.selectTab(e)},u="annotation"===o&&0===a&&!l,h="note"===o&&0===i;return po("div",{className:"hyp-u-vertical-spacing--4 SelectionTabs__container",children:[po("div",{className:"hyp-u-layout-row hyp-u-horizontal-spacing--6 SelectionTabs",role:"tablist",children:[po(Fp,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),po(Fp,{count:i,isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),
558
558
  children:"Page Notes"}),s>0&&po(Fp,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&po("div",{className:"hyp-u-layout-row--justify-right",children:po(bo,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:ti(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&po(ko,{classes:"text-center",children:po("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&po(ko,{classes:"text-center",children:po("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",po("br",{}),"Create one by selecting some text and clicking the"," ",po(Mo,{classes:"m-0.5 inline -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"]);var Hp=ri((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){
559
559
  const i=Xi(),a=ii(),s=a.focusedGroupId(),l=a.hasAppliedFilter()||a.hasSelectedAnnotations(),c=a.isLoading(),u=a.isLoggedIn(),h=a.directLinkedAnnotationId(),d=h?a.findAnnotationByID(h):void 0,p=d?Hi(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,y=!(c||!h)&&!d,_=a.directLinkedGroupFetchFailed(),b=y||_,w=!b,x=!b&&!l,k=h&&!u&&!y&&!c,S=to(s);Qr((()=>{if(!S.current||S.current!==s){if(S.current){let e=a.focusState().active;a.clearSelection(),e&&a.toggleFocusMode(!0)}S.current=s}s&&m.length&&r.load({groupId:s,uris:m})}),[a,r,s,g,m]),Qr((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return Qr((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),po("div",{children:[po("h2",{className:"sr-only",children:"Annotations"}),w&&po(Tp,{}),po(Bp,{onLogin:t,onSignUp:n}),y&&po(xp,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),_&&po(xp,{
560
- errorType:"group",onLoginRequest:t}),x&&po(jp,{isLoading:c}),po(wp,{threads:i.children}),k&&po(Np,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var qp=ri((function({api:e,toastMessenger:t}){const n=ii(),r=n.routeParams().q,o=ro((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...yi(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return Qr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),po(wp,{threads:Xi().children})}),["api","toastMessenger"]);class Up{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.985.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
560
+ errorType:"group",onLoginRequest:t}),x&&po(jp,{isLoading:c}),po(wp,{threads:i.children}),k&&po(Np,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var qp=ri((function({api:e,toastMessenger:t}){const n=ii(),r=n.routeParams().q,o=ro((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...yi(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return Qr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),po(wp,{threads:Xi().children})}),["api","toastMessenger"]);class Up{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.989.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
561
561
  this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString()}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}asEncodedURLString(){return encodeURIComponent(this.asFormattedString())}}function $p(e){const t=P(e);return!(null==t||!t.authority)&&t.authority!==e.authDomain}function Gp({commandName:e,iconName:t}){return po("span",{className:"whitespace-nowrap",children:[po(Mo,{name:t,classes:qr("mx-1 -mt-1","text-color-text-light inline")}),po("em",{children:e})]})}var Vp=ri((function({settings:e}){const t=!$p(e);return po("ol",{className:"list-decimal pl-10 space-y-2",children:[po("li",{children:["To create an annotation, select text and then select the"," ",po(Gp,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),po("li",{
562
562
  children:["To create a highlight (",po(zo,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/why-are-highlights-private-by-default/",target:"_blank",children:"visible only to you"}),"), select text and then select the"," ",po(Gp,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&po("li",{children:["To annotate in a private group, select the group from the groups dropdown. Don't see your group? Ask the group creator to send a"," ",po(zo,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),po("li",{children:["To reply to an annotation, select the"," ",po(Gp,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);var Wp=ri((function({toastMessenger:e,versionData:t}){return po("div",{className:"hyp-u-vertical-spacing",children:[po("dl",{className:"VersionInfo",children:[po("dt",{className:"VersionInfo__key",children:"Version"}),po("dd",{
563
563
  className:"VersionInfo__value",children:t.version}),po("dt",{className:"VersionInfo__key",children:"User Agent"}),po("dd",{className:"VersionInfo__value",children:t.userAgent}),po("dt",{className:"VersionInfo__key",children:"URL"}),po("dd",{className:"VersionInfo__value",children:t.urls}),po("dt",{className:"VersionInfo__key",children:"Fingerprint"}),po("dd",{className:"VersionInfo__value",children:t.fingerprint}),po("dt",{className:"VersionInfo__key",children:"Account"}),po("dd",{className:"VersionInfo__value",children:t.account}),po("dt",{className:"VersionInfo__key",children:"Date"}),po("dd",{className:"VersionInfo__value",children:t.timestamp})]}),po("div",{className:"hyp-u-layout-row--justify-center",children:po(bo,{onClick:()=>{try{wa(t.asFormattedString()),e.success("Copied version info to clipboard")}catch(t){e.error("Unable to copy version info")}},icon:"copy",children:"Copy version details"})})]})}),["toastMessenger"]);function Yp({children:e,onClick:t}){return po(wo,{
@@ -585,7 +585,7 @@ className:qr("HypothesisApp","js-thread-list-scroll-root",{"theme-clean":h,"Hypo
585
585
  ;function Cm({error:e}){return po("div",{className:"LaunchErrorPanel",children:po(Ho,{title:"Unable to start Hypothesis",children:e.message})})}class Am{constructor(e,t){this._api=e,this._store=t}_applyDraftChanges(e){const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?ga(e.user):va(e.user,e.group)),{...e,...t}}_initialize(e,t=new Date){const n=this._store.getDefault("annotationPrivacy"),r=this._store.focusedGroupId(),o=this._store.profile();if(!r)throw new Error("Cannot create annotation without a group");const i=o.userid,a=o.user_info,s="s:"+U(8),l=Object.assign({created:t.toISOString(),group:r,permissions:ya(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return Li(l)&&(l.permissions=ga(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Li(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!Ai(n)}),
586
586
  zi(n)?this._store.selectTab("note"):Oi(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:Ai(e)?va(t,e.group):ga(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e){let t;const n=this._applyDraftChanges(e);let r;t=Si(e)?this._api.annotation.update({id:e.id},n):this._api.annotation.create({},n),this._store.annotationSaveStarted(e);try{r=await t}finally{this._store.annotationSaveFinished(e)}return Object.keys(e).forEach((t=>{"$"===t[0]&&(r[t]=e[t])})),
587
587
  this._store.removeDraft(e),this._store.addAnnotations([r]),r}}Am.$inject=["api","store"];class Em extends Error{constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),n&&(r+=`: ${n}`),super(r),this.url=e,this.response=t,this.reason=n}}async function Tm(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Em(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new Em(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Em(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Nm(e,t){const n={};for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],i=":"+r;-1!==e.indexOf(i)?e=e.replace(i,encodeURIComponent(String(o))):n[r]=o}return{url:e,unusedParams:n}}function Lm(e){const t={};for(const n in e)e.hasOwnProperty(n)&&"$"!==n[0]&&(t[n]=e[n]);return t}class Mm{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){
588
- return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;return t.split(".").forEach((e=>{n=n[e]})),n}(o,t),u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.985.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Nm(c.url,a),m=new URL(d);for(let[e,t]of Object.entries(p)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&m.searchParams.append(e,n.toString())}return await Tm(m.toString(),{body:s?JSON.stringify(Lm(s)):null,headers:u,method:c.method})}finally{i()}}}(r,e,{getAccessToken:t.getAccessToken,getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={create:i("annotation.create"),delete:i("annotation.delete"),get:i("annotation.read"),update:i("annotation.update"),flag:i("annotation.flag"),hide:i("annotation.hide"),unhide:i("annotation.unhide")},this.group={member:{delete:i("group.member.delete")},read:i("group.read")},this.groups={
588
+ return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;return t.split(".").forEach((e=>{n=n[e]})),n}(o,t),u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.989.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Nm(c.url,a),m=new URL(d);for(let[e,t]of Object.entries(p)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&m.searchParams.append(e,n.toString())}return await Tm(m.toString(),{body:s?JSON.stringify(Lm(s)):null,headers:u,method:c.method})}finally{i()}}}(r,e,{getAccessToken:t.getAccessToken,getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={create:i("annotation.create"),delete:i("annotation.delete"),get:i("annotation.read"),update:i("annotation.update"),flag:i("annotation.flag"),hide:i("annotation.hide"),unhide:i("annotation.unhide")},this.group={member:{delete:i("group.member.delete")},read:i("group.read")},this.groups={
589
589
  list:i("groups.read")},this.profile={groups:{read:i("profile.groups.read")},read:i("profile.read"),update:i("profile.update")}}setClientId(e){this._clientId=e}}Mm.$inject=["apiRoutes","auth","store"];var zm={};function Om(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Im=Om;Om.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Om.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Om.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime()
590
590
  ;if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(void 0===n){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout((function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout((function(){r._operationTimeoutCb(r._attempts)}),r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)}),n),this._options.unref&&this._timer.unref(),!0},Om.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){n._operationTimeoutCb()}),n._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},Om.prototype.try=function(e){
591
591
  console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Om.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Om.prototype.start=Om.prototype.try,Om.prototype.errors=function(){return this._errors},Om.prototype.attempts=function(){return this._attempts},Om.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,a=(e[i]||0)+1;e[i]=a,a>=n&&(t=o,n=a)}return t},function(e){var t=Im;e.operation=function(n){var r=e.timeouts(n);return new t(r,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t))
@@ -598,24 +598,24 @@ Hm.$inject=["$window","apiRoutes","localStorage","settings","toastMessenger"];cl
598
598
  const r=Array.isArray(t),o=()=>r?t.map((e=>e())):t();let i=o();return e((()=>{const e=o();if(r?Um(e,i):e===i)return;const t=i;i=e,n(e,t)}))}class Gm{constructor(e,t){this._frameSync=e,this._store=t}init(){const e=()=>this._store.profile().features;$m(this._store.subscribe,[e,()=>this._store.frames()],(()=>{this._frameSync.notifyHost("featureFlagsUpdated",e()||{})}))}}function Vm(e,t){return!!function(e){if(null===e||"object"!=typeof e)return!1;for(let t of["frame1","frame2","type","requestId"])if("string"!=typeof e[t])return!1;return!0}(e)&&JSON.stringify(e,Object.keys(t).sort())===JSON.stringify(t,Object.keys(t).sort())}Gm.$inject=["frameSync","store"];class Wm{constructor({hostFrame:e,source:t}){this._hostFrame=e,this._source=t,this._listeners=new da}destroy(){this._listeners.removeAll()}async discover(e){let t=!1;if(("guest"===this._source&&"host"===e||"guest"===this._source&&"sidebar"===e||"sidebar"===this._source&&"host"===e||"notebook"===this._source&&"sidebar"===e)&&(t=!0),
599
599
  !t)throw new Error("Invalid request of channel/port");const n=U(6);return new Promise(((t,r)=>{const o=()=>{this._hostFrame.postMessage({frame1:this._source,frame2:e,type:"request",requestId:n},"*")},i=setInterval(o,250),a=setTimeout((()=>{clearInterval(i),r(new Error(`Unable to establish ${this._source}-${e} communication channel`))}),2e4),s=this._listeners.add(window,"message",(r=>{const{data:o,ports:l}=r;Vm(o,{frame1:this._source,frame2:e,type:"offer",requestId:n})&&(clearInterval(i),clearTimeout(a),this._listeners.remove(s),t(l[0]))}));o()}))}}function Ym(e,t,n=[],r=-1){e.postMessage({protocol:"frame-rpc",version:"1.0.0",arguments:n,method:t,sequence:r})}class Km{constructor({userAgent:e=navigator.userAgent,currentWindow:t=window}={}){this._port=null,this._methods=new Map,this._sequence=1,this._callbacks=new Map,this._listeners=new da,this._listeners.add(t,"unload",(()=>{this._port&&(Ym(this._port,"close"),t!==t.parent&&function(e){const t=e.match(/\bAppleWebKit\/([0-9]+)\b/)
600
600
  ;return!!t&&!(parseInt(t[1])<=537)}(e)&&t.parent.postMessage({type:"hypothesisPortClosed"},"*",[this._port]))})),this._pendingCalls=[],this._receivedCloseEvent=!1}on(e,t){if(this._port)throw new Error("Cannot add a method handler after a port is connected");this._methods.set(e,t)}connect(e){this._port=e,this._listeners.add(e,"message",(e=>this._handle(e))),e.start(),Ym(e,"connect");for(let[e,t]of this._pendingCalls)this.call(e,...t);this._pendingCalls=[]}destroy(){this._port&&(Ym(this._port,"close"),this._port.close()),this._destroyed=!0,this._listeners.removeAll()}call(e,...t){if(this._port||this._pendingCalls.push([e,t]),!this._port||this._destroyed)return;const n=this._sequence++,r=t[t.length-1];"function"==typeof r&&(this._callbacks.set(n,r),t=t.slice(0,-1)),Ym(this._port,e,t,n)}_parseMessage({data:e}){return e&&"object"==typeof e?"frame-rpc"!==e.protocol||"1.0.0"!==e.version?null:Array.isArray(e.arguments)?e:null:null}_handle(e){const t=this._parseMessage(e),n=this._port;if(t&&n)if("method"in t){
601
- if("close"===t.method){if(this._receivedCloseEvent)return;this._receivedCloseEvent=!0}const e=this._methods.get(t.method);if(!e)return;const r=(...e)=>{const r={arguments:e,protocol:"frame-rpc",response:t.sequence,version:"1.0.0"};n.postMessage(r)};e(...t.arguments,r)}else if("response"in t){const e=this._callbacks.get(t.response);this._callbacks.delete(t.response),e&&e(...t.arguments)}}}function Xm({$tag:e,target:t,uri:n}){return{$tag:e,target:t,uri:n}}function Zm(e,t){const n=e.find((e=>e.uri===t.uri));return n||e.find((e=>null===e.id))}class Jm{constructor(e,t,n){this._window=e,this._annotationsService=t,this._store=n,this._portFinder=new Wm({hostFrame:this._window.parent,source:"sidebar"}),this._listeners=new da,this._hostRPC=new Km,this._guestRPC=new Map,this._nextGuestId=0,this._inFrame=new Set,this._highlightsVisible=!1,this._setupSyncToGuests(),this._setupHostEvents()}_setupSyncToGuests(){let e=0;$m(this._store.subscribe,[()=>this._store.allAnnotations(),()=>this._store.frames()],(([t,n],[r])=>{
602
- let o=0;const i=new Set,a=[];t.forEach((e=>{ki(e)||(Ai(e)&&++o,i.add(e.$tag),this._inFrame.has(e.$tag)||a.push(e))}));const s=r.filter((e=>!i.has(e.$tag)));if(a.length>0){const e=new Map;for(let t of a){var l;const r=Zm(n,t);if(!r)continue;const o=null!==(l=e.get(r.id))&&void 0!==l?l:[];o.push(t),e.set(r.id,o)}for(let[t,n]of e){const e=this._guestRPC.get(t);e&&e.call("loadAnnotations",n.map(Xm))}a.forEach((e=>{this._inFrame.add(e.$tag)}))}s.forEach((e=>{this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag))),this._inFrame.delete(e.$tag)})),n.length>0&&n.every((e=>e.isAnnotationFetchComplete))&&(0!==o&&o===e||(this._hostRPC.call("publicAnnotationCountChanged",o),e=o))}))}_connectGuest(e){const t=new Km;++this._nextGuestId;let n=`temp-${this._nextGuestId}`;this._guestRPC.set(n,t),t.on("documentInfoChanged",(e=>{this._guestRPC.delete(n),n=e.frameIdentifier,this._guestRPC.set(n,t),this._store.connectFrame({id:e.frameIdentifier,metadata:e.metadata,uri:e.uri})})),t.on("close",(()=>{
603
- const e=this._store.frames().find((e=>e.id===n));e&&this._store.destroyFrame(e),t.destroy(),this._guestRPC.delete(n)})),t.on("createAnnotation",(e=>{if(!this._store.isLoggedIn())return this._hostRPC.call("openSidebar"),this._store.openSidebarPanel("loginPrompt"),void this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag)));this._inFrame.add(e.$tag),e.$highlight||this._hostRPC.call("openSidebar"),this._hostRPC.call("showHighlights"),this._annotationsService.create(e)}));let r={};const o=ha((()=>{this._store.updateAnchorStatus(r),r={}}),10);t.on("syncAnchoringStatus",(({$tag:e,$orphan:t})=>{this._inFrame.add(e),r[e]=t?"orphan":"anchored",o()})),t.on("showAnnotations",(e=>{this._store.selectAnnotations(this._store.findIDsForTags(e)),this._store.selectTab("annotation")})),t.on("focusAnnotations",(e=>{this._store.focusAnnotations(e||[])})),t.on("toggleAnnotationSelection",(e=>{this._store.toggleSelectedAnnotations(this._store.findIDsForTags(e))})),t.on("openSidebar",(()=>{this._hostRPC.call("openSidebar")
604
- })),t.on("closeSidebar",(()=>{this._hostRPC.call("closeSidebar")})),t.connect(e),t.call("setHighlightsVisible",this._highlightsVisible)}_setupHostEvents(){this._hostRPC.on("sidebarOpened",(()=>{this._store.setSidebarOpened(!0)})),this._hostRPC.on("setHighlightsVisible",(e=>{this._highlightsVisible=e,this._guestRPC.forEach((t=>t.call("setHighlightsVisible",e)))}))}async connect(){const e=await this._portFinder.discover("host");this._hostRPC.connect(e),this._listeners.add(e,"message",(e=>{const{data:t,ports:n}=e;Vm(t,{frame1:"guest",frame2:"sidebar",type:"offer"})&&this._connectGuest(n[0])}))}notifyHost(e,...t){this._hostRPC.call(e,...t)}focusAnnotations(e){this._store.focusAnnotations(e),this._guestRPC.forEach((t=>t.call("focusAnnotations",e)))}scrollToAnnotation(e){this._guestRPC.forEach((t=>t.call("scrollToAnnotation",e)))}destroy(){this._portFinder.destroy(),this._listeners.removeAll()}}function Qm(e){return Object.keys(e).reduce(((e,t)=>(e[t]=t,e)),{})}Jm.$inject=["$window","annotationsService","store"]
605
- ;const ef={id:"__default__",name:"__DEFAULT__",logo:"data:image/svg+xml;utf8,"+encodeURIComponent(Yo)};const tf=["organization","scopes"];class nf{constructor(e,t,n,r,o,i){this._store=e,this._api=t,this._auth=n,this._settings=o,this._toastMessenger=i,this._serviceConfig=P(o),this._reloadSetUp=!1}_mainURI(){var e,t;return null!==(e=null===(t=this._store.mainFrame())||void 0===t?void 0:t.uri)&&void 0!==e?e:null}async _filterGroups(e,t,n,r){if(r){const t=e.find((e=>e.id===r));t&&!t.isScopedToUri&&t.scopes&&t.scopes.enforced&&(e=e.filter((e=>e.id!==r)),this._store.setDirectLinkedGroupFetchFailed(),r=null)}if(t)return e;const o=e.some((e=>"__world__"!==e.id&&e.isScopedToUri));return o?"__world__"===r||"__world__"===n?e:e.filter((e=>"__world__"!==e.id)):e}_setupAutoReload(){this._reloadSetUp||(this._reloadSetUp=!0,$m(this._store.subscribe,(()=>this._mainURI()),(()=>{this.load()})),$m(this._store.subscribe,[()=>this._store.hasFetchedProfile(),()=>this._store.profile().userid],((e,[t])=>{t&&this.load()})))}
606
- _addGroupsToStore(e,t){!function(e){e.forEach((e=>{e.organization&&"object"==typeof e.organization||(e.organization=ef)}))}(e);const n=0===this._store.allGroups().length,r=this._store.getDefault("focusedGroup");this._store.loadGroups(e),n&&(t&&e.some((e=>e.id===t))?this.focus(t):r&&e.some((e=>e.id===r))&&this.focus(r))}_fetchGroup(e){return this._api.group.read({id:e,expand:tf})}async _loadGroupsForUserAndDocument(){var e;const t=()=>function(e,t){const n=t(e);return null!==n?Promise.resolve(n):new Promise((n=>{const r=e.subscribe((()=>{const o=t(e);null!==o&&(r(),n(o))}))}))}(this._store,(()=>this._mainURI()));let n=null;"sidebar"===this._store.route()&&(n=await t()),this._setupAutoReload();const r=this._store.directLinkedAnnotationId();let o=null;r&&(o=this._api.annotation.get({id:r}).catch((()=>null)));const i=this._store.directLinkedGroupId();let a=null;i&&(a=this._fetchGroup(i).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),
607
- null))));const s={expand:tf},l=null===(e=this._serviceConfig)||void 0===e?void 0:e.authority;l&&(s.authority=l),n&&(s.document_uri=n);const[c,u,h,d,p]=await Promise.all([this._api.profile.groups.read({expand:tf}),this._api.groups.list(s),this._auth.getAccessToken(),o,a]);p&&!u.some((e=>e.id===p.id))&&u.push(p);let m=null;if(d){m=d.group;const e=c.concat(u).find((e=>e.id===d.group));if(!e)try{const e=await this._fetchGroup(d.group);u.push(e)}catch(e){this._toastMessenger.error("Unable to fetch group for linked annotation")}}const f=null!==h,g=await this._filterGroups(J(c,u,n,this._settings),f,m,i),v=m||i||null;return this._addGroupsToStore(g,v),g}async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:tf});let n;const r=async e=>{try{return await this._fetchGroup(e)}catch(e){return n=e,null}},o=await Promise.all(e.map((e=>t.find((t=>t.id===e||t.groupid===e))||r(e)))),i=o.filter((e=>null!==e)),a=this._store.directLinkedGroupId();return this._addGroupsToStore(i,a),
608
- n&&this._toastMessenger.error(`Unable to fetch groups: ${n.message}`,{autoDismiss:!1}),i}async load(){var e;if(null!==(e=this._serviceConfig)&&void 0!==e&&e.groups){let e=[];try{e=await this._serviceConfig.groups}catch(e){this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(e)}return this._loadGroupsForUserAndDocument()}focus(e){const t=this._store.focusedGroupId();this._store.focusGroup(e);const n=this._store.focusedGroupId();if(t!==n&&null!==t&&n){const e=this._store.newAnnotations().filter((e=>!ki(e))).map((e=>({...e,group:n})));e.length&&this._store.addAnnotations(e),this._store.setDefault("focusedGroup",n)}}leave(e){return this._api.group.member.delete({pubid:e,userid:"me"})}}nf.$inject=["store","api","auth","session","settings","toastMessenger"];class rf{constructor(e,t,n,r){this._api=e,this._store=t,this._streamer=n,this._streamFilter=r,this._searchClient=null}
609
- load({groupId:e,uris:t,onError:n,maxResults:r,sortBy:o,sortOrder:i,streamFilterBy:a="uri"}){if(this._store.removeAnnotations(this._store.savedAnnotations()),this._searchClient&&this._searchClient.cancel(),"group"===a)this._streamFilter.resetFilter().addClause("/group","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()});else t&&t.length>0&&(this._streamFilter.resetFilter().addClause("/uri","one_of",t),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}));const s={incremental:!0,separateReplies:!1,maxResults:r,sortBy:o,sortOrder:i};this._searchClient=new nm(this._api.search,s),this._searchClient.on("resultCount",(e=>{this._store.setAnnotationResultCount(e)})),this._searchClient.on("results",(e=>{e.length&&this._store.addAnnotations(e)})),this._searchClient.on("error",(e=>{"function"==typeof n?n(e):console.error(e)})),this._searchClient.on("end",(()=>{this._searchClient=null,t&&t.length>0&&this._store.frames().forEach((e=>{
610
- t.indexOf(e.uri)>=0&&this._store.updateFrameAnnotationFetchStatus(e.uri,!0)})),this._store.annotationFetchFinished()})),this._store.annotationFetchStarted(),this._searchClient.get({group:e,uri:t})}async loadThread(e){let t,n;this._store.clearAnnotations();try{this._store.annotationFetchStarted(),t=await this._api.annotation.get({id:e}),ki(t)&&(t=await this._api.annotation.get({id:t.references[0]})),n=await this._api.search({references:t.id})}finally{this._store.annotationFetchFinished()}const r=[t,...n.rows];if(this._store.addAnnotations(r),!ki(t)){const e=t.id;this._streamFilter.addClause("/references","one_of",e,!0).addClause("/id","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}),this._streamer.connect()}return r}}rf.$inject=["api","store","streamer","streamFilter"];class of{constructor(){this._store={}}getItem(e){return e in this._store?this._store[e]:null}setItem(e,t){this._store[e]=t}removeItem(e){delete this._store[e]}}class af{constructor(e){
611
- let t="hypothesis.testKey";try{this._storage=e.localStorage,e.localStorage.setItem(t,t),e.localStorage.getItem(t),e.localStorage.removeItem(t)}catch(e){this._storage=new of}}getItem(e){return this._storage.getItem(e)}getObject(e){const t=this._storage.getItem(e);return t?JSON.parse(t):null}setItem(e,t){this._storage.setItem(e,t)}setObject(e,t){const n=JSON.stringify(t);this._storage.setItem(e,n)}removeItem(e){this._storage.removeItem(e)}}af.$inject=["$window"];const sf={annotationPrivacy:"hypothesis.privacy",focusedGroup:"hypothesis.groups.focus"};class lf{constructor(e,t){this._storage=e,this._store=t}init(){Object.keys(sf).forEach((e=>{const t=this._storage.getItem(sf[e]);this._store.setDefault(e,t)})),$m(this._store.subscribe,(()=>this._store.getDefaults()),((e,t)=>{for(let n in e)t[n]!==e[n]&&n in sf&&this._storage.setItem(sf[n],e[n])}))}}lf.$inject=["localStorage","store"];class cf{constructor(e,t){this._window=e,this._store=t,this._didRegisterPopstateListener=!1}currentRoute(){
612
- const e=this._window.location.pathname.slice(1).split("/"),t=new URLSearchParams(this._window.location.search),n={};for(let[e,r]of t)n[e]=r;"client"===e[0]&&e.shift();let r;switch(e[0].replace(/\.html$/,"")){case"a":r="annotation",n.id=e[1]||"";break;case"notebook":r="notebook";break;case"stream":r="stream";break;default:r="sidebar"}return{route:r,params:n}}routeUrl(e,t={}){let n;const r={...t};switch(e){case"annotation":{const e=t.id;delete r.id,n=`/a/${e}`}break;case"notebook":n="/notebook";break;case"stream":n="/stream";break;default:throw new Error(`Cannot generate URL for route "${e}"`)}let o=!1;const i=new URLSearchParams;for(let[e,t]of Object.entries(r))o=!0,i.set(e,t);return o&&(n+="?"+i.toString()),n}sync(){const{route:e,params:t}=this.currentRoute();this._store.changeRoute(e,t),this._didRegisterPopstateListener||(this._window.addEventListener("popstate",(()=>{this.sync()})),this._didRegisterPopstateListener=!0)}navigate(e,t){this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}
613
- cf.$inject=["$window","store"];class uf{constructor(e,t){this._apiRoutes=e,this._store=t}async init(){try{const e=await this._apiRoutes.links();this._store.updateLinks(e)}catch(e){console.warn(`Failed to fetch Hypothesis links: ${e.message}`)}}}uf.$inject=["apiRoutes","store"];class hf{constructor(e,t,n,r,o){var i,a;this._api=t,this._auth=n,this._store=e,this._toastMessenger=o,this._authority=null!==(i=null===(a=P(r))||void 0===a?void 0:a.authority)&&void 0!==i?i:null,this._lastLoad=null,this._lastLoadTime=null,n.on("oauthTokensChanged",(()=>this.reload()))}load(){return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=Pm((()=>{const e=this._authority?{authority:this._authority}:{};return this._api.profile.read(e)})).then((e=>(this.update(e),this._lastLoadTime=Date.now(),e))).catch((e=>{throw this._lastLoadTime=null,e}))),this._lastLoad}async dismissSidebarTutorial(){const e=await this._api.profile.update({},{preferences:{
614
- show_sidebar_tutorial:!1}});this.update(e)}update(e){const t=this._store.profile(),n=e.userid!==t.userid;return this._store.updateProfile(e),this._lastLoad=Promise.resolve(e),this._lastLoadTime=Date.now(),n&&(e.userid?Cr({id:e.userid}):Cr(null)),e}async logout(){try{return await this._auth.logout(),this.reload()}catch(e){throw this._toastMessenger.error("Log out failed"),new Error(e)}}reload(){return this._lastLoad=null,this._lastLoadTime=null,this.load()}}hf.$inject=["store","api","auth","settings","toastMessenger"];class df{constructor(){this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}}}addClause(e,t,n,r=!1){return this._filter.clauses.push({field:e,operator:t,value:n,case_sensitive:r}),this}getFilter(){return this._filter}resetFilter(){return this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}},this}}class pf extends Qp{constructor(e){super();const t=[];let n;const r=()=>{for(;t.length>0;){const e=JSON.stringify(t.shift())
615
- ;n.send(e)}};this.close=()=>{n.close(1e3)},this.send=e=>{t.push(e),this.isConnected()&&r()},this.isConnected=()=>n.readyState===WebSocket.OPEN,(()=>{n=new WebSocket(e),n.onopen=e=>{r(),this.emit("open",e)},n.onclose=e=>{if(1e3===e.code||1001===e.code)return void this.emit("close",e);const t=new Error(`WebSocket closed abnormally, code: ${e.code}`);console.warn(t),this.emit("disconnect")},n.onerror=e=>{this.emit("error",e)},n.onmessage=e=>{this.emit("message",e)}})()}}class mf{constructor(e,t,n,r,o){this._auth=n,this._groups=r,this._session=o,this._store=e,this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=U(32),this._socket=null,this._updateImmediately=!0,this._configMessages={},this._reconnectionAttempts=0,this._reconnectSetUp=!1}applyPendingUpdates(){const e=Object.values(this._store.pendingUpdates());e.length&&this._store.addAnnotations(e);const t=Object.keys(this._store.pendingDeletions()).map((e=>({id:e})));t.length&&this._store.removeAnnotations(t),this._store.clearPendingUpdates()}
616
- _handleSocketError(e,t){K("Error connecting to H push notification service:",t);const n=new URL(e).hostname;-1!==["localhost","127.0.0.1"].indexOf(n)&&K("Check that your H service is configured to allow WebSocket connections from "+window.location.origin)}_handleSocketMessage(e){const t=JSON.parse(e.data);if(t)if("annotation-notification"===t.type){const e=t.payload;switch(t.options.action){case"create":case"update":case"past":this._store.receiveRealTimeUpdates({updatedAnnotations:e});break;case"delete":this._store.receiveRealTimeUpdates({deletedAnnotations:e})}this._updateImmediately&&this.applyPendingUpdates()}else if("session-change"===t.type)this._session.update(t.model),this._groups.load();else if("whoyouare"===t.type){const e=this._store.profile().userid;t.userid!==e&&console.warn('WebSocket user ID "%s" does not match logged-in ID "%s"',t.userid,e)}else K("Received unsupported notification",t.type)}_sendClientConfig(e){Object.keys(this._configMessages).forEach((t=>{
617
- this._configMessages[t]&&e.send(this._configMessages[t])}))}setConfig(e,t){var n;this._configMessages[e]=t,null!==(n=this._socket)&&void 0!==n&&n.isConnected()&&this._socket.send(t)}async _reconnect(){var e;const t=await this._websocketURL;if(!t)return;let n,r;null===(e=this._socket)||void 0===e||e.close();try{n=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(n){const e=new URL(t);e.searchParams.set("access_token",n),r=e.toString()}else r=t;const o=new pf(r);o.on("open",(()=>{this._reconnectionAttempts=0,this._sendClientConfig(o)})),o.on("disconnect",(()=>{if(++this._reconnectionAttempts,this._reconnectionAttempts<10){const e=1e3*2**this._reconnectionAttempts;setTimeout((()=>this._reconnect()),e)}else console.error("Gave up trying to reconnect to Hypothesis real time update service")})),o.on("error",(e=>this._handleSocketError(t,e))),o.on("message",(e=>this._handleSocketMessage(e))),this._socket=o,this.setConfig("client-id",{
618
- messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){var t;this._updateImmediately=null===(t=e.applyUpdatesImmediately)||void 0===t||t,this._reconnectSetUp||(this._reconnectSetUp=!0,$m(this._store.subscribe,(()=>this._store.profile().userid),(()=>{this._reconnect()}))),this._socket||await this._reconnect()}}mf.$inject=["store","apiRoutes","auth","groups","session"];class ff{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject("hypothesis.user.tags.list")||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${Z(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject("hypothesis.user.tags.map")||{};e.forEach((e=>{t[e]?(t[e].count+=1,t[e].updated=Date.now()):t[e]={text:e,count:1,updated:Date.now()}})),this._storage.setObject("hypothesis.user.tags.map",t)
601
+ if("close"===t.method){if(this._receivedCloseEvent)return;this._receivedCloseEvent=!0}const e=this._methods.get(t.method);if(!e)return;const r=(...e)=>{const r={arguments:e,protocol:"frame-rpc",response:t.sequence,version:"1.0.0"};n.postMessage(r)};e(...t.arguments,r)}else if("response"in t){const e=this._callbacks.get(t.response);this._callbacks.delete(t.response),e&&e(...t.arguments)}}}function Xm({$tag:e,target:t,uri:n}){return{$tag:e,target:t,uri:n}}function Zm(e,t){const n=e.find((e=>e.uri===t.uri));if(n)return n;const r=e.find((e=>null===e.id));return r||e[0]}class Jm{constructor(e,t,n){this._window=e,this._annotationsService=t,this._store=n,this._portFinder=new Wm({hostFrame:this._window.parent,source:"sidebar"}),this._listeners=new da,this._hostRPC=new Km,this._guestRPC=new Map,this._nextGuestId=0,this._inFrame=new Set,this._highlightsVisible=!1,this._setupSyncToGuests(),this._setupHostEvents()}_setupSyncToGuests(){let e=0
602
+ ;$m(this._store.subscribe,[()=>this._store.allAnnotations(),()=>this._store.frames()],(([t,n],[r])=>{let o=0;const i=new Set,a=[];t.forEach((e=>{ki(e)||(Ai(e)&&++o,i.add(e.$tag),this._inFrame.has(e.$tag)||a.push(e))}));const s=r.filter((e=>!i.has(e.$tag)));if(a.length>0){const e=new Map;for(let t of a){var l;const r=Zm(n,t);if(!r)continue;const o=null!==(l=e.get(r.id))&&void 0!==l?l:[];o.push(t),e.set(r.id,o)}for(let[t,n]of e){const e=this._guestRPC.get(t);e&&e.call("loadAnnotations",n.map(Xm))}a.forEach((e=>{this._inFrame.add(e.$tag)}))}s.forEach((e=>{this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag))),this._inFrame.delete(e.$tag)})),n.length>0&&n.every((e=>e.isAnnotationFetchComplete))&&(0!==o&&o===e||(this._hostRPC.call("publicAnnotationCountChanged",o),e=o))}))}_connectGuest(e){const t=new Km;++this._nextGuestId;let n=`temp-${this._nextGuestId}`;this._guestRPC.set(n,t),t.on("documentInfoChanged",(e=>{this._guestRPC.delete(n),n=e.frameIdentifier,this._guestRPC.set(n,t),this._store.connectFrame({
603
+ id:e.frameIdentifier,metadata:e.metadata,uri:e.uri})})),t.on("close",(()=>{const e=this._store.frames().find((e=>e.id===n));e&&this._store.destroyFrame(e),t.destroy(),this._guestRPC.delete(n)})),t.on("createAnnotation",(e=>{if(!this._store.isLoggedIn())return this._hostRPC.call("openSidebar"),this._store.openSidebarPanel("loginPrompt"),void this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag)));this._inFrame.add(e.$tag),e.$highlight||this._hostRPC.call("openSidebar"),this._hostRPC.call("showHighlights"),this._annotationsService.create(e)}));let r={};const o=ha((()=>{this._store.updateAnchorStatus(r),r={}}),10);t.on("syncAnchoringStatus",(({$tag:e,$orphan:t})=>{this._inFrame.add(e),r[e]=t?"orphan":"anchored",o()})),t.on("showAnnotations",(e=>{this._store.selectAnnotations(this._store.findIDsForTags(e)),this._store.selectTab("annotation")})),t.on("focusAnnotations",(e=>{this._store.focusAnnotations(e||[])})),t.on("toggleAnnotationSelection",(e=>{
604
+ this._store.toggleSelectedAnnotations(this._store.findIDsForTags(e))})),t.on("openSidebar",(()=>{this._hostRPC.call("openSidebar")})),t.on("closeSidebar",(()=>{this._hostRPC.call("closeSidebar")})),t.connect(e),t.call("setHighlightsVisible",this._highlightsVisible)}_setupHostEvents(){this._hostRPC.on("sidebarOpened",(()=>{this._store.setSidebarOpened(!0)})),this._hostRPC.on("setHighlightsVisible",(e=>{this._highlightsVisible=e,this._guestRPC.forEach((t=>t.call("setHighlightsVisible",e)))}))}async connect(){const e=await this._portFinder.discover("host");this._hostRPC.connect(e),this._listeners.add(e,"message",(e=>{const{data:t,ports:n}=e;Vm(t,{frame1:"guest",frame2:"sidebar",type:"offer"})&&this._connectGuest(n[0])}))}notifyHost(e,...t){this._hostRPC.call(e,...t)}focusAnnotations(e){this._store.focusAnnotations(e),this._guestRPC.forEach((t=>t.call("focusAnnotations",e)))}scrollToAnnotation(e){this._guestRPC.forEach((t=>t.call("scrollToAnnotation",e)))}destroy(){this._portFinder.destroy(),
605
+ this._listeners.removeAll()}}function Qm(e){return Object.keys(e).reduce(((e,t)=>(e[t]=t,e)),{})}Jm.$inject=["$window","annotationsService","store"];const ef={id:"__default__",name:"__DEFAULT__",logo:"data:image/svg+xml;utf8,"+encodeURIComponent(Yo)};const tf=["organization","scopes"];class nf{constructor(e,t,n,r,o,i){this._store=e,this._api=t,this._auth=n,this._settings=o,this._toastMessenger=i,this._serviceConfig=P(o),this._reloadSetUp=!1}_mainURI(){var e,t;return null!==(e=null===(t=this._store.mainFrame())||void 0===t?void 0:t.uri)&&void 0!==e?e:null}async _filterGroups(e,t,n,r){if(r){const t=e.find((e=>e.id===r));t&&!t.isScopedToUri&&t.scopes&&t.scopes.enforced&&(e=e.filter((e=>e.id!==r)),this._store.setDirectLinkedGroupFetchFailed(),r=null)}if(t)return e;const o=e.some((e=>"__world__"!==e.id&&e.isScopedToUri));return o?"__world__"===r||"__world__"===n?e:e.filter((e=>"__world__"!==e.id)):e}_setupAutoReload(){this._reloadSetUp||(this._reloadSetUp=!0,$m(this._store.subscribe,(()=>this._mainURI()),(()=>{
606
+ this.load()})),$m(this._store.subscribe,[()=>this._store.hasFetchedProfile(),()=>this._store.profile().userid],((e,[t])=>{t&&this.load()})))}_addGroupsToStore(e,t){!function(e){e.forEach((e=>{e.organization&&"object"==typeof e.organization||(e.organization=ef)}))}(e);const n=0===this._store.allGroups().length,r=this._store.getDefault("focusedGroup");this._store.loadGroups(e),n&&(t&&e.some((e=>e.id===t))?this.focus(t):r&&e.some((e=>e.id===r))&&this.focus(r))}_fetchGroup(e){return this._api.group.read({id:e,expand:tf})}async _loadGroupsForUserAndDocument(){var e;const t=()=>function(e,t){const n=t(e);return null!==n?Promise.resolve(n):new Promise((n=>{const r=e.subscribe((()=>{const o=t(e);null!==o&&(r(),n(o))}))}))}(this._store,(()=>this._mainURI()));let n=null;"sidebar"===this._store.route()&&(n=await t()),this._setupAutoReload();const r=this._store.directLinkedAnnotationId();let o=null;r&&(o=this._api.annotation.get({id:r}).catch((()=>null)));const i=this._store.directLinkedGroupId();let a=null
607
+ ;i&&(a=this._fetchGroup(i).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),null))));const s={expand:tf},l=null===(e=this._serviceConfig)||void 0===e?void 0:e.authority;l&&(s.authority=l),n&&(s.document_uri=n);const[c,u,h,d,p]=await Promise.all([this._api.profile.groups.read({expand:tf}),this._api.groups.list(s),this._auth.getAccessToken(),o,a]);p&&!u.some((e=>e.id===p.id))&&u.push(p);let m=null;if(d){m=d.group;const e=c.concat(u).find((e=>e.id===d.group));if(!e)try{const e=await this._fetchGroup(d.group);u.push(e)}catch(e){this._toastMessenger.error("Unable to fetch group for linked annotation")}}const f=null!==h,g=await this._filterGroups(J(c,u,n,this._settings),f,m,i),v=m||i||null;return this._addGroupsToStore(g,v),g}async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:tf});let n;const r=async e=>{try{return await this._fetchGroup(e)}catch(e){return n=e,null}
608
+ },o=await Promise.all(e.map((e=>t.find((t=>t.id===e||t.groupid===e))||r(e)))),i=o.filter((e=>null!==e)),a=this._store.directLinkedGroupId();return this._addGroupsToStore(i,a),n&&this._toastMessenger.error(`Unable to fetch groups: ${n.message}`,{autoDismiss:!1}),i}async load(){var e;if(null!==(e=this._serviceConfig)&&void 0!==e&&e.groups){let e=[];try{e=await this._serviceConfig.groups}catch(e){this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(e)}return this._loadGroupsForUserAndDocument()}focus(e){const t=this._store.focusedGroupId();this._store.focusGroup(e);const n=this._store.focusedGroupId();if(t!==n&&null!==t&&n){const e=this._store.newAnnotations().filter((e=>!ki(e))).map((e=>({...e,group:n})));e.length&&this._store.addAnnotations(e),this._store.setDefault("focusedGroup",n)}}leave(e){return this._api.group.member.delete({pubid:e,userid:"me"})}}nf.$inject=["store","api","auth","session","settings","toastMessenger"];class rf{
609
+ constructor(e,t,n,r){this._api=e,this._store=t,this._streamer=n,this._streamFilter=r,this._searchClient=null}load({groupId:e,uris:t,onError:n,maxResults:r,sortBy:o,sortOrder:i,streamFilterBy:a="uri"}){if(this._store.removeAnnotations(this._store.savedAnnotations()),this._searchClient&&this._searchClient.cancel(),"group"===a)this._streamFilter.resetFilter().addClause("/group","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()});else t&&t.length>0&&(this._streamFilter.resetFilter().addClause("/uri","one_of",t),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}));const s={incremental:!0,separateReplies:!1,maxResults:r,sortBy:o,sortOrder:i};this._searchClient=new nm(this._api.search,s),this._searchClient.on("resultCount",(e=>{this._store.setAnnotationResultCount(e)})),this._searchClient.on("results",(e=>{e.length&&this._store.addAnnotations(e)})),this._searchClient.on("error",(e=>{"function"==typeof n?n(e):console.error(e)})),
610
+ this._searchClient.on("end",(()=>{this._searchClient=null,t&&t.length>0&&this._store.frames().forEach((e=>{t.indexOf(e.uri)>=0&&this._store.updateFrameAnnotationFetchStatus(e.uri,!0)})),this._store.annotationFetchFinished()})),this._store.annotationFetchStarted(),this._searchClient.get({group:e,uri:t})}async loadThread(e){let t,n;this._store.clearAnnotations();try{this._store.annotationFetchStarted(),t=await this._api.annotation.get({id:e}),ki(t)&&(t=await this._api.annotation.get({id:t.references[0]})),n=await this._api.search({references:t.id})}finally{this._store.annotationFetchFinished()}const r=[t,...n.rows];if(this._store.addAnnotations(r),!ki(t)){const e=t.id;this._streamFilter.addClause("/references","one_of",e,!0).addClause("/id","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}),this._streamer.connect()}return r}}rf.$inject=["api","store","streamer","streamFilter"];class of{constructor(){this._store={}}getItem(e){return e in this._store?this._store[e]:null}
611
+ setItem(e,t){this._store[e]=t}removeItem(e){delete this._store[e]}}class af{constructor(e){let t="hypothesis.testKey";try{this._storage=e.localStorage,e.localStorage.setItem(t,t),e.localStorage.getItem(t),e.localStorage.removeItem(t)}catch(e){this._storage=new of}}getItem(e){return this._storage.getItem(e)}getObject(e){const t=this._storage.getItem(e);return t?JSON.parse(t):null}setItem(e,t){this._storage.setItem(e,t)}setObject(e,t){const n=JSON.stringify(t);this._storage.setItem(e,n)}removeItem(e){this._storage.removeItem(e)}}af.$inject=["$window"];const sf={annotationPrivacy:"hypothesis.privacy",focusedGroup:"hypothesis.groups.focus"};class lf{constructor(e,t){this._storage=e,this._store=t}init(){Object.keys(sf).forEach((e=>{const t=this._storage.getItem(sf[e]);this._store.setDefault(e,t)})),$m(this._store.subscribe,(()=>this._store.getDefaults()),((e,t)=>{for(let n in e)t[n]!==e[n]&&n in sf&&this._storage.setItem(sf[n],e[n])}))}}lf.$inject=["localStorage","store"];class cf{constructor(e,t){this._window=e,
612
+ this._store=t,this._didRegisterPopstateListener=!1}currentRoute(){const e=this._window.location.pathname.slice(1).split("/"),t=new URLSearchParams(this._window.location.search),n={};for(let[e,r]of t)n[e]=r;"client"===e[0]&&e.shift();let r;switch(e[0].replace(/\.html$/,"")){case"a":r="annotation",n.id=e[1]||"";break;case"notebook":r="notebook";break;case"stream":r="stream";break;default:r="sidebar"}return{route:r,params:n}}routeUrl(e,t={}){let n;const r={...t};switch(e){case"annotation":{const e=t.id;delete r.id,n=`/a/${e}`}break;case"notebook":n="/notebook";break;case"stream":n="/stream";break;default:throw new Error(`Cannot generate URL for route "${e}"`)}let o=!1;const i=new URLSearchParams;for(let[e,t]of Object.entries(r))o=!0,i.set(e,t);return o&&(n+="?"+i.toString()),n}sync(){const{route:e,params:t}=this.currentRoute();this._store.changeRoute(e,t),this._didRegisterPopstateListener||(this._window.addEventListener("popstate",(()=>{this.sync()})),this._didRegisterPopstateListener=!0)}navigate(e,t){
613
+ this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}cf.$inject=["$window","store"];class uf{constructor(e,t){this._apiRoutes=e,this._store=t}async init(){try{const e=await this._apiRoutes.links();this._store.updateLinks(e)}catch(e){console.warn(`Failed to fetch Hypothesis links: ${e.message}`)}}}uf.$inject=["apiRoutes","store"];class hf{constructor(e,t,n,r,o){var i,a;this._api=t,this._auth=n,this._store=e,this._toastMessenger=o,this._authority=null!==(i=null===(a=P(r))||void 0===a?void 0:a.authority)&&void 0!==i?i:null,this._lastLoad=null,this._lastLoadTime=null,n.on("oauthTokensChanged",(()=>this.reload()))}load(){return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=Pm((()=>{const e=this._authority?{authority:this._authority}:{};return this._api.profile.read(e)})).then((e=>(this.update(e),this._lastLoadTime=Date.now(),e))).catch((e=>{throw this._lastLoadTime=null,e}))),this._lastLoad}async dismissSidebarTutorial(){
614
+ const e=await this._api.profile.update({},{preferences:{show_sidebar_tutorial:!1}});this.update(e)}update(e){const t=this._store.profile(),n=e.userid!==t.userid;return this._store.updateProfile(e),this._lastLoad=Promise.resolve(e),this._lastLoadTime=Date.now(),n&&(e.userid?Cr({id:e.userid}):Cr(null)),e}async logout(){try{return await this._auth.logout(),this.reload()}catch(e){throw this._toastMessenger.error("Log out failed"),new Error(e)}}reload(){return this._lastLoad=null,this._lastLoadTime=null,this.load()}}hf.$inject=["store","api","auth","settings","toastMessenger"];class df{constructor(){this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}}}addClause(e,t,n,r=!1){return this._filter.clauses.push({field:e,operator:t,value:n,case_sensitive:r}),this}getFilter(){return this._filter}resetFilter(){return this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}},this}}class pf extends Qp{constructor(e){super();const t=[];let n
615
+ ;const r=()=>{for(;t.length>0;){const e=JSON.stringify(t.shift());n.send(e)}};this.close=()=>{n.close(1e3)},this.send=e=>{t.push(e),this.isConnected()&&r()},this.isConnected=()=>n.readyState===WebSocket.OPEN,(()=>{n=new WebSocket(e),n.onopen=e=>{r(),this.emit("open",e)},n.onclose=e=>{if(1e3===e.code||1001===e.code)return void this.emit("close",e);const t=new Error(`WebSocket closed abnormally, code: ${e.code}`);console.warn(t),this.emit("disconnect")},n.onerror=e=>{this.emit("error",e)},n.onmessage=e=>{this.emit("message",e)}})()}}class mf{constructor(e,t,n,r,o){this._auth=n,this._groups=r,this._session=o,this._store=e,this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=U(32),this._socket=null,this._updateImmediately=!0,this._configMessages={},this._reconnectionAttempts=0,this._reconnectSetUp=!1}applyPendingUpdates(){const e=Object.values(this._store.pendingUpdates());e.length&&this._store.addAnnotations(e);const t=Object.keys(this._store.pendingDeletions()).map((e=>({id:e})))
616
+ ;t.length&&this._store.removeAnnotations(t),this._store.clearPendingUpdates()}_handleSocketError(e,t){K("Error connecting to H push notification service:",t);const n=new URL(e).hostname;-1!==["localhost","127.0.0.1"].indexOf(n)&&K("Check that your H service is configured to allow WebSocket connections from "+window.location.origin)}_handleSocketMessage(e){const t=JSON.parse(e.data);if(t)if("annotation-notification"===t.type){const e=t.payload;switch(t.options.action){case"create":case"update":case"past":this._store.receiveRealTimeUpdates({updatedAnnotations:e});break;case"delete":this._store.receiveRealTimeUpdates({deletedAnnotations:e})}this._updateImmediately&&this.applyPendingUpdates()}else if("session-change"===t.type)this._session.update(t.model),this._groups.load();else if("whoyouare"===t.type){const e=this._store.profile().userid;t.userid!==e&&console.warn('WebSocket user ID "%s" does not match logged-in ID "%s"',t.userid,e)}else K("Received unsupported notification",t.type)}_sendClientConfig(e){
617
+ Object.keys(this._configMessages).forEach((t=>{this._configMessages[t]&&e.send(this._configMessages[t])}))}setConfig(e,t){var n;this._configMessages[e]=t,null!==(n=this._socket)&&void 0!==n&&n.isConnected()&&this._socket.send(t)}async _reconnect(){var e;const t=await this._websocketURL;if(!t)return;let n,r;null===(e=this._socket)||void 0===e||e.close();try{n=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(n){const e=new URL(t);e.searchParams.set("access_token",n),r=e.toString()}else r=t;const o=new pf(r);o.on("open",(()=>{this._reconnectionAttempts=0,this._sendClientConfig(o)})),o.on("disconnect",(()=>{if(++this._reconnectionAttempts,this._reconnectionAttempts<10){const e=1e3*2**this._reconnectionAttempts;setTimeout((()=>this._reconnect()),e)}else console.error("Gave up trying to reconnect to Hypothesis real time update service")})),o.on("error",(e=>this._handleSocketError(t,e))),o.on("message",(e=>this._handleSocketMessage(e))),
618
+ this._socket=o,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){var t;this._updateImmediately=null===(t=e.applyUpdatesImmediately)||void 0===t||t,this._reconnectSetUp||(this._reconnectSetUp=!0,$m(this._store.subscribe,(()=>this._store.profile().userid),(()=>{this._reconnect()}))),this._socket||await this._reconnect()}}mf.$inject=["store","apiRoutes","auth","groups","session"];class ff{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject("hypothesis.user.tags.list")||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${Z(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject("hypothesis.user.tags.map")||{};e.forEach((e=>{t[e]?(t[e].count+=1,t[e].updated=Date.now()):t[e]={text:e,count:1,updated:Date.now()}})),this._storage.setObject("hypothesis.user.tags.map",t)
619
619
  ;const n=Object.keys(t).sort(((e,n)=>t[e].count!==t[n].count?t[n].count-t[e].count:e.localeCompare(n)));this._storage.setObject("hypothesis.user.tags.list",n)}}ff.$inject=["localStorage"];class gf{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}gf.$inject=["store"];class vf{constructor(e){this._store=e}dismiss(e){const t=this._store.getToastMessage(e);t&&!t.isDismissed&&(this._store.updateToastMessage({...t,isDismissed:!0}),setTimeout((()=>{this._store.removeToastMessage(e)}),500))}_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r=""}={}){if(this._store.hasToastMessage(e,t))return;const o=U(10),i={type:e,id:o,message:t,moreInfoURL:r};this._store.addToastMessage({isDismissed:!1,...i}),n&&setTimeout((()=>{this.dismiss(o)}),5e3)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}function yf(e,t,n){return t in e?Object.defineProperty(e,t,{
620
620
  value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function _f(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function bf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?_f(Object(n),!0).forEach((function(t){yf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):_f(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function wf(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}vf.$inject=["store"];var xf="function"==typeof Symbol&&Symbol.observable||"@@observable",kf=function(){return Math.random().toString(36).substring(7).split("").join(".")},Sf={INIT:"@@redux/INIT"+kf(),
621
621
  REPLACE:"@@redux/REPLACE"+kf(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+kf()}};function Cf(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function Af(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(wf(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(wf(1));return n(Af)(e,t)}if("function"!=typeof e)throw new Error(wf(2));var o=e,i=t,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(wf(3));return i}function h(e){if("function"!=typeof e)throw new Error(wf(4));if(l)throw new Error(wf(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(wf(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}function d(e){if(!Cf(e))throw new Error(wf(7));if(void 0===e.type)throw new Error(wf(8))
@@ -648,8 +648,8 @@ return e.expanded}const nv=Uf((e=>e.forcedVisible),(e=>Vf(e))),rv=Uf((e=>e.selec
648
648
  type:ev.SET_SORT_KEY,key:e}},toggleSelectedAnnotations:function(e){return{type:ev.TOGGLE_SELECTED_ANNOTATIONS,toggleIds:e}}},selectors:{expandedMap:tv,forcedVisibleThreads:nv,hasSelectedAnnotations:rv,selectedAnnotations:ov,selectedTab:iv,selectionState:av,sortKey:sv,sortKeys:lv}}),uv={OPEN_SIDEBAR_PANEL:function(e,t){return{activePanelName:t.panelName}},CLOSE_SIDEBAR_PANEL:function(e,t){let n=e.activePanelName;return t.panelName===n&&(n=null),{activePanelName:n}},TOGGLE_SIDEBAR_PANEL:function(e,t){let n;const r=e.activePanelName===t.panelName,o=void 0!==t.panelState?t.panelState:!r;return n=o?t.panelName:r&&!o?null:e.activePanelName,{activePanelName:n}}},hv=Qm(uv);const dv=If({activePanelName:null},{namespace:"sidebarPanels",reducers:uv,actionCreators:{openSidebarPanel:function(e){return{type:hv.OPEN_SIDEBAR_PANEL,panelName:e}},closeSidebarPanel:function(e){return{type:hv.CLOSE_SIDEBAR_PANEL,panelName:e}},toggleSidebarPanel:function(e,t){return{type:hv.TOGGLE_SIDEBAR_PANEL,panelName:e,panelState:t}}},
649
649
  selectors:{isSidebarPanelOpen:function(e,t){return e.activePanelName===t}}}),pv={ADD_MESSAGE:function(e,t){return{messages:e.messages.concat({...t.message})}},REMOVE_MESSAGE:function(e,t){return{messages:e.messages.filter((e=>e.id!==t.id))}},UPDATE_MESSAGE:function(e,t){return{messages:e.messages.map((e=>e.id&&e.id===t.message.id?{...t.message}:e))}}},mv=Qm(pv);const fv=If({messages:[]},{namespace:"toastMessages",reducers:pv,actionCreators:{addToastMessage:function(e){return{type:mv.ADD_MESSAGE,message:e}},removeToastMessage:function(e){return{type:mv.REMOVE_MESSAGE,id:e}},updateToastMessage:function(e){return{type:mv.UPDATE_MESSAGE,message:e}}},selectors:{getToastMessage:function(e,t){return e.messages.find((e=>e.id===t))},getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}}),gv={SET_SIDEBAR_OPENED:(e,t)=>!0===t.opened?{sidebarHasOpened:!0}:{}},vv=Qm(gv);const yv=If({sidebarHasOpened:!1},{namespace:"viewer",reducers:gv,
650
650
  actionCreators:{setSidebarOpened:function(e){return{type:vv.SET_SIDEBAR_OPENED,opened:e}}},selectors:{hasSidebarOpened:function(e){return e.sidebarHasOpened}}});function _v(e){return Of([Bf,ng,ig,lg,gg,Sg,Ng,Gg,qg,Kg,Kf,cv,Og,dv,fv,yv],[e],[Rf])}_v.$inject=["settings"];class bv{constructor(){this._providers=new Map,this._instances=new Map,this._constructing=new Set}get(e){if(this._instances.has(e))return this._instances.get(e);const t=this._providers.get(e);if(!t)throw new Error(`"${e}" is not registered`);if("value"in t)return this._instances.set(e,t.value),t.value;if(this._constructing.has(e))throw new Error(`Encountered a circular dependency when constructing "${e}"`);this._constructing.add(e);try{const n=[],r="class"in t&&t.class.$inject||"factory"in t&&t.factory.$inject||[];for(const t of r)try{n.push(this.get(t))}catch(n){const r=new Error(`Failed to construct dependency "${t}" of "${e}": ${n.message}`);throw r.cause=n,r}let o;if(t.class)o=new t.class(...n);else{o=(0,t.factory)(...n)}
651
- return this._instances.set(e,o),o}finally{this._constructing.delete(e)}}register(e,t){if("function"==typeof t)t={class:t};else if(!function(e){return"object"==typeof e&&null!==e&&("value"in e||"function"==typeof e.class||"function"==typeof e.factory)}(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)}}}const wv=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document),xv=function(e){const{version:t,origin:n}=R(e.location.href);return"1.985.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.985.0) than the host page (${t}). It may not work.`),
652
- !1):"null"===e.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):e.origin===n||(console.warn(`The Hypothesis sidebar is running in a different origin (${e.origin}) than expected (${n}). It may not work.`),!1)}(window);function kv(e,t){e.setClientId(t.clientId)}function Sv(e,t,n){e.load(),t.load(),n.sync()}function Cv(e,t,n,r){e.init(),t.init(),n.init(),r.init()}function Av(e,t){"sidebar"===t.route()&&e.connect()}wv.sentry&&xv&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;wr({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.985.0",beforeSend:(e,t)=>{if(Sr>=5)return K("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Sr;try{const n=t&&t.originalException;n instanceof Event&&Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted})}catch(e){}return e}});try{
651
+ return this._instances.set(e,o),o}finally{this._constructing.delete(e)}}register(e,t){if("function"==typeof t)t={class:t};else if(!function(e){return"object"==typeof e&&null!==e&&("value"in e||"function"==typeof e.class||"function"==typeof e.factory)}(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)}}}const wv=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document),xv=function(e){const{version:t,origin:n}=R(e.location.href);return"1.989.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.989.0) than the host page (${t}). It may not work.`),
652
+ !1):"null"===e.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):e.origin===n||(console.warn(`The Hypothesis sidebar is running in a different origin (${e.origin}) than expected (${n}). It may not work.`),!1)}(window);function kv(e,t){e.setClientId(t.clientId)}function Sv(e,t,n){e.load(),t.load(),n.sync()}function Cv(e,t,n,r){e.init(),t.init(),n.init(),r.init()}function Av(e,t){"sidebar"===t.route()&&e.connect()}wv.sentry&&xv&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;wr({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.989.0",beforeSend:(e,t)=>{if(Sr>=5)return K("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Sr;try{const n=t&&t.originalException;n instanceof Event&&Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted})}catch(e){}return e}});try{
653
653
  Yt("host_config",R(window.location.href))}catch(e){}Yt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),kr(((e,t)=>{Wt(e,{tags:{context:t}})}))}(wv.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;if("A"===t.tagName){const e=t;"_blank"===e.target&&(e.rel="noopener")}}))}(document.body),function(e=n){let t=!1;try{document.createElement("div").dir="auto"}catch(e){t=!0}if(t){const t=e.vnode;e.vnode=e=>{"string"==typeof e.type&&"dir"in e.props&&"auto"===e.props.dir&&(e.props.dir=""),t&&t(e)}}}(),kv.$inject=["api","streamer"],Sv.$inject=["groups","session","router"],Cv.$inject=["autosaveService","features","persistedDefaults","serviceURL"],Av.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&mo.clear();for(let[t,n]of Object.entries(e))mo.set(t,n)}(Ko);const Ev=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",te)}(),async function(e,t=window){
654
654
  const n=H(window),r=n.requestConfigFromFrame;if(!r)return V(e,n);if("string"==typeof r)return await G(e,t);if("number"==typeof r.ancestorLevel&&"string"==typeof r.origin){const o=function(e,t=window){let n=t;for(let t=0;t<e;t++){if(n===n.top)throw new Error("The target parent frame has exceeded the ancestor tree. Try reducing the `requestConfigFromFrame.ancestorLevel` value in the `hypothesisConfig`");n=n.parent}return n}(r.ancestorLevel,t);return{...await W(e,o,r.origin),...n.group?{group:n.group}:{}}}throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified")}(wv).then((e=>{!function(e,t){const n=new bv
655
655
  ;n.register("annotationsService",Am).register("api",Mm).register("apiRoutes",Bm).register("auth",Hm).register("autosaveService",qm).register("features",Gm).register("frameSync",Jm).register("groups",nf).register("loadAnnotationsService",rf).register("localStorage",af).register("persistedDefaults",lf).register("router",cf).register("serviceURL",uf).register("session",hf).register("streamer",mf).register("streamFilter",df).register("tags",ff).register("threadsService",gf).register("toastMessenger",vf).register("store",{factory:_v}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Cv),n.run(kv),n.run(Sv),n.run(ee),n.run(Av),I(po(ni.Provider,{value:n,children:po(Sm,{})}),t)}(e,Ev)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),I(po(Cm,{error:e}),t)}(e,Ev)));