hypothesis 1.1479.0 → 1.1480.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?8e9240","styles/annotator.css":"styles/annotator.css?46da94","styles/annotator.css.map":"styles/annotator.css.map?b9addc","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?cf6da0","styles/katex.min.css.map":"styles/katex.min.css.map?8b4c15","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?d811d1","styles/ui-playground.css.map":"styles/ui-playground.css.map?7b5350","styles/ui-playground.css":"styles/ui-playground.css?b7fb6a","styles/sidebar.css":"styles/sidebar.css?83c466","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?4ff7c7","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?fb68b8","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?215757","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?27a210","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?00ecbb"};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.1479.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?2d3da4","styles/annotator.css":"styles/annotator.css?46da94","styles/annotator.css.map":"styles/annotator.css.map?b9addc","styles/highlights.css":"styles/highlights.css?6b4ebd","styles/highlights.css.map":"styles/highlights.css.map?241350","styles/katex.min.css":"styles/katex.min.css?cf6da0","styles/katex.min.css.map":"styles/katex.min.css.map?8b4c15","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?83c466","styles/sidebar.css.map":"styles/sidebar.css.map?d811d1","styles/ui-playground.css.map":"styles/ui-playground.css.map?7b5350","styles/ui-playground.css":"styles/ui-playground.css?b7fb6a","scripts/ui-playground.bundle.js":"scripts/ui-playground.bundle.js?215757","scripts/annotator.bundle.js.map":"scripts/annotator.bundle.js.map?fb68b8","scripts/sidebar.bundle.js":"scripts/sidebar.bundle.js?ab1b1e","scripts/ui-playground.bundle.js.map":"scripts/ui-playground.bundle.js.map?27a210","scripts/sidebar.bundle.js.map":"scripts/sidebar.bundle.js.map?09a32a"};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),p=a(l.assetRoot||"https://cdn.hypothes.is/hypothesis/1.1480.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,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,u=a(d.notebookAppUrl||"https://hypothes.is/notebook"),h=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),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 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:u,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,5 +1,5 @@
1
1
  {
2
- "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?8e9240",
2
+ "scripts/annotator.bundle.js": "scripts/annotator.bundle.js?2d3da4",
3
3
  "styles/annotator.css": "styles/annotator.css?46da94",
4
4
  "styles/annotator.css.map": "styles/annotator.css.map?b9addc",
5
5
  "styles/highlights.css": "styles/highlights.css?6b4ebd",
@@ -8,13 +8,13 @@
8
8
  "styles/katex.min.css.map": "styles/katex.min.css.map?8b4c15",
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?83c466",
11
12
  "styles/sidebar.css.map": "styles/sidebar.css.map?d811d1",
12
13
  "styles/ui-playground.css.map": "styles/ui-playground.css.map?7b5350",
13
14
  "styles/ui-playground.css": "styles/ui-playground.css?b7fb6a",
14
- "styles/sidebar.css": "styles/sidebar.css?83c466",
15
- "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?4ff7c7",
16
- "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?fb68b8",
17
15
  "scripts/ui-playground.bundle.js": "scripts/ui-playground.bundle.js?215757",
16
+ "scripts/annotator.bundle.js.map": "scripts/annotator.bundle.js.map?fb68b8",
17
+ "scripts/sidebar.bundle.js": "scripts/sidebar.bundle.js?ab1b1e",
18
18
  "scripts/ui-playground.bundle.js.map": "scripts/ui-playground.bundle.js.map?27a210",
19
- "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?00ecbb"
19
+ "scripts/sidebar.bundle.js.map": "scripts/sidebar.bundle.js.map?09a32a"
20
20
  }
@@ -139,7 +139,7 @@ this._sidebarRPC.on("scrollToAnnotation",(t=>{this._scrollToAnnotation(t)})),thi
139
139
  this._selectionObserver.disconnect(),this._adder.destroy(),this._bucketBarClient.destroy(),null===(t=this._clusterToolbar)||void 0===t||t.destroy(),null===(e=this._outsideAssignmentNotice)||void 0===e||e.destroy(),function(t){Jn(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=_r(t);if(!n)return;const i=Qn(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)&&ti(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=Vn.fromRange(i);n={annotation:t,target:e,range:o}}catch(i){n={
140
140
  annotation:t,target:e}}return n})));if(!this._annotations.has(t.$tag))return[];for(const t of n)e(t);return t.$orphan=n.length>0&&n.every((t=>t.target.selector&&!t.range)),this._updateAnchors(this.anchors.concat(n),!0),this._sidebarRPC.call("syncAnchoringStatus",t),n}detach(t,e=!0){this._annotations.delete(t);const n=[];for(const e of this.anchors)e.annotation.$tag!==t?n.push(e):e.highlights&&Jn(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}))),r={uri:n.uri,document:n.metadata,target:o,$highlight:t,$cluster:t?"user-highlights":"user-annotations",$tag:"a:"+s(8)};return this._sidebarRPC.call("createAnnotation",r),
