hypothesis 1.1248.0 → 1.1250.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?e270dd","styles/annotator.css":"styles/annotator.css?13d96a","styles/annotator.css.map":"styles/annotator.css.map?420356","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?e9b69c","styles/katex.min.css.map":"styles/katex.min.css.map?42d80c","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?a9757b","styles/sidebar.css.map":"styles/sidebar.css.map?310106","styles/ui-playground.css":"styles/ui-playground.css?2817da","styles/ui-playground.css.map":"styles/ui-playground.css.map?a4aa2e","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?249f4f","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?5464ef","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?30df62","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?aec820","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?95d578"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=e,t(r),s.head.appendChild(r)}function r(s,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.esModule,o=void 0===n||n,a=r.forceReload,i=void 0!==a&&a,l=s.createElement("script");o&&(l.type="module"),i&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,t(l),s.head.appendChild(l)}function n(s,e,r,n){var o=s.createElement("link");o.rel=e,o.href=n,o.type="application/annotator+".concat(r),t(o),s.head.appendChild(o)}function o(s,e,r){var n=s.createElement("link");n.rel="preload",n.as=e,n.href=r,"fetch"===e&&(n.crossOrigin="anonymous"),t(n),s.head.appendChild(n)}function a(s,t){return s.assetRoot+"build/"+s.manifest[t]}function i(s){var t=s.match(/(https?):\/\/([^:/]+)/);return t?{protocol:t[1],hostname:t[2]}:null}function l(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=s.currentScript;return t?i(t.src):null}function p(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=l(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 c=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<e.length;r++){var n=void 0;try{n=JSON.parse(e[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),n={}}Object.assign(t,n)}return t}(document),u=p(c.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1248.0/");if(document.querySelector("hypothesis-app")){!function(s,t){o(s,"fetch",t.apiUrl),o(s,"fetch",t.apiUrl+"links");for(var n=0,i=["scripts/sidebar.bundle.js"];n<i.length;n++)r(s,a(t,i[n]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)e(s,a(t,p[l]))}(document,{assetRoot:u,manifest:s,apiUrl:c.apiUrl})}else{var d=c,h=p(d.notebookAppUrl||"https://hypothes.is/notebook"),y=p(d.profileAppUrl||"https://hypothes.is/user-profile"),f=p(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",t.sidebarAppUrl),n(s,"notebook","html",t.notebookAppUrl),n(s,"profile","html",t.profileAppUrl),o(s,"style",a(t,"styles/annotator.css")),n(s,"hypothesis-client","javascript",t.assetRoot+"build/boot.js");for(var i=0,l=["scripts/annotator.bundle.js"];i<l.length;i++)r(s,a(t,l[i]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,u=p;c<u.length;c++)e(s,a(t,u[c]))}}(document,{assetRoot:u,manifest:s,notebookAppUrl:h,profileAppUrl:y,sidebarAppUrl:f})}}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?35e942","styles/annotator.css":"styles/annotator.css?ce2a96","styles/annotator.css.map":"styles/annotator.css.map?db785c","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?e9b69c","styles/katex.min.css.map":"styles/katex.min.css.map?42d80c","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?a06c2b","styles/sidebar.css.map":"styles/sidebar.css.map?e814a9","styles/ui-playground.css":"styles/ui-playground.css?536cd0","styles/ui-playground.css.map":"styles/ui-playground.css.map?1b4f14","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?6cc925","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?5464ef","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?30df62","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?a27c18","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?173823"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var r=s.createElement("link");r.rel="stylesheet",r.type="text/css",r.href=e,t(r),s.head.appendChild(r)}function r(s,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=r.esModule,o=void 0===n||n,a=r.forceReload,i=void 0!==a&&a,l=s.createElement("script");o&&(l.type="module"),i&&(e+="#ts=".concat(Date.now())),l.src=e,l.async=!1,t(l),s.head.appendChild(l)}function n(s,e,r,n){var o=s.createElement("link");o.rel=e,o.href=n,o.type="application/annotator+".concat(r),t(o),s.head.appendChild(o)}function o(s,e,r){var n=s.createElement("link");n.rel="preload",n.as=e,n.href=r,"fetch"===e&&(n.crossOrigin="anonymous"),t(n),s.head.appendChild(n)}function a(s,t){return s.assetRoot+"build/"+s.manifest[t]}function i(s){var t=s.match(/(https?):\/\/([^:/]+)/);return t?{protocol:t[1],hostname:t[2]}:null}function l(){var s=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document,t=s.currentScript;return t?i(t.src):null}function p(s){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:document;if(-1===s.indexOf("{"))return s;var e=l(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 c=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),r=0;r<e.length;r++){var n=void 0;try{n=JSON.parse(e[r].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),n={}}Object.assign(t,n)}return t}(document),u=p(c.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1250.0/");if(document.querySelector("hypothesis-app")){!function(s,t){o(s,"fetch",t.apiUrl),o(s,"fetch",t.apiUrl+"links");for(var n=0,i=["scripts/sidebar.bundle.js"];n<i.length;n++)r(s,a(t,i[n]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)e(s,a(t,p[l]))}(document,{assetRoot:u,manifest:s,apiUrl:c.apiUrl})}else{var d=c,h=p(d.notebookAppUrl||"https://hypothes.is/notebook"),y=p(d.profileAppUrl||"https://hypothes.is/user-profile"),f=p(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){n(s,"sidebar","html",t.sidebarAppUrl),n(s,"notebook","html",t.notebookAppUrl),n(s,"profile","html",t.profileAppUrl),o(s,"style",a(t,"styles/annotator.css")),n(s,"hypothesis-client","javascript",t.assetRoot+"build/boot.js");for(var i=0,l=["scripts/annotator.bundle.js"];i<l.length;i++)r(s,a(t,l[i]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,u=p;c<u.length;c++)e(s,a(t,u[c]))}}(document,{assetRoot:u,manifest:s,notebookAppUrl:h,profileAppUrl:y,sidebarAppUrl:f})}}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,20 +1,20 @@
1
1
  {
2
- "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?e270dd",
3
- "styles/annotator.css": "styles/annotator.css?13d96a",
4
- "styles/annotator.css.map": "styles/annotator.css.map?420356",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?35e942",
3
+ "styles/annotator.css": "styles/annotator.css?ce2a96",
4
+ "styles/annotator.css.map": "styles/annotator.css.map?db785c",
5
5
  "styles/highlights.css": "styles/highlights.css?6b4ebd",
6
6
  "styles/highlights.css.map": "styles/highlights.css.map?241350",
7
7
  "styles/katex.min.css": "styles/katex.min.css?e9b69c",
8
8
  "styles/katex.min.css.map": "styles/katex.min.css.map?42d80c",
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?a9757b",
12
- "styles/sidebar.css.map": "styles/sidebar.css.map?310106",
13
- "styles/ui-playground.css": "styles/ui-playground.css?2817da",
14
- "styles/ui-playground.css.map": "styles/ui-playground.css.map?a4aa2e",
15
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?249f4f",
11
+ "styles/sidebar.css": "styles/sidebar.css?a06c2b",
12
+ "styles/sidebar.css.map": "styles/sidebar.css.map?e814a9",
13
+ "styles/ui-playground.css": "styles/ui-playground.css?536cd0",
14
+ "styles/ui-playground.css.map": "styles/ui-playground.css.map?1b4f14",
15
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?6cc925",
16
16
  "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?5464ef",
17
17
  "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?30df62",
18
- "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?aec820",
19
- "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?95d578"
18
+ "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?a27c18",
19
+ "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?173823"
20
20
  }
@@ -9,9 +9,9 @@ const t="Handling port request",e=new Set,n=n=>{e.has(n)||(e.add(n),p(new Error(
9
9
  "sidebar"===a?this._sidebarHostChannel.port2.postMessage(d,[u.port2]):"host"===a&&this._emitter.emit("frameConnected",s,u.port2)},o=t,(...t)=>{try{return i(...t)}catch(t){throw p(t,o),t}}))}_messageMatches({allowedMessage:t,allowedOrigin:e,data:n,origin:i}){return("*"===e||i===e)&&s(n,t)}on(t,e){this._emitter.on(t,e)}destroy(){this._listeners.removeAll()}}const _="1.0.0",v="frame-rpc";function b(t,e,n=[],i=-1){t.postMessage({protocol:v,version:_,arguments:n,method:e,sequence:i})}function y(t){const e=t.match(/\bAppleWebKit\/([0-9]+)\b/);if(!e)return!1;return!(parseInt(e[1])<=537)}class w{constructor({userAgent:t=navigator.userAgent,currentWindow:e=window}={}){this._port=null,this._methods=new Map,this._sequence=1,this._callbacks=new Map,this._listeners=new n,this._listeners.add(e,"unload",(()=>{this._port&&(b(this._port,"close"),e!==e.parent&&y(t)&&e.parent.postMessage({type:"hypothesisPortClosed"},"*",[this._port]))})),this._pendingCalls=[],this._receivedCloseEvent=!1}on(t,e){
10
10
  if(this._port)throw new Error("Cannot add a method handler after a port is connected");this._methods.set(t,e)}connect(t){this._port=t,this._listeners.add(t,"message",(t=>this._handle(t))),t.start(),b(t,"connect");for(let[t,e]of this._pendingCalls)this.call(t,...e);this._pendingCalls=[]}destroy(){this._port&&(b(this._port,"close"),this._port.close()),this._destroyed=!0,this._listeners.removeAll()}call(t,...e){if(this._port||this._pendingCalls.push([t,e]),!this._port||this._destroyed)return;const n=this._sequence++,i=e[e.length-1];"function"==typeof i&&(this._callbacks.set(n,i),e=e.slice(0,-1)),b(this._port,t,e,n)}_parseMessage({data:t}){return t&&"object"==typeof t?t.protocol!==v||t.version!==_?null:Array.isArray(t.arguments)?t:null:null}_handle(t){const e=this._parseMessage(t),n=this._port;if(e&&n)if("method"in e){if("close"===e.method){if(this._receivedCloseEvent)return;this._receivedCloseEvent=!0}const t=this._methods.get(e.method);if(!t)return;const i=(...t)=>{const i={arguments:t,protocol:v,
11
11
  response:e.sequence,version:_};n.postMessage(i)};t(...e.arguments,i)}else if("response"in e){const t=this._callbacks.get(e.response);this._callbacks.delete(e.response),t&&t(...e.arguments)}}}function x(t){if("string"==typeof t&&"false"===t.trim().toLocaleLowerCase())return!1;const e=Number(t);return isNaN(e)?"string"==typeof t:Boolean(e)}function C(t){for(var e={},n=t.querySelectorAll("script.js-hypothesis-config"),i=0;i<n.length;i++){var o=void 0;try{o=JSON.parse(n[i].textContent||"")}catch(t){console.warn("Could not parse settings from js-hypothesis-config tags",t),o={}}Object.assign(e,o)}return e}function S(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function E(t,e,n){const i=t.document.querySelector(`link[type="application/annotator+${n}"][rel="${e}"]`);if(!i)throw new Error(`No application/annotator+${n} (rel="${e}") link in the document`);if(!i.href)throw new Error(`application/annotator+${n} (rel="${e}") link has no href`);return i.href}function N(t){return"string"==typeof t?t:null}
12
- function A(t){const e=function(t){if(!S(t,"hypothesisConfig"))return{};if("function"!=typeof t.hypothesisConfig){const t="https://h.readthedocs.io/projects/client/en/latest/publishers/config/#window.hypothesisConfig";return console.warn("hypothesisConfig must be a function, see: "+t),{}}return t.hypothesisConfig()}(t);let n;function i(t){return S(e,t)?e[t]:S(n,t)?n[t]:void 0}return n=x(e.ignoreOtherConfiguration)?{}:C(t.document),{get annotations(){return N(n.annotations)||function(){const e=t.location.href.match(/#annotations:([A-Za-z0-9_-]+)$/);return e?e[1]:null}()},get clientUrl(){return E(t,"hypothesis-client","javascript")},get group(){return N(n.group)||function(){const e=t.location.href.match(/#annotations:group:([A-Za-z0-9_-]+)$/);return e?e[1]:null}()},get notebookAppUrl(){return E(t,"notebook","html")},get profileAppUrl(){return E(t,"profile","html")},get showHighlights(){return function(){const t=i("showHighlights");switch(t){case"always":case"never":case"whenSidebarOpen":return t;case!0:
13
- return"always";case!1:return"never";default:return"always"}}()},get sidebarAppUrl(){return E(t,"sidebar","html")},get query(){return N(n.query)||function(){const e=t.location.href.match(/#annotations:(query|q):(.+)$/i);if(e)try{return decodeURIComponent(e[2])}catch(t){}return null}()},hostPageSetting:i}}function R(t,e){return t.hostPageSetting(e)}const k={annotations:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.annotations},appType:{allowInBrowserExt:!0,defaultValue:null,getValue:R},branding:{defaultValue:null,allowInBrowserExt:!1,getValue:R},clientUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.clientUrl},contentInfoBanner:{allowInBrowserExt:!1,defaultValue:null,getValue:R},enableExperimentalNewNoteButton:{allowInBrowserExt:!1,defaultValue:null,getValue:R},group:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.group},focus:{allowInBrowserExt:!1,defaultValue:null,getValue:R},theme:{allowInBrowserExt:!1,defaultValue:null,getValue:R},usernameUrl:{allowInBrowserExt:!1,defaultValue:null,
14
- getValue:R},onLayoutChange:{allowInBrowserExt:!1,defaultValue:null,getValue:R},openSidebar:{allowInBrowserExt:!0,defaultValue:!1,coerce:x,getValue:R},query:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.query},requestConfigFromFrame:{allowInBrowserExt:!1,defaultValue:null,getValue:R},services:{allowInBrowserExt:!1,defaultValue:null,getValue:R},showHighlights:{allowInBrowserExt:!1,defaultValue:"always",getValue:t=>t.showHighlights},notebookAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.notebookAppUrl},profileAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.profileAppUrl},sidebarAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.sidebarAppUrl},subFrameIdentifier:{allowInBrowserExt:!0,defaultValue:null,getValue:R},externalContainerSelector:{allowInBrowserExt:!1,defaultValue:null,getValue:R}};function T(t,e=window){const n=A(e),i={};for(let r of function(t){const e={annotator:["clientUrl","contentInfoBanner","subFrameIdentifier"],
12
+ function A(t){const e=function(t){if(!S(t,"hypothesisConfig"))return{};if("function"!=typeof t.hypothesisConfig){const t="https://h.readthedocs.io/projects/client/en/latest/publishers/config/#window.hypothesisConfig";return console.warn("hypothesisConfig must be a function, see: "+t),{}}return t.hypothesisConfig()}(t),n=x(e.ignoreOtherConfiguration)?{}:C(t.document);function i(t){return S(e,t)?e[t]:S(n,t)?n[t]:void 0}return{get annotations(){return N(n.annotations)||function(){const e=t.location.href.match(/#annotations:([A-Za-z0-9_-]+)$/);return e?e[1]:null}()},get clientUrl(){return E(t,"hypothesis-client","javascript")},get group(){return N(n.group)||function(){const e=t.location.href.match(/#annotations:group:([A-Za-z0-9_-]+)$/);return e?e[1]:null}()},get notebookAppUrl(){return E(t,"notebook","html")},get profileAppUrl(){return E(t,"profile","html")},get showHighlights(){return function(){const t=i("showHighlights");switch(t){case"always":case"never":case"whenSidebarOpen":return t;case!0:return"always"
13
+ ;case!1:return"never";default:return"always"}}()},get sidebarAppUrl(){return E(t,"sidebar","html")},get query(){return N(n.query)||function(){const e=t.location.href.match(/#annotations:(query|q):(.+)$/i);if(e)try{return decodeURIComponent(e[2])}catch(t){}return null}()},hostPageSetting:i}}const R=(t,e)=>t.hostPageSetting(e),k={annotations:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.annotations},appType:{allowInBrowserExt:!0,defaultValue:null,getValue:R},branding:{defaultValue:null,allowInBrowserExt:!1,getValue:R},clientUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.clientUrl},contentInfoBanner:{allowInBrowserExt:!1,defaultValue:null,getValue:R},enableExperimentalNewNoteButton:{allowInBrowserExt:!1,defaultValue:null,getValue:R},group:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.group},focus:{allowInBrowserExt:!1,defaultValue:null,getValue:R},theme:{allowInBrowserExt:!1,defaultValue:null,getValue:R},usernameUrl:{allowInBrowserExt:!1,defaultValue:null,getValue:R},onLayoutChange:{
14
+ allowInBrowserExt:!1,defaultValue:null,getValue:R},openSidebar:{allowInBrowserExt:!0,defaultValue:!1,coerce:x,getValue:R},query:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.query},requestConfigFromFrame:{allowInBrowserExt:!1,defaultValue:null,getValue:R},services:{allowInBrowserExt:!1,defaultValue:null,getValue:R},showHighlights:{allowInBrowserExt:!1,defaultValue:"always",getValue:t=>t.showHighlights},notebookAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.notebookAppUrl},profileAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.profileAppUrl},sidebarAppUrl:{allowInBrowserExt:!0,defaultValue:null,getValue:t=>t.sidebarAppUrl},subFrameIdentifier:{allowInBrowserExt:!0,defaultValue:null,getValue:R},externalContainerSelector:{allowInBrowserExt:!1,defaultValue:null,getValue:R}};function T(t,e=window){const n=A(e),i={};for(const r of function(t){const e={annotator:["clientUrl","contentInfoBanner","subFrameIdentifier"],
15
15
  sidebar:["appType","annotations","branding","enableExperimentalNewNoteButton","externalContainerSelector","focus","group","onLayoutChange","openSidebar","query","requestConfigFromFrame","services","showHighlights","sidebarAppUrl","theme","usernameUrl"],notebook:["branding","group","notebookAppUrl","requestConfigFromFrame","services","theme","usernameUrl"],profile:["profileAppUrl"]};switch(t){case"annotator":return e.annotator;case"sidebar":return e.sidebar;case"notebook":return e.notebook;case"profile":return e.profile;case"all":return Object.values(e).flat();default:throw new Error(`Invalid application context used: "${t}"`)}}(t)){const t=k[r],s=void 0!==t.defaultValue,a=!((o=E(e,"sidebar","html")).startsWith("http://")||o.startsWith("https://"));if(!t.allowInBrowserExt&&a){s&&(i[r]=t.defaultValue);continue}const l=t.getValue(n,r);void 0!==l?i[r]=t.coerce?t.coerce(l):l:s&&(i[r]=t.defaultValue)}var o;return i}var P,O,L,M,I,F,D,B,H={},V=[],U=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i
16
16
  ;function q(t,e){for(var n in e)t[n]=e[n];return t}function W(t){var e=t.parentNode;e&&e.removeChild(t)}function z(t,e,n,i,o){var r={type:t,props:e,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++L:o};return null==o&&null!=O.vnode&&O.vnode(r),r}function $(t){return t.children}function j(t,e){this.props=t,this.context=e}function X(t,e){if(null==e)return t.__?X(t.__,t.__.__k.indexOf(t)+1):null;for(var n;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e)return n.__e;return"function"==typeof t.type?X(t):null}function Y(t){var e,n;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,e=0;e<t.__k.length;e++)if(null!=(n=t.__k[e])&&null!=n.__e){t.__e=t.__c.base=n.__e;break}return Y(t)}}function Z(t){(!t.__d&&(t.__d=!0)&&M.push(t)&&!G.__r++||I!==O.debounceRendering)&&((I=O.debounceRendering)||F)(G)}function G(){var t,e,n,i,o,r,s,a;for(M.sort(D);t=M.shift();)t.__d&&(e=M.length,i=void 0,o=void 0,s=(r=(n=t).__v).__e,(a=n.__P)&&(i=[],
17
17
  (o=q({},r)).__v=r.__v+1,rt(a,r,o,n.__n,void 0!==a.ownerSVGElement,null!=r.__h?[s]:null,i,null==s?X(r):s,r.__h),st(i,r),r.__e!=s&&Y(r)),M.length>e&&M.sort(D));G.__r=0}function K(t,e,n,i,o,r,s,a,l,c){var h,u,d,f,p,m,g,_=i&&i.__k||V,v=_.length;for(n.__k=[],h=0;h<e.length;h++)if(null!=(f=n.__k[h]=null==(f=e[h])||"boolean"==typeof f||"function"==typeof f?null:"string"==typeof f||"number"==typeof f||"bigint"==typeof f?z(null,f,null,null,f):Array.isArray(f)?z($,{children:f},null,null,null):f.__b>0?z(f.type,f.props,f.key,f.ref?f.ref:null,f.__v):f)){if(f.__=n,f.__b=n.__b+1,null===(d=_[h])||d&&f.key==d.key&&f.type===d.type)_[h]=void 0;else for(u=0;u<v;u++){if((d=_[u])&&f.key==d.key&&f.type===d.type){_[u]=void 0;break}d=null}rt(t,f,d=d||H,o,r,s,a,l,c),p=f.__e,(u=f.ref)&&d.ref!=u&&(g||(g=[]),d.ref&&g.push(d.ref,null,f),g.push(u,f.__c||p,f)),null!=p?(null==m&&(m=p),"function"==typeof f.type&&f.__k===d.__k?f.__d=l=Q(f,l,t):l=J(t,f,d,_,p,l),"function"==typeof n.type&&(n.__d=l)):l&&d.__e==l&&l.parentNode!=t&&(l=X(d))}
@@ -120,7 +120,7 @@ this._hostRPC.on("close",(()=>this.emit("hostDisconnected")));const e=await this
120
120
  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=Ye.fromRange(i);n={annotation:t,target:e,range:o}}catch(i){n={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&&sn(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=[]
121
121
  ;const n=await this.getDocumentInfo(),i=this.element,r=(await Promise.all(e.map((t=>this._integration.describe(i,t))))).map((t=>({source:n.uri,selector:t}))),s={uri:n.uri,document:n.metadata,target:r,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+o(8)};return this._sidebarRPC.call("createAnnotation",s),this.anchor(s),Ao(),s}_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);an(e.highlights,n)}this._sidebarRPC.call("hoverAnnotations",t)}_scrollToClosestOffScreenAnchor(t,e){const n=function(t,e){let n=null,i=0;for(let r of t){var o;if(null===(o=r.highlights)||void 0===o||!o.length)continue;const t=ln(r.highlights).top;"up"===e&&t>=137||"down"===e&&t<=window.innerHeight-22||(!n||"up"===e&&t>i||"down"===e&&t<i)&&(n=r,i=t)}return n}(this.anchors.filter((({annotation:e})=>t.includes(e.$tag))),e);n&&this._integration.scrollToAnchor(n)}_onSelection(t){
122
122
  const e=this._integration.getAnnotatableRange(t);if(!e)return void this._onClearSelection();const n=document.getSelection(),i=Ke(n),o=function(t){if(t.isCollapsed)return null;const e=tn(t.getRangeAt(0));return 0===e.length?null:Ke(t)?e[0]:e[e.length-1]}(n);o?(this.selectedRanges=[e],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=So(),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")}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)}
123
- get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){Ht(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function ko(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function To(t,e){var n;const i={};for(let[t,n]of Object.entries(e))"notebookAppUrl"!==t&&"sidebarAppUrl"!==t&&null!=n&&(i[t]=n);i.origin=new URL(t).origin,i.version="1.1248.0";const o=new URL(window.location.href);if(o.hash="",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),
123
+ get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sideBySideActive=this._integration.fitSideBySide(t)}get sideBySideActive(){return this._sideBySideActive}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){Ht(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function ko(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function To(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.1250.0";const o=new URL(window.location.href);if(o.hash="",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),
124
124
  t.onProfileRequest&&(t.onProfileRequestProvided=!0),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return i}function Po({config:t,groupId:e}){return Wt("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allowFullScreen:!0,src:ko(t.notebookAppUrl,{...To(t.notebookAppUrl,t),group:e})})}function Oo({eventBus:t,config:e}){const[n,i]=Nt(0),[o,r]=Nt(!0),[s,a]=Nt(null),l=Rt(""),c=Rt(null);At((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),At((()=>{document.body.style.overflow=o?l.current:"hidden"}),[o]),At((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),i((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t]);return null===s?null:Wt("div",{className:be("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:o}),"data-testid":"notebook-outer",children:Wt("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[Wt("div",{className:"absolute right-0 m-3",children:Wt(Ae,{
125
125
  title:"Close the Notebook",onClick:()=>{var t;r(!0),null===(t=c.current)||void 0===t||t.publish("closeNotebook")},variant:"dark",classes:be("!bg-transparent enabled:hover:!bg-grey-3"),children:Wt(Xt,{className:"w-4 h-4"})})}),Wt(Po,{config:e,groupId:s},n)]})})}class Lo{constructor(t,n,i){e(this,"_outerContainer",void 0),e(this,"_shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this._shadowRoot=Fe(this._outerContainer),ut(Wt(Oo,{eventBus:n,config:i}),this._shadowRoot)}destroy(){ut(null,this._shadowRoot),this._outerContainer.remove()}}function Mo({eventBus:t,config:e}){const[n,i]=Nt(!0),o=Rt(null);At((()=>{const e=t.createEmitter();return e.subscribe("openProfile",(()=>{i(!1)})),o.current=e,()=>{e.destroy()}}),[t]);return n?null:Wt("div",{className:"fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50","data-testid":"profile-outer",children:Wt("div",{className:"relative w-full h-full","data-testid":"profile-inner",
126
126
  children:[Wt("div",{className:"absolute right-0 m-3",children:Wt(Ae,{title:"Close the Profile",onClick:()=>{var t;i(!0),null===(t=o.current)||void 0===t||t.publish("closeProfile")},variant:"dark",classes:be("!bg-transparent enabled:hover:!bg-grey-3"),children:Wt(Xt,{className:"w-4 h-4"})})}),Wt("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:e.profileAppUrl})]})})}class Io{constructor(t,n,i){e(this,"_outerContainer",void 0),e(this,"shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-profile"),t.appendChild(this._outerContainer),this.shadowRoot=Fe(this._outerContainer),ut(Wt(Mo,{eventBus:n,config:i}),this.shadowRoot)}destroy(){ut(null,this.shadowRoot),this._outerContainer.remove()}}var Fo={},Do={get exports(){return Fo},set exports(t){Fo=t}};!function(t){!function(e,n,i,o){var r,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l=Math.round,c=Math.abs,h=Date.now;function u(t,e,n){return setTimeout(v(t,n),e)}function d(t,e,n){