hypothesis 1.1607.0 → 1.1608.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 +12 -12
- package/build/scripts/annotator.bundle.js +20 -20
- package/build/scripts/annotator.bundle.js.map +1 -1
- package/build/scripts/sidebar.bundle.js +87 -87
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/scripts/ui-playground.bundle.js +16 -16
- package/build/scripts/ui-playground.bundle.js.map +1 -1
- package/build/styles/annotator.css +6 -0
- package/build/styles/annotator.css.map +1 -1
- package/build/styles/sidebar.css +6 -0
- package/build/styles/sidebar.css.map +1 -1
- package/build/styles/ui-playground.css +7 -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";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?
|
|
1
|
+
!function(){"use strict";var s={"scripts/annotator.bundle.js":"scripts/annotator.bundle.js?7b8378","styles/annotator.css":"styles/annotator.css?669ce7","styles/annotator.css.map":"styles/annotator.css.map?936412","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?d92c5a","styles/katex.min.css.map":"styles/katex.min.css.map?e7e03f","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?302a46","styles/sidebar.css.map":"styles/sidebar.css.map?f55674","styles/ui-playground.css":"styles/ui-playground.css?26dc9f","styles/ui-playground.css.map":"styles/ui-playground.css.map?66b9f0","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?aa3492","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?55cc48","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?2c1b49","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?0b7527","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?7074d2"};function t(s){s.setAttribute("data-hypothesis-asset","")}function e(s,e){var o=s.createElement("link");o.rel="stylesheet",o.type="text/css",o.href=e,t(o),s.head.appendChild(o)}function o(s,e){var o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=o.esModule,n=void 0===r||r,i=o.forceReload,a=void 0!==i&&i,l=s.createElement("script");n&&(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,o,r){var n=s.createElement("link");n.rel=e,n.href=r,n.type="application/annotator+".concat(o),t(n),s.head.appendChild(n)}function n(s,e,o){var r=s.createElement("link");r.rel="preload",r.as=e,r.href=o,"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=[()=>Object.fromEntries([]),()=>new URL(document.location.href),()=>new Request("https://hypothes.is"),()=>Element.prototype.attachShadow,()=>CSS.supports("display: grid"),()=>(document.evaluate("/html/body",document,null,XPathResult.ANY_TYPE,null),!0)];try{return s.every((s=>s()))}catch(s){return!1}}()){var l=function(s){for(var t={},e=s.querySelectorAll("script.js-hypothesis-config"),o=0;o<e.length;o++){var r=void 0;try{r=JSON.parse(e[o].textContent||"")}catch(s){console.warn("Could not parse settings from js-hypothesis-config tags",s),r={}}Object.assign(t,r)}return t}(document),p=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1608.0/");if(document.querySelector("hypothesis-app")){!function(s,t){n(s,"fetch",t.apiUrl),n(s,"fetch",t.apiUrl+"links");for(var r=0,a=["scripts/sidebar.bundle.js"];r<a.length;r++)o(s,i(t,a[r]),{esModule:!0});for(var l=0,p=["styles/katex.min.css","styles/sidebar.css"];l<p.length;l++)e(s,i(t,p[l]))}(document,{assetRoot:p,manifest:s,apiUrl:l.apiUrl})}else{var c=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(c&&!function(s){return!!(arguments.length>1&&void 0!==arguments[1]?arguments[1]:document).querySelector("script.js-hypothesis-config[data-extension-id=".concat(s,"]"))}(c))throw new Error("Could not start Hypothesis extension as configuration is missing");var d=l,h=a(d.notebookAppUrl||"https://hypothes.is/notebook"),u=a(d.profileAppUrl||"https://hypothes.is/user-profile"),y=a(d.sidebarAppUrl||"https://hypothes.is/app.html");!function(s,t){if(!s.querySelector('link[type="application/annotator+html"]')){r(s,"sidebar","html",t.sidebarAppUrl),r(s,"notebook","html",t.notebookAppUrl),r(s,"profile","html",t.profileAppUrl),n(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++)o(s,i(t,l[a]),{esModule:!1});var p=[];void 0!==window.PDFViewerApplication&&p.push("styles/pdfjs-overrides.css"),p.push("styles/highlights.css");for(var c=0,d=p;c<d.length;c++)e(s,i(t,d[c]))}}(document,{assetRoot:p,manifest:s,notebookAppUrl:h,profileAppUrl:u,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/.")}();
|
package/build/manifest.json
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
{
|
|
2
|
-
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?
|
|
3
|
-
"styles/annotator.css": "styles/annotator.css?
|
|
4
|
-
"styles/annotator.css.map": "styles/annotator.css.map?
|
|
2
|
+
"scripts/annotator.bundle.js": "scripts/annotator.bundle.js?7b8378",
|
|
3
|
+
"styles/annotator.css": "styles/annotator.css?669ce7",
|
|
4
|
+
"styles/annotator.css.map": "styles/annotator.css.map?936412",
|
|
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?d92c5a",
|
|
8
8
|
"styles/katex.min.css.map": "styles/katex.min.css.map?e7e03f",
|
|
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?
|
|
12
|
-
"styles/sidebar.css.map": "styles/sidebar.css.map?
|
|
13
|
-
"styles/ui-playground.css
|
|
14
|
-
"styles/ui-playground.css": "styles/ui-playground.css?
|
|
15
|
-
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?
|
|
16
|
-
"scripts/
|
|
17
|
-
"scripts/
|
|
18
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?
|
|
19
|
-
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?
|
|
11
|
+
"styles/sidebar.css": "styles/sidebar.css?302a46",
|
|
12
|
+
"styles/sidebar.css.map": "styles/sidebar.css.map?f55674",
|
|
13
|
+
"styles/ui-playground.css": "styles/ui-playground.css?26dc9f",
|
|
14
|
+
"styles/ui-playground.css.map": "styles/ui-playground.css.map?66b9f0",
|
|
15
|
+
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?aa3492",
|
|
16
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?55cc48",
|
|
17
|
+
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?2c1b49",
|
|
18
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?0b7527",
|
|
19
|
+
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?7074d2"
|
|
20
20
|
}
|
|
@@ -2,25 +2,25 @@
|
|
|
2
2
|
n.metaKey||n.altKey||n.ctrlKey||(r(e.activeElement)&&a(e.activeElement),t=!0)}function d(e){t=!1}function h(e){r(e.target)&&(t||s(e.target))&&a(e.target)}function u(e){r(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(o),o=window.setTimeout((function(){n=!1}),100),l(e.target))}function f(e){"hidden"===document.visibilityState&&(n&&(t=!0),m())}function m(){document.addEventListener("mousemove",g),document.addEventListener("mousedown",g),document.addEventListener("mouseup",g),document.addEventListener("pointermove",g),document.addEventListener("pointerdown",g),document.addEventListener("pointerup",g),document.addEventListener("touchmove",g),document.addEventListener("touchstart",g),document.addEventListener("touchend",g)}function p(){document.removeEventListener("mousemove",g),document.removeEventListener("mousedown",g),document.removeEventListener("mouseup",g),document.removeEventListener("pointermove",g),
|
|
3
3
|
document.removeEventListener("pointerdown",g),document.removeEventListener("pointerup",g),document.removeEventListener("touchmove",g),document.removeEventListener("touchstart",g),document.removeEventListener("touchend",g)}function g(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1,p())}document.addEventListener("keydown",c,!0),document.addEventListener("mousedown",d,!0),document.addEventListener("pointerdown",d,!0),document.addEventListener("touchstart",d,!0),document.addEventListener("visibilitychange",f,!0),m(),e.addEventListener("focus",h,!0),e.addEventListener("blur",u,!0),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready")
|
|
4
4
|
}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}"undefined"!=typeof document&&e(document)}());var o,i,r,s,a,l,c,d,h,u,f,m,p={},g=[],_=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,b=Array.isArray;function w(e,t){for(var n in t)e[n]=t[n];return e}function v(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function y(e,t,n,o,s){var a={type:e,props:t,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++r:s,__i:-1,__u:0};return null==s&&null!=i.vnode&&i.vnode(a),a}function x(e){return e.children}function N(e,t){this.props=e,this.context=t}function C(e,t){if(null==t)return e.__?C(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?C(e):null}function S(e){var t,n;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e){e.__e=e.__c.base=n.__e;break
|
|
5
|
-
}return S(e)}}function E(e){(!e.__d&&(e.__d=!0)&&s.push(e)&&!A.__r++||a
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
5
|
+
}return S(e)}}function E(e){(!e.__d&&(e.__d=!0)&&s.push(e)&&!A.__r++||a!=i.debounceRendering)&&((a=i.debounceRendering)||l)(A)}function A(){for(var e,t,n,o,r,a,l,d=1;s.length;)s.length>d&&s.sort(c),e=s.shift(),d=s.length,e.__d&&(n=void 0,r=(o=(t=e).__v).__e,a=[],l=[],t.__P&&((n=w({},o)).__v=o.__v+1,i.vnode&&i.vnode(n),O(t.__P,n,o,t.__n,t.__P.namespaceURI,32&o.__u?[r]:null,a,null==r?C(o):r,!!(32&o.__u),l),n.__v=o.__v,n.__.__k[n.__i]=n,I(a,n,l),n.__e!=r&&S(n)));A.__r=0}function R(e,t,n,o,i,r,s,a,l,c,d){var h,u,f,m,_,w,v=o&&o.__k||g,N=t.length;for(l=function(e,t,n,o,i){var r,s,a,l,c,d=n.length,h=d,u=0;for(e.__k=new Array(i),r=0;r<i;r++)null!=(s=t[r])&&"boolean"!=typeof s&&"function"!=typeof s?(l=r+u,(s=e.__k[r]="string"==typeof s||"number"==typeof s||"bigint"==typeof s||s.constructor==String?y(null,s,null,null,null):b(s)?y(x,{children:s},null,null,null):null==s.constructor&&s.__b>0?y(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):s).__=e,s.__b=e.__b+1,a=null,-1!=(c=s.__i=T(s,n,l,h))&&(h--,(a=n[c])&&(a.__u|=2)),
|
|
6
|
+
null==a||null==a.__v?(-1==c&&(i>d?u--:i<d&&u++),"function"!=typeof s.type&&(s.__u|=4)):c!=l&&(c==l-1?u--:c==l+1?u++:(c>l?u--:u++,s.__u|=4))):e.__k[r]=null;if(h)for(r=0;r<d;r++)null!=(a=n[r])&&0==(2&a.__u)&&(a.__e==o&&(o=C(a)),H(a,a));return o}(n,t,v,l,N),h=0;h<N;h++)null!=(f=n.__k[h])&&(u=-1==f.__i?p:v[f.__i]||p,f.__i=h,w=O(e,f,u,i,r,s,a,l,c,d),m=f.__e,f.ref&&u.ref!=f.ref&&(u.ref&&F(u.ref,null,f),d.push(f.ref,f.__c||m,f)),null==_&&null!=m&&(_=m),4&f.__u||u.__k===f.__k?l=k(f,l,e):"function"==typeof f.type&&void 0!==w?l=w:m&&(l=m.nextSibling),f.__u&=-7);return n.__e=_,l}function k(e,t,n){var o,i;if("function"==typeof e.type){for(o=e.__k,i=0;o&&i<o.length;i++)o[i]&&(o[i].__=e,t=k(o[i],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=C(e)),n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function T(e,t,n,o){var i,r,s=e.key,a=e.type,l=t[n];if(null===l&&null==e.key||l&&s==l.key&&a==l.type&&0==(2&l.__u))return n;if(o>(null!=l&&0==(2&l.__u)?1:0))for(i=n-1,
|
|
7
|
+
r=n+1;i>=0||r<t.length;){if(i>=0){if((l=t[i])&&0==(2&l.__u)&&s==l.key&&a==l.type)return i;i--}if(r<t.length){if((l=t[r])&&0==(2&l.__u)&&s==l.key&&a==l.type)return r;r++}}return-1}function P(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||_.test(t)?n:n+"px"}function M(e,t,n,o,i){var r;e:if("style"==t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof o&&(e.style.cssText=o=""),o)for(t in o)n&&t in n||P(e.style,t,"");if(n)for(t in n)o&&n[t]==o[t]||P(e.style,t,n[t])}else if("o"==t[0]&&"n"==t[1])r=t!=(t=t.replace(d,"$1")),t=t.toLowerCase()in e||"onFocusOut"==t||"onFocusIn"==t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=n,n?o?n.u=o.u:(n.u=h,e.addEventListener(t,r?f:u,r)):e.removeEventListener(t,r?f:u,r);else{if("http://www.w3.org/2000/svg"==i)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{
|
|
8
|
+
e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function L(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=h++;else if(t.t<n.u)return;return n(i.event?i.event(t):t)}}}function O(e,t,n,o,r,s,a,l,c,d){var h,u,f,m,p,g,_,y,C,S,E,A,k,T,P,M,L,O=t.type;if(null!=t.constructor)return null;128&n.__u&&(c=!!(32&n.__u),s=[l=t.__e=n.__e]),(h=i.__b)&&h(t);e:if("function"==typeof O)try{if(y=t.props,C="prototype"in O&&O.prototype.render,S=(h=O.contextType)&&o[h.__c],E=h?S?S.props.value:h.__:o,n.__c?_=(u=t.__c=n.__c).__=u.__E:(C?t.__c=u=new O(y,E):(t.__c=u=new N(y,E),u.constructor=O,u.render=V),S&&S.sub(u),u.props=y,u.state||(u.state={}),u.context=E,u.__n=o,f=u.__d=!0,u.__h=[],u._sb=[]),C&&null==u.__s&&(u.__s=u.state),C&&null!=O.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=w({},u.__s)),w(u.__s,O.getDerivedStateFromProps(y,u.__s))),m=u.props,p=u.state,u.__v=t,
|
|
9
|
+
f)C&&null==O.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),C&&null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(C&&null==O.getDerivedStateFromProps&&y!==m&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(y,E),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(y,u.__s,E)||t.__v==n.__v){for(t.__v!=n.__v&&(u.props=y,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some((function(e){e&&(e.__=t)})),A=0;A<u._sb.length;A++)u.__h.push(u._sb[A]);u._sb=[],u.__h.length&&a.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(y,u.__s,E),C&&null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(m,p,g)}))}if(u.context=E,u.props=y,u.__P=e,u.__e=!1,k=i.__r,T=0,C){for(u.state=u.__s,u.__d=!1,k&&k(t),h=u.render(u.props,u.state,u.context),P=0;P<u._sb.length;P++)u.__h.push(u._sb[P]);u._sb=[]}else do{u.__d=!1,k&&k(t),h=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++T<25);u.state=u.__s,
|
|
10
|
+
null!=u.getChildContext&&(o=w(w({},o),u.getChildContext())),C&&!f&&null!=u.getSnapshotBeforeUpdate&&(g=u.getSnapshotBeforeUpdate(m,p)),M=h,null!=h&&h.type===x&&null==h.key&&(M=B(h.props.children)),l=R(e,b(M)?M:[M],t,n,o,r,s,a,l,c,d),u.base=t.__e,t.__u&=-161,u.__h.length&&a.push(u),_&&(u.__E=u.__=null)}catch(e){if(t.__v=null,c||null!=s)if(e.then){for(t.__u|=c?160:128;l&&8==l.nodeType&&l.nextSibling;)l=l.nextSibling;s[s.indexOf(l)]=null,t.__e=l}else for(L=s.length;L--;)v(s[L]);else t.__e=n.__e,t.__k=n.__k;i.__e(e,t,n)}else null==s&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):l=t.__e=D(n.__e,t,n,o,r,s,a,c,d);return(h=i.diffed)&&h(t),128&t.__u?void 0:l}function I(e,t,n){for(var o=0;o<n.length;o++)F(n[o],n[++o],n[++o]);i.__c&&i.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){i.__e(e,t.__v)}}))}function B(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:b(e)?e.map(B):w({},e)}function D(e,t,n,r,s,a,l,c,d){var h,u,f,m,g,_,w,y=n.props,x=t.props,N=t.type
|
|
11
|
+
;if("svg"==N?s="http://www.w3.org/2000/svg":"math"==N?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=a)for(h=0;h<a.length;h++)if((g=a[h])&&"setAttribute"in g==!!N&&(N?g.localName==N:3==g.nodeType)){e=g,a[h]=null;break}if(null==e){if(null==N)return document.createTextNode(x);e=document.createElementNS(s,N,x.is&&x),c&&(i.__m&&i.__m(t,a),c=!1),a=null}if(null==N)y===x||c&&e.data==x||(e.data=x);else{if(a=a&&o.call(e.childNodes),y=n.props||p,!c&&null!=a)for(y={},h=0;h<e.attributes.length;h++)y[(g=e.attributes[h]).name]=g.value;for(h in y)if(g=y[h],"children"==h);else if("dangerouslySetInnerHTML"==h)f=g;else if(!(h in x)){if("value"==h&&"defaultValue"in x||"checked"==h&&"defaultChecked"in x)continue;M(e,h,null,g,s)}for(h in x)g=x[h],"children"==h?m=g:"dangerouslySetInnerHTML"==h?u=g:"value"==h?_=g:"checked"==h?w=g:c&&"function"!=typeof g||y[h]===g||M(e,h,g,y[h],s);if(u)c||f&&(u.__html==f.__html||u.__html==e.innerHTML)||(e.innerHTML=u.__html),t.__k=[];else if(f&&(e.innerHTML=""),
|
|
12
|
+
R("template"==t.type?e.content:e,b(m)?m:[m],t,n,r,"foreignObject"==N?"http://www.w3.org/1999/xhtml":s,a,l,a?a[0]:n.__k&&C(n,0),c,d),null!=a)for(h=a.length;h--;)v(a[h]);c||(h="value","progress"==N&&null==_?e.removeAttribute("value"):null!=_&&(_!==e[h]||"progress"==N&&!_||"option"==N&&_!=y[h])&&M(e,h,_,y[h],s),h="checked",null!=w&&w!=e[h]&&M(e,h,w,y[h],s))}return e}function F(e,t,n){try{if("function"==typeof e){var o="function"==typeof e.__u;o&&e.__u(),o&&null==t||(e.__u=e(t))}else e.current=t}catch(e){i.__e(e,n)}}function H(e,t,n){var o,r;if(i.unmount&&i.unmount(e),(o=e.ref)&&(o.current&&o.current!=e.__e||F(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){i.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(r=0;r<o.length;r++)o[r]&&H(o[r],t,n||"function"!=typeof e.type);n||v(e.__e),e.__c=e.__=e.__e=void 0}function V(e,t,n){return this.constructor(e,n)}function U(e,t,n){var r,s,a;t==document&&(t=document.documentElement),i.__&&i.__(e,t),r=!1?null:t.__k,s=[],a=[],
|
|
13
|
+
O(t,e=t.__k=function(e,t,n){var i,r,s,a={};for(s in t)"key"==s?i=t[s]:"ref"==s?r=t[s]:a[s]=t[s];if(arguments.length>2&&(a.children=arguments.length>3?o.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(s in e.defaultProps)null==a[s]&&(a[s]=e.defaultProps[s]);return y(e,a,i,r,null)}(x,null,[e]),r||p,p,t.namespaceURI,r?null:t.firstChild?o.call(t.childNodes):null,s,r?r.__e:t.firstChild,false,a),I(s,e,a)}function q(e){function t(e){var n,o;return this.getChildContext||(n=new Set,(o={})[t.__c]=this,this.getChildContext=function(){return o},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(e){this.props.value!=e.value&&n.forEach((function(e){e.__e=!0,E(e)}))},this.sub=function(e){n.add(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.delete(e),t&&t.call(e)}}),e.children}return t.__c="__cC"+m++,t.__=e,t.Provider=t.__l=(t.Consumer=function(e,t){return e.children(t)}).contextType=t,t}o=g.slice,i={__e:function(e,t,n,o){
|
|
14
|
+
for(var i,r,s;t=t.__;)if((i=t.__c)&&!i.__)try{if((r=i.constructor)&&null!=r.getDerivedStateFromError&&(i.setState(r.getDerivedStateFromError(e)),s=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,o||{}),s=i.__d),s)return i.__E=i}catch(t){e=t}throw e}},r=0,N.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=w({},this.state),"function"==typeof e&&(e=e(w({},n),this.props)),e&&w(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),E(this))},N.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),E(this))},N.prototype.render=x,s=[],l="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},A.__r=0,d=/(PointerCapture)$|Capture$/i,h=0,u=L(!1),f=L(!0),m=0;var z,$,W,j,X=0,K=[],Y=i,G=Y.__b,Q=Y.__r,J=Y.diffed,Z=Y.__c,ee=Y.unmount,te=Y.__;function ne(e,t){Y.__h&&Y.__h($,e,X||t),X=0;var n=$.__H||($.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function oe(e){
|
|
15
|
+
return X=1,function(e,t,n){var o=ne(z++,2);if(o.t=e,!o.__c&&(o.__=[_e(void 0,t),function(e){var t=o.__N?o.__N[0]:o.__[0],n=o.t(t,e);t!==n&&(o.__N=[n,o.__[1]],o.__c.setState({}))}],o.__c=$,!$.__f)){var i=function(e,t,n){if(!o.__c.__H)return!0;var i=o.__c.__H.__.filter((function(e){return!!e.__c}));if(i.every((function(e){return!e.__N})))return!r||r.call(this,e,t,n);var s=o.__c.props!==e;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(s=!0)}})),r&&r.call(this,e,t,n)||s};$.__f=!0;var r=$.shouldComponentUpdate,s=$.componentWillUpdate;$.componentWillUpdate=function(e,t,n){if(this.__e){var o=r;r=void 0,i(e,t,n),r=o}s&&s.call(this,e,t,n)},$.shouldComponentUpdate=i}return o.__N||o.__}(_e,e)}function ie(e,t){var n=ne(z++,3);!Y.__s&&ge(n.__H,t)&&(n.__=e,n.u=t,$.__H.__h.push(n))}function re(e,t){var n=ne(z++,4);!Y.__s&&ge(n.__H,t)&&(n.__=e,n.u=t,$.__h.push(n))}function se(e){return X=5,ae((function(){return{current:e}}),[])}function ae(e,t){var n=ne(z++,7)
|
|
16
|
+
;return ge(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function le(e,t){return X=8,ae((function(){return e}),t)}function ce(e){var t=$.context[e.__c],n=ne(z++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub($)),t.props.value):e.__}function de(){var e=ne(z++,11);if(!e.__){for(var t=$.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var n=t.__m||(t.__m=[0,0]);e.__="P"+n[0]+"-"+n[1]++}return e.__}function he(){for(var e;e=K.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(me),e.__H.__h.forEach(pe),e.__H.__h=[]}catch(t){e.__H.__h=[],Y.__e(t,e.__v)}}Y.__b=function(e){$=null,G&&G(e)},Y.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),te&&te(e,t)},Y.__r=function(e){Q&&Q(e),z=0;var t=($=e.__c).__H;t&&(W===$?(t.__h=[],$.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(me),t.__h.forEach(pe),t.__h=[],z=0)),W=$},Y.diffed=function(e){J&&J(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==K.push(t)&&j===Y.requestAnimationFrame||((j=Y.requestAnimationFrame)||fe)(he)),
|
|
17
|
+
t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),W=$=null},Y.__c=function(e,t){t.some((function(e){try{e.__h.forEach(me),e.__h=e.__h.filter((function(e){return!e.__||pe(e)}))}catch(n){t.some((function(e){e.__h&&(e.__h=[])})),t=[],Y.__e(n,e.__v)}})),Z&&Z(e,t)},Y.unmount=function(e){ee&&ee(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{me(e)}catch(e){t=e}})),n.__H=void 0,t&&Y.__e(t,n.__v))};var ue="function"==typeof requestAnimationFrame;function fe(e){var t,n=function(){clearTimeout(o),ue&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(n,100);ue&&(t=requestAnimationFrame(n))}function me(e){var t=$,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),$=t}function pe(e){var t=$;e.__c=e.__(),$=t}function ge(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function _e(e,t){return"function"==typeof t?t(e):t}function be(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){
|
|
18
|
+
var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class we{constructor(){be(this,"_listeners",void 0),this._listeners=new Map}add(e,t,n,o){e.addEventListener(t,n,o);const i=Symbol();return this._listeners.set(i,{eventTarget:e,eventType:t,listener:n,options:o}),i}remove(e){const t=this._listeners.get(e);if(t){const{eventTarget:n,eventType:o,listener:i,options:r}=t;n.removeEventListener(o,i,r),this._listeners.delete(e)}}removeAll(){this._listeners.forEach((({eventTarget:e,eventType:t,listener:n,options:o})=>{e.removeEventListener(t,n,o)})),this._listeners.clear()}}function ve(e){e.focus()}function ye(e,{autofocus:t=!1,loop:n=!0,horizontal:o=!0,vertical:i=!0,selector:r="a,button",containerVisible:s=!0,focusElement:a=ve}={}){const l=se(null),c=function(e){const t=se({
|
|
19
|
+
callback:e,call:(...e)=>t.current.callback(...e)});return t.current.callback=e,t.current.call}(a);ie((()=>{if(!s)return()=>{};if(!e.current)throw new Error("Container ref not set");const a=e.current,d=()=>{const e=Array.from(a.querySelectorAll(r)).filter((e=>null!==e.offsetParent&&!function(e){return"boolean"==typeof e.disabled&&e.disabled}(e)));return document.activeElement===a&&e.unshift(a),e},h=(e=d(),t=-1,n=!1,o)=>{t<0&&(t=e.findIndex((e=>0===e.tabIndex)))<0&&(t=0);for(const[i,r]of e.entries())r.tabIndex=i===t?0:-1,i===t&&n&&(l.current=r,c(r,o))},u=d(),f=l.current?u.indexOf(l.current):0;h(u,f,t);const m=new we;m.add(a,"focusin",(e=>{if(e.target===a&&l.current)return void c(l.current);const n=d(),o=n.indexOf(e.target);o>=0&&h(n,o,t)})),m.add(a,"keydown",(e=>{const t=d();let r=t.findIndex((e=>0===e.tabIndex)),s=!1;o&&"ArrowLeft"===e.key||i&&"ArrowUp"===e.key?(0===r?r=n?t.length-1:r:--r,s=!0):o&&"ArrowRight"===e.key||i&&"ArrowDown"===e.key?(r===t.length-1?r=n?0:r:++r,s=!0):"Home"===e.key?(r=0,
|
|
20
|
+
s=!0):"End"===e.key&&(r=t.length-1,s=!0),s&&(h(t,r,!0,e),e.preventDefault(),e.stopPropagation())}));const p=new MutationObserver((()=>{h()}));return p.observe(a,{subtree:!0,attributes:!0,attributeFilter:["disabled"],childList:!0}),()=>{m.removeAll(),p.disconnect()}}),[t,e,c,o,n,r,i,s])}function xe(e,t,n){return(t=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var o=n.call(e,t);if("object"!=typeof o)return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}class Ne{constructor(e){xe(this,"_target",void 0),xe(this,"_value",void 0),this._target=e,this._value=null}get current(){return this._value}set current(e){this._value=e,this._updateTarget()}get target(){return this._target}set target(e){e!==this._target&&(this._target=e,this._updateTarget())}
|
|
21
|
+
_updateTarget(){const e=this._value;"function"==typeof this._target?this._target(e):this._target&&(this._target.current=e)}}function Ce(e){const t=se(new Ne(e));return t.current.target=e,t.current}var Se,Ee={exports:{}};var Ae,Re=(Se||(Se=1,Ae=Ee,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var i=arguments[t];i&&(e=o(e,n(i)))}return e}function n(n){if("string"==typeof n||"number"==typeof n)return n;if("object"!=typeof n)return"";if(Array.isArray(n))return t.apply(null,n);if(n.toString!==Object.prototype.toString&&!n.toString.toString().includes("[native code]"))return n.toString();var i="";for(var r in n)e.call(n,r)&&n[r]&&(i=o(i,r));return i}function o(e,t){return t?e?e+" "+t:e+t:e}Ae.exports?(t.default=t,Ae.exports=t):window.classNames=t}()),Ee.exports),ke=t(Re);var Te=0;function Pe(e,t,n,o,r,s){t||(t={});var a,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?a=t[l]:c[l]=t[l];var d={type:e,props:c,key:n,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,
|
|
22
|
+
__v:--Te,__i:-1,__u:0,__source:r,__self:s};if("function"==typeof e&&(a=e.defaultProps))for(l in a)void 0===c[l]&&(c[l]=a[l]);return i.vnode&&i.vnode(d),d}q({}),q({});var Me="/home/runner/work/frontend-shared/frontend-shared/src/components/layout/Card.tsx";function Le({children:e,classes:t,elementRef:n,active:o=!1,variant:i="raised",width:r="full",...s}){return Pe("div",{"data-component":"Card",...s,ref:n,className:ke("rounded-lg border bg-white",{"shadow hover:shadow-md":"raised"===i,"shadow-md":o&&"raised"===i},{"w-full":"full"===r,"w-auto":"auto"===r},t),children:e},void 0,0,{fileName:Me,lineNumber:40,columnNumber:5},this)}var Oe="/home/runner/work/frontend-shared/frontend-shared/src/components/layout/CardContent.tsx";function Ie({children:e,classes:t,elementRef:n,size:o="md",...i}){return Pe("div",{"data-component":"CardContent",...i,ref:n,className:ke({"p-3 space-y-4":"md"===o,"p-2 space-y-3":"sm"===o,"p-4 space-y-6":"lg"===o},t),children:e},void 0,0,{fileName:Oe,lineNumber:29,columnNumber:5},this)}
|
|
23
|
+
var Be="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Annotate.tsx";function De(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"AnnotateIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:Be,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",
|
|
24
24
|
d:"M14 0a2 2 0 0 1 2 2v13a1 1 0 0 1-1.555.832l-4.262-1.757A1 1 0 0 0 9.802 14H2a2 2 0 0 1-2-2V2a2 2 0 0 1 2-2zm-2.109 3.5h-.484l-.14.006-.122.018a.7.7 0 0 0-.2.071l-.076.054-.108.1-.097.1-1.632 1.999-.091.12-.084.129a2.6 2.6 0 0 0-.291.722l-.03.142-.027.218-.009.223v2.646l.01.086.027.08a.54.54 0 0 0 .236.236l.067.028.07.017.074.005h2.907l.074-.005.094-.025a.5.5 0 0 0 .169-.108.5.5 0 0 0 .082-.096l.029-.051.027-.081.01-.086V7.336l-.006-.073-.018-.068a.44.44 0 0 0-.124-.178.6.6 0 0 0-.103-.074l-.055-.026-.087-.024-.092-.009h-.579l-.057-.006-.054-.017a.3.3 0 0 1-.096-.07.2.2 0 0 1-.045-.078l-.004-.04.01-.043.022-.043 1.311-2.227.047-.09.037-.106a.5.5 0 0 0-.06-.394.53.53 0 0 0-.255-.22l-.084-.028-.092-.016zm-5.924 0h-.424l-.121.006-.108.018a.6.6 0 0 0-.174.071l-.067.054-.095.1-.084.1-1.429 1.999-.08.12-.096.174a2.8 2.8 0 0 0-.232.677l-.025.142-.024.218L3 7.402v2.646l.008.086.024.08a.5.5 0 0 0 .097.148q.052.055.11.088l.058.028.062.017.065.005h2.543l.065-.005.082-.025a.515.515 0 0 0 .22-.204l.025-.051.024-.081.008-.086V7.336l-.005-.073-.023-.09a.487.487 0 0 0-.191-.23l-.048-.026-.076-.024-.08-.009H5.46l-.05-.006-.047-.017a.3.3 0 0 1-.084-.07.2.2 0 0 1-.04-.078l-.003-.04.008-.043.02-.043L6.411 4.36l.04-.09.033-.106a.55.55 0 0 0-.053-.394.5.5 0 0 0-.222-.22l-.074-.028-.08-.016z"
|
|
25
25
|
},void 0,0,{fileName:Be,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:Be,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:Be,lineNumber:11,columnNumber:5},this)}var Fe="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Cancel.tsx";function He(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CancelIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:Fe,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"m12.322 5.085-.08.087-2.828 2.827 2.829 2.83a1 1 0 0 1-1.32 1.497l-.095-.083L8 9.414l-2.828 2.829c-.915.914-2.272-.388-1.494-1.328l.08-.087L6.584 8 3.757 5.172a1 1 0 0 1 1.32-1.498l.095.083L8 6.585l2.828-2.828c.886-.885 2.188.309 1.56 1.239z"},void 0,0,{fileName:Fe,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:Fe,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:Fe,lineNumber:11,
|
|
26
26
|
columnNumber:5},this)}var Ve="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/CaretDown.tsx";function Ue(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16","aria-hidden":"true",viewBox:"0 0 16 16","data-component":"CaretDownIcon",...e,children:Pe("g",{"fill-rule":"evenodd",children:[Pe("path",{fill:"none",d:"M0 0h16v16H0z"},void 0,0,{fileName:Ve,lineNumber:21,columnNumber:9},this),Pe("path",{fill:"currentColor",d:"M3.293 5.293a1 1 0 0 1 1.32-.083l.094.083L8 8.585l3.293-3.292a1 1 0 0 1 1.32-.083l.094.083a1 1 0 0 1 .083 1.32l-.083.094-4 4a1 1 0 0 1-1.32.083l-.094-.083-4-4a1 1 0 0 1 0-1.414"},void 0,0,{fileName:Ve,lineNumber:22,columnNumber:9},this)]},void 0,0,{fileName:Ve,lineNumber:20,columnNumber:7},this)},void 0,0,{fileName:Ve,lineNumber:11,columnNumber:5},this)}var qe="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/CaretLeft.tsx";function ze(e){return Pe("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",
|
|
@@ -155,7 +155,7 @@ const{shape:t,anchor:n}=e,o=getComputedStyle(n),i=parseInt(o.borderWidth),r=n.ge
|
|
|
155
155
|
annotation:e,target:t};let n;try{const o=await this._integration.anchor(this.element,t.selector);if(o instanceof Range){const i=go.fromRange(o);n={annotation:e,target:t,region:i}}else n={annotation:e,target:t,region:o}}catch{n={annotation:e,target:t}}return n})));if(!this._annotations.has(e.$tag))return[];for(const e of n)t(e);return e.$orphan=n.length>0&&n.every((e=>e.target.selector&&!e.region)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",e),n}detach(e,t=!0){this._annotations.delete(e);const n=[];for(const t of this.anchors)t.annotation.$tag!==e?n.push(t):t.highlights&&ko(t.highlights);this._updateAnchors(n,t)}_updateAnchors(e,t){this.anchors=e,this._clusterToolbar?.scheduleClusterUpdates(),t&&this._bucketBarClient.update(this.anchors)}async createAnnotation(e){if("selection"===e)return this.createAnnotationFromSelection();if(["rect","point"].includes(e)){const t=await this._drawTool.draw(e),n=await this.getDocumentInfo(),o=[{source:n.uri,
|
|
156
156
|
selector:await this._integration.describe(this.element,t)}],i={uri:n.uri,document:n.metadata,target:o,$tag:"a:"+on(8)};return this._sidebarRPC.call("createAnnotation",i),this.anchor(i),i}throw new Error("Unsupported annotation tool")}async createAnnotationFromSelection({highlight:e=!1}={}){const t=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),o=this.element,i=(await Promise.all(t.map((e=>this._integration.describe(o,e))))).map((e=>({source:n.uri,selector:e}))),r={uri:n.uri,document:n.metadata,target:i,$highlight:e,$cluster:e?"user-highlights":"user-annotations",$tag:"a:"+on(8)};return this._sidebarRPC.call("createAnnotation",r),this.anchor(r),Or(),r}_hoverAnnotations(e){this._hoveredAnnotations.clear(),e.forEach((e=>this._hoveredAnnotations.add(e)));for(const t of this.anchors)if(t.highlights){const n=e.includes(t.annotation.$tag);To(t.highlights,n)}this._sidebarRPC.call("hoverAnnotations",e)}_onSelection(e){const t=this._integration.getAnnotatableRange(e)
|
|
157
157
|
;if(!t)return void this._onClearSelection();const n=document.getSelection(),o=yo(n),i=Co(n);i?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),this._adder.annotationsForSelection=Pr(),this._isAdderVisible=!0,this._adder.show(i,o)):this._onClearSelection()}_onClearSelection(){this._isAdderVisible=!1,this._adder.hide(),this.selectedRanges=[],this._informHostOnNextSelectionClear&&this._hostRPC.call("textUnselected"),this._informHostOnNextSelectionClear=!0}selectAnnotations(e,{toggle:t=!1,focusInSidebar:n=!1}={}){t?this._sidebarRPC.call("toggleAnnotationSelection",e):this._sidebarRPC.call("showAnnotations",e,n),this._sidebarRPC.call("openSidebar")}setHighlightsVisible(e,t=!0){!function(e,t){e.classList.toggle("hypothesis-highlights-always-on",t)}(this.element,e),this._highlightsVisible=e,t&&this._hostRPC.call("highlightsVisibleChanged",e)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(e){this._sidebarLayout=e,this._integration.fitSideBySide(e)}get hoveredAnnotationTags(){
|
|
158
|
-
return this._hoveredAnnotations}_handleShortcut(e){Kn(e,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(e){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new Rr(this.element)),this._outsideAssignmentNotice.setVisible(e)}}function Dr(e,t){const n=new URL(e),o=new URLSearchParams;return o.append("config",JSON.stringify(t)),n.hash=o.toString(),n.toString()}function Fr(e,t){const n={};for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.
|
|
158
|
+
return this._hoveredAnnotations}_handleShortcut(e){Kn(e,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(e){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new Rr(this.element)),this._outsideAssignmentNotice.setVisible(e)}}function Dr(e,t){const n=new URL(e),o=new URLSearchParams;return o.append("config",JSON.stringify(t)),n.hash=o.toString(),n.toString()}function Fr(e,t){const n={};for(const[e,o]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=o&&(n[e]=o);n.origin=new URL(e).origin,n.version="1.1608.0";const o=new URL(window.location.href);if(o.hash="",n.hostURL=o.toString(),Array.isArray(n.services)&&n.services?.length>0){const e=n.services[0];e.onLoginRequest&&(e.onLoginRequestProvided=!0),e.onLogoutRequest&&(e.onLogoutRequestProvided=!0),e.onSignupRequest&&(e.onSignupRequestProvided=!0),e.onProfileRequest&&(e.onProfileRequestProvided=!0),e.onHelpRequest&&(e.onHelpRequestProvided=!0)}return n}
|
|
159
159
|
function Hr({closed:e,onClose:t,children:n,"data-testid":o,"aria-label":i}){const r=se(null);return ie((()=>{e?r.current?.close():r.current?.showModal()}),[e]),ie((()=>{const e=r.current;return e?.addEventListener("cancel",t),()=>{e?.removeEventListener("cancel",t)}}),[t]),Pe("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":o,"aria-label":i,children:n})}function Vr({closed:e,children:t,...n}){return Pe("div",{...n,className:ke("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:e}),children:Pe("div",{className:"relative w-full h-full",children:t})})}function Ur({document_:e=document,...t}){return Pe(ae((()=>function(e){return"function"==typeof e.createElement("dialog").showModal}(e)?Hr:Vr),[e]),{...t})}function qr({config:e,groupId:t}){return Pe("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:Dr(e.notebookAppUrl,{...Fr(e.notebookAppUrl,e),group:t})})}
|
|
160
160
|
function zr({eventBus:e,config:t}){const[n,o]=oe(0),[i,r]=oe(!0),[s,a]=oe(null),l=se(""),c=se(null);ie((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),ie((()=>{document.body.style.overflow=i?l.current:"hidden"}),[i]),ie((()=>{const t=e.createEmitter();return t.subscribe("openNotebook",(e=>{r(!1),o((e=>e+1)),a(e)})),c.current=t,()=>{t.destroy()}}),[e]);const d=le((()=>{r(!0),c.current?.publish("closeNotebook")}),[]);return null===s?null:Pe(Ur,{closed:i,onClose:d,"data-testid":"notebook-outer","aria-label":"Hypothesis notebook",children:[Pe("div",{className:"absolute right-0 m-3",children:Pe(Rt,{title:"Close notebook",onClick:d,variant:"dark",classes:ke("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:Pe(He,{className:"w-4 h-4"})})}),Pe(qr,{config:t,groupId:s},n)]})}class $r{constructor(e,t,n){this._container=new oo("notebook",(()=>Pe(zr,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){
|
|
161
161
|
this._container.destroy()}}function Wr({eventBus:e,config:t}){const[n,o]=oe(!0),i=se(null);ie((()=>{const t=e.createEmitter();return t.subscribe("openProfile",(()=>{o(!1)})),i.current=t,()=>{t.destroy()}}),[e]);const r=()=>{o(!0),i.current?.publish("closeProfile")};return n?null:Pe(Ur,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[Pe("div",{className:"absolute right-0 m-3",children:Pe(Rt,{title:"Close profile dialog",onClick:r,variant:"dark",classes:ke("!bg-transparent enabled:hover:!bg-grey-3"),children:Pe(He,{className:"w-4 h-4"})})}),Pe("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:t.profileAppUrl})]})}class jr{constructor(e,t,n){this._container=new oo("profile",(()=>Pe(Wr,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function Xr({above:e,below:t,buckets:n,onFocusAnnotations:o,onScrollToAnnotation:i,onSelectAnnotations:r}){
|