hypothesis 1.1372.0 → 1.1373.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?3b24f1","styles/annotator.css":"styles/annotator.css?90cc61","styles/annotator.css.map":"styles/annotator.css.map?0a9b1b","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?322a0c","styles/sidebar.css":"styles/sidebar.css?3482a0","styles/ui-playground.css":"styles/ui-playground.css?28722f","styles/ui-playground.css.map":"styles/ui-playground.css.map?e9ffc8","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?2e79e4","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?e526d2","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?f72d59","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?f4c017","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?0bbb88"};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.1372.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 u=l,d=a(u.notebookAppUrl||"https://hypothes.is/notebook"),h=a(u.profileAppUrl||"https://hypothes.is/user-profile"),y=a(u.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,u=c;p<u.length;p++)e(s,i(t,u[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:d,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?f97f86","styles/annotator.css":"styles/annotator.css?ea5d97","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/annotator.css.map":"styles/annotator.css.map?1e746d","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css.map":"styles/katex.min.css.map?cd8c0e","styles/pdfjs-overrides.css":"styles/pdfjs-overrides.css?c95edf","styles/katex.min.css":"styles/katex.min.css?e179ab","styles/pdfjs-overrides.css.map":"styles/pdfjs-overrides.css.map?1d8ac6","styles/sidebar.css.map":"styles/sidebar.css.map?5d5f84","styles/sidebar.css":"styles/sidebar.css?84392c","styles/ui-playground.css.map":"styles/ui-playground.css.map?54e020","styles/ui-playground.css":"styles/ui-playground.css?1a49f2","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?3ccd55","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?573ccf","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?2e79e4","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?f4c017","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?21296f"};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.1373.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 u=l,d=a(u.notebookAppUrl||"https://hypothes.is/notebook"),h=a(u.profileAppUrl||"https://hypothes.is/user-profile"),y=a(u.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,u=c;p<u.length;p++)e(s,i(t,u[p]))}}(document,{assetRoot:c,manifest:s,notebookAppUrl:d,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,20 +1,20 @@
1
1
  {
2
- "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?3b24f1",
3
- "styles/annotator.css": "styles/annotator.css?90cc61",
4
- "styles/annotator.css.map": "styles/annotator.css.map?0a9b1b",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?f97f86",
3
+ "styles/annotator.css": "styles/annotator.css?ea5d97",
5
4
  "styles/highlights.css": "styles/highlights.css?6b4ebd",
5
+ "styles/annotator.css.map": "styles/annotator.css.map?1e746d",
6
6
  "styles/highlights.css.map": "styles/highlights.css.map?241350",
7
- "styles/katex.min.css": "styles/katex.min.css?e179ab",
8
7
  "styles/katex.min.css.map": "styles/katex.min.css.map?cd8c0e",
9
8
  "styles/pdfjs-overrides.css": "styles/pdfjs-overrides.css?c95edf",
9
+ "styles/katex.min.css": "styles/katex.min.css?e179ab",
10
10
  "styles/pdfjs-overrides.css.map": "styles/pdfjs-overrides.css.map?1d8ac6",
11
- "styles/sidebar.css.map": "styles/sidebar.css.map?322a0c",
12
- "styles/sidebar.css": "styles/sidebar.css?3482a0",
13
- "styles/ui-playground.css": "styles/ui-playground.css?28722f",
14
- "styles/ui-playground.css.map": "styles/ui-playground.css.map?e9ffc8",
11
+ "styles/sidebar.css.map": "styles/sidebar.css.map?5d5f84",
12
+ "styles/sidebar.css": "styles/sidebar.css?84392c",
13
+ "styles/ui-playground.css.map": "styles/ui-playground.css.map?54e020",
14
+ "styles/ui-playground.css": "styles/ui-playground.css?1a49f2",
15
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?3ccd55",
16
+ "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?573ccf",
15
17
  "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?2e79e4",
16
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?e526d2",
17
- "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?f72d59",
18
18
  "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?f4c017",
19
- "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?0bbb88"
19
+ "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?21296f"
20
20
  }
