hypothesis 1.1464.0 → 1.1466.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/boot.js CHANGED
@@ -1 +1 @@
1
- !function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?13c5ed","styles/annotator.css":"styles/annotator.css?ec72d0","styles/annotator.css.map":"styles/annotator.css.map?de3818","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?e179ab","styles/katex.min.css.map":"styles/katex.min.css.map?cd8c0e","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css.map":"styles/sidebar.css.map?1984a9","styles/ui-playground.css":"styles/ui-playground.css?db6174","styles/sidebar.css":"styles/sidebar.css?13d728","styles/ui-playground.css.map":"styles/ui-playground.css.map?ec0173","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?0663e4","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?a5d947","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?ed487e","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?0ad0cd","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?415b42"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var n=s.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,t(n),s.head.appendChild(n)}function n(s,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,o=void 0===r||r,i=n.forceReload,a=void 0!==i&&i,l=s.createElement("script");o&&(l.type="module"),a&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,t(l),s.head.appendChild(l)}function r(s,e,n,r){var o=s.createElement("link");o.rel=e,o.href=r,o.type="application/annotator+".concat(n),t(o),s.head.appendChild(o)}function o(s,e,n){var r=s.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),t(r),s.head.appendChild(r)}function i(s,t){return s.assetRoot+"build/"+s.manifest[t]}function a(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=function(){var s,t,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return e?(s=e.src,(t=s.match(/(https?):\/\/([^:/]+)/))?{protocol:t[1],hostname:t[2]}:null):null}(t);if(!e)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",e.hostname)).replace("{current_scheme}",e.protocol)}if(function(){var s=[function(){return Object.fromEntries([])},function(){return new URL(document.location.href)},function(){return new Request("https://hypothes.is")},function(){return Element.prototype.attachShadow},function(){return CSS.supports("display: grid")},function(){return document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0}];try{return s.every((function(s){return s()}))}catch(s){return!1}}()){var l=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),n=0;n<e.length;n++){var r=void 0;try{r=JSON.parse(e[n].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(t,r)}return t}(document),c=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1464.0/");if(document.querySelector("hypothesis-app")){!function(s,t){o(s,"fetch",t.apiUrl),o(s,"fetch",t.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)n(s,i(t,a[r]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)e(s,i(t,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,u=a(d.notebookAppUrl||"https://hypothes.is/notebook"),h=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",t.sidebarAppUrl),r(s,"notebook","html",t.notebookAppUrl),r(s,"profile","html",t.profileAppUrl),o(s,"style",i(t,"styles/annotator.css")),r(s,"hypothesis-client","javascript",t.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)n(s,i(t,l[a]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,d=c;p<d.length;p++)e(s,i(t,d[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:u,profileAppUrl:h,sidebarAppUrl:y})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
1
+ !function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?a6b57e","styles/annotator.css":"styles/annotator.css?ec72d0","styles/annotator.css.map":"styles/annotator.css.map?de3818","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?e179ab","styles/katex.min.css.map":"styles/katex.min.css.map?cd8c0e","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css":"styles/sidebar.css?13d728","styles/sidebar.css.map":"styles/sidebar.css.map?1984a9","styles/ui-playground.css":"styles/ui-playground.css?db6174","styles/ui-playground.css.map":"styles/ui-playground.css.map?ec0173","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?ed487e","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?0663e4","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?37f2eb","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?8d50ee","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?0ad0cd"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var n=s.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,t(n),s.head.appendChild(n)}function n(s,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,o=void 0===r||r,i=n.forceReload,a=void 0!==i&&i,l=s.createElement("script");o&&(l.type="module"),a&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,t(l),s.head.appendChild(l)}function r(s,e,n,r){var o=s.createElement("link");o.rel=e,o.href=r,o.type="application/annotator+".concat(n),t(o),s.head.appendChild(o)}function o(s,e,n){var r=s.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),t(r),s.head.appendChild(r)}function i(s,t){return s.assetRoot+"build/"+s.manifest[t]}function a(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=function(){var s,t,e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:document).currentScript;return e?(s=e.src,(t=s.match(/(https?):\/\/([^:/]+)/))?{protocol:t[1],hostname:t[2]}:null):null}(t);if(!e)throw new Error("Could not process URL template because script origin is unknown");return s=(s=s.replace("{current_host}",e.hostname)).replace("{current_scheme}",e.protocol)}if(function(){var s=[function(){return Object.fromEntries([])},function(){return new URL(document.location.href)},function(){return new Request("https://hypothes.is")},function(){return Element.prototype.attachShadow},function(){return CSS.supports("display: grid")},function(){return document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0}];try{return s.every((function(s){return s()}))}catch(s){return!1}}()){var l=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),n=0;n<e.length;n++){var r=void 0;try{r=JSON.parse(e[n].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(t,r)}return t}(document),c=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1466.0/");if(document.querySelector("hypothesis-app")){!function(s,t){o(s,"fetch",t.apiUrl),o(s,"fetch",t.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)n(s,i(t,a[r]),{esModule:!0});for(var l=0,c=["styles/katex.min.css","styles/sidebar.css"];l<c.length;l++)e(s,i(t,c[l]))}(document,{assetRoot:c,manifest:s,apiUrl:l.apiUrl})}else{var p=function(){var s;return null===(s=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).chrome)||void 0===s||null===(s=s.runtime)||void 0===s?void 0:s.id}();if(p&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(p))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,u=a(d.notebookAppUrl||"https://hypothes.is/notebook"),h=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",t.sidebarAppUrl),r(s,"notebook","html",t.notebookAppUrl),r(s,"profile","html",t.profileAppUrl),o(s,"style",i(t,"styles/annotator.css")),r(s,"hypothesis-client","javascript",t.assetRoot+"build/boot.js");for(var a=0,l=["scripts/annotator.bundle.js"];a<l.length;a++)n(s,i(t,l[a]),{esModule:!1});var c=[];void 0!==window.PDFViewerApplication&&c.push("styles/pdfjs-overrides.css"),c.push("styles/highlights.css");for(var p=0,d=c;p<d.length;p++)e(s,i(t,d[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:u,profileAppUrl:h,sidebarAppUrl:y})}}else console.warn("The Hypothesis annotation tool is not supported in this browser. See https://web.hypothes.is/help/which-browsers-are-supported-by-hypothesis/.")}();
@@ -1,5 +1,5 @@
1
1
  {
2
- "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?13c5ed",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?a6b57e",
3
3
  "styles/annotator.css": "styles/annotator.css?ec72d0",
4
4
  "styles/annotator.css.map": "styles/annotator.css.map?de3818",
5
5
  "styles/highlights.css": "styles/highlights.css?6b4ebd",
@@ -8,13 +8,13 @@
8
8
  "styles/katex.min.css.map": "styles/katex.min.css.map?cd8c0e",
9
9
  "styles/pdfjs-overrides.css": "styles/pdfjs-overrides.css?c95edf",
10
10
  "styles/pdfjs-overrides.css.map": "styles/pdfjs-overrides.css.map?1d8ac6",
11
+ "styles/sidebar.css": "styles/sidebar.css?13d728",
11
12
  "styles/sidebar.css.map": "styles/sidebar.css.map?1984a9",
12
13
  "styles/ui-playground.css": "styles/ui-playground.css?db6174",
13
- "styles/sidebar.css": "styles/sidebar.css?13d728",
14
14
  "styles/ui-playground.css.map": "styles/ui-playground.css.map?ec0173",
15
- "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?0663e4",
16
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?a5d947",
17
15
  "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?ed487e",
18
- "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?0ad0cd",
19
- "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?415b42"
16
+ "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?0663e4",
17
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?37f2eb",
18
+ "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?8d50ee",
19
+ "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?0ad0cd"
20
20
  }
@@ -140,7 +140,7 @@ this._sidebarRPC.on("scrollToAnnotation",(t=>{this._scrollToAnnotation(t)})),thi
140
140
  this._selectionObserver.disconnect(),this._adder.destroy(),this._bucketBarClient.destroy(),null===(t=this._clusterToolbar)||void 0===t||t.destroy(),null===(e=this._outsideAssignmentNotice)||void 0===e||e.destroy(),function(t){ti(Array.from(t.querySelectorAll("hypothesis-highlight")))}(this.element),this._integration.destroy()}async anchor(t){this._contentReady&&(await this._contentReady,this._contentReady=void 0);const e=t=>{var e;const n=vr(t);if(!n)return;const i=Qn(n,null===(e=t.annotation)||void 0===e?void 0:e.$cluster);i.forEach((e=>{e._annotation=t.annotation})),t.highlights=i,this._hoveredAnnotations.has(t.annotation.$tag)&&ei(i,!0)};this.detach(t.$tag,!1),this._annotations.add(t.$tag),t.target||(t.target=[]);const n=await Promise.all(t.target.map((async e=>{if(!e.selector||!e.selector.some((t=>"TextQuoteSelector"===t.type)))return{annotation:t,target:e};let n;try{const i=await this._integration.anchor(this.element,e.selector),o=Un.fromRange(i);n={annotation:t,target:e,range:o}}catch(i){n={
141
141
  annotation:t,target:e}}return n})));if(!this._annotations.has(t.$tag))return[];for(const t of n)e(t);return t.$orphan=n.length>0&&n.every((t=>t.target.selector&&!t.range)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",t),n}detach(t,e=!0){this._annotations.delete(t);const n=[];for(const e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&ti(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){var n;this.anchors=t,null===(n=this._clusterToolbar)||void 0===n||n.scheduleClusterUpdates(),e&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:t=!1}={}){const e=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),i=this.element,o=(await Promise.all(e.map((t=>this._integration.describe(i,t))))).map((t=>({source:n.uri,selector:t}))),r={uri:n.uri,document:n.metadata,target:o,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+s(8)};return this._sidebarRPC.call("createAnnotation",r),
142
142
  this.anchor(r),br(),r}_hoverAnnotations(t){this._hoveredAnnotations.clear(),t.forEach((t=>this._hoveredAnnotations.add(t)));for(const e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);ei(e.highlights,n)}this._sidebarRPC.call("hoverAnnotations",t)}_onSelection(t){const e=this._integration.getAnnotatableRange(t);if(!e)return void this._onClearSelection();const n=document.getSelection(),i=jn(n),o=Gn(n);o?(this.selectedRanges=[e],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=gr(),this._isAdderVisible=!0,this._adder.show(o,i)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}selectAnnotations(t,{toggle:e=!1,focusInSidebar:n=!1}={}){e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t,n),this._sidebarRPC.call("openSidebar")}
