hypothesis 1.1509.0 → 1.1511.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 +13 -13
- package/build/scripts/annotator.bundle.js +7 -7
- package/build/scripts/annotator.bundle.js.map +1 -1
- package/build/scripts/sidebar.bundle.js +72 -72
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/scripts/ui-playground.bundle.js +601 -600
- package/build/scripts/ui-playground.bundle.js.map +1 -1
- package/build/styles/annotator.css +4 -1
- package/build/styles/annotator.css.map +1 -1
- package/build/styles/sidebar.css +4 -1
- package/build/styles/sidebar.css.map +1 -1
- package/build/styles/ui-playground.css +4 -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?e70b8c","styles/annotator.css":"styles/annotator.css?102c6c","styles/annotator.css.map":"styles/annotator.css.map?0d45db","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?58e394","styles/katex.min.css.map":"styles/katex.min.css.map?1785d7","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?c7c009","styles/sidebar.css":"styles/sidebar.css?2d32d5","styles/ui-playground.css.map":"styles/ui-playground.css.map?696708","styles/ui-playground.css":"styles/ui-playground.css?a495e1","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?c38a7f","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?b2f8d1","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?0419ae","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?8546a5","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?4476d6"};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.1511.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/.")}();
|
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?e70b8c",
|
|
3
|
+
"styles/annotator.css": "styles/annotator.css?102c6c",
|
|
4
|
+
"styles/annotator.css.map": "styles/annotator.css.map?0d45db",
|
|
5
5
|
"styles/highlights.css": "styles/highlights.css?6b4ebd",
|
|
6
6
|
"styles/highlights.css.map": "styles/highlights.css.map?241350",
|
|
7
|
-
"styles/katex.min.css.map": "styles/katex.min.css.map?1785d7",
|
|
8
7
|
"styles/katex.min.css": "styles/katex.min.css?58e394",
|
|
8
|
+
"styles/katex.min.css.map": "styles/katex.min.css.map?1785d7",
|
|
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.map": "styles/sidebar.css.map?
|
|
12
|
-
"styles/
|
|
13
|
-
"styles/ui-playground.css.map": "styles/ui-playground.css.map?
|
|
14
|
-
"styles/
|
|
15
|
-
"scripts/
|
|
16
|
-
"scripts/
|
|
17
|
-
"scripts/
|
|
18
|
-
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?
|
|
19
|
-
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?
|
|
11
|
+
"styles/sidebar.css.map": "styles/sidebar.css.map?c7c009",
|
|
12
|
+
"styles/sidebar.css": "styles/sidebar.css?2d32d5",
|
|
13
|
+
"styles/ui-playground.css.map": "styles/ui-playground.css.map?696708",
|
|
14
|
+
"styles/ui-playground.css": "styles/ui-playground.css?a495e1",
|
|
15
|
+
"scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?c38a7f",
|
|
16
|
+
"scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?b2f8d1",
|
|
17
|
+
"scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?0419ae",
|
|
18
|
+
"scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?8546a5",
|
|
19
|
+
"scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?4476d6"
|
|
20
20
|
}
|
|
@@ -17,12 +17,12 @@ defaultValue:null,getValue:$},group:{allowInBrowserExt:!0,defaultValue:null,getV
|
|
|
17
17
|
getValue:$},externalContainerSelector:{allowInBrowserExt:!1,defaultValue:null,getValue:$},sideBySide:{allowInBrowserExt:!0,getValue:e=>e.sideBySide}};function j(e,t=window){const n=W(t),i={};for(const r of function(e){const t={annotator:["clientUrl","contentInfoBanner","contentReady","subFrameIdentifier","sideBySide"],sidebar:["appType","annotations","branding","bucketContainerSelector","enableExperimentalNewNoteButton","externalContainerSelector","focus","group","onLayoutChange","openSidebar","query","requestConfigFromFrame","services","showHighlights","sidebarAppUrl","theme","usernameUrl"],notebook:["branding","group","notebookAppUrl","requestConfigFromFrame","services","theme","usernameUrl"],profile:["profileAppUrl"]};return"all"===e?Object.values(t).flat():t[e]}(e)){const e=z[r],s=void 0!==e.defaultValue,a=!((o=U(t,"sidebar","html")).startsWith("http://")||o.startsWith("https://"));if(!e.allowInBrowserExt&&a){s&&(i[r]=e.defaultValue);continue}const l=e.getValue(n,r)
|
|
18
18
|
;void 0!==l?i[r]=e.coerce?e.coerce(l):l:s&&(i[r]=e.defaultValue)}var o;return i}var X,Y,K,G,Q,Z,J,ee,te,ne,ie,oe={},re=[],se=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ae=Array.isArray;function le(e,t){for(var n in t)e[n]=t[n];return e}function ce(e){var t=e.parentNode;t&&t.removeChild(e)}function he(e,t,n,i,o){var r={type:e,props:t,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++K:o,__i:-1,__u:0};return null==o&&null!=Y.vnode&&Y.vnode(r),r}function ue(e){return e.children}function de(e,t){this.props=e,this.context=t}function fe(e,t){if(null==t)return e.__?fe(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?fe(e):null}function pe(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}return pe(e)}}function me(e){
|
|
19
19
|
(!e.__d&&(e.__d=!0)&&G.push(e)&&!ge.__r++||Q!==Y.debounceRendering)&&((Q=Y.debounceRendering)||Z)(ge)}function ge(){var e,t,n,i,o,r,s,a;for(G.sort(J);e=G.shift();)e.__d&&(t=G.length,i=void 0,r=(o=(n=e).__v).__e,s=[],a=[],n.__P&&((i=le({},o)).__v=o.__v+1,Y.vnode&&Y.vnode(i),Ce(n.__P,i,o,n.__n,n.__P.namespaceURI,32&o.__u?[r]:null,s,null==r?fe(o):r,!!(32&o.__u),a),i.__v=o.__v,i.__.__k[i.__i]=i,Se(s,i,a),i.__e!=r&&pe(i)),G.length>t&&G.sort(J));ge.__r=0}function _e(e,t,n,i,o,r,s,a,l,c,h){var u,d,f,p,m,g=i&&i.__k||re,_=t.length;for(n.__d=l,function(e,t,n){var i,o,r,s,a,l=t.length,c=n.length,h=c,u=0;for(e.__k=[],i=0;i<l;i++)s=i+u,null!=(o=e.__k[i]=null==(o=t[i])||"boolean"==typeof o||"function"==typeof o?null:"string"==typeof o||"number"==typeof o||"bigint"==typeof o||o.constructor==String?he(null,o,null,null,null):ae(o)?he(ue,{children:o},null,null,null):void 0===o.constructor&&o.__b>0?he(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o)?(o.__=e,o.__b=e.__b+1,a=be(o,n,s,h),o.__i=a,r=null,-1!==a&&(h--,
|
|
20
|
-
(r=n[a])&&(r.__u|=131072)),null==r||null===r.__v?(-1==a&&u--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a==s-1?u
|
|
21
|
-
;do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function be(e,t,n,i){var o=e.key,r=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&o==l.key&&r===l.type&&0==(131072&l.__u))return n;if(i>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&o==l.key&&r===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&o==l.key&&r===l.type)return a;a++}}return-1}function ye(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||se.test(t)?n:n+"px"}function we(e,t,n,i,o){var r;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||ye(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||ye(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$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,
|
|
22
|
-
e.addEventListener(t,r?ne:te,r)):e.removeEventListener(t,r?ne:te,r);else{if("http://www.w3.org/2000/svg"==o)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{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 xe(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=ee++;else if(t.t<n.u)return;return n(Y.event?Y.event(t):t)}}}function Ce(e,t,n,i,o,r,s,a,l,c){var h,u,d,f,p,m,g,_,v,b,y,w,x,C,S,N,E=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),r=[a=t.__e=n.__e]),(h=Y.__b)&&h(t);e:if("function"==typeof E)try{if(_=t.props,v="prototype"in E&&E.prototype.render,b=(h=E.contextType)&&i[h.__c],y=h?b?b.props.value:h.__:i,
|
|
23
|
-
u.constructor=E,u.render=Te),b&&b.sub(u),u.props=_,u.state||(u.state={}),u.context=y,u.__n=i,d=u.__d=!0,u.__h=[],u._sb=[]),v&&null==u.__s&&(u.__s=u.state),v&&null!=E.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=le({},u.__s)),le(u.__s,E.getDerivedStateFromProps(_,u.__s))),f=u.props,p=u.state,u.__v=t,d)v&&null==E.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),v&&null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(v&&null==E.getDerivedStateFromProps&&_!==f&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(_,y),!u.__e&&(null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(_,u.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(u.props=_,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),w=0;w<u._sb.length;w++)u.__h.push(u._sb[w]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(_,u.__s,y),
|
|
24
|
-
}))}if(u.context=y,u.props=_,u.__P=e,u.__e=!1,x=Y.__r,C=0,v){for(u.state=u.__s,u.__d=!1,x&&x(t),h=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do{u.__d=!1,x&&x(t),h=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++C<25);u.state=u.__s,null!=u.getChildContext&&(i=le(le({},i),u.getChildContext())),v&&!d&&null!=u.getSnapshotBeforeUpdate&&(m=u.getSnapshotBeforeUpdate(f,p)),_e(e,ae(N=null!=h&&h.type===ue&&null==h.key?h.props.children:h)?N:[N],t,n,i,o,r,s,a,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&s.push(u),g&&(u.__E=u.__=null)}catch(e){if(t.__v=null,l||null!=r){for(t.__u|=l?160:32;a&&8===a.nodeType&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,t.__e=a}else t.__e=n.__e,t.__k=n.__k;Y.__e(e,t,n)}else null==r&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Ne(n.__e,t,n,i,o,r,s,l,c);(h=Y.diffed)&&h(t)}function Se(e,t,n){t.__d=void 0
|
|
25
|
-
e.some((function(e){e.call(t)}))}catch(e){Y.__e(e,t.__v)}}))}function Ne(e,t,n,i,o,r,s,a,l){var c,h,u,d,f,p,m,g=n.props,_=t.props,v=t.type;if("svg"===v?o="http://www.w3.org/2000/svg":"math"===v?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=r)for(c=0;c<r.length;c++)if((f=r[c])&&"setAttribute"in f==!!v&&(v?f.localName===v:3===f.nodeType)){e=f,r[c]=null;break}if(null==e){if(null===v)return document.createTextNode(_);e=document.createElementNS(o,v,_.is&&_),r=null,a=!1}if(null===v)g===_||a&&e.data===_||(e.data=_);else{if(r=r&&X.call(e.childNodes),g=n.props||oe,!a&&null!=r)for(g={},c=0;c<e.attributes.length;c++)g[(f=e.attributes[c]).name]=f.value;for(c in g)if(f=g[c],"children"==c);else if("dangerouslySetInnerHTML"==c)u=f;else if("key"!==c&&!(c in _)){if("value"==c&&"defaultValue"in _||"checked"==c&&"defaultChecked"in _)continue;we(e,c,null,f,o)}for(c in _)f=_[c],
|
|
20
|
+
(r=n[a])&&(r.__u|=131072)),null==r||null===r.__v?(-1==a&&u--,"function"!=typeof o.type&&(o.__u|=65536)):a!==s&&(a==s-1?u--:a==s+1?u++:a>s?h>l-s?u+=a-s:u--:a<s&&(a==s-u?u-=a-s:u++),a!==i+u&&(o.__u|=65536))):(r=n[s])&&null==r.key&&r.__e&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=fe(r)),Ae(r,r,!1),n[s]=null,h--);if(h)for(i=0;i<c;i++)null!=(r=n[i])&&0==(131072&r.__u)&&(r.__e==e.__d&&(e.__d=fe(r)),Ae(r,r))}(n,t,g),l=n.__d,u=0;u<_;u++)null!=(f=n.__k[u])&&"boolean"!=typeof f&&"function"!=typeof f&&(d=-1===f.__i?oe:g[f.__i]||oe,f.__i=u,Ce(e,f,d,o,r,s,a,l,c,h),p=f.__e,f.ref&&d.ref!=f.ref&&(d.ref&&Ee(d.ref,null,f),h.push(f.ref,f.__c||p,f)),null==m&&null!=p&&(m=p),65536&f.__u||d.__k===f.__k?l=ve(f,l,e):"function"==typeof f.type&&void 0!==f.__d?l=f.__d:p&&(l=p.nextSibling),f.__d=void 0,f.__u&=-196609);n.__d=l,n.__e=m}function ve(e,t,n){var i,o;if("function"==typeof e.type){for(i=e.__k,o=0;i&&o<i.length;o++)i[o]&&(i[o].__=e,t=ve(i[o],t,n));return t}e.__e!=t&&(t&&e.type&&!n.contains(t)&&(t=fe(e)),
|
|
21
|
+
n.insertBefore(e.__e,t||null),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8===t.nodeType);return t}function be(e,t,n,i){var o=e.key,r=e.type,s=n-1,a=n+1,l=t[n];if(null===l||l&&o==l.key&&r===l.type&&0==(131072&l.__u))return n;if(i>(null!=l&&0==(131072&l.__u)?1:0))for(;s>=0||a<t.length;){if(s>=0){if((l=t[s])&&0==(131072&l.__u)&&o==l.key&&r===l.type)return s;s--}if(a<t.length){if((l=t[a])&&0==(131072&l.__u)&&o==l.key&&r===l.type)return a;a++}}return-1}function ye(e,t,n){"-"===t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||se.test(t)?n:n+"px"}function we(e,t,n,i,o){var r;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof i&&(e.style.cssText=i=""),i)for(t in i)n&&t in n||ye(e.style,t,"");if(n)for(t in n)i&&n[t]===i[t]||ye(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])r=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$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,
|
|
22
|
+
n?i?n.u=i.u:(n.u=ee,e.addEventListener(t,r?ne:te,r)):e.removeEventListener(t,r?ne:te,r);else{if("http://www.w3.org/2000/svg"==o)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{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 xe(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=ee++;else if(t.t<n.u)return;return n(Y.event?Y.event(t):t)}}}function Ce(e,t,n,i,o,r,s,a,l,c){var h,u,d,f,p,m,g,_,v,b,y,w,x,C,S,N,E=t.type;if(void 0!==t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),r=[a=t.__e=n.__e]),(h=Y.__b)&&h(t);e:if("function"==typeof E)try{if(_=t.props,v="prototype"in E&&E.prototype.render,b=(h=E.contextType)&&i[h.__c],y=h?b?b.props.value:h.__:i,
|
|
23
|
+
n.__c?g=(u=t.__c=n.__c).__=u.__E:(v?t.__c=u=new E(_,y):(t.__c=u=new de(_,y),u.constructor=E,u.render=Te),b&&b.sub(u),u.props=_,u.state||(u.state={}),u.context=y,u.__n=i,d=u.__d=!0,u.__h=[],u._sb=[]),v&&null==u.__s&&(u.__s=u.state),v&&null!=E.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=le({},u.__s)),le(u.__s,E.getDerivedStateFromProps(_,u.__s))),f=u.props,p=u.state,u.__v=t,d)v&&null==E.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),v&&null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(v&&null==E.getDerivedStateFromProps&&_!==f&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(_,y),!u.__e&&(null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(_,u.__s,y)||t.__v===n.__v)){for(t.__v!==n.__v&&(u.props=_,u.state=u.__s,u.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),w=0;w<u._sb.length;w++)u.__h.push(u._sb[w]);u._sb=[],u.__h.length&&s.push(u);break e}null!=u.componentWillUpdate&&u.componentWillUpdate(_,u.__s,y),
|
|
24
|
+
v&&null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(f,p,m)}))}if(u.context=y,u.props=_,u.__P=e,u.__e=!1,x=Y.__r,C=0,v){for(u.state=u.__s,u.__d=!1,x&&x(t),h=u.render(u.props,u.state,u.context),S=0;S<u._sb.length;S++)u.__h.push(u._sb[S]);u._sb=[]}else do{u.__d=!1,x&&x(t),h=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++C<25);u.state=u.__s,null!=u.getChildContext&&(i=le(le({},i),u.getChildContext())),v&&!d&&null!=u.getSnapshotBeforeUpdate&&(m=u.getSnapshotBeforeUpdate(f,p)),_e(e,ae(N=null!=h&&h.type===ue&&null==h.key?h.props.children:h)?N:[N],t,n,i,o,r,s,a,l,c),u.base=t.__e,t.__u&=-161,u.__h.length&&s.push(u),g&&(u.__E=u.__=null)}catch(e){if(t.__v=null,l||null!=r){for(t.__u|=l?160:32;a&&8===a.nodeType&&a.nextSibling;)a=a.nextSibling;r[r.indexOf(a)]=null,t.__e=a}else t.__e=n.__e,t.__k=n.__k;Y.__e(e,t,n)}else null==r&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=Ne(n.__e,t,n,i,o,r,s,l,c);(h=Y.diffed)&&h(t)}function Se(e,t,n){t.__d=void 0
|
|
25
|
+
;for(var i=0;i<n.length;i++)Ee(n[i],n[++i],n[++i]);Y.__c&&Y.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Y.__e(e,t.__v)}}))}function Ne(e,t,n,i,o,r,s,a,l){var c,h,u,d,f,p,m,g=n.props,_=t.props,v=t.type;if("svg"===v?o="http://www.w3.org/2000/svg":"math"===v?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),null!=r)for(c=0;c<r.length;c++)if((f=r[c])&&"setAttribute"in f==!!v&&(v?f.localName===v:3===f.nodeType)){e=f,r[c]=null;break}if(null==e){if(null===v)return document.createTextNode(_);e=document.createElementNS(o,v,_.is&&_),r=null,a=!1}if(null===v)g===_||a&&e.data===_||(e.data=_);else{if(r=r&&X.call(e.childNodes),g=n.props||oe,!a&&null!=r)for(g={},c=0;c<e.attributes.length;c++)g[(f=e.attributes[c]).name]=f.value;for(c in g)if(f=g[c],"children"==c);else if("dangerouslySetInnerHTML"==c)u=f;else if("key"!==c&&!(c in _)){if("value"==c&&"defaultValue"in _||"checked"==c&&"defaultChecked"in _)continue;we(e,c,null,f,o)}for(c in _)f=_[c],
|
|
26
26
|
"children"==c?d=f:"dangerouslySetInnerHTML"==c?h=f:"value"==c?p=f:"checked"==c?m=f:"key"===c||a&&"function"!=typeof f||g[c]===f||we(e,c,f,g[c],o);if(h)a||u&&(h.__html===u.__html||h.__html===e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(u&&(e.innerHTML=""),_e(e,ae(d)?d:[d],t,n,i,"foreignObject"===v?"http://www.w3.org/1999/xhtml":o,r,s,r?r[0]:n.__k&&fe(n,0),a,l),null!=r)for(c=r.length;c--;)null!=r[c]&&ce(r[c]);a||(c="value",void 0!==p&&(p!==e[c]||"progress"===v&&!p||"option"===v&&p!==g[c])&&we(e,c,p,g[c],o),c="checked",void 0!==m&&m!==e[c]&&we(e,c,m,g[c],o))}return e}function Ee(e,t,n){try{if("function"==typeof e){var i="function"==typeof e.__u;i&&e.__u(),i&&null==t||(e.__u=e(t))}else e.current=t}catch(e){Y.__e(e,n)}}function Ae(e,t,n){var i,o;if(Y.unmount&&Y.unmount(e),(i=e.ref)&&(i.current&&i.current!==e.__e||Ee(i,null,t)),null!=(i=e.__c)){if(i.componentWillUnmount)try{i.componentWillUnmount()}catch(e){Y.__e(e,t)}i.base=i.__P=null}
|
|
27
27
|
if(i=e.__k)for(o=0;o<i.length;o++)i[o]&&Ae(i[o],t,n||"function"!=typeof e.type);n||null==e.__e||ce(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function Te(e,t,n){return this.constructor(e,n)}function ke(e,t,n){var i,o,r,s;Y.__&&Y.__(e,t),o=(i="function"==typeof n)?null:t.__k,r=[],s=[],Ce(t,e=(!i&&n||t).__k=function(e,t,n){var i,o,r,s={};for(r in t)"key"==r?i=t[r]:"ref"==r?o=t[r]:s[r]=t[r];if(arguments.length>2&&(s.children=arguments.length>3?X.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===s[r]&&(s[r]=e.defaultProps[r]);return he(e,s,i,o,null)}(ue,null,[e]),o||oe,oe,t.namespaceURI,!i&&n?[n]:o?null:t.firstChild?X.call(t.childNodes):null,r,!i&&n?n:o?o.__e:t.firstChild,i,s),Se(r,e,s)}function Re(e,t){var n={__c:t="__cC"+ie++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,i;return this.getChildContext||(n=[],(i={})[t]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){n=null},
|
|
28
28
|
this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some((function(e){e.__e=!0,me(e)}))},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n&&n.splice(n.indexOf(e),1),t&&t.call(e)}}),e.children}};return n.Provider.__=n.Consumer.contextType=n}X=re.slice,Y={__e:function(e,t,n,i){for(var o,r,s;t=t.__;)if((o=t.__c)&&!o.__)try{if((r=o.constructor)&&null!=r.getDerivedStateFromError&&(o.setState(r.getDerivedStateFromError(e)),s=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,i||{}),s=o.__d),s)return o.__E=o}catch(t){e=t}throw e}},K=0,de.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=le({},this.state),"function"==typeof e&&(e=e(le({},n),this.props)),e&&le(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),me(this))},de.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),me(this))},de.prototype.render=ue,G=[],
|
|
@@ -135,7 +135,7 @@ this._sidebarRPC.on("loadAnnotations",(async e=>{try{await Promise.all(e.map((e=
|
|
|
135
135
|
;const t=e=>{const t=_r(e);if(!t)return;const n=Qn(t,e.annotation?.$cluster);n.forEach((t=>{t._annotation=e.annotation})),e.highlights=n,this._hoveredAnnotations.has(e.annotation.$tag)&&ei(n,!0)};this.detach(e.$tag,!1),this._annotations.add(e.$tag),e.target||(e.target=[]);const n=await Promise.all(e.target.map((async t=>{if(!t.selector||!t.selector.some((e=>"TextQuoteSelector"===e.type)))return{annotation:e,target:t};let n;try{const i=await this._integration.anchor(this.element,t.selector),o=Vn.fromRange(i);n={annotation:e,target:t,range:o}}catch(i){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.range)),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&&Jn(t.highlights);this._updateAnchors(n,t)}_updateAnchors(e,t){
|
|
136
136
|
this.anchors=e,this._clusterToolbar?.scheduleClusterUpdates(),t&&this._bucketBarClient.update(this.anchors)}async createAnnotation({highlight:e=!1}={}){const t=this.selectedRanges;this.selectedRanges=[];const n=await this.getDocumentInfo(),i=this.element,r=(await Promise.all(t.map((e=>this._integration.describe(i,e))))).map((e=>({source:n.uri,selector:e}))),s={uri:n.uri,document:n.metadata,target:r,$highlight:e,$cluster:e?"user-highlights":"user-annotations",$tag:"a:"+o(8)};return this._sidebarRPC.call("createAnnotation",s),this.anchor(s),vr(),s}_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);ei(t.highlights,n)}this._sidebarRPC.call("hoverAnnotations",e)}_onSelection(e){const t=this._integration.getAnnotatableRange(e);if(!t)return void this._onClearSelection();const n=document.getSelection(),i=zn(n),o=Yn(n);o?(this.selectedRanges=[t],this._hostRPC.call("textSelected"),
|
|
137
137
|
this._adder.annotationsForSelection=mr(),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(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(){return this._hoveredAnnotations}_handleShortcut(e){st(e,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(e){
|
|
138
|
-
this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new dr(this.element)),this._outsideAssignmentNotice.setVisible(e)}}function wr(e,t){const n=new URL(e),i=new URLSearchParams;return i.append("config",JSON.stringify(t)),n.hash=i.toString(),n.toString()}function xr(e,t){const n={};for(const[e,i]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=i&&(n[e]=i);n.origin=new URL(e).origin,n.version="1.
|
|
138
|
+
this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new dr(this.element)),this._outsideAssignmentNotice.setVisible(e)}}function wr(e,t){const n=new URL(e),i=new URLSearchParams;return i.append("config",JSON.stringify(t)),n.hash=i.toString(),n.toString()}function xr(e,t){const n={};for(const[e,i]of Object.entries(t))"notebookAppUrl"!==e&&"sidebarAppUrl"!==e&&null!=i&&(n[e]=i);n.origin=new URL(e).origin,n.version="1.1511.0";const i=new URL(window.location.href);if(i.hash="",n.hostURL=i.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}function Cr({closed:e,onClose:t,children:n,"data-testid":i,"aria-label":o}){const r=Ye(null);return je((()=>{e?r.current?.close():r.current?.showModal()}),[e]),je((()=>{const e=r.current
|
|
139
139
|
;return e?.addEventListener("cancel",t),()=>{e?.removeEventListener("cancel",t)}}),[t]),bt("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":i,"aria-label":o,children:n})}function Sr({closed:e,children:t,...n}){return bt("div",{...n,className:_t("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:e}),children:bt("div",{className:"relative w-full h-full",children:t})})}function Nr({document_:e=document,...t}){return bt(Ke((()=>function(e){return"function"==typeof e.createElement("dialog").showModal}(e)?Cr:Sr),[e]),{...t})}function Er({config:e,groupId:t}){return bt("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:wr(e.notebookAppUrl,{...xr(e.notebookAppUrl,e),group:t})})}function Ar({eventBus:e,config:t}){const[n,i]=ze(0),[o,r]=ze(!0),[s,a]=ze(null),l=Ye(""),c=Ye(null);je((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),je((()=>{
|
|
140
140
|
document.body.style.overflow=o?l.current:"hidden"}),[o]),je((()=>{const t=e.createEmitter();return t.subscribe("openNotebook",(e=>{r(!1),i((e=>e+1)),a(e)})),c.current=t,()=>{t.destroy()}}),[e]);const h=Ge((()=>{r(!0),c.current?.publish("closeNotebook")}),[]);return null===s?null:bt(Nr,{closed:o,onClose:h,"data-testid":"notebook-outer","aria-label":"Hypothesis notebook",children:[bt("div",{className:"absolute right-0 m-3",children:bt(rn,{title:"Close notebook",onClick:h,variant:"dark",classes:_t("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:bt(At,{className:"w-4 h-4"})})}),bt(Er,{config:t,groupId:s},n)]})}class Tr{constructor(e,t,n){this._container=new Tn("notebook",(()=>bt(Ar,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function kr({eventBus:e,config:t}){const[n,i]=ze(!0),o=Ye(null);je((()=>{const t=e.createEmitter();return t.subscribe("openProfile",(()=>{i(!1)})),o.current=t,()=>{t.destroy()}
|
|
141
141
|
}),[e]);const r=()=>{i(!0),o.current?.publish("closeProfile")};return n?null:bt(Nr,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[bt("div",{className:"absolute right-0 m-3",children:bt(rn,{title:"Close profile dialog",onClick:r,variant:"dark",classes:_t("!bg-transparent enabled:hover:!bg-grey-3"),children:bt(At,{className:"w-4 h-4"})})}),bt("iframe",{title:"Hypothesis profile",className:"h-full w-full border-0",src:t.profileAppUrl})]})}class Rr{constructor(e,t,n){this._container=new Tn("profile",(()=>bt(kr,{eventBus:t,config:n}))),e.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}var Pr={exports:{}};!function(e){!function(t,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(e,t,n){return setTimeout(b(e,n),t)}function f(e,t,n){return!!Array.isArray(e)&&(p(e,n[t],n),!0)}function p(e,t,n){var i
|