@@ -60,7 +60,7 @@ const[u,d]=Wt(!1),f=Yt((()=>d(!1)),[]),p=jt(null),m=jt(null),g=Gt(),_=function(t
60
60
  fileName:fn,lineNumber:43,columnNumber:5},this)}var mn="/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/PointerButton.tsx";function gn({children:t,classes:e,elementRef:n,expanded:i,pressed:o,title:r,direction:s,...a}){return me(Ze,{"data-component":"PointerButton",...a,elementRef:n,classes:fe("relative w-[26px] h-[16px]","flex items-center justify-center","bg-white rounded-[4px] border","before:absolute before:border-transparent","after:absolute after:border-transparent","text-[10px] text-color-text-light leading-none font-semibold",{"shadow-[1px_1px_1px_rgba(0,0,0,0.1)]":"down"!==s,"shadow-[1px_0px_1px_rgba(0,0,0,0.1)]":"down"===s},{"rounded-r-[4px] rounded-l-[2px]":"left"===s,"before:right-full before:top-1/2 after:right-full after:top-1/2":"left"===s,"before:mt-[-8px] before:border-8 before:border-r-[5px] before:border-r-grey-3":"left"===s,"after:mt-[-7px] after:border-[7px] after:border-r-[4px] after:border-r-white":"left"===s},{"z-1 rounded-t-px-sm rounded-b-px":"up"===s,
61
61
  "before:top-auto before:left-1/2 before:bottom-full after:top-auto after:left-1/2 after:bottom-full":"up"===s,"before:ml-[-13px] before:border-[13px] before:border-b-[6px] before:border-b-grey-3":"up"===s,"after:ml-[-12px] after:border-[12px] after:border-b-[5px] after:border-b-white":"up"===s},{"z-1 rounded-t-px rounded-b-px-sm":"down"===s,"before:top-full before:left-1/2 after:top-full after:left-1/2":"down"===s,"before:ml-[-13px] before:border-[13px] before:border-t-[6px] before:border-t-grey-3":"down"===s,"after:ml-[-12px] after:border-[12px] after:border-t-[5px] after:border-t-white":"down"===s},e),expanded:i,pressed:o,title:r,variant:"custom",size:"custom",children:t},void 0,0,{fileName:mn,lineNumber:48,columnNumber:5},this)}function _n({badgeCount:t}){return me("span",{className:fe("rounded px-1 py-0.5","bg-current"),children:me("span",{className:"font-bold text-color-text-inverted",children:t})})}function vn({arrowDirection:t}){return me("div",{
62
62
  className:fe("absolute left-1/2 -translate-x-1/2 z-2","fill-white text-grey-3",{"top-0 -translate-y-full":"up"===t}),children:me("up"===t?Xe:$e,{})})}function bn({badgeCount:t,icon:e,label:n,onClick:i,shortcut:o}){re(o,i);const r=o?`${n} (${o})`:n;return me(Ze,{classes:fe("text-grey-7","group-hover:text-grey-5","hover:group-hover:text-grey-9"),onClick:i,title:r,size:"custom",variant:"custom",children:me("div",{className:fe("flex flex-col items-center gap-y-1 py-2.5 px-2","text-annotator-sm leading-none"),children:[e&&me(e,{className:"text-annotator-lg",title:r}),"number"==typeof t&&me(_n,{badgeCount:t}),me("span",{"data-testid":"adder-button-label",children:n})]})})}function yn({annotationCount:t,isVisible:e}){return me("div",{className:"sr-only",children:[me("span",{"aria-live":"polite","aria-atomic":"true",role:"status","data-testid":"annotation-count-announce",children:t>0&&me("span",{children:[t," ",1===t?"annotation":"annotations"," for this selection."]})}),me("ul",{"aria-live":"polite",
63
- "data-testid":"annotate-shortcuts-announce",children:e&&me(lt,{children:[t>0&&me("li",{children:["Press ","'S'"," to show annotations."]}),me("li",{children:["Press ","'A'"," to annotate."]}),me("li",{children:["Press ","'H'"," to highlight."]})]})})]})}function wn({arrowDirection:t,isVisible:e,onCommand:n,annotationCount:i=0}){const o=e?"a":null,r=e?"h":null,s=e?"s":null;return re(e?"Escape":null,(()=>n("hide"))),me("div",{className:fe("all-initial","border border-solid border-grey-3","absolute select-none bg-white rounded shadow-adder-toolbar","opacity-5",{"animate-adder-pop-up":"up"===t&&e,"animate-adder-pop-down":"down"===t&&e}),"data-component":"AdderToolbar",dir:"ltr",style:{visibility:e?"visible":"hidden"},children:[me("div",{className:fe("flex group"),children:[me(bn,{icon:we,onClick:()=>n("annotate"),label:"Annotate",shortcut:o}),me(bn,{icon:Fe,onClick:()=>n("highlight"),label:"Highlight",shortcut:r}),i>0&&me(lt,{children:[me("div",{className:fe("m-1.5 border-r border-grey-4 border-solid")}),me(bn,{
63
+ "data-testid":"annotate-shortcuts-announce",children:e&&me(lt,{children:[t>0&&me("li",{children:["Press ","'S'"," to show annotations."]}),me("li",{children:["Press ","'A'"," to annotate."]}),me("li",{children:["Press ","'H'"," to highlight."]})]})})]})}function wn({arrowDirection:t,isVisible:e,onCommand:n,annotationCount:i=0}){const o=e?"a":null,r=e?"h":null,s=e?"s":null;return re(e?"Escape":null,(()=>n("hide"))),me("div",{className:fe("all-initial","border border-solid border-grey-3","absolute select-none bg-white rounded shadow-intense","opacity-5",{"animate-adder-pop-up":"up"===t&&e,"animate-adder-pop-down":"down"===t&&e}),"data-component":"AdderToolbar",dir:"ltr",style:{visibility:e?"visible":"hidden"},children:[me("div",{className:fe("flex group"),children:[me(bn,{icon:we,onClick:()=>n("annotate"),label:"Annotate",shortcut:o}),me(bn,{icon:Fe,onClick:()=>n("highlight"),label:"Highlight",shortcut:r}),i>0&&me(lt,{children:[me("div",{className:fe("m-1.5 border-r border-grey-4 border-solid")}),me(bn,{
64
64
  badgeCount:i,onClick:()=>n("show"),label:"Show",shortcut:s})]})]}),me(vn,{arrowDirection:t}),me(yn,{annotationCount:i,isVisible:e})]})}function xn(t){const e=t.attachShadow({mode:"open"});!function(t){var e;const n=null===(e=document.querySelector('link[rel="preload"][href*="/build/styles/annotator.css"]'))||void 0===e?void 0:e.href;if(!n)return;const i=document.createElement("link");i.rel="stylesheet",i.href=n,t.appendChild(i)}(e);const n=window.applyFocusVisiblePolyfill;var i;return n&&n(e),(i=e).addEventListener("mouseup",(t=>t.stopPropagation())),i.addEventListener("mousedown",(t=>t.stopPropagation())),i.addEventListener("touchstart",(t=>t.stopPropagation()),{passive:!0}),e}let Cn=function(t){return t[t.DOWN=1]="DOWN",t[t.UP=2]="UP",t}({});function Sn(t){return t.toString()+"px"}class Nn{constructor(t,e){n(this,"_outerContainer",void 0),n(this,"_shadowRoot",void 0),n(this,"_view",void 0),n(this,"_isVisible",void 0),n(this,"_arrowDirection",void 0),n(this,"_onAnnotate",void 0),
65
65
  n(this,"_onHighlight",void 0),n(this,"_onShowAnnotations",void 0),n(this,"_annotationsForSelection",void 0),this._outerContainer=document.createElement("hypothesis-adder"),t.appendChild(this._outerContainer),this._shadowRoot=xn(this._outerContainer),Object.assign(this._outerContainer.style,{position:"absolute",top:0,left:0}),this._view=t.ownerDocument.defaultView,this._isVisible=!1,this._arrowDirection="up",this._annotationsForSelection=[],this._onAnnotate=e.onAnnotate,this._onHighlight=e.onHighlight,this._onShowAnnotations=e.onShowAnnotations,this._render()}get annotationsForSelection(){return this._annotationsForSelection}set annotationsForSelection(t){this._annotationsForSelection=t,this._render()}hide(){this._isVisible=!1,this._render(),Object.assign(this._outerContainer.style,{top:0,left:0})}destroy(){Rt(null,this._shadowRoot),this._outerContainer.remove()}show(t,e){const{left:n,top:i,arrowDirection:o}=this._calculateTarget(t,e);this._showAt(n,i),this._isVisible=!0,
66
66
  this._arrowDirection=o===Cn.UP?"up":"down",this._render()}_width(){return this._shadowRoot.firstChild.getBoundingClientRect().width}_height(){return this._shadowRoot.firstChild.getBoundingClientRect().height}_calculateTarget(t,e){let n,i,o;n=e&&!se()?Cn.DOWN:Cn.UP;const r=Math.min(20,t.width),s=this._width(),a=se()?10:0,l=this._height();return o=e?t.left-s/2+r:t.left+t.width-s/2-r,t.top-l<0&&n===Cn.DOWN?n=Cn.UP:t.top+l>this._view.innerHeight&&(n=Cn.DOWN),i=n===Cn.UP?t.top+t.height+10+a:t.top-l-10,o=Math.max(o,0),o=Math.min(o,this._view.innerWidth-s),i=Math.max(i,0),i=Math.min(i,this._view.innerHeight-l),{top:i,left:o,arrowDirection:n}}_findZindex(t,e){if(void 0===document.elementsFromPoint)return 32768;const n=this._width(),i=this._height(),o=[...new Set([...document.elementsFromPoint(t,e),...document.elementsFromPoint(t,e+i),...document.elementsFromPoint(t+n/2,e+i/2),...document.elementsFromPoint(t+n,e),...document.elementsFromPoint(t+n,e+i)])].map((t=>+getComputedStyle(t).zIndex)).filter(Number.isInteger)
@@ -138,7 +138,7 @@ this._sidebarRPC.on("hoverAnnotations",(t=>this._hoverAnnotations(t))),this._sid
138
138
  this._bucketBarClient.destroy(),null===(t=this._clusterToolbar)||void 0===t||t.destroy(),function(t){Xn(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=ar(t);if(!n)return;const i=$n(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)&&Yn(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=Ln.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)
139
139
  ;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&&Xn(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}))),s={uri:n.uri,document:n.metadata,target:o,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+r(8)};return this._sidebarRPC.call("createAnnotation",s),this.anchor(s),lr(),s}_hoverAnnotations(t){this._hoveredAnnotations.clear(),
140
140
  t.forEach((t=>this._hoveredAnnotations.add(t)));for(const e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);Yn(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=Hn(n),o=qn(n);o?(this.selectedRanges=[e],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=rr(),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)
141
- }(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){oe(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function ur(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function dr(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.1372.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),
141
+ }(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){oe(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}}function ur(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function dr(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.1373.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),
142
142
  t.onProfileRequest&&(t.onProfileRequestProvided=!0),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return i}function fr({config:t,groupId:e}){return me("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allowFullScreen:!0,src:ur(t.notebookAppUrl,{...dr(t.notebookAppUrl,t),group:e})})}function pr({eventBus:t,config:e}){const[n,i]=Wt(0),[o,r]=Wt(!0),[s,a]=Wt(null),l=jt(""),c=jt(null);zt((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),zt((()=>{document.body.style.overflow=o?l.current:"hidden"}),[o]),zt((()=>{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:me("div",{className:fe("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:o}),"data-testid":"notebook-outer",children:me("div",{className:"relative w-full h-full","data-testid":"notebook-inner",children:[me("div",{className:"absolute right-0 m-3",children:me(tn,{
143
143
  title:"Close the Notebook",onClick:()=>{var t;r(!0),null===(t=c.current)||void 0===t||t.publish("closeNotebook")},variant:"dark",classes:fe("!bg-transparent enabled:hover:!bg-grey-3"),children:me(Ce,{className:"w-4 h-4"})})}),me(fr,{config:e,groupId:s},n)]})})}class mr{constructor(t,e,i){n(this,"_outerContainer",void 0),n(this,"_shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-notebook"),t.appendChild(this._outerContainer),this._shadowRoot=xn(this._outerContainer),Rt(me(pr,{eventBus:e,config:i}),this._shadowRoot)}destroy(){Rt(null,this._shadowRoot),this._outerContainer.remove()}}function gr({eventBus:t,config:e}){const[n,i]=Wt(!0),o=jt(null);zt((()=>{const e=t.createEmitter();return e.subscribe("openProfile",(()=>{i(!1)})),o.current=e,()=>{e.destroy()}}),[t]);return n?null:me("div",{className:"fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50","data-testid":"profile-outer",children:me("div",{className:"relative w-full h-full","data-testid":"profile-inner",
144
144
  children:[me("div",{className:"absolute right-0 m-3",children:me(tn,{title:"Close the Profile",onClick:()=>{var t;i(!0),null===(t=o.current)||void 0===t||t.publish("closeProfile")},variant:"dark",classes:fe("!bg-transparent enabled:hover:!bg-grey-3"),children:me(Ce,{className:"w-4 h-4"})})}),me("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:e.profileAppUrl})]})})}class _r{constructor(t,e,i){n(this,"_outerContainer",void 0),n(this,"shadowRoot",void 0),this._outerContainer=document.createElement("hypothesis-profile"),t.appendChild(this._outerContainer),this.shadowRoot=xn(this._outerContainer),Rt(me(gr,{eventBus:e,config:i}),this.shadowRoot)}destroy(){Rt(null,this.shadowRoot),this._outerContainer.remove()}}var vr={exports:{}};!function(t){!function(e,n,i,o){var r,s=["","webkit","Moz","MS","ms","o"],a=n.createElement("div"),l="function",c=Math.round,h=Math.abs,u=Date.now;function d(t,e,n){return setTimeout(b(t,n),e)}function f(t,e,n){return!!Array.isArray(t)&&(p(t,n[e],n),!0)}