hypothesis 1.1074.0 → 1.1075.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 +1 -1
- package/build/manifest.json +11 -11
- package/build/scripts/annotator.bundle.js +1 -1
- package/build/scripts/sidebar.bundle.js +6 -6
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/scripts/ui-playground.bundle.js +136 -134
- package/build/scripts/ui-playground.bundle.js.map +1 -1
- package/build/styles/annotator.css +23 -0
- package/build/styles/annotator.css.map +1 -1
- package/build/styles/sidebar.css +27 -0
- package/build/styles/sidebar.css.map +1 -1
- package/build/styles/ui-playground.css +28 -1
- package/build/styles/ui-playground.css.map +1 -1
- package/package.json +2 -2
package/build/boot.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(){"use strict";function t(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function e(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.every((function(e){return"function"==typeof t[e]}))}var n={es2017:function(){return!e(Object,"entries","values")},es2018:function(){return"function"!=typeof Promise||!e(Promise.prototype,"finally")}};function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function s(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var i=["es2017","es2018"];function l(t){t.setAttribute("data-hypothesis-asset","")}function c(t,e){var n=t.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,l(n),t.head.appendChild(n)}function u(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,s=void 0===r||r,o=n.forceReload,a=void 0!==o&&o,i=t.createElement("script");s&&(i.type="module"),a&&(e+="#ts=".concat(Date.now())),i.src=e,i.async=!1,l(i),t.head.appendChild(i)}function p(t,e,n,r){var s=t.createElement("link");s.rel=e,s.href=r,s.type="application/annotator+".concat(n),l(s),t.head.appendChild(s)}function d(t,e,n){var r=t.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),l(r),t.head.appendChild(r)}function f(t,e){return t.assetRoot+"build/"+t.manifest[e]}function h(t){return function(t){return t.filter((function(t){var e=n[t];if(!e)throw new Error('Unknown polyfill set "'.concat(t,'"'));return e()}))}(t).map((function(t){return"scripts/polyfills-".concat(t,".bundle.js")}))}function y(t){var e=t.match(/(https?):\/\/([^:/]+)/);return e?{protocol:e[1],hostname:e[2]}:null}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=t.currentScript;return e?y(e.src):null}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===t.indexOf("{"))return t;var n=m(e);if(!n)throw new Error("Could not process URL template because script origin is unknown");return t=(t=t.replace("{current_host}",n.hostname)).replace("{current_scheme}",n.protocol)}var v={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?
|
|
1
|
+
!function(){"use strict";function t(t,e){for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}function e(t){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];return n.every((function(e){return"function"==typeof t[e]}))}var n={es2017:function(){return!e(Object,"entries","values")},es2018:function(){return"function"!=typeof Promise||!e(Promise.prototype,"finally")}};function r(t,e){var n="undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(!n){if(Array.isArray(t)||(n=o(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,s=function(){};return{s:s,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:s}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,l=!1;return{s:function(){n=n.call(t)},n:function(){var t=n.next();return i=t.done,t},e:function(t){l=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(l)throw a}}}}function s(t){return function(t){if(Array.isArray(t))return a(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){if(t){if("string"==typeof t)return a(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?a(t,e):void 0}}function a(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}var i=["es2017","es2018"];function l(t){t.setAttribute("data-hypothesis-asset","")}function c(t,e){var n=t.createElement("link");n.rel="stylesheet",n.type="text/css",n.href=e,l(n),t.head.appendChild(n)}function u(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=n.esModule,s=void 0===r||r,o=n.forceReload,a=void 0!==o&&o,i=t.createElement("script");s&&(i.type="module"),a&&(e+="#ts=".concat(Date.now())),i.src=e,i.async=!1,l(i),t.head.appendChild(i)}function p(t,e,n,r){var s=t.createElement("link");s.rel=e,s.href=r,s.type="application/annotator+".concat(n),l(s),t.head.appendChild(s)}function d(t,e,n){var r=t.createElement("link");r.rel="preload",r.as=e,r.href=n,"fetch"===e&&(r.crossOrigin="anonymous"),l(r),t.head.appendChild(r)}function f(t,e){return t.assetRoot+"build/"+t.manifest[e]}function h(t){return function(t){return t.filter((function(t){var e=n[t];if(!e)throw new Error('Unknown polyfill set "'.concat(t,'"'));return e()}))}(t).map((function(t){return"scripts/polyfills-".concat(t,".bundle.js")}))}function y(t){var e=t.match(/(https?):\/\/([^:/]+)/);return e?{protocol:e[1],hostname:e[2]}:null}function m(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,e=t.currentScript;return e?y(e.src):null}function b(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===t.indexOf("{"))return t;var n=m(e);if(!n)throw new Error("Could not process URL template because script origin is unknown");return t=(t=t.replace("{current_host}",n.hostname)).replace("{current_scheme}",n.protocol)}var v={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?7cc17f","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?3c2067","styles/annotator.css":"styles/annotator.css?31cb1e","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?98dc9f","styles/highlights.css":"styles/highlights.css?5dd56a","styles/highlights.css.map":"styles/highlights.css.map?34b9c1","styles/katex.min.css":"styles/katex.min.css?d477ff","styles/katex.min.css.map":"styles/katex.min.css.map?010d5b","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?2eeb58","styles/sidebar.css":"styles/sidebar.css?5f8f49","styles/sidebar.css.map":"styles/sidebar.css.map?1cbfbc","styles/ui-playground.css":"styles/ui-playground.css?12e975","styles/ui-playground.css.map":"styles/ui-playground.css.map?7ae6ba","styles/annotator.css.map":"styles/annotator.css.map?dd44ab","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?93d00a","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?7d9789","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?92b2d6"};if(function(){var t=[function(){return Promise.resolve()},function(){return new Map},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 t.every((function(t){return t()}))}catch(t){return!1}}()){var g=function(e){for(var n={},r=e.querySelectorAll("script.js-hypothesis-config"),s=0;s<r.length;s++){var o=void 0;try{o=JSON.parse(r[s].textContent||"")}catch(t){console.warn("Could not parse settings from js-hypothesis-config tags",t),o={}}t(n,o)}return n}(document),j=b(g.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1075.0/");if(document.querySelector("hypothesis-app")){!function(t,e){d(t,"fetch",e.apiUrl),d(t,"fetch",e.apiUrl+"links");var n,o=h(i),a=r([].concat(s(o),["scripts/sidebar.bundle.js"]));try{for(a.s();!(n=a.n()).done;)u(t,f(e,n.value),{esModule:!0})}catch(t){a.e(t)}finally{a.f()}for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)c(t,f(e,p[l]))}(document,{assetRoot:j,manifest:v,apiUrl:g.apiUrl})}else{var w=g,A=b(w.notebookAppUrl||"https://hypothes.is/notebook"),k=b(w.sidebarAppUrl||"https://hypothes.is/app.html");!function(t,e){if(!t.querySelector('link[type="application/annotator+html"]')){p(t,"sidebar","html",e.sidebarAppUrl),p(t,"notebook","html",e.notebookAppUrl),d(t,"style",f(e,"styles/annotator.css")),p(t,"hypothesis-client","javascript",e.assetRoot+"build/boot.js");var n,o=h(i),a=r([].concat(s(o),["scripts/annotator.bundle.js"]));try{for(a.s();!(n=a.n()).done;)u(t,f(e,n.value),{esModule:!1})}catch(t){a.e(t)}finally{a.f()}var l=[];void 0!==window.PDFViewerApplication&&l.push("styles/pdfjs-overrides.css"),l.push("styles/highlights.css");for(var y=0,m=l;y<m.length;y++)c(t,f(e,m[y]))}}(document,{assetRoot:j,manifest:v,notebookAppUrl:A,sidebarAppUrl:k})}}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/.")}();
|
package/build/manifest.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?
|
|
3
|
-
"
|
|
4
|
-
"styles/annotator.css
|
|
2
|
+
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?7cc17f",
|
|
3
|
+
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?3c2067",
|
|
4
|
+
"styles/annotator.css": "styles/annotator.css?31cb1e",
|
|
5
|
+
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?98dc9f",
|
|
5
6
|
"styles/highlights.css": "styles/highlights.css?5dd56a",
|
|
6
7
|
"styles/highlights.css.map": "styles/highlights.css.map?34b9c1",
|
|
7
8
|
"styles/katex.min.css": "styles/katex.min.css?d477ff",
|
|
8
9
|
"styles/katex.min.css.map": "styles/katex.min.css.map?010d5b",
|
|
9
10
|
"styles/pdfjs-overrides.css": "styles/pdfjs-overrides.css?c95edf",
|
|
10
11
|
"styles/pdfjs-overrides.css.map": "styles/pdfjs-overrides.css.map?2eeb58",
|
|
11
|
-
"styles/sidebar.css": "styles/sidebar.css?
|
|
12
|
-
"styles/sidebar.css.map": "styles/sidebar.css.map?
|
|
13
|
-
"
|
|
14
|
-
"styles/ui-playground.css.map": "styles/ui-playground.css.map?
|
|
15
|
-
"styles/
|
|
16
|
-
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?b49bb6",
|
|
17
|
-
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?694b70",
|
|
12
|
+
"styles/sidebar.css": "styles/sidebar.css?5f8f49",
|
|
13
|
+
"styles/sidebar.css.map": "styles/sidebar.css.map?1cbfbc",
|
|
14
|
+
"styles/ui-playground.css": "styles/ui-playground.css?12e975",
|
|
15
|
+
"styles/ui-playground.css.map": "styles/ui-playground.css.map?7ae6ba",
|
|
16
|
+
"styles/annotator.css.map": "styles/annotator.css.map?dd44ab",
|
|
18
17
|
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?93d00a",
|
|
19
|
-
"scripts/sidebar.bundle.js
|
|
18
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?7d9789",
|
|
19
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?92b2d6"
|
|
20
20
|
}
|
|
@@ -105,7 +105,7 @@ async getDocumentInfo(){const[t,e]=await Promise.all([this._integration.uri(),th
|
|
|
105
105
|
this._listeners.removeAll(),this._selectionObserver.disconnect(),this._adder.destroy(),this._bucketBarClient.destroy(),function(t){Re(Array.from(t.querySelectorAll("hypothesis-highlight")))}(this.element),this._integration.destroy()}async anchor(t){const e=t=>{const e=Vo(t);if(!e)return;const n=Ae(e);n.forEach((e=>{e._annotation=t.annotation})),t.highlights=n,this._focusedAnnotations.has(t.annotation.$tag)&&Le(n,!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 o=await this._integration.anchor(this.element,e.selector),i=ye.fromRange(o);n={annotation:t,target:e,range:i}}catch(o){n={annotation:t,target:e}}return n})));if(!this._annotations.has(t.$tag))return[];for(let 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),
|
|
106
106
|
this._sidebarRPC.call("syncAnchoringStatus",t),n}detach(t,e=!0){this._annotations.delete(t);const n=[];for(let e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&Re(e.highlights);this._updateAnchors(n,e)}_updateAnchors(t,e){this.anchors=t,e&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:t=!1}={}){const e=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(e.map((t=>this._integration.describe(o,t))))).map((t=>({source:n.uri,selector:t}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:t,$tag:"a:"+Mt(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Fo(),r}_focusAnnotations(t){this._focusedAnnotations.clear(),t.forEach((t=>this._focusedAnnotations.add(t)));for(let e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);Le(e.highlights,n)}this._sidebarRPC.call("focusAnnotations",t)}_scrollToClosestOffScreenAnchor(t,e){const n=function(t,e){let n=null,o=0
|
|
107
107
|
;for(let r of t){var i;if(null===(i=r.highlights)||void 0===i||!i.length)continue;const t=Pe(r.highlights).top;"up"===e&&t>=137||"down"===e&&t<=window.innerHeight-22||(!n||"up"===e&&t>o||"down"===e&&t<o)&&(n=r,o=t)}return n}(this.anchors.filter((({annotation:e})=>t.includes(e.$tag))),e);n&&this._integration.scrollToAnchor(n)}_onSelection(t){if(!this._integration.canAnnotate(t))return void this._onClearSelection();const e=document.getSelection(),n=Ce(e),o=Ee(e);o?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=Do(),this._isAdderVisible=!0,this._adder.show(o,n)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}selectAnnotations(t,e=!1){e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t),this._sidebarRPC.call("openSidebar")}
|
|
108
|
-
setHighlightsVisible(t){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}function qo(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function Uo(t,e){var n;const o={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(o[t]=n);o.origin=new URL(t).origin,o.version="1.
|
|
108
|
+
setHighlightsVisible(t){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get focusedAnnotationTags(){return this._focusedAnnotations}}function qo(t,e){const n=new URL(t),o=new URLSearchParams;return o.append("config",JSON.stringify(e)),n.hash=o.toString(),n.toString()}function Uo(t,e){var n;const o={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(o[t]=n);o.origin=new URL(t).origin,o.version="1.1075.0";const i=new URL(window.location.href);if(i.hash="",o.hostURL=i.toString(),Array.isArray(o.services)&&(null===(n=o.services)||void 0===n?void 0:n.length)>0){const t=o.services[0];t.onLoginRequest&&(t.onLoginRequestProvided=!0),t.onLogoutRequest&&(t.onLogoutRequestProvided=!0),t.onSignupRequest&&(t.onSignupRequestProvided=!0),t.onProfileRequest&&(t.onProfileRequestProvided=!0),
|
|
109
109
|
t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return o}function Wo({config:t,groupId:e}){return vt("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allowFullScreen:!0,src:qo(t.notebookAppUrl,{...Uo(t.notebookAppUrl,t),group:e})})}function zo({eventBus:t,config:e}){const[n,o]=at(0),[i,r]=at(!0),[s,a]=at(null),c=ht(""),l=ht(null);ct((()=>(c.current=document.body.style.overflow,()=>{document.body.style.overflow=c.current})),[]),ct((()=>{document.body.style.overflow=i?c.current:"hidden"}),[i]),ct((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),o((t=>t+1)),a(t)})),l.current=e,()=>{e.destroy()}}),[t]);return null===s?null:vt("div",{className:K("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:i}),"data-testid":"notebook-outer",children:vt("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[vt("div",{className:"absolute right-0 text-xl m-3",children:vt(St,{icon:"cancel",title:"Close the Notebook",
|
|
110
110
|
onClick:()=>{var t;r(!0),null===(t=l.current)||void 0===t||t.publish("closeNotebook")},variant:"dark"})}),vt(Wo,{config:e,groupId:s},n)]})})}class $o{constructor(t,e,n){this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this.shadowRoot=de(this._outerContainer),M(vt(zo,{eventBus:e,config:n}),this.shadowRoot)}destroy(){M(null,this.shadowRoot),this._outerContainer.remove()}}var jo={exports:{}};!function(t){!function(e,n,o,i){var r,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),c=Math.round,l=Math.abs,h=Date.now;function u(t,e,n){return setTimeout(v(t,n),e)}function d(t,e,n){return!!Array.isArray(t)&&(f(t,n[e],n),!0)}function f(t,e,n){var o;if(t)if(t.forEach)t.forEach(e,n);else if(t.length!==i)for(o=0;o<t.length;)e.call(n,t[o],o,t),o++;else for(o in t)t.hasOwnProperty(o)&&e.call(n,t[o],o,t)}function p(t,n,o){var i="DEPRECATED METHOD: "+n+"\n"+o+" AT \n";return function(){
|
|
111
111
|
var n=new Error("get-stack-trace"),o=n&&n.stack?n.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",r=e.console&&(e.console.warn||e.console.log);return r&&r.call(e.console,i,o),t.apply(this,arguments)}}r="function"!=typeof Object.assign?function(t){if(t===i||null===t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),n=1;n<arguments.length;n++){var o=arguments[n];if(o!==i&&null!==o)for(var r in o)o.hasOwnProperty(r)&&(e[r]=o[r])}return e}:Object.assign;var g=p((function(t,e,n){for(var o=Object.keys(e),r=0;r<o.length;)(!n||n&&t[o[r]]===i)&&(t[o[r]]=e[o[r]]),r++;return t}),"extend","Use `assign`."),m=p((function(t,e){return g(t,e,!0)}),"merge","Use `assign`.");function _(t,e,n){var o,i=e.prototype;(o=t.prototype=Object.create(i)).constructor=t,o._super=i,n&&r(o,n)}function v(t,e){return function(){return t.apply(e,arguments)}}function y(t,e){
|
|
@@ -92,9 +92,9 @@ uo("checkbox",' <svg\n width="32"\n height="32"\n viewBox="-4 -4 39 39
|
|
|
92
92
|
columnNumber:5})}function yo({children:e,direction:t="row",classes:n,containerRef:r,elementRef:o,...i}){return so("div",{className:Ir(`Hyp-Actions--${t}`,n),...i,ref:null!=o?o:r,children:e},void 0,!1,{fileName:vo,lineNumber:89,columnNumber:5})}var wo='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8l3.536-3.536L8 8 4.464 4.464 8 8zm0 0l-3.536 3.536L8 8l3.536 3.536L8 8z"></path></g></svg>\n',xo="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";const ko=uo("cancel",wo);let So=0;function Co(e){const[t]=Vr((()=>(++So,`${e}-${So}`)));return t}
|
|
93
93
|
function Eo({buttons:e,cancelLabel:t="Cancel",children:n,contentClass:r,icon:o,initialFocus:i,onCancel:a,role:s="dialog",title:l,withCancelButton:c=!0,withCloseButton:u=!0}){const h=Co("dialog-description"),d=Co("dialog-title"),p=Xr();Wr((()=>{if(null!==i){const e=null==i?void 0:i.current;e&&!e.disabled?e.focus():p.current.focus()}}),[]),Kr((()=>{const e=p.current.querySelector("p");e&&(e.id=h,p.current.setAttribute("aria-describedby",h))}),[h]);const m=a&&c,f=e||m;return so("div",{"aria-labelledby":d,className:Ir("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[so("header",{className:"Hyp-Dialog__header",children:[o&&so("div",{className:"Hyp-Dialog__header-icon",children:so(co,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:xo,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:xo,lineNumber:138,columnNumber:11}),so("h2",{className:"Hyp-Dialog__title",id:d,children:l},void 0,!1,{fileName:xo,lineNumber:142,columnNumber:9}),a&&u&&so("div",{
|
|
94
94
|
className:"Hyp-Dialog__close",children:so(mo,{"data-testid":"close-button",icon:ko,title:"Close",onClick:a},void 0,!1,{fileName:xo,lineNumber:147,columnNumber:13})},void 0,!1,{fileName:xo,lineNumber:146,columnNumber:11})]},void 0,!0,{fileName:xo,lineNumber:136,columnNumber:7}),n,f&&so("div",{className:"Hyp-Dialog__actions",children:[m&&so(fo,{"data-testid":"cancel-button",onClick:a,children:t},void 0,!1,{fileName:xo,lineNumber:160,columnNumber:13}),e]},void 0,!0,{fileName:xo,lineNumber:158,columnNumber:9})]},void 0,!0,{fileName:xo,lineNumber:125,columnNumber:5})}function Ao({name:e,classes:t="",containerClasses:n="",title:r=""}){const o=lo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=Xr();Kr((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",Ir("Hyp-Icon",t))}),[t,o]);const a={};return r&&(a.title=r),so("span",{className:n,dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{
|
|
95
|
-
fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:60,columnNumber:5})}function To({children:e,classes:t="",linkRef:n,...r}){return so("a",{className:Ir("Hyp-Link",t),ref:n,rel:"noopener noreferrer",...r,children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}function No(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function Mo(e,t,n){Wr((()=>{if(!t)return()=>{};const r=No(document.body,["keydown"],(e=>{"Escape"===
|
|
96
|
-
|
|
97
|
-
|
|
95
|
+
fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:60,columnNumber:5})}function To({children:e,classes:t="",linkRef:n,...r}){return so("a",{className:Ir("Hyp-Link",t),ref:n,rel:"noopener noreferrer",...r,children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}function No(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function Mo(e,t,n){Wr((()=>{if(!t)return()=>{};const r=No(document.body,["keydown"],(e=>{"Escape"===e.key&&n()})),o=No(document.body,["focus"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0}),i=No(document.body,["mousedown","click"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0});return()=>{r(),i(),o()}}),[e,t,n])}var Lo="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function zo({children:e,onCancel:t,...n}){const r=Xr()
|
|
96
|
+
;return Mo(r,!0,(()=>{t&&t()})),so(m,{children:[so("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:Lo,lineNumber:39,columnNumber:7}),so("div",{className:"Hyp-Modal",ref:r,children:so(Eo,{onCancel:t,...n,children:e},void 0,!1,{fileName:Lo,lineNumber:41,columnNumber:9})},void 0,!1,{fileName:Lo,lineNumber:40,columnNumber:7})]},void 0,!0)}function Oo({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return so(zo,{onCancel:r,buttons:[so(fo,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:Lo,lineNumber:76,columnNumber:9})],...o,children:so("p",{children:e},void 0,!1,{fileName:Lo,lineNumber:87,columnNumber:7})},void 0,!1,{fileName:Lo,lineNumber:73,columnNumber:5})}var Ro="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";const Do=uo("cancel",wo);function Io({children:e,icon:t,onClose:n,title:r}){const o=!!n;return so("div",{className:Ir("Hyp-Panel",{"Hyp-Panel--closeable":o}),children:[so("header",{className:"Hyp-Panel__header",
|
|
97
|
+
children:[t&&so("div",{className:"Hyp-Panel__header-icon",children:so(co,{name:t,title:r},void 0,!1,{fileName:Ro,lineNumber:37,columnNumber:13})},void 0,!1,{fileName:Ro,lineNumber:36,columnNumber:11}),so("h2",{className:"Hyp-Panel__title",children:r},void 0,!1,{fileName:Ro,lineNumber:40,columnNumber:9}),o&&so("div",{className:"Hyp-Panel__close",children:so(mo,{icon:Do,title:"Close",onClick:n},void 0,!1,{fileName:Ro,lineNumber:43,columnNumber:13})},void 0,!1,{fileName:Ro,lineNumber:42,columnNumber:11})]},void 0,!0,{fileName:Ro,lineNumber:34,columnNumber:7}),so("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:Ro,lineNumber:47,columnNumber:7})]},void 0,!0,{fileName:Ro,lineNumber:29,columnNumber:5})}
|
|
98
98
|
const Po=uo("spinner",'<svg viewBox="0 0 64 64">\n <g stroke-width="6" stroke="currentColor" stroke-linecap="round">\n <line y1="16" y2="28" transform="translate(32,32) rotate(180)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(225)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".15;0;1;.8;.65;.45;.3;.15" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(270)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".3;.15;0;1;.8;.65;.45;.3" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(315)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".45;.3;.15;0;1;.85;.65;.45" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(0)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".65;.45;.3;.15;0;1;.8;.65;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(45)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".8;.65;.45;.3;.15;0;1;.8" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(90)">\n <animate attributeName="stroke-opacity" dur="750ms" values="1;.85;.6;.45;.3;.15;0;1;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(135)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n </g>\n</svg>')
|
|
99
99
|
;function Bo({classes:e="",size:t="medium"}){return so(Ao,{name:Po,containerClasses:Ir(`Hyp-Spinner--${t}`,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:32,columnNumber:5})}var Fo="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js";function jo({classes:e="",inputRef:t,hasError:n=!1,type:r="text",...o}){return so("input",{className:Ir("Hyp-TextInput",{"has-error":n},e),...o,ref:t,type:r},void 0,!1,{fileName:Fo,lineNumber:39,columnNumber:5})}function Uo({children:e,classes:t=""}){return so("div",{className:Ir("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:Fo,lineNumber:67,columnNumber:5})}
|
|
100
100
|
var Ho='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 4l4 4-4 4"></path></g></svg>',qo='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="24px" height="28px" viewBox="0 0 24 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <rect fill="#ffffff" stroke="none" width="17.14407" height="16.046612" x="3.8855932" y="3.9449153" />\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M0,2.00494659 C0,0.897645164 0.897026226,0 2.00494659,0 L21.9950534,0 C23.1023548,0 24,0.897026226 24,2.00494659 L24,21.9950534 C24,23.1023548 23.1029738,24 21.9950534,24 L2.00494659,24 C0.897645164,24 0,23.1029738 0,21.9950534 L0,2.00494659 Z M9,24 L12,28 L15,24 L9,24 Z M7.00811294,4 L4,4 L4,20 L7.00811294,20 L7.00811294,15.0028975 C7.00811294,12.004636 8.16824717,12.0097227 9,12 C10,12.0072451 11.0189302,12.0606714 11.0189302,14.003477 L11.0189302,20 L14.0270431,20 L14.0270431,13.1087862 C14.0270433,10 12,9.00309038 10,9.00309064 C8.01081726,9.00309091 8,9.00309086 7.00811294,11.0019317 L7.00811294,4 Z M19,19.9869002 C20.1045695,19.9869002 21,19.0944022 21,17.9934501 C21,16.892498 20.1045695,16 19,16 C17.8954305,16 17,16.892498 17,17.9934501 C17,19.0944022 17.8954305,19.9869002 19,19.9869002 Z" fill="currentColor"></path>\n </g>\n</svg>\n'
|
|
@@ -583,7 +583,7 @@ maxSynchronousAlignments:h,end:u,scrollAncestor:r},"cancellable"in n&&!n.cancell
|
|
|
583
583
|
function Qf({children:e,count:t,isWaitingToAnchor:n,isSelected:r,label:o,onSelect:i}){const a=()=>{r||i()},s=t>0?`${o} (${t} available)`:o;return so(go,{classes:Ir("inline bg-transparent min-w-[5.25rem] text-color-text hover:!no-underline",{"font-bold":r}),onClick:a,onMouseDown:a,pressed:!!r,role:"tab",tabIndex:0,title:s,children:so(m,{children:[e,t>0&&!n&&so("span",{className:"relative bottom-[3px] left-[2px] text-tiny",children:t})]})})}var eg=Jo((function({annotationsService:e,isLoading:t,settings:n}){const r=ys(),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 so("div",{className:Ir("space-y-3 pb-[9px]"),children:[so("div",{className:"flex gap-x-6 theme-clean:ml-[15px]",role:"tablist",children:[so(Qf,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),so(Qf,{count:i,
|
|
584
584
|
isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),children:"Page Notes"}),s>0&&so(Qf,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&so("div",{className:"flex justify-end",children:so(fo,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:Xo(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&so(_o,{classes:"text-center",children:so("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&so(_o,{classes:"text-center",children:so("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",so("br",{}),"Create one by selecting some text and clicking the"," ",so(Ao,{classes:"inline m-0.5 -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"])
|
|
585
585
|
;var tg=Jo((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){const i=Ks(),a=ys(),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?js(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,_=!(c||!h)&&!d,b=a.directLinkedGroupFetchFailed(),y=_||b,w=!y,x=!y&&!l,k=h&&!u&&!_&&!c,S=Xr(s);Wr((()=>{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]),Wr((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return Wr((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),so("div",{children:[so("h2",{className:"sr-only",children:"Annotations"}),w&&so(Hf,{}),so(Jf,{onLogin:t,onSignUp:n
|
|
586
|
-
}),_&&so(Ff,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),b&&so(Ff,{errorType:"group",onLoginRequest:t}),x&&so(eg,{isLoading:c}),so(Bf,{threads:i.children}),k&&so(qf,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var ng=Jo((function({api:e,toastMessenger:t}){const n=ys(),r=n.routeParams().q,o=Jr((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...Os(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return Wr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),so(Bf,{threads:Ks().children})}),["api","toastMessenger"]);class rg{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.
|
|
586
|
+
}),_&&so(Ff,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),b&&so(Ff,{errorType:"group",onLoginRequest:t}),x&&so(eg,{isLoading:c}),so(Bf,{threads:i.children}),k&&so(qf,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var ng=Jo((function({api:e,toastMessenger:t}){const n=ys(),r=n.routeParams().q,o=Jr((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...Os(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return Wr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),so(Bf,{threads:Ks().children})}),["api","toastMessenger"]);class rg{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.1075.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
|
|
587
587
|
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 og(e){const t=I(e);return!(null==t||!t.authority)&&t.authority!==e.authDomain}function ig({commandName:e,iconName:t}){return so("span",{className:"whitespace-nowrap",children:[so(Ao,{name:t,classes:Ir("mx-1 -mt-1","text-color-text-light inline")}),so("em",{children:e})]})}var ag=Jo((function({settings:e}){const t=!og(e);return so("ol",{className:"list-decimal pl-10 space-y-2",children:[so("li",{children:["To create an annotation, select text and then select the"," ",so(ig,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),so("li",{
|
|
588
588
|
children:["To create a highlight (",so(To,{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"," ",so(ig,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&so("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"," ",so(To,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),so("li",{children:["To reply to an annotation, select the"," ",so(ig,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);function sg({label:e,children:t,classes:n}){return so(m,{children:[so("dt",{className:"col-span-1 sm:text-right font-medium",children:e}),so("dd",{className:Ir("col-span-1 sm:col-span-3 text-color-text-light break-words",n),children:t})]})}
|
|
589
589
|
var lg=Jo((function({toastMessenger:e,versionData:t}){return so("div",{className:"space-y-4",children:[so("dl",{className:"grid grid-cols-1 sm:grid-cols-4 sm:gap-x-2",children:[so(sg,{label:"Version",children:t.version}),so(sg,{label:"User Agent",children:t.userAgent}),so(sg,{classes:Ir("break-all"),label:"URL",children:t.urls}),so(sg,{label:"Fingerprint",children:t.fingerprint}),so(sg,{label:"Account",children:t.account}),so(sg,{label:"Date",children:t.timestamp})]}),so("div",{className:"flex items-center justify-center",children:so(fo,{onClick:()=>{try{wl(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 cg({children:e,onClick:t}){return so(go,{classes:"leading-none text-brand",onClick:t,children:[e,so(Ao,{classes:"ml-1",name:"arrow-right"})]})}function ug({linkText:e,url:t}){return so("div",{className:"flex-1 border-r last-of-type:border-r-0",
|
|
@@ -612,7 +612,7 @@ displayName:n,userid:e.userid,username:t.username}}return{status:"logged-out"}}(
|
|
|
612
612
|
const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?gl(e.user):vl(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;if(!i)throw new Error("Cannot create annotation when logged out");const a=o.user_info,s="s:"+U(8),l=Object.assign({created:t.toISOString(),group:r,permissions:_l(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return Bi(l)&&(l.permissions=gl(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Bi(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!Ri(n)}),ji(n)?this._store.selectTab("note"):Ui(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}
|
|
613
613
|
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._activity.reportActivity("delete",e),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._activity.reportActivity("flag",e),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:Ri(e)?vl(t,e.group):gl(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e){let t,n;const r=this._applyDraftChanges(e);let o;zi(e)?(t=this._api.annotation.update({id:e.id},r),n="update"):(t=this._api.annotation.create({},r),n="create"),this._store.annotationSaveStarted(e);try{o=await t,this._activity.reportActivity(n,o)}finally{this._store.annotationSaveFinished(e)}for(let[t,n]of Object.entries(e))if(t.startsWith("$")){o[t]=n}
|
|
614
614
|
return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}Ug.$inject=["annotationActivity","api","store"];class Hg{constructor(e){this._rpc=e.rpc,this._reportConfig=e.reportActivity}reportActivity(e,t){if(!this._rpc||!this._reportConfig)return;let n;switch(e){case"create":n=new Date(t.created).toISOString();break;case"update":n=new Date(t.updated).toISOString();break;default:n=(new Date).toISOString()}const r={date:n,annotation:{id:t.id,isShared:bl(t.permissions)}};this._reportConfig.events.includes(e)&&function(e,t,n,r=[]){const o={jsonrpc:"2.0",method:n,params:r};e.postMessage(o,t)}(this._rpc.targetFrame,this._rpc.origin,this._reportConfig.method,[e,r])}}Hg.$inject=["settings"];class qg 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 $g(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new qg(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){
|
|
615
|
-
throw new qg(e,n,"Failed to parse response")}var o;if(!n.ok)throw new qg(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Gg(e){const t={};for(let[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}function Vg(e){return"url"in e}function Yg(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(let[e,t]of r.entries()){const o=n[t];if(!o||Vg(o)){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.
|
|
615
|
+
throw new qg(e,n,"Failed to parse response")}var o;if(!n.ok)throw new qg(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Gg(e){const t={};for(let[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}function Vg(e){return"url"in e}function Yg(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(let[e,t]of r.entries()){const o=n[t];if(!o||Vg(o)){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1075.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Va(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 $g(m.toString(),{body:s?JSON.stringify(Gg(s)):null,headers:u,
|
|
616
616
|
method:c.method})}finally{i()}}}class Wg{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>Yg(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={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}}Wg.$inject=["apiRoutes","auth","store"];var Kg={exports:{}},Xg={};function Zg(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,
|
|
617
617
|
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 Jg=Zg;Zg.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Zg.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Zg.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++,
|
|
618
618
|
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},Zg.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)},Zg.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Zg.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Zg.prototype.start=Zg.prototype.try,Zg.prototype.errors=function(){return this._errors},Zg.prototype.attempts=function(){return this._attempts},Zg.prototype.mainError=function(){if(0===this._errors.length)return null
|
|
@@ -646,7 +646,7 @@ this._sendClientConfig(o)})),o.on("disconnect",(()=>{if(++this._reconnectionAtte
|
|
|
646
646
|
if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${W(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);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)}}Nv.$inject=["localStorage"];class Mv{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}Mv.$inject=["store"];class Lv{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))}
|
|
647
647
|
_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r="",visuallyHidden:o=!1}={}){if(this._store.hasToastMessage(e,t))return;const i=U(10),a={type:e,id:i,message:t,moreInfoURL:r,visuallyHidden:o};this._store.addToastMessage({isDismissed:!1,...a}),n&&setTimeout((()=>{this.dismiss(i)}),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)}}Lv.$inject=["store"];class zv{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){
|
|
648
648
|
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)}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 Ov=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),Rv=function(e){const{version:t,origin:n}=D(e.location.href)
|
|
649
|
-
;return"1.
|
|
649
|
+
;return"1.1075.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1075.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 Dv(e,t){e.setClientId(t.clientId)}function Iv(e,t,n){e.load(),t.load(),n.sync()}function Pv(e,t,n){e.init(),t.init(),n.init()}function Bv(e,t){"sidebar"===t.route()&&e.connect()}Ov.sentry&&Rv&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;dr({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1075.0",beforeSend:(e,t)=>{if(vr>=5)return G("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++vr;try{const n=t&&t.originalException
|
|
650
650
|
;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{Yt("host_config",D(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>"))),gr(((e,t)=>{Vt(e,{tags:{context:t}})}))}(Ov.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=>{if("string"==typeof e.type){const t=e.props;"dir"in t&&"auto"===t.dir&&(t.dir="")}t&&t(e)}}}(),Dv.$inject=["api","streamer"],Iv.$inject=["groups","session","router"],Pv.$inject=["autosaveService","persistedDefaults","serviceURL"],Bv.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&lo.clear();for(let[t,n]of Object.entries(e))lo.set(t,n)}($o)
|
|
651
651
|
;const Fv=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",J)}(),async function(e,t=window){const n=function(e){const t=D(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:P,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:F(t.origin),ancestorLevel:B(t.ancestorLevel)}}},o={};for(let[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;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:q(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){
|
|
652
652
|
const e=await async function(e,t){return{...await H(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=H(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=I(e);if(t){if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(i),i}(Ov).then((e=>{!function(e,t){const n=new zv
|