143
- setHighlightsVisible(t,e=!0){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){le(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(t){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new fr(this.element)),this._outsideAssignmentNotice.setVisible(t)}}function xr(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function Cr(t,e){var n;const i={};for(const[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.1464.0";const o=new URL(window.location.href);if(o.hash="",
143
+ setHighlightsVisible(t,e=!0){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){le(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(t){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new fr(this.element)),this._outsideAssignmentNotice.setVisible(t)}}function xr(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function Cr(t,e){var n;const i={};for(const[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.1466.0";const o=new URL(window.location.href);if(o.hash="",
144
144
  i.hostURL=o.toString(),Array.isArray(i.services)&&(null===(n=i.services)||void 0===n?void 0:n.length)>0){const t=i.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),t.onLogoutRequest&&(t.onLogoutRequestProvided=!0),t.onSignupRequest&&(t.onSignupRequestProvided=!0),t.onProfileRequest&&(t.onProfileRequestProvided=!0),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return i}function Sr({closed:t,onClose:e,children:n,"data-testid":i,"aria-label":o}){const r=Kt(null);return Yt((()=>{var e,n;t?null===(e=r.current)||void 0===e||e.close():null===(n=r.current)||void 0===n||n.showModal()}),[t]),Yt((()=>{const t=r.current;return null==t||t.addEventListener("cancel",e),()=>{null==t||t.removeEventListener("cancel",e)}}),[e]),we("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":i,"aria-label":o,children:n})}function Nr({closed:t,children:e,...n}){return we("div",{...n,className:be("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:t}),children:we("div",{
145
145
  className:"relative w-full h-full",children:e})})}function Er({document_:t=document,...e}){return we(Zt((()=>function(t){return"function"==typeof t.createElement("dialog").showModal}(t)?Sr:Nr),[t]),{...e})}function Ar({config:t,groupId:e}){return we("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:xr(t.notebookAppUrl,{...Cr(t.notebookAppUrl,t),group:e})})}function Tr({eventBus:t,config:e}){const[n,i]=Xt(0),[o,r]=Xt(!0),[s,a]=Xt(null),l=Kt(""),c=Kt(null);Yt((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),Yt((()=>{document.body.style.overflow=o?l.current:"hidden"}),[o]),Yt((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),i((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t]);const h=Qt((()=>{var t;r(!0),null===(t=c.current)||void 0===t||t.publish("closeNotebook")}),[]);return null===s?null:we(Er,{closed:o,onClose:h,"data-testid":"notebook-outer",
146
146
  "aria-label":"Hypothesis notebook",children:[we("div",{className:"absolute right-0 m-3",children:we(an,{title:"Close notebook",onClick:h,variant:"dark",classes:be("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:we(ke,{className:"w-4 h-4"})})}),we(Ar,{config:e,groupId:s},n)]})}class kr{constructor(t,e,n){i(this,"_container",void 0),this._container=new kn("notebook",(()=>we(Tr,{eventBus:e,config:n}))),t.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Rr({eventBus:t,config:e}){const[n,i]=Xt(!0),o=Kt(null);Yt((()=>{const e=t.createEmitter();return e.subscribe("openProfile",(()=>{i(!1)})),o.current=e,()=>{e.destroy()}}),[t]);const r=()=>{var t;i(!0),null===(t=o.current)||void 0===t||t.publish("closeProfile")};return n?null:we(Er,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[we("div",{className:"absolute right-0 m-3",children:we(an,{title:"Close profile dialog",onClick:r,
@@ -553,7 +553,7 @@ const uf=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5
553
553
  ;return function(r){return r===t||(t=r,n=e(r)),n}}((function(e){const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:Sf[t.sortKey]};if(!!t.filterQuery||Object.keys(t.filters).length>0){const e=function(e,t={}){const n=e=>{const n=t[e];return"string"==typeof n?[n]:[]},r=n("cfi"),o=n("page"),i=n("quote"),a=n("tag"),s=n("text"),l=n("uri"),c=n("user"),u=[],d=[],h=yf(e,gf);for(const e of h){const t=e.slice(0,e.indexOf(":")),n=e.slice(t.length+1);switch(t){case"cfi":r.push(n);break;case"quote":i.push(n);break;case"page":o.push(n);break;case"since":{const t=86400,n={sec:1,min:60,hour:3600,day:t,week:7*t,month:30*t,year:365*t},r=e.slice(6).toLowerCase().match(/^(\d+)(sec|min|hour|day|week|month|year)?$/);if(r){const e=parseFloat(r[1]),t=r[2]||"sec";d.push(e*n[t])}}break;case"tag":a.push(n);break;case"text":s.push(n);break;case"uri":l.push(n);break;case"user":c.push(n);break;default:u.push(e)}}return{any:{terms:u,operator:"and"},cfi:{terms:r,operator:"or"},quote:{
554
554
  terms:i,operator:"and"},page:{terms:o,operator:"or"},since:{terms:d,operator:"and"},tag:{terms:a,operator:"and"},text:{terms:s,operator:"and"},uri:{terms:l,operator:"or"},user:{terms:c,operator:"or"}}}(t.filterQuery||"",t.filters);n.filterFn=t=>function(e,t){const n=(e,t)=>new hf(t,ff[e]),r=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{let r;if("any"===e){const e=["quote","text","tag","user"];r=t.terms.map((t=>new mf("or",e.map((e=>n(e,t))))))}else r=t.terms.map((t=>n(e,t)));return new mf(t.operator,r)})),o=new mf("and",r);return e.filter((e=>e.id&&o.matches(e))).map((e=>e.id))}([t],e).length>0}const r=tf(e.annotations,n),o={annotation:0,note:0,orphan:0};return e.showTabs&&(r.children=r.children.filter((e=>{if(!e.annotation)return!1;if(jo(e.annotation))return!1;const n=xf(e.annotation);return o[n]+=1,n===t.selectedTab}))),{tabCounts:o,rootThread:r}}));function Ef(){
555
555
  const e=Ia(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a="sidebar"===r,s=de((()=>{const e={...o,filterQuery:n,filters:i};return{annotations:t,selection:e,showTabs:a}}),[t,n,o,i,a]);return Af(s)}var Tf=Qr((function({loadAnnotationsService:e,onLogin:t}){var n;const r=Ia(),o=null!==(n=r.routeParams().id)&&void 0!==n?n:"",{rootThread:i}=Ef(),a=r.profile().userid,[s,l]=ae(!1);return le((()=>{l(!1),r.clearAnnotations(),e.loadThread(o).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&r.setExpanded(e.id,!0))),t.id!==o&&r.highlightAnnotations([o]))})).catch((()=>{l(!0)}))}),[o,a,e,r]),De(v,{children:[s&&De(za,{errorType:"annotation",onLoginRequest:t}),De(Gp,{threads:i.children})]})}),["loadAnnotationsService"]);class Cf{constructor(e,t,n=window){var r,o,i;H(this,"version",void 0),H(this,"userAgent",void 0),H(this,"urls",void 0),H(this,"fingerprint",void 0),H(this,"account",void 0),H(this,"timestamp",void 0),
556
- H(this,"segment",void 0);const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.1464.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(o=o.metadata)||void 0===o?void 0:o.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString();const l=null===(i=t[0])||void 0===i?void 0:i.segment;if(l){const e=[];if(l.cfi&&e.push(["CFI",l.cfi]),l.pages){const t=`${l.pages.start}-${l.pages.end}`;e.push(["Pages",t])}l.url&&e.push(["URL",l.url]),this.segment=e.map((([e,t])=>`${e}: ${t}`)).join(", ")}}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())}}var Mf="complete",If="canceled";function zf(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,
556
+ H(this,"segment",void 0);const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.1466.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(o=o.metadata)||void 0===o?void 0:o.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString();const l=null===(i=t[0])||void 0===i?void 0:i.segment;if(l){const e=[];if(l.cfi&&e.push(["CFI",l.cfi]),l.pages){const t=`${l.pages.start}-${l.pages.end}`;e.push(["Pages",t])}l.url&&e.push(["URL",l.url]),this.segment=e.map((([e,t])=>`${e}: ${t}`)).join(", ")}}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())}}var Mf="complete",If="canceled";function zf(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,
557
557
  e.scrollTop=n)}function Lf(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=function(e,t){var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),d=c&&null!=c.left?c.left:.5,h=c&&null!=c.top?c.top:.5,m=c&&null!=c.leftOffset?c.leftOffset:0,p=c&&null!=c.topOffset?c.topOffset:0,f=d,g=h;if(e.isWindow(t))s=Math.min(u.width,t.innerWidth),l=Math.min(u.height,t.innerHeight),r=u.left+t.pageXOffset-t.innerWidth*f+s*f,o=u.top+t.pageYOffset-t.innerHeight*g+l*g,r-=m,o-=p,r=e.align.lockX?t.pageXOffset:r,o=e.align.lockY?t.pageYOffset:o,i=r-t.pageXOffset,a=o-t.pageYOffset;else{s=u.width,l=u.height,n=t.getBoundingClientRect();var v=u.left-(n.left-t.scrollLeft),b=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=b+l*g-t.clientHeight*g,r-=m,o-=p,r=Math.max(Math.min(r,t.scrollWidth-t.clientWidth),0),o=Math.max(Math.min(o,t.scrollHeight-t.clientHeight),0),r=e.align.lockX?t.scrollLeft:r,o=e.align.lockY?t.scrollTop:o,i=r-t.scrollLeft,a=o-t.scrollTop}return{x:r,y:o,differenceX:i,differenceY:a}
558
558
  }(t,e),o=Date.now()-t.startTime,i=Math.min(1/t.time*o,1);if(t.endIterations>=n)return zf(e,r.x,r.y),e._scrollSettings=null,t.end(Mf);var a=1-t.ease(i);if(zf(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&Lf(t.scrollAncestor),void Lf(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(Lf.bind(null,e))}}function Of(e){return e.self===e}function Rf(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function Pf(){return!0}function Df(e){if(e.assignedSlot)return Df(e.assignedSlot);if(e.parentElement)return"body"===e.parentElement.tagName.toLowerCase()?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}var Ff=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),t.time=isNaN(t.time)?1e3:t.time,
559
559
  t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{};var r=Df(e),o=1,i=t.validTarget||Pf,a=t.isScrollable;t.debug&&(console.log("About to scroll to",e),r||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var s=[];r;)if(t.debug&&console.log("Scrolling parent node",r),i(r,o)&&(a?a(r,Rf):Rf(r))&&(o++,s.push(r)),!(r=Df(r))){l(Mf);break}return s.reduce(((n,r,o)=>function(e,t,n,r,o){var i,a=!t._scrollSettings,s=t._scrollSettings,l=Date.now(),c={passive:!0};function u(e){t._scrollSettings=null,t.parentElement&&t.parentElement._scrollSettings&&t.parentElement._scrollSettings.end(e),n.debug&&console.log("Scrolling ended with type",e,"for",t),o(e),i&&(t.removeEventListener("touchstart",i,c),t.removeEventListener("wheel",i,c))}s&&s.end(If);var d=n.maxSynchronousAlignments;return null==d&&(d=3),t._scrollSettings={startTime:l,endIterations:0,target:e,time:n.time,ease:n.ease,align:n.align,isWindow:n.isWindow||Of,maxSynchronousAlignments:d,end:u,scrollAncestor:r},
@@ -640,7 +640,7 @@ const n=Jo(e),r=Ko(e),o=[`Created at: ${Ep(new Date(e.created))}`,`Author: ${c(e
640
640
  }(De("html",{lang:"en",children:[De("head",{children:[De("title",{children:`Annotations on "${a}"`}),De("meta",{charSet:"UTF-8"})]}),De("body",{children:[De("section",{children:[De("h1",{children:"Summary"}),De("p",{children:De("time",{dateTime:o.toISOString(),children:Ep(o)})}),De("p",{children:De("strong",{children:a})}),De("p",{children:De("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i})}),De("table",{children:De("tbody",{style:{verticalAlign:"top"},children:[De("tr",{children:[De("td",{children:"Group:"}),De("td",{children:t})]}),De("tr",{children:[De("td",{children:"Total users:"}),De("td",{children:s.length})]}),De("tr",{children:[De("td",{children:"Users:"}),De("td",{children:s.join(", ")})]}),De("tr",{children:[De("td",{children:"Total annotations:"}),De("td",{children:e.length})]}),De("tr",{children:[De("td",{children:"Total replies:"}),De("td",{children:l.length})]})]})})]}),De("hr",{}),De("section",{children:[De("h1",{children:"Annotations"}),e.map(((e,t)=>{
641
641
  const n=Jo(e),r=Ko(e),o=Lm(e.text),i=o===`<p>${e.text}</p>`?e.text:o;return De("article",{children:[De("h2",{children:["Annotation ",t+1,":"]}),De("table",{children:De("tbody",{style:{verticalAlign:"top"},children:[De("tr",{children:[De("td",{children:"Created at:"}),De("td",{children:De("time",{dateTime:e.created,children:Ep(new Date(e.created))})})]}),De("tr",{children:[De("td",{children:"Author:"}),De("td",{children:c(e)})]}),n&&De("tr",{children:[De("td",{children:"Page:"}),De("td",{children:n})]}),De("tr",{children:[De("td",{children:"Type:"}),De("td",{children:Wo(e)})]}),r&&De("tr",{children:[De("td",{children:"Quote:"}),De("td",{children:De("blockquote",{style:{margin:0},children:r})})]}),De("tr",{children:[De("td",{children:"Comment:"}),De("td",{dangerouslySetInnerHTML:{__html:i}})]}),e.tags.length>0&&De("tr",{children:[De("td",{children:"Tags:"}),De("td",{children:e.tags.join(", ")})]})]})})]},e.id)}))]})]})]}),{},{pretty:!0}).replace(/\t/g," ")}
642
642
  _exportCommon(e,{displayNamesEnabled:t,defaultAuthority:n}){const[r]=e;if(!r)throw new Error("No annotations to export");const o=e=>ss(e,n,t),{uri:i,title:a}=zo(r);return{uri:i,title:a,uniqueUsers:[...new Set(e.map((e=>o(e))).filter(Boolean))],replies:e.filter((e=>Po(e))),extractUsername:o}}}_b.$inject=[];class yb extends Error{constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),n&&(r+=`: ${n}`),super(r),H(this,"url",void 0),H(this,"response",void 0),H(this,"reason",void 0),this.url=e,this.response=t,this.reason=n}}async function wb(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new yb(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new yb(e,n,"Failed to parse response")}var o;if(!n.ok)throw new yb(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}class xb{constructor(e,t,n){H(this,"_clientId",void 0),H(this,"search",void 0),H(this,"annotation",void 0),H(this,"group",void 0),H(this,"groups",void 0),H(this,"profile",void 0),
643
- this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,i]=await Promise.all([e,n()]),l=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!l)throw new Error(`Missing API route: ${t}`);const c={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1464.0"};i&&(c.Authorization="Bearer "+i);const u=r();u&&(c["X-Client-Id"]=u);const{url:d,unusedParams:h}=ra(l.url,a),m=new URL(d);for(const[e,t]of Object.entries(h)){const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&m.searchParams.append(e,t.toString())}return await wb(m.toString(),{body:s?JSON.stringify(fb(s)):null,headers:c,method:l.method})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished})
643
+ this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,i]=await Promise.all([e,n()]),l=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!l)throw new Error(`Missing API route: ${t}`);const c={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1466.0"};i&&(c.Authorization="Bearer "+i);const u=r();u&&(c["X-Client-Id"]=u);const{url:d,unusedParams:h}=ra(l.url,a),m=new URL(d);for(const[e,t]of Object.entries(h)){const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&m.searchParams.append(e,t.toString())}return await wb(m.toString(),{body:s?JSON.stringify(fb(s)):null,headers:c,method:l.method})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,onRequestFinished:n.apiRequestFinished})
644
644
  ;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={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}}xb.$inject=["apiRoutes","auth","store"];var kb={};function Nb(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 Sb=Nb;Nb.prototype.reset=function(){this._attempts=1,
645
645
  this._timeouts=this._originalTimeouts.slice(0)},Nb.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Nb.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();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},Nb.prototype.attempt=function(e,t){this._fn=e,
646
646
  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)},Nb.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Nb.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Nb.prototype.start=Nb.prototype.try,Nb.prototype.errors=function(){return this._errors},Nb.prototype.attempts=function(){return this._attempts},Nb.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=Sb;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})},
@@ -670,8 +670,8 @@ qb(this._store.subscribe,(()=>[this._store.hasFetchedProfile(),this._store.profi
670
670
  },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;const t=null===(e=this._serviceConfig)||void 0===e?void 0:e.groups;if(Array.isArray(t)||"function"==typeof(null==(n=t)?void 0:n.then)){let e=[];try{e=await t}catch(e){this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(e)}return this._loadGroupsForUserAndDocument();var n}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=>!Po(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"})}}
671
671
  Xb.$inject=["store","api","auth","settings","toastMessenger"];const Jb=Object.prototype.toString;function Zb(e){switch(Jb.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return l_(e,Error)}}function Qb(e,t){return Jb.call(e)===`[object ${t}]`}function e_(e){return Qb(e,"ErrorEvent")}function t_(e){return Qb(e,"DOMError")}function n_(e){return Qb(e,"String")}function r_(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function o_(e){return null===e||r_(e)||"object"!=typeof e&&"function"!=typeof e}function i_(e){return Qb(e,"Object")}function a_(e){return"undefined"!=typeof Event&&l_(e,Event)}function s_(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function l_(e,t){try{return e instanceof t}catch(e){return!1}}function c_(e){return!("object"!=typeof e||null===e||!e.__isVue&&!e._isVue)}function u_(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function d_(e,t){
672
672
  if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{c_(r)?n.push("[VueViewModel]"):n.push(String(r))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function h_(e,t,n=!1){return!!n_(e)&&(Qb(t,"RegExp")?t.test(e):!!n_(t)&&(n?e===t:e.includes(t)))}function m_(e,t=[],n=!1){return t.some((t=>h_(e,t,n)))}function p_(e,t,n=250,r,o,i,a){if(!(i.exception&&i.exception.values&&a&&l_(a.originalException,Error)))return;const s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;var l,c;s&&(i.exception.values=(l=f_(e,t,o,a.originalException,r,i.exception.values,s,0),c=n,l.map((e=>(e.value&&(e.value=u_(e.value,c)),e)))))}function f_(e,t,n,r,o,i,a,s){if(i.length>=n+1)return i;let l=[...i];if(l_(r[o],Error)){g_(a,s);const i=e(t,r[o]),c=l.length;v_(i,o,c,s),l=f_(e,t,n,r[o],o,[i,...l],i,c)}return Array.isArray(r.errors)&&r.errors.forEach(((r,i)=>{if(l_(r,Error)){g_(a,s);const c=e(t,r),u=l.length;v_(c,`errors[${i}]`,u,s),
673
- l=f_(e,t,n,r,o,[c,...l],c,u)}})),l}function g_(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,is_exception_group:!0,exception_id:t}}function v_(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function b_(e){return e&&e.Math==Math?e:void 0}const __="object"==typeof globalThis&&b_(globalThis)||"object"==typeof window&&b_(window)||"object"==typeof self&&b_(self)||"object"==typeof global&&b_(global)||function(){return this}()||{};function y_(){return __}function w_(e,t,n){const r=n||__,o=r.__SENTRY__=r.__SENTRY__||{};return o[e]||(o[e]=t())}const x_=y_(),k_=80;function N_(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let i=0,a=0;const s=" > ",l=s.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||k_;for(;n&&i++<r&&(c=S_(n,u),!("html"===c||i>1&&a+o.length*l+c.length>=d));)o.push(c),a+=c.length,n=n.parentNode
674
- ;return o.reverse().join(s)}catch(e){return"<unknown>"}}function S_(e,t){const n=e,r=[];let o,i,a,s,l;if(!n||!n.tagName)return"";if(x_.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const c=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(c&&c.length)c.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),o=n.className,o&&n_(o))for(i=o.split(/\s+/),l=0;l<i.length;l++)r.push(`.${i[l]}`);const u=["aria-label","type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],s=n.getAttribute(a),s&&r.push(`[${a}="${s}"]`);return r.join("")}const A_="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,E_=["debug","info","warn","error","log","assert","trace"],T_={};function C_(e){if(!("console"in __))return e();const t=__.console,n={},r=Object.keys(T_);r.forEach((e=>{const r=T_[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}
673
+ l=f_(e,t,n,r,o,[c,...l],c,u)}})),l}function g_(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,..."AggregateError"===e.type&&{is_exception_group:!0},exception_id:t}}function v_(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function b_(e){return e&&e.Math==Math?e:void 0}const __="object"==typeof globalThis&&b_(globalThis)||"object"==typeof window&&b_(window)||"object"==typeof self&&b_(self)||"object"==typeof global&&b_(global)||function(){return this}()||{};function y_(){return __}function w_(e,t,n){const r=n||__,o=r.__SENTRY__=r.__SENTRY__||{};return o[e]||(o[e]=t())}const x_=y_(),k_=80;function N_(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,o=[];let i=0,a=0;const s=" > ",l=s.length;let c;const u=Array.isArray(t)?t:t.keyAttrs,d=!Array.isArray(t)&&t.maxStringLength||k_;for(;n&&i++<r&&(c=S_(n,u),!("html"===c||i>1&&a+o.length*l+c.length>=d));)o.push(c),a+=c.length,
674
+ n=n.parentNode;return o.reverse().join(s)}catch(e){return"<unknown>"}}function S_(e,t){const n=e,r=[];let o,i,a,s,l;if(!n||!n.tagName)return"";if(x_.HTMLElement&&n instanceof HTMLElement&&n.dataset&&n.dataset.sentryComponent)return n.dataset.sentryComponent;r.push(n.tagName.toLowerCase());const c=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(c&&c.length)c.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),o=n.className,o&&n_(o))for(i=o.split(/\s+/),l=0;l<i.length;l++)r.push(`.${i[l]}`);const u=["aria-label","type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],s=n.getAttribute(a),s&&r.push(`[${a}="${s}"]`);return r.join("")}const A_="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,E_=["debug","info","warn","error","log","assert","trace"],T_={};function C_(e){if(!("console"in __))return e();const t=__.console,n={},r=Object.keys(T_);r.forEach((e=>{const r=T_[e];n[e]=t[e],t[e]=r}));try{return e()}finally{r.forEach((e=>{t[e]=n[e]}))}}
675
675
  const M_=function(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return A_?E_.forEach((n=>{t[n]=(...t)=>{e&&C_((()=>{__.console[n](`Sentry Logger [${n}]:`,...t)}))}})):E_.forEach((e=>{t[e]=()=>{}})),t}(),I_=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function z_(e,t=!1){const{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${a}`}function L_(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function O_(e){const t="string"==typeof e?function(e){const t=I_.exec(e);if(!t)return void C_((()=>{console.error(`Invalid Sentry Dsn: ${e}`)}));const[n,r,o="",i,a="",s]=t.slice(1);let l="",c=s;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return L_({host:i,pass:o,path:l,projectId:c,port:a,protocol:n,publicKey:r})}(e):L_(e)
676
676
  ;if(t&&function(e){if(!A_)return!0;const{port:t,projectId:n,protocol:r}=e;return!(["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(M_.error(`Invalid Sentry Dsn: ${t} missing`),!0)))||(n.match(/^\d+$/)?function(e){return"http"===e||"https"===e}(r)?t&&isNaN(parseInt(t,10))&&(M_.error(`Invalid Sentry Dsn: Invalid port ${t}`),1):(M_.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),1):(M_.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),1)))}(t))return t}class R_ extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}function P_(e,t,n){if(!(t in e))return;const r=e[t],o=n(r);"function"==typeof o&&F_(o,r),e[t]=o}function D_(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch(n){A_&&M_.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function F_(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,D_(e,"__sentry_original__",t)
677
677
  }catch(e){}}function B_(e){return e.__sentry_original__}function H_(e){if(Zb(e))return{message:e.message,name:e.name,stack:e.stack,...$_(e)};if(a_(e)){const t={type:e.type,target:j_(e.target),currentTarget:j_(e.currentTarget),...$_(e)};return"undefined"!=typeof CustomEvent&&l_(e,CustomEvent)&&(t.detail=e.detail),t}return e}function j_(e){try{return t=e,"undefined"!=typeof Element&&l_(t,Element)?N_(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}var t}function $_(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function U_(e){return q_(e,new Map)}function q_(e,t){if(function(e){if(!i_(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||"Object"===t}catch(e){return!0}}(e)){const n=t.get(e);if(void 0!==n)return n;const r={};t.set(e,r);for(const n of Object.keys(e))void 0!==e[n]&&(r[n]=q_(e[n],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[]
@@ -688,7 +688,7 @@ function Dy(e,t,n=1/0,r=1/0,o=function(){const e="function"==typeof WeakSet,t=e?
688
688
  e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Fy||(Fy={}));class jy{constructor(e){jy.prototype.__init.call(this),jy.prototype.__init2.call(this),jy.prototype.__init3.call(this),jy.prototype.__init4.call(this),this._state=Fy.PENDING,this._handlers=[];try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new jy(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new jy(((t,n)=>{let r,o;return this.then((t=>{o=!1,r=t,e&&e()}),(t=>{o=!0,r=t,e&&e()})).then((()=>{o?n(r):t(r)}))}))}__init(){this._resolve=e=>{this._setResult(Fy.RESOLVED,e)}}__init2(){this._reject=e=>{this._setResult(Fy.REJECTED,e)}}__init3(){this._setResult=(e,t)=>{this._state===Fy.PENDING&&(s_(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init4(){this._executeHandlers=()=>{
689
689
  if(this._state===Fy.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===Fy.RESOLVED&&e[1](this._value),this._state===Fy.REJECTED&&e[2](this._value),e[0]=!0)}))}}}function $y(e){const 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 Hy(new R_("Not adding Promise because buffer limit was reached."));const o=r();return-1===t.indexOf(o)&&t.push(o),o.then((()=>n(o))).then(null,(()=>n(o).then(null,(()=>{})))),o},drain:function(e){return new jy(((n,r)=>{let o=t.length;if(!o)return n(!0);const i=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{By(e).then((()=>{--o||(clearTimeout(i),n(!0))}),r)}))}))}}}function Uy(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const qy=["fatal","error","warning","log","info","debug"];function Gy(e){
690
690
  return"warn"===e?"warning":qy.includes(e)?e:"log"}const Vy=1e3;function Wy(){return Date.now()/Vy}const Yy=function(){const{performance:e}=__;if(!e||!e.now)return Wy;const t=Date.now()-e.now(),n=null==e.timeOrigin?t:e.timeOrigin;return()=>(n+e.now())/Vy}();function Ky(e,t=[]){return[e,t]}function Xy(e,t){const[n,r]=e;return[n,[...r,t]]}function Jy(e,t){const n=e[1];for(const e of n){if(t(e,e[0].type))return!0}return!1}function Zy(e,t){return(t||new TextEncoder).encode(e)}function Qy(e,t){const[n,r]=e;let o=JSON.stringify(n);function i(e){"string"==typeof o?o="string"==typeof e?o+e:[Zy(o,t),e]:o.push("string"==typeof e?Zy(e,t):e)}for(const e of r){const[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch(t){e=JSON.stringify(Ry(n))}i(e)}}return"string"==typeof o?o:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(o)}function ew(e,t){
691
- const n="string"==typeof e.data?Zy(e.data,t):e.data;return[U_({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=__;if(!e||!e.now)return;const 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)})();const tw={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",statsd:"unknown"};function nw(e){return tw[e]}function rw(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}const ow=6e4;function iw(e,{statusCode:t,headers:n},r=Date.now()){const o={...e},i=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(i)for(const e of i.trim().split(",")){
691
+ const n="string"==typeof e.data?Zy(e.data,t):e.data;return[U_({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=__;if(!e||!e.now)return;const 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)})();const tw={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"unknown"};function nw(e){return tw[e]}function rw(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}const ow=6e4;function iw(e,{statusCode:t,headers:n},r=Date.now()){const o={...e},i=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(i)for(const e of i.trim().split(",")){
692
692
  const[t,n]=e.split(":",2),i=parseInt(t,10),a=1e3*(isNaN(i)?60:i);if(n)for(const e of n.split(";"))o[e]=r+a;else o.all=r+a}else a?o.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?ow:r-t}(a,r):429===t&&(o.all=r+6e4);return o}const aw="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,sw="production";function lw(){return w_("globalEventProcessors",(()=>[]))}function cw(e){lw().push(e)}function uw(e,t,n,r=0){return new jy(((o,i)=>{const a=e[r];if(null===t||"function"!=typeof a)o(t);else{const s=a({...t},n);aw&&a.id&&null===s&&M_.log(`Event processor "${a.id}" dropped event`),s_(s)?s.then((t=>uw(e,t,n,r+1).then(o))).then(null,i):uw(e,s,n,r+1).then(o).then(null,i)}}))}function dw(e){const t=Yy(),n={sid:ry(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return U_({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),
693
693
  timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&hw(n,e),n}function hw(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Yy(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ry()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),
694
694
  t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function mw(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),hw(e,n)}const pw=1;function fw(e){const{spanId:t,traceId:n}=e.spanContext(),{data:r,op:o,parent_span_id:i,status:a,tags:s,origin:l}=gw(e);return U_({data:r,op:o,parent_span_id:i,span_id:t,status:a,tags:s,trace_id:n,origin:l})}function gw(e){return function(e){return"function"==typeof e.getSpanJSON}(e)?e.getSpanJSON():"function"==typeof e.toJSON?e.toJSON():{}}function vw(e,t,n,r,o,i){const{normalizeDepth:a=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||n.event_id||ry(),timestamp:t.timestamp||Wy()},c=n.integrations||e.integrations.map((e=>e.name));!function(e,t){const{environment:n,release:r,dist:o,maxValueLength:i=250}=t;"environment"in e||(e.environment="environment"in t?n:sw)
@@ -703,7 +703,7 @@ this._session&&hw(this._session,{user:e}),this._notifyScopeListeners(),this}getU
703
703
  const e=this._span;return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e;if(t instanceof Fw){const e=t.getScopeData();this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&Object.keys(e.user).length&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint.length&&(this._fingerprint=e.fingerprint),t.getRequestSession()&&(this._requestSession=t.getRequestSession()),e.propagationContext&&(this._propagationContext=e.propagationContext)}else if(i_(t)){const t=e;this._tags={...this._tags,...t.tags},this._extra={...this._extra,...t.extra},this._contexts={...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),
704
704
  t.propagationContext&&(this._propagationContext=t.propagationContext)}return this}clear(){return this._breadcrumbs=[],this._tags={},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._attachments=[],this._propagationContext=Bw(),this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:Wy(),...e},o=this._breadcrumbs;return o.push(r),this._breadcrumbs=o.length>n?o.slice(-n):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this.getScopeData().attachments}clearAttachments(){return this._attachments=[],this}getScopeData(){
705
705
  const{_breadcrumbs:e,_attachments:t,_contexts:n,_tags:r,_extra:o,_user:i,_level:a,_fingerprint:s,_eventProcessors:l,_propagationContext:c,_sdkProcessingMetadata:u,_transactionName:d,_span:h}=this;return{breadcrumbs:e,attachments:t,contexts:n,tags:r,extra:o,user:i,level:a,fingerprint:s||[],eventProcessors:l,propagationContext:c,sdkProcessingMetadata:u,transactionName:d,span:h}}applyToEvent(e,t={},n=[]){Ow(e,this.getScopeData());return uw([...n,...lw(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const n=t&&t.event_id?t.event_id:ry();if(!this._client)return M_.warn("No client configured on scope - will not capture exception!"),n;const r=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},this),n}
706
- captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:ry();if(!this._client)return M_.warn("No client configured on scope - will not capture message!"),r;const o=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:ry();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(M_.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function Bw(){return{traceId:ry(),spanId:ry().substring(16)}}const Hw="7.102.1",jw=parseFloat(Hw),$w=100;class Uw{constructor(e,t,n,r=jw){let o,i;this._version=r,t?o=t:(o=new Fw,o.setClient(e)),n?i=n:(i=new Fw,i.setClient(e)),this._stack=[{scope:o}],e&&this.bindClient(e),this._isolationScope=i}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,
706
+ captureMessage(e,t,n){const r=n&&n.event_id?n.event_id:ry();if(!this._client)return M_.warn("No client configured on scope - will not capture message!"),r;const o=new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:ry();return this._client?(this._client.captureEvent(e,{...t,event_id:n},this),n):(M_.warn("No client configured on scope - will not capture event!"),n)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function Bw(){return{traceId:ry(),spanId:ry().substring(16)}}const Hw="7.106.0",jw=parseFloat(Hw),$w=100;class Uw{constructor(e,t,n,r=jw){let o,i;this._version=r,t?o=t:(o=new Fw,o.setClient(e)),n?i=n:(i=new Fw,i.setClient(e)),this._stack=[{scope:o}],e&&this.bindClient(e),this._isolationScope=i}isOlderThan(e){return this._version<e}bindClient(e){const t=this.getStackTop();t.client=e,
707
707
  t.scope.setClient(e),e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=this.getScope().clone();return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();let n;try{n=e(t)}catch(e){throw this.popScope(),e}return s_(n)?n.then((e=>(this.popScope(),e)),(e=>{throw this.popScope(),e})):(this.popScope(),n)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStack(){return this._stack}getStackTop(){return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:ry(),r=new Error("Sentry syntheticException");return this.getScope().captureException(e,{originalException:e,syntheticException:r,...t,event_id:n}),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:ry(),o=new Error(e);return this.getScope().captureMessage(e,t,{
708
708
  originalException:e,syntheticException:o,...n,event_id:r}),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:ry();return e.type||(this._lastEventId=n),this.getScope().captureEvent(e,{...t,event_id:n}),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=$w}=r.getOptions&&r.getOptions()||{};if(i<=0)return;const a={timestamp:Wy(),...e},s=o?C_((()=>o(a,t))):a;null!==s&&(r.emit&&r.emit("beforeAddBreadcrumb",s,t),n.addBreadcrumb(s,i))}setUser(e){this.getScope().setUser(e),this.getIsolationScope().setUser(e)}setTags(e){this.getScope().setTags(e),this.getIsolationScope().setTags(e)}setExtras(e){this.getScope().setExtras(e),this.getIsolationScope().setExtras(e)}setTag(e,t){this.getScope().setTag(e,t),this.getIsolationScope().setTag(e,t)}setExtra(e,t){this.getScope().setExtra(e,t),this.getIsolationScope().setExtra(e,t)}setContext(e,t){this.getScope().setContext(e,t),this.getIsolationScope().setContext(e,t)}
709
709
  configureScope(e){const{scope:t,client:n}=this.getStackTop();n&&e(t)}run(e){const t=Gw(this);try{e(this)}finally{Gw(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return aw&&M_.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){const n=this._callExtensionMethod("startTransaction",e,t);if(aw&&!n){this.getClient()?M_.warn("Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n"):M_.warn("Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'")}return n}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop().scope,t=e.getSession();t&&mw(t),this._sendSessionUpdate(),e.setSession()}startSession(e){
@@ -755,8 +755,8 @@ case"update":case"past":this._store.receiveRealTimeUpdates({updatedAnnotations:e
755
755
  const e=new URL(t);e.searchParams.set("access_token",n),r=e.toString()}else r=t;const o=new Dk(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",{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,qb(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}Fk.$inject=["store","apiRoutes","auth","groups","session"]
756
756
  ;const Bk="hypothesis.user.tags.list",Hk="hypothesis.user.tags.map";class jk{constructor(e){H(this,"_storage",void 0),this._storage=e}filter(e,t=null){const n=this._storage.getObject(Bk)||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${hv(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject(Hk)||{};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(Hk,t);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(Bk,n)}}jk.$inject=["localStorage"];class $k{constructor(e){H(this,"_store",void 0),this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}$k.$inject=["store"];class Uk extends Jf{constructor(e,t){super(),H(this,"_store",void 0),H(this,"_window",void 0),
757
757
  H(this,"_delayedMessageQueue",void 0),this._store=e,this._window=t,this._delayedMessageQueue=[],this._window.addEventListener("focus",(()=>{this._delayedMessageQueue.forEach((({type:e,messageText:t,options:n})=>this._addMessage(e,t,n))),this._delayedMessageQueue=[]}))}dismiss(e){this._store.getToastMessage(e)&&(this._store.removeToastMessage(e),this.emit("toastMessageDismissed",e))}_addMessage(e,t,{autoDismiss:n=!0,visuallyHidden:r=!1,delayed:o=!1}={}){if(this._store.hasToastMessage(e,t))return;if(o&&!this._window.document.hasFocus()){const o={autoDismiss:n,visuallyHidden:r};return void this._delayedMessageQueue.push({type:e,messageText:t,options:o})}const i={type:e,id:rv(10),message:t,visuallyHidden:r,autoDismiss:n};this._store.addToastMessage(i),this.emit("toastMessageAdded",i)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}Uk.$inject=["store","$window"];const qk=function(e){
758
- for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),Gk=function(e){const{version:t,origin:n}=iv(e.location.href);return"1.1464.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1464.0) than the host page (${t}). It may not work.`),!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 Vk(e,t){e.setClientId(t.clientId)}function Wk(e,t,n){e.load(),t.load(),n.sync()}function Yk(e,t,n){e.init(),t.init(),n.init()}function Kk(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{
759
- autoDismiss:!1})}))}qk.sentry&&Gk&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;kk({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1464.0",beforeSend:(e,t)=>{if(Nk>=5)return dv("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Nk;try{const n=t&&t.originalException;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch(e){}return e}});try{Nw("host_config",iv(window.location.href))}catch(e){}Nw("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Db(((e,t)=>{Sk(e,t)}))}(qk.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")}))}(document.body),Vk.$inject=["api","streamer"],
758
+ for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),Gk=function(e){const{version:t,origin:n}=iv(e.location.href);return"1.1466.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1466.0) than the host page (${t}). It may not work.`),!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 Vk(e,t){e.setClientId(t.clientId)}function Wk(e,t,n){e.load(),t.load(),n.sync()}function Yk(e,t,n){e.init(),t.init(),n.init()}function Kk(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{
759
+ autoDismiss:!1})}))}qk.sentry&&Gk&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;kk({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1466.0",beforeSend:(e,t)=>{if(Nk>=5)return dv("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Nk;try{const n=t&&t.originalException;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch(e){}return e}});try{Nw("host_config",iv(window.location.href))}catch(e){}Nw("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Db(((e,t)=>{Sk(e,t)}))}(qk.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")}))}(document.body),Vk.$inject=["api","streamer"],
760
760
  Wk.$inject=["groups","session","router"],Yk.$inject=["autosaveService","persistedDefaults","serviceURL"],Kk.$inject=["frameSync","store","toastMessenger"];const Xk=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",vv)}(),async function(e,t=window){const n=function(e){const t=iv(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:av,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:lv(t.origin),ancestorLevel:sv(t.ancestorLevel)}}},o={};for(const[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i);return o}(window),r=function(e,t){const n=e.requestConfigFromFrame;if(!n)return null
761
761
  ;if("number"!=typeof n.ancestorLevel||"string"!=typeof n.origin)throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified");return{targetFrame:cv(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await ov(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(n,r);o=function(e,t){const n=e.services;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=ov(t.targetFrame,t.origin,"requestGroups",[n],0).catch((()=>{throw new Error("Unable to fetch groups")})))})),e):e}(e,r)}else o=n;const i={...e,...o};return r&&(i.rpc=r),i.apiUrl=function(e){const t=Yr(e);if(!t)return e.apiUrl;if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}(i),i}(qk).then((e=>{!function(e,t){const n=new q
762
762
  ;n.register("annotationsExporter",_b).register("annotationsService",_v).register("annotationActivity",bv).register("api",xb).register("apiRoutes",Cb).register("auth",zb).register("autosaveService",Lb).register("frameSync",Wb).register("groups",Xb).register("importAnnotationsService",Ek).register("loadAnnotationsService",Tk).register("localStorage",Mk).register("persistedDefaults",zk).register("router",Lk).register("serviceURL",Ok).register("session",Rk).register("streamer",Fk).register("streamFilter",Pk).register("tags",jk).register("threadsService",$k).register("toastMessenger",Uk).register("store",{factory:Ma}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Yk),n.run(Vk),n.run(Wk),n.run(gv),n.run(Kk),D(De(Zr.Provider,{value:n,children:De(ev,{})}),t)}(e,Xk)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),D(De(tv,{error:e}),t)}(e,Xk)));