141
141
  this.anchor(r),vr(),r}_hoverAnnotations(t){this._hoveredAnnotations.clear(),t.forEach((t=>this._hoveredAnnotations.add(t)));for(const e of this.anchors)if(e.highlights){const n=t.includes(e.annotation.$tag);ti(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=$n(n),o=Yn(n);o?(this.selectedRanges=[e],this._hostRPC.call("textSelected"),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(t,{toggle:e=!1,focusInSidebar:n=!1}={}){e?this._sidebarRPC.call("toggleAnnotationSelection",t):this._sidebarRPC.call("showAnnotations",t,n),this._sidebarRPC.call("openSidebar")}
142
- setHighlightsVisible(t,e=!0){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){ae(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(t){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new dr(this.element)),this._outsideAssignmentNotice.setVisible(t)}}function wr(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function xr(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.1479.0";const o=new URL(window.location.href);if(o.hash="",
142
+ setHighlightsVisible(t,e=!0){!function(t,e){t.classList.toggle("hypothesis-highlights-always-on",e)}(this.element,t),this._highlightsVisible=t,e&&this._hostRPC.call("highlightsVisibleChanged",t)}get highlightsVisible(){return this._highlightsVisible}fitSideBySide(t){this._sidebarLayout=t,this._integration.fitSideBySide(t)}get hoveredAnnotationTags(){return this._hoveredAnnotations}_handleShortcut(t){ae(t,"Ctrl+Shift+H")&&this.setHighlightsVisible(!this._highlightsVisible)}_setOutsideAssignmentNoticeVisible(t){this._outsideAssignmentNotice||(this._outsideAssignmentNotice=new dr(this.element)),this._outsideAssignmentNotice.setVisible(t)}}function wr(t,e){const n=new URL(t),i=new URLSearchParams;return i.append("config",JSON.stringify(e)),n.hash=i.toString(),n.toString()}function xr(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.1480.0";const o=new URL(window.location.href);if(o.hash="",
143
143
  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),t.onProfileRequest&&(t.onProfileRequestProvided=!0),t.onHelpRequest&&(t.onHelpRequestProvided=!0)}return i}function Cr({closed:t,onClose:e,children:n,"data-testid":i,"aria-label":o}){const r=Gt(null);return Xt((()=>{var e,n;t?null===(e=r.current)||void 0===e||e.close():null===(n=r.current)||void 0===n||n.showModal()}),[t]),Xt((()=>{const t=r.current;return null==t||t.addEventListener("cancel",e),()=>{null==t||t.removeEventListener("cancel",e)}}),[e]),ye("dialog",{ref:r,className:"relative w-full h-full backdrop:bg-black/50","data-testid":i,"aria-label":o,children:n})}function Sr({closed:t,children:e,...n}){return ye("div",{...n,className:ve("fixed z-max top-0 left-0 right-0 bottom-0 p-3 bg-black/50",{hidden:t}),children:ye("div",{
144
144
  className:"relative w-full h-full",children:e})})}function Nr({document_:t=document,...e}){return ye(Kt((()=>function(t){return"function"==typeof t.createElement("dialog").showModal}(t)?Cr:Sr),[t]),{...e})}function Er({config:t,groupId:e}){return ye("iframe",{title:"Hypothesis annotation notebook",className:"h-full w-full border-0",allow:"fullscreen; clipboard-write",src:wr(t.notebookAppUrl,{...xr(t.notebookAppUrl,t),group:e})})}function Ar({eventBus:t,config:e}){const[n,i]=jt(0),[o,r]=jt(!0),[s,a]=jt(null),l=Gt(""),c=Gt(null);Xt((()=>(l.current=document.body.style.overflow,()=>{document.body.style.overflow=l.current})),[]),Xt((()=>{document.body.style.overflow=o?l.current:"hidden"}),[o]),Xt((()=>{const e=t.createEmitter();return e.subscribe("openNotebook",(t=>{r(!1),i((t=>t+1)),a(t)})),c.current=e,()=>{e.destroy()}}),[t]);const h=Qt((()=>{var t;r(!0),null===(t=c.current)||void 0===t||t.publish("closeNotebook")}),[]);return null===s?null:ye(Nr,{closed:o,onClose:h,"data-testid":"notebook-outer",
145
145
  "aria-label":"Hypothesis notebook",children:[ye("div",{className:"absolute right-0 m-3",children:ye(sn,{title:"Close notebook",onClick:h,variant:"dark",classes:ve("!bg-transparent enabled:hover:!bg-grey-3"),"data-testid":"close-button",children:ye(Te,{className:"w-4 h-4"})})}),ye(Er,{config:e,groupId:s},n)]})}class Tr{constructor(t,e,n){i(this,"_container",void 0),this._container=new Tn("notebook",(()=>ye(Ar,{eventBus:e,config:n}))),t.append(this._container.element),this._container.render()}destroy(){this._container.destroy()}}function kr({eventBus:t,config:e}){const[n,i]=jt(!0),o=Gt(null);Xt((()=>{const e=t.createEmitter();return e.subscribe("openProfile",(()=>{i(!1)})),o.current=e,()=>{e.destroy()}}),[t]);const r=()=>{var t;i(!0),null===(t=o.current)||void 0===t||t.publish("closeProfile")};return n?null:ye(Nr,{closed:n,onClose:r,"data-testid":"profile-outer","aria-label":"Hypothesis profile",children:[ye("div",{className:"absolute right-0 m-3",children:ye(sn,{title:"Close profile dialog",onClick:r,
@@ -152,20 +152,20 @@ const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.obser
152
152
  ;let n=t[2];const r=new URLSearchParams(e.search);let o=r.get("start"),i=r.get("end");if(!o){const e=n.match(/\/start\/([^/]+)/);e&&(o=e[1],n=n.replace(e[0],""))}if(!i){const e=n.match(/\/end\/([^/]+)/);e&&(i=e[1],n=n.replace(e[0],""))}const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),As(a.href)},function(e){return e.pathname.endsWith(".mp3")||e.pathname.endsWith(".ogg")||e.pathname.endsWith(".wav")?function(e){const t=document.createElement("audio");return t.controls=!0,t.src=e,t}(e.href):null}];function Is(e){if(e.href!==e.textContent)try{const t=encodeURI(e.textContent);if(e.href!==t)return null}catch{return null}const t=function(e){let t,n;for(n=0;n<Ms.length;n++)if(t=Ms[n](e),t)return t;return null}(e);return t&&e.parentElement.replaceChild(t,e),t}const{entries:zs,setPrototypeOf:Ls,isFrozen:Os,getPrototypeOf:Rs,getOwnPropertyDescriptor:Ps}=Object
153
153
  ;let{freeze:Ds,seal:Fs,create:Bs}=Object,{apply:Hs,construct:js}="undefined"!=typeof Reflect&&Reflect;Ds||(Ds=function(e){return e}),Fs||(Fs=function(e){return e}),Hs||(Hs=function(e,t,n){return e.apply(t,n)}),js||(js=function(e,t){return new e(...t)});const $s=tl(Array.prototype.forEach),qs=tl(Array.prototype.pop),Us=tl(Array.prototype.push),Gs=tl(String.prototype.toLowerCase),Vs=tl(String.prototype.toString),Ws=tl(String.prototype.match),Ys=tl(String.prototype.replace),Ks=tl(String.prototype.indexOf),Xs=tl(String.prototype.trim),Qs=tl(Object.prototype.hasOwnProperty),Js=tl(RegExp.prototype.test),Zs=(el=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return js(el,t)});var el;function tl(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Hs(e,t,r)}}function nl(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:Gs;Ls&&Ls(e,null);let r=t.length;for(;r--;){let o=t[r];if("string"==typeof o){
154
154
  const e=n(o);e!==o&&(Os(t)||(t[r]=e),o=e)}e[o]=!0}return e}function rl(e){for(let t=0;t<e.length;t++){Qs(e,t)||(e[t]=null)}return e}function ol(e){const t=Bs(null);for(const[n,r]of zs(e)){Qs(e,n)&&(Array.isArray(r)?t[n]=rl(r):r&&"object"==typeof r&&r.constructor===Object?t[n]=ol(r):t[n]=r)}return t}function il(e,t){for(;null!==e;){const n=Ps(e,t);if(n){if(n.get)return tl(n.get);if("function"==typeof n.value)return tl(n.value)}e=Rs(e)}return function(){return null}}
155
- const al=Ds(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),sl=Ds(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ll=Ds(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),cl=Ds(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ul=Ds(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),dl=Ds(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hl=Ds(["#text"]),ml=Ds(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","xmlns","slot"]),pl=Ds(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fl=Ds(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),gl=Ds(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),vl=Fs(/\{\{[\w\W]*|[\w\W]*\}\}/gm),bl=Fs(/<%[\w\W]*|[\w\W]*%>/gm),_l=Fs(/\${[\w\W]*}/gm),yl=Fs(/^data-[\-\w.\u00B7-\uFFFF]/),wl=Fs(/^aria-[\-\w]+$/),xl=Fs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kl=Fs(/^(?:\w+script|data):/i),Nl=Fs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sl=Fs(/^html$/i),Al=Fs(/^[a-z][.\w]*(-[.\w]+)+$/i)
156
- ;var El=Object.freeze({__proto__:null,MUSTACHE_EXPR:vl,ERB_EXPR:bl,TMPLIT_EXPR:_l,DATA_ATTR:yl,ARIA_ATTR:wl,IS_ALLOWED_URI:xl,IS_SCRIPT_OR_DATA:kl,ATTR_WHITESPACE:Nl,DOCTYPE_NAME:Sl,CUSTOM_ELEMENT:Al});const Tl=function(){return"undefined"==typeof window?null:window};var Cl=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tl();const n=t=>e(t);if(n.version="3.0.11",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:p}=t,f=c.prototype,g=il(f,"cloneNode"),v=il(f,"nextSibling"),b=il(f,"childNodes"),_=il(f,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let y,w=""
157
- ;const{implementation:x,createNodeIterator:k,createDocumentFragment:N,getElementsByTagName:S}=r,{importNode:A}=o;let E={};n.isSupported="function"==typeof zs&&"function"==typeof _&&x&&void 0!==x.createHTMLDocument;const{MUSTACHE_EXPR:T,ERB_EXPR:C,TMPLIT_EXPR:M,DATA_ATTR:I,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:R}=El;let{IS_ALLOWED_URI:P}=El,D=null;const F=nl({},[...al,...sl,...ll,...ul,...hl]);let B=null;const H=nl({},[...ml,...pl,...fl,...gl]);let j=Object.seal(Bs(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,q=null,U=!0,G=!0,V=!1,W=!0,Y=!1,K=!1,X=!1,Q=!1,J=!1,Z=!1,ee=!1,te=!0,ne=!1,re=!0,oe=!1,ie={},ae=null
158
- ;const se=nl({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let le=null;const ce=nl({},["audio","video","img","source","image","track"]);let ue=null;const de=nl({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",me="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml";let fe=pe,ge=!1,ve=null;const be=nl({},[he,me,pe],Vs);let _e=null;const ye=["application/xhtml+xml","text/html"];let we=null,xe=null;const ke=r.createElement("form"),Ne=function(e){return e instanceof RegExp||e instanceof Function},Se=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!xe||xe!==e){if(e&&"object"==typeof e||(e={}),e=ol(e),_e=-1===ye.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,
159
- we="application/xhtml+xml"===_e?Vs:Gs,D=Qs(e,"ALLOWED_TAGS")?nl({},e.ALLOWED_TAGS,we):F,B=Qs(e,"ALLOWED_ATTR")?nl({},e.ALLOWED_ATTR,we):H,ve=Qs(e,"ALLOWED_NAMESPACES")?nl({},e.ALLOWED_NAMESPACES,Vs):be,ue=Qs(e,"ADD_URI_SAFE_ATTR")?nl(ol(de),e.ADD_URI_SAFE_ATTR,we):de,le=Qs(e,"ADD_DATA_URI_TAGS")?nl(ol(ce),e.ADD_DATA_URI_TAGS,we):ce,ae=Qs(e,"FORBID_CONTENTS")?nl({},e.FORBID_CONTENTS,we):se,$=Qs(e,"FORBID_TAGS")?nl({},e.FORBID_TAGS,we):{},q=Qs(e,"FORBID_ATTR")?nl({},e.FORBID_ATTR,we):{},ie=!!Qs(e,"USE_PROFILES")&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,G=!1!==e.ALLOW_DATA_ATTR,V=e.ALLOW_UNKNOWN_PROTOCOLS||!1,W=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,K=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,Z=e.RETURN_DOM_FRAGMENT||!1,ee=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,te=!1!==e.SANITIZE_DOM,ne=e.SANITIZE_NAMED_PROPS||!1,re=!1!==e.KEEP_CONTENT,oe=e.IN_PLACE||!1,P=e.ALLOWED_URI_REGEXP||xl,fe=e.NAMESPACE||pe,j=e.CUSTOM_ELEMENT_HANDLING||{},
160
- e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(j.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Ne(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(j.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(j.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(G=!1),Z&&(J=!0),ie&&(D=nl({},hl),B=[],!0===ie.html&&(nl(D,al),nl(B,ml)),!0===ie.svg&&(nl(D,sl),nl(B,pl),nl(B,gl)),!0===ie.svgFilters&&(nl(D,ll),nl(B,pl),nl(B,gl)),!0===ie.mathMl&&(nl(D,ul),nl(B,fl),nl(B,gl))),e.ADD_TAGS&&(D===F&&(D=ol(D)),nl(D,e.ADD_TAGS,we)),e.ADD_ATTR&&(B===H&&(B=ol(B)),nl(B,e.ADD_ATTR,we)),e.ADD_URI_SAFE_ATTR&&nl(ue,e.ADD_URI_SAFE_ATTR,we),e.FORBID_CONTENTS&&(ae===se&&(ae=ol(ae)),nl(ae,e.FORBID_CONTENTS,we)),re&&(D["#text"]=!0),K&&nl(D,["html","head","body"]),D.table&&(nl(D,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){
161
- if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Zs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Zs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=e.TRUSTED_TYPES_POLICY,w=y.createHTML("")}else void 0===y&&(y=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,i)),null!==y&&"string"==typeof w&&(w=y.createHTML(""));Ds&&Ds(e),xe=e}},Ae=nl({},["mi","mo","mn","ms","mtext"]),Ee=nl({},["foreignobject","desc","title","annotation-xml"]),Te=nl({},["title","style","font","a","script"]),Ce=nl({},[...sl,...ll,...cl]),Me=nl({},[...ul,...dl]),Ie=function(e){
162
- Us(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},ze=function(e,t){try{Us(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Us(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!B[e])if(J||Z)try{Ie(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Le=function(e){let t=null,n=null;if(Q)e="<remove></remove>"+e;else{const t=Ws(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===_e&&fe===pe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=y?y.createHTML(e):e;if(fe===pe)try{t=(new m).parseFromString(o,_e)}catch(e){}if(!t||!t.documentElement){t=x.createDocument(fe,"template",null);try{t.documentElement.innerHTML=ge?w:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),fe===pe?S.call(t,K?"html":"body")[0]:K?t.documentElement:i},Oe=function(e){
163
- return k.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Re=function(e){return"function"==typeof l&&e instanceof l},Pe=function(e,t,r){E[e]&&$s(E[e],(e=>{e.call(n,t,r,xe)}))},De=function(e){let t=null;if(Pe("beforeSanitizeElements",e,null),(r=e)instanceof h&&("string"!=typeof r.nodeName||"string"!=typeof r.textContent||"function"!=typeof r.removeChild||!(r.attributes instanceof d)||"function"!=typeof r.removeAttribute||"function"!=typeof r.setAttribute||"string"!=typeof r.namespaceURI||"function"!=typeof r.insertBefore||"function"!=typeof r.hasChildNodes))return Ie(e),!0;var r;const o=we(e.nodeName);if(Pe("uponSanitizeElement",e,{tagName:o,allowedTags:D}),e.hasChildNodes()&&!Re(e.firstElementChild)&&Js(/<[/\w]/g,e.innerHTML)&&Js(/<[/\w]/g,e.textContent))return Ie(e),!0;if(7===e.nodeType)return Ie(e),!0;if(!D[o]||$[o]){if(!$[o]&&Be(o)){if(j.tagNameCheck instanceof RegExp&&Js(j.tagNameCheck,o))return!1
164
- ;if(j.tagNameCheck instanceof Function&&j.tagNameCheck(o))return!1}if(re&&!ae[o]){const t=_(e)||e.parentNode,n=b(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r)t.insertBefore(g(n[r],!0),v(e))}}return Ie(e),!0}return e instanceof c&&!function(e){let t=_(e);t&&t.tagName||(t={namespaceURI:fe,tagName:"template"});const n=Gs(e.tagName),r=Gs(t.tagName);return!!ve[e.namespaceURI]&&(e.namespaceURI===me?t.namespaceURI===pe?"svg"===n:t.namespaceURI===he?"svg"===n&&("annotation-xml"===r||Ae[r]):Boolean(Ce[n]):e.namespaceURI===he?t.namespaceURI===pe?"math"===n:t.namespaceURI===me?"math"===n&&Ee[r]:Boolean(Me[n]):e.namespaceURI===pe?!(t.namespaceURI===me&&!Ee[r])&&!(t.namespaceURI===he&&!Ae[r])&&!Me[n]&&(Te[n]||!Ce[n]):!("application/xhtml+xml"!==_e||!ve[e.namespaceURI]))}(e)?(Ie(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!Js(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&3===e.nodeType&&(t=e.textContent,$s([T,C,M],(e=>{t=Ys(t,e," ")})),e.textContent!==t&&(Us(n.removed,{element:e.cloneNode()}),
165
- e.textContent=t)),Pe("afterSanitizeElements",e,null),!1):(Ie(e),!0)},Fe=function(e,t,n){if(te&&("id"===t||"name"===t)&&(n in r||n in ke))return!1;if(G&&!q[t]&&Js(I,t));else if(U&&Js(z,t));else if(!B[t]||q[t]){if(!(Be(e)&&(j.tagNameCheck instanceof RegExp&&Js(j.tagNameCheck,e)||j.tagNameCheck instanceof Function&&j.tagNameCheck(e))&&(j.attributeNameCheck instanceof RegExp&&Js(j.attributeNameCheck,t)||j.attributeNameCheck instanceof Function&&j.attributeNameCheck(t))||"is"===t&&j.allowCustomizedBuiltInElements&&(j.tagNameCheck instanceof RegExp&&Js(j.tagNameCheck,n)||j.tagNameCheck instanceof Function&&j.tagNameCheck(n))))return!1}else if(ue[t]);else if(Js(P,Ys(n,O,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Ks(n,"data:")||!le[e]){if(V&&!Js(L,Ys(n,O,"")));else if(n)return!1}else;return!0},Be=function(e){return"annotation-xml"!==e&&Ws(e,R)},He=function(e){Pe("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return;const r={attrName:"",attrValue:"",keepAttr:!0,
166
- allowedAttributes:B};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:l}=i,c=we(a);let u="value"===a?l:Xs(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,Pe("uponSanitizeAttribute",e,r),u=r.attrValue,r.forceKeepAttr)continue;if(ze(a,e),!r.keepAttr)continue;if(!W&&Js(/\/>/i,u)){ze(a,e);continue}Y&&$s([T,C,M],(e=>{u=Ys(u,e," ")}));const d=we(e.nodeName);if(Fe(d,c,u)){if(!ne||"id"!==c&&"name"!==c||(ze(a,e),u="user-content-"+u),y&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(s);else switch(p.getAttributeType(d,c)){case"TrustedHTML":u=y.createHTML(u);break;case"TrustedScriptURL":u=y.createScriptURL(u)}try{s?e.setAttributeNS(s,a,u):e.setAttribute(a,u),qs(n.removed)}catch(e){}}}Pe("afterSanitizeAttributes",e,null)},je=function e(t){let n=null;const r=Oe(t);for(Pe("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Pe("uponSanitizeShadowNode",n,null),De(n)||(n.content instanceof a&&e(n.content),He(n));Pe("afterSanitizeShadowDOM",t,null)}
167
- ;return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,c=null;if(ge=!e,ge&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Re(e)){if("function"!=typeof e.toString)throw Zs("toString is not a function");if("string"!=typeof(e=e.toString()))throw Zs("dirty is not a string, aborting")}if(!n.isSupported)return e;if(X||Se(t),n.removed=[],"string"==typeof e&&(oe=!1),oe){if(e.nodeName){const t=we(e.nodeName);if(!D[t]||$[t])throw Zs("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Le("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!J&&!Y&&!K&&-1===e.indexOf("<"))return y&&ee?y.createHTML(e):e;if(r=Le(e),!r)return J?null:ee?w:""}r&&Q&&Ie(r.firstChild);const u=Oe(oe?e:r);for(;s=u.nextNode();)De(s)||(s.content instanceof a&&je(s.content),He(s));if(oe)return e;if(J){
168
- if(Z)for(c=N.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(B.shadowroot||B.shadowrootmode)&&(c=A.call(o,c,!0)),c}let d=K?r.outerHTML:r.innerHTML;return K&&D["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Js(Sl,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Y&&$s([T,C,M],(e=>{d=Ys(d,e," ")})),y&&ee?y.createHTML(d):d},n.setConfig=function(){Se(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),X=!0},n.clearConfig=function(){xe=null,X=!1},n.isValidAttribute=function(e,t,n){xe||Se({});const r=we(e),o=we(t);return Fe(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(E[e]=E[e]||[],Us(E[e],t))},n.removeHook=function(e){if(E[e])return qs(E[e])},n.removeHooks=function(e){E[e]&&(E[e]=[])},n.removeAllHooks=function(){E={}},n}(),Ml=/["'&<>]/,Il=function(e){var t,n=""+e,r=Ml.exec(n);if(!r)return n;var o="",i=0,a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:t="&quot;";break;case 38:
155
+ const al=Ds(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","section","select","shadow","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),sl=Ds(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","filter","font","g","glyph","glyphref","hkern","image","line","lineargradient","marker","mask","metadata","mpath","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ll=Ds(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),cl=Ds(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),ul=Ds(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),dl=Ds(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),hl=Ds(["#text"]),ml=Ds(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","face","for","headers","height","hidden","high","href","hreflang","id","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","pattern","placeholder","playsinline","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),pl=Ds(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),fl=Ds(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),gl=Ds(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),vl=Fs(/\{\{[\w\W]*|[\w\W]*\}\}/gm),bl=Fs(/<%[\w\W]*|[\w\W]*%>/gm),_l=Fs(/\${[\w\W]*}/gm),yl=Fs(/^data-[\-\w.\u00B7-\uFFFF]/),wl=Fs(/^aria-[\-\w]+$/),xl=Fs(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),kl=Fs(/^(?:\w+script|data):/i),Nl=Fs(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Sl=Fs(/^html$/i),Al=Fs(/^[a-z][.\w]*(-[.\w]+)+$/i)
156
+ ;var El=Object.freeze({__proto__:null,MUSTACHE_EXPR:vl,ERB_EXPR:bl,TMPLIT_EXPR:_l,DATA_ATTR:yl,ARIA_ATTR:wl,IS_ALLOWED_URI:xl,IS_SCRIPT_OR_DATA:kl,ATTR_WHITESPACE:Nl,DOCTYPE_NAME:Sl,CUSTOM_ELEMENT:Al});const Tl=function(){return"undefined"==typeof window?null:window};var Cl=function e(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Tl();const n=t=>e(t);if(n.version="3.1.0",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;let{document:r}=t;const o=r,i=o.currentScript,{DocumentFragment:a,HTMLTemplateElement:s,Node:l,Element:c,NodeFilter:u,NamedNodeMap:d=t.NamedNodeMap||t.MozNamedAttrMap,HTMLFormElement:h,DOMParser:m,trustedTypes:p}=t,f=c.prototype,g=il(f,"cloneNode"),v=il(f,"nextSibling"),b=il(f,"childNodes"),_=il(f,"parentNode");if("function"==typeof s){const e=r.createElement("template");e.content&&e.content.ownerDocument&&(r=e.content.ownerDocument)}let y,w=""
157
+ ;const{implementation:x,createNodeIterator:k,createDocumentFragment:N,getElementsByTagName:S}=r,{importNode:A}=o;let E={};n.isSupported="function"==typeof zs&&"function"==typeof _&&x&&void 0!==x.createHTMLDocument;const{MUSTACHE_EXPR:T,ERB_EXPR:C,TMPLIT_EXPR:M,DATA_ATTR:I,ARIA_ATTR:z,IS_SCRIPT_OR_DATA:L,ATTR_WHITESPACE:O,CUSTOM_ELEMENT:R}=El;let{IS_ALLOWED_URI:P}=El,D=null;const F=nl({},[...al,...sl,...ll,...ul,...hl]);let B=null;const H=nl({},[...ml,...pl,...fl,...gl]);let j=Object.seal(Bs(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),$=null,q=null,U=!0,G=!0,V=!1,W=!0,Y=!1,K=!0,X=!1,Q=!1,J=!1,Z=!1,ee=!1,te=!1,ne=!0,re=!1,oe=!0,ie=!1,ae={},se=null
158
+ ;const le=nl({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let ce=null;const ue=nl({},["audio","video","img","source","image","track"]);let de=null;const he=nl({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),me="http://www.w3.org/1998/Math/MathML",pe="http://www.w3.org/2000/svg",fe="http://www.w3.org/1999/xhtml";let ge=fe,ve=!1,be=null;const _e=nl({},[me,pe,fe],Vs);let ye=null;const we=["application/xhtml+xml","text/html"];let xe=null,ke=null;const Ne=r.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},Ae=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!ke||ke!==e){if(e&&"object"==typeof e||(e={}),e=ol(e),ye=-1===we.indexOf(e.PARSER_MEDIA_TYPE)?"text/html":e.PARSER_MEDIA_TYPE,
159
+ xe="application/xhtml+xml"===ye?Vs:Gs,D=Qs(e,"ALLOWED_TAGS")?nl({},e.ALLOWED_TAGS,xe):F,B=Qs(e,"ALLOWED_ATTR")?nl({},e.ALLOWED_ATTR,xe):H,be=Qs(e,"ALLOWED_NAMESPACES")?nl({},e.ALLOWED_NAMESPACES,Vs):_e,de=Qs(e,"ADD_URI_SAFE_ATTR")?nl(ol(he),e.ADD_URI_SAFE_ATTR,xe):he,ce=Qs(e,"ADD_DATA_URI_TAGS")?nl(ol(ue),e.ADD_DATA_URI_TAGS,xe):ue,se=Qs(e,"FORBID_CONTENTS")?nl({},e.FORBID_CONTENTS,xe):le,$=Qs(e,"FORBID_TAGS")?nl({},e.FORBID_TAGS,xe):{},q=Qs(e,"FORBID_ATTR")?nl({},e.FORBID_ATTR,xe):{},ae=!!Qs(e,"USE_PROFILES")&&e.USE_PROFILES,U=!1!==e.ALLOW_ARIA_ATTR,G=!1!==e.ALLOW_DATA_ATTR,V=e.ALLOW_UNKNOWN_PROTOCOLS||!1,W=!1!==e.ALLOW_SELF_CLOSE_IN_ATTR,Y=e.SAFE_FOR_TEMPLATES||!1,K=!1!==e.SAFE_FOR_XML,X=e.WHOLE_DOCUMENT||!1,Z=e.RETURN_DOM||!1,ee=e.RETURN_DOM_FRAGMENT||!1,te=e.RETURN_TRUSTED_TYPE||!1,J=e.FORCE_BODY||!1,ne=!1!==e.SANITIZE_DOM,re=e.SANITIZE_NAMED_PROPS||!1,oe=!1!==e.KEEP_CONTENT,ie=e.IN_PLACE||!1,P=e.ALLOWED_URI_REGEXP||xl,ge=e.NAMESPACE||fe,j=e.CUSTOM_ELEMENT_HANDLING||{},
160
+ e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(j.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(j.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(j.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),Y&&(G=!1),ee&&(Z=!0),ae&&(D=nl({},hl),B=[],!0===ae.html&&(nl(D,al),nl(B,ml)),!0===ae.svg&&(nl(D,sl),nl(B,pl),nl(B,gl)),!0===ae.svgFilters&&(nl(D,ll),nl(B,pl),nl(B,gl)),!0===ae.mathMl&&(nl(D,ul),nl(B,fl),nl(B,gl))),e.ADD_TAGS&&(D===F&&(D=ol(D)),nl(D,e.ADD_TAGS,xe)),e.ADD_ATTR&&(B===H&&(B=ol(B)),nl(B,e.ADD_ATTR,xe)),e.ADD_URI_SAFE_ATTR&&nl(de,e.ADD_URI_SAFE_ATTR,xe),e.FORBID_CONTENTS&&(se===le&&(se=ol(se)),nl(se,e.FORBID_CONTENTS,xe)),oe&&(D["#text"]=!0),X&&nl(D,["html","head","body"]),D.table&&(nl(D,["tbody"]),delete $.tbody),e.TRUSTED_TYPES_POLICY){
161
+ if("function"!=typeof e.TRUSTED_TYPES_POLICY.createHTML)throw Zs('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if("function"!=typeof e.TRUSTED_TYPES_POLICY.createScriptURL)throw Zs('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');y=e.TRUSTED_TYPES_POLICY,w=y.createHTML("")}else void 0===y&&(y=function(e,t){if("object"!=typeof e||"function"!=typeof e.createPolicy)return null;let n=null;const r="data-tt-policy-suffix";t&&t.hasAttribute(r)&&(n=t.getAttribute(r));const o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:e=>e,createScriptURL:e=>e})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}}(p,i)),null!==y&&"string"==typeof w&&(w=y.createHTML(""));Ds&&Ds(e),ke=e}},Ee=nl({},["mi","mo","mn","ms","mtext"]),Te=nl({},["foreignobject","desc","title","annotation-xml"]),Ce=nl({},["title","style","font","a","script"]),Me=nl({},[...sl,...ll,...cl]),Ie=nl({},[...ul,...dl]),ze=function(e){
162
+ Us(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){e.remove()}},Le=function(e,t){try{Us(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Us(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!B[e])if(Z||ee)try{ze(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Oe=function(e){let t=null,n=null;if(J)e="<remove></remove>"+e;else{const t=Ws(e,/^[\r\n\t ]+/);n=t&&t[0]}"application/xhtml+xml"===ye&&ge===fe&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");const o=y?y.createHTML(e):e;if(ge===fe)try{t=(new m).parseFromString(o,ye)}catch(e){}if(!t||!t.documentElement){t=x.createDocument(ge,"template",null);try{t.documentElement.innerHTML=ve?w:o}catch(e){}}const i=t.body||t.documentElement;return e&&n&&i.insertBefore(r.createTextNode(n),i.childNodes[0]||null),ge===fe?S.call(t,X?"html":"body")[0]:X?t.documentElement:i},Re=function(e){
163
+ return k.call(e.ownerDocument||e,e,u.SHOW_ELEMENT|u.SHOW_COMMENT|u.SHOW_TEXT|u.SHOW_PROCESSING_INSTRUCTION|u.SHOW_CDATA_SECTION,null)},Pe=function(e){return"function"==typeof l&&e instanceof l},De=function(e,t,r){E[e]&&$s(E[e],(e=>{e.call(n,t,r,ke)}))},Fe=function(e){let t=null;if(De("beforeSanitizeElements",e,null),(r=e)instanceof h&&("string"!=typeof r.nodeName||"string"!=typeof r.textContent||"function"!=typeof r.removeChild||!(r.attributes instanceof d)||"function"!=typeof r.removeAttribute||"function"!=typeof r.setAttribute||"string"!=typeof r.namespaceURI||"function"!=typeof r.insertBefore||"function"!=typeof r.hasChildNodes))return ze(e),!0;var r;const o=xe(e.nodeName);if(De("uponSanitizeElement",e,{tagName:o,allowedTags:D}),e.hasChildNodes()&&!Pe(e.firstElementChild)&&Js(/<[/\w]/g,e.innerHTML)&&Js(/<[/\w]/g,e.textContent))return ze(e),!0;if(7===e.nodeType)return ze(e),!0;if(K&&8===e.nodeType&&Js(/<[/\w]/g,e.data))return ze(e),!0;if(!D[o]||$[o]){if(!$[o]&&He(o)){
164
+ if(j.tagNameCheck instanceof RegExp&&Js(j.tagNameCheck,o))return!1;if(j.tagNameCheck instanceof Function&&j.tagNameCheck(o))return!1}if(oe&&!se[o]){const t=_(e)||e.parentNode,n=b(e)||e.childNodes;if(n&&t){for(let r=n.length-1;r>=0;--r)t.insertBefore(g(n[r],!0),v(e))}}return ze(e),!0}return e instanceof c&&!function(e){let t=_(e);t&&t.tagName||(t={namespaceURI:ge,tagName:"template"});const n=Gs(e.tagName),r=Gs(t.tagName);return!!be[e.namespaceURI]&&(e.namespaceURI===pe?t.namespaceURI===fe?"svg"===n:t.namespaceURI===me?"svg"===n&&("annotation-xml"===r||Ee[r]):Boolean(Me[n]):e.namespaceURI===me?t.namespaceURI===fe?"math"===n:t.namespaceURI===pe?"math"===n&&Te[r]:Boolean(Ie[n]):e.namespaceURI===fe?!(t.namespaceURI===pe&&!Te[r])&&!(t.namespaceURI===me&&!Ee[r])&&!Ie[n]&&(Ce[n]||!Me[n]):!("application/xhtml+xml"!==ye||!be[e.namespaceURI]))}(e)?(ze(e),!0):"noscript"!==o&&"noembed"!==o&&"noframes"!==o||!Js(/<\/no(script|embed|frames)/i,e.innerHTML)?(Y&&3===e.nodeType&&(t=e.textContent,$s([T,C,M],(e=>{t=Ys(t,e," ")})),
165
+ e.textContent!==t&&(Us(n.removed,{element:e.cloneNode()}),e.textContent=t)),De("afterSanitizeElements",e,null),!1):(ze(e),!0)},Be=function(e,t,n){if(ne&&("id"===t||"name"===t)&&(n in r||n in Ne))return!1;if(G&&!q[t]&&Js(I,t));else if(U&&Js(z,t));else if(!B[t]||q[t]){if(!(He(e)&&(j.tagNameCheck instanceof RegExp&&Js(j.tagNameCheck,e)||j.tagNameCheck instanceof Function&&j.tagNameCheck(e))&&(j.attributeNameCheck instanceof RegExp&&Js(j.attributeNameCheck,t)||j.attributeNameCheck instanceof Function&&j.attributeNameCheck(t))||"is"===t&&j.allowCustomizedBuiltInElements&&(j.tagNameCheck instanceof RegExp&&Js(j.tagNameCheck,n)||j.tagNameCheck instanceof Function&&j.tagNameCheck(n))))return!1}else if(de[t]);else if(Js(P,Ys(n,O,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Ks(n,"data:")||!ce[e]){if(V&&!Js(L,Ys(n,O,"")));else if(n)return!1}else;return!0},He=function(e){return"annotation-xml"!==e&&Ws(e,R)},je=function(e){De("beforeSanitizeAttributes",e,null);const{attributes:t}=e;if(!t)return
166
+ ;const r={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:B};let o=t.length;for(;o--;){const i=t[o],{name:a,namespaceURI:s,value:l}=i,c=xe(a);let u="value"===a?l:Xs(l);if(r.attrName=c,r.attrValue=u,r.keepAttr=!0,r.forceKeepAttr=void 0,De("uponSanitizeAttribute",e,r),u=r.attrValue,r.forceKeepAttr)continue;if(Le(a,e),!r.keepAttr)continue;if(!W&&Js(/\/>/i,u)){Le(a,e);continue}Y&&$s([T,C,M],(e=>{u=Ys(u,e," ")}));const d=xe(e.nodeName);if(Be(d,c,u)){if(!re||"id"!==c&&"name"!==c||(Le(a,e),u="user-content-"+u),y&&"object"==typeof p&&"function"==typeof p.getAttributeType)if(s);else switch(p.getAttributeType(d,c)){case"TrustedHTML":u=y.createHTML(u);break;case"TrustedScriptURL":u=y.createScriptURL(u)}try{s?e.setAttributeNS(s,a,u):e.setAttribute(a,u),qs(n.removed)}catch(e){}}}De("afterSanitizeAttributes",e,null)},$e=function e(t){let n=null;const r=Re(t);for(De("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)De("uponSanitizeShadowNode",n,null),Fe(n)||(n.content instanceof a&&e(n.content),je(n))
167
+ ;De("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=null,i=null,s=null,c=null;if(ve=!e,ve&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Pe(e)){if("function"!=typeof e.toString)throw Zs("toString is not a function");if("string"!=typeof(e=e.toString()))throw Zs("dirty is not a string, aborting")}if(!n.isSupported)return e;if(Q||Ae(t),n.removed=[],"string"==typeof e&&(ie=!1),ie){if(e.nodeName){const t=xe(e.nodeName);if(!D[t]||$[t])throw Zs("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof l)r=Oe("\x3c!----\x3e"),i=r.ownerDocument.importNode(e,!0),1===i.nodeType&&"BODY"===i.nodeName||"HTML"===i.nodeName?r=i:r.appendChild(i);else{if(!Z&&!Y&&!X&&-1===e.indexOf("<"))return y&&te?y.createHTML(e):e;if(r=Oe(e),!r)return Z?null:te?w:""}r&&J&&ze(r.firstChild);const u=Re(ie?e:r);for(;s=u.nextNode();)Fe(s)||(s.content instanceof a&&$e(s.content),je(s));if(ie)return e;if(Z){
168
+ if(ee)for(c=N.call(r.ownerDocument);r.firstChild;)c.appendChild(r.firstChild);else c=r;return(B.shadowroot||B.shadowrootmode)&&(c=A.call(o,c,!0)),c}let d=X?r.outerHTML:r.innerHTML;return X&&D["!doctype"]&&r.ownerDocument&&r.ownerDocument.doctype&&r.ownerDocument.doctype.name&&Js(Sl,r.ownerDocument.doctype.name)&&(d="<!DOCTYPE "+r.ownerDocument.doctype.name+">\n"+d),Y&&$s([T,C,M],(e=>{d=Ys(d,e," ")})),y&&te?y.createHTML(d):d},n.setConfig=function(){Ae(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),Q=!0},n.clearConfig=function(){ke=null,Q=!1},n.isValidAttribute=function(e,t,n){ke||Ae({});const r=xe(e),o=xe(t);return Be(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(E[e]=E[e]||[],Us(E[e],t))},n.removeHook=function(e){if(E[e])return qs(E[e])},n.removeHooks=function(e){E[e]&&(E[e]=[])},n.removeAllHooks=function(){E={}},n}(),Ml=/["'&<>]/,Il=function(e){var t,n=""+e,r=Ml.exec(n);if(!r)return n;var o="",i=0,a=0;for(i=r.index;i<n.length;i++){switch(n.charCodeAt(i)){case 34:t="&quot;";break;case 38:
169
169
  t="&amp;";break;case 39:t="&#39;";break;case 60:t="&lt;";break;case 62:t="&gt;";break;default:continue}a!==i&&(o+=n.substring(a,i)),a=i+1,o+=t}return a!==i?o+n.substring(a,i):o};var zl=t(Il);class Ll{constructor(e,t,n){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=n}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new Ll(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Ol{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new Ol(t,Ll.range(this,e))}}class Rl{constructor(e,t){this.name=void 0,this.position=void 0,this.length=void 0,this.rawMessage=void 0;var n,r,o="KaTeX parse error: "+e,i=t&&t.loc;if(i&&i.start<=i.end){var a=i.lexer.input;n=i.start,r=i.end,n===a.length?o+=" at end of input: ":o+=" at position "+(n+1)+": ";var s=a.slice(n,r).replace(/[^]/g,"$&̲");o+=(n>15?"…"+a.slice(n-15,n):a.slice(0,n))+s+(r+15<a.length?a.slice(r,r+15)+"…":a.slice(r))}
170
170
  var l=new Error(o);return l.name="ParseError",l.__proto__=Rl.prototype,l.position=n,null!=n&&null!=r&&(l.length=r-n),l.rawMessage=e,l}}Rl.prototype.__proto__=Error.prototype;var Pl=/([A-Z])/g,Dl={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},Fl=/[&><"']/g;var Bl=function e(t){return"ordgroup"===t.type||"color"===t.type?1===t.body.length?e(t.body[0]):t:"font"===t.type?e(t.body):t},Hl={contains:function(e,t){return-1!==e.indexOf(t)},deflt:function(e,t){return void 0===e?t:e},escape:function(e){return String(e).replace(Fl,(e=>Dl[e]))},hyphenate:function(e){return e.replace(Pl,"-$1").toLowerCase()},getBaseElem:Bl,isCharacterBox:function(e){var t=Bl(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"}},jl={displayMode:{type:"boolean",
171
171
  description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",
@@ -551,7 +551,7 @@ matches:(e,t)=>hf(e,t)===uf.Overlap,normalize:e=>e.trim()},since:{fieldValues:e=
551
551
  ;t[i]?t[i].push(o):t[i]=[o]}return t}function Sf(e){return Go(e)?"orphan":Vo(e)?"note":"annotation"}function Af(e){return os([e]).reduce(((e,t)=>t.created>e?t.created:e),"")}function Ef(e){return os([e]).reduce(((e,t)=>(e||(e=t.created),t.created<e?t.created:e)),"")}const Tf={Newest:(e,t)=>{const n=Af(e),r=Af(t);return n>r?-1:n<r?1:0},Oldest:(e,t)=>{const n=Ef(e),r=Ef(t);return n<r?-1:n>r?1:0},Location:(e,t)=>{var n,r;if(!e.annotation||!t.annotation)return function(e,t){return e.annotation||t.annotation?e.annotation?1:-1:0}(e,t);const o=Ko(e.annotation),i=Ko(t.annotation);if(o.cfi&&i.cfi){const e=sf(o.cfi,i.cfi);if(0!==e)return Math.sign(e)}else{if(o.cfi)return-1;if(i.cfi)return 1}const a=null!==(n=o.position)&&void 0!==n?n:Number.MAX_SAFE_INTEGER,s=null!==(r=i.position)&&void 0!==r?r:Number.MAX_SAFE_INTEGER;return Math.sign(a-s)}};const Cf=function(e){if(1!==e.length)throw new Error("Memoize input must be a function of one argument");let t,n;return function(r){return r===t||(t=r,n=e(r)),n}}((function(e){
552
552
  const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:Tf[t.sortKey]};if(!!t.filterQuery||Object.keys(t.filters).length>0){const e=function(e,t={}){const n=e=>{const n=t[e];return"string"==typeof n?[n]:[]},r=n("cfi"),o=n("page"),i=n("quote"),a=n("tag"),s=n("text"),l=n("uri"),c=n("user"),u=[],d=[],h=kf(e,_f);for(const e of h){const t=e.slice(0,e.indexOf(":")),n=e.slice(t.length+1);switch(t){case"cfi":r.push(n);break;case"quote":i.push(n);break;case"page":o.push(n);break;case"since":{const t=86400,n={sec:1,min:60,hour:3600,day:t,week:7*t,month:30*t,year:365*t},r=e.slice(6).toLowerCase().match(/^(\d+)(sec|min|hour|day|week|month|year)?$/);if(r){const e=parseFloat(r[1]),t=r[2]||"sec";d.push(e*n[t])}}break;case"tag":a.push(n);break;case"text":s.push(n);break;case"uri":l.push(n);break;case"user":c.push(n);break;default:u.push(e)}}return{any:{terms:u,operator:"and"},cfi:{terms:r,operator:"or"},quote:{terms:i,operator:"and"},page:{terms:o,operator:"or"},since:{
553
553
  terms:d,operator:"and"},tag:{terms:a,operator:"and"},text:{terms:s,operator:"and"},uri:{terms:l,operator:"or"},user:{terms:c,operator:"or"}}}(t.filterQuery||"",t.filters);n.filterFn=t=>function(e,t){const n=(e,t)=>new ff(t,bf[e]),r=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{let r;if("any"===e){const e=["quote","text","tag","user"];r=t.terms.map((t=>new gf("or",e.map((e=>n(e,t))))))}else r=t.terms.map((t=>n(e,t)));return new gf(t.operator,r)})),o=new gf("and",r);return e.filter((e=>e.id&&o.matches(e))).map((e=>e.id))}([t],e).length>0}const r=rf(e.annotations,n),o={annotation:0,note:0,orphan:0};return e.showTabs&&(r.children=r.children.filter((e=>{if(!e.annotation)return!1;if($o(e.annotation))return!1;const n=Sf(e.annotation);return o[n]+=1,n===t.selectedTab}))),{tabCounts:o,rootThread:r}}));function Mf(){const e=za(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a="sidebar"===r,s=ue((()=>{const e={...o,filterQuery:n,filters:i};return{
554
- annotations:t,selection:e,showTabs:a}}),[t,n,o,i,a]);return Cf(s)}var If=eo((function({loadAnnotationsService:e,onLogin:t}){var n;const r=za(),o=null!==(n=r.routeParams().id)&&void 0!==n?n:"",{rootThread:i}=Mf(),a=r.profile().userid,[s,l]=ie(!1);return se((()=>{l(!1),r.clearAnnotations(),e.loadThread(o).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&r.setExpanded(e.id,!0))),t.id!==o&&r.highlightAnnotations([o]))})).catch((()=>{l(!0)}))}),[o,a,e,r]),Pe(v,{children:[s&&Pe(La,{errorType:"annotation",onLoginRequest:t}),Pe(Wp,{threads:i.children})]})}),["loadAnnotationsService"]);class zf{constructor(e,t,n=window){var r,o,i;B(this,"version",void 0),B(this,"userAgent",void 0),B(this,"urls",void 0),B(this,"fingerprint",void 0),B(this,"account",void 0),B(this,"timestamp",void 0),B(this,"segment",void 0);const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.1479.0",this.userAgent=n.navigator.userAgent,
554
+ annotations:t,selection:e,showTabs:a}}),[t,n,o,i,a]);return Cf(s)}var If=eo((function({loadAnnotationsService:e,onLogin:t}){var n;const r=za(),o=null!==(n=r.routeParams().id)&&void 0!==n?n:"",{rootThread:i}=Mf(),a=r.profile().userid,[s,l]=ie(!1);return se((()=>{l(!1),r.clearAnnotations(),e.loadThread(o).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>e.id&&r.setExpanded(e.id,!0))),t.id!==o&&r.highlightAnnotations([o]))})).catch((()=>{l(!0)}))}),[o,a,e,r]),Pe(v,{children:[s&&Pe(La,{errorType:"annotation",onLoginRequest:t}),Pe(Wp,{threads:i.children})]})}),["loadAnnotationsService"]);class zf{constructor(e,t,n=window){var r,o,i;B(this,"version",void 0),B(this,"userAgent",void 0),B(this,"urls",void 0),B(this,"fingerprint",void 0),B(this,"account",void 0),B(this,"timestamp",void 0),B(this,"segment",void 0);const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.1480.0",this.userAgent=n.navigator.userAgent,
555
555
  this.urls=t.map((e=>e.uri)).join(", ")||a,this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(o=o.metadata)||void 0===o?void 0:o.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString();const l=null===(i=t[0])||void 0===i?void 0:i.segment;if(l){const e=[];if(l.cfi&&e.push(["CFI",l.cfi]),l.pages){const t=`${l.pages.start}-${l.pages.end}`;e.push(["Pages",t])}l.url&&e.push(["URL",l.url]),this.segment=e.map((([e,t])=>`${e}: ${t}`)).join(", ")}}asFormattedString(){return`Version: ${this.version}\nUser Agent: ${this.userAgent}\nURL: ${this.urls}\nFingerprint: ${this.fingerprint}\nAccount: ${this.account}\nDate: ${this.timestamp}\n`}asEncodedURLString(){return encodeURIComponent(this.asFormattedString())}}var Lf="complete",Of="canceled";function Rf(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function Pf(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=function(e,t){
556
556
  var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),d=c&&null!=c.left?c.left:.5,h=c&&null!=c.top?c.top:.5,m=c&&null!=c.leftOffset?c.leftOffset:0,p=c&&null!=c.topOffset?c.topOffset:0,f=d,g=h;if(e.isWindow(t))s=Math.min(u.width,t.innerWidth),l=Math.min(u.height,t.innerHeight),r=u.left+t.pageXOffset-t.innerWidth*f+s*f,o=u.top+t.pageYOffset-t.innerHeight*g+l*g,r-=m,o-=p,r=e.align.lockX?t.pageXOffset:r,o=e.align.lockY?t.pageYOffset:o,i=r-t.pageXOffset,a=o-t.pageYOffset;else{s=u.width,l=u.height,n=t.getBoundingClientRect();var v=u.left-(n.left-t.scrollLeft),b=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=b+l*g-t.clientHeight*g,r-=m,o-=p,r=Math.max(Math.min(r,t.scrollWidth-t.clientWidth),0),o=Math.max(Math.min(o,t.scrollHeight-t.clientHeight),0),r=e.align.lockX?t.scrollLeft:r,o=e.align.lockY?t.scrollTop:o,i=r-t.scrollLeft,a=o-t.scrollTop}return{x:r,y:o,differenceX:i,differenceY:a}}(t,e),o=Date.now()-t.startTime,i=Math.min(1/t.time*o,1);if(t.endIterations>=n)return Rf(e,r.x,r.y),
557
557
  e._scrollSettings=null,t.end(Lf);var a=1-t.ease(i);if(Rf(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&Pf(t.scrollAncestor),void Pf(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(Pf.bind(null,e))}}function Df(e){return e.self===e}function Ff(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function Bf(){return!0}function Hf(e){if(e.assignedSlot)return Hf(e.assignedSlot);if(e.parentElement)return"body"===e.parentElement.tagName.toLowerCase()?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}var jf=function(e,t,n){if(e){"function"==typeof t&&(n=t,t=null),t||(t={}),t.time=isNaN(t.time)?1e3:t.time,t.ease=t.ease||function(e){return 1-Math.pow(1-e,e/2)},t.align=t.align||{}
@@ -641,7 +641,7 @@ const n=Jo(e),r=Xo(e),o=[`Created at: ${Cp(new Date(e.created))}`,`Author: ${c(e
641
641
  }(Pe("html",{lang:"en",children:[Pe("head",{children:[Pe("title",{children:`Annotations on "${a}"`}),Pe("meta",{charSet:"UTF-8"})]}),Pe("body",{children:[Pe("section",{children:[Pe("h1",{children:"Summary"}),Pe("p",{children:Pe("time",{dateTime:o.toISOString(),children:Cp(o)})}),Pe("p",{children:Pe("strong",{children:a})}),Pe("p",{children:Pe("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i})}),Pe("table",{children:Pe("tbody",{style:{verticalAlign:"top"},children:[Pe("tr",{children:[Pe("td",{children:"Group:"}),Pe("td",{children:t})]}),Pe("tr",{children:[Pe("td",{children:"Total users:"}),Pe("td",{children:s.length})]}),Pe("tr",{children:[Pe("td",{children:"Users:"}),Pe("td",{children:s.join(", ")})]}),Pe("tr",{children:[Pe("td",{children:"Total annotations:"}),Pe("td",{children:e.length})]}),Pe("tr",{children:[Pe("td",{children:"Total replies:"}),Pe("td",{children:l.length})]})]})})]}),Pe("hr",{}),Pe("section",{children:[Pe("h1",{children:"Annotations"}),e.map(((e,t)=>{
642
642
  const n=Jo(e),r=Xo(e),o=Rm(e.text),i=o===`<p>${e.text}</p>`?e.text:o;return Pe("article",{children:[Pe("h2",{children:["Annotation ",t+1,":"]}),Pe("table",{children:Pe("tbody",{style:{verticalAlign:"top"},children:[Pe("tr",{children:[Pe("td",{children:"Created at:"}),Pe("td",{children:Pe("time",{dateTime:e.created,children:Cp(new Date(e.created))})})]}),Pe("tr",{children:[Pe("td",{children:"Author:"}),Pe("td",{children:c(e)})]}),n&&Pe("tr",{children:[Pe("td",{children:"Page:"}),Pe("td",{children:n})]}),Pe("tr",{children:[Pe("td",{children:"Type:"}),Pe("td",{children:Yo(e)})]}),r&&Pe("tr",{children:[Pe("td",{children:"Quote:"}),Pe("td",{children:Pe("blockquote",{style:{margin:0},children:r})})]}),Pe("tr",{children:[Pe("td",{children:"Comment:"}),Pe("td",{dangerouslySetInnerHTML:{__html:i}})]}),e.tags.length>0&&Pe("tr",{children:[Pe("td",{children:"Tags:"}),Pe("td",{children:e.tags.join(", ")})]})]})})]},e.id)}))]})]})]}),{},{pretty:!0}).replace(/\t/g," ")}
643
643
  _exportCommon(e,{displayNamesEnabled:t,defaultAuthority:n}){const[r]=e;if(!r)throw new Error("No annotations to export");const o=e=>ls(e,n,t),{uri:i,title:a}=Lo(r);return{uri:i,title:a,uniqueUsers:[...new Set(e.map((e=>o(e))).filter(Boolean))],replies:e.filter((e=>Do(e))),extractUsername:o}}}Tb.$inject=[];class Cb extends Error{constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),n&&(r+=`: ${n}`),super(r),B(this,"url",void 0),B(this,"response",void 0),B(this,"reason",void 0),this.url=e,this.response=t,this.reason=n}}async function Mb(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Cb(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new Cb(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Cb(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}class Ib{constructor(e,t,n){B(this,"_clientId",void 0),B(this,"search",void 0),B(this,"annotation",void 0),B(this,"group",void 0),B(this,"groups",void 0),B(this,"profile",void 0),
644
- B(this,"analytics",void 0),this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,i]=await Promise.all([e,n()]),l=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!l)throw new Error(`Missing API route: ${t}`);const c={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1479.0"};i&&(c.Authorization="Bearer "+i);const u=r();u&&(c["X-Client-Id"]=u);const{url:d,unusedParams:h}=oa(l.url,a),m=new URL(d);for(const[e,t]of Object.entries(h)){const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&m.searchParams.append(e,t.toString())}return await Mb(m.toString(),{body:s?JSON.stringify(Nb(s)):null,headers:c,method:l.method})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,
644
+ B(this,"analytics",void 0),this._clientId=null;const r=e.routes(),o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,i]=await Promise.all([e,n()]),l=function(e,t){let n=e;const r=t.split(".");for(const[e,t]of r.entries()){const o=n[t];if(!o||"url"in o){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!l)throw new Error(`Missing API route: ${t}`);const c={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1480.0"};i&&(c.Authorization="Bearer "+i);const u=r();u&&(c["X-Client-Id"]=u);const{url:d,unusedParams:h}=oa(l.url,a),m=new URL(d);for(const[e,t]of Object.entries(h)){const n=Array.isArray(t)?t:[t];for(const t of n)null!=t&&m.searchParams.append(e,t.toString())}return await Mb(m.toString(),{body:s?JSON.stringify(Nb(s)):null,headers:c,method:l.method})}finally{i()}}}(r,e,{getAccessToken:()=>t.getAccessToken(),getClientId:o,onRequestStarted:n.apiRequestStarted,
645
645
  onRequestFinished:n.apiRequestFinished});this.search=i("search"),this.annotation={create:i("annotation.create"),delete:i("annotation.delete"),get:i("annotation.read"),update:i("annotation.update"),flag:i("annotation.flag"),hide:i("annotation.hide"),unhide:i("annotation.unhide")},this.group={member:{delete:i("group.member.delete")},read:i("group.read")},this.groups={list:i("groups.read")},this.profile={groups:{read:i("profile.groups.read")},read:i("profile.read"),update:i("profile.update")},this.analytics={events:{create:i("analytics.events.create")}}}setClientId(e){this._clientId=e}}Ib.$inject=["apiRoutes","auth","store"];var zb={};function Lb(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,
646
646
  this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Ob=Lb;Lb.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Lb.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Lb.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(void 0===n){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout((function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout((function(){r._operationTimeoutCb(r._attempts)}),r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)}),n),
647
647
  this._options.unref&&this._timer.unref(),!0},Lb.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var n=this;this._operationTimeoutCb&&(this._timeout=setTimeout((function(){n._operationTimeoutCb()}),n._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},Lb.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Lb.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Lb.prototype.start=Lb.prototype.try,Lb.prototype.errors=function(){return this._errors},Lb.prototype.attempts=function(){return this._attempts},Lb.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,n=0,r=0;r<this._errors.length;r++){var o=this._errors[r],i=o.message,a=(e[i]||0)+1;e[i]=a,a>=n&&(t=o,n=a)}return t},function(e){var t=Ob;e.operation=function(n){var r=e.timeouts(n);return new t(r,{
@@ -757,7 +757,7 @@ this._window.setTimeout((()=>this._store.highlightAnnotations([])),5e3));const t
757
757
  }else console.error("Gave up trying to reconnect to Hypothesis real time update service")})),o.on("error",(e=>this._handleSocketError(t,e))),o.on("message",(e=>this._handleSocketMessage(e))),this._socket=o,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){var t;this._updateImmediately=null===(t=e.applyUpdatesImmediately)||void 0===t||t,this._reconnectSetUp||(this._reconnectSetUp=!0,Zb(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}Wk.$inject=["store","apiRoutes","auth","groups","session","$window"];const Yk="hypothesis.user.tags.list",Kk="hypothesis.user.tags.map";class Xk{constructor(e){B(this,"_storage",void 0),this._storage=e}filter(e,t=null){const n=this._storage.getObject(Yk)||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${yv(e)}`,"i")
758
758
  ;return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject(Kk)||{};e.forEach((e=>{t[e]?(t[e].count+=1,t[e].updated=Date.now()):t[e]={text:e,count:1,updated:Date.now()}})),this._storage.setObject(Kk,t);const n=Object.keys(t).sort(((e,n)=>t[e].count!==t[n].count?t[n].count-t[e].count:e.localeCompare(n)));this._storage.setObject(Yk,n)}}Xk.$inject=["localStorage"];class Qk{constructor(e){B(this,"_store",void 0),this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}Qk.$inject=["store"];class Jk extends eg{constructor(e,t){super(),B(this,"_store",void 0),B(this,"_window",void 0),B(this,"_delayedMessageQueue",void 0),this._store=e,this._window=t,this._delayedMessageQueue=[],this._window.addEventListener("focus",(()=>{this._delayedMessageQueue.forEach((({type:e,messageText:t,options:n})=>this._addMessage(e,t,n))),this._delayedMessageQueue=[]}))}dismiss(e){
759
759
  this._store.getToastMessage(e)&&(this._store.removeToastMessage(e),this.emit("toastMessageDismissed",e))}_addMessage(e,t,{autoDismiss:n=!0,visuallyHidden:r=!1,delayed:o=!1}={}){if(this._store.hasToastMessage(e,t))return;if(o&&!this._window.document.hasFocus()){const o={autoDismiss:n,visuallyHidden:r};return void this._delayedMessageQueue.push({type:e,messageText:t,options:o})}const i={type:e,id:dv(10),message:t,visuallyHidden:r,autoDismiss:n};this._store.addToastMessage(i),this.emit("toastMessageAdded",i)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}Jk.$inject=["store","$window"];const Zk=function(e){for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),eN=function(e){const{version:t,origin:n}=mv(e.location.href)
760
- ;return"1.1479.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1479.0) than the host page (${t}). It may not work.`),!1):"null"===e.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):e.origin===n||(console.warn(`The Hypothesis sidebar is running in a different origin (${e.origin}) than expected (${n}). It may not work.`),!1)}(window);function tN(e,t){e.setClientId(t.clientId)}function nN(e,t,n){e.load(),t.load(),n.sync()}function rN(e,t,n){e.init(),t.init(),n.init()}function oN(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{autoDismiss:!1})}))}Zk.sentry&&eN&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;zk({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1479.0",beforeSend:(e,t)=>{
760
+ ;return"1.1480.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.1480.0) than the host page (${t}). It may not work.`),!1):"null"===e.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):e.origin===n||(console.warn(`The Hypothesis sidebar is running in a different origin (${e.origin}) than expected (${n}). It may not work.`),!1)}(window);function tN(e,t){e.setClientId(t.clientId)}function nN(e,t,n){e.load(),t.load(),n.sync()}function rN(e,t,n){e.init(),t.init(),n.init()}function oN(e,t,n){"sidebar"===t.route()&&e.connect().catch((()=>{n.error("Hypothesis failed to connect to the web page. Try reloading the page.",{autoDismiss:!1})}))}Zk.sentry&&eN&&function(e){const t=function(){const e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;zk({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1480.0",beforeSend:(e,t)=>{
761
761
  if(Lk>=5)return _v("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Lk;try{const n=t&&t.originalException;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch(e){}return e}});try{Lw("host_config",mv(window.location.href))}catch(e){}Lw("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Vb(((e,t)=>{Ok(e,t)}))}(Zk.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;"A"===t.tagName&&"_blank"===t.target&&(t.rel="noopener")}))}(document.body),tN.$inject=["api","streamer"],nN.$inject=["groups","session","router"],rN.$inject=["autosaveService","persistedDefaults","serviceURL"],oN.$inject=["frameSync","store","toastMessenger"];const iN=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",Sv)}(),async function(e,t=window){const n=function(e){
762
762
  const t=mv(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:pv,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:gv(t.origin),ancestorLevel:fv(t.ancestorLevel)}}},o={};for(const[e,i]of Object.entries(t))n.includes(e)&&null!==i&&(r[e]?o[e]=r[e](i):o[e]=i);return o}(window),r=function(e,t){const n=e.requestConfigFromFrame;if(!n)return null;if("number"!=typeof n.ancestorLevel||"string"!=typeof n.origin)throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified");return{targetFrame:vv(n.ancestorLevel,t),origin:n.origin}}(n,t);let o;if(r){const e=await async function(e,t){return{...await hv(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(n,r);o=function(e,t){const n=e.services
763
763
  ;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=hv(t.targetFrame,t.origin,"requestGroups",[n],0).catch((()=>{throw new Error("Unable to fetch groups")})))})),e):e}(e,r)}else o=n;const i={...e,...o};return r&&(i.rpc=r),i.apiUrl=function(e){const t=Kr(e);if(!t)return e.apiUrl;if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}(i),i}(Zk).then((e=>{!function(e,t){const n=new q