hypothesis 1.969.0 → 1.970.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 +10 -10
- package/build/scripts/annotator.bundle.js +69 -69
- package/build/scripts/annotator.bundle.js.map +1 -1
- package/build/scripts/sidebar.bundle.js +231 -231
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/styles/annotator.css +521 -1
- package/build/styles/annotator.css.map +1 -1
- package/build/styles/sidebar.css +548 -1
- package/build/styles/sidebar.css.map +1 -1
- package/package.json +1 -1
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
function e(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var t,n,r,o,i,a,s,l={},c=[],u=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function h(e,t){for(var n in t)e[n]=t[n];return e}function d(e){var t=e.parentNode;t&&t.removeChild(e)}function p(e,t,o,i,a){var s={type:e,props:t,key:o,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==a?++r:a};return null==a&&null!=n.vnode&&n.vnode(s),s}function m(e){return e.children}function f(e,t){this.props=e,this.context=t}function g(e,t){if(null==t)return e.__?g(e.__,e.__.__k.indexOf(e)+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?g(e):null}function v(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 v(e)}}function y(e){
|
|
2
|
-
(!e.__d&&(e.__d=!0)&&o.push(e)&&!_.__r++||a!==n.debounceRendering)&&((a=n.debounceRendering)||i)(_)}function _(){for(var e;_.__r=o.length;)e=o.sort((function(e,t){return e.__v.__b-t.__v.__b})),o=[],e.some((function(e){var t,n,r,o,i,a;e.__d&&(i=(o=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=h({},o)).__v=o.__v+1,
|
|
2
|
+
(!e.__d&&(e.__d=!0)&&o.push(e)&&!_.__r++||a!==n.debounceRendering)&&((a=n.debounceRendering)||i)(_)}function _(){for(var e;_.__r=o.length;)e=o.sort((function(e,t){return e.__v.__b-t.__v.__b})),o=[],e.some((function(e){var t,n,r,o,i,a;e.__d&&(i=(o=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=h({},o)).__v=o.__v+1,T(a,o,r,t.__n,void 0!==a.ownerSVGElement,null!=o.__h?[i]:null,n,null==i?g(o):i,o.__h),N(n,o),o.__e!=i&&v(o)))}))}function b(e,t,n,r,o,i,a,s,u,h){var d,f,v,y,_,b,x,S=r&&r.__k||c,C=S.length;for(n.__k=[],d=0;d<t.length;d++)if(null!=(y=n.__k[d]=null==(y=t[d])||"boolean"==typeof y?null:"string"==typeof y||"number"==typeof y||"bigint"==typeof y?p(null,y,null,null,y):Array.isArray(y)?p(m,{children:y},null,null,null):y.__b>0?p(y.type,y.props,y.key,null,y.__v):y)){if(y.__=n,y.__b=n.__b+1,null===(v=S[d])||v&&y.key==v.key&&y.type===v.type)S[d]=void 0;else for(f=0;f<C;f++){if((v=S[f])&&y.key==v.key&&y.type===v.type){S[f]=void 0;break}v=null}T(e,y,v=v||l,o,i,a,s,u,h),_=y.__e,(f=y.ref)&&v.ref!=f&&(x||(x=[]),
|
|
3
3
|
v.ref&&x.push(v.ref,null,y),x.push(f,y.__c||_,y)),null!=_?(null==b&&(b=_),"function"==typeof y.type&&y.__k===v.__k?y.__d=u=w(y,u,e):u=k(e,y,v,S,_,u),"function"==typeof n.type&&(n.__d=u)):u&&v.__e==u&&u.parentNode!=e&&(u=g(v))}for(n.__e=b,d=C;d--;)null!=S[d]&&("function"==typeof n.type&&null!=S[d].__e&&S[d].__e==n.__d&&(n.__d=g(r,d+1)),z(S[d],S[d]));if(x)for(d=0;d<x.length;d++)M(x[d],x[++d],x[++d])}function w(e,t,n){for(var r,o=e.__k,i=0;o&&i<o.length;i++)(r=o[i])&&(r.__=e,t="function"==typeof r.type?w(r,t,n):k(n,r,r,o,r.__e,t));return t}function x(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){x(e,t)})):t.push(e)),t}function k(e,t,n,r,o,i){var a,s,l;if(void 0!==t.__d)a=t.__d,t.__d=void 0;else if(null==n||o!=i||null==o.parentNode)e:if(null==i||i.parentNode!==e)e.appendChild(o),a=null;else{for(s=i,l=0;(s=s.nextSibling)&&l<r.length;l+=2)if(s==o)break e;e.insertBefore(o,i),a=i}return void 0!==a?a:o.nextSibling}function S(e,t,n){
|
|
4
|
-
"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||u.test(t)?n:n+"px"}function C(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||S(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||S(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?
|
|
4
|
+
"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||u.test(t)?n:n+"px"}function C(e,t,n,r,o){var i;e:if("style"===t)if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||S(e.style,t,"");if(n)for(t in n)r&&n[t]===r[t]||S(e.style,t,n[t])}else if("o"===t[0]&&"n"===t[1])i=t!==(t=t.replace(/Capture$/,"")),t=t.toLowerCase()in e?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r||e.addEventListener(t,i?E:A,i):e.removeEventListener(t,i?E:A,i);else if("dangerouslySetInnerHTML"!==t){if(o)t=t.replace(/xlink[H:h]/,"h").replace(/sName$/,"s");else if("href"!==t&&"list"!==t&&"form"!==t&&"tabIndex"!==t&&"download"!==t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null!=n&&(!1!==n||"a"===t[0]&&"r"===t[1])?e.setAttribute(t,n):e.removeAttribute(t))}}function A(e){this.l[e.type+!1](n.event?n.event(e):e)}function E(e){this.l[e.type+!0](n.event?n.event(e):e)}function T(e,t,r,o,i,a,s,l,c){
|
|
5
5
|
var u,d,p,g,v,y,_,w,x,k,S,C=t.type;if(void 0!==t.constructor)return null;null!=r.__h&&(c=r.__h,l=t.__e=r.__e,t.__h=null,a=[l]),(u=n.__b)&&u(t);try{e:if("function"==typeof C){if(w=t.props,x=(u=C.contextType)&&o[u.__c],k=u?x?x.props.value:u.__:o,r.__c?_=(d=t.__c=r.__c).__=d.__E:("prototype"in C&&C.prototype.render?t.__c=d=new C(w,k):(t.__c=d=new f(w,k),d.constructor=C,d.render=O),x&&x.sub(d),d.props=w,d.state||(d.state={}),d.context=k,d.__n=o,p=d.__d=!0,d.__h=[]),null==d.__s&&(d.__s=d.state),null!=C.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=h({},d.__s)),h(d.__s,C.getDerivedStateFromProps(w,d.__s))),g=d.props,v=d.state,p)null==C.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(null==C.getDerivedStateFromProps&&w!==g&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(w,k),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(w,d.__s,k)||t.__v===r.__v){d.props=w,d.state=d.__s,
|
|
6
6
|
t.__v!==r.__v&&(d.__d=!1),d.__v=t,t.__e=r.__e,t.__k=r.__k,t.__k.forEach((function(e){e&&(e.__=t)})),d.__h.length&&s.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(w,d.__s,k),null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(g,v,y)}))}d.context=k,d.props=w,d.state=d.__s,(u=n.__r)&&u(t),d.__d=!1,d.__v=t,d.__P=e,u=d.render(d.props,d.state,d.context),d.state=d.__s,null!=d.getChildContext&&(o=h(h({},o),d.getChildContext())),p||null==d.getSnapshotBeforeUpdate||(y=d.getSnapshotBeforeUpdate(g,v)),S=null!=u&&u.type===m&&null==u.key?u.props.children:u,b(e,Array.isArray(S)?S:[S],t,r,o,i,a,s,l,c),d.base=t.__e,t.__h=null,d.__h.length&&s.push(d),_&&(d.__E=d.__=null),d.__e=!1}else null==a&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=L(r.__e,t,r,o,i,a,s,c);(u=n.diffed)&&u(t)}catch(e){t.__v=null,(c||null!=a)&&(t.__e=l,t.__h=!!c,a[a.indexOf(l)]=null),n.__e(e,t,r)}}function N(e,t){n.__c&&n.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){
|
|
7
7
|
n.__e(e,t.__v)}}))}function L(e,n,r,o,i,a,s,c){var u,h,p,m=r.props,f=n.props,v=n.type,y=0;if("svg"===v&&(i=!0),null!=a)for(;y<a.length;y++)if((u=a[y])&&"setAttribute"in u==!!v&&(v?u.localName===v:3===u.nodeType)){e=u,a[y]=null;break}if(null==e){if(null===v)return document.createTextNode(f);e=i?document.createElementNS("http://www.w3.org/2000/svg",v):document.createElement(v,f.is&&f),a=null,c=!1}if(null===v)m===f||c&&e.data===f||(e.data=f);else{if(a=a&&t.call(e.childNodes),h=(m=r.props||l).dangerouslySetInnerHTML,p=f.dangerouslySetInnerHTML,!c){if(null!=a)for(m={},y=0;y<e.attributes.length;y++)m[e.attributes[y].name]=e.attributes[y].value;(p||h)&&(p&&(h&&p.__html==h.__html||p.__html===e.innerHTML)||(e.innerHTML=p&&p.__html||""))}if(function(e,t,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in t||C(e,i,null,n[i],r);for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||C(e,i,t[i],n[i],r)}(e,f,m,i,c),p)n.__k=[];else if(y=n.props.children,
|
|
8
|
-
b(e,Array.isArray(y)?y:[y],n,r,o,i&&"foreignObject"!==v,a,s,a?a[0]:r.__k&&g(r,0),c),null!=a)for(y=a.length;y--;)null!=a[y]&&d(a[y]);c||("value"in f&&void 0!==(y=f.value)&&(y!==m.value||y!==e.value||"progress"===v&&!y)&&C(e,"value",y,m.value,!1),"checked"in f&&void 0!==(y=f.checked)&&y!==e.checked&&C(e,"checked",y,m.checked,!1))}return e}function M(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,r)}}function z(e,t,r){var o,i;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||M(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&z(o[i],t,"function"!=typeof e.type);r||null==e.__e||d(e.__e),e.__e=e.__d=void 0}function O(e,t,n){return this.constructor(e,n)}function I(e,r,o){var i,a,s;n.__&&n.__(e,r),a=(i="function"==typeof o)?null:o&&o.__k||r.__k,s=[],
|
|
9
|
-
;if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return p(e,s,o,i,null)}(m,null,[e]),a||l,l,void 0!==r.ownerSVGElement,!i&&o?[o]:a?null:r.firstChild?t.call(r.childNodes):null,s,!i&&o?o:a?a.__e:r.firstChild,i),N(s,e)}function
|
|
10
|
-
const t=
|
|
8
|
+
b(e,Array.isArray(y)?y:[y],n,r,o,i&&"foreignObject"!==v,a,s,a?a[0]:r.__k&&g(r,0),c),null!=a)for(y=a.length;y--;)null!=a[y]&&d(a[y]);c||("value"in f&&void 0!==(y=f.value)&&(y!==m.value||y!==e.value||"progress"===v&&!y)&&C(e,"value",y,m.value,!1),"checked"in f&&void 0!==(y=f.checked)&&y!==e.checked&&C(e,"checked",y,m.checked,!1))}return e}function M(e,t,r){try{"function"==typeof e?e(t):e.current=t}catch(e){n.__e(e,r)}}function z(e,t,r){var o,i;if(n.unmount&&n.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||M(o,null,t)),null!=(o=e.__c)){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(e){n.__e(e,t)}o.base=o.__P=null}if(o=e.__k)for(i=0;i<o.length;i++)o[i]&&z(o[i],t,"function"!=typeof e.type);r||null==e.__e||d(e.__e),e.__e=e.__d=void 0}function O(e,t,n){return this.constructor(e,n)}function I(e,r,o){var i,a,s;n.__&&n.__(e,r),a=(i="function"==typeof o)?null:o&&o.__k||r.__k,s=[],T(r,e=(!i&&o||r).__k=function(e,n,r){var o,i,a,s={};for(a in n)"key"==a?o=n[a]:"ref"==a?i=n[a]:s[a]=n[a]
|
|
9
|
+
;if(arguments.length>2&&(s.children=arguments.length>3?t.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(a in e.defaultProps)void 0===s[a]&&(s[a]=e.defaultProps[a]);return p(e,s,o,i,null)}(m,null,[e]),a||l,l,void 0!==r.ownerSVGElement,!i&&o?[o]:a?null:r.firstChild?t.call(r.childNodes):null,s,!i&&o?o:a?a.__e:r.firstChild,i),N(s,e)}function R(e){const t=new URL(e).hash.slice(1),n=new URLSearchParams(t).get("config");return JSON.parse(n||"{}")}function P({services:e}){return Array.isArray(e)&&e[0]?e[0]:null}function D(e){const t=P(e);if(t){if(t.apiUrl)return t.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}function B(e){if("string"==typeof e&&"false"===e.trim().toLocaleLowerCase())return!1;const t=Number(e);return isNaN(t)?"string"==typeof e:Boolean(t)}function F(e){return parseInt(e)}function j(e){return e&&"function"==typeof e.toString?e.toString():""}function H(e){
|
|
10
|
+
const t=R(e.location.href),n=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],r={openSidebar:B,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:j(t.origin),ancestorLevel:F(t.ancestorLevel)}}};return Object.keys(t).reduce(((e,o)=>(-1!==n.indexOf(o)&&null!==t[o]&&(r[o]?e[o]=r[o](t[o]):e[o]=t[o]),e)),{})}function U(e){const t=e.toString(16);return 1===t.length?"0"+t:t}function q(e){const t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t).map(U).join("")}function $(e,t,n,r=[],o=2e3,i=window){const a=q(10),s={jsonrpc:"2.0",method:n,params:r,id:a};try{e.postMessage(s,t)}catch(e){return Promise.reject(e)}let l;const c=new Promise(((e,n)=>{l=r=>{if(r.origin!==t)return;if(!(r.data instanceof Object)||"2.0"!==r.data.jsonrpc||r.data.id!==a)return;const{error:o,result:i}=r.data
|
|
11
11
|
;void 0!==o?n(o):void 0!==i?e(i):n(new Error("RPC reply had no result or error"))},i.addEventListener("message",l)})),u=[c];var h,d;return o&&u.push((h=o,d=`Request to ${t} timed out`,new Promise(((e,t)=>{setTimeout((()=>t(new Error(d))),h)})))),Promise.race(u).then((e=>(i.removeEventListener("message",l),e))).catch((e=>{throw i.removeEventListener("message",l),e}))}function G(e,t=window){let n;return n=function(e,t=window){const n=[];for(let r of function(e){if(e===e.top)return[];const t=[];do{e=e.parent,t.push(e)}while(e!==e.top);return t}(t)){const t=$(r,e,"requestConfig",[],3e3);n.push(t)}return 0===n.length&&n.push(Promise.reject(new Error("Client is top frame"))),Promise.race(n)}(H(t).requestConfigFromFrame,t),n.then((t=>{const n=Object.assign({},e,t);return n.apiUrl=D(n),n}))}function V(e,t){const n={...e,...t};return n.apiUrl=D(n),n}async function W(e,t,n){return async function(e,t){Array.isArray(e.services)&&e.services.forEach(((e,n)=>{
|
|
12
12
|
"$rpc:requestGroups"===e.groups&&(e.groups=t("requestGroups",[n],null).catch((()=>{throw new Error("Unable to fetch groups")})))}));return e}(V(e,await $(t,n,"requestConfig",[],3e3)),((e,r=[],o=3e3)=>$(t,n,e,r,o)))}t=c.slice,n={__e:function(e,t){for(var n,r,o;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),o=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e),o=n.__d),o)return n.__E=n}catch(t){e=t}throw e}},r=0,f.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=h({},this.state),"function"==typeof e&&(e=e(h({},n),this.props)),e&&h(n,e),null!=e&&this.__v&&(t&&this.__h.push(t),y(this))},f.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),y(this))},f.prototype.render=m,o=[],i="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_.__r=0,s=0;let Y={};function K(...e){const t=e.join();t in Y||(console.warn(...e),Y[t]=!0)}
|
|
13
|
-
K.reset=()=>{Y={}};var X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Z=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};function J(e,t,n,r){const o=t.find((e=>"__world__"===e.id));o&&e.unshift(o);const i=e.map((e=>e.id));t=t.filter((e=>!i.includes(e.id))),t.forEach((e=>e.isMember=!1)),e.forEach((e=>e.isMember=!0));const a=e.concat(t);return a.forEach((e=>{e.canLeave=!!function(e){const t=
|
|
13
|
+
K.reset=()=>{Y={}};var X="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Z=e=>{if("string"!=typeof e)throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};function J(e,t,n,r){const o=t.find((e=>"__world__"===e.id));o&&e.unshift(o);const i=e.map((e=>e.id));t=t.filter((e=>!i.includes(e.id))),t.forEach((e=>e.isMember=!1)),e.forEach((e=>e.isMember=!0));const a=e.concat(t);return a.forEach((e=>{e.canLeave=!!function(e){const t=P(e);return!t||!!t.allowLeavingGroups}(r)&&"private"===e.type})),a.forEach((e=>e.isScopedToUri=function(e,t){if(e.scopes&&e.scopes.uri_patterns.length>0&&t)return function(e,t){return void 0!==t.find((t=>e.match(t.split("*").map(Z).join(".*"))))}(t,e.scopes.uri_patterns);return!0}(e,n))),a}let Q=[];function ee(e,t,n){const r=(e=>({changeFocusModeUser:t=>{var n;e.changeFocusModeUser(t)
|
|
14
14
|
;const r=null!==(n=null==t?void 0:t.groups)&&void 0!==n?n:[],o=function(e,t){return function(e,t){return t.filter((t=>e.includes(t.id)||t.groupid&&e.includes(t.groupid)))}(e,t).map((e=>e.id))}(r,e.allGroups());r.length&&!o.length&&console.error("No matching groups found in list of filtered group IDs"),e.filterGroups(o)}}))(e);function o(e){let n=t.rpcAllowedOrigins||[];if(null==(o=e.data)||"object"!=typeof o||"2.0"!==o.jsonrpc)return;var o;if(!n.includes(e.origin))return void K(`Ignoring JSON-RPC request from non-whitelisted origin ${e.origin}`);let i=e.data;e.source.postMessage(function(e){const t=r[e.method];if(void 0===t)return{jsonrpc:"2.0",id:e.id,error:{code:-32601,message:"Method not found"}};e.params?t(...e.params):t();return{jsonrpc:"2.0",result:"ok",id:e.id}}(i),e.origin)}Q.forEach((e=>{o(e)})),Q=[],window.removeEventListener("message",te),n.addEventListener("message",o)}function te(e){Q.push(e)}ee.$inject=["store","settings","$window"];var ne=function(e,t){return ne=Object.setPrototypeOf||{
|
|
15
15
|
__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},ne(e,t)};function re(e,t){function n(){this.constructor=e}ne(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var oe,ie=function(){return ie=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},ie.apply(this,arguments)};function ae(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function se(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,o,i=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=i.next()).done;)a.push(r.value)}catch(e){o={error:e}}finally{try{r&&!r.done&&(n=i.return)&&n.call(i)
|
|
16
16
|
}finally{if(o)throw o.error}}return a}function le(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(se(arguments[t]));return e}!function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"}(oe||(oe={}));var ce=["fatal","error","warning","log","info","debug","critical"];function ue(){return"undefined"!=typeof __SENTRY_NO_DEBUG__&&!__SENTRY_BROWSER_BUNDLE__}function he(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}var de={};function pe(){return he()?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:de}var me=Object.prototype.toString;function fe(e){switch(me.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return Ce(e,Error)}}function ge(e,t){return me.call(e)==="[object "+t+"]"}function ve(e){return ge(e,"ErrorEvent")}function ye(e){
|
|
17
|
-
return ge(e,"DOMError")}function _e(e){return ge(e,"String")}function be(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function we(e){return ge(e,"Object")}function xe(e){return"undefined"!=typeof Event&&Ce(e,Event)}function ke(e){return"undefined"!=typeof Element&&Ce(e,Element)}function Se(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function Ce(e,t){try{return e instanceof t}catch(e){return!1}}function Ae(e,t){try{for(var n=e,r=[],o=0,i=0,a=" > ".length,s=void 0;n&&o++<5&&!("html"===(s=
|
|
18
|
-
(n=s.className)&&_e(n))for(r=n.split(/\s+/),a=0;a<r.length;a++)l.push("."+r[a]);var u=["type","name","title","alt"];for(a=0;a<u.length;a++)o=u[a],(i=s.getAttribute(o))&&l.push("["+o+'="'+i+'"]');return l.join("")}var
|
|
19
|
-
path:e.path||"",projectId:e.projectId}}function Oe(e){var t="string"==typeof e?function(e){var t=Le.exec(e);if(!t)throw new Ne("Invalid Sentry Dsn: "+e);var n=se(t.slice(1),6),r=n[0],o=n[1],i=n[2],a=void 0===i?"":i,s=n[3],l=n[4],c=void 0===l?"":l,u="",h=n[5],d=h.split("/");if(d.length>1&&(u=d.slice(0,-1).join("/"),h=d.pop()),h){var p=h.match(/^\d+/);p&&(h=p[0])}return ze({host:s,pass:a,path:u,projectId:h,port:c,protocol:r,publicKey:o})}(e):ze(e);return function(e){if(ue()){var t=e.port,n=e.projectId,r=e.protocol;if(["protocol","publicKey","host","projectId"].forEach((function(t){if(!e[t])throw new Ne("Invalid Sentry Dsn: "+t+" missing")})),!n.match(/^\d+$/))throw new Ne("Invalid Sentry Dsn: Invalid projectId "+n);if(!function(e){return"http"===e||"https"===e}(r))throw new Ne("Invalid Sentry Dsn: Invalid protocol "+r);if(t&&isNaN(parseInt(t,10)))throw new Ne("Invalid Sentry Dsn: Invalid port "+t)}}(t),t}var Ie=pe(),
|
|
20
|
-
;var n=t.console,r={};["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var o=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),o}var De=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&
|
|
17
|
+
return ge(e,"DOMError")}function _e(e){return ge(e,"String")}function be(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function we(e){return ge(e,"Object")}function xe(e){return"undefined"!=typeof Event&&Ce(e,Event)}function ke(e){return"undefined"!=typeof Element&&Ce(e,Element)}function Se(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function Ce(e,t){try{return e instanceof t}catch(e){return!1}}function Ae(e,t){try{for(var n=e,r=[],o=0,i=0,a=" > ".length,s=void 0;n&&o++<5&&!("html"===(s=Ee(n,t))||o>1&&i+r.length*a+s.length>=80);)r.push(s),i+=s.length,n=n.parentNode;return r.reverse().join(" > ")}catch(e){return"<unknown>"}}function Ee(e,t){var n,r,o,i,a,s=e,l=[];if(!s||!s.tagName)return"";l.push(s.tagName.toLowerCase());var c=t&&t.length?t.filter((function(e){return s.getAttribute(e)})).map((function(e){return[e,s.getAttribute(e)]})):null;if(c&&c.length)c.forEach((function(e){l.push("["+e[0]+'="'+e[1]+'"]')}));else if(s.id&&l.push("#"+s.id),
|
|
18
|
+
(n=s.className)&&_e(n))for(r=n.split(/\s+/),a=0;a<r.length;a++)l.push("."+r[a]);var u=["type","name","title","alt"];for(a=0;a<u.length;a++)o=u[a],(i=s.getAttribute(o))&&l.push("["+o+'="'+i+'"]');return l.join("")}var Te=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){return e.__proto__=t,e}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(e,n)||(e[n]=t[n]);return e});var Ne=function(e){function t(t){var n=this.constructor,r=e.call(this,t)||this;return r.message=t,r.name=n.prototype.constructor.name,Te(r,n.prototype),r}return re(t,e),t}(Error),Le=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function Me(e,t){void 0===t&&(t=!1);var n=e.host,r=e.path,o=e.pass,i=e.port,a=e.projectId;return e.protocol+"://"+e.publicKey+(t&&o?":"+o:"")+"@"+n+(i?":"+i:"")+"/"+(r?r+"/":r)+a}function ze(e){return"user"in e&&!("publicKey"in e)&&(e.publicKey=e.user),{user:e.publicKey||"",protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",
|
|
19
|
+
path:e.path||"",projectId:e.projectId}}function Oe(e){var t="string"==typeof e?function(e){var t=Le.exec(e);if(!t)throw new Ne("Invalid Sentry Dsn: "+e);var n=se(t.slice(1),6),r=n[0],o=n[1],i=n[2],a=void 0===i?"":i,s=n[3],l=n[4],c=void 0===l?"":l,u="",h=n[5],d=h.split("/");if(d.length>1&&(u=d.slice(0,-1).join("/"),h=d.pop()),h){var p=h.match(/^\d+/);p&&(h=p[0])}return ze({host:s,pass:a,path:u,projectId:h,port:c,protocol:r,publicKey:o})}(e):ze(e);return function(e){if(ue()){var t=e.port,n=e.projectId,r=e.protocol;if(["protocol","publicKey","host","projectId"].forEach((function(t){if(!e[t])throw new Ne("Invalid Sentry Dsn: "+t+" missing")})),!n.match(/^\d+$/))throw new Ne("Invalid Sentry Dsn: Invalid projectId "+n);if(!function(e){return"http"===e||"https"===e}(r))throw new Ne("Invalid Sentry Dsn: Invalid protocol "+r);if(t&&isNaN(parseInt(t,10)))throw new Ne("Invalid Sentry Dsn: Invalid port "+t)}}(t),t}var Ie=pe(),Re="Sentry Logger ";function Pe(e){var t=pe();if(!("console"in t))return e()
|
|
20
|
+
;var n=t.console,r={};["debug","info","warn","error","log","assert"].forEach((function(e){e in t.console&&n[e].__sentry_original__&&(r[e]=n[e],n[e]=n[e].__sentry_original__)}));var o=e();return Object.keys(r).forEach((function(e){n[e]=r[e]})),o}var De=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Pe((function(){Ie.console.log(Re+"[Log]: "+e.join(" "))}))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Pe((function(){Ie.console.warn(Re+"[Warn]: "+e.join(" "))}))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this._enabled&&Pe((function(){Ie.console.error(Re+"[Error]: "+e.join(" "))}))},e}();Ie.__SENTRY__=Ie.__SENTRY__||{};var Be=Ie.__SENTRY__.logger||(Ie.__SENTRY__.logger=new De);function Fe(e){try{
|
|
21
21
|
return e&&"function"==typeof e&&e.name||"<anonymous>"}catch(e){return"<anonymous>"}}function je(e,t){return void 0===t&&(t=0),"string"!=typeof e||0===t||e.length<=t?e:e.substr(0,t)+"..."}function He(e,t){if(!Array.isArray(e))return"";for(var n=[],r=0;r<e.length;r++){var o=e[r];try{n.push(String(o))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function Ue(e,t){return!!_e(e)&&(ge(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function qe(e,t,n){if(t in e){var r=e[t],o=n(r);if("function"==typeof o)try{Ge(o,r)}catch(e){}e[t]=o}}function $e(e,t,n){Object.defineProperty(e,t,{value:n})}function Ge(e,t){var n=t.prototype||{};e.prototype=t.prototype=n,$e(e,"__sentry_original__",t)}function Ve(e){return e.__sentry_original__}function We(e){if(fe(e)){var t=e,n={message:t.message,name:t.name,stack:t.stack};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=t[r]);return n}if(xe(e)){var o=e,i={};i.type=o.type;try{
|
|
22
22
|
i.target=ke(o.target)?Ae(o.target):Object.prototype.toString.call(o.target)}catch(e){i.target="<unknown>"}try{i.currentTarget=ke(o.currentTarget)?Ae(o.currentTarget):Object.prototype.toString.call(o.currentTarget)}catch(e){i.currentTarget="<unknown>"}for(var a in"undefined"!=typeof CustomEvent&&Ce(e,CustomEvent)&&(i.detail=o.detail),o)Object.prototype.hasOwnProperty.call(o,a)&&(i[a]=o[a]);return i}return e}function Ye(e){return function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(e))}function Ke(e,t,n){void 0===t&&(t=3),void 0===n&&(n=102400);var r=Je(e,t);return Ye(r)>n?Ke(e,t-1,n):r}function Xe(e,t){
|
|
23
23
|
return"domain"===t&&e&&"object"==typeof e&&e._events?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!=typeof global&&e===global?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":we(n=e)&&"nativeEvent"in n&&"preventDefault"in n&&"stopPropagation"in n?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?"[Function: "+Fe(e)+"]":"symbol"==typeof e?"["+String(e)+"]":"bigint"==typeof e?"[BigInt: "+String(e)+"]":e;var n}function Ze(e,t,n,r){if(void 0===n&&(n=1/0),void 0===r&&(r=function(){var e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(var r=0;r<t.length;r++)if(t[r]===n)return!0;return t.push(n),!1},function(n){if(e)t.delete(n);else for(var r=0;r<t.length;r++)if(t[r]===n){t.splice(r,1);break}}]}()),0===n)return function(e){if("string"==typeof e)return e;var t=Object.prototype.toString.call(e)
|
|
@@ -29,27 +29,27 @@ n.head.appendChild(r),r.contentWindow&&r.contentWindow.fetch&&(t=nt(r.contentWin
|
|
|
29
29
|
return e.apply(this,t)}}it.onpopstate=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=it.location.href,o=ot;if(ot=r,ut("history",{from:o,to:r}),e)try{return e.apply(this,t)}catch(e){}},qe(it.history,"pushState",t),qe(it.history,"replaceState",t)}();break;case"error":gt=it.onerror,it.onerror=function(e,t,n,r,o){return ut("error",{column:r,error:o,line:n,msg:e,url:t}),!!gt&>.apply(this,arguments)};break;case"unhandledrejection":vt=it.onunhandledrejection,it.onunhandledrejection=function(e){return ut("unhandledrejection",e),!vt||vt.apply(this,arguments)};break;default:Be.warn("unknown instrumentation type:",e)}}function ct(e,t){at[e]=at[e]||[],at[e].push(t),lt(e)}function ut(e,t){var n,r;if(e&&at[e])try{for(var o=ae(at[e]||[]),i=o.next();!i.done;i=o.next()){var a=i.value;try{a(t)}catch(t){ue()&&Be.error("Error while triggering instrumentation handler.\nType: "+e+"\nName: "+Fe(a)+"\nError: "+t)}}}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{
|
|
30
30
|
if(n)throw n.error}}}function ht(e){return void 0===e&&(e=[]),"Request"in it&&Ce(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function dt(e){return void 0===e&&(e=[]),"string"==typeof e[0]?e[0]:"Request"in it&&Ce(e[0],Request)?e[0].url:String(e[0])}var pt,mt;function ft(e,t){return void 0===t&&(t=!1),function(n){if(n&&mt!==n&&!function(e){if("keypress"!==e.type)return!1;try{var t=e.target;if(!t||!t.tagName)return!0;if("INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable)return!1}catch(e){}return!0}(n)){var r="keypress"===n.type?"input":n.type;(void 0===pt||function(e,t){if(!e)return!0;if(e.type!==t.type)return!0;try{if(e.target!==t.target)return!0}catch(e){}return!1}(mt,n))&&(e({event:n,name:r,global:t}),mt=n),clearTimeout(pt),pt=it.setTimeout((function(){pt=void 0}),1e3)}}}var gt=null;var vt=null;function yt(){var e=pe(),t=e.crypto||e.msCrypto;if(void 0!==t&&t.getRandomValues){var n=new Uint16Array(8);t.getRandomValues(n),
|
|
31
31
|
n[3]=4095&n[3]|16384,n[4]=16383&n[4]|32768;var r=function(e){for(var t=e.toString(16);t.length<4;)t="0"+t;return t};return r(n[0])+r(n[1])+r(n[2])+r(n[3])+r(n[4])+r(n[5])+r(n[6])+r(n[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))}function _t(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}function bt(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function wt(e){var t=e.message,n=e.event_id;if(t)return t;var r=bt(e);return r?r.type&&r.value?r.type+": "+r.value:r.type||r.value||n||"<unknown>":n||"<unknown>"}function xt(e,t,n){var r=e.exception=e.exception||{},o=r.values=r.values||[],i=o[0]=o[0]||{};i.value||(i.value=t||""),i.type||(i.type=n||"Error")}function kt(e,t){var n=bt(e);if(n){var r=n.mechanism;if(n.mechanism=ie(ie(ie({},{type:"generic",
|
|
32
|
-
handled:!0}),r),t),t&&"data"in t){var o=ie(ie({},r&&r.data),t.data);n.mechanism.data=o}}}function St(e){if(e&&e.__sentry_captured__)return!0;try{$e(e,"__sentry_captured__",!0)}catch(e){}return!1}function Ct(e){return new
|
|
33
|
-
}catch(e){o(e)}else o(t)}]),r._executeHandlers()}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var o,i;return n.then((function(e){i=!1,o=e,t&&t()}),(function(e){i=!0,o=e,t&&t()})).then((function(){i?r(o):e(o)}))}))},e}();function
|
|
34
|
-
return Date.now()/1e3}};var Mt=he()?function(){try{return(e=module,t="perf_hooks",e.require(t)).performance}catch(e){return}var e,t}():function(){var e=pe().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),zt=void 0===Mt?Lt:{nowSeconds:function(){return(Mt.timeOrigin+Mt.now())/1e3}},Ot=Lt.nowSeconds.bind(Lt),It=zt.nowSeconds.bind(zt);!function(){var e=pe().performance;if(e&&e.now){var t=36e5,n=e.now(),r=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=o<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(i||s<t)&&(o<=s&&e.timeOrigin)}}();var
|
|
32
|
+
handled:!0}),r),t),t&&"data"in t){var o=ie(ie({},r&&r.data),t.data);n.mechanism.data=o}}}function St(e){if(e&&e.__sentry_captured__)return!0;try{$e(e,"__sentry_captured__",!0)}catch(e){}return!1}function Ct(e){return new Et((function(t){t(e)}))}function At(e){return new Et((function(t,n){n(e)}))}var Et=function(){function e(e){var t=this;this._state=0,this._handlers=[],this._resolve=function(e){t._setResult(1,e)},this._reject=function(e){t._setResult(2,e)},this._setResult=function(e,n){0===t._state&&(Se(n)?n.then(t._resolve,t._reject):(t._state=e,t._value=n,t._executeHandlers()))},this._executeHandlers=function(){if(0!==t._state){var e=t._handlers.slice();t._handlers=[],e.forEach((function(e){e[0]||(1===t._state&&e[1](t._value),2===t._state&&e[2](t._value),e[0]=!0)}))}};try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}return e.prototype.then=function(t,n){var r=this;return new e((function(e,o){r._handlers.push([!1,function(n){if(t)try{e(t(n))}catch(e){o(e)}else e(n)},function(t){if(n)try{e(n(t))
|
|
33
|
+
}catch(e){o(e)}else o(t)}]),r._executeHandlers()}))},e.prototype.catch=function(e){return this.then((function(e){return e}),e)},e.prototype.finally=function(t){var n=this;return new e((function(e,r){var o,i;return n.then((function(e){i=!1,o=e,t&&t()}),(function(e){i=!0,o=e,t&&t()})).then((function(){i?r(o):e(o)}))}))},e}();function Tt(e){var t=[];function n(e){return t.splice(t.indexOf(e),1)[0]}return{$:t,add:function(r){if(!(void 0===e||t.length<e))return At(new Ne("Not adding Promise due to buffer limit reached."));var o=r();return-1===t.indexOf(o)&&t.push(o),o.then((function(){return n(o)})).then(null,(function(){return n(o).then(null,(function(){}))})),o},drain:function(e){return new Et((function(n,r){var o=t.length;if(!o)return n(!0);var i=setTimeout((function(){e&&e>0&&n(!1)}),e);t.forEach((function(e){Ct(e).then((function(){--o||(clearTimeout(i),n(!0))}),r)}))}))}}}function Nt(e){return"warn"===e?oe.Warning:function(e){return-1!==ce.indexOf(e)}(e)?e:oe.Log}var Lt={nowSeconds:function(){
|
|
34
|
+
return Date.now()/1e3}};var Mt=he()?function(){try{return(e=module,t="perf_hooks",e.require(t)).performance}catch(e){return}var e,t}():function(){var e=pe().performance;if(e&&e.now)return{now:function(){return e.now()},timeOrigin:Date.now()-e.now()}}(),zt=void 0===Mt?Lt:{nowSeconds:function(){return(Mt.timeOrigin+Mt.now())/1e3}},Ot=Lt.nowSeconds.bind(Lt),It=zt.nowSeconds.bind(zt);!function(){var e=pe().performance;if(e&&e.now){var t=36e5,n=e.now(),r=Date.now(),o=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,i=o<t,a=e.timing&&e.timing.navigationStart,s="number"==typeof a?Math.abs(a+n-r):t;(i||s<t)&&(o<=s&&e.timeOrigin)}}();var Rt=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}return e.clone=function(t){var n=new e;return t&&(n._breadcrumbs=le(t._breadcrumbs),n._tags=ie({},t._tags),n._extra=ie({},t._extra),n._contexts=ie({},t._contexts),
|
|
35
35
|
n._user=t._user,n._level=t._level,n._span=t._span,n._session=t._session,n._transactionName=t._transactionName,n._fingerprint=t._fingerprint,n._eventProcessors=le(t._eventProcessors),n._requestSession=t._requestSession),n},e.prototype.addScopeListener=function(e){this._scopeListeners.push(e)},e.prototype.addEventProcessor=function(e){return this._eventProcessors.push(e),this},e.prototype.setUser=function(e){return this._user=e||{},this._session&&this._session.update({user:e}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.getRequestSession=function(){return this._requestSession},e.prototype.setRequestSession=function(e){return this._requestSession=e,this},e.prototype.setTags=function(e){return this._tags=ie(ie({},this._tags),e),this._notifyScopeListeners(),this},e.prototype.setTag=function(e,t){var n;return this._tags=ie(ie({},this._tags),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(e){
|
|
36
36
|
return this._extra=ie(ie({},this._extra),e),this._notifyScopeListeners(),this},e.prototype.setExtra=function(e,t){var n;return this._extra=ie(ie({},this._extra),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(e){return this._fingerprint=e,this._notifyScopeListeners(),this},e.prototype.setLevel=function(e){return this._level=e,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(e){return this._transactionName=e,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(e){return this.setTransactionName(e)},e.prototype.setContext=function(e,t){var n;return null===t?delete this._contexts[e]:this._contexts=ie(ie({},this._contexts),((n={})[e]=t,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(e){return this._span=e,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var e=this.getSpan();return e&&e.transaction},e.prototype.setSession=function(e){
|
|
37
37
|
return e?this._session=e:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if("function"==typeof t){var n=t(this);return n instanceof e?n:this}return t instanceof e?(this._tags=ie(ie({},this._tags),t._tags),this._extra=ie(ie({},this._extra),t._extra),this._contexts=ie(ie({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint),t._requestSession&&(this._requestSession=t._requestSession)):we(t)&&(t=t,this._tags=ie(ie({},this._tags),t.tags),this._extra=ie(ie({},this._extra),t.extra),this._contexts=ie(ie({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint),t.requestSession&&(this._requestSession=t.requestSession)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},
|
|
38
38
|
this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(e,t){var n="number"==typeof t?Math.min(t,100):100;if(n<=0)return this;var r=ie({timestamp:Ot()},e);return this._breadcrumbs=le(this._breadcrumbs,[r]).slice(-n),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(e,t){if(this._extra&&Object.keys(this._extra).length&&(e.extra=ie(ie({},this._extra),e.extra)),this._tags&&Object.keys(this._tags).length&&(e.tags=ie(ie({},this._tags),e.tags)),this._user&&Object.keys(this._user).length&&(e.user=ie(ie({},this._user),e.user)),this._contexts&&Object.keys(this._contexts).length&&(e.contexts=ie(ie({},this._contexts),e.contexts)),this._level&&(e.level=this._level),
|
|
39
|
-
this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=ie({trace:this._span.getTraceContext()},e.contexts);var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags=ie({transaction:n},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=le(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(le(
|
|
40
|
-
;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function
|
|
39
|
+
this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts=ie({trace:this._span.getTraceContext()},e.contexts);var n=this._span.transaction&&this._span.transaction.name;n&&(e.tags=ie({transaction:n},e.tags))}return this._applyFingerprint(e),e.breadcrumbs=le(e.breadcrumbs||[],this._breadcrumbs),e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata=this._sdkProcessingMetadata,this._notifyEventProcessors(le(Pt(),this._eventProcessors),e,t)},e.prototype.setSDKProcessingMetadata=function(e){return this._sdkProcessingMetadata=ie(ie({},this._sdkProcessingMetadata),e),this},e.prototype._notifyEventProcessors=function(e,t,n,r){var o=this;return void 0===r&&(r=0),new Et((function(i,a){var s=e[r];if(null===t||"function"!=typeof s)i(t);else{var l=s(ie({},t),n);Se(l)?l.then((function(t){return o._notifyEventProcessors(e,t,n,r+1).then(i)})).then(null,a):o._notifyEventProcessors(e,l,n,r+1).then(i).then(null,a)}}))},e.prototype._notifyScopeListeners=function(){var e=this
|
|
40
|
+
;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((function(t){t(e)})),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(e){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint},e}();function Pt(){var e=pe();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function Dt(e){Pt().push(e)}var Bt=function(){function e(e){this.errors=0,this.sid=yt(),this.duration=0,this.status="ok",this.init=!0,this.ignoreDuration=!1;var t=It();this.timestamp=t,this.started=t,e&&this.update(e)}return e.prototype.update=function(e){if(void 0===e&&(e={}),e.user&&(!this.ipAddress&&e.user.ip_address&&(this.ipAddress=e.user.ip_address),this.did||e.did||(this.did=e.user.id||e.user.email||e.user.username)),
|
|
41
41
|
this.timestamp=e.timestamp||It(),e.ignoreDuration&&(this.ignoreDuration=e.ignoreDuration),e.sid&&(this.sid=32===e.sid.length?e.sid:yt()),void 0!==e.init&&(this.init=e.init),!this.did&&e.did&&(this.did=""+e.did),"number"==typeof e.started&&(this.started=e.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof e.duration)this.duration=e.duration;else{var t=this.timestamp-this.started;this.duration=t>=0?t:0}e.release&&(this.release=e.release),e.environment&&(this.environment=e.environment),!this.ipAddress&&e.ipAddress&&(this.ipAddress=e.ipAddress),!this.userAgent&&e.userAgent&&(this.userAgent=e.userAgent),"number"==typeof e.errors&&(this.errors=e.errors),e.status&&(this.status=e.status)},e.prototype.close=function(e){e?this.update({status:e}):"ok"===this.status?this.update({status:"exited"}):this.update()},e.prototype.toJSON=function(){return et({sid:""+this.sid,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),
|
|
42
|
-
status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})},e}(),Ft=function(){function e(e,t,n){void 0===t&&(t=new
|
|
42
|
+
status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?""+this.did:void 0,duration:this.duration,attrs:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})},e}(),Ft=function(){function e(e,t,n){void 0===t&&(t=new Rt),void 0===n&&(n=4),this._version=n,this._stack=[{}],this.getStackTop().scope=t,e&&this.bindClient(e)}return e.prototype.isOlderThan=function(e){return this._version<e},e.prototype.bindClient=function(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()},e.prototype.pushScope=function(){var e=Rt.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e},e.prototype.popScope=function(){return!(this.getStack().length<=1)&&!!this.getStack().pop()},e.prototype.withScope=function(e){var t=this.pushScope();try{e(t)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){
|
|
43
43
|
return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(e,t){var n=this._lastEventId=yt(),r=t;if(!t){var o=void 0;try{throw new Error("Sentry syntheticException")}catch(e){o=e}r={originalException:e,syntheticException:o}}return this._invokeClient("captureException",e,ie(ie({},r),{event_id:n})),n},e.prototype.captureMessage=function(e,t,n){var r=this._lastEventId=yt(),o=n;if(!n){var i=void 0;try{throw new Error(e)}catch(e){i=e}o={originalException:e,syntheticException:i}}return this._invokeClient("captureMessage",e,t,ie(ie({},o),{event_id:r})),r},e.prototype.captureEvent=function(e,t){var n=yt();return"transaction"!==e.type&&(this._lastEventId=n),this._invokeClient("captureEvent",e,ie(ie({},t),{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(e,t){var n=this.getStackTop(),r=n.scope,o=n.client;if(r&&o){
|
|
44
|
-
var i=o.getOptions&&o.getOptions()||{},a=i.beforeBreadcrumb,s=void 0===a?null:a,l=i.maxBreadcrumbs,c=void 0===l?100:l;if(!(c<=0)){var u=Ot(),h=ie({timestamp:u},e),d=s?
|
|
44
|
+
var i=o.getOptions&&o.getOptions()||{},a=i.beforeBreadcrumb,s=void 0===a?null:a,l=i.maxBreadcrumbs,c=void 0===l?100:l;if(!(c<=0)){var u=Ot(),h=ie({timestamp:u},e),d=s?Pe((function(){return s(h,t)})):h;null!==d&&r.addBreadcrumb(d,c)}}},e.prototype.setUser=function(e){var t=this.getScope();t&&t.setUser(e)},e.prototype.setTags=function(e){var t=this.getScope();t&&t.setTags(e)},e.prototype.setExtras=function(e){var t=this.getScope();t&&t.setExtras(e)},e.prototype.setTag=function(e,t){var n=this.getScope();n&&n.setTag(e,t)},e.prototype.setExtra=function(e,t){var n=this.getScope();n&&n.setExtra(e,t)},e.prototype.setContext=function(e,t){var n=this.getScope();n&&n.setContext(e,t)},e.prototype.configureScope=function(e){var t=this.getStackTop(),n=t.scope,r=t.client;n&&r&&e(n)},e.prototype.run=function(e){var t=Ht(this);try{e(this)}finally{Ht(t)}},e.prototype.getIntegration=function(e){var t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){
|
|
45
45
|
return Be.warn("Cannot retrieve integration "+e.id+" from the current Hub"),null}},e.prototype.startSpan=function(e){return this._callExtensionMethod("startSpan",e)},e.prototype.startTransaction=function(e,t){return this._callExtensionMethod("startTransaction",e,t)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.captureSession=function(e){if(void 0===e&&(e=!1),e)return this.endSession();this._sendSessionUpdate()},e.prototype.endSession=function(){var e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&n.close(),this._sendSessionUpdate(),t&&t.setSession()},e.prototype.startSession=function(e){var t=this.getStackTop(),n=t.scope,r=t.client,o=r&&r.getOptions()||{},i=o.release,a=o.environment,s=(pe().navigator||{}).userAgent,l=new Bt(ie(ie(ie({release:i,environment:a},n&&{user:n.getUser()}),s&&{userAgent:s}),e));if(n){var c=n.getSession&&n.getSession();c&&"ok"===c.status&&c.update({status:"exited"}),this.endSession(),n.setSession(l)}return l},
|
|
46
46
|
e.prototype._sendSessionUpdate=function(){var e=this.getStackTop(),t=e.scope,n=e.client;if(t){var r=t.getSession&&t.getSession();r&&n&&n.captureSession&&n.captureSession(r)}},e.prototype._invokeClient=function(e){for(var t,n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var o=this.getStackTop(),i=o.scope,a=o.client;a&&a[e]&&(t=a)[e].apply(t,le(n,[i]))},e.prototype._callExtensionMethod=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=jt(),o=r.__SENTRY__;if(o&&o.extensions&&"function"==typeof o.extensions[e])return o.extensions[e].apply(this,t);Be.warn("Extension method "+e+" couldn't be found, doing nothing.")},e}();function jt(){var e=pe();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function Ht(e){var t=jt(),n=$t(t);return Gt(t,e),n}function Ut(){var e=jt();return qt(e)&&!$t(e).isOlderThan(4)||Gt(e,new Ft),he()?function(e){try{var t=jt().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return $t(e)
|
|
47
|
-
;if(!qt(n)||$t(n).isOlderThan(4)){var r=$t(e).getStackTop();Gt(n,new Ft(r.client,
|
|
47
|
+
;if(!qt(n)||$t(n).isOlderThan(4)){var r=$t(e).getStackTop();Gt(n,new Ft(r.client,Rt.clone(r.scope)))}return $t(n)}catch(t){return $t(e)}}(e):$t(e)}function qt(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function $t(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new Ft),e.__SENTRY__.hub}function Gt(e,t){return!!e&&(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0)}function Vt(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var r=Ut();if(r&&r[e])return r[e].apply(r,le(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function Wt(e,t){var n;try{throw new Error("Sentry syntheticException")}catch(e){n=e}return Vt("captureException",e,{captureContext:t,originalException:e,syntheticException:n})}function Yt(e,t){Vt("setExtra",e,t)}function Kt(e){Vt("withScope",e)}function Xt(e){var t=e.protocol?e.protocol+":":"",n=e.port?":"+e.port:"";return t+"//"+e.host+n+(e.path?"/"+e.path:"")+"/api/"}
|
|
48
48
|
function Zt(e,t){return""+Xt(e)+e.projectId+"/"+t+"/"}function Jt(e){return t={sentry_key:e.publicKey,sentry_version:"7"},Object.keys(t).map((function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])})).join("&");var t}function Qt(e){return function(e){return Zt(e,"store")}(e)+"?"+Jt(e)}function en(e,t){return t||function(e){return Zt(e,"envelope")}(e)+"?"+Jt(e)}var tn=[];function nn(e){return e.reduce((function(e,t){return e.every((function(e){return t.name!==e.name}))&&e.push(t),e}),[])}function rn(e){var t={};return function(e){var t=e.defaultIntegrations&&le(e.defaultIntegrations)||[],n=e.integrations,r=le(nn(t));Array.isArray(n)?r=le(r.filter((function(e){return n.every((function(t){return t.name!==e.name}))})),nn(n)):"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);var o=r.map((function(e){return e.name})),i="Debug";return-1!==o.indexOf(i)&&r.push.apply(r,le(r.splice(o.indexOf(i),1))),r}(e).forEach((function(e){t[e.name]=e,function(e){-1===tn.indexOf(e.name)&&(e.setupOnce(Dt,Ut),
|
|
49
49
|
tn.push(e.name),Be.log("Integration installed: "+e.name))}(e)})),$e(t,"initialized",!0),t}var on="Not capturing exception because it's already been captured.",an=function(){function e(e,t){this._integrations={},this._numProcessing=0,this._backend=new e(t),this._options=t,t.dsn&&(this._dsn=Oe(t.dsn))}return e.prototype.captureException=function(e,t,n){var r=this;if(!St(e)){var o=t&&t.event_id;return this._process(this._getBackend().eventFromException(e,t).then((function(e){return r._captureEvent(e,t,n)})).then((function(e){o=e}))),o}Be.log(on)},e.prototype.captureMessage=function(e,t,n,r){var o=this,i=n&&n.event_id,a=be(e)?this._getBackend().eventFromMessage(String(e),t,n):this._getBackend().eventFromException(e,n);return this._process(a.then((function(e){return o._captureEvent(e,n,r)})).then((function(e){i=e}))),i},e.prototype.captureEvent=function(e,t,n){if(!(t&&t.originalException&&St(t.originalException))){var r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((function(e){r=e}))),r}
|
|
50
50
|
Be.log(on)},e.prototype.captureSession=function(e){this._isEnabled()?"string"!=typeof e.release?ue()&&Be.warn("Discarded session because of missing or non-string release"):(this._sendSession(e),e.update({init:!1})):ue()&&Be.warn("SDK not enabled, will not capture session.")},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.getTransport=function(){return this._getBackend().getTransport()},e.prototype.flush=function(e){var t=this;return this._isClientDoneProcessing(e).then((function(n){return t.getTransport().close(e).then((function(e){return n&&e}))}))},e.prototype.close=function(e){var t=this;return this.flush(e).then((function(e){return t.getOptions().enabled=!1,e}))},e.prototype.setupIntegrations=function(){this._isEnabled()&&!this._integrations.initialized&&(this._integrations=rn(this._options))},e.prototype.getIntegration=function(e){try{return this._integrations[e.id]||null}catch(t){
|
|
51
|
-
return Be.warn("Cannot retrieve integration "+e.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(e,t){var n,r,o=!1,i=!1,a=t.exception&&t.exception.values;if(a){i=!0;try{for(var s=ae(a),l=s.next();!l.done;l=s.next()){var c=l.value.mechanism;if(c&&!1===c.handled){o=!0;break}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}var u="ok"===e.status;(u&&0===e.errors||u&&o)&&(e.update(ie(ie({},o&&{status:"crashed"}),{errors:e.errors||Number(i||o)})),this.captureSession(e))},e.prototype._sendSession=function(e){this._getBackend().sendSession(e)},e.prototype._isClientDoneProcessing=function(e){var t=this;return new
|
|
52
|
-
e.prototype._prepareEvent=function(e,t,n){var r=this,o=this.getOptions().normalizeDepth,i=void 0===o?3:o,a=ie(ie({},e),{event_id:e.event_id||(n&&n.event_id?n.event_id:yt()),timestamp:e.timestamp||Ot()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var s=t;n&&n.captureContext&&(s=
|
|
51
|
+
return Be.warn("Cannot retrieve integration "+e.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(e,t){var n,r,o=!1,i=!1,a=t.exception&&t.exception.values;if(a){i=!0;try{for(var s=ae(a),l=s.next();!l.done;l=s.next()){var c=l.value.mechanism;if(c&&!1===c.handled){o=!0;break}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}}var u="ok"===e.status;(u&&0===e.errors||u&&o)&&(e.update(ie(ie({},o&&{status:"crashed"}),{errors:e.errors||Number(i||o)})),this.captureSession(e))},e.prototype._sendSession=function(e){this._getBackend().sendSession(e)},e.prototype._isClientDoneProcessing=function(e){var t=this;return new Et((function(n){var r=0,o=setInterval((function(){0==t._numProcessing?(clearInterval(o),n(!0)):(r+=1,e&&r>=e&&(clearInterval(o),n(!1)))}),1)}))},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){return!1!==this.getOptions().enabled&&void 0!==this._dsn},
|
|
52
|
+
e.prototype._prepareEvent=function(e,t,n){var r=this,o=this.getOptions().normalizeDepth,i=void 0===o?3:o,a=ie(ie({},e),{event_id:e.event_id||(n&&n.event_id?n.event_id:yt()),timestamp:e.timestamp||Ot()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var s=t;n&&n.captureContext&&(s=Rt.clone(s).update(n.captureContext));var l=Ct(a);return s&&(l=s.applyToEvent(a,n)),l.then((function(e){return"number"==typeof i&&i>0?r._normalizeEvent(e,i):e}))},e.prototype._normalizeEvent=function(e,t){if(!e)return null;var n=ie(ie(ie(ie(ie({},e),e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((function(e){return ie(ie({},e),e.data&&{data:Je(e.data,t)})}))}),e.user&&{user:Je(e.user,t)}),e.contexts&&{contexts:Je(e.contexts,t)}),e.extra&&{extra:Je(e.extra,t)});e.contexts&&e.contexts.trace&&(n.contexts.trace=e.contexts.trace);var r=this.getOptions()._experiments;return(void 0===r?{}:r).ensureNoCircularStructures?Je(n):n},e.prototype._applyClientOptions=function(e){
|
|
53
53
|
var t=this.getOptions(),n=t.environment,r=t.release,o=t.dist,i=t.maxValueLength,a=void 0===i?250:i;"environment"in e||(e.environment="environment"in t?n:"production"),void 0===e.release&&void 0!==r&&(e.release=r),void 0===e.dist&&void 0!==o&&(e.dist=o),e.message&&(e.message=je(e.message,a));var s=e.exception&&e.exception.values&&e.exception.values[0];s&&s.value&&(s.value=je(s.value,a));var l=e.request;l&&l.url&&(l.url=je(l.url,a))},e.prototype._applyIntegrationsMetadata=function(e){var t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=le(e.sdk.integrations||[],t))},e.prototype._sendEvent=function(e){this._getBackend().sendEvent(e)},e.prototype._captureEvent=function(e,t,n){return this._processEvent(e,t,n).then((function(e){return e.event_id}),(function(e){Be.error(e)}))},e.prototype._processEvent=function(e,t,n){var r=this,o=this.getOptions(),i=o.beforeSend,a=o.sampleRate,s=this.getTransport();function l(e,t){s.recordLostEvent&&s.recordLostEvent(e,t)}
|
|
54
54
|
if(!this._isEnabled())return At(new Ne("SDK not enabled, will not capture event."));var c="transaction"===e.type;return!c&&"number"==typeof a&&Math.random()>a?(l("sample_rate","event"),At(new Ne("Discarding event because it's not included in the random sample (sampling rate = "+a+")"))):this._prepareEvent(e,n,t).then((function(n){if(null===n)throw l("event_processor",e.type||"event"),new Ne("An event processor returned null, will not send event.");return t&&t.data&&!0===t.data.__sentry__||c||!i?n:function(e){var t="`beforeSend` method has to return `null` or a valid event.";if(Se(e))return e.then((function(e){if(!we(e)&&null!==e)throw new Ne(t);return e}),(function(e){throw new Ne("beforeSend rejected with "+e)}));if(!we(e)&&null!==e)throw new Ne(t);return e}(i(n,t))})).then((function(t){if(null===t)throw l("before_send",e.type||"event"),new Ne("`beforeSend` returned `null`, will not send event.");var o=n&&n.getSession&&n.getSession();return!c&&o&&r._updateSessionFromEvent(o,t),r._sendEvent(t),t
|
|
55
55
|
})).then(null,(function(e){if(e instanceof Ne)throw e;throw r.captureException(e,{data:{__sentry__:!0},originalException:e}),new Ne("Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: "+e)}))},e.prototype._process=function(e){var t=this;this._numProcessing+=1,e.then((function(e){return t._numProcessing-=1,e}),(function(e){return t._numProcessing-=1,e}))},e}();var sn=function(){function e(){}return e.prototype.sendEvent=function(e){return Ct({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:"skipped"})},e.prototype.close=function(e){return Ct(!0)},e}(),ln=function(){function e(e){this._options=e,this._options.dsn||Be.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype.eventFromException=function(e,t){throw new Ne("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(e,t,n){
|
|
@@ -60,19 +60,19 @@ hn=Function.prototype.toString,Function.prototype.toString=function(){for(var e=
|
|
|
60
60
|
if(e.stacktrace)return this._getLastValidUrl(e.stacktrace.frames);var t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?this._getLastValidUrl(t):null}catch(t){return ue()&&Be.error("Cannot extract url for event "+wt(e)),null}},e.id="InboundFilters",e}(),fn=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gn=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,vn=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,yn=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,_n=/\((\S*)(?::(\d+))(?::(\d+))\)/,bn=/Minified React error #\d+;/i;function wn(e){var t=null,n=0;e&&("number"==typeof e.framesToPop?n=e.framesToPop:bn.test(e.message)&&(n=1));try{if(t=function(e){if(!e||!e.stacktrace)return null
|
|
61
61
|
;for(var t,n=e.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,o=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,i=n.split("\n"),a=[],s=0;s<i.length;s+=2){var l=null;(t=r.exec(i[s]))?l={url:t[2],func:t[3],args:[],line:+t[1],column:null}:(t=o.exec(i[s]))&&(l={url:t[6],func:t[3]||t[4],args:t[5]?t[5].split(","):[],line:+t[1],column:+t[2]}),l&&(!l.func&&l.line&&(l.func="?"),a.push(l))}if(!a.length)return null;return{message:Sn(e),name:e.name,stack:a}}(e),t)return kn(t,n)}catch(e){}try{if(t=function(e){var t,n;if(!e||!e.stack)return null;for(var r,o,i,a=[],s=e.stack.split("\n"),l=0;l<s.length;++l){if(o=fn.exec(s[l])){var c=o[2]&&0===o[2].indexOf("native");o[2]&&0===o[2].indexOf("eval")&&(r=_n.exec(o[2]))&&(o[2]=r[1],o[3]=r[2],o[4]=r[3]);var u=o[2]&&0===o[2].indexOf("address at ")?o[2].substr("address at ".length):o[2],h=o[1]||"?";h=(t=se(xn(h,u),2))[0],i={url:u=t[1],func:h,args:c?[o[2]]:[],line:o[3]?+o[3]:null,column:o[4]?+o[4]:null}
|
|
62
62
|
}else if(o=vn.exec(s[l]))i={url:o[2],func:o[1]||"?",args:[],line:+o[3],column:o[4]?+o[4]:null};else{if(!(o=gn.exec(s[l])))continue;o[3]&&o[3].indexOf(" > eval")>-1&&(r=yn.exec(o[3]))?(o[1]=o[1]||"eval",o[3]=r[1],o[4]=r[2],o[5]=""):0!==l||o[5]||void 0===e.columnNumber||(a[0].column=e.columnNumber+1);u=o[3],h=o[1]||"?";h=(n=se(xn(h,u),2))[0],i={url:u=n[1],func:h,args:o[2]?o[2].split(","):[],line:o[4]?+o[4]:null,column:o[5]?+o[5]:null}}!i.func&&i.line&&(i.func="?"),a.push(i)}if(!a.length)return null;return{message:Sn(e),name:e.name,stack:a}}(e),t)return kn(t,n)}catch(e){}return{message:Sn(e),name:e&&e.name,stack:[],failed:!0}}var xn=function(e,t){var n=-1!==e.indexOf("safari-extension"),r=-1!==e.indexOf("safari-web-extension");return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?"safari-extension:"+t:"safari-web-extension:"+t]:[e,t]};function kn(e,t){try{return ie(ie({},e),{stack:e.stack.slice(t)})}catch(t){return e}}function Sn(e){var t=e&&e.message
|
|
63
|
-
;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Cn(e){var t=
|
|
64
|
-
return"code"in o&&(r.tags=ie(ie({},r.tags),{"DOMException.code":""+o.code})),r}return fe(e)?r=An(wn(e)):we(e)||xe(e)?(r=function(e,t,n){var r={exception:{values:[{type:xe(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+Qe(e)}]},extra:{__serialized__:Ke(e)}};if(t){var o=
|
|
65
|
-
ue()&&Be.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Ln=t.bind(Mn)}function On(e,t){if("[object Navigator]"===Object.prototype.toString.call(Mn&&Mn.navigator)&&"function"==typeof Mn.navigator.sendBeacon)return Mn.navigator.sendBeacon.bind(Mn.navigator)(e,t);if(tt()){var n=zn();n(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(e){console.error(e)}))}else;}function In(e){return"event"===e?"error":e}var
|
|
63
|
+
;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Cn(e){var t=En(e.stack),n={type:e.name,value:e.message};return t&&t.length&&(n.stacktrace={frames:t}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function An(e){return{exception:{values:[Cn(e)]}}}function En(e){if(!e||!e.length)return[];var t=e,n=t[0].func||"",r=t[t.length-1].func||"";return-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1)),-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1)),t.slice(0,50).map((function(e){return{colno:null===e.column?void 0:e.column,filename:e.url||t[0].url,function:e.func||"?",in_app:!0,lineno:null===e.line?void 0:e.line}})).reverse()}function Tn(e,t,n){var r;if(void 0===n&&(n={}),ve(e)&&e.error)return r=An(wn(e=e.error));if(ye(e)||ge(e,"DOMException")){var o=e;if("stack"in e)r=An(wn(e));else{var i=o.name||(ye(o)?"DOMError":"DOMException"),a=o.message?i+": "+o.message:i;xt(r=Nn(a,t,n),a)}
|
|
64
|
+
return"code"in o&&(r.tags=ie(ie({},r.tags),{"DOMException.code":""+o.code})),r}return fe(e)?r=An(wn(e)):we(e)||xe(e)?(r=function(e,t,n){var r={exception:{values:[{type:xe(e)?e.constructor.name:n?"UnhandledRejection":"Error",value:"Non-Error "+(n?"promise rejection":"exception")+" captured with keys: "+Qe(e)}]},extra:{__serialized__:Ke(e)}};if(t){var o=En(wn(t).stack);r.stacktrace={frames:o}}return r}(e,t,n.isRejection),kt(r,{synthetic:!0}),r):(xt(r=Nn(e,t,n),""+e,void 0),kt(r,{synthetic:!0}),r)}function Nn(e,t,n){void 0===n&&(n={});var r={message:e};if(n.attachStacktrace&&t){var o=En(wn(t).stack);r.stacktrace={frames:o}}return r}var Ln,Mn=pe();function zn(){if(Ln)return Ln;if(nt(Mn.fetch))return Ln=Mn.fetch.bind(Mn);var e=Mn.document,t=Mn.fetch;if(e&&"function"==typeof e.createElement)try{var n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);var r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){
|
|
65
|
+
ue()&&Be.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return Ln=t.bind(Mn)}function On(e,t){if("[object Navigator]"===Object.prototype.toString.call(Mn&&Mn.navigator)&&"function"==typeof Mn.navigator.sendBeacon)return Mn.navigator.sendBeacon.bind(Mn.navigator)(e,t);if(tt()){var n=zn();n(e,{body:t,method:"POST",credentials:"omit",keepalive:!0}).then(null,(function(e){console.error(e)}))}else;}function In(e){return"event"===e?"error":e}var Rn=pe(),Pn=function(){function e(e){var t,n,r,o=this;this.options=e,this._buffer=Tt(30),this._rateLimits={},this._outcomes={},this._api=(t=e.dsn,n=e._metadata,r=e.tunnel,{initDsn:t,metadata:n||{},dsn:Oe(t),tunnel:r}),this.url=Qt(this._api.dsn),this.options.sendClientReports&&Rn.document&&Rn.document.addEventListener("visibilitychange",(function(){"hidden"===Rn.document.visibilityState&&o._flushOutcomes()}))}return e.prototype.sendEvent=function(e){return this._sendRequest(function(e,t){
|
|
66
66
|
var n=cn(t),r=e.type||"event",o="transaction"===r||!!t.tunnel,i=(e.sdkProcessingMetadata||{}).transactionSampling||{},a=i.method,s=i.rate;delete e.sdkProcessingMetadata;var l={body:JSON.stringify(n?un(e,t.metadata.sdk):e),type:r,url:o?en(t.dsn,t.tunnel):Qt(t.dsn)};if(o){var c=JSON.stringify(ie(ie({event_id:e.event_id,sent_at:(new Date).toISOString()},n&&{sdk:n}),!!t.tunnel&&{dsn:Me(t.dsn)}))+"\n"+JSON.stringify({type:r,sample_rates:[{id:a,rate:s}]})+"\n"+l.body;l.body=c}return l}(e,this._api),e)},e.prototype.sendSession=function(e){return this._sendRequest(function(e,t){var n=cn(t),r="aggregates"in e?"sessions":"session";return{body:JSON.stringify(ie(ie({sent_at:(new Date).toISOString()},n&&{sdk:n}),!!t.tunnel&&{dsn:Me(t.dsn)}))+"\n"+JSON.stringify({type:r})+"\n"+JSON.stringify(e),type:r,url:en(t.dsn,t.tunnel)}}(e,this._api),e)},e.prototype.close=function(e){return this._buffer.drain(e)},e.prototype.recordLostEvent=function(e,t){var n;if(this.options.sendClientReports){var r=In(t)+":"+e
|
|
67
67
|
;Be.log("Adding outcome: "+r),this._outcomes[r]=(null!=(n=this._outcomes[r])?n:0)+1}},e.prototype._flushOutcomes=function(){if(this.options.sendClientReports){var e=this._outcomes;if(this._outcomes={},Object.keys(e).length){Be.log("Flushing outcomes:\n"+JSON.stringify(e,null,2));var t=en(this._api.dsn,this._api.tunnel),n=JSON.stringify(ie({},this._api.tunnel&&{dsn:Me(this._api.dsn)}))+"\n"+JSON.stringify({type:"client_report"})+"\n"+JSON.stringify({timestamp:Ot(),discarded_events:Object.keys(e).map((function(t){var n=se(t.split(":"),2),r=n[0];return{reason:n[1],category:r,quantity:e[t]}}))});try{On(t,n)}catch(e){Be.error(e)}}else Be.log("No outcomes to flush")}},e.prototype._handleResponse=function(e){var t,n=e.requestType,r=e.response,o=e.headers,i=e.resolve,a=e.reject,s=(t=r.status)>=200&&t<300?"success":429===t?"rate_limit":t>=400&&t<500?"invalid":t>=500?"failed":"unknown";this._handleRateLimit(o)&&ue()&&Be.warn("Too many "+n+" requests, backing off until: "+this._disabledUntil(n)),"success"!==s?a(r):i({
|
|
68
68
|
status:s})},e.prototype._disabledUntil=function(e){var t=In(e);return this._rateLimits[t]||this._rateLimits.all},e.prototype._isRateLimited=function(e){return this._disabledUntil(e)>new Date(Date.now())},e.prototype._handleRateLimit=function(e){var t,n,r,o,i=Date.now(),a=e["x-sentry-rate-limits"],s=e["retry-after"];if(a){try{for(var l=ae(a.trim().split(",")),c=l.next();!c.done;c=l.next()){var u=c.value.split(":",2),h=parseInt(u[0],10),d=1e3*(isNaN(h)?60:h);try{for(var p=(r=void 0,ae(u[1].split(";"))),m=p.next();!m.done;m=p.next()){var f=m.value;this._rateLimits[f||"all"]=new Date(i+d)}}catch(e){r={error:e}}finally{try{m&&!m.done&&(o=p.return)&&o.call(p)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return!0}return!!s&&(this._rateLimits.all=new Date(i+function(e,t){if(!t)return 6e4;var n=parseInt(""+t,10);if(!isNaN(n))return 1e3*n;var r=Date.parse(""+t);return isNaN(r)?6e4:r-e}(i,s)),!0)},e}(),Dn=function(e){function t(t,n){
|
|
69
|
-
void 0===n&&(n=zn());var r=e.call(this,t)||this;return r._fetch=n,r}return re(t,e),t.prototype._sendRequest=function(e,t){var n=this;if(this._isRateLimited(e.type))return this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var r={body:e.body,method:"POST",referrerPolicy:rt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add((function(){return new
|
|
70
|
-
throw t instanceof Ne?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(
|
|
71
|
-
})).then(void 0,(function(t){throw t instanceof Ne?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(
|
|
69
|
+
void 0===n&&(n=zn());var r=e.call(this,t)||this;return r._fetch=n,r}return re(t,e),t.prototype._sendRequest=function(e,t){var n=this;if(this._isRateLimited(e.type))return this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429});var r={body:e.body,method:"POST",referrerPolicy:rt()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(r,this.options.fetchParameters),void 0!==this.options.headers&&(r.headers=this.options.headers),this._buffer.add((function(){return new Et((function(t,o){n._fetch(e.url,r).then((function(r){var i={"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")};n._handleResponse({requestType:e.type,response:r,headers:i,resolve:t,reject:o})})).catch(o)}))})).then(void 0,(function(t){
|
|
70
|
+
throw t instanceof Ne?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(Pn),Bn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re(t,e),t.prototype._sendRequest=function(e,t){var n=this;return this._isRateLimited(e.type)?(this.recordLostEvent("ratelimit_backoff",e.type),Promise.reject({event:t,type:e.type,reason:"Transport for "+e.type+" requests locked till "+this._disabledUntil(e.type)+" due to too many requests.",status:429})):this._buffer.add((function(){return new Et((function(t,r){var o=new XMLHttpRequest;for(var i in o.onreadystatechange=function(){if(4===o.readyState){var i={"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")};n._handleResponse({requestType:e.type,response:o,headers:i,resolve:t,reject:r})}},o.open("POST",e.url),n.options.headers)Object.prototype.hasOwnProperty.call(n.options.headers,i)&&o.setRequestHeader(i,n.options.headers[i]);o.send(e.body)}))
|
|
71
|
+
})).then(void 0,(function(t){throw t instanceof Ne?n.recordLostEvent("queue_overflow",e.type):n.recordLostEvent("network_error",e.type),t}))},t}(Pn),Fn=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return re(t,e),t.prototype.eventFromException=function(e,t){return function(e,t,n){var r=Tn(t,n&&n.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return kt(r),r.level=oe.Error,n&&n.event_id&&(r.event_id=n.event_id),Ct(r)}(this._options,e,t)},t.prototype.eventFromMessage=function(e,t,n){return void 0===t&&(t=oe.Info),function(e,t,n,r){void 0===n&&(n=oe.Info);var o=Nn(t,r&&r.syntheticException||void 0,{attachStacktrace:e.attachStacktrace});return o.level=n,r&&r.event_id&&(o.event_id=r.event_id),Ct(o)}(this._options,e,t,n)},t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var t=ie(ie({},this._options.transportOptions),{dsn:this._options.dsn,tunnel:this._options.tunnel,
|
|
72
72
|
sendClientReports:this._options.sendClientReports,_metadata:this._options._metadata});return this._options.transport?new this._options.transport(t):tt()?new Dn(t):new Bn(t)},t}(ln),jn=pe(),Hn=0;function Un(){return Hn>0}function qn(){Hn+=1,setTimeout((function(){Hn-=1}))}function $n(e,t,n){if(void 0===t&&(t={}),"function"!=typeof e)return e;try{var r=e.__sentry_wrapped__;if(r)return r;if(Ve(e))return e}catch(t){return e}var o=function(){var r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);var o=r.map((function(e){return $n(e,t)}));return e.apply(this,o)}catch(e){throw qn(),Kt((function(n){n.addEventProcessor((function(e){return t.mechanism&&(xt(e,void 0,void 0),kt(e,t.mechanism)),e.extra=ie(ie({},e.extra),{arguments:r}),e})),Wt(e)})),e}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(o[i]=e[i])}catch(e){}Ge(o,e),$e(e,"__sentry_wrapped__",o);try{Object.getOwnPropertyDescriptor(o,"name").configurable&&Object.defineProperty(o,"name",{get:function(){
|
|
73
73
|
return e.name}})}catch(e){}return o}function Gn(e){if(void 0===e&&(e={}),jn.document)if(e.eventId)if(e.dsn){var t=jn.document.createElement("script");t.async=!0,t.src=function(e,t){var n=Oe(e),r=Xt(n)+"embed/error-page/",o="dsn="+Me(n);for(var i in t)if("dsn"!==i)if("user"===i){if(!t.user)continue;t.user.name&&(o+="&name="+encodeURIComponent(t.user.name)),t.user.email&&(o+="&email="+encodeURIComponent(t.user.email))}else o+="&"+encodeURIComponent(i)+"="+encodeURIComponent(t[i]);return r+"?"+o}(e.dsn,e),e.onLoad&&(t.onload=e.onLoad);var n=jn.document.head||jn.document.body;n&&n.appendChild(t)}else ue()&&Be.error("Missing dsn option in showReportDialog call");else ue()&&Be.error("Missing eventId option in showReportDialog call")}var Vn=function(){function e(t){this.name=e.id,this._installFunc={onerror:Wn,onunhandledrejection:Yn},this._options=ie({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50;var e=this._options;for(var t in e){var n=this._installFunc[t]
|
|
74
|
-
;n&&e[t]&&(Xn(t),n(),this._installFunc[t]=void 0)}},e.id="GlobalHandlers",e}();function Wn(){ct("error",(function(e){var t=se(Jn(),2),n=t[0],r=t[1];if(n.getIntegration(Vn)){var o=e.msg,i=e.url,a=e.line,s=e.column,l=e.error;if(!(Un()||l&&l.__sentry_own_request__)){var c=void 0===l&&_e(o)?function(e,t,n,r){var o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=ve(e)?e.message:e,a="Error",s=i.match(o);s&&(a=s[1],i=s[2]);return Kn({exception:{values:[{type:a,value:i}]}},t,n,r)}(o,i,a,s):Kn(
|
|
75
|
-
}:
|
|
74
|
+
;n&&e[t]&&(Xn(t),n(),this._installFunc[t]=void 0)}},e.id="GlobalHandlers",e}();function Wn(){ct("error",(function(e){var t=se(Jn(),2),n=t[0],r=t[1];if(n.getIntegration(Vn)){var o=e.msg,i=e.url,a=e.line,s=e.column,l=e.error;if(!(Un()||l&&l.__sentry_own_request__)){var c=void 0===l&&_e(o)?function(e,t,n,r){var o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,i=ve(e)?e.message:e,a="Error",s=i.match(o);s&&(a=s[1],i=s[2]);return Kn({exception:{values:[{type:a,value:i}]}},t,n,r)}(o,i,a,s):Kn(Tn(l||o,void 0,{attachStacktrace:r,isRejection:!1}),i,a,s);Zn(n,l,c,"onerror")}}}))}function Yn(){ct("unhandledrejection",(function(e){var t=se(Jn(),2),n=t[0],r=t[1];if(n.getIntegration(Vn)){var o=e;try{"reason"in e?o=e.reason:"detail"in e&&"reason"in e.detail&&(o=e.detail.reason)}catch(e){}if(Un()||o&&o.__sentry_own_request__)return!0;var i=be(o)?{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(o)}]}
|
|
75
|
+
}:Tn(o,void 0,{attachStacktrace:r,isRejection:!0});i.level=oe.Error,Zn(n,o,i,"onunhandledrejection")}}))}function Kn(e,t,n,r){var o=e.exception=e.exception||{},i=o.values=o.values||[],a=i[0]=i[0]||{},s=a.stacktrace=a.stacktrace||{},l=s.frames=s.frames||[],c=isNaN(parseInt(r,10))?void 0:r,u=isNaN(parseInt(n,10))?void 0:n,h=_e(t)&&t.length>0?t:function(){var e=pe();try{return e.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:h,function:"?",in_app:!0,lineno:u}),e}function Xn(e){ue()&&Be.log("Global Handler attached: "+e)}function Zn(e,t,n,r){kt(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function Jn(){var e=Ut(),t=e.getClient();return[e,t&&t.getOptions().attachStacktrace]}
|
|
76
76
|
var Qn=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],er=function(){function e(t){this.name=e.id,this._options=ie({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var e=pe();this._options.setTimeout&&qe(e,"setTimeout",tr),this._options.setInterval&&qe(e,"setInterval",tr),this._options.requestAnimationFrame&&qe(e,"requestAnimationFrame",nr),this._options.XMLHttpRequest&&"XMLHttpRequest"in e&&qe(XMLHttpRequest.prototype,"send",rr);var t=this._options.eventTarget;t&&(Array.isArray(t)?t:Qn).forEach(or)},e.id="TryCatch",e}()
|
|
77
77
|
;function tr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=t[0];return t[0]=$n(r,{mechanism:{data:{function:Fe(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function nr(e){return function(t){return e.call(this,$n(t,{mechanism:{data:{function:"requestAnimationFrame",handler:Fe(e)},handled:!0,type:"instrument"}}))}}function rr(e){return function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var r=this,o=["onload","onerror","onprogress","onreadystatechange"];return o.forEach((function(e){e in r&&"function"==typeof r[e]&&qe(r,e,(function(t){var n={mechanism:{data:{function:e,handler:Fe(t)},handled:!0,type:"instrument"}},r=Ve(t);return r&&(n.mechanism.data.handler=Fe(r)),$n(t,n)}))})),e.apply(this,t)}}function or(e){var t=pe(),n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(qe(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=$n(r.handleEvent.bind(r),{
|
|
78
78
|
mechanism:{data:{function:"handleEvent",handler:Fe(r),target:e},handled:!0,type:"instrument"}}))}catch(e){}return t.call(this,n,$n(r,{mechanism:{data:{function:"addEventListener",handler:Fe(r),target:e},handled:!0,type:"instrument"}}),o)}})),qe(n,"removeEventListener",(function(e){return function(t,n,r){var o=n;try{var i=o&&o.__sentry_wrapped__;i&&e.call(this,t,i,r)}catch(e){}return e.call(this,t,o,r)}})))}var ir=function(){function e(t){this.name=e.id,this._options=ie({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(e){this._options.sentry&&Ut().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:wt(e)},{event:e})},e.prototype.setupOnce=function(){this._options.console&&ct("console",ar),this._options.dom&&ct("dom",function(e){function t(t){var n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?Ae(t.event.target,r):Ae(t.event,r)
|
|
@@ -85,13 +85,13 @@ void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClient
|
|
|
85
85
|
var t=!0,n=!1,r=null,o={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function i(e){return!!(e&&e!==document&&"HTML"!==e.nodeName&&"BODY"!==e.nodeName&&"classList"in e&&"contains"in e.classList)}function a(e){var t=e.type,n=e.tagName;return!("INPUT"!==n||!o[t]||e.readOnly)||"TEXTAREA"===n&&!e.readOnly||!!e.isContentEditable}function s(e){e.classList.contains("focus-visible")||(e.classList.add("focus-visible"),e.setAttribute("data-focus-visible-added",""))}function l(e){e.hasAttribute("data-focus-visible-added")&&(e.classList.remove("focus-visible"),e.removeAttribute("data-focus-visible-added"))}function c(n){n.metaKey||n.altKey||n.ctrlKey||(i(e.activeElement)&&s(e.activeElement),t=!0)}function u(e){t=!1}function h(e){i(e.target)&&(t||a(e.target))&&s(e.target)}function d(e){i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(r),
|
|
86
86
|
r=window.setTimeout((function(){n=!1}),100),l(e.target))}function p(e){"hidden"===document.visibilityState&&(n&&(t=!0),m())}function m(){document.addEventListener("mousemove",g),document.addEventListener("mousedown",g),document.addEventListener("mouseup",g),document.addEventListener("pointermove",g),document.addEventListener("pointerdown",g),document.addEventListener("pointerup",g),document.addEventListener("touchmove",g),document.addEventListener("touchstart",g),document.addEventListener("touchend",g)}function f(){document.removeEventListener("mousemove",g),document.removeEventListener("mousedown",g),document.removeEventListener("mouseup",g),document.removeEventListener("pointermove",g),document.removeEventListener("pointerdown",g),document.removeEventListener("pointerup",g),document.removeEventListener("touchmove",g),document.removeEventListener("touchstart",g),document.removeEventListener("touchend",g)}function g(e){e.target.nodeName&&"html"===e.target.nodeName.toLowerCase()||(t=!1,f())}
|
|
87
87
|
document.addEventListener("keydown",c,!0),document.addEventListener("mousedown",u,!0),document.addEventListener("pointerdown",u,!0),document.addEventListener("touchstart",u,!0),document.addEventListener("visibilitychange",p,!0),m(),e.addEventListener("focus",h,!0),e.addEventListener("blur",d,!0),e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host?e.host.setAttribute("data-js-focus-visible",""):e.nodeType===Node.DOCUMENT_NODE&&(document.documentElement.classList.add("js-focus-visible"),document.documentElement.setAttribute("data-js-focus-visible",""))}if("undefined"!=typeof window&&"undefined"!=typeof document){var t;window.applyFocusVisiblePolyfill=e;try{t=new CustomEvent("focus-visible-polyfill-ready")}catch(e){(t=document.createEvent("CustomEvent")).initCustomEvent("focus-visible-polyfill-ready",!1,!1,{})}window.dispatchEvent(t)}"undefined"!=typeof document&&e(document)}(),"undefined"!=typeof window&&window.__PREACT_DEVTOOLS__&&window.__PREACT_DEVTOOLS__.attachPreact("10.6.4",n,{Fragment:m,Component:f})
|
|
88
|
-
;var Ar={};function
|
|
89
|
-
return null==this.__v?null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+Or(Lr())):null==this.__P&&console.warn('Can\'t call "this.setState" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+Or(this.__v)),
|
|
90
|
-
return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+Or(Lr())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+Or(this.__v)),
|
|
91
|
-
;e=new Error("Missing Suspense. The throwing component was: "+
|
|
92
|
-
if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+
|
|
93
|
-
void 0!==n.ref&&"function"!=typeof n.ref&&"object"!=typeof n.ref&&!("$$typeof"in n))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof n.ref+"] instead\n"+Dr(n)+"\n\n"+Or(n));if("string"==typeof n.type)for(var i in n.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof n.props[i]&&null!=n.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof n.props[i]+"] instead\n"+Dr(n)+"\n\n"+Or(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&l&&!l.lazyPropTypes.has(n.type)){var a="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var s=n.type();l.lazyPropTypes.set(n.type,!0),console.warn(a+"Component wrapped in lazy() is "+
|
|
94
|
-
Object.keys(e).forEach((function(n){var i;try{i=e[n](t,n,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}!i||i.message in Ar||(Ar[i.message]=!0,console.error("Failed prop type: "+i.message+(o&&"\n"+o()||"")))}))}(n.type.propTypes,c,0,
|
|
88
|
+
;var Ar={};function Er(e){return e.type===m?"Fragment":"function"==typeof e.type?e.type.displayName||e.type.name:"string"==typeof e.type?e.type:"#text"}var Tr=[],Nr=[];function Lr(){return Tr.length>0?Tr[Tr.length-1]:null}var Mr=!1;function zr(e){return"function"==typeof e.type&&e.type!=m}function Or(e){for(var t=[e],n=e;null!=n.__o;)t.push(n.__o),n=n.__o;return t.reduce((function(e,t){e+=" in "+Er(t);var n=t.__source;return n?e+=" (at "+n.fileName+":"+n.lineNumber+")":Mr||(Mr=!0,console.warn("Add @babel/plugin-transform-react-jsx-source to get a more detailed component stack. Note that you should not add it to production builds of your App for bundle size reasons.")),e+"\n"}),"")}var Ir="function"==typeof WeakMap,Rr=f.prototype.setState;f.prototype.setState=function(e,t){
|
|
89
|
+
return null==this.__v?null==this.state&&console.warn('Calling "this.setState" inside the constructor of a component is a no-op and might be a bug in your application. Instead, set "this.state = {}" directly.\n\n'+Or(Lr())):null==this.__P&&console.warn('Can\'t call "this.setState" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+Or(this.__v)),Rr.call(this,e,t)};var Pr=f.prototype.forceUpdate;function Dr(e){var t=e.props,n=Er(e),r="";for(var o in t)if(t.hasOwnProperty(o)&&"children"!==o){var i=t[o];"function"==typeof i&&(i="function "+(i.displayName||i.name)+"() {}"),i=Object(i)!==i||i.toString?i+"":Object.prototype.toString.call(i),r+=" "+o+"="+JSON.stringify(i)}var a=t.children;return"<"+n+r+(a&&a.length?">..</"+n+">":" />")}f.prototype.forceUpdate=function(e){
|
|
90
|
+
return null==this.__v?console.warn('Calling "this.forceUpdate" inside the constructor of a component is a no-op and might be a bug in your application.\n\n'+Or(Lr())):null==this.__P&&console.warn('Can\'t call "this.forceUpdate" on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in the componentWillUnmount method.\n\n'+Or(this.__v)),Pr.call(this,e)},function(){!function(){var e=n.__b,t=n.diffed,r=n.__,o=n.vnode,i=n.__r;n.diffed=function(e){zr(e)&&Nr.pop(),Tr.pop(),t&&t(e)},n.__b=function(t){zr(t)&&Tr.push(t),e&&e(t)},n.__=function(e,t){Nr=[],r&&r(e,t)},n.vnode=function(e){e.__o=Nr.length>0?Nr[Nr.length-1]:null,o&&o(e)},n.__r=function(e){zr(e)&&Nr.push(e),i&&i(e)}}();var e=!1,t=n.__b,r=n.diffed,o=n.vnode,i=n.__e,a=n.__,s=n.__h,l=Ir?{useEffect:new WeakMap,useLayoutEffect:new WeakMap,lazyPropTypes:new WeakMap}:null,c=[];n.__e=function(e,t,n){if(t&&t.__c&&"function"==typeof e.then){var r=e
|
|
91
|
+
;e=new Error("Missing Suspense. The throwing component was: "+Er(t));for(var o=t;o;o=o.__)if(o.__c&&o.__c.__c){e=r;break}if(e instanceof Error)throw e}try{i(e,t,n),"function"!=typeof e.then&&setTimeout((function(){throw e}))}catch(e){throw e}},n.__=function(e,t){if(!t)throw new Error("Undefined parent passed to render(), this is the second argument.\nCheck if the element is available in the DOM/has the correct id.");var n;switch(t.nodeType){case 1:case 11:case 9:n=!0;break;default:n=!1}if(!n){var r=Er(e);throw new Error("Expected a valid HTML node as a second argument to render.\tReceived "+t+" instead: render(<"+r+" />, "+t+");")}a&&a(e,t)},n.__b=function(n){var r=n.type,o=function e(t){return t?"function"==typeof t.type?e(t.__):t:{}}(n.__);if(e=!0,void 0===r)throw new Error("Undefined component passed to createElement()\n\nYou likely forgot to export your component or might have mixed up default and named imports"+Dr(n)+"\n\n"+Or(n));if(null!=r&&"object"==typeof r){
|
|
92
|
+
if(void 0!==r.__k&&void 0!==r.__e)throw new Error("Invalid type passed to createElement(): "+r+"\n\nDid you accidentally pass a JSX literal as JSX twice?\n\n let My"+Er(n)+" = "+Dr(r)+";\n let vnode = <My"+Er(n)+" />;\n\nThis usually happens when you export a JSX literal and not the component.\n\n"+Or(n));throw new Error("Invalid type passed to createElement(): "+(Array.isArray(r)?"array":r))}if("thead"!==r&&"tfoot"!==r&&"tbody"!==r||"table"===o.type?"tr"===r&&"thead"!==o.type&&"tfoot"!==o.type&&"tbody"!==o.type&&"table"!==o.type?console.error("Improper nesting of table. Your <tr> should have a <thead/tbody/tfoot/table> parent."+Dr(n)+"\n\n"+Or(n)):"td"===r&&"tr"!==o.type?console.error("Improper nesting of table. Your <td> should have a <tr> parent."+Dr(n)+"\n\n"+Or(n)):"th"===r&&"tr"!==o.type&&console.error("Improper nesting of table. Your <th> should have a <tr>."+Dr(n)+"\n\n"+Or(n)):console.error("Improper nesting of table. Your <thead/tbody/tfoot> should have a <table> parent."+Dr(n)+"\n\n"+Or(n)),
|
|
93
|
+
void 0!==n.ref&&"function"!=typeof n.ref&&"object"!=typeof n.ref&&!("$$typeof"in n))throw new Error('Component\'s "ref" property should be a function, or an object created by createRef(), but got ['+typeof n.ref+"] instead\n"+Dr(n)+"\n\n"+Or(n));if("string"==typeof n.type)for(var i in n.props)if("o"===i[0]&&"n"===i[1]&&"function"!=typeof n.props[i]&&null!=n.props[i])throw new Error("Component's \""+i+'" property should be a function, but got ['+typeof n.props[i]+"] instead\n"+Dr(n)+"\n\n"+Or(n));if("function"==typeof n.type&&n.type.propTypes){if("Lazy"===n.type.displayName&&l&&!l.lazyPropTypes.has(n.type)){var a="PropTypes are not supported on lazy(). Use propTypes on the wrapped component itself. ";try{var s=n.type();l.lazyPropTypes.set(n.type,!0),console.warn(a+"Component wrapped in lazy() is "+Er(s))}catch(n){console.warn(a+"We will log the wrapped component's name once it is loaded.")}}var c=n.props;n.type.__f&&delete(c=function(e,t){for(var n in t)e[n]=t[n];return e}({},c)).ref,function(e,t,n,r,o){
|
|
94
|
+
Object.keys(e).forEach((function(n){var i;try{i=e[n](t,n,r,"prop",null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){i=e}!i||i.message in Ar||(Ar[i.message]=!0,console.error("Failed prop type: "+i.message+(o&&"\n"+o()||"")))}))}(n.type.propTypes,c,0,Er(n),(function(){return Or(n)}))}t&&t(n)},n.__h=function(t,n,r){if(!t||!e)throw new Error("Hook can only be invoked from render methods.");s&&s(t,n,r)};var u=function(e,t){return{get:function(){var n="get"+e+t;c&&c.indexOf(n)<0&&(c.push(n),console.warn("getting vnode."+e+" is deprecated, "+t))},set:function(){var n="set"+e+t;c&&c.indexOf(n)<0&&(c.push(n),console.warn("setting vnode."+e+" is not allowed, "+t))}}},h={nodeName:u("nodeName","use vnode.type"),attributes:u("attributes","use vnode.props"),children:u("children","use vnode.props.children")},d=Object.create({},h);n.vnode=function(e){var t=e.props;if(null!==e.type&&null!=t&&("__source"in t||"__self"in t)){var n=e.props={};for(var r in t){var i=t[r]
|
|
95
95
|
;"__source"===r?e.__source=i:"__self"===r?e.__self=i:n[r]=i}}e.__proto__=d,o&&o(e)},n.diffed=function(t){if(t.__k&&t.__k.forEach((function(e){if(e&&void 0===e.type){delete e.__,delete e.__b;var n=Object.keys(e).join(",");throw new Error("Objects are not valid as a child. Encountered an object with the keys {"+n+"}.\n\n"+Or(t))}})),e=!1,r&&r(t),null!=t.__k)for(var n=[],o=0;o<t.__k.length;o++){var i=t.__k[o];if(i&&null!=i.key){var a=i.key;if(-1!==n.indexOf(a)){console.error('Following component has two or more children with the same key attribute: "'+a+'". This may cause glitches and misbehavior in rendering process. Component: \n\n'+Dr(t)+"\n\n"+Or(t));break}n.push(a)}}}}();var Br={exports:{}};!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)e.push(o);else if(Array.isArray(o)){if(o.length){var a=n.apply(null,o);a&&e.push(a)}
|
|
96
96
|
}else if("object"===i)if(o.toString===Object.prototype.toString)for(var s in o)t.call(o,s)&&o[s]&&e.push(s);else e.push(o.toString())}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(Br);var Fr,jr,Hr,Ur=Br.exports,qr=0,$r=[],Gr=n.__b,Vr=n.__r,Wr=n.diffed,Yr=n.__c,Kr=n.unmount;function Xr(e,t){n.__h&&n.__h(jr,e,qr||t),qr=0;var r=jr.__H||(jr.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Zr(e){return qr=1,Jr(uo,e)}function Jr(e,t,n){var r=Xr(Fr++,2);return r.t=e,r.__c||(r.__=[n?n(t):uo(void 0,t),function(e){var t=r.t(r.__[0],e);r.__[0]!==t&&(r.__=[t,r.__[1]],r.__c.setState({}))}],r.__c=jr),r.__}function Qr(e,t){var r=Xr(Fr++,3);!n.__s&&co(r.__H,t)&&(r.__=e,r.__H=t,jr.__H.__h.push(r))}function eo(e,t){var r=Xr(Fr++,4);!n.__s&&co(r.__H,t)&&(r.__=e,r.__H=t,jr.__h.push(r))}function to(e){return qr=5,no((function(){return{current:e}}),[])}function no(e,t){var n=Xr(Fr++,7);return co(n.__H,t)&&(n.__=e(),n.__H=t,n.__h=e),n.__}function ro(e,t){return qr=8,
|
|
97
97
|
no((function(){return e}),t)}function oo(e){var t=jr.context[e.__c],n=Xr(Fr++,9);return n.c=e,t?(null==n.__&&(n.__=!0,t.sub(jr)),t.props.value):e.__}function io(){var e;for($r.sort((function(e,t){return e.__v.__b-t.__v.__b}));e=$r.pop();)if(e.__P)try{e.__H.__h.forEach(so),e.__H.__h.forEach(lo),e.__H.__h=[]}catch(t){e.__H.__h=[],n.__e(t,e.__v)}}n.__b=function(e){jr=null,Gr&&Gr(e)},n.__r=function(e){Vr&&Vr(e),Fr=0;var t=(jr=e.__c).__H;t&&(t.__h.forEach(so),t.__h.forEach(lo),t.__h=[])},n.diffed=function(e){Wr&&Wr(e);var t=e.__c;t&&t.__H&&t.__H.__h.length&&(1!==$r.push(t)&&Hr===n.requestAnimationFrame||((Hr=n.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),ao&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);ao&&(t=requestAnimationFrame(n))})(io)),jr=null},n.__c=function(e,t){t.some((function(e){try{e.__h.forEach(so),e.__h=e.__h.filter((function(e){return!e.__||lo(e)}))}catch(r){t.some((function(e){e.__h&&(e.__h=[])})),t=[],n.__e(r,e.__v)}})),Yr&&Yr(e,t)},n.unmount=function(e){
|
|
@@ -99,11 +99,11 @@ Kr&&Kr(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach((function(e){try{so(e)}catch
|
|
|
99
99
|
;const a={};return r&&(a.title=r),po("span",{className:Ur("Hyp-SvgIcon",{"Hyp-SvgIcon--inline":n}),dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/SvgIcon.js",lineNumber:69,columnNumber:5})}function go(e,t){const n="string"==typeof e?Symbol(e):e;return mo.set(n,t),n}var vo="/home/runner/work/frontend-shared/frontend-shared/src/components/buttons.js";function yo({buttonRef:e,classes:t,className:n,icon:r,iconPosition:o="left",size:i="medium",variant:a="normal",expanded:s,pressed:l,type:c="button",...u}){var h;const d=null!==(h=null==u?void 0:u.role)&&void 0!==h?h:"button",p={"aria-label":u.title};return"tab"===d?p["aria-selected"]=l:(p["aria-pressed"]=l,p["aria-expanded"]=s),po("button",{ref:e,className:Ur(n,`${n}--${i}`,`${n}--${a}`,{[`${n}--icon-${o}`]:r},t),type:c,...p,...u},void 0,!1,{fileName:vo,lineNumber:82,columnNumber:5})}function _o({className:e="Hyp-IconButton",...t}){const{icon:n}=t;return po(yo,{className:e,...t,
|
|
100
100
|
children:po(fo,{name:n},void 0,!1,{fileName:vo,lineNumber:109,columnNumber:7})},void 0,!1,{fileName:vo,lineNumber:108,columnNumber:5})}function bo({children:e,className:t="Hyp-LabeledButton",...n}){const{icon:r,iconPosition:o="left"}=n;return po(yo,{className:t,...n,children:[r&&"left"===o&&po(fo,{name:r},void 0,!1,{fileName:vo,lineNumber:127,columnNumber:43}),e,r&&"right"===o&&po(fo,{name:r},void 0,!1,{fileName:vo,lineNumber:129,columnNumber:44})]},void 0,!0,{fileName:vo,lineNumber:126,columnNumber:5})}function wo(e){return po(yo,{className:"Hyp-LinkButton",...e},void 0,!1,{fileName:vo,lineNumber:140,columnNumber:10})}
|
|
101
101
|
go("checkbox",' <svg\n width="32"\n height="32"\n viewBox="-4 -4 39 39"\n aria-hidden="true"\n focusable="false"\n >\n <rect\n class="hyp-svg-checkbox--background"\n width="35"\n height="35"\n x="-2"\n y="-2"\n stroke="currentColor"\n fill="none"\n stroke-width="3"\n rx="5"\n ry="5"\n />\n <polyline\n class="hyp-svg-checkbox--checkmark"\n points="4,14 12,23 28,5"\n stroke="transparent"\n stroke-width="5"\n fill="none"\n />\n</svg>');var xo="/home/runner/work/frontend-shared/frontend-shared/src/components/containers.js";function ko({children:e,classes:t="",containerRef:n}){return po("div",{className:Ur("Hyp-Frame",t),ref:n,children:e},void 0,!1,{fileName:xo,lineNumber:26,columnNumber:5})}function So({children:e,direction:t="row",classes:n="",containerRef:r}){return po("div",{className:Ur(`Hyp-Actions--${t}`,n),ref:r,children:e},void 0,!1,{fileName:xo,lineNumber:72,columnNumber:5})}
|
|
102
|
-
var Co='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8l3.536-3.536L8 8 4.464 4.464 8 8zm0 0l-3.536 3.536L8 8l3.536 3.536L8 8z"></path></g></svg>\n',Ao="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";const
|
|
103
|
-
p.current.setAttribute("aria-describedby",h))}),[h]);const m=a&&c,f=e||m;return po("div",{"aria-labelledby":d,className:Ur("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[po("header",{className:"Hyp-Dialog__header",children:[o&&po("div",{className:"Hyp-Dialog__header-icon",children:po(fo,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:Ao,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:Ao,lineNumber:138,columnNumber:11}),po("h2",{className:"Hyp-Dialog__title",id:d,children:l},void 0,!1,{fileName:Ao,lineNumber:142,columnNumber:9}),a&&u&&po("div",{className:"Hyp-Dialog__close",children:po(_o,{"data-testid":"close-button",icon:
|
|
102
|
+
var Co='<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><g fill-rule="evenodd"><rect fill="none" stroke="none" x="0" y="0" width="16" height="16"></rect><path fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M8 8l3.536-3.536L8 8 4.464 4.464 8 8zm0 0l-3.536 3.536L8 8l3.536 3.536L8 8z"></path></g></svg>\n',Ao="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";const Eo=go("cancel",Co);let To=0;function No(e){const[t]=Zr((()=>(++To,`${e}-${To}`)));return t}function Lo({buttons:e,cancelLabel:t="Cancel",children:n,contentClass:r,icon:o,initialFocus:i,onCancel:a,role:s="dialog",title:l,withCancelButton:c=!0,withCloseButton:u=!0}){const h=No("dialog-description"),d=No("dialog-title"),p=to(null);Qr((()=>{if(null!==i){const e=null==i?void 0:i.current;e&&!e.disabled?e.focus():p.current.focus()}}),[]),eo((()=>{const e=p.current.querySelector("p");e&&(e.id=h,
|
|
103
|
+
p.current.setAttribute("aria-describedby",h))}),[h]);const m=a&&c,f=e||m;return po("div",{"aria-labelledby":d,className:Ur("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[po("header",{className:"Hyp-Dialog__header",children:[o&&po("div",{className:"Hyp-Dialog__header-icon",children:po(fo,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:Ao,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:Ao,lineNumber:138,columnNumber:11}),po("h2",{className:"Hyp-Dialog__title",id:d,children:l},void 0,!1,{fileName:Ao,lineNumber:142,columnNumber:9}),a&&u&&po("div",{className:"Hyp-Dialog__close",children:po(_o,{"data-testid":"close-button",icon:Eo,title:"Close",onClick:a},void 0,!1,{fileName:Ao,lineNumber:147,columnNumber:13})},void 0,!1,{fileName:Ao,lineNumber:146,columnNumber:11})]},void 0,!0,{fileName:Ao,lineNumber:136,columnNumber:7}),n,f&&po("div",{className:"Hyp-Dialog__actions",children:[m&&po(bo,{"data-testid":"cancel-button",onClick:a,children:t},void 0,!1,{
|
|
104
104
|
fileName:Ao,lineNumber:160,columnNumber:13}),e]},void 0,!0,{fileName:Ao,lineNumber:158,columnNumber:9})]},void 0,!0,{fileName:Ao,lineNumber:125,columnNumber:5})}function Mo({name:e,classes:t="",containerClasses:n="",title:r=""}){const o=mo.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=to();eo((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",Ur("Hyp-Icon",t))}),[t,o]);const a={};return r&&(a.title=r),po("span",{className:n,dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:60,columnNumber:5})}function zo({children:e,classes:t="",linkRef:n,...r}){return po("a",{className:Ur("Hyp-Link",t),ref:n,rel:"noopener noreferrer",...r,children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Link.js",lineNumber:24,columnNumber:5})}function Oo(e){const t={Left:"ArrowLeft",Up:"ArrowUp",Down:"ArrowDown",Right:"ArrowRight",
|
|
105
|
-
Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}function Io(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function
|
|
106
|
-
function Bo({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return po(Do,{onCancel:r,buttons:[po(bo,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:
|
|
105
|
+
Spacebar:" ",Del:"Delete"};return t[e]?t[e]:e}function Io(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function Ro(e,t,n){Qr((()=>{if(!t)return()=>{};const r=Io(document.body,["keydown"],(e=>{"Escape"===Oo(e.key)&&n()})),o=Io(document.body,["focus"],(t=>{e.current.contains(t.target)||n()}),{useCapture:!0}),i=Io(document.body,["mousedown","click"],(t=>{e.current.contains(t.target)||n()}),{useCapture:!0});return()=>{r(),i(),o()}}),[e,t,n])}var Po="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function Do({children:e,onCancel:t,...n}){const r=to(null);return Ro(r,!0,(()=>{t&&t()})),po(m,{children:[po("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:Po,lineNumber:37,columnNumber:7}),po("div",{className:"Hyp-Modal",ref:r,children:po(Lo,{onCancel:t,...n,children:e},void 0,!1,{fileName:Po,lineNumber:39,columnNumber:9})},void 0,!1,{fileName:Po,lineNumber:38,columnNumber:7})]},void 0,!0)}
|
|
106
|
+
function Bo({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return po(Do,{onCancel:r,buttons:[po(bo,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:Po,lineNumber:74,columnNumber:9})],...o,children:po("p",{children:e},void 0,!1,{fileName:Po,lineNumber:85,columnNumber:7})},void 0,!1,{fileName:Po,lineNumber:71,columnNumber:5})}var Fo="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";const jo=go("cancel",Co);function Ho({children:e,icon:t,onClose:n,title:r}){const o=!!n;return po("div",{className:Ur("Hyp-Panel",{"Hyp-Panel--closeable":o}),children:[po("header",{className:"Hyp-Panel__header",children:[t&&po("div",{className:"Hyp-Panel__header-icon",children:po(fo,{name:t,title:r},void 0,!1,{fileName:Fo,lineNumber:37,columnNumber:13})},void 0,!1,{fileName:Fo,lineNumber:36,columnNumber:11}),po("h2",{className:"Hyp-Panel__title",children:r},void 0,!1,{fileName:Fo,lineNumber:40,columnNumber:9}),o&&po("div",{className:"Hyp-Panel__close",
|
|
107
107
|
children:po(_o,{icon:jo,title:"Close",onClick:n},void 0,!1,{fileName:Fo,lineNumber:43,columnNumber:13})},void 0,!1,{fileName:Fo,lineNumber:42,columnNumber:11})]},void 0,!0,{fileName:Fo,lineNumber:34,columnNumber:7}),po("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:Fo,lineNumber:47,columnNumber:7})]},void 0,!0,{fileName:Fo,lineNumber:29,columnNumber:5})}
|
|
108
108
|
const Uo=go("spinner",'<svg viewBox="0 0 64 64">\n <g stroke-width="6" stroke="currentColor" stroke-linecap="round">\n <line y1="16" y2="28" transform="translate(32,32) rotate(180)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(225)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".15;0;1;.8;.65;.45;.3;.15" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(270)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".3;.15;0;1;.8;.65;.45;.3" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(315)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".45;.3;.15;0;1;.85;.65;.45" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(0)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".65;.45;.3;.15;0;1;.8;.65;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(45)">\n <animate attributeName="stroke-opacity" dur="750ms" values=".8;.65;.45;.3;.15;0;1;.8" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(90)">\n <animate attributeName="stroke-opacity" dur="750ms" values="1;.85;.6;.45;.3;.15;0;1;" repeatCount="indefinite"></animate>\n </line>\n <line y1="16" y2="28" transform="translate(32,32) rotate(135)">\n <animate attributeName="stroke-opacity" dur="750ms" values="0;1;.8;.65;.45;.3;.15;0" repeatCount="indefinite"></animate>\n </line>\n </g>\n</svg>')
|
|
109
109
|
;function qo({classes:e="",size:t="medium"}){return po(Mo,{name:Uo,containerClasses:Ur(`Hyp-Spinner--${t}`,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:32,columnNumber:5})}var $o="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js";function Go({classes:e="",inputRef:t,hasError:n=!1,type:r="text",...o}){return po("input",{className:Ur("Hyp-TextInput",{"has-error":n},e),...o,ref:t,type:r},void 0,!1,{fileName:$o,lineNumber:39,columnNumber:5})}function Vo({children:e,classes:t=""}){return po("div",{className:Ur("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:$o,lineNumber:67,columnNumber:5})}
|
|
@@ -144,42 +144,42 @@ this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmou
|
|
|
144
144
|
get:n})}return Qr((()=>e.subscribe((()=>{r.find((t=>t.method.apply(e,t.args)!==t.result))&&(r.splice(0,r.length),n(0))}))),[r,e]),o.current}const ai={collapsed:!1,depth:0,visible:!0,replyCount:0};function si(e){return e.id||e.$tag}function li(e,t,n){return!(!e[n]||e[n].parent===t)&&(!e[n].parent||li(e,t,e[n].parent))}function ci(e,t,n=[]){if(e[t].parent||!n.length)return;const r=n[n.length-1];e[r]||(e[r]={...ai,children:[],id:r},ci(e,r,n.slice(0,-1))),li(e,t,r)&&(e[t].parent=r,e[r].children.push(e[t]))}function ui(e,t){return Object.assign({},t(e),{children:e.children.map((e=>ui(e,t)))})}function hi(e,t,n){const r=e.children.map((e=>hi(e,n,n))).slice().sort(t);return{...e,children:r}}function di(e,t){const n=e.children.map((e=>di(e,t+1))),r=n.reduce(((e,t)=>e+1+t.replyCount),0);return{...e,children:n,depth:t,replyCount:r}}function pi(e){return e.children.some((e=>e.visible||pi(e)))}
|
|
145
145
|
const mi=(e,t)=>e.annotation&&t.annotation?e.annotation.created<t.annotation.created?-1:e.annotation.created>t.annotation.created?1:0:0;function fi(e,t){const n=t.selected.length>0,r=t.forcedVisible.length>0;let o=function(e){const t={};e.forEach((e=>{const n=si(e);t[n]={...ai,children:[],annotation:e,id:n}})),e.forEach((e=>{const n=(e.references||[]).filter((t=>t!==e.id));return ci(t,si(e),n)}));const n=[];for(const e in t)t[e].parent||(t[e].collapsed=!0,n.push(t[e]));return{...ai,id:"root",children:n}}(e);return n&&(o.children=o.children.filter((e=>{const n=t.selected.includes(e.id),o=r&&t.forcedVisible.includes(e.id);return n||o}))),t.threadFilterFn&&(o.children=o.children.filter(t.threadFilterFn)),o.visible=!1,o=ui(o,(e=>{let n=e.visible;return t.filterFn&&(n=!(!r||!t.forcedVisible.includes(e.id))||!!e.annotation&&!!t.filterFn(e.annotation)),{...e,visible:n}})),o.children=o.children.filter((e=>e.visible||pi(e))),o=ui(o,(e=>{const n={collapsed:e.collapsed}
|
|
146
146
|
;if(t.expanded.hasOwnProperty(e.id))n.collapsed=!t.expanded[e.id];else{const r=t.filterFn&&pi(e);n.collapsed=e.collapsed&&!r}return{...e,...n}})),o=hi(o,t.sortCompareFn,mi),o=di(o,-1),o}function gi(e){const t=e.slice(0,e.indexOf(":"));if(!t)return[null,e];if(["group","quote","since","tag","text","uri","user"].includes(t)){return[t,e.slice(t.length+1)]}return[null,e]}function vi(e){if(!e)return[];const t=function(e){const t=e.slice(0,1),n=e.slice(-1);return'"'!==t&&"'"!==t||t!==n||(e=e.slice(1,e.length-1)),e};let n=e.match(/(?:[^\s"']+|"[^"]*"|'[^']*')+/g)||[];n=n.map(t);for(let e=0;e<n.length;e++){const r=n[e],[o,i]=gi(r);o&&(n[e]=o+":"+t(i))}return n}function yi(e){const t={},n=e=>"tag"===e?"tags":e,r=(e,n)=>t[e]?t[e].push(n):t[e]=[n];if(e){const t=vi(e);for(const e of t){let[t,o]=gi(e);t||(t="any",o=e),r(n(t),o)}}return t}function _i(e){const t=e.uri;let n;try{n=new URL(t).hostname}catch{n=""}"localhost"===n&&(n="");let r=n;return e.document&&e.document.title&&(r=e.document.title[0]),{uri:t,domain:n,title:r
|
|
147
|
-
}}function bi(e){let t=e.uri;return t&&0!==t.indexOf("http://")&&0!==t.indexOf("https://")&&(t=null),e.links&&e.links.incontext&&(t=e.links.incontext),t}function wi(e){const t=_i(e);let n="";if(t.uri&&0===t.uri.indexOf("file://")&&t.title){const e=t.uri.split("/"),r=e[e.length-1];r&&(n=r)}else t.domain&&t.domain!==t.title&&(n=t.domain);return n}function xi(e){let t=_i(e).title;return t.length>30&&(t=t.slice(0,30)+"…"),t}function ki(e){return(e.references||[]).length>0}function Si(e){return!e.id}function Ci(e){let t=!1;return e.permissions?(e.permissions.read.forEach((e=>{const n=e.split(":");2===n.length&&"group"===n[0]&&(t=!0)})),t):t}function Ai(e){return!!(e.target&&e.target.length>0&&e.target[0].selector)}function
|
|
147
|
+
}}function bi(e){let t=e.uri;return t&&0!==t.indexOf("http://")&&0!==t.indexOf("https://")&&(t=null),e.links&&e.links.incontext&&(t=e.links.incontext),t}function wi(e){const t=_i(e);let n="";if(t.uri&&0===t.uri.indexOf("file://")&&t.title){const e=t.uri.split("/"),r=e[e.length-1];r&&(n=r)}else t.domain&&t.domain!==t.title&&(n=t.domain);return n}function xi(e){let t=_i(e).title;return t.length>30&&(t=t.slice(0,30)+"…"),t}function ki(e){return(e.references||[]).length>0}function Si(e){return!e.id}function Ci(e){let t=!1;return e.permissions?(e.permissions.read.forEach((e=>{const n=e.split(":");2===n.length&&"group"===n[0]&&(t=!0)})),t):t}function Ai(e){return!!(e.target&&e.target.length>0&&e.target[0].selector)}function Ei(e){return Ai(e)&&void 0===e.$orphan&&!e.$anchorTimeout}function Ti(e){return!!e.hidden}function Ni(e){return!!e.$highlight||!Si(e)&&!(Mi(e)||ki(e)||e.hidden||e.text||e.tags&&e.tags.length)}function Li(e){return Ai(e)&&!0===e.$orphan}function Mi(e){return!Ai(e)&&!ki(e)}function zi(e){
|
|
148
148
|
return!(!Ai(e)||Li(e))}function Oi(e){if(e){const t=e.target||[];for(let e=0;e<t.length;e++){const n=t[e].selector||[];for(const e of n)if("TextPositionSelector"===e.type)return e.start}}return Number.POSITIVE_INFINITY}function Ii(e){if(0===e.target.length)return null;const t=e.target[0];if(!t.selector)return null;const n=t.selector.find((e=>"TextQuoteSelector"===e.type));return n?n.exact:null}
|
|
149
|
-
const
|
|
150
|
-
;function
|
|
149
|
+
const Ri=/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08E4-\u08FE\u0900-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C01-\u0C03\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C82\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D02\u0D03\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u18A9\u1920-\u192B\u1930-\u193B\u19B0-\u19C0\u19C8\u19C9\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1DC0-\u1DE6\u1DFC-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C4\uA8E0-\uA8F1\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE26]/g
|
|
150
|
+
;function Pi(e){return"string"!=typeof e?e:function(e){return e.replace(Ri,"")}((t=e,t.normalize("NFKD"))).toLowerCase();var t}class Di{constructor(e,t,n){this.field=e,this.term=t,this.checker=n}matches(e){const t=this.checker;if(t.autofalse&&t.autofalse(e))return!1;let n=t.value(e);return n=Array.isArray(n)?n.map(Pi):Pi(n),t.match(this.term,n)}}class Bi{constructor(e,t){this.operator=e,this.filters=t}matches(e){return"and"===this.operator?this.filters.every((t=>t.matches(e))):this.filters.some((t=>t.matches(e)))}}const Fi={quote:{autofalse:e=>(e.references||[]).length>0,value:e=>Ii(e)||"",match:(e,t)=>t.indexOf(e)>-1},since:{autofalse:e=>"string"!=typeof e.updated,value:e=>new Date(e.updated),match:(e,t)=>(Date.now()-t)/1e3<=e},tag:{autofalse:e=>!Array.isArray(e.tags),value:e=>e.tags,match:(e,t)=>t.includes(e)},text:{autofalse:e=>"string"!=typeof e.text,value:e=>e.text,match:(e,t)=>t.indexOf(e)>-1},uri:{autofalse:e=>"string"!=typeof e.uri,value:e=>e.uri,match:(e,t)=>t.indexOf(e)>-1},user:{
|
|
151
151
|
autofalse:e=>"string"!=typeof e.user,value:e=>e.user+" "+function(e){return e.user_info&&e.user_info.display_name||""}(e),match:(e,t)=>t.indexOf(e)>-1}};function ji(e){return Li(e)?"orphan":Mi(e)?"note":"annotation"}function Hi(e,t){const n=e.visible===t;return e.children.reduce(((e,n)=>e+Hi(n,t)),n?1:0)}function Ui(e){return Hi(e,!1)}function qi(e){return Hi(e,!0)}function $i(e){const t=e.filter((e=>!!e.annotation)).map((e=>e.annotation));if(t.length)return t;const n=[];if(e.forEach((e=>{e.children&&n.push(...e.children)})),n.length)return $i(n);throw new Error("Thread contains no annotations")}function Gi(e){return $i([e]).reduce(((e,t)=>t.created>e?t.created:e),"")}function Vi(e){return $i([e]).reduce(((e,t)=>(e||(e=t.created),t.created<e?t.created:e)),"")}const Wi={Newest:function(e,t){const n=Gi(e),r=Gi(t);return n>r?-1:n<r?1:0},Oldest:function(e,t){const n=Vi(e),r=Vi(t);return n<r?-1:n>r?1:0},Location:function(e,t){if(!e.annotation||!t.annotation)return function(e,t){
|
|
152
152
|
return e.annotation||t.annotation?e.annotation?1:-1:0}(e,t);const n=Oi(e.annotation),r=Oi(t.annotation);return n<r?-1:n>r?1:0}};const Yi=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){const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:Wi[t.sortKey]},r=!!t.filterQuery||Object.keys(t.filters).length>0;if(r){const e=function(e,t={}){let n;const r=[],o=[],i=[],a=[],s=[],l=[],c=t.user?[t.user]:[];if(e){n=vi(e);for(const e of n){const t=e.slice(0,e.indexOf(":")),n=e.slice(t.length+1);switch(t){case"quote":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";i.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":
|
|
153
|
-
c.push(n);break;default:r.push(e)}}}return{any:{terms:r,operator:"and"},quote:{terms:o,operator:"and"},since:{terms:i,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=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{const n=t.terms.map(
|
|
153
|
+
c.push(n);break;default:r.push(e)}}}return{any:{terms:r,operator:"and"},quote:{terms:o,operator:"and"},since:{terms:i,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=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{const n=t.terms.map(Pi);let r;if("any"===e){const e=["quote","text","tag","user"];r=n.map((t=>new Bi("or",e.map((e=>new Di(e,t,Fi[e]))))))}else r=n.map((t=>new Di(e,t,Fi[e])));return new Bi(t.operator,r)})),r=new Bi("and",n);return e.filter((e=>e.id&&r.matches(e))).map((e=>e.id))}([t],e).length>0}return!r&&"sidebar"===e.route&&(n.threadFilterFn=e=>{return!!e.annotation&&(n=e.annotation,r=t.selectedTab,!Ei(n)&&ji(n)===r);var n,r}),fi(e.annotations,n)}));function Ki(){const e=ii(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a=no((()=>({annotations:t,route:r,selection:{...o,
|
|
154
154
|
filterQuery:n,filters:i}})),[t,n,r,o,i]);return Yi(a)}var Xi=/^\s+|\s+$/g,Zi=/^[-+]0x[0-9a-f]+$/i,Ji=/^0b[01]+$/i,Qi=/^0o[0-7]+$/i,ea=parseInt,ta="object"==typeof X&&X&&X.Object===Object&&X,na="object"==typeof self&&self&&self.Object===Object&&self,ra=ta||na||Function("return this")(),oa=Object.prototype.toString,ia=Math.max,aa=Math.min,sa=function(){return ra.Date.now()};function la(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ca(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==oa.call(e)}(e))return NaN;if(la(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=la(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Xi,"");var n=Ji.test(e);return n||Qi.test(e)?ea(e.slice(2),n?2:8):Zi.test(e)?NaN:+e}var ua=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,h=!1,d=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function p(t){var n=r,i=o;return r=o=void 0,c=t,a=e.apply(i,n)}
|
|
155
155
|
function m(e){return c=e,s=setTimeout(g,t),u?p(e):a}function f(e){var n=e-l;return void 0===l||n>=t||n<0||h&&e-c>=i}function g(){var e=sa();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return h?aa(n,i-(e-c)):n}(e))}function v(e){return s=void 0,d&&r?p(e):(r=o=void 0,a)}function y(){var e=sa(),n=f(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return m(l);if(h)return s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=ca(t)||0,la(n)&&(u=!!n.leading,i=(h="maxWait"in n)?ia(ca(n.maxWait)||0,t):i,d="trailing"in n?!!n.trailing:d),y.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},y.flush=function(){return void 0===s?a:v(sa())},y};class ha{constructor(){this._listeners=new Map}add(e,t,n,r){e.addEventListener(t,n,r);const o=Symbol();return this._listeners.set(o,{eventTarget:e,eventType:t,listener:n}),o}remove(e){const t=this._listeners.get(e);if(t){const{eventTarget:n,eventType:r,listener:o}=t;n.removeEventListener(r,o),this._listeners.delete(e)}}removeAll(){
|
|
156
156
|
this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners.clear()}}const da={defaultHeight:200,marginAbove:800,marginBelow:800};function pa(e){const t=window.getComputedStyle(e);return e.getBoundingClientRect().height+(parseFloat(t.marginTop)+parseFloat(t.marginBottom))}function ma(e){return/^http(s?):/i.test(e)}function fa(e){return{read:[e],update:[e],delete:[e]}}function ga(e,t){return Object.assign(fa(e),{read:["group:"+t]})}function va(e,t,n){return"private"===function(e){switch(e){case"private":case"shared":return e;default:return"shared"}}(n)&&e?fa(e):ga(e,t)}function ya(e){return e.read.some((e=>0===e.indexOf("group:")))}function _a(e){return!ya(e)}function ba(e){const t=document.createElement("textarea");t.value=e,t.setAttribute("data-testid","copy-text"),t.contentEditable="true",document.body.appendChild(t),t.focus();try{const e=document.createRange(),n=document.getSelection();n.removeAllRanges(),e.selectNodeContents(t),n.addRange(e),
|
|
157
157
|
t.setSelectionRange(0,t.value.length),document.execCommand("copy")}finally{t.remove()}}function wa({label:e,iconName:t,uri:n}){return po("li",{className:"ShareLinks__link",children:po("a",{"aria-label":e,href:n,title:e,target:"_blank",rel:"noopener noreferrer",children:po(Mo,{name:t,classes:"ShareLinks__icon"})})})}function xa({shareURI:e}){const t=encodeURIComponent(e);return po("ul",{className:"ShareLinks",children:[po(wa,{iconName:"twitter",label:"Tweet share link",uri:`https://twitter.com/intent/tweet?url=${t}&hashtags=annotated`}),po(wa,{iconName:"facebook",label:"Share on Facebook",uri:`https://www.facebook.com/sharer/sharer.php?u=${t}`}),po(wa,{iconName:"email",label:"Share via email",uri:`mailto:?subject=${encodeURIComponent("Let's Annotate")}&body=${t}`})]})}function ka(){return((e=window.navigator,t="ontouchend"in document)=>["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(e.platform)||e.userAgent.includes("Mac")&&t)()}
|
|
158
|
-
var Sa=ri((function({annotation:e,toastMessenger:t,group:n,shareUri:r}){const o=_a(e.permissions),i=ma(e.uri),a=to(null),s=to(null),[l,c]=Zr(!1),u=to(l);if(
|
|
158
|
+
var Sa=ri((function({annotation:e,toastMessenger:t,group:n,shareUri:r}){const o=_a(e.permissions),i=ma(e.uri),a=to(null),s=to(null),[l,c]=Zr(!1),u=to(l);if(Ro(a,l,(()=>c(!1))),Qr((()=>{var e,t;u.current!==l&&(u.current=l,l&&!ka()&&(null===(e=s.current)||void 0===e||e.focus(),null===(t=s.current)||void 0===t||t.select()))}),[l]),!n)return null;const h=i,d="private"===n.type?po("span",{children:["Only members of the group ",po("em",{children:n.name})," may view this annotation."]}):po("span",{children:"Anyone using this link may view this annotation."}),p=o?po("span",{children:"Only you may view this annotation."}):d;return po("div",{className:"AnnotationShareControl",ref:a,children:[po(_o,{icon:"share",title:"Share",onClick:()=>c(!l),expanded:l}),l&&po("div",{className:"annotation-share-panel",children:[po("div",{className:"annotation-share-panel__header",children:po("div",{className:"annotation-share-panel__title",children:"Share this annotation"})}),po("div",{className:"annotation-share-panel__content",
|
|
159
159
|
children:[po("div",{className:"hyp-u-layout-row annotation-share-panel__inputs",children:po(Vo,{children:[po(Go,{"aria-label":"Use this URL to share this annotation",type:"text",value:r,readOnly:!0,inputRef:s}),po(_o,{icon:"copy",title:"Copy share link to clipboard",onClick:()=>{try{ba(r),t.success("Copied share link to clipboard")}catch(e){t.error("Unable to copy link")}},variant:"dark"})]})}),po("div",i?{className:"annotation-share-panel__details",children:p}:{className:"annotation-share-panel__details",children:"This annotation cannot be shared in its original context because it was made on a document that is not available on the web. This link shares the annotation by itself."}),h&&po(xa,{shareURI:r})]}),po(Mo,{name:"pointer",classes:"annotation-share-panel__arrow"})]})]})}),["toastMessenger"]);var Ca=ri((function({annotation:e,annotationsService:t,onReply:n,settings:r,toastMessenger:o}){const i=ii(),a=i.profile(),s=i.getGroup(e.group),l=i.isLoggedIn(),c=t=>function(e,t,n){return-1!==e[t].indexOf(n||"")
|
|
160
|
-
}(e.permissions,t,a.userid),u=c("delete"),h=c("update"),d=function(e){const t=
|
|
161
|
-
l?n():i.openSidebarPanel("loginPrompt")}}),p&&po(Sa,{annotation:e,group:s,shareUri:p}),d&&!e.flagged&&po(_o,{icon:"flag",title:"Report this annotation to moderators",onClick:()=>{t.flag(e).catch((()=>o.error("Flagging annotation failed")))}}),d&&e.flagged&&po(_o,{pressed:!0,icon:"flag--active",title:"Annotation has been reported to the moderators"})]})}),["annotationsService","settings","toastMessenger"]);function Aa({isCollapsed:e,setCollapsed:t,linkStyle:n={}}){return po("div",{className:"Excerpt__inline-controls",children:po("div",{className:"Excerpt__toggle-container",children:po(wo,{classes:"InlineLinkButton InlineLinkButton--underlined",onClick:()=>t(!e),expanded:!e,title:"Toggle visibility of full excerpt text",style:n,variant:"dark",children:e?"More":"Less"})})})}const
|
|
160
|
+
}(e.permissions,t,a.userid),u=c("delete"),h=c("update"),d=function(e){const t=P(e);return!1!==(null==t?void 0:t.allowFlagging)}(r)&&!!a.userid&&a.userid!==e.user,p=function(e){const t=P(e);return!1!==(null==t?void 0:t.enableShareLinks)}(r)&&function(e){var t,n,r,o,i,a;return ma(e.uri)?null!==(t=null!==(n=null===(r=e.links)||void 0===r?void 0:r.incontext)&&void 0!==n?n:null===(o=e.links)||void 0===o?void 0:o.html)&&void 0!==t?t:null:null!==(i=null===(a=e.links)||void 0===a?void 0:a.html)&&void 0!==i?i:null}(e);return po("div",{className:"AnnotationActionBar hyp-u-layout-row u-font--xlarge",children:[h&&po(_o,{icon:"edit",title:"Edit",onClick:()=>{i.createDraft(e,{tags:e.tags,text:e.text,isPrivate:_a(e.permissions)})}}),u&&po(_o,{icon:"trash",title:"Delete",onClick:async()=>{if(await Xo({title:"Delete annotation?",message:"Are you sure you want to delete this annotation?",confirmAction:"Delete"}))try{await t.delete(e)}catch(e){o.error(e.message)}}}),po(_o,{icon:"reply",title:"Reply",onClick:()=>{
|
|
161
|
+
l?n():i.openSidebarPanel("loginPrompt")}}),p&&po(Sa,{annotation:e,group:s,shareUri:p}),d&&!e.flagged&&po(_o,{icon:"flag",title:"Report this annotation to moderators",onClick:()=>{t.flag(e).catch((()=>o.error("Flagging annotation failed")))}}),d&&e.flagged&&po(_o,{pressed:!0,icon:"flag--active",title:"Annotation has been reported to the moderators"})]})}),["annotationsService","settings","toastMessenger"]);function Aa({isCollapsed:e,setCollapsed:t,linkStyle:n={}}){return po("div",{className:"Excerpt__inline-controls",children:po("div",{className:"Excerpt__toggle-container",children:po(wo,{classes:"InlineLinkButton InlineLinkButton--underlined",onClick:()=>t(!e),expanded:!e,title:"Toggle visibility of full excerpt text",style:n,variant:"dark",children:e?"More":"Less"})})})}const Ea=()=>{};var Ta=ri((function({children:e,collapse:t=!1,collapsedHeight:n,inlineControls:r=!0,onCollapsibleChanged:o=Ea,onToggleCollapsed:i=Ea,overflowThreshold:a=0,settings:s={}}){const[l,c]=Zr(!0),u=to(),[h,d]=Zr(0),p=ro((()=>{
|
|
162
162
|
const e=u.current.clientHeight;d(e);o(e>n+a)}),[n,o,a]);eo((()=>{const e=function(e,t){if("undefined"!=typeof ResizeObserver){const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.observe(e),()=>n.disconnect()}const n=new ha;let r=e.clientWidth,o=e.clientHeight;const i=()=>{r===e.clientWidth&&o===e.clientHeight||(r=e.clientWidth,o=e.clientHeight,t(r,o))};n.add(e,"load",i),n.add(window,"resize",i);const a=new MutationObserver(i);return a.observe(e,{characterData:!0,childList:!0,subtree:!0}),()=>{n.removeAll(),a.disconnect()}}(u.current,p);return p(),e}),[p]);const m=h>n+a,f=m&&(r?l:t),g={};0!==h&&(g["max-height"]=f?n:h);const v=e=>r?c(e):i(e);return po("div",{className:"Excerpt",style:g,children:[po("div",{className:"Excerpt__content",ref:u,children:e}),po("div",{role:"presentation",onClick:()=>v(!1),className:Ur({Excerpt__shadow:!0,"Excerpt__shadow--transparent":r,"is-hidden":!f}),title:"Show the full excerpt"}),m&&r&&po(Aa,{isCollapsed:l,setCollapsed:v,
|
|
163
163
|
linkStyle:ti(["selectionFontFamily"],s)})]})}),["settings"]);function Na(e,t=16/9){const n=document.createElement("iframe");return n.src=e,n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen",""),function(e,t){e.style.position="absolute",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%";const n=document.createElement("div");return n.style.paddingBottom=1/t*100+"%",n.style.position="relative",n.appendChild(e),n}(n,t)}function La(e){const t=/(\d+)([hms]?)/g,n={h:3600,m:60,s:1};let r,o=0;for(;null!==(r=t.exec(e));)r[2]?o+=Number(r[1])*n[r[2]]:o+=+r[1];return o.toString()}function Ma(e,t){const n=function(e){const t=["end","start","t"],n=new URLSearchParams(e.search),r=new URLSearchParams;for(let[e,o]of n)t.includes(e)&&("t"===e?r.append("start",La(o)):r.append(e,o));r.sort();let o=r.toString();return o&&(o=`?${o}`),o}(t);return Na(`https://www.youtube.com/embed/${e}${n}`)}function za(e,t,n,{aspectRatio:r}={}){return o=>{if(o.hostname!==e)return null
|
|
164
164
|
;const i=t.exec(o.pathname);if(!i)return null;const a=i[1];return Na(n(a),r)}}const Oa=[function(e){if("www.youtube.com"!==e.hostname)return null;if(!/\/watch\/?/.test(e.pathname))return null;const t=/[&?]v=([^&#]+)/.exec(e.search);return t?Ma(t[1],e):null},function(e){if("youtu.be"!==e.hostname)return null;const t=/^\/([^/]+)\/?$/.exec(e.pathname);return t?Ma(t[1],e):null},za("vimeo.com",/^\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),za("vimeo.com",/^\/channels\/[^/]+\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),za("flipgrid.com",/^\/s\/([^/]+)$/,(e=>`https://flipgrid.com/s/${e}?embed=true`)),function(e){if("archive.org"!==e.hostname)return null;const t=/^\/(embed|details)\/(.+)/.exec(e.pathname);if(!t)return null;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],""))}
|
|
165
|
-
const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),Na(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 Ia(e){if(e.href!==e.textContent&&decodeURI(e.href)!==e.textContent)return null;const t=function(e){let t,n;for(n=0;n<Oa.length;n++)if(t=Oa[n](e),t)return t;return null}(e);return t&&e.parentElement.replaceChild(t,e),t}var
|
|
166
|
-
if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var Va,Wa=rs(Array.prototype.forEach),Ya=rs(Array.prototype.pop),Ka=rs(Array.prototype.push),Xa=rs(String.prototype.toLowerCase),Za=rs(String.prototype.match),Ja=rs(String.prototype.replace),Qa=rs(String.prototype.indexOf),es=rs(String.prototype.trim),ts=rs(RegExp.prototype.test),ns=(Va=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ga(Va,t)});function rs(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return $a(e,t,r)}}function os(e,t){
|
|
165
|
+
const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),Na(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 Ia(e){if(e.href!==e.textContent&&decodeURI(e.href)!==e.textContent)return null;const t=function(e){let t,n;for(n=0;n<Oa.length;n++)if(t=Oa[n](e),t)return t;return null}(e);return t&&e.parentElement.replaceChild(t,e),t}var Ra=Object.hasOwnProperty,Pa=Object.setPrototypeOf,Da=Object.isFrozen,Ba=Object.getPrototypeOf,Fa=Object.getOwnPropertyDescriptor,ja=Object.freeze,Ha=Object.seal,Ua=Object.create,qa="undefined"!=typeof Reflect&&Reflect,$a=qa.apply,Ga=qa.construct;$a||($a=function(e,t,n){return e.apply(t,n)}),ja||(ja=function(e){return e}),Ha||(Ha=function(e){return e}),Ga||(Ga=function(e,t){return new(Function.prototype.bind.apply(e,[null].concat(function(e){
|
|
166
|
+
if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(t))))});var Va,Wa=rs(Array.prototype.forEach),Ya=rs(Array.prototype.pop),Ka=rs(Array.prototype.push),Xa=rs(String.prototype.toLowerCase),Za=rs(String.prototype.match),Ja=rs(String.prototype.replace),Qa=rs(String.prototype.indexOf),es=rs(String.prototype.trim),ts=rs(RegExp.prototype.test),ns=(Va=TypeError,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return Ga(Va,t)});function rs(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return $a(e,t,r)}}function os(e,t){Pa&&Pa(e,null);for(var n=t.length;n--;){var r=t[n];if("string"==typeof r){var o=Xa(r);o!==r&&(Da(t)||(t[n]=o),r=o)}e[r]=!0}return e}function is(e){var t=Ua(null),n=void 0;for(n in e)$a(Ra,e,[n])&&(t[n]=e[n]);return t}function as(e,t){for(;null!==e;){var n=Fa(e,t);if(n){if(n.get)return rs(n.get);if("function"==typeof n.value)return rs(n.value)}e=Ba(e)}
|
|
167
167
|
return function(e){return console.warn("fallback value for",e),null}}
|
|
168
168
|
var ss=ja(["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"]),ls=ja(["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"]),cs=ja(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),us=ja(["animate","color-profile","cursor","discard","fedropshadow","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"]),hs=ja(["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"]),ds=ja(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),ps=ja(["#text"]),ms=ja(["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"]),fs=ja(["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","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"]),gs=ja(["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"]),vs=ja(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),ys=Ha(/\{\{[\s\S]*|[\s\S]*\}\}/gm),_s=Ha(/<%[\s\S]*|[\s\S]*%>/gm),bs=Ha(/^data-[\-\w.\u00B7-\uFFFF]/),ws=Ha(/^aria-[\-\w]+$/),xs=Ha(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),ks=Ha(/^(?:\w+script|data):/i),Ss=Ha(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),Cs="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){
|
|
169
|
-
return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function As(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var
|
|
170
|
-
;var r=t.document,o=t.document,i=t.DocumentFragment,a=t.HTMLTemplateElement,s=t.Node,l=t.Element,c=t.NodeFilter,u=t.NamedNodeMap,h=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,d=t.HTMLFormElement,p=t.DOMParser,m=t.trustedTypes,f=l.prototype,g=as(f,"cloneNode"),v=as(f,"nextSibling"),y=as(f,"childNodes"),_=as(f,"parentNode");if("function"==typeof a){var b=o.createElement("template");b.content&&b.content.ownerDocument&&(o=b.content.ownerDocument)}var w=
|
|
169
|
+
return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function As(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}var Es=function(){return"undefined"==typeof window?null:window},Ts=function(e,t){if("object"!==(void 0===e?"undefined":Cs(e))||"function"!=typeof e.createPolicy)return null;var n=null,r="data-tt-policy-suffix";t.currentScript&&t.currentScript.hasAttribute(r)&&(n=t.currentScript.getAttribute(r));var o="dompurify"+(n?"#"+n:"");try{return e.createPolicy(o,{createHTML:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};var Ns=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Es(),n=function(t){return e(t)};if(n.version="2.3.4",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n
|
|
170
|
+
;var r=t.document,o=t.document,i=t.DocumentFragment,a=t.HTMLTemplateElement,s=t.Node,l=t.Element,c=t.NodeFilter,u=t.NamedNodeMap,h=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,d=t.HTMLFormElement,p=t.DOMParser,m=t.trustedTypes,f=l.prototype,g=as(f,"cloneNode"),v=as(f,"nextSibling"),y=as(f,"childNodes"),_=as(f,"parentNode");if("function"==typeof a){var b=o.createElement("template");b.content&&b.content.ownerDocument&&(o=b.content.ownerDocument)}var w=Ts(m,r),x=w&&ee?w.createHTML(""):"",k=o,S=k.implementation,C=k.createNodeIterator,A=k.createDocumentFragment,E=k.getElementsByTagName,T=r.importNode,N={};try{N=is(o).documentMode?o.documentMode:{}}catch(e){}var L={};n.isSupported="function"==typeof _&&S&&void 0!==S.createHTMLDocument&&9!==N;var M=ys,z=_s,O=bs,I=ws,R=ks,P=Ss,D=xs,B=null,F=os({},[].concat(As(ss),As(ls),As(cs),As(hs),As(ps))),j=null,H=os({},[].concat(As(ms),As(fs),As(gs),As(vs))),U=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},
|
|
171
171
|
attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),q=null,$=null,G=!0,V=!0,W=!1,Y=!1,K=!1,X=!1,Z=!1,J=!1,Q=!1,ee=!1,te=!0,ne=!0,re=!1,oe={},ie=null,ae=os({},["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"]),se=null,le=os({},["audio","video","img","source","image","track"]),ce=null,ue=os({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),he="http://www.w3.org/1998/Math/MathML",de="http://www.w3.org/2000/svg",pe="http://www.w3.org/1999/xhtml",me=pe,fe=!1,ge=void 0,ve=["application/xhtml+xml","text/html"],ye="text/html",_e=void 0,be=null,we=o.createElement("form"),xe=function(e){return e instanceof RegExp||e instanceof Function},ke=function(e){
|
|
172
172
|
be&&be===e||(e&&"object"===(void 0===e?"undefined":Cs(e))||(e={}),e=is(e),B="ALLOWED_TAGS"in e?os({},e.ALLOWED_TAGS):F,j="ALLOWED_ATTR"in e?os({},e.ALLOWED_ATTR):H,ce="ADD_URI_SAFE_ATTR"in e?os(is(ue),e.ADD_URI_SAFE_ATTR):ue,se="ADD_DATA_URI_TAGS"in e?os(is(le),e.ADD_DATA_URI_TAGS):le,ie="FORBID_CONTENTS"in e?os({},e.FORBID_CONTENTS):ae,q="FORBID_TAGS"in e?os({},e.FORBID_TAGS):{},$="FORBID_ATTR"in e?os({},e.FORBID_ATTR):{},oe="USE_PROFILES"in e&&e.USE_PROFILES,G=!1!==e.ALLOW_ARIA_ATTR,V=!1!==e.ALLOW_DATA_ATTR,W=e.ALLOW_UNKNOWN_PROTOCOLS||!1,Y=e.SAFE_FOR_TEMPLATES||!1,K=e.WHOLE_DOCUMENT||!1,J=e.RETURN_DOM||!1,Q=e.RETURN_DOM_FRAGMENT||!1,ee=e.RETURN_TRUSTED_TYPE||!1,Z=e.FORCE_BODY||!1,te=!1!==e.SANITIZE_DOM,ne=!1!==e.KEEP_CONTENT,re=e.IN_PLACE||!1,D=e.ALLOWED_URI_REGEXP||D,me=e.NAMESPACE||pe,e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(U.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),
|
|
173
173
|
e.CUSTOM_ELEMENT_HANDLING&&xe(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(U.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&(U.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),ge=ge=-1===ve.indexOf(e.PARSER_MEDIA_TYPE)?ye:e.PARSER_MEDIA_TYPE,_e="application/xhtml+xml"===ge?function(e){return e}:Xa,Y&&(V=!1),Q&&(J=!0),oe&&(B=os({},[].concat(As(ps))),j=[],!0===oe.html&&(os(B,ss),os(j,ms)),!0===oe.svg&&(os(B,ls),os(j,fs),os(j,vs)),!0===oe.svgFilters&&(os(B,cs),os(j,fs),os(j,vs)),!0===oe.mathMl&&(os(B,hs),os(j,gs),os(j,vs))),e.ADD_TAGS&&(B===F&&(B=is(B)),os(B,e.ADD_TAGS)),e.ADD_ATTR&&(j===H&&(j=is(j)),os(j,e.ADD_ATTR)),e.ADD_URI_SAFE_ATTR&&os(ce,e.ADD_URI_SAFE_ATTR),e.FORBID_CONTENTS&&(ie===ae&&(ie=is(ie)),os(ie,e.FORBID_CONTENTS)),ne&&(B["#text"]=!0),K&&os(B,["html","head","body"]),B.table&&(os(B,["tbody"]),delete q.tbody),ja&&ja(e),be=e)
|
|
174
|
-
},Se=os({},["mi","mo","mn","ms","mtext"]),Ce=os({},["foreignobject","desc","title","annotation-xml"]),Ae=os({},ls);os(Ae,cs),os(Ae,us);var
|
|
175
|
-
"is"===e&&!j[e])if(J||Q)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Me=function(e){var t=void 0,n=void 0;if(Z)e="<remove></remove>"+e;else{var r=Za(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=w?w.createHTML(e):e;if(me===pe)try{t=(new p).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(me,"template",null);try{t.documentElement.innerHTML=fe?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),me===pe?
|
|
176
|
-
return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},Ie=function(e){return"object"===(void 0===s?"undefined":Cs(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":Cs(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},
|
|
177
|
-
var o=_(e)||e.parentNode,i=y(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(g(i[a],!0),v(e))}if(!q[r]&&Be(r)){if(U.tagNameCheck instanceof RegExp&&ts(U.tagNameCheck,r))return!1;if(U.tagNameCheck instanceof Function&&U.tagNameCheck(r))return!1}return Ne(e),!0}return e instanceof l&&!
|
|
178
|
-
if(!(Be(e)&&(U.tagNameCheck instanceof RegExp&&ts(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&ts(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t))||"is"===t&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&ts(U.tagNameCheck,n)||U.tagNameCheck instanceof Function&&U.tagNameCheck(n))))return!1}else if(ce[t]);else if(ts(D,Ja(n,
|
|
179
|
-
r=s.attrValue,!s.forceKeepAttr&&(Le(c,e),s.keepAttr))if(ts(/\/>/i,r))Le(c,e);else{Y&&(r=Ja(r,M," "),r=Ja(r,z," "));var h=_e(e.nodeName);if(De(h,o,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),Ya(n.removed)}catch(e){}}}
|
|
180
|
-
re);else if(e instanceof s)1===(l=(a=Me("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!J&&!Y&&!K&&-1===e.indexOf("<"))return w&&ee?w.createHTML(e):e;if(!(a=Me(e)))return J?null:x}a&&Z&&Ne(a.firstChild);for(var d=ze(re?e:a);c=d.nextNode();)3===c.nodeType&&c===u||
|
|
174
|
+
},Se=os({},["mi","mo","mn","ms","mtext"]),Ce=os({},["foreignobject","desc","title","annotation-xml"]),Ae=os({},ls);os(Ae,cs),os(Ae,us);var Ee=os({},hs);os(Ee,ds);var Te=function(e){var t=_(e);t&&t.tagName||(t={namespaceURI:pe,tagName:"template"});var n=Xa(e.tagName),r=Xa(t.tagName);if(e.namespaceURI===de)return t.namespaceURI===pe?"svg"===n:t.namespaceURI===he?"svg"===n&&("annotation-xml"===r||Se[r]):Boolean(Ae[n]);if(e.namespaceURI===he)return t.namespaceURI===pe?"math"===n:t.namespaceURI===de?"math"===n&&Ce[r]:Boolean(Ee[n]);if(e.namespaceURI===pe){if(t.namespaceURI===de&&!Ce[r])return!1;if(t.namespaceURI===he&&!Se[r])return!1;var o=os({},["title","style","font","a","script"]);return!Ee[n]&&(o[n]||!Ae[n])}return!1},Ne=function(e){Ka(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},Le=function(e,t){try{Ka(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){Ka(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),
|
|
175
|
+
"is"===e&&!j[e])if(J||Q)try{Ne(t)}catch(e){}else try{t.setAttribute(e,"")}catch(e){}},Me=function(e){var t=void 0,n=void 0;if(Z)e="<remove></remove>"+e;else{var r=Za(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===ge&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=w?w.createHTML(e):e;if(me===pe)try{t=(new p).parseFromString(i,ge)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(me,"template",null);try{t.documentElement.innerHTML=fe?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),me===pe?E.call(t,K?"html":"body")[0]:K?t.documentElement:a},ze=function(e){return C.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},Oe=function(e){
|
|
176
|
+
return e instanceof d&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof h)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)},Ie=function(e){return"object"===(void 0===s?"undefined":Cs(s))?e instanceof s:e&&"object"===(void 0===e?"undefined":Cs(e))&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Re=function(e,t,r){L[e]&&Wa(L[e],(function(e){e.call(n,t,r,be)}))},Pe=function(e){var t=void 0;if(Re("beforeSanitizeElements",e,null),Oe(e))return Ne(e),!0;if(Za(e.nodeName,/[\u0080-\uFFFF]/))return Ne(e),!0;var r=_e(e.nodeName);if(Re("uponSanitizeElement",e,{tagName:r,allowedTags:B}),!Ie(e.firstElementChild)&&(!Ie(e.content)||!Ie(e.content.firstElementChild))&&ts(/<[/\w]/g,e.innerHTML)&&ts(/<[/\w]/g,e.textContent))return Ne(e),!0;if("select"===r&&ts(/<template/i,e.innerHTML))return Ne(e),!0;if(!B[r]||q[r]){if(ne&&!ie[r]){
|
|
177
|
+
var o=_(e)||e.parentNode,i=y(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(g(i[a],!0),v(e))}if(!q[r]&&Be(r)){if(U.tagNameCheck instanceof RegExp&&ts(U.tagNameCheck,r))return!1;if(U.tagNameCheck instanceof Function&&U.tagNameCheck(r))return!1}return Ne(e),!0}return e instanceof l&&!Te(e)?(Ne(e),!0):"noscript"!==r&&"noembed"!==r||!ts(/<\/no(script|embed)/i,e.innerHTML)?(Y&&3===e.nodeType&&(t=e.textContent,t=Ja(t,M," "),t=Ja(t,z," "),e.textContent!==t&&(Ka(n.removed,{element:e.cloneNode()}),e.textContent=t)),Re("afterSanitizeElements",e,null),!1):(Ne(e),!0)},De=function(e,t,n){if(te&&("id"===t||"name"===t)&&(n in o||n in we))return!1;if(V&&!$[t]&&ts(O,t));else if(G&&ts(I,t));else if(!j[t]||$[t]){
|
|
178
|
+
if(!(Be(e)&&(U.tagNameCheck instanceof RegExp&&ts(U.tagNameCheck,e)||U.tagNameCheck instanceof Function&&U.tagNameCheck(e))&&(U.attributeNameCheck instanceof RegExp&&ts(U.attributeNameCheck,t)||U.attributeNameCheck instanceof Function&&U.attributeNameCheck(t))||"is"===t&&U.allowCustomizedBuiltInElements&&(U.tagNameCheck instanceof RegExp&&ts(U.tagNameCheck,n)||U.tagNameCheck instanceof Function&&U.tagNameCheck(n))))return!1}else if(ce[t]);else if(ts(D,Ja(n,P,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==Qa(n,"data:")||!se[e]){if(W&&!ts(R,Ja(n,P,"")));else if(n)return!1}else;return!0},Be=function(e){return e.indexOf("-")>0},Fe=function(e){var t=void 0,r=void 0,o=void 0,i=void 0;Re("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:j};for(i=a.length;i--;){var l=t=a[i],c=l.name,u=l.namespaceURI;if(r=es(t.value),o=_e(c),s.attrName=o,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,Re("uponSanitizeAttribute",e,s),
|
|
179
|
+
r=s.attrValue,!s.forceKeepAttr&&(Le(c,e),s.keepAttr))if(ts(/\/>/i,r))Le(c,e);else{Y&&(r=Ja(r,M," "),r=Ja(r,z," "));var h=_e(e.nodeName);if(De(h,o,r))try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),Ya(n.removed)}catch(e){}}}Re("afterSanitizeAttributes",e,null)}},je=function e(t){var n=void 0,r=ze(t);for(Re("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Re("uponSanitizeShadowNode",n,null),Pe(n)||(n.content instanceof i&&e(n.content),Fe(n));Re("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e,o){var a=void 0,l=void 0,c=void 0,u=void 0,h=void 0;if((fe=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Ie(e)){if("function"!=typeof e.toString)throw ns("toString is not a function");if("string"!=typeof(e=e.toString()))throw ns("dirty is not a string, aborting")}if(!n.isSupported){if("object"===Cs(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Ie(e))return t.toStaticHTML(e.outerHTML)}return e}if(X||ke(o),n.removed=[],"string"==typeof e&&(re=!1),
|
|
180
|
+
re);else if(e instanceof s)1===(l=(a=Me("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===l.nodeName||"HTML"===l.nodeName?a=l:a.appendChild(l);else{if(!J&&!Y&&!K&&-1===e.indexOf("<"))return w&&ee?w.createHTML(e):e;if(!(a=Me(e)))return J?null:x}a&&Z&&Ne(a.firstChild);for(var d=ze(re?e:a);c=d.nextNode();)3===c.nodeType&&c===u||Pe(c)||(c.content instanceof i&&je(c.content),Fe(c),u=c);if(u=null,re)return e;if(J){if(Q)for(h=A.call(a.ownerDocument);a.firstChild;)h.appendChild(a.firstChild);else h=a;return j.shadowroot&&(h=T.call(r,h,!0)),h}var p=K?a.outerHTML:a.innerHTML;return Y&&(p=Ja(p,M," "),p=Ja(p,z," ")),w&&ee?w.createHTML(p):p},n.setConfig=function(e){ke(e),X=!0},n.clearConfig=function(){be=null,X=!1},n.isValidAttribute=function(e,t,n){be||ke({});var r=_e(e),o=_e(t);return De(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(L[e]=L[e]||[],Ka(L[e],t))},n.removeHook=function(e){L[e]&&Ya(L[e])},n.removeHooks=function(e){L[e]&&(L[e]=[])},n.removeAllHooks=function(){L={}},n
|
|
181
181
|
}(),Ls=/["'&<>]/,Ms=function(e){var t,n=""+e,r=Ls.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=""";break;case 38:t="&";break;case 39:t="'";break;case 60:t="<";break;case 62:t=">";break;default:continue}a!==i&&(o+=n.substring(a,i)),a=i+1,o+=t}return a!==i?o+n.substring(a,i):o};class zs{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 zs(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Os{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 Os(t,zs.range(this,e))}}class Is{constructor(e,t){this.position=void 0;var n,r="KaTeX parse error: "+e,o=t&&t.loc;if(o&&o.start<=o.end){var i=o.lexer.input;n=o.start;var a=o.end;n===i.length?r+=" at end of input: ":r+=" at position "+(n+1)+": "
|
|
182
|
-
;var s=i.slice(n,a).replace(/[^]/g,"$&̲");r+=(n>15?"…"+i.slice(n-15,n):i.slice(0,n))+s+(a+15<i.length?i.slice(a,a+15)+"…":i.slice(a))}var l=new Error(r);return l.name="ParseError",l.__proto__=Is.prototype,l.position=n,l}}Is.prototype.__proto__=Error.prototype;var
|
|
182
|
+
;var s=i.slice(n,a).replace(/[^]/g,"$&̲");r+=(n>15?"…"+i.slice(n-15,n):i.slice(0,n))+s+(a+15<i.length?i.slice(a,a+15)+"…":i.slice(a))}var l=new Error(r);return l.name="ParseError",l.__proto__=Is.prototype,l.position=n,l}}Is.prototype.__proto__=Error.prototype;var Rs=/([A-Z])/g,Ps={"&":"&",">":">","<":"<",'"':""","'":"'"},Ds=/[&><"']/g;var Bs=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},Fs={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(Ds,(e=>Ps[e]))},hyphenate:function(e){return e.replace(Rs,"-$1").toLowerCase()},getBaseElem:Bs,isCharacterBox:function(e){var t=Bs(e);return"mathord"===t.type||"textord"===t.type||"atom"===t.type},protocolFromUrl:function(e){var t=/^\s*([^\\/#]*?)(?::|�*58|�*3a)/i.exec(e);return null!=t?t[1]:"_relative"}},js={displayMode:{type:"boolean",
|
|
183
183
|
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>",
|
|
184
184
|
cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],
|
|
185
185
|
description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function Hs(e){if(e.default)return e.default;var t=e.type,n=Array.isArray(t)?t[0]:t;if("string"!=typeof n)return n.enum[0];switch(n){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{}}}class Us{constructor(e){for(var t in this.displayMode=void 0,
|
|
@@ -272,28 +272,28 @@ this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.clas
|
|
|
272
272
|
this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,yl.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Fs.contains(this.classes,e)}toNode(){return _l.call(this,"span")}toMarkup(){return bl.call(this,"span")}}class xl{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,yl.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Fs.contains(this.classes,e)}toNode(){return _l.call(this,"a")}toMarkup(){return bl.call(this,"a")}}class kl{constructor(e,t,n){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.style=n}hasClass(e){return Fs.contains(this.classes,e)}toNode(){var e=document.createElement("img")
|
|
273
273
|
;for(var t in e.src=this.src,e.alt=this.alt,e.className="mord",this.style)this.style.hasOwnProperty(t)&&(e.style[t]=this.style[t]);return e}toMarkup(){var e="<img src='"+this.src+" 'alt='"+this.alt+"' ",t="";for(var n in this.style)this.style.hasOwnProperty(n)&&(t+=Fs.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+Fs.escape(t)+'"'),e+="'/>"}}var Sl={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class Cl{constructor(e,t,n,r,o,i,a,s){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=n||0,this.italic=r||0,this.skew=o||0,this.width=i||0,this.classes=a||[],this.style=s||{},this.maxFontSize=0;var l=function(e){for(var t=0;t<Js.length;t++)for(var n=Js[t],r=0;r<n.blocks.length;r++){var o=n.blocks[r];if(e>=o[0]&&e<=o[1])return n.name}return null}(this.text.charCodeAt(0));l&&this.classes.push(l+"_fallback"),
|
|
274
274
|
/[îïíì]/.test(this.text)&&(this.text=Sl[this.text])}hasClass(e){return Fs.contains(this.classes,e)}toNode(){var e=document.createTextNode(this.text),t=null;for(var n in this.italic>0&&((t=document.createElement("span")).style.marginRight=gl(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=vl(this.classes)),this.style)this.style.hasOwnProperty(n)&&((t=t||document.createElement("span")).style[n]=this.style[n]);return t?(t.appendChild(e),t):e}toMarkup(){var e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=Fs.escape(vl(this.classes)),t+='"');var n="";for(var r in this.italic>0&&(n+="margin-right:"+this.italic+"em;"),this.style)this.style.hasOwnProperty(r)&&(n+=Fs.hyphenate(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+Fs.escape(n)+'"');var o=Fs.escape(this.text);return e?(t+=">",t+=o,t+="</span>"):o}}class Al{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){
|
|
275
|
-
var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"}}class
|
|
276
|
-
var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");return e+="/>"}}function Nl(e){if(e instanceof Cl)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var Ll={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ml={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},zl={math:{},text:{}};function Ol(e,t,n,r,o,i){zl[e][o]={font:t,group:n,replace:r},i&&r&&(zl[e][r]=zl[e][o])}var Il="math",
|
|
277
|
-
Ol(Il,
|
|
278
|
-
Ol(Il,
|
|
279
|
-
Ol(Il,
|
|
275
|
+
var e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e='<svg xmlns="http://www.w3.org/2000/svg"';for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");e+=">";for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</svg>"}}class El{constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){var e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",tl[this.pathName]),e}toMarkup(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+tl[this.pathName]+"'/>"}}class Tl{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){
|
|
276
|
+
var e=document.createElementNS("http://www.w3.org/2000/svg","line");for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);return e}toMarkup(){var e="<line";for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+"='"+this.attributes[t]+"'");return e+="/>"}}function Nl(e){if(e instanceof Cl)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var Ll={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Ml={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},zl={math:{},text:{}};function Ol(e,t,n,r,o,i){zl[e][o]={font:t,group:n,replace:r},i&&r&&(zl[e][r]=zl[e][o])}var Il="math",Rl="text",Pl="main",Dl="ams",Bl="accent-token",Fl="bin",jl="close",Hl="mathord",Ul="op-token",ql="open",$l="rel",Gl="textord";Ol(Il,Pl,$l,"≡","\\equiv",!0),Ol(Il,Pl,$l,"≺","\\prec",!0),Ol(Il,Pl,$l,"≻","\\succ",!0),Ol(Il,Pl,$l,"∼","\\sim",!0),Ol(Il,Pl,$l,"⊥","\\perp"),Ol(Il,Pl,$l,"⪯","\\preceq",!0),
|
|
277
|
+
Ol(Il,Pl,$l,"⪰","\\succeq",!0),Ol(Il,Pl,$l,"≃","\\simeq",!0),Ol(Il,Pl,$l,"∣","\\mid",!0),Ol(Il,Pl,$l,"≪","\\ll",!0),Ol(Il,Pl,$l,"≫","\\gg",!0),Ol(Il,Pl,$l,"≍","\\asymp",!0),Ol(Il,Pl,$l,"∥","\\parallel"),Ol(Il,Pl,$l,"⋈","\\bowtie",!0),Ol(Il,Pl,$l,"⌣","\\smile",!0),Ol(Il,Pl,$l,"⊑","\\sqsubseteq",!0),Ol(Il,Pl,$l,"⊒","\\sqsupseteq",!0),Ol(Il,Pl,$l,"≐","\\doteq",!0),Ol(Il,Pl,$l,"⌢","\\frown",!0),Ol(Il,Pl,$l,"∋","\\ni",!0),Ol(Il,Pl,$l,"∝","\\propto",!0),Ol(Il,Pl,$l,"⊢","\\vdash",!0),Ol(Il,Pl,$l,"⊣","\\dashv",!0),Ol(Il,Pl,$l,"∋","\\owns"),Ol(Il,Pl,"punct",".","\\ldotp"),Ol(Il,Pl,"punct","⋅","\\cdotp"),Ol(Il,Pl,Gl,"#","\\#"),Ol(Rl,Pl,Gl,"#","\\#"),Ol(Il,Pl,Gl,"&","\\&"),Ol(Rl,Pl,Gl,"&","\\&"),Ol(Il,Pl,Gl,"ℵ","\\aleph",!0),Ol(Il,Pl,Gl,"∀","\\forall",!0),Ol(Il,Pl,Gl,"ℏ","\\hbar",!0),Ol(Il,Pl,Gl,"∃","\\exists",!0),Ol(Il,Pl,Gl,"∇","\\nabla",!0),Ol(Il,Pl,Gl,"♭","\\flat",!0),Ol(Il,Pl,Gl,"ℓ","\\ell",!0),Ol(Il,Pl,Gl,"♮","\\natural",!0),Ol(Il,Pl,Gl,"♣","\\clubsuit",!0),Ol(Il,Pl,Gl,"℘","\\wp",!0),Ol(Il,Pl,Gl,"♯","\\sharp",!0),
|
|
278
|
+
Ol(Il,Pl,Gl,"♢","\\diamondsuit",!0),Ol(Il,Pl,Gl,"ℜ","\\Re",!0),Ol(Il,Pl,Gl,"♡","\\heartsuit",!0),Ol(Il,Pl,Gl,"ℑ","\\Im",!0),Ol(Il,Pl,Gl,"♠","\\spadesuit",!0),Ol(Il,Pl,Gl,"§","\\S",!0),Ol(Rl,Pl,Gl,"§","\\S"),Ol(Il,Pl,Gl,"¶","\\P",!0),Ol(Rl,Pl,Gl,"¶","\\P"),Ol(Il,Pl,Gl,"†","\\dag"),Ol(Rl,Pl,Gl,"†","\\dag"),Ol(Rl,Pl,Gl,"†","\\textdagger"),Ol(Il,Pl,Gl,"‡","\\ddag"),Ol(Rl,Pl,Gl,"‡","\\ddag"),Ol(Rl,Pl,Gl,"‡","\\textdaggerdbl"),Ol(Il,Pl,jl,"⎱","\\rmoustache",!0),Ol(Il,Pl,ql,"⎰","\\lmoustache",!0),Ol(Il,Pl,jl,"⟯","\\rgroup",!0),Ol(Il,Pl,ql,"⟮","\\lgroup",!0),Ol(Il,Pl,Fl,"∓","\\mp",!0),Ol(Il,Pl,Fl,"⊖","\\ominus",!0),Ol(Il,Pl,Fl,"⊎","\\uplus",!0),Ol(Il,Pl,Fl,"⊓","\\sqcap",!0),Ol(Il,Pl,Fl,"∗","\\ast"),Ol(Il,Pl,Fl,"⊔","\\sqcup",!0),Ol(Il,Pl,Fl,"◯","\\bigcirc",!0),Ol(Il,Pl,Fl,"∙","\\bullet"),Ol(Il,Pl,Fl,"‡","\\ddagger"),Ol(Il,Pl,Fl,"≀","\\wr",!0),Ol(Il,Pl,Fl,"⨿","\\amalg"),Ol(Il,Pl,Fl,"&","\\And"),Ol(Il,Pl,$l,"⟵","\\longleftarrow",!0),Ol(Il,Pl,$l,"⇐","\\Leftarrow",!0),Ol(Il,Pl,$l,"⟸","\\Longleftarrow",!0),
|
|
279
|
+
Ol(Il,Pl,$l,"⟶","\\longrightarrow",!0),Ol(Il,Pl,$l,"⇒","\\Rightarrow",!0),Ol(Il,Pl,$l,"⟹","\\Longrightarrow",!0),Ol(Il,Pl,$l,"↔","\\leftrightarrow",!0),Ol(Il,Pl,$l,"⟷","\\longleftrightarrow",!0),Ol(Il,Pl,$l,"⇔","\\Leftrightarrow",!0),Ol(Il,Pl,$l,"⟺","\\Longleftrightarrow",!0),Ol(Il,Pl,$l,"↦","\\mapsto",!0),Ol(Il,Pl,$l,"⟼","\\longmapsto",!0),Ol(Il,Pl,$l,"↗","\\nearrow",!0),Ol(Il,Pl,$l,"↩","\\hookleftarrow",!0),Ol(Il,Pl,$l,"↪","\\hookrightarrow",!0),Ol(Il,Pl,$l,"↘","\\searrow",!0),Ol(Il,Pl,$l,"↼","\\leftharpoonup",!0),Ol(Il,Pl,$l,"⇀","\\rightharpoonup",!0),Ol(Il,Pl,$l,"↙","\\swarrow",!0),Ol(Il,Pl,$l,"↽","\\leftharpoondown",!0),Ol(Il,Pl,$l,"⇁","\\rightharpoondown",!0),Ol(Il,Pl,$l,"↖","\\nwarrow",!0),Ol(Il,Pl,$l,"⇌","\\rightleftharpoons",!0),Ol(Il,Dl,$l,"≮","\\nless",!0),Ol(Il,Dl,$l,"","\\@nleqslant"),Ol(Il,Dl,$l,"","\\@nleqq"),Ol(Il,Dl,$l,"⪇","\\lneq",!0),Ol(Il,Dl,$l,"≨","\\lneqq",!0),Ol(Il,Dl,$l,"","\\@lvertneqq"),Ol(Il,Dl,$l,"⋦","\\lnsim",!0),Ol(Il,Dl,$l,"⪉","\\lnapprox",!0),Ol(Il,Dl,$l,"⊀","\\nprec",!0),
|
|
280
280
|
Ol(Il,Dl,$l,"⋠","\\npreceq",!0),Ol(Il,Dl,$l,"⋨","\\precnsim",!0),Ol(Il,Dl,$l,"⪹","\\precnapprox",!0),Ol(Il,Dl,$l,"≁","\\nsim",!0),Ol(Il,Dl,$l,"","\\@nshortmid"),Ol(Il,Dl,$l,"∤","\\nmid",!0),Ol(Il,Dl,$l,"⊬","\\nvdash",!0),Ol(Il,Dl,$l,"⊭","\\nvDash",!0),Ol(Il,Dl,$l,"⋪","\\ntriangleleft"),Ol(Il,Dl,$l,"⋬","\\ntrianglelefteq",!0),Ol(Il,Dl,$l,"⊊","\\subsetneq",!0),Ol(Il,Dl,$l,"","\\@varsubsetneq"),Ol(Il,Dl,$l,"⫋","\\subsetneqq",!0),Ol(Il,Dl,$l,"","\\@varsubsetneqq"),Ol(Il,Dl,$l,"≯","\\ngtr",!0),Ol(Il,Dl,$l,"","\\@ngeqslant"),Ol(Il,Dl,$l,"","\\@ngeqq"),Ol(Il,Dl,$l,"⪈","\\gneq",!0),Ol(Il,Dl,$l,"≩","\\gneqq",!0),Ol(Il,Dl,$l,"","\\@gvertneqq"),Ol(Il,Dl,$l,"⋧","\\gnsim",!0),Ol(Il,Dl,$l,"⪊","\\gnapprox",!0),Ol(Il,Dl,$l,"⊁","\\nsucc",!0),Ol(Il,Dl,$l,"⋡","\\nsucceq",!0),Ol(Il,Dl,$l,"⋩","\\succnsim",!0),Ol(Il,Dl,$l,"⪺","\\succnapprox",!0),Ol(Il,Dl,$l,"≆","\\ncong",!0),Ol(Il,Dl,$l,"","\\@nshortparallel"),Ol(Il,Dl,$l,"∦","\\nparallel",!0),Ol(Il,Dl,$l,"⊯","\\nVDash",!0),Ol(Il,Dl,$l,"⋫","\\ntriangleright"),
|
|
281
|
-
Ol(Il,Dl,$l,"⋭","\\ntrianglerighteq",!0),Ol(Il,Dl,$l,"","\\@nsupseteqq"),Ol(Il,Dl,$l,"⊋","\\supsetneq",!0),Ol(Il,Dl,$l,"","\\@varsupsetneq"),Ol(Il,Dl,$l,"⫌","\\supsetneqq",!0),Ol(Il,Dl,$l,"","\\@varsupsetneqq"),Ol(Il,Dl,$l,"⊮","\\nVdash",!0),Ol(Il,Dl,$l,"⪵","\\precneqq",!0),Ol(Il,Dl,$l,"⪶","\\succneqq",!0),Ol(Il,Dl,$l,"","\\@nsubseteqq"),Ol(Il,Dl,Fl,"⊴","\\unlhd"),Ol(Il,Dl,Fl,"⊵","\\unrhd"),Ol(Il,Dl,$l,"↚","\\nleftarrow",!0),Ol(Il,Dl,$l,"↛","\\nrightarrow",!0),Ol(Il,Dl,$l,"⇍","\\nLeftarrow",!0),Ol(Il,Dl,$l,"⇏","\\nRightarrow",!0),Ol(Il,Dl,$l,"↮","\\nleftrightarrow",!0),Ol(Il,Dl,$l,"⇎","\\nLeftrightarrow",!0),Ol(Il,Dl,$l,"△","\\vartriangle"),Ol(Il,Dl,Gl,"ℏ","\\hslash"),Ol(Il,Dl,Gl,"▽","\\triangledown"),Ol(Il,Dl,Gl,"◊","\\lozenge"),Ol(Il,Dl,Gl,"Ⓢ","\\circledS"),Ol(Il,Dl,Gl,"®","\\circledR"),Ol(
|
|
282
|
-
Ol(Il,Dl,Gl,"▲","\\blacktriangle"),Ol(Il,Dl,Gl,"▼","\\blacktriangledown"),Ol(Il,Dl,Gl,"■","\\blacksquare"),Ol(Il,Dl,Gl,"⧫","\\blacklozenge"),Ol(Il,Dl,Gl,"★","\\bigstar"),Ol(Il,Dl,Gl,"∢","\\sphericalangle",!0),Ol(Il,Dl,Gl,"∁","\\complement",!0),Ol(Il,Dl,Gl,"ð","\\eth",!0),Ol(Pl,
|
|
281
|
+
Ol(Il,Dl,$l,"⋭","\\ntrianglerighteq",!0),Ol(Il,Dl,$l,"","\\@nsupseteqq"),Ol(Il,Dl,$l,"⊋","\\supsetneq",!0),Ol(Il,Dl,$l,"","\\@varsupsetneq"),Ol(Il,Dl,$l,"⫌","\\supsetneqq",!0),Ol(Il,Dl,$l,"","\\@varsupsetneqq"),Ol(Il,Dl,$l,"⊮","\\nVdash",!0),Ol(Il,Dl,$l,"⪵","\\precneqq",!0),Ol(Il,Dl,$l,"⪶","\\succneqq",!0),Ol(Il,Dl,$l,"","\\@nsubseteqq"),Ol(Il,Dl,Fl,"⊴","\\unlhd"),Ol(Il,Dl,Fl,"⊵","\\unrhd"),Ol(Il,Dl,$l,"↚","\\nleftarrow",!0),Ol(Il,Dl,$l,"↛","\\nrightarrow",!0),Ol(Il,Dl,$l,"⇍","\\nLeftarrow",!0),Ol(Il,Dl,$l,"⇏","\\nRightarrow",!0),Ol(Il,Dl,$l,"↮","\\nleftrightarrow",!0),Ol(Il,Dl,$l,"⇎","\\nLeftrightarrow",!0),Ol(Il,Dl,$l,"△","\\vartriangle"),Ol(Il,Dl,Gl,"ℏ","\\hslash"),Ol(Il,Dl,Gl,"▽","\\triangledown"),Ol(Il,Dl,Gl,"◊","\\lozenge"),Ol(Il,Dl,Gl,"Ⓢ","\\circledS"),Ol(Il,Dl,Gl,"®","\\circledR"),Ol(Rl,Dl,Gl,"®","\\circledR"),Ol(Il,Dl,Gl,"∡","\\measuredangle",!0),Ol(Il,Dl,Gl,"∄","\\nexists"),Ol(Il,Dl,Gl,"℧","\\mho"),Ol(Il,Dl,Gl,"Ⅎ","\\Finv",!0),Ol(Il,Dl,Gl,"⅁","\\Game",!0),Ol(Il,Dl,Gl,"‵","\\backprime"),
|
|
282
|
+
Ol(Il,Dl,Gl,"▲","\\blacktriangle"),Ol(Il,Dl,Gl,"▼","\\blacktriangledown"),Ol(Il,Dl,Gl,"■","\\blacksquare"),Ol(Il,Dl,Gl,"⧫","\\blacklozenge"),Ol(Il,Dl,Gl,"★","\\bigstar"),Ol(Il,Dl,Gl,"∢","\\sphericalangle",!0),Ol(Il,Dl,Gl,"∁","\\complement",!0),Ol(Il,Dl,Gl,"ð","\\eth",!0),Ol(Rl,Pl,Gl,"ð","ð"),Ol(Il,Dl,Gl,"╱","\\diagup"),Ol(Il,Dl,Gl,"╲","\\diagdown"),Ol(Il,Dl,Gl,"□","\\square"),Ol(Il,Dl,Gl,"□","\\Box"),Ol(Il,Dl,Gl,"◊","\\Diamond"),Ol(Il,Dl,Gl,"¥","\\yen",!0),Ol(Rl,Dl,Gl,"¥","\\yen",!0),Ol(Il,Dl,Gl,"✓","\\checkmark",!0),Ol(Rl,Dl,Gl,"✓","\\checkmark"),Ol(Il,Dl,Gl,"ℶ","\\beth",!0),Ol(Il,Dl,Gl,"ℸ","\\daleth",!0),Ol(Il,Dl,Gl,"ℷ","\\gimel",!0),Ol(Il,Dl,Gl,"ϝ","\\digamma",!0),Ol(Il,Dl,Gl,"ϰ","\\varkappa"),Ol(Il,Dl,ql,"┌","\\@ulcorner",!0),Ol(Il,Dl,jl,"┐","\\@urcorner",!0),Ol(Il,Dl,ql,"└","\\@llcorner",!0),Ol(Il,Dl,jl,"┘","\\@lrcorner",!0),Ol(Il,Dl,$l,"≦","\\leqq",!0),Ol(Il,Dl,$l,"⩽","\\leqslant",!0),Ol(Il,Dl,$l,"⪕","\\eqslantless",!0),Ol(Il,Dl,$l,"≲","\\lesssim",!0),Ol(Il,Dl,$l,"⪅","\\lessapprox",!0),
|
|
283
283
|
Ol(Il,Dl,$l,"≊","\\approxeq",!0),Ol(Il,Dl,Fl,"⋖","\\lessdot"),Ol(Il,Dl,$l,"⋘","\\lll",!0),Ol(Il,Dl,$l,"≶","\\lessgtr",!0),Ol(Il,Dl,$l,"⋚","\\lesseqgtr",!0),Ol(Il,Dl,$l,"⪋","\\lesseqqgtr",!0),Ol(Il,Dl,$l,"≑","\\doteqdot"),Ol(Il,Dl,$l,"≓","\\risingdotseq",!0),Ol(Il,Dl,$l,"≒","\\fallingdotseq",!0),Ol(Il,Dl,$l,"∽","\\backsim",!0),Ol(Il,Dl,$l,"⋍","\\backsimeq",!0),Ol(Il,Dl,$l,"⫅","\\subseteqq",!0),Ol(Il,Dl,$l,"⋐","\\Subset",!0),Ol(Il,Dl,$l,"⊏","\\sqsubset",!0),Ol(Il,Dl,$l,"≼","\\preccurlyeq",!0),Ol(Il,Dl,$l,"⋞","\\curlyeqprec",!0),Ol(Il,Dl,$l,"≾","\\precsim",!0),Ol(Il,Dl,$l,"⪷","\\precapprox",!0),Ol(Il,Dl,$l,"⊲","\\vartriangleleft"),Ol(Il,Dl,$l,"⊴","\\trianglelefteq"),Ol(Il,Dl,$l,"⊨","\\vDash",!0),Ol(Il,Dl,$l,"⊪","\\Vvdash",!0),Ol(Il,Dl,$l,"⌣","\\smallsmile"),Ol(Il,Dl,$l,"⌢","\\smallfrown"),Ol(Il,Dl,$l,"≏","\\bumpeq",!0),Ol(Il,Dl,$l,"≎","\\Bumpeq",!0),Ol(Il,Dl,$l,"≧","\\geqq",!0),Ol(Il,Dl,$l,"⩾","\\geqslant",!0),Ol(Il,Dl,$l,"⪖","\\eqslantgtr",!0),Ol(Il,Dl,$l,"≳","\\gtrsim",!0),Ol(Il,Dl,$l,"⪆","\\gtrapprox",!0),
|
|
284
284
|
Ol(Il,Dl,Fl,"⋗","\\gtrdot"),Ol(Il,Dl,$l,"⋙","\\ggg",!0),Ol(Il,Dl,$l,"≷","\\gtrless",!0),Ol(Il,Dl,$l,"⋛","\\gtreqless",!0),Ol(Il,Dl,$l,"⪌","\\gtreqqless",!0),Ol(Il,Dl,$l,"≖","\\eqcirc",!0),Ol(Il,Dl,$l,"≗","\\circeq",!0),Ol(Il,Dl,$l,"≜","\\triangleq",!0),Ol(Il,Dl,$l,"∼","\\thicksim"),Ol(Il,Dl,$l,"≈","\\thickapprox"),Ol(Il,Dl,$l,"⫆","\\supseteqq",!0),Ol(Il,Dl,$l,"⋑","\\Supset",!0),Ol(Il,Dl,$l,"⊐","\\sqsupset",!0),Ol(Il,Dl,$l,"≽","\\succcurlyeq",!0),Ol(Il,Dl,$l,"⋟","\\curlyeqsucc",!0),Ol(Il,Dl,$l,"≿","\\succsim",!0),Ol(Il,Dl,$l,"⪸","\\succapprox",!0),Ol(Il,Dl,$l,"⊳","\\vartriangleright"),Ol(Il,Dl,$l,"⊵","\\trianglerighteq"),Ol(Il,Dl,$l,"⊩","\\Vdash",!0),Ol(Il,Dl,$l,"∣","\\shortmid"),Ol(Il,Dl,$l,"∥","\\shortparallel"),Ol(Il,Dl,$l,"≬","\\between",!0),Ol(Il,Dl,$l,"⋔","\\pitchfork",!0),Ol(Il,Dl,$l,"∝","\\varpropto"),Ol(Il,Dl,$l,"◀","\\blacktriangleleft"),Ol(Il,Dl,$l,"∴","\\therefore",!0),Ol(Il,Dl,$l,"∍","\\backepsilon"),Ol(Il,Dl,$l,"▶","\\blacktriangleright"),Ol(Il,Dl,$l,"∵","\\because",!0),
|
|
285
|
-
Ol(Il,Dl,$l,"⋘","\\llless"),Ol(Il,Dl,$l,"⋙","\\gggtr"),Ol(Il,Dl,Fl,"⊲","\\lhd"),Ol(Il,Dl,Fl,"⊳","\\rhd"),Ol(Il,Dl,$l,"≂","\\eqsim",!0),Ol(Il,
|
|
286
|
-
Ol(Il,Dl,$l,"⇆","\\leftrightarrows",!0),Ol(Il,Dl,$l,"⇚","\\Lleftarrow",!0),Ol(Il,Dl,$l,"↞","\\twoheadleftarrow",!0),Ol(Il,Dl,$l,"↢","\\leftarrowtail",!0),Ol(Il,Dl,$l,"↫","\\looparrowleft",!0),Ol(Il,Dl,$l,"⇋","\\leftrightharpoons",!0),Ol(Il,Dl,$l,"↶","\\curvearrowleft",!0),Ol(Il,Dl,$l,"↺","\\circlearrowleft",!0),Ol(Il,Dl,$l,"↰","\\Lsh",!0),Ol(Il,Dl,$l,"⇈","\\upuparrows",!0),Ol(Il,Dl,$l,"↿","\\upharpoonleft",!0),Ol(Il,Dl,$l,"⇃","\\downharpoonleft",!0),Ol(Il,
|
|
287
|
-
Ol(Il,Dl,$l,"⇝","\\rightsquigarrow",!0),Ol(Il,Dl,$l,"⇝","\\leadsto"),Ol(Il,Dl,$l,"⇛","\\Rrightarrow",!0),Ol(Il,Dl,$l,"↾","\\restriction"),Ol(Il,
|
|
288
|
-
Ol(Il,
|
|
289
|
-
Ol(Il,
|
|
290
|
-
Ol(Il,
|
|
291
|
-
Ol(Il,
|
|
292
|
-
Ol(Il,
|
|
293
|
-
Ol(Pl,
|
|
294
|
-
Ol(Pl,
|
|
295
|
-
var Xl='0123456789!@*()-=+";:?/.,'.charAt(Kl);Ol(Pl,
|
|
296
|
-
Ol(Il,
|
|
285
|
+
Ol(Il,Dl,$l,"⋘","\\llless"),Ol(Il,Dl,$l,"⋙","\\gggtr"),Ol(Il,Dl,Fl,"⊲","\\lhd"),Ol(Il,Dl,Fl,"⊳","\\rhd"),Ol(Il,Dl,$l,"≂","\\eqsim",!0),Ol(Il,Pl,$l,"⋈","\\Join"),Ol(Il,Dl,$l,"≑","\\Doteq",!0),Ol(Il,Dl,Fl,"∔","\\dotplus",!0),Ol(Il,Dl,Fl,"∖","\\smallsetminus"),Ol(Il,Dl,Fl,"⋒","\\Cap",!0),Ol(Il,Dl,Fl,"⋓","\\Cup",!0),Ol(Il,Dl,Fl,"⩞","\\doublebarwedge",!0),Ol(Il,Dl,Fl,"⊟","\\boxminus",!0),Ol(Il,Dl,Fl,"⊞","\\boxplus",!0),Ol(Il,Dl,Fl,"⋇","\\divideontimes",!0),Ol(Il,Dl,Fl,"⋉","\\ltimes",!0),Ol(Il,Dl,Fl,"⋊","\\rtimes",!0),Ol(Il,Dl,Fl,"⋋","\\leftthreetimes",!0),Ol(Il,Dl,Fl,"⋌","\\rightthreetimes",!0),Ol(Il,Dl,Fl,"⋏","\\curlywedge",!0),Ol(Il,Dl,Fl,"⋎","\\curlyvee",!0),Ol(Il,Dl,Fl,"⊝","\\circleddash",!0),Ol(Il,Dl,Fl,"⊛","\\circledast",!0),Ol(Il,Dl,Fl,"⋅","\\centerdot"),Ol(Il,Dl,Fl,"⊺","\\intercal",!0),Ol(Il,Dl,Fl,"⋒","\\doublecap"),Ol(Il,Dl,Fl,"⋓","\\doublecup"),Ol(Il,Dl,Fl,"⊠","\\boxtimes",!0),Ol(Il,Dl,$l,"⇢","\\dashrightarrow",!0),Ol(Il,Dl,$l,"⇠","\\dashleftarrow",!0),Ol(Il,Dl,$l,"⇇","\\leftleftarrows",!0),
|
|
286
|
+
Ol(Il,Dl,$l,"⇆","\\leftrightarrows",!0),Ol(Il,Dl,$l,"⇚","\\Lleftarrow",!0),Ol(Il,Dl,$l,"↞","\\twoheadleftarrow",!0),Ol(Il,Dl,$l,"↢","\\leftarrowtail",!0),Ol(Il,Dl,$l,"↫","\\looparrowleft",!0),Ol(Il,Dl,$l,"⇋","\\leftrightharpoons",!0),Ol(Il,Dl,$l,"↶","\\curvearrowleft",!0),Ol(Il,Dl,$l,"↺","\\circlearrowleft",!0),Ol(Il,Dl,$l,"↰","\\Lsh",!0),Ol(Il,Dl,$l,"⇈","\\upuparrows",!0),Ol(Il,Dl,$l,"↿","\\upharpoonleft",!0),Ol(Il,Dl,$l,"⇃","\\downharpoonleft",!0),Ol(Il,Pl,$l,"⊶","\\origof",!0),Ol(Il,Pl,$l,"⊷","\\imageof",!0),Ol(Il,Dl,$l,"⊸","\\multimap",!0),Ol(Il,Dl,$l,"↭","\\leftrightsquigarrow",!0),Ol(Il,Dl,$l,"⇉","\\rightrightarrows",!0),Ol(Il,Dl,$l,"⇄","\\rightleftarrows",!0),Ol(Il,Dl,$l,"↠","\\twoheadrightarrow",!0),Ol(Il,Dl,$l,"↣","\\rightarrowtail",!0),Ol(Il,Dl,$l,"↬","\\looparrowright",!0),Ol(Il,Dl,$l,"↷","\\curvearrowright",!0),Ol(Il,Dl,$l,"↻","\\circlearrowright",!0),Ol(Il,Dl,$l,"↱","\\Rsh",!0),Ol(Il,Dl,$l,"⇊","\\downdownarrows",!0),Ol(Il,Dl,$l,"↾","\\upharpoonright",!0),Ol(Il,Dl,$l,"⇂","\\downharpoonright",!0),
|
|
287
|
+
Ol(Il,Dl,$l,"⇝","\\rightsquigarrow",!0),Ol(Il,Dl,$l,"⇝","\\leadsto"),Ol(Il,Dl,$l,"⇛","\\Rrightarrow",!0),Ol(Il,Dl,$l,"↾","\\restriction"),Ol(Il,Pl,Gl,"‘","`"),Ol(Il,Pl,Gl,"$","\\$"),Ol(Rl,Pl,Gl,"$","\\$"),Ol(Rl,Pl,Gl,"$","\\textdollar"),Ol(Il,Pl,Gl,"%","\\%"),Ol(Rl,Pl,Gl,"%","\\%"),Ol(Il,Pl,Gl,"_","\\_"),Ol(Rl,Pl,Gl,"_","\\_"),Ol(Rl,Pl,Gl,"_","\\textunderscore"),Ol(Il,Pl,Gl,"∠","\\angle",!0),Ol(Il,Pl,Gl,"∞","\\infty",!0),Ol(Il,Pl,Gl,"′","\\prime"),Ol(Il,Pl,Gl,"△","\\triangle"),Ol(Il,Pl,Gl,"Γ","\\Gamma",!0),Ol(Il,Pl,Gl,"Δ","\\Delta",!0),Ol(Il,Pl,Gl,"Θ","\\Theta",!0),Ol(Il,Pl,Gl,"Λ","\\Lambda",!0),Ol(Il,Pl,Gl,"Ξ","\\Xi",!0),Ol(Il,Pl,Gl,"Π","\\Pi",!0),Ol(Il,Pl,Gl,"Σ","\\Sigma",!0),Ol(Il,Pl,Gl,"Υ","\\Upsilon",!0),Ol(Il,Pl,Gl,"Φ","\\Phi",!0),Ol(Il,Pl,Gl,"Ψ","\\Psi",!0),Ol(Il,Pl,Gl,"Ω","\\Omega",!0),Ol(Il,Pl,Gl,"A","Α"),Ol(Il,Pl,Gl,"B","Β"),Ol(Il,Pl,Gl,"E","Ε"),Ol(Il,Pl,Gl,"Z","Ζ"),Ol(Il,Pl,Gl,"H","Η"),Ol(Il,Pl,Gl,"I","Ι"),Ol(Il,Pl,Gl,"K","Κ"),Ol(Il,Pl,Gl,"M","Μ"),Ol(Il,Pl,Gl,"N","Ν"),Ol(Il,Pl,Gl,"O","Ο"),
|
|
288
|
+
Ol(Il,Pl,Gl,"P","Ρ"),Ol(Il,Pl,Gl,"T","Τ"),Ol(Il,Pl,Gl,"X","Χ"),Ol(Il,Pl,Gl,"¬","\\neg",!0),Ol(Il,Pl,Gl,"¬","\\lnot"),Ol(Il,Pl,Gl,"⊤","\\top"),Ol(Il,Pl,Gl,"⊥","\\bot"),Ol(Il,Pl,Gl,"∅","\\emptyset"),Ol(Il,Dl,Gl,"∅","\\varnothing"),Ol(Il,Pl,Hl,"α","\\alpha",!0),Ol(Il,Pl,Hl,"β","\\beta",!0),Ol(Il,Pl,Hl,"γ","\\gamma",!0),Ol(Il,Pl,Hl,"δ","\\delta",!0),Ol(Il,Pl,Hl,"ϵ","\\epsilon",!0),Ol(Il,Pl,Hl,"ζ","\\zeta",!0),Ol(Il,Pl,Hl,"η","\\eta",!0),Ol(Il,Pl,Hl,"θ","\\theta",!0),Ol(Il,Pl,Hl,"ι","\\iota",!0),Ol(Il,Pl,Hl,"κ","\\kappa",!0),Ol(Il,Pl,Hl,"λ","\\lambda",!0),Ol(Il,Pl,Hl,"μ","\\mu",!0),Ol(Il,Pl,Hl,"ν","\\nu",!0),Ol(Il,Pl,Hl,"ξ","\\xi",!0),Ol(Il,Pl,Hl,"ο","\\omicron",!0),Ol(Il,Pl,Hl,"π","\\pi",!0),Ol(Il,Pl,Hl,"ρ","\\rho",!0),Ol(Il,Pl,Hl,"σ","\\sigma",!0),Ol(Il,Pl,Hl,"τ","\\tau",!0),Ol(Il,Pl,Hl,"υ","\\upsilon",!0),Ol(Il,Pl,Hl,"ϕ","\\phi",!0),Ol(Il,Pl,Hl,"χ","\\chi",!0),Ol(Il,Pl,Hl,"ψ","\\psi",!0),Ol(Il,Pl,Hl,"ω","\\omega",!0),Ol(Il,Pl,Hl,"ε","\\varepsilon",!0),Ol(Il,Pl,Hl,"ϑ","\\vartheta",!0),
|
|
289
|
+
Ol(Il,Pl,Hl,"ϖ","\\varpi",!0),Ol(Il,Pl,Hl,"ϱ","\\varrho",!0),Ol(Il,Pl,Hl,"ς","\\varsigma",!0),Ol(Il,Pl,Hl,"φ","\\varphi",!0),Ol(Il,Pl,Fl,"∗","*",!0),Ol(Il,Pl,Fl,"+","+"),Ol(Il,Pl,Fl,"−","-",!0),Ol(Il,Pl,Fl,"⋅","\\cdot",!0),Ol(Il,Pl,Fl,"∘","\\circ"),Ol(Il,Pl,Fl,"÷","\\div",!0),Ol(Il,Pl,Fl,"±","\\pm",!0),Ol(Il,Pl,Fl,"×","\\times",!0),Ol(Il,Pl,Fl,"∩","\\cap",!0),Ol(Il,Pl,Fl,"∪","\\cup",!0),Ol(Il,Pl,Fl,"∖","\\setminus"),Ol(Il,Pl,Fl,"∧","\\land"),Ol(Il,Pl,Fl,"∨","\\lor"),Ol(Il,Pl,Fl,"∧","\\wedge",!0),Ol(Il,Pl,Fl,"∨","\\vee",!0),Ol(Il,Pl,Gl,"√","\\surd"),Ol(Il,Pl,ql,"⟨","\\langle",!0),Ol(Il,Pl,ql,"∣","\\lvert"),Ol(Il,Pl,ql,"∥","\\lVert"),Ol(Il,Pl,jl,"?","?"),Ol(Il,Pl,jl,"!","!"),Ol(Il,Pl,jl,"⟩","\\rangle",!0),Ol(Il,Pl,jl,"∣","\\rvert"),Ol(Il,Pl,jl,"∥","\\rVert"),Ol(Il,Pl,$l,"=","="),Ol(Il,Pl,$l,":",":"),Ol(Il,Pl,$l,"≈","\\approx",!0),Ol(Il,Pl,$l,"≅","\\cong",!0),Ol(Il,Pl,$l,"≥","\\ge"),Ol(Il,Pl,$l,"≥","\\geq",!0),Ol(Il,Pl,$l,"←","\\gets"),Ol(Il,Pl,$l,">","\\gt",!0),Ol(Il,Pl,$l,"∈","\\in",!0),
|
|
290
|
+
Ol(Il,Pl,$l,"","\\@not"),Ol(Il,Pl,$l,"⊂","\\subset",!0),Ol(Il,Pl,$l,"⊃","\\supset",!0),Ol(Il,Pl,$l,"⊆","\\subseteq",!0),Ol(Il,Pl,$l,"⊇","\\supseteq",!0),Ol(Il,Dl,$l,"⊈","\\nsubseteq",!0),Ol(Il,Dl,$l,"⊉","\\nsupseteq",!0),Ol(Il,Pl,$l,"⊨","\\models"),Ol(Il,Pl,$l,"←","\\leftarrow",!0),Ol(Il,Pl,$l,"≤","\\le"),Ol(Il,Pl,$l,"≤","\\leq",!0),Ol(Il,Pl,$l,"<","\\lt",!0),Ol(Il,Pl,$l,"→","\\rightarrow",!0),Ol(Il,Pl,$l,"→","\\to"),Ol(Il,Dl,$l,"≱","\\ngeq",!0),Ol(Il,Dl,$l,"≰","\\nleq",!0),Ol(Il,Pl,"spacing"," ","\\ "),Ol(Il,Pl,"spacing"," ","\\space"),Ol(Il,Pl,"spacing"," ","\\nobreakspace"),Ol(Rl,Pl,"spacing"," ","\\ "),Ol(Rl,Pl,"spacing"," "," "),Ol(Rl,Pl,"spacing"," ","\\space"),Ol(Rl,Pl,"spacing"," ","\\nobreakspace"),Ol(Il,Pl,"spacing",null,"\\nobreak"),Ol(Il,Pl,"spacing",null,"\\allowbreak"),Ol(Il,Pl,"punct",",",","),Ol(Il,Pl,"punct",";",";"),Ol(Il,Dl,Fl,"⊼","\\barwedge",!0),Ol(Il,Dl,Fl,"⊻","\\veebar",!0),Ol(Il,Pl,Fl,"⊙","\\odot",!0),Ol(Il,Pl,Fl,"⊕","\\oplus",!0),Ol(Il,Pl,Fl,"⊗","\\otimes",!0),
|
|
291
|
+
Ol(Il,Pl,Gl,"∂","\\partial",!0),Ol(Il,Pl,Fl,"⊘","\\oslash",!0),Ol(Il,Dl,Fl,"⊚","\\circledcirc",!0),Ol(Il,Dl,Fl,"⊡","\\boxdot",!0),Ol(Il,Pl,Fl,"△","\\bigtriangleup"),Ol(Il,Pl,Fl,"▽","\\bigtriangledown"),Ol(Il,Pl,Fl,"†","\\dagger"),Ol(Il,Pl,Fl,"⋄","\\diamond"),Ol(Il,Pl,Fl,"⋆","\\star"),Ol(Il,Pl,Fl,"◃","\\triangleleft"),Ol(Il,Pl,Fl,"▹","\\triangleright"),Ol(Il,Pl,ql,"{","\\{"),Ol(Rl,Pl,Gl,"{","\\{"),Ol(Rl,Pl,Gl,"{","\\textbraceleft"),Ol(Il,Pl,jl,"}","\\}"),Ol(Rl,Pl,Gl,"}","\\}"),Ol(Rl,Pl,Gl,"}","\\textbraceright"),Ol(Il,Pl,ql,"{","\\lbrace"),Ol(Il,Pl,jl,"}","\\rbrace"),Ol(Il,Pl,ql,"[","\\lbrack",!0),Ol(Rl,Pl,Gl,"[","\\lbrack",!0),Ol(Il,Pl,jl,"]","\\rbrack",!0),Ol(Rl,Pl,Gl,"]","\\rbrack",!0),Ol(Il,Pl,ql,"(","\\lparen",!0),Ol(Il,Pl,jl,")","\\rparen",!0),Ol(Rl,Pl,Gl,"<","\\textless",!0),Ol(Rl,Pl,Gl,">","\\textgreater",!0),Ol(Il,Pl,ql,"⌊","\\lfloor",!0),Ol(Il,Pl,jl,"⌋","\\rfloor",!0),Ol(Il,Pl,ql,"⌈","\\lceil",!0),Ol(Il,Pl,jl,"⌉","\\rceil",!0),Ol(Il,Pl,Gl,"\\","\\backslash"),Ol(Il,Pl,Gl,"∣","|"),
|
|
292
|
+
Ol(Il,Pl,Gl,"∣","\\vert"),Ol(Rl,Pl,Gl,"|","\\textbar",!0),Ol(Il,Pl,Gl,"∥","\\|"),Ol(Il,Pl,Gl,"∥","\\Vert"),Ol(Rl,Pl,Gl,"∥","\\textbardbl"),Ol(Rl,Pl,Gl,"~","\\textasciitilde"),Ol(Rl,Pl,Gl,"\\","\\textbackslash"),Ol(Rl,Pl,Gl,"^","\\textasciicircum"),Ol(Il,Pl,$l,"↑","\\uparrow",!0),Ol(Il,Pl,$l,"⇑","\\Uparrow",!0),Ol(Il,Pl,$l,"↓","\\downarrow",!0),Ol(Il,Pl,$l,"⇓","\\Downarrow",!0),Ol(Il,Pl,$l,"↕","\\updownarrow",!0),Ol(Il,Pl,$l,"⇕","\\Updownarrow",!0),Ol(Il,Pl,Ul,"∐","\\coprod"),Ol(Il,Pl,Ul,"⋁","\\bigvee"),Ol(Il,Pl,Ul,"⋀","\\bigwedge"),Ol(Il,Pl,Ul,"⨄","\\biguplus"),Ol(Il,Pl,Ul,"⋂","\\bigcap"),Ol(Il,Pl,Ul,"⋃","\\bigcup"),Ol(Il,Pl,Ul,"∫","\\int"),Ol(Il,Pl,Ul,"∫","\\intop"),Ol(Il,Pl,Ul,"∬","\\iint"),Ol(Il,Pl,Ul,"∭","\\iiint"),Ol(Il,Pl,Ul,"∏","\\prod"),Ol(Il,Pl,Ul,"∑","\\sum"),Ol(Il,Pl,Ul,"⨂","\\bigotimes"),Ol(Il,Pl,Ul,"⨁","\\bigoplus"),Ol(Il,Pl,Ul,"⨀","\\bigodot"),Ol(Il,Pl,Ul,"∮","\\oint"),Ol(Il,Pl,Ul,"∯","\\oiint"),Ol(Il,Pl,Ul,"∰","\\oiiint"),Ol(Il,Pl,Ul,"⨆","\\bigsqcup"),Ol(Il,Pl,Ul,"∫","\\smallint"),
|
|
293
|
+
Ol(Rl,Pl,"inner","…","\\textellipsis"),Ol(Il,Pl,"inner","…","\\mathellipsis"),Ol(Rl,Pl,"inner","…","\\ldots",!0),Ol(Il,Pl,"inner","…","\\ldots",!0),Ol(Il,Pl,"inner","⋯","\\@cdots",!0),Ol(Il,Pl,"inner","⋱","\\ddots",!0),Ol(Il,Pl,Gl,"⋮","\\varvdots"),Ol(Il,Pl,Bl,"ˊ","\\acute"),Ol(Il,Pl,Bl,"ˋ","\\grave"),Ol(Il,Pl,Bl,"¨","\\ddot"),Ol(Il,Pl,Bl,"~","\\tilde"),Ol(Il,Pl,Bl,"ˉ","\\bar"),Ol(Il,Pl,Bl,"˘","\\breve"),Ol(Il,Pl,Bl,"ˇ","\\check"),Ol(Il,Pl,Bl,"^","\\hat"),Ol(Il,Pl,Bl,"⃗","\\vec"),Ol(Il,Pl,Bl,"˙","\\dot"),Ol(Il,Pl,Bl,"˚","\\mathring"),Ol(Il,Pl,Hl,"","\\@imath"),Ol(Il,Pl,Hl,"","\\@jmath"),Ol(Il,Pl,Gl,"ı","ı"),Ol(Il,Pl,Gl,"ȷ","ȷ"),Ol(Rl,Pl,Gl,"ı","\\i",!0),Ol(Rl,Pl,Gl,"ȷ","\\j",!0),Ol(Rl,Pl,Gl,"ß","\\ss",!0),Ol(Rl,Pl,Gl,"æ","\\ae",!0),Ol(Rl,Pl,Gl,"œ","\\oe",!0),Ol(Rl,Pl,Gl,"ø","\\o",!0),Ol(Rl,Pl,Gl,"Æ","\\AE",!0),Ol(Rl,Pl,Gl,"Œ","\\OE",!0),Ol(Rl,Pl,Gl,"Ø","\\O",!0),Ol(Rl,Pl,Bl,"ˊ","\\'"),Ol(Rl,Pl,Bl,"ˋ","\\`"),Ol(Rl,Pl,Bl,"ˆ","\\^"),Ol(Rl,Pl,Bl,"˜","\\~"),Ol(Rl,Pl,Bl,"ˉ","\\="),Ol(Rl,Pl,Bl,"˘","\\u"),
|
|
294
|
+
Ol(Rl,Pl,Bl,"˙","\\."),Ol(Rl,Pl,Bl,"¸","\\c"),Ol(Rl,Pl,Bl,"˚","\\r"),Ol(Rl,Pl,Bl,"ˇ","\\v"),Ol(Rl,Pl,Bl,"¨",'\\"'),Ol(Rl,Pl,Bl,"˝","\\H"),Ol(Rl,Pl,Bl,"◯","\\textcircled");var Vl={"--":!0,"---":!0,"``":!0,"''":!0};Ol(Rl,Pl,Gl,"–","--",!0),Ol(Rl,Pl,Gl,"–","\\textendash"),Ol(Rl,Pl,Gl,"—","---",!0),Ol(Rl,Pl,Gl,"—","\\textemdash"),Ol(Rl,Pl,Gl,"‘","`",!0),Ol(Rl,Pl,Gl,"‘","\\textquoteleft"),Ol(Rl,Pl,Gl,"’","'",!0),Ol(Rl,Pl,Gl,"’","\\textquoteright"),Ol(Rl,Pl,Gl,"“","``",!0),Ol(Rl,Pl,Gl,"“","\\textquotedblleft"),Ol(Rl,Pl,Gl,"”","''",!0),Ol(Rl,Pl,Gl,"”","\\textquotedblright"),Ol(Il,Pl,Gl,"°","\\degree",!0),Ol(Rl,Pl,Gl,"°","\\degree"),Ol(Rl,Pl,Gl,"°","\\textdegree",!0),Ol(Il,Pl,Gl,"£","\\pounds"),Ol(Il,Pl,Gl,"£","\\mathsterling",!0),Ol(Rl,Pl,Gl,"£","\\pounds"),Ol(Rl,Pl,Gl,"£","\\textsterling",!0),Ol(Il,Dl,Gl,"✠","\\maltese"),Ol(Rl,Dl,Gl,"✠","\\maltese");for(var Wl=0;Wl<'0123456789/@."'.length;Wl++){var Yl='0123456789/@."'.charAt(Wl);Ol(Il,Pl,Gl,Yl,Yl)}for(var Kl=0;Kl<'0123456789!@*()-=+";:?/.,'.length;Kl++){
|
|
295
|
+
var Xl='0123456789!@*()-=+";:?/.,'.charAt(Kl);Ol(Rl,Pl,Gl,Xl,Xl)}for(var Zl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",Jl=0;Jl<Zl.length;Jl++){var Ql=Zl.charAt(Jl);Ol(Il,Pl,Hl,Ql,Ql),Ol(Rl,Pl,Gl,Ql,Ql)}Ol(Il,Dl,Gl,"C","ℂ"),Ol(Rl,Dl,Gl,"C","ℂ"),Ol(Il,Dl,Gl,"H","ℍ"),Ol(Rl,Dl,Gl,"H","ℍ"),Ol(Il,Dl,Gl,"N","ℕ"),Ol(Rl,Dl,Gl,"N","ℕ"),Ol(Il,Dl,Gl,"P","ℙ"),Ol(Rl,Dl,Gl,"P","ℙ"),Ol(Il,Dl,Gl,"Q","ℚ"),Ol(Rl,Dl,Gl,"Q","ℚ"),Ol(Il,Dl,Gl,"R","ℝ"),Ol(Rl,Dl,Gl,"R","ℝ"),Ol(Il,Dl,Gl,"Z","ℤ"),Ol(Rl,Dl,Gl,"Z","ℤ"),Ol(Il,Pl,Hl,"h","ℎ"),Ol(Rl,Pl,Hl,"h","ℎ");for(var ec="",tc=0;tc<Zl.length;tc++){var nc=Zl.charAt(tc);Ol(Il,Pl,Hl,nc,ec=String.fromCharCode(55349,56320+tc)),Ol(Rl,Pl,Gl,nc,ec),Ol(Il,Pl,Hl,nc,ec=String.fromCharCode(55349,56372+tc)),Ol(Rl,Pl,Gl,nc,ec),Ol(Il,Pl,Hl,nc,ec=String.fromCharCode(55349,56424+tc)),Ol(Rl,Pl,Gl,nc,ec),Ol(Il,Pl,Hl,nc,ec=String.fromCharCode(55349,56580+tc)),Ol(Rl,Pl,Gl,nc,ec),Ol(Il,Pl,Hl,nc,ec=String.fromCharCode(55349,56736+tc)),Ol(Rl,Pl,Gl,nc,ec),
|
|
296
|
+
Ol(Il,Pl,Hl,nc,ec=String.fromCharCode(55349,56788+tc)),Ol(Rl,Pl,Gl,nc,ec),Ol(Il,Pl,Hl,nc,ec=String.fromCharCode(55349,56840+tc)),Ol(Rl,Pl,Gl,nc,ec),Ol(Il,Pl,Hl,nc,ec=String.fromCharCode(55349,56944+tc)),Ol(Rl,Pl,Gl,nc,ec),tc<26&&(Ol(Il,Pl,Hl,nc,ec=String.fromCharCode(55349,56632+tc)),Ol(Rl,Pl,Gl,nc,ec),Ol(Il,Pl,Hl,nc,ec=String.fromCharCode(55349,56476+tc)),Ol(Rl,Pl,Gl,nc,ec))}Ol(Il,Pl,Hl,"k",ec=String.fromCharCode(55349,56668)),Ol(Rl,Pl,Gl,"k",ec);for(var rc=0;rc<10;rc++){var oc=rc.toString();Ol(Il,Pl,Hl,oc,ec=String.fromCharCode(55349,57294+rc)),Ol(Rl,Pl,Gl,oc,ec),Ol(Il,Pl,Hl,oc,ec=String.fromCharCode(55349,57314+rc)),Ol(Rl,Pl,Gl,oc,ec),Ol(Il,Pl,Hl,oc,ec=String.fromCharCode(55349,57324+rc)),Ol(Rl,Pl,Gl,oc,ec),Ol(Il,Pl,Hl,oc,ec=String.fromCharCode(55349,57334+rc)),Ol(Rl,Pl,Gl,oc,ec)}for(var ic=0;ic<"ÐÞþ".length;ic++){var ac="ÐÞþ".charAt(ic);Ol(Il,Pl,Hl,ac,ac),Ol(Rl,Pl,Gl,ac,ac)}
|
|
297
297
|
var sc=[["mathbf","textbf","Main-Bold"],["mathbf","textbf","Main-Bold"],["mathnormal","textit","Math-Italic"],["mathnormal","textit","Math-Italic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["boldsymbol","boldsymbol","Main-BoldItalic"],["mathscr","textscr","Script-Regular"],["","",""],["","",""],["","",""],["mathfrak","textfrak","Fraktur-Regular"],["mathfrak","textfrak","Fraktur-Regular"],["mathbb","textbb","AMS-Regular"],["mathbb","textbb","AMS-Regular"],["","",""],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathitsf","textitsf","SansSerif-Italic"],["mathitsf","textitsf","SansSerif-Italic"],["","",""],["","",""],["mathtt","texttt","Typewriter-Regular"],["mathtt","texttt","Typewriter-Regular"]],lc=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],cc=function(e,t,n){
|
|
298
298
|
return zl[n][e]&&zl[n][e].replace&&(e=zl[n][e].replace),{value:e,metrics:al(e,t,n)}},uc=function(e,t,n,r,o){var i,a=cc(e,t,n),s=a.metrics;if(e=a.value,s){var l=s.italic;("text"===n||r&&"mathit"===r.font)&&(l=0),i=new Cl(e,s.height,s.depth,l,s.skew,s.width,o)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+n+"'"),i=new Cl(e,0,0,0,0,0,o);if(r){i.maxFontSize=r.sizeMultiplier,r.style.isTight()&&i.classes.push("mtight");var c=r.getColor();c&&(i.style.color=c)}return i},hc=(e,t)=>{if(vl(e.classes)!==vl(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize)return!1;if(1===e.classes.length){var n=e.classes[0];if("mbin"===n||"mord"===n)return!1}for(var r in e.style)if(e.style.hasOwnProperty(r)&&e.style[r]!==t.style[r])return!1;for(var o in t.style)if(t.style.hasOwnProperty(o)&&e.style[o]!==t.style[o])return!1;return!0},dc=function(e){for(var t=0,n=0,r=0,o=0;o<e.children.length;o++){var i=e.children[o];i.height>t&&(t=i.height),i.depth>n&&(n=i.depth),
|
|
299
299
|
i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},pc=function(e,t,n,r){var o=new wl(e,t,n,r);return dc(o),o},mc=(e,t,n,r)=>new wl(e,t,n,r),fc=function(e){var t=new nl(e);return dc(t),t},gc=function(e,t,n){var r="";switch(e){case"amsrm":r="AMS";break;case"textrm":r="Main";break;case"textsf":r="SansSerif";break;case"texttt":r="Typewriter";break;default:r=e}return r+"-"+("textbf"===t&&"textit"===n?"BoldItalic":"textbf"===t?"Bold":"textit"===t?"Italic":"Regular")},vc={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},
|
|
@@ -301,60 +301,60 @@ mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},yc={vec:["vec",.471,
|
|
|
301
301
|
for(var t=e.children,n=[t[0]],r=-t[0].shift-t[0].elem.depth,o=r,i=1;i<t.length;i++){var a=-t[i].shift-o-t[i].elem.depth,s=a-(t[i-1].elem.height+t[i-1].elem.depth);o+=a,n.push({type:"kern",size:s}),n.push(t[i])}return{children:n,depth:r}}var l;if("top"===e.positionType){for(var c=e.positionData,u=0;u<e.children.length;u++){var h=e.children[u];c-="kern"===h.type?h.size:h.elem.height+h.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var d=e.children[0];if("elem"!==d.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-d.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-d.elem.depth}}return{children:e.children,depth:l}}(e),o=0,i=0;i<n.length;i++){var a=n[i];if("elem"===a.type){var s=a.elem;o=Math.max(o,s.maxFontSize,s.height)}}o+=2;var l=pc(["pstrut"],[]);l.style.height=gl(o);for(var c=[],u=r,h=r,d=r,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)d+=m.size;else{
|
|
302
302
|
var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},y=pc(g,[l,f],void 0,v);y.style.top=gl(-o-d-f.depth),m.marginLeft&&(y.style.marginLeft=m.marginLeft),m.marginRight&&(y.style.marginRight=m.marginRight),c.push(y),d+=f.height+f.depth}u=Math.min(u,d),h=Math.max(h,d)}var _,b=pc(["vlist"],c);if(b.style.height=gl(h),u<0){var w=pc([],[]),x=pc(["vlist"],[w]);x.style.height=gl(-u);var k=pc(["vlist-s"],[new Cl("")]);_=[pc(["vlist-r"],[b,k]),pc(["vlist-r"],[x])]}else _=[pc(["vlist-r"],[b])];var S=pc(["vlist-t"],_);return 2===_.length&&S.classes.push("vlist-t2"),S.height=h,S.depth=-u,S},makeOrd:function(e,t,n){var r=e.mode,o=e.text,i=["mord"],a="math"===r||"text"===r&&t.font,s=a?t.font:t.fontFamily;if(55349===o.charCodeAt(0)){var[l,c]=function(e,t){var n=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536,r="math"===t?0:1;if(119808<=n&&n<120484){var o=Math.floor((n-119808)/26);return[sc[o][2],sc[o][r]]}if(120782<=n&&n<=120831){var i=Math.floor((n-120782)/10);return[lc[i][2],lc[i][r]]}
|
|
303
303
|
if(120485===n||120486===n)return[sc[0][2],sc[0][r]];if(120486<n&&n<120782)return["",""];throw new Is("Unsupported character: "+e)}(o,r);return uc(o,l,r,t,i.concat(c))}if(s){var u,h;if("boldsymbol"===s){var d=function(e,t,n,r,o){return"textord"!==o&&cc(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(o,r,0,0,n);u=d.fontName,h=[d.fontClass]}else a?(u=vc[s].fontName,h=[s]):(u=gc(s,t.fontWeight,t.fontShape),h=[s,t.fontWeight,t.fontShape]);if(cc(o,u,r).metrics)return uc(o,u,r,t,i.concat(h));if(Vl.hasOwnProperty(o)&&"Typewriter"===u.substr(0,10)){for(var p=[],m=0;m<o.length;m++)p.push(uc(o[m],u,r,t,i.concat(h)));return fc(p)}}if("mathord"===n)return uc(o,"Math-Italic",r,t,i.concat(["mathnormal"]));if("textord"===n){var f=zl[r][o]&&zl[r][o].font;if("ams"===f){var g=gc("amsrm",t.fontWeight,t.fontShape);return uc(o,g,r,t,i.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var v=gc(f,t.fontWeight,t.fontShape)
|
|
304
|
-
;return uc(o,v,r,t,i.concat(v,t.fontWeight,t.fontShape))}var y=gc("textrm",t.fontWeight,t.fontShape);return uc(o,y,r,t,i.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=pc(["mspace"],[],t),r=fl(e,t);return n.style.marginRight=gl(r),n},staticSvg:function(e,t){var[n,r,o]=yc[e],i=new
|
|
305
|
-
mord:xc,mop:xc,mopen:xc,minner:xc},mopen:{},mclose:{mop:bc,mbin:wc,mrel:xc,minner:bc},mpunct:{mord:bc,mop:bc,mrel:xc,mopen:bc,mclose:bc,mpunct:bc,minner:bc},minner:{mord:bc,mop:bc,mbin:wc,mrel:xc,mopen:bc,mpunct:bc,minner:bc}},Sc={mord:{mop:bc},mop:{mord:bc,mop:bc},mbin:{},mrel:{},mopen:{},mclose:{mop:bc},mpunct:{},minner:{mop:bc}},Cc={},Ac={},
|
|
306
|
-
},Mc=function(e){return"ordgroup"===e.type?e.body:[e]},zc=_c.makeSpan,Oc=["leftmost","mbin","mopen","mrel","mop","mpunct"],Ic=["rightmost","mrel","mclose","mpunct"],
|
|
307
|
-
var n=Hc(t),r=Hc(e),o=n&&r?e.hasClass("mtight")?Sc[n][r]:kc[n][r]:null;if(o)return _c.makeGlue(o,l)}),{node:u},h,d),o},Bc=function e(t,n,r,o,i){o&&t.push(o);for(var a=0;a<t.length;a++){var s=t[a],l=Fc(s);if(l)e(l.children,n,r,null,i);else{var c=!s.hasClass("mspace");if(c){var u=n(s,r.node);u&&(r.insertAfter?r.insertAfter(u):(t.unshift(u),a++))}c?r.node=s:i&&s.hasClass("newline")&&(r.node=zc(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),a++})(a)}}o&&t.pop()},Fc=function(e){return e instanceof nl||e instanceof xl||e instanceof wl&&e.hasClass("enclosing")?e:null},jc=function e(t,n){var r=Fc(t);if(r){var o=r.children;if(o.length){if("right"===n)return e(o[o.length-1],"right");if("left"===n)return e(o[0],"left")}}return t},Hc=function(e,t){return e?(t&&(e=jc(e,t)),
|
|
304
|
+
;return uc(o,v,r,t,i.concat(v,t.fontWeight,t.fontShape))}var y=gc("textrm",t.fontWeight,t.fontShape);return uc(o,y,r,t,i.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=pc(["mspace"],[],t),r=fl(e,t);return n.style.marginRight=gl(r),n},staticSvg:function(e,t){var[n,r,o]=yc[e],i=new El(n),a=new Al([i],{width:gl(r),height:gl(o),style:"width:"+gl(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),s=mc(["overlay"],[a],t);return s.height=o,s.style.height=gl(o),s.style.width=gl(r),s},svgData:yc,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof Cl&&r instanceof Cl&&hc(n,r)&&(n.text+=r.text,n.height=Math.max(n.height,r.height),n.depth=Math.max(n.depth,r.depth),n.italic=r.italic,e.splice(t+1,1),t--)}return e}},bc={number:3,unit:"mu"},wc={number:4,unit:"mu"},xc={number:5,unit:"mu"},kc={mord:{mop:bc,mbin:wc,mrel:xc,minner:bc},mop:{mord:bc,mop:bc,mrel:xc,minner:bc},mbin:{mord:wc,mop:wc,mopen:wc,minner:wc},mrel:{
|
|
305
|
+
mord:xc,mop:xc,mopen:xc,minner:xc},mopen:{},mclose:{mop:bc,mbin:wc,mrel:xc,minner:bc},mpunct:{mord:bc,mop:bc,mrel:xc,mopen:bc,mclose:bc,mpunct:bc,minner:bc},minner:{mord:bc,mop:bc,mbin:wc,mrel:xc,mopen:bc,mpunct:bc,minner:bc}},Sc={mord:{mop:bc},mop:{mord:bc,mop:bc},mbin:{},mrel:{},mopen:{},mclose:{mop:bc},mpunct:{},minner:{mop:bc}},Cc={},Ac={},Ec={};function Tc(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:i,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs,argTypes:r.argTypes,allowedInArgument:!!r.allowedInArgument,allowedInText:!!r.allowedInText,allowedInMath:void 0===r.allowedInMath||r.allowedInMath,numOptionalArgs:r.numOptionalArgs||0,infix:!!r.infix,primitive:!!r.primitive,handler:o},l=0;l<n.length;++l)Cc[n[l]]=s;t&&(i&&(Ac[t]=i),a&&(Ec[t]=a))}function Nc(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Tc({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Lc=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e
|
|
306
|
+
},Mc=function(e){return"ordgroup"===e.type?e.body:[e]},zc=_c.makeSpan,Oc=["leftmost","mbin","mopen","mrel","mop","mpunct"],Ic=["rightmost","mrel","mclose","mpunct"],Rc={display:Zs.DISPLAY,text:Zs.TEXT,script:Zs.SCRIPT,scriptscript:Zs.SCRIPTSCRIPT},Pc={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},Dc=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],i=0;i<e.length;i++){var a=qc(e[i],t);if(a instanceof nl){var s=a.children;o.push(...s)}else o.push(a)}if(_c.tryCombineChars(o),!n)return o;var l=t;if(1===e.length){var c=e[0];"sizing"===c.type?l=t.havingSize(c.size):"styling"===c.type&&(l=t.havingStyle(Rc[c.style]))}var u=zc([r[0]||"leftmost"],[],t),h=zc([r[1]||"rightmost"],[],t),d="root"===n;return Bc(o,((e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&Fs.contains(Ic,r)?t.classes[0]="mord":"mbin"===r&&Fs.contains(Oc,n)&&(e.classes[0]="mord")}),{node:u},h,d),Bc(o,((e,t)=>{
|
|
307
|
+
var n=Hc(t),r=Hc(e),o=n&&r?e.hasClass("mtight")?Sc[n][r]:kc[n][r]:null;if(o)return _c.makeGlue(o,l)}),{node:u},h,d),o},Bc=function e(t,n,r,o,i){o&&t.push(o);for(var a=0;a<t.length;a++){var s=t[a],l=Fc(s);if(l)e(l.children,n,r,null,i);else{var c=!s.hasClass("mspace");if(c){var u=n(s,r.node);u&&(r.insertAfter?r.insertAfter(u):(t.unshift(u),a++))}c?r.node=s:i&&s.hasClass("newline")&&(r.node=zc(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),a++})(a)}}o&&t.pop()},Fc=function(e){return e instanceof nl||e instanceof xl||e instanceof wl&&e.hasClass("enclosing")?e:null},jc=function e(t,n){var r=Fc(t);if(r){var o=r.children;if(o.length){if("right"===n)return e(o[o.length-1],"right");if("left"===n)return e(o[0],"left")}}return t},Hc=function(e,t){return e?(t&&(e=jc(e,t)),Pc[e.classes[0]]||null):null},Uc=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return zc(t.concat(n))},qc=function(e,t,n){if(!e)return zc();if(Ac[e.type]){var r=Ac[e.type](e,t);if(n&&t.size!==n.size){
|
|
308
308
|
r=zc(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new Is("Got group of unknown type: '"+e.type+"'")};function $c(e,t){var n=zc(["base"],e,t),r=zc(["strut"]);return r.style.height=gl(n.height+n.depth),n.depth&&(r.style.verticalAlign=gl(-n.depth)),n.children.unshift(r),n}function Gc(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=Dc(e,t,"root");2===o.length&&o[1].hasClass("tag")&&(r=o.pop());for(var i,a=[],s=[],l=0;l<o.length;l++)if(s.push(o[l]),o[l].hasClass("mbin")||o[l].hasClass("mrel")||o[l].hasClass("allowbreak")){for(var c=!1;l<o.length-1&&o[l+1].hasClass("mspace")&&!o[l+1].hasClass("newline");)l++,s.push(o[l]),o[l].hasClass("nobreak")&&(c=!0);c||(a.push($c(s,t)),s=[])}else o[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push($c(s,t)),s=[]),a.push(o[l]));s.length>0&&a.push($c(s,t)),n?((i=$c(Dc(n,t,!0))).classes=["tag"],a.push(i)):r&&a.push(r);var u=zc(["katex-html"],a);if(u.setAttribute("aria-hidden","true"),i){
|
|
309
309
|
var h=i.children[0];h.style.height=gl(u.height+u.depth),u.depth&&(h.style.verticalAlign=gl(-u.depth))}return u}function Vc(e){return new nl(e)}class Wc{constructor(e,t,n){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=n||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){var e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=vl(this.classes));for(var n=0;n<this.children.length;n++)e.appendChild(this.children[n].toNode());return e}toMarkup(){var e="<"+this.type;for(var t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=Fs.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Fs.escape(vl(this.classes))+'"'),e+=">"
|
|
310
310
|
;for(var n=0;n<this.children.length;n++)e+=this.children[n].toMarkup();return e+="</"+this.type+">"}toText(){return this.children.map((e=>e.toText())).join("")}}class Yc{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Fs.escape(this.toText())}toText(){return this.text}}var Kc={MathNode:Wc,TextNode:Yc,SpaceNode:class{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?" ":e>=.1666&&e<=.1667?" ":e>=.2222&&e<=.2223?" ":e>=.2777&&e<=.2778?" ":e>=-.05556&&e<=-.05555?" ":e>=-.1667&&e<=-.1666?" ":e>=-.2223&&e<=-.2222?" ":e>=-.2778&&e<=-.2777?" ":null}toNode(){if(this.character)return document.createTextNode(this.character);var e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",gl(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+gl(this.width)+'"/>'}toText(){
|
|
311
311
|
return this.character?this.character:" "}},newDocumentFragment:Vc},Xc=function(e,t,n){return!zl[t][e]||!zl[t][e].replace||55349===e.charCodeAt(0)||Vl.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.substr(4,2)||n.font&&"tt"===n.font.substr(4,2))||(e=zl[t][e].replace),new Kc.TextNode(e)},Zc=function(e){return 1===e.length?e[0]:new Kc.MathNode("mrow",e)},Jc=function(e,t){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold";var n=t.font;if(!n||"mathnormal"===n)return null;var r=e.mode;if("mathit"===n)return"italic";if("boldsymbol"===n)return"textord"===e.type?"bold":"bold-italic";if("mathbf"===n)return"bold";if("mathbb"===n)return"double-struck"
|
|
312
312
|
;if("mathfrak"===n)return"fraktur";if("mathscr"===n||"mathcal"===n)return"script";if("mathsf"===n)return"sans-serif";if("mathtt"===n)return"monospace";var o=e.text;return Fs.contains(["\\imath","\\jmath"],o)?null:(zl[r][o]&&zl[r][o].replace&&(o=zl[r][o].replace),al(o,_c.fontMap[n].fontName,r)?_c.fontMap[n].variant:null)},Qc=function(e,t,n){if(1===e.length){var r=tu(e[0],t);return n&&r instanceof Wc&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,i=[],a=0;a<e.length;a++){var s=tu(e[a],t);if(s instanceof Wc&&o instanceof Wc){if("mtext"===s.type&&"mtext"===o.type&&s.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...s.children);continue}if("mn"===s.type&&"mn"===o.type){o.children.push(...s.children);continue}if("mi"===s.type&&1===s.children.length&&"mn"===o.type){var l=s.children[0];if(l instanceof Yc&&"."===l.text){o.children.push(...s.children);continue}}else if("mi"===o.type&&1===o.children.length){var c=o.children[0]
|
|
313
|
-
;if(c instanceof Yc&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof Yc&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),i.pop())}}}i.push(s),o=s}return i},eu=function(e,t,n){return Zc(Qc(e,t,n))},tu=function(e,t){if(!e)return new Kc.MathNode("mrow");if(
|
|
313
|
+
;if(c instanceof Yc&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof Yc&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),i.pop())}}}i.push(s),o=s}return i},eu=function(e,t,n){return Zc(Qc(e,t,n))},tu=function(e,t){if(!e)return new Kc.MathNode("mrow");if(Ec[e.type])return Ec[e.type](e,t);throw new Is("Got group of unknown type: '"+e.type+"'")};function nu(e,t,n,r,o){var i,a=Qc(e,n);i=1===a.length&&a[0]instanceof Wc&&Fs.contains(["mrow","mtable"],a[0].type)?a[0]:new Kc.MathNode("mrow",a);var s=new Kc.MathNode("annotation",[new Kc.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new Kc.MathNode("semantics",[i,s]),c=new Kc.MathNode("math",[l]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),r&&c.setAttribute("display","block");var u=o?"katex":"katex-mathml";return _c.makeSpan([u],[c])}var ru=function(e){return new hl({style:e.displayMode?Zs.DISPLAY:Zs.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})
|
|
314
314
|
},ou=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=_c.makeSpan(n,[e])}return e},iu={widehat:"^",widecheck:"ˇ",widetilde:"~",utilde:"~",overleftarrow:"←",underleftarrow:"←",xleftarrow:"←",overrightarrow:"→",underrightarrow:"→",xrightarrow:"→",underbrace:"⏟",overbrace:"⏞",overgroup:"⏠",undergroup:"⏡",overleftrightarrow:"↔",underleftrightarrow:"↔",xleftrightarrow:"↔",Overrightarrow:"⇒",xRightarrow:"⇒",overleftharpoon:"↼",xleftharpoonup:"↼",overrightharpoon:"⇀",xrightharpoonup:"⇀",xLeftarrow:"⇐",xLeftrightarrow:"⇔",xhookleftarrow:"↩",xhookrightarrow:"↪",xmapsto:"↦",xrightharpoondown:"⇁",xleftharpoondown:"↽",xrightleftharpoons:"⇌",xleftrightharpoons:"⇋",xtwoheadleftarrow:"↞",xtwoheadrightarrow:"↠",xlongequal:"=",xtofrom:"⇄",xrightleftarrows:"⇄",xrightequilibrium:"⇌",xleftequilibrium:"⇋","\\cdrightarrow":"→","\\cdleftarrow":"←","\\cdlongequal":"="},au={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],
|
|
315
315
|
underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],
|
|
316
316
|
xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],
|
|
317
|
-
xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},su=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=_c.makeSpan(["stretchy",t],[],o),"fbox"===t){var s=o.color&&o.getColor();s&&(i.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new
|
|
318
|
-
;if(Fs.contains(["widehat","widecheck","widetilde","utilde"],r)){var o,i,a,s="ordgroup"===(p=e.base).type?p.body.length:1;if(s>5)"widehat"===r||"widecheck"===r?(o=420,n=2364,a=.42,i=r+"4"):(o=312,n=2340,a=.34,i="tilde4");else{var l=[1,1,2,2,3,3][s];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],o=[0,239,300,360,420][l],a=[0,.24,.3,.3,.36,.42][l],i=r+l):(n=[0,600,1033,2339,2340][l],o=[0,260,286,306,312][l],a=[0,.26,.286,.3,.306,.34][l],i="tilde"+l)}var c=new
|
|
319
|
-
for(var w=0;w<b;w++){var x=new
|
|
317
|
+
xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},su=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=_c.makeSpan(["stretchy",t],[],o),"fbox"===t){var s=o.color&&o.getColor();s&&(i.style.borderColor=s)}}else{var l=[];/^[bx]cancel$/.test(t)&&l.push(new Tl({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Tl({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new Al(l,{width:"100%",height:gl(a)});i=_c.makeSvgSpan([],[c],o)}return i.height=a,i.style.height=gl(a),i},lu=function(e){var t=new Kc.MathNode("mo",[new Kc.TextNode(iu[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},cu=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.substr(1)
|
|
318
|
+
;if(Fs.contains(["widehat","widecheck","widetilde","utilde"],r)){var o,i,a,s="ordgroup"===(p=e.base).type?p.body.length:1;if(s>5)"widehat"===r||"widecheck"===r?(o=420,n=2364,a=.42,i=r+"4"):(o=312,n=2340,a=.34,i="tilde4");else{var l=[1,1,2,2,3,3][s];"widehat"===r||"widecheck"===r?(n=[0,1062,2364,2364,2364][l],o=[0,239,300,360,420][l],a=[0,.24,.3,.3,.36,.42][l],i=r+l):(n=[0,600,1033,2339,2340][l],o=[0,260,286,306,312][l],a=[0,.26,.286,.3,.306,.34][l],i="tilde"+l)}var c=new El(i),u=new Al([c],{width:"100%",height:gl(a),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:_c.makeSvgSpan([],[u],t),minWidth:0,height:a}}var h,d,p,m=[],f=au[r],[g,v,y]=f,_=y/1e3,b=g.length;if(1===b)h=["hide-tail"],d=[f[3]];else if(2===b)h=["halfarrow-left","halfarrow-right"],d=["xMinYMin","xMaxYMin"];else{if(3!==b)throw new Error("Correct katexImagesData or update code here to support\n "+b+" children.");h=["brace-left","brace-center","brace-right"],d=["xMinYMin","xMidYMin","xMaxYMin"]}
|
|
319
|
+
for(var w=0;w<b;w++){var x=new El(g[w]),k=new Al([x],{width:"400em",height:gl(_),viewBox:"0 0 "+n+" "+y,preserveAspectRatio:d[w]+" slice"}),S=_c.makeSvgSpan([h[w]],[k],t);if(1===b)return{span:S,minWidth:v,height:_};S.style.height=gl(_),m.push(S)}return{span:_c.makeSpan(["stretchy"],m,t),minWidth:v,height:_}}();return n.height=o,n.style.height=gl(o),r>0&&(n.style.minWidth=gl(r)),n};function uu(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function hu(e){var t=du(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function du(e){return e&&("atom"===e.type||Ml.hasOwnProperty(e.type))?e:null}var pu=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=uu(e.base,"accent")).base,e.base=n,o=function(e){if(e instanceof wl)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(qc(e,t)),e.base=r):n=(r=uu(e,"accent")).base;var i=qc(n,t.havingCrampedStyle()),a=0
|
|
320
320
|
;if(r.isShifty&&Fs.isCharacterBox(n)){var s=Fs.getBaseElem(n);a=Nl(qc(s,t.havingCrampedStyle())).skew}var l,c="\\c"===r.label,u=c?i.height+i.depth:Math.min(i.height,t.fontMetrics().xHeight);if(r.isStretchy)l=cu(r,t),l=_c.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+gl(2*a)+")",marginLeft:gl(2*a)}:void 0}]},t);else{var h,d;"\\vec"===r.label?(h=_c.staticSvg("vec",t),d=_c.svgData.vec[1]):((h=Nl(h=_c.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,d=h.width,c&&(u+=h.depth)),l=_c.makeSpan(["accent-body"],[h]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),u=i.height);var m=a;p||(m-=d/2),l.style.left=gl(m),"\\textcircled"===r.label&&(l.style.top=".2em"),l=_c.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var f=_c.makeSpan(["mord","accent"],[l],t);return o?(o.children[0]=f,
|
|
321
|
-
o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},mu=(e,t)=>{var n=e.isStretchy?lu(e.label):new Kc.MathNode("mo",[Xc(e.label,e.mode)]),r=new Kc.MathNode("mover",[tu(e.base,t),n]);return r.setAttribute("accent","true"),r},fu=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));
|
|
322
|
-
names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:pu,mathmlBuilder:mu}),
|
|
323
|
-
mathmlBuilder:(e,t)=>{var n=lu(e.label),r=new Kc.MathNode("munder",[tu(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var gu=e=>{var t=new Kc.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};
|
|
321
|
+
o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},mu=(e,t)=>{var n=e.isStretchy?lu(e.label):new Kc.MathNode("mo",[Xc(e.label,e.mode)]),r=new Kc.MathNode("mover",[tu(e.base,t),n]);return r.setAttribute("accent","true"),r},fu=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));Tc({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{var n=Lc(t[0]),r=!fu.test(e.funcName),o=!r||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:r,isShifty:o,base:n}},htmlBuilder:pu,mathmlBuilder:mu}),Tc({type:"accent",
|
|
322
|
+
names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{var n=t[0],r=e.parser.mode;return"math"===r&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),r="text"),{type:"accent",mode:r,label:e.funcName,isStretchy:!1,isShifty:!0,base:n}},htmlBuilder:pu,mathmlBuilder:mu}),Tc({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"accentUnder",mode:n.mode,label:r,base:o}},htmlBuilder:(e,t)=>{var n=qc(e.base,t),r=cu(e,t),o="\\utilde"===e.label?.12:0,i=_c.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]},t);return _c.makeSpan(["mord","accentunder"],[i],t)},
|
|
323
|
+
mathmlBuilder:(e,t)=>{var n=lu(e.label),r=new Kc.MathNode("munder",[tu(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var gu=e=>{var t=new Kc.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Tc({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){var{parser:r,funcName:o}=e;return{type:"xArrow",mode:r.mode,label:o,body:t[0],below:n[0]}},htmlBuilder(e,t){
|
|
324
324
|
var n,r=t.style,o=t.havingStyle(r.sup()),i=_c.wrapFragment(qc(e.body,o,t),t),a="\\x"===e.label.slice(0,2)?"x":"cd";i.classes.push(a+"-arrow-pad"),e.below&&(o=t.havingStyle(r.sub()),(n=_c.wrapFragment(qc(e.below,o,t),t)).classes.push(a+"-arrow-pad"));var s,l=cu(e,t),c=-t.fontMetrics().axisHeight+.5*l.height,u=-t.fontMetrics().axisHeight-.5*l.height-.111;if((i.depth>.25||"\\xleftequilibrium"===e.label)&&(u-=i.depth),n){var h=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=_c.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:h}]},t)}else s=_c.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:c}]},t);return s.children[0].children[0].children[1].classes.push("svg-align"),_c.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=lu(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=gu(tu(e.body,t));if(e.below){
|
|
325
325
|
var i=gu(tu(e.below,t));n=new Kc.MathNode("munderover",[r,i,o])}else n=new Kc.MathNode("mover",[r,o])}else if(e.below){var a=gu(tu(e.below,t));n=new Kc.MathNode("munder",[r,a])}else n=gu(),n=new Kc.MathNode("mover",[r,n]);return n}});var vu={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},yu=e=>"textord"===e.type&&"@"===e.text;function _u(e,t,n){var r=vu[e];switch(r){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return n.callFunction(r,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":var o={type:"atom",text:r,mode:"math",family:"rel"},i={type:"ordgroup",mode:"math",body:[n.callFunction("\\\\cdleft",[t[0]],[]),n.callFunction("\\Big",[o],[]),n.callFunction("\\\\cdright",[t[1]],[])]};return n.callFunction("\\\\cdparent",[i],[]);case"\\\\cdlongequal":return n.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":return n.callFunction("\\Big",[{type:"textord",text:"\\Vert",mode:"math"}],[]);default:return{type:"textord",text:" ",mode:"math"}
|
|
326
|
-
}}
|
|
327
|
-
type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=uu(t[0],"ordgroup").body,o="",i=0;i<r.length;i++){o+=uu(r[i],"textord").text}var a,s=parseInt(o);if(isNaN(s))throw new Is("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new Is("\\@char with invalid code point "+o);return s<=65535?a=String.fromCharCode(s):(s-=65536,a=String.fromCharCode(55296+(s>>10),56320+(1023&s))),{type:"textord",mode:n.mode,text:a}}});var bu=(e,t)=>{var n=Dc(e.body,t.withColor(e.color),!1);return _c.makeFragment(n)},wu=(e,t)=>{var n=Qc(e.body,t.withColor(e.color)),r=new Kc.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};
|
|
328
|
-
argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=uu(t[0],"color-token").color;n.gullet.macros.set("\\current@color",o);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:o,body:i}},htmlBuilder:bu,mathmlBuilder:wu}),
|
|
329
|
-
"\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},ku=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Is("Expected a control sequence",e);return t},Su=(e,t,n,r)=>{var o=e.gullet.macros.get(n.text);null==o&&(n.noexpand=!0,o={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,o,r)};
|
|
330
|
-
;for(var i,a=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){i=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Is('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Is('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new Is("Expected a macro definition");s[a].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return i&&l.unshift(i),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(o,{tokens:l,numArgs:a,delimiters:s},n===xu[n]),{type:"internal",mode:t.mode}}}),
|
|
331
|
-
;return Su(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),
|
|
332
|
-
return _c.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=Au(_c.makeSpan(["delimsizing","size"+t],[a],r),Zs.TEXT,r,i);return n&&
|
|
326
|
+
}}Tc({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"cdlabel",mode:n.mode,side:r.slice(4),label:t[0]}},htmlBuilder(e,t){var n=t.havingStyle(t.style.sup()),r=_c.wrapFragment(qc(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=gl(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new Kc.MathNode("mrow",[tu(e.label,t)]);return(n=new Kc.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new Kc.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Tc({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=_c.wrapFragment(qc(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new Kc.MathNode("mrow",[tu(e.fragment,t)])}),Tc({
|
|
327
|
+
type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=uu(t[0],"ordgroup").body,o="",i=0;i<r.length;i++){o+=uu(r[i],"textord").text}var a,s=parseInt(o);if(isNaN(s))throw new Is("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new Is("\\@char with invalid code point "+o);return s<=65535?a=String.fromCharCode(s):(s-=65536,a=String.fromCharCode(55296+(s>>10),56320+(1023&s))),{type:"textord",mode:n.mode,text:a}}});var bu=(e,t)=>{var n=Dc(e.body,t.withColor(e.color),!1);return _c.makeFragment(n)},wu=(e,t)=>{var n=Qc(e.body,t.withColor(e.color)),r=new Kc.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Tc({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=uu(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:Mc(o)}},htmlBuilder:bu,mathmlBuilder:wu}),Tc({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,
|
|
328
|
+
argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=uu(t[0],"color-token").color;n.gullet.macros.set("\\current@color",o);var i=n.parseExpression(!0,r);return{type:"color",mode:n.mode,color:o,body:i}},htmlBuilder:bu,mathmlBuilder:wu}),Tc({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:1,argTypes:["size"],allowedInText:!0},handler(e,t,n){var{parser:r}=e,o=n[0],i=!r.settings.displayMode||!r.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:r.mode,newLine:i,size:o&&uu(o,"size").value}},htmlBuilder(e,t){var n=_c.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=gl(fl(e.size,t)))),n},mathmlBuilder(e,t){var n=new Kc.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",gl(fl(e.size,t)))),n}});var xu={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef",
|
|
329
|
+
"\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},ku=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Is("Expected a control sequence",e);return t},Su=(e,t,n,r)=>{var o=e.gullet.macros.get(n.text);null==o&&(n.noexpand=!0,o={tokens:[n],numArgs:0,unexpandable:!e.gullet.isExpandable(n.text)}),e.gullet.macros.set(t,o,r)};Tc({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t,funcName:n}=e;t.consumeSpaces();var r=t.fetch();if(xu[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=xu[r.text]),uu(t.parseFunction(),"internal");throw new Is("Invalid token after macro prefix",r)}}),Tc({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=t.gullet.popToken(),o=r.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(o))throw new Is("Expected a control sequence",r)
|
|
330
|
+
;for(var i,a=0,s=[[]];"{"!==t.gullet.future().text;)if("#"===(r=t.gullet.popToken()).text){if("{"===t.gullet.future().text){i=t.gullet.future(),s[a].push("{");break}if(r=t.gullet.popToken(),!/^[1-9]$/.test(r.text))throw new Is('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Is('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new Is("Expected a macro definition");s[a].push(r.text)}var{tokens:l}=t.gullet.consumeArg();return i&&l.unshift(i),"\\edef"!==n&&"\\xdef"!==n||(l=t.gullet.expandTokens(l)).reverse(),t.gullet.macros.set(o,{tokens:l,numArgs:a,delimiters:s},n===xu[n]),{type:"internal",mode:t.mode}}}),Tc({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=ku(t.gullet.popToken());t.gullet.consumeSpaces();var o=(e=>{var t=e.gullet.popToken();return"="===t.text&&" "===(t=e.gullet.popToken()).text&&(t=e.gullet.popToken()),t})(t)
|
|
331
|
+
;return Su(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),Tc({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=ku(t.gullet.popToken()),o=t.gullet.popToken(),i=t.gullet.popToken();return Su(t,r,i,"\\\\globalfuture"===n),t.gullet.pushToken(i),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var Cu=function(e,t,n){var r=al(zl.math[e]&&zl.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},Au=function(e,t,n,r){var o=n.havingBaseStyle(t),i=_c.makeSpan(r.concat(o.sizingClasses(n)),[e],n),a=o.sizeMultiplier/n.sizeMultiplier;return i.height*=a,i.depth*=a,i.maxFontSize=o.sizeMultiplier,i},Eu=function(e,t,n){var r=t.havingBaseStyle(n),o=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=gl(o),e.height-=o,e.depth+=o},Tu=function(e,t,n,r,o,i){var a=function(e,t,n,r){
|
|
332
|
+
return _c.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=Au(_c.makeSpan(["delimsizing","size"+t],[a],r),Zs.TEXT,r,i);return n&&Eu(s,r,Zs.TEXT),s},Nu=function(e,t,n){var r;return r="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:_c.makeSpan(["delimsizinginner",r],[_c.makeSpan([],[_c.makeSymbol(e,t,n)])])}},Lu=function(e,t,n){var r=rl["Size4-Regular"][e.charCodeAt(0)]?rl["Size4-Regular"][e.charCodeAt(0)][4]:rl["Size1-Regular"][e.charCodeAt(0)][4],o=new El("inner",function(e,t){switch(e){case"⎜":return"M291 0 H417 V"+t+" H291z M291 0 H417 V"+t+" H291z";case"∣":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145z";case"∥":return"M145 0 H188 V"+t+" H145z M145 0 H188 V"+t+" H145zM367 0 H410 V"+t+" H367z M367 0 H410 V"+t+" H367z";case"⎟":return"M457 0 H583 V"+t+" H457z M457 0 H583 V"+t+" H457z";case"⎢":return"M319 0 H403 V"+t+" H319z M319 0 H403 V"+t+" H319z";case"⎥":return"M263 0 H347 V"+t+" H263z M263 0 H347 V"+t+" H263z";case"⎪":return"M384 0 H504 V"+t+" H384z M384 0 H504 V"+t+" H384z"
|
|
333
333
|
;case"⏐":return"M312 0 H355 V"+t+" H312z M312 0 H355 V"+t+" H312z";case"‖":return"M257 0 H300 V"+t+" H257z M257 0 H300 V"+t+" H257zM478 0 H521 V"+t+" H478z M478 0 H521 V"+t+" H478z";default:return""}}(e,Math.round(1e3*t))),i=new Al([o],{width:gl(r),height:gl(t),style:"width:"+gl(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=_c.makeSvgSpan([],[i],n);return a.height=t,a.style.height=gl(t),a.style.width=gl(r),{type:"elem",elem:a}},Mu={type:"kern",size:-.008},zu=["|","\\lvert","\\rvert","\\vert"],Ou=["\\|","\\lVert","\\rVert","\\Vert"],Iu=function(e,t,n,r,o,i){var a,s,l,c;a=l=c=e,s=null;var u="Size1-Regular";"\\uparrow"===e?l=c="⏐":"\\Uparrow"===e?l=c="‖":"\\downarrow"===e?a=l="⏐":"\\Downarrow"===e?a=l="‖":"\\updownarrow"===e?(a="\\uparrow",l="⏐",c="\\downarrow"):"\\Updownarrow"===e?(a="\\Uparrow",l="‖",c="\\Downarrow"):Fs.contains(zu,e)?l="∣":Fs.contains(Ou,e)?l="∥":"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",u="Size4-Regular"):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",
|
|
334
334
|
u="Size4-Regular"):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",u="Size4-Regular"):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",u="Size4-Regular"):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",u="Size4-Regular"):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",u="Size4-Regular"):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",u="Size4-Regular"):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",u="Size4-Regular"):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",s="⎬",c="⎭",l="⎪",u="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",u="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",u="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",u="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",u="Size4-Regular");var h=Cu(a,u,o),d=h.height+h.depth,p=Cu(l,u,o),m=p.height+p.depth,f=Cu(c,u,o),g=f.height+f.depth,v=0,y=1;if(null!==s){var _=Cu(s,u,o);v=_.height+_.depth,y=2}var b=d+g+v,w=b+Math.max(0,Math.ceil((t-b)/(y*m)))*y*m,x=r.fontMetrics().axisHeight
|
|
335
|
-
;n&&(x*=r.sizeMultiplier);var k=w/2-x,S=[];if(S.push(Nu(c,u,o)),S.push(Mu),null===s){var C=w-d-g+.016;S.push(Lu(l,C,r))}else{var A=(w-d-g-v)/2+.016;S.push(Lu(l,A,r)),S.push(Mu),S.push(Nu(s,u,o)),S.push(Mu),S.push(Lu(l,A,r))}S.push(Mu),S.push(Nu(a,u,o));var
|
|
335
|
+
;n&&(x*=r.sizeMultiplier);var k=w/2-x,S=[];if(S.push(Nu(c,u,o)),S.push(Mu),null===s){var C=w-d-g+.016;S.push(Lu(l,C,r))}else{var A=(w-d-g-v)/2+.016;S.push(Lu(l,A,r)),S.push(Mu),S.push(Nu(s,u,o)),S.push(Mu),S.push(Lu(l,A,r))}S.push(Mu),S.push(Nu(a,u,o));var E=r.havingBaseStyle(Zs.TEXT),T=_c.makeVList({positionType:"bottom",positionData:k,children:S},E);return Au(_c.makeSpan(["delimsizing","mult"],[T],E),Zs.TEXT,r,i)},Ru=function(e,t,n,r,o){var i=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e,t){
|
|
336
336
|
return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,80);break;case"sqrtSize1":r=function(e,t){
|
|
337
337
|
return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,80);break;case"sqrtSize2":r=function(e,t){
|
|
338
338
|
return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,80);break;case"sqrtSize3":r=function(e,t){
|
|
339
339
|
return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,80);break;case"sqrtSize4":r=function(e,t){
|
|
340
|
-
return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,80);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(n-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,80,n)}return r}(e,r,n),a=new
|
|
341
|
-
;return _c.makeSvgSpan(["hide-tail"],[s],o)},
|
|
342
|
-
type:"stack"}],qu=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},$u=function(e,t,n,r){for(var o=Math.min(2,3-r.style.size);o<n.length&&"stack"!==n[o].type;o++){var i=Cu(e,qu(n[o]),"math"),a=i.height+i.depth;if("small"===n[o].type&&(a*=r.havingBaseStyle(n[o].style).sizeMultiplier),a>t)return n[o]}return n[n.length-1]},Gu=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=Fs.contains(Bu,e)?ju:Fs.contains(
|
|
343
|
-
var n,r,o=t.havingBaseSizing(),i=$u("\\surd",e*o.sizeMultiplier,Uu,o),a=o.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,u=0;return"small"===i.type?(e<1?a=1:e<1.4&&(a=.7),c=(1+s)/a,(n=
|
|
340
|
+
return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,80);break;case"sqrtTall":r=function(e,t,n){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(n-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,80,n)}return r}(e,r,n),a=new El(e,i),s=new Al([a],{width:"400em",height:gl(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"})
|
|
341
|
+
;return _c.makeSvgSpan(["hide-tail"],[s],o)},Pu=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Du=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Bu=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Fu=[0,1.2,1.8,2.4,3],ju=[{type:"small",style:Zs.SCRIPTSCRIPT},{type:"small",style:Zs.SCRIPT},{type:"small",style:Zs.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Hu=[{type:"small",style:Zs.SCRIPTSCRIPT},{type:"small",style:Zs.SCRIPT},{type:"small",style:Zs.TEXT},{type:"stack"}],Uu=[{type:"small",style:Zs.SCRIPTSCRIPT},{type:"small",style:Zs.SCRIPT},{type:"small",style:Zs.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{
|
|
342
|
+
type:"stack"}],qu=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";throw new Error("Add support for delim type '"+e.type+"' here.")},$u=function(e,t,n,r){for(var o=Math.min(2,3-r.style.size);o<n.length&&"stack"!==n[o].type;o++){var i=Cu(e,qu(n[o]),"math"),a=i.height+i.depth;if("small"===n[o].type&&(a*=r.havingBaseStyle(n[o].style).sizeMultiplier),a>t)return n[o]}return n[n.length-1]},Gu=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=Fs.contains(Bu,e)?ju:Fs.contains(Pu,e)?Uu:Hu;var s=$u(e,t,a,r);return"small"===s.type?function(e,t,n,r,o,i){var a=_c.makeSymbol(e,"Main-Regular",o,r),s=Au(a,t,r,i);return n&&Eu(s,r,t),s}(e,s.style,n,r,o,i):"large"===s.type?Tu(e,s.size,n,r,o,i):Iu(e,t,n,r,o,i)},Vu={sqrtImage:function(e,t){
|
|
343
|
+
var n,r,o=t.havingBaseSizing(),i=$u("\\surd",e*o.sizeMultiplier,Uu,o),a=o.sizeMultiplier,s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness),l=0,c=0,u=0;return"small"===i.type?(e<1?a=1:e<1.4&&(a=.7),c=(1+s)/a,(n=Ru("sqrtMain",l=(1+s+.08)/a,u=1e3+1e3*s+80,s,t)).style.minWidth="0.853em",r=.833/a):"large"===i.type?(u=1080*Fu[i.size],c=(Fu[i.size]+s)/a,l=(Fu[i.size]+s+.08)/a,(n=Ru("sqrtSize"+i.size,l,u,s,t)).style.minWidth="1.02em",r=1/a):(l=e+s+.08,c=e+s,u=Math.floor(1e3*e+s)+80,(n=Ru("sqrtTall",l,u,s,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=gl(l),{span:n,advanceWidth:r,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*a}},sizedDelim:function(e,t,n,r,o){if("<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),Fs.contains(Pu,e)||Fs.contains(Bu,e))return Tu(e,t,!1,n,r,o);if(Fs.contains(Du,e))return Iu(e,Fu[t],!1,n,r,o);throw new Is("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Fu,customSizedDelim:Gu,leftRightDelim:function(e,t,n,r,o,i){
|
|
344
344
|
var a=r.fontMetrics().axisHeight*r.sizeMultiplier,s=5/r.fontMetrics().ptPerEm,l=Math.max(t-a,n+a),c=Math.max(l/500*901,2*l-s);return Gu(e,c,!0,r,o,i)}},Wu={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}
|
|
345
|
-
},Yu=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Ku(e,t){var n=du(e);if(n&&Fs.contains(Yu,n.text))return n;throw new Is(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Xu(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}
|
|
346
|
-
mode:e.parser.mode,size:Wu[e.funcName].size,mclass:Wu[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?_c.makeSpan([e.mclass]):Vu.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(Xc(e.delim,e.mode));var n=new Kc.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=gl(Vu.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),
|
|
345
|
+
},Yu=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","<",">","\\langle","⟨","\\rangle","⟩","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."];function Ku(e,t){var n=du(e);if(n&&Fs.contains(Yu,n.text))return n;throw new Is(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Xu(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Tc({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{var n=Ku(t[0],e);return{type:"delimsizing",
|
|
346
|
+
mode:e.parser.mode,size:Wu[e.funcName].size,mclass:Wu[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?_c.makeSpan([e.mclass]):Vu.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(Xc(e.delim,e.mode));var n=new Kc.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=gl(Vu.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),Tc({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=e.parser.gullet.macros.get("\\current@color");if(n&&"string"!=typeof n)throw new Is("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Ku(t[0],e).text,color:n}}}),Tc({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Ku(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1)
|
|
347
347
|
;--r.leftrightDepth,r.expect("\\right",!1);var i=uu(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{Xu(e);for(var n,r,o=Dc(e.body,t,!0,["mopen","mclose"]),i=0,a=0,s=!1,l=0;l<o.length;l++)o[l].isMiddle?s=!0:(i=Math.max(o[l].height,i),a=Math.max(o[l].depth,a));if(i*=t.sizeMultiplier,a*=t.sizeMultiplier,n="."===e.left?Uc(t,["mopen"]):Vu.leftRightDelim(e.left,i,a,t,e.mode,["mopen"]),o.unshift(n),s)for(var c=1;c<o.length;c++){var u=o[c].isMiddle;u&&(o[c]=Vu.leftRightDelim(u.delim,i,a,u.options,e.mode,[]))}if("."===e.right)r=Uc(t,["mclose"]);else{var h=e.rightColor?t.withColor(e.rightColor):t;r=Vu.leftRightDelim(e.right,i,a,h,e.mode,["mclose"])}return o.push(r),_c.makeSpan(["minner"],o,t)},mathmlBuilder:(e,t)=>{Xu(e);var n=Qc(e.body,t);if("."!==e.left){var r=new Kc.MathNode("mo",[Xc(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new Kc.MathNode("mo",[Xc(e.right,e.mode)])
|
|
348
|
-
;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return Zc(n)}}),
|
|
349
|
-
number:.6,unit:"pt"},t),u=fl({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=o.height+o.depth+c+u;o.style.paddingLeft=gl(h/2+c);var d=Math.floor(1e3*h*a),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(d),m=new Al([new
|
|
348
|
+
;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return Zc(n)}}),Tc({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=Ku(t[0],e);if(!e.parser.leftrightDepth)throw new Is("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Uc(t,[]);else{n=Vu.sizedDelim(e.delim,1,t,e.mode,[]);var r={delim:e.delim,options:t};n.isMiddle=r}return n},mathmlBuilder:(e,t)=>{var n="\\vert"===e.delim||"|"===e.delim?Xc("|","text"):Xc(e.delim,e.mode),r=new Kc.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var Zu=(e,t)=>{var n,r,o=_c.wrapFragment(qc(e.body,t),t),i=e.label.substr(1),a=t.sizeMultiplier,s=0,l=Fs.isCharacterBox(e.body);if("sout"===i)(n=_c.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,s=-.5*t.fontMetrics().xHeight;else if("phase"===i){var c=fl({
|
|
349
|
+
number:.6,unit:"pt"},t),u=fl({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var h=o.height+o.depth+c+u;o.style.paddingLeft=gl(h/2+c);var d=Math.floor(1e3*h*a),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(d),m=new Al([new El("phase",p)],{width:"400em",height:gl(d/1e3),viewBox:"0 0 400000 "+d,preserveAspectRatio:"xMinYMin slice"});(n=_c.makeSvgSpan(["hide-tail"],[m],t)).style.height=gl(h),s=o.depth+c+u}else{/cancel/.test(i)?l||o.classes.push("cancel-pad"):"angl"===i?o.classes.push("anglpad"):o.classes.push("boxpad");var f=0,g=0,v=0;/box/.test(i)?(v=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),g=f=t.fontMetrics().fboxsep+("colorbox"===i?0:v)):"angl"===i?(f=4*(v=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness)),g=Math.max(0,.25-o.depth)):g=f=l?.2:0,n=su(o,i,f,g,t),/fbox|boxed|fcolorbox/.test(i)?(n.style.borderStyle="solid",n.style.borderWidth=gl(v)):"angl"===i&&.049!==v&&(n.style.borderTopWidth=gl(v),n.style.borderRightWidth=gl(v)),
|
|
350
350
|
s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=_c.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:o,shift:0}]},t);else{var y=/cancel|phase/.test(i)?["svg-align"]:[];r=_c.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:y}]},t)}return/cancel/.test(i)&&(r.height=o.height,r.depth=o.depth),/cancel/.test(i)&&!l?_c.makeSpan(["mord","cancel-lap"],[r],t):_c.makeSpan(["mord"],[r],t)},Ju=(e,t)=>{var n=0,r=new Kc.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[tu(e.body,t)]);switch(e.label){case"\\cancel":r.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":r.setAttribute("notation","downdiagonalstrike");break;case"\\phase":r.setAttribute("notation","phasorangle");break;case"\\sout":r.setAttribute("notation","horizontalstrike");break;case"\\fbox":
|
|
351
|
-
r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var o=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+o+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};
|
|
352
|
-
argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=uu(t[0],"color-token").color,a=uu(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}},htmlBuilder:Zu,mathmlBuilder:Ju}),
|
|
353
|
-
handler:o},l=0;l<n.length;++l)Qu[n[l]]=s;i&&(Ac[t]=i),a&&(
|
|
351
|
+
r.setAttribute("notation","box");break;case"\\angl":r.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(n=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,r.setAttribute("width","+"+2*n+"pt"),r.setAttribute("height","+"+2*n+"pt"),r.setAttribute("lspace",n+"pt"),r.setAttribute("voffset",n+"pt"),"\\fcolorbox"===e.label){var o=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);r.setAttribute("style","border: "+o+"em solid "+String(e.borderColor))}break;case"\\xcancel":r.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&r.setAttribute("mathbackground",e.backgroundColor),r};Tc({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=uu(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,body:a}},htmlBuilder:Zu,mathmlBuilder:Ju}),Tc({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,
|
|
352
|
+
argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=uu(t[0],"color-token").color,a=uu(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}},htmlBuilder:Zu,mathmlBuilder:Ju}),Tc({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\fbox",body:t[0]}}}),Tc({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\sout","\\phase"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"enclose",mode:n.mode,label:r,body:o}},htmlBuilder:Zu,mathmlBuilder:Ju}),Tc({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"enclose",mode:n.mode,label:"\\angl",body:t[0]}}});var Qu={};function eh(e){for(var{type:t,names:n,props:r,handler:o,htmlBuilder:i,mathmlBuilder:a}=e,s={type:t,numArgs:r.numArgs||0,allowedInText:!1,numOptionalArgs:0,
|
|
353
|
+
handler:o},l=0;l<n.length;++l)Qu[n[l]]=s;i&&(Ac[t]=i),a&&(Ec[t]=a)}var th={};function nh(e,t){th[e]=t}function rh(e){var t=[];e.consumeSpaces();for(var n=e.fetch().text;"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var oh=e=>{if(!e.parser.settings.displayMode)throw new Is("{"+e.envName+"} can be used only in display mode.")};function ih(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function ah(e,t,n){var{hskipBeforeAndAfter:r,addJot:o,cols:i,arraystretch:a,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:h,leqno:d}=t;if(e.gullet.beginGroup(),c||e.gullet.macros.set("\\cr","\\\\\\relax"),!a){var p=e.gullet.expandMacroAsText("\\arraystretch");if(null==p)a=1;else if(!(a=parseFloat(p))||a<0)throw new Is("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],g=[],v=[],y=null!=l?[]:void 0;function _(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}function b(){
|
|
354
354
|
y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new Os("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(_(),v.push(rh(e));;){var w=e.parseExpression(!1,c?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup(),w={type:"ordgroup",mode:e.mode,body:w},n&&(w={type:"styling",mode:e.mode,style:n,body:[w]}),m.push(w);var x=e.fetch().text;if("&"===x){if(h&&m.length===h){if(c||s)throw new Is("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===x){b(),1===m.length&&"styling"===w.type&&0===w.body[0].body.length&&(f.length>1||!u)&&f.pop(),v.length<f.length+1&&v.push([]);break}if("\\\\"!==x)throw new Is("Expected & or \\\\ or \\cr or \\end",e.nextToken);e.consume();var k=void 0;" "!==e.gullet.future().text&&(k=e.parseSizeGroup(!0)),g.push(k?k.value:null),b(),v.push(rh(e)),m=[],f.push(m),_()}}return e.gullet.endGroup(),
|
|
355
355
|
e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:o,arraystretch:a,body:f,cols:i,rowGaps:g,hskipBeforeAndAfter:r,hLinesBeforeRow:v,colSeparationType:s,tags:y,leqno:d}}function sh(e){return"d"===e.substr(0,1)?"display":"text"}var lh=function(e,t){var n,r,o=e.body.length,i=e.hLinesBeforeRow,a=0,s=new Array(o),l=[],c=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),u=1/t.fontMetrics().ptPerEm,h=5*u;e.colSeparationType&&"small"===e.colSeparationType&&(h=t.havingStyle(Zs.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var d="CD"===e.colSeparationType?fl({number:3,unit:"ex"},t):12*u,p=3*u,m=e.arraystretch*d,f=.7*m,g=.3*m,v=0;function y(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(y(i[0]),n=0;n<e.body.length;++n){var _=e.body[n],b=f,w=g;a<_.length&&(a=_.length);var x=new Array(_.length);for(r=0;r<_.length;++r){var k=qc(_[r],t);w<k.depth&&(w=k.depth),b<k.height&&(b=k.height),x[r]=k}var S=e.rowGaps[n],C=0;S&&(C=fl(S,t))>0&&(w<(C+=g)&&(w=C),C=0),e.addJot&&(w+=p),x.height=b,
|
|
356
|
-
x.depth=w,v+=b,x.pos=v,v+=w+C,s[n]=x,y(i[n+1])}var A,T
|
|
357
|
-
;(r>0||e.hskipBeforeAndAfter)&&0!==(H=Fs.deflt(
|
|
356
|
+
x.depth=w,v+=b,x.pos=v,v+=w+C,s[n]=x,y(i[n+1])}var A,E,T=v/2+t.fontMetrics().axisHeight,N=e.cols||[],L=[],M=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n<o;++n){var z=s[n],O=z.pos-T,I=e.tags[n],R=void 0;(R=!0===I?_c.makeSpan(["eqn-num"],[],t):!1===I?_c.makeSpan([],[],t):_c.makeSpan([],Dc(I,t,!0),t)).depth=z.depth,R.height=z.height,M.push({type:"elem",elem:R,shift:O})}for(r=0,E=0;r<a||E<N.length;++r,++E){for(var P=N[E]||{},D=!0;"separator"===P.type;){if(D||((A=_c.makeSpan(["arraycolsep"],[])).style.width=gl(t.fontMetrics().doubleRuleSep),L.push(A)),"|"!==P.separator&&":"!==P.separator)throw new Is("Invalid separator type: "+P.separator);var B="|"===P.separator?"solid":"dashed",F=_c.makeSpan(["vertical-separator"],[],t);F.style.height=gl(v),F.style.borderRightWidth=gl(c),F.style.borderRightStyle=B,F.style.margin="0 "+gl(-c/2);var j=v-T;j&&(F.style.verticalAlign=gl(-j)),L.push(F),P=N[++E]||{},D=!1}if(!(r>=a)){var H=void 0
|
|
357
|
+
;(r>0||e.hskipBeforeAndAfter)&&0!==(H=Fs.deflt(P.pregap,h))&&((A=_c.makeSpan(["arraycolsep"],[])).style.width=gl(H),L.push(A));var U=[];for(n=0;n<o;++n){var q=s[n],$=q[r];if($){var G=q.pos-T;$.depth=q.depth,$.height=q.height,U.push({type:"elem",elem:$,shift:G})}}U=_c.makeVList({positionType:"individualShift",children:U},t),U=_c.makeSpan(["col-align-"+(P.align||"c")],[U]),L.push(U),(r<a-1||e.hskipBeforeAndAfter)&&0!==(H=Fs.deflt(P.postgap,h))&&((A=_c.makeSpan(["arraycolsep"],[])).style.width=gl(H),L.push(A))}}if(s=_c.makeSpan(["mtable"],L),l.length>0){for(var V=_c.makeLineSpan("hline",t,c),W=_c.makeLineSpan("hdashline",t,c),Y=[{type:"elem",elem:s,shift:0}];l.length>0;){var K=l.pop(),X=K.pos-T;K.isDashed?Y.push({type:"elem",elem:W,shift:X}):Y.push({type:"elem",elem:V,shift:X})}s=_c.makeVList({positionType:"individualShift",children:Y},t)}if(0===M.length)return _c.makeSpan(["mord"],[s],t);var Z=_c.makeVList({positionType:"individualShift",children:M},t);return Z=_c.makeSpan(["tag"],[Z],t),_c.makeFragment([s,Z])
|
|
358
358
|
},ch={c:"center ",l:"left ",r:"right "},uh=function(e,t){for(var n=[],r=new Kc.MathNode("mtd",[],["mtr-glue"]),o=new Kc.MathNode("mtd",[],["mml-eqn-num"]),i=0;i<e.body.length;i++){for(var a=e.body[i],s=[],l=0;l<a.length;l++)s.push(new Kc.MathNode("mtd",[tu(a[l],t)]));e.tags&&e.tags[i]&&(s.unshift(r),s.push(r),e.leqno?s.unshift(o):s.push(o)),n.push(new Kc.MathNode("mtr",s))}var c=new Kc.MathNode("mtable",n),u=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",gl(u));var h="",d="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,g=0,v=p.length;"separator"===p[0].type&&(h+="top ",g=1),"separator"===p[p.length-1].type&&(h+="bottom ",v-=1);for(var y=g;y<v;y++)"align"===p[y].type?(d+=ch[p[y].align],f&&(m+="none "),f=!0):"separator"===p[y].type&&f&&(m+="|"===p[y].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",d.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){
|
|
359
359
|
for(var _=e.cols||[],b="",w=1;w<_.length;w++)b+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",b.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?c.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?c.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?c.setAttribute("columnspacing","0.5em"):c.setAttribute("columnspacing","1em");var x="",k=e.hLinesBeforeRow;h+=k[0].length>0?"left ":"",h+=k[k.length-1].length>0?"right ":"";for(var S=1;S<k.length-1;S++)x+=0===k[S].length?"none ":k[S][0]?"dashed ":"solid ";return/[sd]/.test(x)&&c.setAttribute("rowlines",x.trim()),""!==h&&(c=new Kc.MathNode("menclose",[c])).setAttribute("notation",h.trim()),e.arraystretch&&e.arraystretch<1&&(c=new Kc.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},hh=function(e,t){-1===e.envName.indexOf("ed")&&oh(e);var n,r=[],o=e.envName.indexOf("at")>-1?"alignat":"align",i="split"===e.envName,a=ah(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:ih(e.envName),emptySingleRow:!0,
|
|
360
360
|
colSeparationType:o,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"display"),s=0,l={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){for(var c="",u=0;u<t[0].body.length;u++){c+=uu(t[0].body[u],"textord").text}n=Number(c),s=2*n}var h=!s;a.body.forEach((function(e){for(var t=1;t<e.length;t+=2){var r=uu(e[t],"styling");uu(r.body[0],"ordgroup").body.unshift(l)}if(h)s<e.length&&(s=e.length);else{var o=e.length/2;if(n<o)throw new Is("Too many math in a row: expected "+n+", but got "+o,e[0])}}));for(var d=0;d<s;++d){var p="r",m=0;d%2==1?p="l":d>0&&h&&(m=1),r[d]={type:"align",align:p,pregap:m,postgap:0}}return a.colSeparationType=h?"align":"alignat",a};eh({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(du(t[0])?[t[0]]:uu(t[0],"ordgroup").body).map((function(e){var t=hu(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"}
|
|
@@ -362,46 +362,46 @@ colSeparationType:o,maxNumCols:i?2:void 0,leqno:e.parser.settings.leqno},"displa
|
|
|
362
362
|
type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:lh,mathmlBuilder:uh}),eh({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=ah(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:lh,mathmlBuilder:uh}),eh({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(du(t[0])?[t[0]]:uu(t[0],"ordgroup").body).map((function(e){var t=hu(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new Is("Unknown column alignment: "+t,e)}));if(n.length>1)throw new Is("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=ah(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new Is("{subarray} can contain only one column");return r},htmlBuilder:lh,mathmlBuilder:uh}),eh({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=ah(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{
|
|
363
363
|
type:"align",align:"l",pregap:0,postgap:0}]},sh(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.indexOf("r")>-1?".":"\\{",right:e.envName.indexOf("r")>-1?"\\}":".",rightColor:void 0}},htmlBuilder:lh,mathmlBuilder:uh}),eh({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:hh,htmlBuilder:lh,mathmlBuilder:uh}),eh({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Fs.contains(["gather","gather*"],e.envName)&&oh(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:ih(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return ah(e.parser,t,"display")},htmlBuilder:lh,mathmlBuilder:uh}),eh({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:hh,htmlBuilder:lh,mathmlBuilder:uh}),eh({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){oh(e);var t={autoTag:ih(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno}
|
|
364
364
|
;return ah(e.parser,t,"display")},htmlBuilder:lh,mathmlBuilder:uh}),eh({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(oh(e),function(e){var t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();var n=e.fetch().text;if("&"!==n&&"\\\\"!==n){if("\\end"===n){0===t[t.length-1].length&&t.pop();break}throw new Is("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}for(var r,o,i=[],a=[i],s=0;s<t.length;s++){for(var l=t[s],c={type:"styling",body:[],mode:"math",style:"display"},u=0;u<l.length;u++)if(yu(l[u])){i.push(c);var h=hu(l[u+=1]).text,d=new Array(2);if(d[0]={type:"ordgroup",mode:"math",body:[]},d[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(h)>-1);else{if(!("<>AV".indexOf(h)>-1))throw new Is('Expected one of "<>AV=|." after @',l[u]);for(var p=0;p<2;p++){for(var m=!0,f=u+1;f<l.length;f++){if(o=h,("mathord"===(r=l[f]).type||"atom"===r.type)&&r.text===o){m=!1,u=f;break
|
|
365
|
-
}if(yu(l[f]))throw new Is("Missing a "+h+" character to complete a CD arrow.",l[f]);d[p].body.push(l[f])}if(m)throw new Is("Missing a "+h+" character to complete a CD arrow.",l[u])}}var g={type:"styling",body:[_u(h,d,e)],mode:"math",style:"display"};i.push(g),c={type:"styling",body:[],mode:"math",style:"display"}}else c.body.push(l[u]);s%2==0?i.push(c):i.shift(),i=[],a.push(i)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:a,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(a[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(a.length+1).fill([])}}(e.parser)),htmlBuilder:lh,mathmlBuilder:uh}),nh("\\nonumber","\\gdef\\@eqnsw{0}"),nh("\\notag","\\nonumber"),
|
|
365
|
+
}if(yu(l[f]))throw new Is("Missing a "+h+" character to complete a CD arrow.",l[f]);d[p].body.push(l[f])}if(m)throw new Is("Missing a "+h+" character to complete a CD arrow.",l[u])}}var g={type:"styling",body:[_u(h,d,e)],mode:"math",style:"display"};i.push(g),c={type:"styling",body:[],mode:"math",style:"display"}}else c.body.push(l[u]);s%2==0?i.push(c):i.shift(),i=[],a.push(i)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:a,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(a[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(a.length+1).fill([])}}(e.parser)),htmlBuilder:lh,mathmlBuilder:uh}),nh("\\nonumber","\\gdef\\@eqnsw{0}"),nh("\\notag","\\nonumber"),Tc({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Is(e.funcName+" valid only within array environment")}});var dh=Qu;Tc({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,
|
|
366
366
|
argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new Is("Invalid environment name",o);for(var i="",a=0;a<o.body.length;++a)i+=uu(o.body[a],"textord").text;if("\\begin"===r){if(!dh.hasOwnProperty(i))throw new Is("No such environment: "+i,o);var s=dh[i],{args:l,optArgs:c}=n.parseArguments("\\begin{"+i+"}",s),u={mode:n.mode,envName:i,parser:n},h=s.handler(u,l,c);n.expect("\\end",!1);var d=n.nextToken,p=uu(n.parseFunction(),"environment");if(p.name!==i)throw new Is("Mismatch: \\begin{"+i+"} matched by \\end{"+p.name+"}",d);return h}return{type:"environment",mode:n.mode,name:i,nameGroup:o}}});var ph=_c.makeSpan;function mh(e,t){var n=Dc(e.body,t,!0);return ph([e.mclass],n,t)}function fh(e,t){var n,r=Qc(e.body,t);return"minner"===e.mclass?n=new Kc.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new Kc.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new Kc.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",
|
|
367
|
-
n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}
|
|
368
|
-
props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?gh(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:Mc(i)},l={type:"supsub",mode:a.mode,base:s,sup:"\\underset"===o?null:a,sub:"\\underset"===o?a:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:Fs.isCharacterBox(l)}},htmlBuilder:mh,mathmlBuilder:fh});var vh=(e,t)=>{var n=e.font,r=t.withFont(n);return qc(e.body,r)},yh=(e,t)=>{var n=e.font,r=t.withFont(n);return tu(e.body,r)},_h={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};
|
|
369
|
-
htmlBuilder:vh,mathmlBuilder:yh}),
|
|
367
|
+
n.attributes.rspace="0.22em"):"mpunct"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(n.attributes.lspace="0em",n.attributes.rspace="0em"):"minner"===e.mclass&&(n.attributes.lspace="0.0556em",n.attributes.width="+0.1111em")),n}Tc({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"mclass",mode:n.mode,mclass:"m"+r.substr(5),body:Mc(o),isCharacterBox:Fs.isCharacterBox(o)}},htmlBuilder:mh,mathmlBuilder:fh});var gh=e=>{var t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};Tc({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:gh(t[0]),body:Mc(t[1]),isCharacterBox:Fs.isCharacterBox(t[1])}}}),Tc({type:"mclass",names:["\\stackrel","\\overset","\\underset"],
|
|
368
|
+
props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?gh(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:Mc(i)},l={type:"supsub",mode:a.mode,base:s,sup:"\\underset"===o?null:a,sub:"\\underset"===o?a:null};return{type:"mclass",mode:r.mode,mclass:n,body:[l],isCharacterBox:Fs.isCharacterBox(l)}},htmlBuilder:mh,mathmlBuilder:fh});var vh=(e,t)=>{var n=e.font,r=t.withFont(n);return qc(e.body,r)},yh=(e,t)=>{var n=e.font,r=t.withFont(n);return tu(e.body,r)},_h={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Tc({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=Lc(t[0]),i=r;return i in _h&&(i=_h[i]),{type:"font",mode:n.mode,font:i.slice(1),body:o}},
|
|
369
|
+
htmlBuilder:vh,mathmlBuilder:yh}),Tc({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],o=Fs.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:gh(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:o}}}),Tc({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r,breakOnTokenText:o}=e,{mode:i}=n,a=n.parseExpression(!0,o);return{type:"font",mode:i,font:"math"+r.slice(1),body:{type:"ordgroup",mode:n.mode,body:a}}},htmlBuilder:vh,mathmlBuilder:yh});var bh=(e,t)=>{var n=t;return"display"===e?n=n.id>=Zs.SCRIPT.id?n.text():Zs.DISPLAY:"text"===e&&n.size===Zs.DISPLAY.size?n=Zs.TEXT:"script"===e?n=Zs.SCRIPT:"scriptscript"===e&&(n=Zs.SCRIPTSCRIPT),n},wh=(e,t)=>{var n,r=bh(e.size,t.style),o=r.fracNum(),i=r.fracDen();n=t.havingStyle(o);var a=qc(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm
|
|
370
370
|
;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=t.havingStyle(i);var c,u,h,d,p,m,f,g,v,y,_=qc(e.denom,n,t);if(e.hasBarLine?(e.barSize?(u=fl(e.barSize,t),c=_c.makeLineSpan("frac-line",t,u)):c=_c.makeLineSpan("frac-line",t),u=c.height,h=c.height):(c=null,u=0,h=t.fontMetrics().defaultRuleThickness),r.size===Zs.DISPLAY.size||"display"===e.size?(d=t.fontMetrics().num1,p=u>0?3*h:7*h,m=t.fontMetrics().denom1):(u>0?(d=t.fontMetrics().num2,p=h):(d=t.fontMetrics().num3,p=3*h),m=t.fontMetrics().denom2),c){var b=t.fontMetrics().axisHeight;d-a.depth-(b+.5*u)<p&&(d+=p-(d-a.depth-(b+.5*u))),b-.5*u-(_.height-m)<p&&(m+=p-(b-.5*u-(_.height-m)));var w=-(b-.5*u);f=_c.makeVList({positionType:"individualShift",children:[{type:"elem",elem:_,shift:m},{type:"elem",elem:c,shift:w},{type:"elem",elem:a,shift:-d}]},t)}else{var x=d-a.depth-(_.height-m);x<p&&(d+=.5*(p-x),m+=.5*(p-x)),f=_c.makeVList({positionType:"individualShift",children:[{type:"elem",elem:_,shift:m},{type:"elem",elem:a,shift:-d}]},t)}
|
|
371
371
|
return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===Zs.DISPLAY.size?t.fontMetrics().delim1:r.size===Zs.SCRIPTSCRIPT.size?t.havingStyle(Zs.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?Uc(t,["mopen"]):Vu.customSizedDelim(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),y=e.continued?_c.makeSpan([]):null==e.rightDelim?Uc(t,["mclose"]):Vu.customSizedDelim(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),_c.makeSpan(["mord"].concat(n.sizingClasses(t)),[v,_c.makeSpan(["mfrac"],[f]),y],t)},xh=(e,t)=>{var n=new Kc.MathNode("mfrac",[tu(e.numer,t),tu(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=fl(e.barSize,t);n.setAttribute("linethickness",gl(r))}}else n.setAttribute("linethickness","0px");var o=bh(e.size,t.style);if(o.size!==t.style.size){n=new Kc.MathNode("mstyle",[n]);var i=o.size===Zs.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}
|
|
372
|
-
if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new Kc.MathNode("mo",[new Kc.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}if(a.push(n),null!=e.rightDelim){var l=new Kc.MathNode("mo",[new Kc.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return Zc(a)}return n};
|
|
373
|
-
return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:wh,mathmlBuilder:xh}),
|
|
374
|
-
props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,o=t[4],i=t[5],a=Lc(t[0]),s="atom"===a.type&&"open"===a.family?Sh(a.text):null,l=Lc(t[1]),c="atom"===l.type&&"close"===l.family?Sh(l.text):null,u=uu(t[2],"size"),h=null;n=!!u.isBlank||(h=u.value).number>0;var d="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=uu(p.body[0],"textord");d=kh[Number(m.text)]}}else p=uu(p,"textord"),d=kh[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:n,barSize:h,leftDelim:s,rightDelim:c,size:d}},htmlBuilder:wh,mathmlBuilder:xh}),
|
|
372
|
+
if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new Kc.MathNode("mo",[new Kc.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}if(a.push(n),null!=e.rightDelim){var l=new Kc.MathNode("mo",[new Kc.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return Zc(a)}return n};Tc({type:"genfrac",names:["\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{var n,{parser:r,funcName:o}=e,i=t[0],a=t[1],s=null,l=null,c="auto";switch(o){case"\\dfrac":case"\\frac":case"\\tfrac":n=!0;break;case"\\\\atopfrac":n=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":n=!1,s="(",l=")";break;case"\\\\bracefrac":n=!1,s="\\{",l="\\}";break;case"\\\\brackfrac":n=!1,s="[",l="]";break;default:throw new Error("Unrecognized genfrac command")}switch(o){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}
|
|
373
|
+
return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:wh,mathmlBuilder:xh}),Tc({type:"genfrac",names:["\\cfrac"],props:{numArgs:2},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0],i=t[1];return{type:"genfrac",mode:n.mode,continued:!0,numer:o,denom:i,hasBarLine:!0,leftDelim:null,rightDelim:null,size:"display",barSize:null}}}),Tc({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){var t,{parser:n,funcName:r,token:o}=e;switch(r){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:n.mode,replaceWith:t,token:o}}});var kh=["display","text","script","scriptscript"],Sh=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};Tc({type:"genfrac",names:["\\genfrac"],
|
|
374
|
+
props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){var n,{parser:r}=e,o=t[4],i=t[5],a=Lc(t[0]),s="atom"===a.type&&"open"===a.family?Sh(a.text):null,l=Lc(t[1]),c="atom"===l.type&&"close"===l.family?Sh(l.text):null,u=uu(t[2],"size"),h=null;n=!!u.isBlank||(h=u.value).number>0;var d="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=uu(p.body[0],"textord");d=kh[Number(m.text)]}}else p=uu(p,"textord"),d=kh[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:n,barSize:h,leftDelim:s,rightDelim:c,size:d}},htmlBuilder:wh,mathmlBuilder:xh}),Tc({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){var{parser:n,funcName:r,token:o}=e;return{type:"infix",mode:n.mode,replaceWith:"\\\\abovefrac",size:uu(t[0],"size").value,token:o}}}),Tc({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{
|
|
375
375
|
var{parser:n,funcName:r}=e,o=t[0],i=function(e){if(!e)throw new Error("Expected non-null, but got "+String(e));return e}(uu(t[1],"infix").size),a=t[2],s=i.number>0;return{type:"genfrac",mode:n.mode,numer:o,denom:a,continued:!1,hasBarLine:s,barSize:i,leftDelim:null,rightDelim:null,size:"auto"}},htmlBuilder:wh,mathmlBuilder:xh});var Ch=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?qc(e.sup,t.havingStyle(o.sup()),t):qc(e.sub,t.havingStyle(o.sub()),t),r=uu(e.base,"horizBrace")):r=uu(e,"horizBrace");var i,a=qc(r.base,t.havingBaseStyle(Zs.DISPLAY)),s=cu(r,t);if(r.isOver?(i=_c.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:a},{type:"kern",size:.1},{type:"elem",elem:s}]},t)).children[0].children[0].children[1].classes.push("svg-align"):(i=_c.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:a}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){
|
|
376
|
-
var l=_c.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t);i=r.isOver?_c.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):_c.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return _c.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t)};
|
|
377
|
-
htmlBuilder:(e,t)=>{var n=Dc(e.body,t,!1);return _c.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=eu(e.body,t);return n instanceof Wc||(n=new Wc("mrow",[n])),n.setAttribute("href",e.href),n}}),
|
|
376
|
+
var l=_c.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t);i=r.isOver?_c.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):_c.makeVList({positionType:"bottom",positionData:l.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:l}]},t)}return _c.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t)};Tc({type:"horizBrace",names:["\\overbrace","\\underbrace"],props:{numArgs:1},handler(e,t){var{parser:n,funcName:r}=e;return{type:"horizBrace",mode:n.mode,label:r,isOver:/^\\over/.test(r),base:t[0]}},htmlBuilder:Ch,mathmlBuilder:(e,t)=>{var n=lu(e.label);return new Kc.MathNode(e.isOver?"mover":"munder",[tu(e.base,t),n])}}),Tc({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],o=uu(t[0],"url").url;return n.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:Mc(r)}:n.formatUnsupportedCmd("\\href")},
|
|
377
|
+
htmlBuilder:(e,t)=>{var n=Dc(e.body,t,!1);return _c.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=eu(e.body,t);return n instanceof Wc||(n=new Wc("mrow",[n])),n.setAttribute("href",e.href),n}}),Tc({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=uu(t[0],"url").url;if(!n.settings.isTrusted({command:"\\url",url:r}))return n.formatUnsupportedCmd("\\url");for(var o=[],i=0;i<r.length;i++){var a=r[i];"~"===a&&(a="\\textasciitilde"),o.push({type:"textord",mode:"text",text:a})}var s={type:"text",mode:n.mode,font:"\\texttt",body:o};return{type:"href",mode:n.mode,href:r,body:Mc(s)}}}),Tc({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){var{parser:n}=e;return{type:"hbox",mode:n.mode,body:Mc(t[0])}},htmlBuilder(e,t){var n=Dc(e.body,t,!1);return _c.makeFragment(n)},mathmlBuilder:(e,t)=>new Kc.MathNode("mrow",Qc(e.body,t))}),Tc({type:"html",
|
|
378
378
|
names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{var n,{parser:r,funcName:o,token:i}=e,a=uu(t[0],"raw").string,s=t[1];r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");var l={};switch(o){case"\\htmlClass":l.class=a,n={command:"\\htmlClass",class:a};break;case"\\htmlId":l.id=a,n={command:"\\htmlId",id:a};break;case"\\htmlStyle":l.style=a,n={command:"\\htmlStyle",style:a};break;case"\\htmlData":for(var c=a.split(","),u=0;u<c.length;u++){var h=c[u].split("=");if(2!==h.length)throw new Is("Error parsing key-value for \\htmlData");l["data-"+h[0].trim()]=h[1].trim()}n={command:"\\htmlData",attributes:l};break;default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(n)?{type:"html",mode:r.mode,attributes:l,body:Mc(s)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{var n=Dc(e.body,t,!1),r=["enclosing"]
|
|
379
|
-
;e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=_c.makeSpan(r,n,t);for(var i in e.attributes)"class"!==i&&e.attributes.hasOwnProperty(i)&&o.setAttribute(i,e.attributes[i]);return o},mathmlBuilder:(e,t)=>eu(e.body,t)}),
|
|
379
|
+
;e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=_c.makeSpan(r,n,t);for(var i in e.attributes)"class"!==i&&e.attributes.hasOwnProperty(i)&&o.setAttribute(i,e.attributes[i]);return o},mathmlBuilder:(e,t)=>eu(e.body,t)}),Tc({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Mc(t[0]),mathml:Mc(t[1])}},htmlBuilder:(e,t)=>{var n=Dc(e.html,t,!1);return _c.makeFragment(n)},mathmlBuilder:(e,t)=>eu(e.mathml,t)});var Ah=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};var t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new Is("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!ml(n))throw new Is("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Tc({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,n)=>{
|
|
380
380
|
var{parser:r}=e,o={number:0,unit:"em"},i={number:.9,unit:"em"},a={number:0,unit:"em"},s="";if(n[0])for(var l=uu(n[0],"raw").string.split(","),c=0;c<l.length;c++){var u=l[c].split("=");if(2===u.length){var h=u[1].trim();switch(u[0].trim()){case"alt":s=h;break;case"width":o=Ah(h);break;case"height":i=Ah(h);break;case"totalheight":a=Ah(h);break;default:throw new Is("Invalid key: '"+u[0]+"' in \\includegraphics.")}}}var d=uu(t[0],"url").url;return""===s&&(s=(s=(s=d).replace(/^.*[\\/]/,"")).substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:d})?{type:"includegraphics",mode:r.mode,alt:s,width:o,height:i,totalheight:a,src:d}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=fl(e.height,t),r=0;e.totalheight.number>0&&(r=fl(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=fl(e.width,t));var i={height:gl(n+r)};o>0&&(i.width=gl(o)),r>0&&(i.verticalAlign=gl(-r));var a=new kl(e.src,e.alt,i);return a.height=n,a.depth=r,a},mathmlBuilder:(e,t)=>{
|
|
381
|
-
var n=new Kc.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=fl(e.height,t),o=0;if(e.totalheight.number>0&&(o=fl(e.totalheight,t)-r,n.setAttribute("valign",gl(-o))),n.setAttribute("height",gl(r+o)),e.width.number>0){var i=fl(e.width,t);n.setAttribute("width",gl(i))}return n.setAttribute("src",e.src),n}}),
|
|
382
|
-
;return new Kc.SpaceNode(n)}}),
|
|
383
|
-
;r.switchMode("math");var i="\\("===n?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(o),{type:"styling",mode:r.mode,style:"text",body:a}}}),
|
|
381
|
+
var n=new Kc.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=fl(e.height,t),o=0;if(e.totalheight.number>0&&(o=fl(e.totalheight,t)-r,n.setAttribute("valign",gl(-o))),n.setAttribute("height",gl(r+o)),e.width.number>0){var i=fl(e.width,t);n.setAttribute("width",gl(i))}return n.setAttribute("src",e.src),n}}),Tc({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,o=uu(t[0],"size");if(n.settings.strict){var i="m"===r[1],a="mu"===o.value.unit;i?(a||n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" supports only mu units, not "+o.value.unit+" units"),"math"!==n.mode&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" works only in math mode")):a&&n.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+r+" doesn't support mu units")}return{type:"kern",mode:n.mode,dimension:o.value}},htmlBuilder:(e,t)=>_c.makeGlue(e.dimension,t),mathmlBuilder(e,t){var n=fl(e.dimension,t)
|
|
382
|
+
;return new Kc.SpaceNode(n)}}),Tc({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"lap",mode:n.mode,alignment:r.slice(5),body:o}},htmlBuilder:(e,t)=>{var n;"clap"===e.alignment?(n=_c.makeSpan([],[qc(e.body,t)]),n=_c.makeSpan(["inner"],[n],t)):n=_c.makeSpan(["inner"],[qc(e.body,t)]);var r=_c.makeSpan(["fix"],[]),o=_c.makeSpan([e.alignment],[n,r],t),i=_c.makeSpan(["strut"]);return i.style.height=gl(o.height+o.depth),o.depth&&(i.style.verticalAlign=gl(-o.depth)),o.children.unshift(i),o=_c.makeSpan(["thinbox"],[o],t),_c.makeSpan(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{var n=new Kc.MathNode("mpadded",[tu(e.body,t)]);if("rlap"!==e.alignment){var r="llap"===e.alignment?"-1":"-0.5";n.setAttribute("lspace",r+"width")}return n.setAttribute("width","0px"),n}}),Tc({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){var{funcName:n,parser:r}=e,o=r.mode
|
|
383
|
+
;r.switchMode("math");var i="\\("===n?"\\)":"$",a=r.parseExpression(!1,i);return r.expect(i),r.switchMode(o),{type:"styling",mode:r.mode,style:"text",body:a}}}),Tc({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Is("Mismatched "+e.funcName)}});var Eh=(e,t)=>{switch(t.style.size){case Zs.DISPLAY.size:return e.display;case Zs.TEXT.size:return e.text;case Zs.SCRIPT.size:return e.script;case Zs.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Tc({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Mc(t[0]),text:Mc(t[1]),script:Mc(t[2]),scriptscript:Mc(t[3])}},htmlBuilder:(e,t)=>{var n=Eh(e,t),r=Dc(n,t,!1);return _c.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=Eh(e,t);return eu(n,t)}});var Th=(e,t,n,r,o,i,a)=>{e=_c.makeSpan([],[e]);var s,l,c,u=n&&Fs.isCharacterBox(n);if(t){var h=qc(t,r.havingStyle(o.sup()),r);l={elem:h,
|
|
384
384
|
kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-h.depth)}}if(n){var d=qc(n,r.havingStyle(o.sub()),r);s={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-d.height)}}if(l&&s){var p=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+a;c=_c.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:gl(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:gl(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var m=e.height-a;c=_c.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:gl(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+a;c=_c.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",size:l.kern},{
|
|
385
385
|
type:"elem",elem:l.elem,marginLeft:gl(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var g=[c];if(s&&0!==i&&!u){var v=_c.makeSpan(["mspace"],[],r);v.style.marginRight=gl(i),g.unshift(v)}return _c.makeSpan(["mop","op-limits"],g,r)},Nh=["\\smallint"],Lh=(e,t)=>{var n,r,o,i=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=uu(e.base,"op"),i=!0):o=uu(e,"op");var a,s=t.style,l=!1;if(s.size===Zs.DISPLAY.size&&o.symbol&&!Fs.contains(Nh,o.name)&&(l=!0),o.symbol){var c=l?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(u=o.name.substr(1),o.name="oiint"===u?"\\iint":"\\iiint"),a=_c.makeSymbol(o.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var h=a.italic,d=_c.staticSvg(u+"Size"+(l?"2":"1"),t);a=_c.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:d,shift:l?.08:0}]},t),o.name="\\"+u,a.classes.unshift("mop"),a.italic=h}}else if(o.body){var p=Dc(o.body,t,!0)
|
|
386
|
-
;1===p.length&&p[0]instanceof Cl?(a=p[0]).classes[0]="mop":a=_c.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(_c.mathsym(o.name[f],o.mode,t));a=_c.makeSpan(["mop"],m,t)}var g=0,v=0;return(a instanceof Cl||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(g=(a.height-a.depth)/2-t.fontMetrics().axisHeight,v=a.italic),i?
|
|
387
|
-
names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=r;return 1===o.length&&(o=zh[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Lh,mathmlBuilder:Mh}),
|
|
388
|
-
props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Lh,mathmlBuilder:Mh}),
|
|
389
|
-
var u=l[c];u instanceof Cl&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=_c.makeSpan(["mop"],l,t)}else i=_c.makeSpan(["mop"],[],t);return a?
|
|
390
|
-
case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof Kc.TextNode?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var s=n.map((e=>e.toText())).join("");n=[new Kc.TextNode(s)]}var l=new Kc.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new Kc.MathNode("mo",[Xc("","text")]);return e.parentIsSupSub?new Kc.MathNode("mrow",[l,c]):Kc.newDocumentFragment([l,c])}}),nh("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Nc({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?_c.makeFragment(Dc(e.body,t,!1)):_c.makeSpan(["mord"],Dc(e.body,t,!0),t),mathmlBuilder:(e,t)=>eu(e.body,t,!0)}),
|
|
391
|
-
children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return _c.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new Kc.MathNode("mo",[new Kc.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Kc.MathNode("mover",[tu(e.body,t),n]);return r.setAttribute("accent","true"),r}}),
|
|
392
|
-
;return n=_c.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),_c.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Qc(Mc(e.body),t),r=new Kc.MathNode("mphantom",n),o=new Kc.MathNode("mpadded",[r]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),
|
|
393
|
-
;return _c.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Kc.MathNode("mpadded",[tu(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),
|
|
394
|
-
var n=fl(e.width,t),r=fl(e.height,t),o=e.shift?fl(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new Kc.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",gl(n)),a.setAttribute("height",gl(r));var s=new Kc.MathNode("mpadded",[a]);return o>=0?s.setAttribute("height",gl(o)):(s.setAttribute("height",gl(o)),s.setAttribute("depth",gl(-o))),s.setAttribute("voffset",gl(o)),s}});var
|
|
395
|
-
numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&uu(n[0],"ordgroup");if(a)for(var s="",l=0;l<a.body.length;++l){if("t"===(s=a.body[l].text))o=!0;else{if("b"!==s){o=!1,i=!1;break}i=!0}}else o=!0,i=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:o,smashDepth:i}},htmlBuilder:(e,t)=>{var n=_c.makeSpan([],[qc(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var o=0;o<n.children.length;o++)n.children[o].depth=0;var i=_c.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return _c.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Kc.MathNode("mpadded",[tu(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),
|
|
386
|
+
;1===p.length&&p[0]instanceof Cl?(a=p[0]).classes[0]="mop":a=_c.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(_c.mathsym(o.name[f],o.mode,t));a=_c.makeSpan(["mop"],m,t)}var g=0,v=0;return(a instanceof Cl||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(g=(a.height-a.depth)/2-t.fontMetrics().axisHeight,v=a.italic),i?Th(a,n,r,t,s,v,g):(g&&(a.style.position="relative",a.style.top=gl(g)),a)},Mh=(e,t)=>{var n;if(e.symbol)n=new Wc("mo",[Xc(e.name,e.mode)]),Fs.contains(Nh,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Wc("mo",Qc(e.body,t));else{n=new Wc("mi",[new Yc(e.name.slice(1))]);var r=new Wc("mo",[Xc("","text")]);n=e.parentIsSupSub?new Wc("mrow",[n,r]):Vc([n,r])}return n},zh={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Tc({type:"op",
|
|
387
|
+
names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","∏","∐","∑","⋀","⋁","⋂","⋃","⨀","⨁","⨂","⨄","⨆"],props:{numArgs:0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=r;return 1===o.length&&(o=zh[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Lh,mathmlBuilder:Mh}),Tc({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"op",mode:n.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:Mc(r)}},htmlBuilder:Lh,mathmlBuilder:Mh});var Oh={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Tc({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],
|
|
388
|
+
props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Lh,mathmlBuilder:Mh}),Tc({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:n}},htmlBuilder:Lh,mathmlBuilder:Mh}),Tc({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","∫","∬","∭","∮","∯","∰"],props:{numArgs:0},handler(e){var{parser:t,funcName:n}=e,r=n;return 1===r.length&&(r=Oh[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Lh,mathmlBuilder:Mh});var Ih=(e,t)=>{var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=uu(e.base,"operatorname"),a=!0):o=uu(e,"operatorname"),o.body.length>0){for(var s=o.body.map((e=>{var t=e.text;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e})),l=Dc(s,t.withFont("mathrm"),!0),c=0;c<l.length;c++){
|
|
389
|
+
var u=l[c];u instanceof Cl&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=_c.makeSpan(["mop"],l,t)}else i=_c.makeSpan(["mop"],[],t);return a?Th(i,n,r,t,t.style,0,0):i};function Rh(e,t,n){for(var r=Dc(e,t,!1),o=t.sizeMultiplier/n.sizeMultiplier,i=0;i<r.length;i++){var a=r[i].classes.indexOf("sizing");a<0?Array.prototype.push.apply(r[i].classes,t.sizingClasses(n)):r[i].classes[a+1]==="reset-size"+t.size&&(r[i].classes[a+1]="reset-size"+n.size),r[i].height*=o,r[i].depth*=o}return _c.makeFragment(r)}Tc({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=t[0];return{type:"operatorname",mode:n.mode,body:Mc(o),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:Ih,mathmlBuilder:(e,t)=>{for(var n=Qc(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var i=n[o];if(i instanceof Kc.SpaceNode);else if(i instanceof Kc.MathNode)switch(i.type){case"mi":case"mn":case"ms":
|
|
390
|
+
case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof Kc.TextNode?a.text=a.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):r=!1;break;default:r=!1}else r=!1}if(r){var s=n.map((e=>e.toText())).join("");n=[new Kc.TextNode(s)]}var l=new Kc.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new Kc.MathNode("mo",[Xc("","text")]);return e.parentIsSupSub?new Kc.MathNode("mrow",[l,c]):Kc.newDocumentFragment([l,c])}}),nh("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Nc({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?_c.makeFragment(Dc(e.body,t,!1)):_c.makeSpan(["mord"],Dc(e.body,t,!0),t),mathmlBuilder:(e,t)=>eu(e.body,t,!0)}),Tc({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){var{parser:n}=e,r=t[0];return{type:"overline",mode:n.mode,body:r}},htmlBuilder(e,t){var n=qc(e.body,t.havingCrampedStyle()),r=_c.makeLineSpan("overline-line",t),o=t.fontMetrics().defaultRuleThickness,i=_c.makeVList({positionType:"firstBaseline",
|
|
391
|
+
children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return _c.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new Kc.MathNode("mo",[new Kc.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Kc.MathNode("mover",[tu(e.body,t),n]);return r.setAttribute("accent","true"),r}}),Tc({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"phantom",mode:n.mode,body:Mc(r)}},htmlBuilder:(e,t)=>{var n=Dc(e.body,t.withPhantom(),!1);return _c.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=Qc(e.body,t);return new Kc.MathNode("mphantom",n)}}),Tc({type:"hphantom",names:["\\hphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"hphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=_c.makeSpan([],[qc(e.body,t.withPhantom())]);if(n.height=0,n.depth=0,n.children)for(var r=0;r<n.children.length;r++)n.children[r].height=0,n.children[r].depth=0
|
|
392
|
+
;return n=_c.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),_c.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=Qc(Mc(e.body),t),r=new Kc.MathNode("mphantom",n),o=new Kc.MathNode("mpadded",[r]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),Tc({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[0];return{type:"vphantom",mode:n.mode,body:r}},htmlBuilder:(e,t)=>{var n=_c.makeSpan(["inner"],[qc(e.body,t.withPhantom())]),r=_c.makeSpan(["fix"],[]);return _c.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=Qc(Mc(e.body),t),r=new Kc.MathNode("mphantom",n),o=new Kc.MathNode("mpadded",[r]);return o.setAttribute("width","0px"),o}}),Tc({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=uu(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=qc(e.body,t),r=fl(e.dy,t)
|
|
393
|
+
;return _c.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new Kc.MathNode("mpadded",[tu(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),Tc({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),Tc({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,argTypes:["size","size","size"]},handler(e,t,n){var{parser:r}=e,o=n[0],i=uu(t[0],"size"),a=uu(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&uu(o,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=_c.makeSpan(["mord","rule"],[],t),r=fl(e.width,t),o=fl(e.height,t),i=e.shift?fl(e.shift,t):0;return n.style.borderRightWidth=gl(r),n.style.borderTopWidth=gl(o),n.style.bottom=gl(i),n.width=r,n.height=o+i,n.depth=-i,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){
|
|
394
|
+
var n=fl(e.width,t),r=fl(e.height,t),o=e.shift?fl(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new Kc.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",gl(n)),a.setAttribute("height",gl(r));var s=new Kc.MathNode("mpadded",[a]);return o>=0?s.setAttribute("height",gl(o)):(s.setAttribute("height",gl(o)),s.setAttribute("depth",gl(-o))),s.setAttribute("voffset",gl(o)),s}});var Ph=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Tc({type:"sizing",names:Ph,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!1,n);return{type:"sizing",mode:o.mode,size:Ph.indexOf(r)+1,body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return Rh(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=Qc(e.body,n),o=new Kc.MathNode("mstyle",r);return o.setAttribute("mathsize",gl(n.sizeMultiplier)),o}}),Tc({type:"smash",names:["\\smash"],props:{
|
|
395
|
+
numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&uu(n[0],"ordgroup");if(a)for(var s="",l=0;l<a.body.length;++l){if("t"===(s=a.body[l].text))o=!0;else{if("b"!==s){o=!1,i=!1;break}i=!0}}else o=!0,i=!0;var c=t[0];return{type:"smash",mode:r.mode,body:c,smashHeight:o,smashDepth:i}},htmlBuilder:(e,t)=>{var n=_c.makeSpan([],[qc(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return n;if(e.smashHeight&&(n.height=0,n.children))for(var r=0;r<n.children.length;r++)n.children[r].height=0;if(e.smashDepth&&(n.depth=0,n.children))for(var o=0;o<n.children.length;o++)n.children[o].depth=0;var i=_c.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return _c.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new Kc.MathNode("mpadded",[tu(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),Tc({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){
|
|
396
396
|
var{parser:r}=e,o=n[0],i=t[0];return{type:"sqrt",mode:r.mode,body:i,index:o}},htmlBuilder(e,t){var n=qc(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=_c.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<Zs.TEXT.id&&(o=t.fontMetrics().xHeight);var i=r+o/4,a=n.height+n.depth+i+r,{span:s,ruleWidth:l,advanceWidth:c}=Vu.sqrtImage(a,t),u=s.height-l;u>n.height+n.depth+i&&(i=(i+u-n.height-n.depth)/2);var h=s.height-n.height-i-l;n.style.paddingLeft=gl(c);var d=_c.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+h)},{type:"elem",elem:s},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(Zs.SCRIPTSCRIPT),m=qc(e.index,p,t),f=.6*(d.height-d.depth),g=_c.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]},t),v=_c.makeSpan(["root"],[g]);return _c.makeSpan(["mord","sqrt"],[v,d],t)}return _c.makeSpan(["mord","sqrt"],[d],t)},mathmlBuilder(e,t){
|
|
397
|
-
var{body:n,index:r}=e;return r?new Kc.MathNode("mroot",[tu(n,t),tu(r,t)]):new Kc.MathNode("msqrt",[tu(n,t)])}});var Dh={display:Zs.DISPLAY,text:Zs.TEXT,script:Zs.SCRIPT,scriptscript:Zs.SCRIPTSCRIPT};
|
|
397
|
+
var{body:n,index:r}=e;return r?new Kc.MathNode("mroot",[tu(n,t),tu(r,t)]):new Kc.MathNode("msqrt",[tu(n,t)])}});var Dh={display:Zs.DISPLAY,text:Zs.TEXT,script:Zs.SCRIPT,scriptscript:Zs.SCRIPTSCRIPT};Tc({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){var{breakOnTokenText:n,funcName:r,parser:o}=e,i=o.parseExpression(!0,n),a=r.slice(1,r.length-5);return{type:"styling",mode:o.mode,style:a,body:i}},htmlBuilder(e,t){var n=Dh[e.style],r=t.havingStyle(n).withFont("");return Rh(e.body,r,t)},mathmlBuilder(e,t){var n=Dh[e.style],r=t.havingStyle(n),o=Qc(e.body,r),i=new Kc.MathNode("mstyle",o),a={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return i.setAttribute("scriptlevel",a[0]),i.setAttribute("displaystyle",a[1]),i}});Nc({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base
|
|
398
398
|
;return n?"op"===n.type?n.limits&&(t.style.size===Zs.DISPLAY.size||n.alwaysHandleSupSub)?Lh:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===Zs.DISPLAY.size||n.limits)?Ih:null:"accent"===n.type?Fs.isCharacterBox(n.base)?pu:null:"horizBrace"===n.type&&!e.sub===n.isOver?Ch:null:null}(e,t);if(n)return n(e,t);var r,o,i,{base:a,sup:s,sub:l}=e,c=qc(a,t),u=t.fontMetrics(),h=0,d=0,p=a&&Fs.isCharacterBox(a);if(s){var m=t.havingStyle(t.style.sup());r=qc(s,m,t),p||(h=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=qc(l,f,t),p||(d=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}i=t.style===Zs.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var g,v=t.sizeMultiplier,y=gl(.5/u.ptPerEm/v),_=null;if(o){var b=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof Cl||b)&&(_=gl(-c.italic))}if(r&&o){h=Math.max(h,i,r.depth+.25*u.xHeight),d=Math.max(d,u.sub2)
|
|
399
399
|
;var w=4*u.defaultRuleThickness;if(h-r.depth-(o.height-d)<w){d=w-(h-r.depth)+o.height;var x=.8*u.xHeight-(h-r.depth);x>0&&(h+=x,d-=x)}var k=[{type:"elem",elem:o,shift:d,marginRight:y,marginLeft:_},{type:"elem",elem:r,shift:-h,marginRight:y}];g=_c.makeVList({positionType:"individualShift",children:k},t)}else if(o){d=Math.max(d,u.sub1,o.height-.8*u.xHeight);var S=[{type:"elem",elem:o,marginLeft:_,marginRight:y}];g=_c.makeVList({positionType:"shift",positionData:d,children:S},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");h=Math.max(h,i,r.depth+.25*u.xHeight),g=_c.makeVList({positionType:"shift",positionData:-h,children:[{type:"elem",elem:r,marginRight:y}]},t)}var C=Hc(c,"right")||"mord";return _c.makeSpan([C],[c,_c.makeSpan(["msupsub"],[g])],t)},mathmlBuilder(e,t){var n,r=!1;e.base&&"horizBrace"===e.base.type&&!!e.sup===e.base.isOver&&(r=!0,n=e.base.isOver),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);var o,i=[tu(e.base,t)]
|
|
400
400
|
;if(e.sub&&i.push(tu(e.sub,t)),e.sup&&i.push(tu(e.sup,t)),r)o=n?"mover":"munder";else if(e.sub)if(e.sup){var a=e.base;o=a&&"op"===a.type&&a.limits&&t.style===Zs.DISPLAY||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(t.style===Zs.DISPLAY||a.limits)?"munderover":"msubsup"}else{var s=e.base;o=s&&"op"===s.type&&s.limits&&(t.style===Zs.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===Zs.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===Zs.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===Zs.DISPLAY)?"mover":"msup"}return new Kc.MathNode(o,i)}}),Nc({type:"atom",htmlBuilder:(e,t)=>_c.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new Kc.MathNode("mo",[Xc(e.text,e.mode)]);if("bin"===e.family){var r=Jc(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)
|
|
401
401
|
}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var Bh={mi:"italic",mn:"normal",mtext:"normal"};Nc({type:"mathord",htmlBuilder:(e,t)=>_c.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new Kc.MathNode("mi",[Xc(e.text,e.mode,t)]),r=Jc(e,t)||"italic";return r!==Bh[n.type]&&n.setAttribute("mathvariant",r),n}}),Nc({type:"textord",htmlBuilder:(e,t)=>_c.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=Xc(e.text,e.mode,t),o=Jc(e,t)||"normal";return n="text"===e.mode?new Kc.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new Kc.MathNode("mn",[r]):"\\prime"===e.text?new Kc.MathNode("mo",[r]):new Kc.MathNode("mi",[r]),o!==Bh[n.type]&&n.setAttribute("mathvariant",o),n}});var Fh={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},jh={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Nc({type:"spacing",htmlBuilder(e,t){if(jh.hasOwnProperty(e.text)){var n=jh[e.text].className||""
|
|
402
402
|
;if("text"===e.mode){var r=_c.makeOrd(e,t,"textord");return r.classes.push(n),r}return _c.makeSpan(["mspace",n],[_c.mathsym(e.text,e.mode,t)],t)}if(Fh.hasOwnProperty(e.text))return _c.makeSpan(["mspace",Fh[e.text]],[],t);throw new Is('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!jh.hasOwnProperty(e.text)){if(Fh.hasOwnProperty(e.text))return new Kc.MathNode("mspace");throw new Is('Unknown type of space "'+e.text+'"')}return new Kc.MathNode("mtext",[new Kc.TextNode(" ")])}});var Hh=()=>{var e=new Kc.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Nc({type:"tag",mathmlBuilder(e,t){var n=new Kc.MathNode("mtable",[new Kc.MathNode("mtr",[Hh(),new Kc.MathNode("mtd",[eu(e.body,t)]),Hh(),new Kc.MathNode("mtd",[eu(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Uh={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},qh={"\\textbf":"textbf","\\textmd":"textmd"},$h={"\\textit":"textit","\\textup":"textup"},Gh=(e,t)=>{var n=e.font
|
|
403
|
-
;return n?Uh[n]?t.withTextFontFamily(Uh[n]):qh[n]?t.withTextFontWeight(qh[n]):t.withTextFontShape($h[n]):t};
|
|
404
|
-
},mathmlBuilder(e,t){var n=new Kc.MathNode("mo",[new Kc.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Kc.MathNode("munder",[tu(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),
|
|
403
|
+
;return n?Uh[n]?t.withTextFontFamily(Uh[n]):qh[n]?t.withTextFontWeight(qh[n]):t.withTextFontShape($h[n]):t};Tc({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];return{type:"text",mode:n.mode,body:Mc(o),font:r}},htmlBuilder(e,t){var n=Gh(e,t),r=Dc(e.body,n,!0);return _c.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Gh(e,t);return eu(e.body,n)}}),Tc({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"underline",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=qc(e.body,t),r=_c.makeLineSpan("underline-line",t),o=t.fontMetrics().defaultRuleThickness,i=_c.makeVList({positionType:"top",positionData:n.height,children:[{type:"kern",size:o},{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n}]},t);return _c.makeSpan(["mord","underline"],[i],t)
|
|
404
|
+
},mathmlBuilder(e,t){var n=new Kc.MathNode("mo",[new Kc.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new Kc.MathNode("munder",[tu(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),Tc({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){var{parser:n}=e;return{type:"vcenter",mode:n.mode,body:t[0]}},htmlBuilder(e,t){var n=qc(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return _c.makeVList({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new Kc.MathNode("mpadded",[tu(e.body,t)],["vcenter"])}),Tc({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Is("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Vh(e),r=[],o=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];"~"===a&&(a="\\textasciitilde"),r.push(_c.makeSymbol(a,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}
|
|
405
405
|
return _c.makeSpan(["mord","text"].concat(o.sizingClasses(t)),_c.tryCombineChars(r),o)},mathmlBuilder(e,t){var n=new Kc.TextNode(Vh(e)),r=new Kc.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Vh=e=>e.body.replace(/ /g,e.star?"␣":" "),Wh=Cc,Yh=new RegExp("[̀-ͯ]+$");class Kh{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp("([ \r\n\t]+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-‧-豈-][̀-ͯ]*|[\ud800-\udbff][\udc00-\udfff][̀-ͯ]*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|(\\\\[a-zA-Z@]+)[ \r\n\t]*|\\\\[^\ud800-\udfff])","g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){var e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new Os("EOF",new zs(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new Is("Unexpected character: '"+e[t]+"'",new Os(e[t],new zs(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ")
|
|
406
406
|
;if(14===this.catcodes[r]){var o=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===o?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=o+1,this.lex()}return new Os(r,new zs(this,t,this.tokenRegex.lastIndex))}}class Xh{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new Is("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");var e=this.undefStack.pop();for(var t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){
|
|
407
407
|
return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,n){if(void 0===n&&(n=!1),n){for(var r=0;r<this.undefStack.length;r++)delete this.undefStack[r][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{var o=this.undefStack[this.undefStack.length-1];o&&!o.hasOwnProperty(e)&&(o[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var Zh=th;nh("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),nh("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),nh("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),nh("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),nh("\\@ifnextchar",(function(e){var t=e.consumeArgs(3);e.consumeSpaces();var n=e.future();return 1===t[0].length&&t[0][0].text===n.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}})),
|
|
@@ -515,18 +515,18 @@ o=n.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":o=n.subPa
|
|
|
515
515
|
for(o=0;o<a[r].length;++o)1===r?":"===a[r][o].slice(-1)?a[r][o]=n.helper.padEnd(a[r][o].slice(-1),m-1,"-")+":":a[r][o]=n.helper.padEnd(a[r][o],m,"-"):a[r][o]=n.helper.padEnd(a[r][o],m);i+="| "+a[r].join(" | ")+" |\n"}return i.trim()})),n.subParser("makeMarkdown.tableCell",(function(e,t){var r="";if(!e.hasChildNodes())return"";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t,!0);return r.trim()})),n.subParser("makeMarkdown.txt",(function(e){var t=e.nodeValue;return t=(t=t.replace(/ +/g," ")).replace(/¨NBSP;/g," "),t=(t=(t=(t=(t=(t=(t=(t=(t=n.helper.unescapeHTMLEntities(t)).replace(/([*_~|`])/g,"\\$1")).replace(/^(\s*)>/g,"\\$1>")).replace(/^#/gm,"\\#")).replace(/^(\s*)([-=]{3,})(\s*)$/,"$1\\$2$3")).replace(/^( {0,3}\d+)\./gm,"$1\\.")).replace(/^( {0,3})([+-])/gm,"$1\\$2")).replace(/]([\s]*)\(/g,"\\]$1\\(")).replace(/^ {0,3}\[([\S \t]*?)]:/gm,"\\[$1]:")}));e.exports?e.exports=n:this.showdown=n}).call(X)}(dd);var pd=dd.exports;const md=Ns(window);function fd(){return[{
|
|
516
516
|
type:"output",filter:function(e){return e.replace(/<a href=/g,'<a target="_blank" href=')}}]}let gd;function vd(e){return"{math:"+e.toString()+"}"}function yd(e){const t=function(e){const t=[];let n=0,r=e;for(;;){const e=r.indexOf("$$",n),o=r.indexOf("\\(",n);if(-1===e&&-1===o)break;let i,a;if(-1!==e&&(-1===o||e<o)?(i=e,a=r.indexOf("$$",i+2)):(i=o,a=r.indexOf("\\)",i+2)),-1===a)break;a+=2;const s=t.length+1,l=vd(s);let c;t.push({id:s,expression:r.slice(i+2,a-2),inline:-1!==o}),c=-1!==o?l:"\n\n"+l+"\n\n",r=r.slice(0,i)+c+r.slice(a),n=i+c.length}return{mathBlocks:t,content:r}}(e),n=md.sanitize(function(e){return gd||(gd=new pd.Converter({extensions:[fd],simplifiedAutoLink:!0,literalMidWordUnderscores:!0,strikethrough:!0})),gd.makeHtml(e)}(t.content)),r=function(e,t){return t.reduce(((e,t)=>{let n;try{n=t.inline?hd(t.expression):hd(t.expression,{displayMode:!0})}catch(e){n=Ms(t.expression)}return e.replace(vd(t.id),n)}),e)}(n,t.mathBlocks);return r}function _d({markdown:e="",textClass:t={},textStyle:n={}}){
|
|
517
517
|
const r=no((()=>e?yd(e):""),[e]),o=to();Qr((()=>{!function(e,{className:t}={}){const n=Array.from(e.getElementsByTagName("a"));for(let e of n){const n=Ia(e);n&&(t?n.className=t:n.style.width="350px")}}(o.current,{className:"MarkdownView__embed"})}),[e]);return po("div",{className:Ur("MarkdownView",t),dir:"auto",lang:"",ref:o,dangerouslySetInnerHTML:{__html:r},style:n})}function bd({annotation:e,tags:t}){const n=ii(),r=n.defaultAuthority(),o=no((()=>!Qo(e.user,r)),[e,r]),i=e=>n.getLink("search.tag",{tag:e});return po("ul",{className:"TagList","aria-label":"Annotation tags",children:t.map((e=>po("li",{className:"TagList__item",children:[o&&po("a",{className:"TagList__link",href:i(e),lang:"",target:"_blank",rel:"noopener noreferrer","aria-label":`Tag: ${e}`,title:`View annotations with tag: ${e}`,children:e}),!o&&po("span",{className:"TagList__text","aria-label":`Tag: ${e}`,lang:"",children:e})]},e)))})}md.addHook("afterSanitizeAttributes",(e=>{"target"in e&&e.setAttribute("target","_blank")}))
|
|
518
|
-
;var wd=ri((function({annotation:e,settings:t}){var n,r;const[o,i]=Zr(!0),[a,s]=Zr(!1),l=ii().getDraft(e),c=o?"More":"Less",u=null!==(n=null==l?void 0:l.tags)&&void 0!==n?n:e.tags,h=null!==(r=null==l?void 0:l.text)&&void 0!==r?r:e.text,d=h.length>0,p=u.length>0,m=ti(["annotationFontFamily"],t);return po("div",{className:"hyp-u-vertical-spacing--2",children:[d&&po(
|
|
518
|
+
;var wd=ri((function({annotation:e,settings:t}){var n,r;const[o,i]=Zr(!0),[a,s]=Zr(!1),l=ii().getDraft(e),c=o?"More":"Less",u=null!==(n=null==l?void 0:l.tags)&&void 0!==n?n:e.tags,h=null!==(r=null==l?void 0:l.text)&&void 0!==r?r:e.text,d=h.length>0,p=u.length>0,m=ti(["annotationFontFamily"],t);return po("div",{className:"hyp-u-vertical-spacing--2",children:[d&&po(Ta,{collapse:o,collapsedHeight:400,inlineControls:!1,onCollapsibleChanged:s,onToggleCollapsed:i,overflowThreshold:20,children:po(_d,{textStyle:m,markdown:h,textClass:{AnnotationBody__text:!0,"p-redacted-content":Ti(e)}})}),a&&po("div",{className:"hyp-u-layout-row--justify-right",children:po(bo,{expanded:!o,onClick:()=>i(!o),title:`Toggle visibility of full annotation text: Show ${c}`,children:c})}),p&&po(bd,{annotation:e,tags:u})]})}),["settings"]);const xd=0,kd=1;function Sd(e,t,n,r){let o=e.selectionStart,i=e.selectionEnd;return o>=t+n?(o+=r.length-n,
|
|
519
519
|
i+=r.length-n):i<=t||(o<=t&&i>=t+n?i+=r.length-n:o<t&&i<t+n?o=t:o<t+n&&i>t+n?i+=r.length-n:t<o&&t+n>i&&(o=t,i=t+n)),{text:e.text.slice(0,t)+r+e.text.slice(t+n),selectionStart:o,selectionEnd:i}}function Cd(e,t=xd){const n=e.text.slice(e.selectionStart,e.selectionEnd);let r,o="";if(t===kd&&(o="!"),n.match(/[a-z]+:\/\/.*/)){const t="Description";return r=Sd(e,e.selectionStart,n.length,o+"["+t+"]("+n+")"),r.selectionStart=e.selectionStart+o.length+1,r.selectionEnd=r.selectionStart+t.length,r}{const t=o+"["+n+"](",i="http://insert-your-link-here.com";return r=Sd(e,e.selectionStart,n.length,t+i+")"),r.selectionStart=e.selectionStart+t.length,r.selectionEnd=r.selectionStart+i.length,r}}function Ad(e,t,n,r){void 0===n&&(n=t);const o=e.text.slice(e.selectionStart-t.length,e.selectionStart),i=e.text.slice(e.selectionEnd,e.selectionEnd+t.length);let a=e;return e.selectionStart===e.selectionEnd&&r&&(a=Sd(e,e.selectionStart,0,r),a.selectionStart=a.selectionEnd-r.length),
|
|
520
|
-
o===t&&i===n?(a=Sd(a,a.selectionStart-t.length,t.length,""),a=Sd(a,a.selectionEnd,n.length,"")):(a=Sd(a,a.selectionStart,0,t),a=Sd(a,a.selectionEnd,0,n)),a}function
|
|
520
|
+
o===t&&i===n?(a=Sd(a,a.selectionStart-t.length,t.length,""),a=Sd(a,a.selectionEnd,n.length,"")):(a=Sd(a,a.selectionStart,0,t),a=Sd(a,a.selectionEnd,0,n)),a}function Ed(e,t){const n=e.indexOf("\n",t);return n<0?e.length:n}function Td(e,t,n,r){let o=function(e,t){const n=e.lastIndexOf("\n",t);return n<0?0:n+1}(e.text,t),i=Ed(e.text,t);for(;i<=Ed(e.text,n);){const t=i===e.text.length,a=i-o,s=Ed((e=r(e,o,i)).text,o)-o;if(n+=s-a,t)break;o=o+s+1,i=Ed(e.text,o)}return e}function Nd(e,t){const n=e.selectionStart,r=e.selectionEnd;let o=!0;return Td(e,n,r,((e,n)=>(e.text.slice(n,n+t.length)!==t&&(o=!1),e))),Td(e,n,r,o?(e,n)=>Sd(e,n,t.length,""):(e,n)=>e.text.slice(n,n+t.length)===t?e:Sd(e,n,0,t))}const Ld={bold:"b",italic:"i",link:"l",quote:"q",image:"g",numlist:"o",list:"u"};function Md({buttonRef:e,disabled:t=!1,iconName:n="",label:r,onClick:o,shortcutKey:i,tabIndex:a,title:s=""}){const l=no((()=>((e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0)()?"Cmd":"Ctrl"),[]);let c=s;i&&(c+=` (${l}-${i.toUpperCase()})`)
|
|
521
521
|
;const u={buttonRef:e,disabled:t,icon:n,onClick:o,tabIndex:a,title:c};return r?po(bo,{classes:"u-font--normal TransparentButton",...u,children:r}):po(_o,{classes:"MarkdownEditor__toolbar-button",...u})}function zd({isPreviewing:e,onCommand:t,onTogglePreview:n}){const r=0,o=1,i=2,a=3,s=4,l=5,c=6,u=7,h=8,d=9,p=10,[m,f]=Zr(0),g=to([]).current;if(0===g.length)for(let e=0;e<=p;e++)g.push({current:null});const v=e=>m===e?0:-1;return po("div",{className:"hyp-u-layout-row hyp-u-border--left hyp-u-border--right hyp-u-border--top hyp-u-bg-color--white MarkdownEditor__toolbar",role:"toolbar","aria-label":"Markdown editor toolbar",onKeyDown:t=>{let n=0;const r=p-1;e&&(n=h);let o=null;switch(Oo(t.key)){case"ArrowLeft":o=m<=n?r:m-1;break;case"ArrowRight":o=m>=r?n:m+1;break;case"Home":o=n;break;case"End":o=r}var i;null!==o&&(f(i=o),g[i].current.focus(),t.preventDefault())},children:[po(Md,{disabled:e,iconName:"format-bold",onClick:()=>t("bold"),shortcutKey:Ld.bold,buttonRef:g[r],tabIndex:v(r),title:"Bold"}),po(Md,{
|
|
522
522
|
disabled:e,iconName:"format-italic",onClick:()=>t("italic"),shortcutKey:Ld.italic,buttonRef:g[o],tabIndex:v(o),title:"Italic"}),po(Md,{disabled:e,iconName:"format-quote",onClick:()=>t("quote"),shortcutKey:Ld.quote,buttonRef:g[i],tabIndex:v(i),title:"Quote"}),po(Md,{disabled:e,iconName:"link",onClick:()=>t("link"),shortcutKey:Ld.link,buttonRef:g[a],tabIndex:v(a),title:"Insert link"}),po(Md,{disabled:e,iconName:"image",onClick:()=>t("image"),shortcutKey:Ld.image,buttonRef:g[s],tabIndex:v(s),title:"Insert image"}),po(Md,{disabled:e,iconName:"format-functions",onClick:()=>t("math"),buttonRef:g[l],tabIndex:v(l),title:"Insert math (LaTeX is supported)"}),po(Md,{disabled:e,iconName:"format-list-numbered",onClick:()=>t("numlist"),shortcutKey:Ld.numlist,buttonRef:g[c],tabIndex:v(c),title:"Numbered list"}),po(Md,{disabled:e,iconName:"format-list-unordered",onClick:()=>t("list"),shortcutKey:Ld.list,buttonRef:g[u],tabIndex:v(u),title:"Bulleted list"}),po("span",{className:"hyp-u-stretch"}),po("div",{
|
|
523
523
|
className:"hyp-u-layout-row--center",children:po(zo,{href:"https://web.hypothes.is/help/formatting-annotations-with-markdown/",target:"_blank",classes:"u-font--xsmall IconOnlyLink",linkRef:g[h],tabIndex:v(h),title:"Formatting help","aria-label":"Formatting help",children:po(Mo,{name:"help"})})}),po(Md,{label:e?"Write":"Preview",onClick:n,buttonRef:g[d],tabIndex:v(d)})]})}function Od({label:e="",onEditText:t=(()=>{}),text:n="",textStyle:r={}}){const[o,i]=Zr(!1),a=to(null);Qr((()=>{var e;o||(null===(e=a.current)||void 0===e||e.focus())}),[o]);const s=e=>{a.current&&(!function(e,t){const n=e=>{const n=e({text:t.value,selectionStart:t.selectionStart,selectionEnd:t.selectionEnd});t.value=n.text,t.selectionStart=n.selectionStart,t.selectionEnd=n.selectionEnd,t.focus()},r=e=>{const t=e.text.slice(0,e.selectionStart);return 0===t.length||"\n"===t.slice(-1)||"$$"===t.slice(-2)?Ad(e,"$$","$$","Insert LaTeX"):Ad(e,"\\(","\\)","Insert LaTeX")};switch(e){case"bold":n((e=>Ad(e,"**","**","Bold")));break;case"italic":
|
|
524
|
-
n((e=>Ad(e,"*","*","Italic")));break;case"quote":n((e=>Nd(e,"> ")));break;case"link":n((e=>Cd(e)));break;case"image":n((e=>Cd(e,kd)));break;case"math":n(r);break;case"numlist":n((e=>Nd(e,"1. ")));break;case"list":n((e=>Nd(e,"* ")));break;default:throw new Error(`Unknown toolbar command "${e}"`)}}(e,a.current),t({text:a.current.value}))};return po("div",{className:"u-line-height",children:[po(zd,{onCommand:s,isPreviewing:o,onTogglePreview:()=>i(!o)}),o?po(_d,{markdown:n,textClass:{"hyp-u-border":!0,"hyp-u-bg-color--grey-1":!0,"hyp-u-padding":!0},textStyle:r}):po("textarea",{"aria-label":e,className:"MarkdownEditor__input",dir:"auto",ref:a,onClick:e=>e.stopPropagation(),onKeyDown:e=>{if(e.ctrlKey||e.metaKey)for(let[t,n]of Object.entries(Ld))n===Oo(e.key)&&(e.stopPropagation(),e.preventDefault(),s(t))},onInput:e=>{t({text:e.target.value})},value:n,style:r})]})}const Id=e=>e;function
|
|
525
|
-
const a=n?{id:`${n}${r}`}:{};return po("li",{role:"option","aria-selected":(e===r).toString(),className:Ur({"is-selected":e===r},"AutocompleteList__li"),onClick:()=>{i(t)},...a,children:o(t,r)},`AutocompleteList-${r}`)}))),[e,n,r,o,i]),l=t?{id:t}:{},c=0===r.length||!a;return po("div",{className:Ur({"is-hidden":c},"AutocompleteList"),children:po("ul",{className:"AutocompleteList__items",tabIndex:-1,"aria-label":"Suggestions",role:"listbox",...l,children:s})})}let
|
|
524
|
+
n((e=>Ad(e,"*","*","Italic")));break;case"quote":n((e=>Nd(e,"> ")));break;case"link":n((e=>Cd(e)));break;case"image":n((e=>Cd(e,kd)));break;case"math":n(r);break;case"numlist":n((e=>Nd(e,"1. ")));break;case"list":n((e=>Nd(e,"* ")));break;default:throw new Error(`Unknown toolbar command "${e}"`)}}(e,a.current),t({text:a.current.value}))};return po("div",{className:"u-line-height",children:[po(zd,{onCommand:s,isPreviewing:o,onTogglePreview:()=>i(!o)}),o?po(_d,{markdown:n,textClass:{"hyp-u-border":!0,"hyp-u-bg-color--grey-1":!0,"hyp-u-padding":!0},textStyle:r}):po("textarea",{"aria-label":e,className:"MarkdownEditor__input",dir:"auto",ref:a,onClick:e=>e.stopPropagation(),onKeyDown:e=>{if(e.ctrlKey||e.metaKey)for(let[t,n]of Object.entries(Ld))n===Oo(e.key)&&(e.stopPropagation(),e.preventDefault(),s(t))},onInput:e=>{t({text:e.target.value})},value:n,style:r})]})}const Id=e=>e;function Rd({activeItem:e=-1,id:t,itemPrefixId:n,list:r,listFormatter:o=Id,onSelectItem:i,open:a=!1}){const s=no((()=>r.map(((t,r)=>{
|
|
525
|
+
const a=n?{id:`${n}${r}`}:{};return po("li",{role:"option","aria-selected":(e===r).toString(),className:Ur({"is-selected":e===r},"AutocompleteList__li"),onClick:()=>{i(t)},...a,children:o(t,r)},`AutocompleteList-${r}`)}))),[e,n,r,o,i]),l=t?{id:t}:{},c=0===r.length||!a;return po("div",{className:Ur({"is-hidden":c},"AutocompleteList"),children:po("ul",{className:"AutocompleteList__items",tabIndex:-1,"aria-label":"Suggestions",role:"listbox",...l,children:s})})}let Pd=0;var Dd=ri((function({onAddTag:e,onRemoveTag:t,onTagInput:n,tagList:r,tags:o}){const i=to(),[a,s]=Zr([]),[l,c]=Zr(-1),[u,h]=Zr(!1),[d]=Zr((()=>(++Pd,`TagEditor-${Pd}`))),p=to();Ro(p,u,(()=>{h(!1)}));const m=()=>i.current.value.trim(),f=()=>m()&&m().length>0,g=()=>{i.current.value="",null==n||n("")},v=t=>{e(t)&&(h(!1),c(-1),g(),i.current.focus())},y=e=>{let t=l+e;t<-1?t=a.length-1:t>=a.length&&(t=-1),c(t)},_=l>=0?`${d}-AutocompleteList-item-${l}`:"";return po("div",{className:"TagEditor",children:[po("ul",{className:"TagEditor__tags",
|
|
526
526
|
"aria-label":"Suggested tags for annotation",children:r.map((e=>po("li",{className:"TagEditor__item","aria-label":`Tag: ${e}`,children:[po("span",{lang:"",className:"TagEditor__edit",children:e}),po("button",{onClick:()=>{t(e)},"aria-label":`Remove Tag: ${e}`,title:`Remove Tag: ${e}`,className:"TagEditor__delete",children:po(Mo,{name:"cancel"})})]},`${e}`)))}),po("span",{id:d,className:"TagEditor__combobox-wrapper",ref:p,role:"combobox","aria-expanded":u.toString(),"aria-owns":`${d}-AutocompleteList`,"aria-haspopup":"listbox",children:[po("input",{onInput:()=>{null==n||n(m()),(()=>{if(f()){const e=o.filter(m());s(((e,t)=>{const n=[];return e.forEach((e=>{t.indexOf(e)<0&&n.push(e)})),n.sort()})(e,r)),h(e.length>0)}else h(!1);c(-1)})()},onKeyDown:e=>{switch(Oo(e.key)){case"ArrowUp":y(-1),e.preventDefault();break;case"ArrowDown":y(1),e.preventDefault();break;case"Escape":g(),e.preventDefault();break;case"Enter":case",":v(-1===l?m():a[l]),e.preventDefault();break;case"Tab":if(!f())break
|
|
527
|
-
;-1!==l?v(a[l]):1===a.length?v(a[0]):v(m()),e.preventDefault()}},onFocus:()=>{f()&&h(!0)},ref:i,placeholder:"Add new tags",className:"TagEditor__input",type:"text",autoComplete:"off","aria-autocomplete":"list","aria-activedescendant":_,"aria-controls":`${d}-AutocompleteList`,dir:"auto"}),po(
|
|
527
|
+
;-1!==l?v(a[l]):1===a.length?v(a[0]):v(m()),e.preventDefault()}},onFocus:()=>{f()&&h(!0)},ref:i,placeholder:"Add new tags",className:"TagEditor__input",type:"text",autoComplete:"off","aria-autocomplete":"list","aria-activedescendant":_,"aria-controls":`${d}-AutocompleteList`,dir:"auto"}),po(Rd,{id:`${d}-AutocompleteList`,list:a,listFormatter:e=>{const t=m().toLowerCase(),n=e.toLowerCase().indexOf(t);if(-1===n)return po("span",{children:e});const r=e.slice(0,n),o=e.slice(n,n+t.length),i=e.slice(n+t.length);return po("span",{children:[po("strong",{children:r}),o,po("strong",{children:i})]})},open:u,onSelectItem:e=>{e&&v(e)},itemPrefixId:`${d}-AutocompleteList-item-`,activeItem:l})]})]})}),["tags"]);function Bd(){return po("div",{className:"hyp-u-padding--top hyp-u-border--top u-font--small u-line-height",children:po(zo,{classes:"hyp-u-layout-row--align-center p-link--muted",href:"http://creativecommons.org/publicdomain/zero/1.0/",target:"_blank",
|
|
528
528
|
title:"View more information about the Creative Commons Public Domain dedication",children:[po(Mo,{name:"cc-std",classes:"u-icon--xsmall"}),po(Mo,{name:"cc-zero",classes:"hyp-u-margin--left--1 u-icon--xsmall"}),po("div",{className:"hyp-u-margin--left--2",children:"Annotations can be freely reused by anyone for any purpose."})]})})}function Fd(e){return null!==e.offsetParent}function jd({className:e,closeMenu:t,children:n,visible:r}){const o=to();Qr((()=>{let e=null;return r&&(e=setTimeout((()=>{const e=o.current.querySelector('[role^="menuitem"]');e&&e.focus()}))),()=>{clearTimeout(e)}}),[r]);return po("div",{role:"menu",className:e,ref:o,onKeyDown:e=>{const n=Array.from(o.current.querySelectorAll('[role^="menuitem"]')).filter(Fd);let r=n.findIndex((e=>e.contains(document.activeElement))),i=!1;switch(Oo(e.key)){case"ArrowLeft":case"Escape":t&&(t(e),i=!0);break;case"ArrowUp":r-=1,r<0&&(r=n.length-1),i=!0;break;case"ArrowDown":r+=1,r===n.length&&(r=0),i=!0;break;case"Home":r=0,i=!0;break;case"End":r=n.length-1,
|
|
529
|
-
i=!0}i&&r>=0&&(e.stopPropagation(),e.preventDefault(),n[r].focus())},children:n})}function Hd({className:e}){return po("svg",{className:Ur("Menu__arrow",e),width:15,height:8,children:po("path",{d:"M0 8 L7 0 L15 8",stroke:"currentColor",strokeWidth:"2"})})}let Ud=!1;const qd=()=>{};function $d({align:e="left",arrowClass:t="",children:n,containerPositioned:r=!0,contentClass:o,defaultOpen:i=!1,label:a,open:s,onOpenChanged:l,menuIndicator:c=!0,title:u}){let[h,d]=Zr(i);"boolean"==typeof s&&(h=s,d=l||qd);const p=to(h);Qr((()=>{"function"==typeof l&&p.current!==h&&(p.current=h,l(h))}),[h,l]);const f=e=>{if("mousedown"===e.type)Ud=!0;else if("click"===e.type&&Ud)return Ud=!1,e.stopPropagation(),void e.preventDefault();d(!h)},g=ro((()=>d(!1)),[d]),v=to();
|
|
529
|
+
i=!0}i&&r>=0&&(e.stopPropagation(),e.preventDefault(),n[r].focus())},children:n})}function Hd({className:e}){return po("svg",{className:Ur("Menu__arrow",e),width:15,height:8,children:po("path",{d:"M0 8 L7 0 L15 8",stroke:"currentColor",strokeWidth:"2"})})}let Ud=!1;const qd=()=>{};function $d({align:e="left",arrowClass:t="",children:n,containerPositioned:r=!0,contentClass:o,defaultOpen:i=!1,label:a,open:s,onOpenChanged:l,menuIndicator:c=!0,title:u}){let[h,d]=Zr(i);"boolean"==typeof s&&(h=s,d=l||qd);const p=to(h);Qr((()=>{"function"==typeof l&&p.current!==h&&(p.current=h,l(h))}),[h,l]);const f=e=>{if("mousedown"===e.type)Ud=!0;else if("click"===e.type&&Ud)return Ud=!1,e.stopPropagation(),void e.preventDefault();d(!h)},g=ro((()=>d(!1)),[d]),v=to();Ro(v,h,g);const y=e=>e.stopPropagation();return po("div",{className:"Menu",ref:v,style:{position:r?"relative":"static"},onClick:y,onMouseDown:y,children:[po("button",{"aria-expanded":h?"true":"false","aria-haspopup":!0,className:"Menu__toggle",onMouseDown:f,onClick:f,
|
|
530
530
|
"aria-label":u,title:u,children:po("span",{className:"Menu__toggle-wrapper",children:[a,c&&po("span",{className:Ur("Menu__toggle-arrow",h&&"is-open"),children:po(fo,{name:"expand-menu",className:"Menu__toggle-icon"})})]})}),h&&po(m,{children:[po(Hd,{className:t}),po("div",{className:Ur("Menu__content",`Menu__content--align-${e}`,o),role:"menu",tabIndex:-1,onClick:g,onKeyDown:e=>{const t=Oo(e.key);"Enter"!==t&&" "!==t||setTimeout((()=>{g()}))},children:po(jd,{visible:!0,children:n})})]})]})}function Gd({children:e,visible:t}){const n=to(),[r,o]=Zr(t?"auto":0),[i,a]=Zr(t);Qr((()=>{if(t===(0!==r))return;const e=n.current;t?(e.style.display="",a(!0),o(e.scrollHeight)):(e.style.height=`${e.scrollHeight}px`,e.getBoundingClientRect(),o(0))}),[r,t]);return po("div",{ontransitionend:ro((()=>{t?o("auto"):a(!1)}),[o,t]),ref:n,style:{display:i?"":"none",height:r,overflow:"auto"===r?"visible":"hidden",transition:"height 0.15s ease-in"},children:e})}
|
|
531
531
|
function Vd({href:e,icon:t,iconAlt:n,isDisabled:r,isExpanded:o,isSelected:i,isSubmenuItem:a,isSubmenuVisible:s,label:l,onClick:c,onToggleSubmenu:u,submenu:h}){const d=t&&-1!==t.indexOf("/"),p=t||a,f=t&&a,g=to();let v=null,y=null;t&&"blank"!==t&&(y=d?po("img",{className:"MenuItem__icon",alt:n,src:t}):po(fo,{name:t,className:"MenuItem__icon"}));const _=a?null:y,b=a?y:null;let w;const x="boolean"==typeof s,k="boolean"==typeof i;Qr((()=>()=>{clearTimeout(v)}),[]);const S=e=>{switch(Oo(e.key)){case"ArrowRight":u&&(e.stopPropagation(),e.preventDefault(),u(e));break;case"Enter":case" ":c&&c(e)}};return w=e?po("a",{ref:g,className:Ur("MenuItem",{"is-submenu":a,"is-disabled":r}),href:e,target:"_blank",tabIndex:-1,rel:"noopener noreferrer",role:"menuitem",onKeyDown:S,children:[p&&po("div",{className:"MenuItem__icon-container",children:_}),po("span",{className:"MenuItem__label",children:l}),f&&po("div",{className:"MenuItem__icon-container",children:b})]}):po("div",{ref:g,className:Ur("MenuItem",{"is-submenu":a,
|
|
532
532
|
"is-disabled":r,"is-expanded":o,"is-selected":i}),tabIndex:-1,onKeyDown:S,onClick:c,role:k?"menuitemradio":"menuitem","aria-checked":k?i:void 0,"aria-haspopup":x,"aria-expanded":x?s:void 0,children:[p&&po("div",{className:"MenuItem__icon-container",children:_}),po("span",{className:"MenuItem__label",children:l}),f&&po("div",{className:"MenuItem__icon-container",children:b}),x&&po("div",{role:"none",icon:s?"collapse-menu":"expand-menu",className:"MenuItem__toggle",onClick:u,title:`Show actions for ${l}`,children:po(fo,{name:s?"collapse-menu":"expand-menu",className:"MenuItem__toggle-icon"})})]}),po(m,{children:[w,x&&po(Gd,{visible:s,children:po(jd,{closeMenu:e=>{u&&u(e),v=setTimeout((()=>{g.current.focus()}))},visible:s,className:"MenuItem__submenu",children:h})})]})}var Wd=ri((function({annotation:e,isDisabled:t,onSave:n,settings:r}){const o=ii(),i=o.getDraft(e),a=o.getGroup(e.group);if(!a)return null;const s=i?i.isPrivate:!ya(e.permissions),l=s?"Only Me":a.name,c=t=>{o.createDraft(e,{...i,
|
|
@@ -537,7 +537,7 @@ classes:"hyp-u-layout-row--align-baseline hyp-u-horizontal-spacing--2 p-link--mu
|
|
|
537
537
|
;return`${n} hr${n>1?"s":""} ago`},nextUpdate:36e5},{test:(e,t)=>e.getFullYear()===t.getFullYear(),formatter:function(e,t,n){return ep(e,{month:"short",day:"numeric"},n)},nextUpdate:null}],np={test:()=>!0,formatter:function(e,t,n){return ep(e,{day:"numeric",month:"short",year:"numeric"},n)},nextUpdate:null};function rp(e,t){for(let n of tp)if(n.test(e,t))return n;return np}function op(e){return!isNaN(e.valueOf())}function ip(e,t){let n;const r=new Date(e),o=()=>{const e=function(e,t){if(!e||!op(e)||!op(t))return null;let n=rp(e,t).nextUpdate;return null===n?null:(n=Math.max(n,5e3),n=Math.min(n,20736e5),n)}(r,new Date);if(null===e)return;n=setTimeout((()=>{t(),o()}),e+500)};return o(),()=>clearTimeout(n)}function ap(e,t,n){return e?rp(e,t).formatter(e,t,n):""}function sp(e,t){return ep(e,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"},t)}function lp({annotationCreated:e,annotationUpdated:t,annotationUrl:n,withEditedTimestamp:r}){
|
|
538
538
|
const[o,i]=Zr((()=>new Date)),a=no((()=>new Date(e)),[e]),s=no((()=>r&&new Date(t)),[t,r]),l=no((()=>({absolute:sp(a),relative:ap(a,o)})),[a,o]),c=no((()=>s?{absolute:sp(s),relative:ap(s,o)}:{}),[s,o]);Qr((()=>ip(s?t:e,(()=>i(new Date)))),[e,t,a,s,o]);const u=c&&c.relative!==l.relative?`edited ${c.relative}`:"edited";return po("div",{children:[r&&po("span",{className:"u-color-text--muted u-font--small u-font--italic","data-testid":"timestamp-edited",title:c.absolute,children:["(",u,")"," "]}),n?po(zo,{classes:"p-link--muted p-link--hover-muted",target:"_blank",title:l.absolute,href:n,children:l.relative}):po("span",{className:"u-color-text--muted","data-testid":"timestamp-created",title:l.absolute,children:l.relative})]})}function cp({authorLink:e,displayName:t}){const n=po("h3",{className:"u-color-text u-font--bold",children:t});return e?po(zo,{href:e,target:"_blank",children:n}):po("div",{children:n})}var up=ri((function({annotation:e,isEditing:t,replyCount:n,threadIsCollapsed:r,settings:o}){var i
|
|
539
539
|
;const a=ii(),s=a.defaultAuthority(),l=a.isFeatureEnabled("client_display_names"),c=Qo(e.user,s),u=Kd(e,c,l),h=(()=>{var t;return c?null!==(t=o.usernameUrl&&`${o.usernameUrl}${Jo(e.user)}`)&&void 0!==t?t:void 0:a.getLink("user",{user:e.user})})(),d=ki(e)&&r,p=_a(e.permissions),m=(null===(i=e.links)||void 0===i?void 0:i.html)||"",f=!t&&e.created,g=no((()=>function(e){if(!e.updated||!e.created||e.updated===e.created)return!1;const t=new Date(e.created).getTime(),n=new Date(e.updated).getTime();return!isNaN(t)&&!isNaN(n)&&n-t>2e3}(e)&&!d),[e,d]),v=`${n} ${n>1?"replies":"reply"}`,y=n>0&&d,_=!ki(e),b=function(e){return{domain:wi(e),titleText:xi(e),titleLink:bi(e)}}(e),w=m&&b.titleLink?b.titleLink:"",x="sidebar"!==a.route()&&b.titleText;return po("header",{children:[po("div",{className:"hyp-u-layout-row--align-baseline hyp-u-horizontal-spacing--2 u-wrap-reverse",children:[p&&!t&&po(Mo,{classes:"u-icon--xsmall",name:"lock",title:"This annotation is visible only to you"}),po(cp,{authorLink:h,displayName:u
|
|
540
|
-
}),y&&po(wo,{onClick:()=>a.setExpanded(e.id,!0),title:"Expand replies",children:v}),f&&po("div",{className:"hyp-u-layout-row--justify-right hyp-u-stretch",children:po(lp,{annotationCreated:e.created,annotationUpdated:e.updated,annotationUrl:m,withEditedTimestamp:g})})]}),_&&po("div",{className:"hyp-u-layout-row--align-baseline hyp-u-horizontal-spacing--2 u-wrap-reverse",children:[po(Zd,{annotation:e}),!t&&Ni(e)&&po(Mo,{name:"highlight",title:"This is a highlight. Click 'edit' to add a note or tag.",classes:"u-icon--xsmall u-color-text--muted"}),x&&po(Xd,{domain:b.domain,link:w,title:b.titleText})]})]})}),["settings"]);var hp=ri((function({annotation:e,isFocused:t,settings:n={}}){return po("div",{className:Ur({"is-orphan":Li(e)}),children:po(
|
|
540
|
+
}),y&&po(wo,{onClick:()=>a.setExpanded(e.id,!0),title:"Expand replies",children:v}),f&&po("div",{className:"hyp-u-layout-row--justify-right hyp-u-stretch",children:po(lp,{annotationCreated:e.created,annotationUpdated:e.updated,annotationUrl:m,withEditedTimestamp:g})})]}),_&&po("div",{className:"hyp-u-layout-row--align-baseline hyp-u-horizontal-spacing--2 u-wrap-reverse",children:[po(Zd,{annotation:e}),!t&&Ni(e)&&po(Mo,{name:"highlight",title:"This is a highlight. Click 'edit' to add a note or tag.",classes:"u-icon--xsmall u-color-text--muted"}),x&&po(Xd,{domain:b.domain,link:w,title:b.titleText})]})]})}),["settings"]);var hp=ri((function({annotation:e,isFocused:t,settings:n={}}){return po("div",{className:Ur({"is-orphan":Li(e)}),children:po(Ta,{collapsedHeight:35,inlineControls:!0,overflowThreshold:20,children:po("blockquote",{className:Ur("p-quoted-text",{"is-focused":t,"p-redacted-content":Li(e)}),dir:"auto",lang:"",style:ti(["selectionFontFamily"],n),children:Ii(e)})})})}),["settings"])
|
|
541
541
|
;function dp({onToggleReplies:e,replyCount:t,threadIsCollapsed:n}){const r=`${n?"Show replies":"Hide replies"} (${t})`;return po(wo,{onClick:e,title:r,children:r})}var pp=ri((function({annotation:e,hasAppliedFilter:t,isReply:n,onToggleReplies:r,replyCount:o,threadIsCollapsed:i,annotationsService:a}){const s=n&&i,l=ii(),c=e&&!!Ii(e),u=e&&l.isAnnotationFocused(e.$tag),h=e&&l.isSavingAnnotation(e),d=e&&!!l.getDraft(e)&&!h,p=l.profile().userid,f=!h&&!d,g=!n&&!t&&o>0;return po("article",{className:Ur("hyp-u-vertical-spacing",{"is-collapsed":i,"is-focused":u}),children:[e&&po(m,{children:[po(up,{annotation:e,isEditing:d,replyCount:o,threadIsCollapsed:i}),c&&po(hp,{annotation:e,isFocused:u}),!s&&!d&&po(wd,{annotation:e}),d&&po(Yd,{annotation:e})]}),!e&&!s&&po("div",{children:po("em",{children:"Message not available."})}),!s&&po("footer",{children:po("div",{className:"hyp-u-layout-row",children:[g&&po(dp,{onToggleReplies:r,replyCount:o,threadIsCollapsed:i}),h&&po("div",{
|
|
542
542
|
className:"hyp-u-layout-row--justify-right hyp-u-stretch","data-testid":"saving-message",children:"Saving..."}),e&&f&&po(So,{classes:"hyp-u-stretch",children:po(Ca,{annotation:e,onReply:()=>a.reply(e,p)})})]})})]})}),["annotationsService"]);var mp=ri((function({annotation:e,api:t,toastMessenger:n}){const r=ii(),o=function(e){return e.moderation?e.moderation.flagCount:null}(e),i=null!==o&&(o>0||e.hidden),a=()=>{const o=e.id;t.annotation.hide({id:o}).then((()=>{r.hideAnnotation(o)})).catch((()=>{n.error("Failed to hide annotation")}))},s=()=>{const o=e.id;t.annotation.unhide({id:o}).then((()=>{r.unhideAnnotation(o)})).catch((()=>{n.error("Failed to unhide annotation")}))},l=(()=>{const t={};return e.hidden?(t.onClick=s,t.title="Make this annotation visible to everyone"):(t.onClick=a,t.title="Hide this annotation from non-moderators"),t["aria-label"]=t.title,t})(),c=Ur("ModerationBanner",{"is-flagged":null!==o&&o>0,"is-hidden":e.hidden,"is-reply":ki(e)});return i?po("div",{className:c,
|
|
543
543
|
children:[!!o&&!e.hidden&&po("span",{children:["Flagged for review x",o]}),e.hidden&&po("span",{children:["Hidden from users. Flagged x",o]}),po("span",{className:"hyp-u-stretch"}),po("button",{...l,children:e.hidden?"Unhide":"Hide"})]}):null}),["api","toastMessenger"]);function fp({annotation:e,...t}){const n=ii(),r=e&&n.isSavingAnnotation(e),o=e&&!!n.getDraft(e)&&!r;return e?po("div",{className:"Thread__top-annotation-header",children:po(up,{annotation:e,isEditing:o,...t})}):null}var gp=ri((function e({thread:t,threadsService:n}){const r=!t.collapsed,o=Ui(t)>0,i=!!t.parent,a=t.collapsed?"collapsed":"expand-menu",s=t.collapsed?"Expand replies":"Collapse replies",l=t.children.filter((e=>qi(e)>0)),c=ii(),u=c.hasAppliedFilter(),h=ro((()=>c.setExpanded(t.id,!!t.collapsed)),[c,t.id,t.collapsed]),d=no((()=>t.visible&&po(m,{children:[t.annotation&&po(mp,{annotation:t.annotation}),po(pp,{annotation:t.annotation,hasAppliedFilter:u,isReply:!!t.parent,onToggleReplies:h,replyCount:t.replyCount,
|
|
@@ -547,109 +547,109 @@ const n=ii(),r=t.annotation&&t.annotation.$tag,o=r&&n.isAnnotationFocused(r),i=n
|
|
|
547
547
|
}),d.map((e=>po("div",{className:"ThreadList__card",id:e.id,children:po(vp,{thread:e})},e.id))),po("div",{style:{height:u}})]})}function wp({errorType:e,onLoginRequest:t,showClearSelection:n=!1}){const r=ii(),o=r.isLoggedIn();return po("div",{className:"u-sidebar-container",children:po(Ho,{icon:"restricted",title:"annotation"===e?"Annotation unavailable":"Group unavailable",children:[po("p",{children:o?"group"===e?"The current URL links to a group, but that group cannot be found,\n or you do not have permission to view the annotations in that group.":"The current URL links to an annotation, but that annotation\n cannot be found, or you do not have permission to view it.":`The ${e} associated with the current URL is unavailable.\n You may need to log in to see it.`}),po("div",{className:"hyp-u-layout-row--justify-right hyp-u-horizontal-spacing",children:[n&&po(bo,{variant:o?"primary":void 0,onClick:()=>r.clearSelection(),children:"Show all annotations"}),!o&&po(bo,{variant:"primary",
|
|
548
548
|
onClick:t,children:"Log in"})]})]})})}var xp=ri((function({loadAnnotationsService:e,onLogin:t}){const n=ii(),r=n.routeParams().id,o=Ki(),i=n.profile().userid,[a,s]=Zr(!1);return Qr((()=>{s(!1),n.clearAnnotations(),e.loadThread(r).then((e=>{const t=e.filter((e=>0===(e.references||[]).length))[0];t&&(e.forEach((e=>n.setExpanded(e.id,!0))),t.id!==r&&n.highlightAnnotations([r]))})).catch((()=>{s(!0)}))}),[r,i,e,n]),po(m,{children:[a&&po(wp,{errorType:"annotation",onLoginRequest:t}),po(bp,{threads:o.children})]})}),["loadAnnotationsService"]);function kp({actionButton:e,additionalCount:t=0,entitySingular:n="annotation",entityPlural:r="annotations",filterQuery:o,focusDisplayName:i,resultCount:a}){return po("div",{className:"FilterStatus",children:ii().isLoading()?po("div",{className:"hyp-u-layout-row--center",children:po(qo,{})}):po("div",{className:"hyp-u-layout-row--align-center",children:[po("div",{className:"FilterStatus__text",children:[a>0&&po("span",{children:"Showing "}),po("span",{className:"filter-facet",
|
|
549
549
|
children:[a>0?a:"No"," ",1===a?n:r]}),o&&po("span",{children:[" ","for"," ",po("span",{className:"filter-facet--pre",children:`'${o}'`})]}),i&&po("span",{children:[" ","by ",po("span",{className:"filter-facet",children:i})]}),t>0&&po("span",{className:"filter-facet--muted",children:[" ","(and ",t," more)"]})]}),po("div",{children:e})]})})}function Sp({filterState:e,rootThread:t}){const n=ii(),r=n.directLinkedAnnotationId(),o=n.annotationCount(),i=(t.children||[]).filter((e=>e.annotation&&e.visible)).length-e.selectedCount,a=!e.focusConfigured&&!r?`Show all (${o})`:"Show all",s=po(bo,{title:a,variant:"primary",onClick:()=>n.clearSelection(),icon:"cancel",children:a});return po(kp,{resultCount:e.selectedCount,additionalCount:i,actionButton:s})}function Cp({filterState:e,rootThread:t}){const n=ii(),r=qi(t)-e.forcedVisibleCount,o=po(bo,{icon:"cancel",variant:"primary",title:"Clear search",onClick:()=>n.clearSelection(),children:"Clear search"});return po(kp,{actionButton:o,additionalCount:e.forcedVisibleCount,
|
|
550
|
-
entitySingular:"result",entityPlural:"results",filterQuery:e.filterQuery,focusDisplayName:e.focusDisplayName,resultCount:r})}function Ap({filterState:e,rootThread:t}){const n=ii(),r=qi(t)-e.forcedVisibleCount,o={};e.forcedVisibleCount>0?(o.onClick=()=>n.clearSelection(),o.title="Reset filters"):(o.onClick=()=>n.toggleFocusMode(),o.title=e.focusActive?"Show all":`Show only ${e.focusDisplayName}`);const i=e.focusActive?e.focusDisplayName:"",a=po(bo,{variant:"primary",...o,children:o.title});return po(kp,{resultCount:r,actionButton:a,additionalCount:e.forcedVisibleCount,filterQuery:e.filterQuery,focusDisplayName:i})}function
|
|
551
|
-
}):a.focusConfigured?po(Ap,{filterState:a,rootThread:e}):null}function
|
|
550
|
+
entitySingular:"result",entityPlural:"results",filterQuery:e.filterQuery,focusDisplayName:e.focusDisplayName,resultCount:r})}function Ap({filterState:e,rootThread:t}){const n=ii(),r=qi(t)-e.forcedVisibleCount,o={};e.forcedVisibleCount>0?(o.onClick=()=>n.clearSelection(),o.title="Reset filters"):(o.onClick=()=>n.toggleFocusMode(),o.title=e.focusActive?"Show all":`Show only ${e.focusDisplayName}`);const i=e.focusActive?e.focusDisplayName:"",a=po(bo,{variant:"primary",...o,children:o.title});return po(kp,{resultCount:r,actionButton:a,additionalCount:e.forcedVisibleCount,filterQuery:e.filterQuery,focusDisplayName:i})}function Ep(){const e=Ki(),t=ii(),n=t.focusState(),r=t.forcedVisibleThreads().length,o=t.filterQuery(),i=t.selectedAnnotations().length,a=no((()=>({filterQuery:o,focusActive:n.active,focusConfigured:n.configured,focusDisplayName:n.displayName,forcedVisibleCount:r,selectedCount:i})),[n,r,o,i]);return a.selectedCount>0?po(Sp,{filterState:a,rootThread:e}):a.filterQuery?po(Cp,{filterState:a,rootThread:e
|
|
551
|
+
}):a.focusConfigured?po(Ap,{filterState:a,rootThread:e}):null}function Tp({onLogin:e}){const t=ii();return po("div",{className:"LoggedOutMessage",children:[po("span",{children:["This is a public annotation created with Hypothesis. ",po("br",{}),"To reply or make your own annotations on this document,"," ",po("a",{className:"LoggedOutMessage__link",href:t.getLink("signup"),target:"_blank",rel:"noopener noreferrer",children:"create a free account"})," ","or"," ",po(wo,{classes:"InlineLinkButton InlineLinkButton--underlined",onClick:e,variant:"dark",children:"log in"}),"."]}),po("div",{className:"LoggedOutMessage__logo",children:po("a",{href:"https://hypothes.is","aria-label":"Hypothesis homepage",title:"Hypothesis homepage",children:po(Mo,{name:"logo",classes:"u-icon--xlarge hyp-u-color--grey-7"})})})]})}function Np(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function Lp(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=function(e,t){
|
|
552
552
|
var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),h=c&&null!=c.left?c.left:.5,d=c&&null!=c.top?c.top:.5,p=c&&null!=c.leftOffset?c.leftOffset:0,m=c&&null!=c.topOffset?c.topOffset:0,f=h,g=d;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-=p,o-=m,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),y=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=y+l*g-t.clientHeight*g,r-=p,o-=m,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 Np(e,r.x,r.y),
|
|
553
|
-
e._scrollSettings=null,t.end("complete");var a=1-t.ease(i);if(Np(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&Lp(t.scrollAncestor),void Lp(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(Lp.bind(null,e))}}function Mp(e){return e.self===e}function zp(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function Op(){return!0}function Ip(e){if(e.assignedSlot)return Ip(e.assignedSlot);if(e.parentElement)return"BODY"===e.parentElement.tagName?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
|
|
553
|
+
e._scrollSettings=null,t.end("complete");var a=1-t.ease(i);if(Np(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&Lp(t.scrollAncestor),void Lp(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}(Lp.bind(null,e))}}function Mp(e){return e.self===e}function zp(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function Op(){return!0}function Ip(e){if(e.assignedSlot)return Ip(e.assignedSlot);if(e.parentElement)return"BODY"===e.parentElement.tagName?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 Rp=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||{}
|
|
554
554
|
;var r=Ip(e),o=1,i=t.validTarget||Op,a=t.isScrollable;t.debug&&(console.log("About to scroll to",e),r||console.error("Target did not have a parent, is it mounted in the DOM?"));for(var s=[];r;)if(t.debug&&console.log("Scrolling parent node",r),i(r,o)&&(a?a(r,zp):zp(r))&&(o++,s.push(r)),!(r=Ip(r))){l("complete");break}return s.reduce(((n,r,o)=>function(e,t,n,r,o){var i,a=!t._scrollSettings,s=t._scrollSettings,l=Date.now(),c={passive:!0};function u(e){t._scrollSettings=null,t.parentElement&&t.parentElement._scrollSettings&&t.parentElement._scrollSettings.end(e),n.debug&&console.log("Scrolling ended with type",e,"for",t),o(e),i&&(t.removeEventListener("touchstart",i,c),t.removeEventListener("wheel",i,c))}s&&s.end("canceled");var h=n.maxSynchronousAlignments;return null==h&&(h=3),t._scrollSettings={startTime:l,endIterations:0,target:e,time:n.time,ease:n.ease,align:n.align,isWindow:n.isWindow||Mp,maxSynchronousAlignments:h,end:u,scrollAncestor:r},"cancellable"in n&&!n.cancellable||(i=u.bind(null,"canceled"),
|
|
555
|
-
t.addEventListener("touchstart",i,c),t.addEventListener("wheel",i,c)),a&&Lp(t),i}(e,r,t,s[o+1],l)),null)}function l(e){--o||n&&n(e)}};function
|
|
555
|
+
t.addEventListener("touchstart",i,c),t.addEventListener("wheel",i,c)),a&&Lp(t),i}(e,r,t,s[o+1],l)),null)}function l(e){--o||n&&n(e)}};function Pp({children:e,icon:t="",panelName:n,title:r,onActiveChanged:o}){const i=ii(),a=i.isSidebarPanelOpen(n),s=to(null),l=to(a);Qr((()=>{l.current!==a&&(l.current=a,a&&Rp(s.current),"function"==typeof o&&o(a))}),[a,o]);const c=ro((()=>{i.toggleSidebarPanel(n,!1)}),[i,n]);return po(Gd,{visible:a,children:po("div",{ref:s,className:"u-sidebar-container",children:po(Ho,{title:r,icon:t,onClose:c,children:e})})})}function Dp({onLogin:e,onSignUp:t}){return ii().isLoggedIn()?null:po(Pp,{icon:"restricted",title:"Login needed",panelName:"loginPrompt",children:[po("p",{children:"Please log in to create annotations or highlights."}),po(So,{children:[po(bo,{title:"Sign up",onClick:t,children:"Sign up"}),po(bo,{title:"Log in",variant:"primary",onClick:e,children:"Log in"})]})]})}function Bp({children:e,count:t,isWaitingToAnchor:n,isSelected:r,label:o,onSelect:i}){const a=()=>{r||i()
|
|
556
556
|
},s=t>0?`${o} (${t} available)`:o;return po(bo,{classes:Ur("u-color-text","SelectionTab",{"is-selected":r}),onClick:a,onMouseDown:a,pressed:!!r,role:"tab",tabIndex:0,title:s,children:po(m,{children:[e,t>0&&!n&&po("span",{className:"u-font--xsmall",style:"position:relative;bottom:3px;left:2px",children:t})]})})}var Fp=ri((function({annotationsService:e,isLoading:t,settings:n}){const r=ii(),o=r.selectedTab(),i=r.noteCount(),a=r.annotationCount(),s=r.orphanCount(),l=r.isWaitingToAnchorAnnotations(),c=e=>{r.clearSelection(),r.selectTab(e)},u="annotation"===o&&0===a&&!l,h="note"===o&&0===i;return po("div",{className:"hyp-u-vertical-spacing--4 SelectionTabs__container",children:[po("div",{className:"hyp-u-layout-row hyp-u-horizontal-spacing--6 SelectionTabs",role:"tablist",children:[po(Bp,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),po(Bp,{count:i,isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),
|
|
557
|
-
children:"Page Notes"}),s>0&&po(Bp,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&po("div",{className:"hyp-u-layout-row--justify-right",children:po(bo,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:ti(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&po(ko,{classes:"u-text--centered",children:po("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&po(ko,{classes:"u-text--centered",children:po("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",po("br",{}),"Create one by selecting some text and clicking the"," ",po(Mo,{classes:"
|
|
558
|
-
;var jp=ri((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){const i=Ki(),a=ii(),s=a.focusedGroupId(),l=a.hasAppliedFilter()||a.hasSelectedAnnotations(),c=a.isLoading(),u=a.isLoggedIn(),h=a.directLinkedAnnotationId(),d=h?a.findAnnotationByID(h):void 0,p=d?ji(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,y=!(c||!h)&&!d,_=a.directLinkedGroupFetchFailed(),b=y||_,w=!b,x=!b&&!l,k=h&&!u&&!y&&!c,S=to(s);Qr((()=>{if(!S.current||S.current!==s){if(S.current){let e=a.focusState().active;a.clearSelection(),e&&a.toggleFocusMode(!0)}S.current=s}s&&m.length&&r.load({groupId:s,uris:m})}),[a,r,s,g,m]),Qr((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return Qr((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),po("div",{children:[po("h2",{className:"u-screen-reader-only",children:"Annotations"}),w&&po(
|
|
559
|
-
onSignUp:n}),y&&po(wp,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),_&&po(wp,{errorType:"group",onLoginRequest:t}),x&&po(Fp,{isLoading:c}),po(bp,{threads:i.children}),k&&po(
|
|
560
|
-
this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString()}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())}}function qp(e){const t=
|
|
561
|
-
|
|
562
|
-
children:
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
className:"
|
|
572
|
-
}),
|
|
573
|
-
|
|
574
|
-
className:Ur("toast-message
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
heading:"
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
}),
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
;
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
;
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
this._searchClient.on("
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
return
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
;const tg=Ff((e=>e.annotations),(e=>e.some(
|
|
557
|
+
children:"Page Notes"}),s>0&&po(Bp,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&po("div",{className:"hyp-u-layout-row--justify-right",children:po(bo,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:ti(["ctaBackgroundColor"],n),children:"New note"})}),!t&&h&&po(ko,{classes:"u-text--centered",children:po("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&po(ko,{classes:"u-text--centered",children:po("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",po("br",{}),"Create one by selecting some text and clicking the"," ",po(Mo,{classes:"m-0.5 inline -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"])
|
|
558
|
+
;var jp=ri((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){const i=Ki(),a=ii(),s=a.focusedGroupId(),l=a.hasAppliedFilter()||a.hasSelectedAnnotations(),c=a.isLoading(),u=a.isLoggedIn(),h=a.directLinkedAnnotationId(),d=h?a.findAnnotationByID(h):void 0,p=d?ji(d):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=d&&!1===d.$orphan?d.$tag:null,y=!(c||!h)&&!d,_=a.directLinkedGroupFetchFailed(),b=y||_,w=!b,x=!b&&!l,k=h&&!u&&!y&&!c,S=to(s);Qr((()=>{if(!S.current||S.current!==s){if(S.current){let e=a.focusState().active;a.clearSelection(),e&&a.toggleFocusMode(!0)}S.current=s}s&&m.length&&r.load({groupId:s,uris:m})}),[a,r,s,g,m]),Qr((()=>{v?(e.focusAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):d&&a.selectTab(p)}),[p,e,d,v,a]);const C=a.hasFetchedProfile();return Qr((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),po("div",{children:[po("h2",{className:"u-screen-reader-only",children:"Annotations"}),w&&po(Ep,{}),po(Dp,{onLogin:t,
|
|
559
|
+
onSignUp:n}),y&&po(wp,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),_&&po(wp,{errorType:"group",onLoginRequest:t}),x&&po(Fp,{isLoading:c}),po(bp,{threads:i.children}),k&&po(Tp,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var Hp=ri((function({api:e,toastMessenger:t}){const n=ii(),r=n.routeParams().q,o=ro((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...yi(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return Qr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),po(bp,{threads:Ki().children})}),["api","toastMessenger"]);class Up{constructor(e,t,n=window){var r,o,i;const a="N/A";let s=a;e.userid&&(s=e.userid,e.displayName&&(s=`${e.displayName} (${s})`)),this.version="1.970.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,
|
|
560
|
+
this.fingerprint=null!==(r=null===(o=t[0])||void 0===o||null===(i=o.metadata)||void 0===i?void 0:i.documentFingerprint)&&void 0!==r?r:a,this.account=s,this.timestamp=(new Date).toString()}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())}}function qp(e){const t=P(e);return!(null==t||!t.authority)&&t.authority!==e.authDomain}function $p({commandName:e,iconName:t}){return po("span",{className:"whitespace-nowrap",children:[po(Mo,{name:t,classes:Ur("mx-1 -mt-1","text-color-text-light inline")}),po("em",{children:e})]})}var Gp=ri((function({settings:e}){const t=!qp(e);return po("ol",{className:"list-decimal pl-10 space-y-2",children:[po("li",{children:["To create an annotation, select text and then select the"," ",po($p,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),po("li",{
|
|
561
|
+
children:["To create a highlight (",po(zo,{href:"https://web.hypothes.is/help/why-are-highlights-private-by-default/",target:"_blank",children:"visible only to you"}),"), select text and then select the"," ",po($p,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&po("li",{children:["To annotate in a private group, select the group from the groups dropdown. Don't see your group? Ask the group creator to send a"," ",po(zo,{href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),po("li",{children:["To reply to an annotation, select the"," ",po($p,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);var Vp=ri((function({toastMessenger:e,versionData:t}){return po("div",{className:"hyp-u-vertical-spacing",children:[po("dl",{className:"VersionInfo",children:[po("dt",{className:"VersionInfo__key",children:"Version"}),po("dd",{className:"VersionInfo__value",children:t.version}),po("dt",{className:"VersionInfo__key",
|
|
562
|
+
children:"User Agent"}),po("dd",{className:"VersionInfo__value",children:t.userAgent}),po("dt",{className:"VersionInfo__key",children:"URL"}),po("dd",{className:"VersionInfo__value",children:t.urls}),po("dt",{className:"VersionInfo__key",children:"Fingerprint"}),po("dd",{className:"VersionInfo__value",children:t.fingerprint}),po("dt",{className:"VersionInfo__key",children:"Account"}),po("dd",{className:"VersionInfo__value",children:t.account}),po("dt",{className:"VersionInfo__key",children:"Date"}),po("dd",{className:"VersionInfo__value",children:t.timestamp})]}),po("div",{className:"hyp-u-layout-row--justify-center",children:po(bo,{onClick:()=>{try{ba(t.asFormattedString()),e.success("Copied version info to clipboard")}catch(t){e.error("Unable to copy version info")}},icon:"copy",children:"Copy version details"})})]})}),["toastMessenger"]);function Wp({linkText:e,url:t}){return po("div",{className:"HelpPanel-tabs__tab",children:po("a",{href:t,
|
|
563
|
+
className:"hyp-u-horizontal-spacing--2 hyp-u-layout-row--center HelpPanel-tabs__link",target:"_blank",rel:"noopener noreferrer",children:[po("span",{children:e})," ",po(Mo,{name:"external",classes:"u-icon--small"})]})})}var Yp=ri((function({auth:e,session:t}){const n=ii(),r=n.frames(),o=n.mainFrame(),i=!!n.profile().preferences.show_sidebar_tutorial,[a,s]=Zr("tutorial"),l=no((()=>{const t=e||{status:"logged-out"},n=[...r].sort(((e,t)=>e===o?-1:t===o?1:0));return new Up(t,n)}),[e,r,o]),c=`https://web.hypothes.is/get-help/?sys_info=${l.asEncodedURLString()}`,u=(e,t)=>{e.preventDefault(),s(t)};return po(Pp,{title:"Help",panelName:"help",onActiveChanged:ro((e=>{!e&&i&&t.dismissSidebarTutorial()}),[t,i]),children:po("div",{className:"hyp-u-vertical-spacing HelpPanel__content",children:[po("div",{className:"hyp-u-layout-row--align-center",children:[po("h3",{className:"HelpPanel__sub-panel-title",children:{tutorial:"Getting started",versionInfo:"About this version"}[a]}),po("div",{
|
|
564
|
+
children:["versionInfo"===a&&po("button",{className:"HelpPanel__sub-panel-navigation-button",onClick:e=>u(e,"tutorial"),"aria-label":"Show tutorial panel",children:["Getting started",po(Mo,{name:"arrow-right"})]}),"tutorial"===a&&po("button",{className:"HelpPanel__sub-panel-navigation-button",onClick:e=>u(e,"versionInfo"),"aria-label":"Show version information panel",children:["About this version",po(Mo,{name:"arrow-right"})]})]})]}),po("div",{className:"HelpPanel__subcontent",children:["tutorial"===a&&po(Gp,{}),"versionInfo"===a&&po(Vp,{versionData:l})]}),po("div",{className:"HelpPanel-tabs",children:[po(Wp,{linkText:"Help topics",url:"https://web.hypothes.is/help/"}),po(Wp,{linkText:"New support ticket",url:c})]})]})})}),["session"]),Kp={exports:{}};function Xp(){}Xp.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){
|
|
565
|
+
for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,a=r.length;i<a;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},Kp.exports=Xp;var Zp=Kp.exports.TinyEmitter=Xp;class Jp extends Error{constructor(e){super(`Results size exceeds ${e}`)}}function Qp(e){return 0===e?50:200}class em extends Zp{constructor(e,{getPageSize:t=Qp,separateReplies:n=!0,incremental:r=!0,maxResults:o=null,sortBy:i="created",sortOrder:a="asc"}={}){super(),this._searchFn=e,this._getPageSize=t,this._separateReplies=n,this._incremental=r,this._maxResults=o,this._sortBy=i,this._sortOrder=a,this._canceled=!1,this._results=[],this._resultCount=null}async _getPage(e,t,n=0){const r=this._getPageSize(n),o={limit:r,sort:this._sortBy,order:this._sortOrder,_separate_replies:this._separateReplies,...e};t&&(o.search_after=t);try{
|
|
566
|
+
const t=await this._searchFn(o);if(this._canceled)return;if(null===this._resultCount&&(this._resultCount=t.total,this.emit("resultCount",this._resultCount)),this._maxResults&&t.total>this._maxResults)return this.emit("error",new Jp(this._maxResults)),void this.emit("end");const i=t.rows.concat(t.replies||[]);this._incremental?this.emit("results",i):this._results=this._results.concat(i);const a=i.length===r,s=i.length>0?i[i.length-1][this._sortBy]:null;a&&s?this._getPage(e,s,n+1):(this._incremental||this.emit("results",this._results),this.emit("end"))}catch(e){if(this._canceled)return;this.emit("error",e),this.emit("end")}}get(e){this._results=[],this._resultCount=null,this._getPage(e)}cancel(){this._canceled=!0,this.emit("end")}}function tm({defaultOption:e,icon:t,onSelect:n,options:r,selectedOption:o,title:i}){const a=[e,...r],s=null!=o?o:e,l=po("span",{className:"FilterSelect__menu-label",children:[t&&po(Mo,{name:t,classes:"u-icon--medium hyp-u-margin--right--3"}),s.display]});return po($d,{label:l,title:i,
|
|
567
|
+
contentClass:"FilterSelect__menu",children:a.map((e=>po(Vd,{onClick:()=>n(e),isSelected:e.value===s.value,label:e.display},e.value)))})}function nm(){const e=ii(),t=e.getFilter("user"),n=function(){const e=ii(),t=e.allAnnotations(),n=e.defaultAuthority(),r=e.isFeatureEnabled("client_display_names"),o=e.getFocusFilters(),i=Jo(e.profile().userid);return no((()=>{const e={};if(t.forEach((t=>{const o=Jo(t.user);e[o]=Kd(t,Qo(t.user,n),r)})),o.user){const t=Jo(o.user.value)||o.user.value;e[t]=o.user.display}const a=Object.keys(e).map((t=>({display:t===i?`${e[t]} (Me)`:e[t],value:t})));return a.sort(((e,t)=>i===e.value?-1:i===t.value?1:e.display.localeCompare(t.display))),a}),[t,i,n,r,o.user])}();return po(tm,{defaultOption:{value:"",display:"Everybody"},icon:"profile",onSelect:t=>e.setFilter("user",t),options:n,selectedOption:t,title:"Filter by user"})}function rm({forcedVisibleCount:e,isFiltered:t,isLoading:n,resultCount:r}){const o=Ki(),i=n?r:qi(o),a=o.children.length>0,s=t&&e>0,l=i-e,c=o.children.length
|
|
568
|
+
;return po("div",{className:"hyp-u-layout-row NotebookResultCount",children:[n&&po(qo,{size:"small"}),!n&&po("h2",{children:[!a&&po("strong",{children:"No results"}),a&&t&&po("strong",{children:[l," ",1===l?"result":"results"]}),a&&!t&&po("strong",{children:[c," ",1===c?"thread":"threads"]})]}),s&&po("h3",{children:["(and ",e," more)"]}),!t&&a&&po("h3",{children:["(",i," ",1===i?"annotation":"annotations",")"]})]})}function om({currentPage:e,onChangePage:t,totalPages:n}){const r=e<n,o=e>1,i=function(e,t,n=5){if(t<=1)return[];const r=new Set([1,e,t]);let o=1;for(;r.size<Math.min(t,n);)e+o<=t&&r.add(e+o),e-o>=1&&r.add(e-o),++o;const i=[];return[...r].sort(((e,t)=>e-t)).forEach(((e,t,n)=>{t>0&&e-n[t-1]>1&&i.push(null),i.push(e)})),i}(e,n),a=(e,n)=>{t(e),null==n||n.blur()};return po("div",{className:"PaginationNavigation",children:[po("div",{className:"PaginationNavigation__relative PaginationNavigation__prev",children:o&&po(bo,{classes:"PaginationPageButton",icon:"arrow-left",title:"Go to previous page",
|
|
569
|
+
onClick:t=>a(e-1,t.target),variant:"dark",children:"prev"})}),po("ul",{className:"PaginationNavigation__pages",children:i.map(((t,n)=>po("li",{children:null===t?po("div",{className:"PaginationNavigation__gap",children:"..."}):po(bo,{classes:"PaginationPageButton",title:`Go to page ${t}`,pressed:t===e,onClick:e=>a(t,e.target),variant:"dark",children:t.toString()},`page-${n}`)},n)))}),po("div",{className:"PaginationNavigation__relative PaginationNavigation__next",children:r&&po(bo,{classes:"PaginationPageButton",icon:"arrow-right",iconPosition:"right",title:"Go to next page",onClick:t=>a(e+1,t.target),variant:"dark",children:"next"})})]})}function im({currentPage:e,isLoading:t,onChangePage:n,threads:r,pageSize:o=25}){const{paginatedThreads:i,totalPages:a}=no((()=>{const t=r.filter((e=>qi(e)>0)),n=(e-1)*o,i=n+o,a=Math.ceil(t.length/o);return{paginatedThreads:t.slice(n,i),totalPages:a}}),[r,e,o]);return po(m,{children:[po(bp,{threads:i}),!t&&po(om,{currentPage:e,onChangePage:n,totalPages:a})]})}
|
|
570
|
+
var am=ri((function({loadAnnotationsService:e,streamer:t}){var n;const r=ii(),o=r.getFilterValues(),i=r.focusedGroup(),a=r.forcedVisibleThreads().length,s=r.hasAppliedFilter(),l=r.isLoading(),c=r.annotationResultCount(),u=r.pendingUpdateCount(),h=Ki(),d=null!==(n=null==i?void 0:i.name)&&void 0!==n?n:"…",p=(null==i?void 0:i.id)||r.directLinkedGroupId(),m=to(1),[f,g]=Zr(1),[v,y]=Zr(!1),_=e=>{e instanceof Jp&&y(!0)},b=r.hasFetchedProfile();Qr((()=>{b&&t.connect({applyUpdatesImmediately:!1})}),[b,t]),Qr((()=>{r.setSortKey("Newest"),p&&e.load({groupId:p,sortBy:"updated",sortOrder:"desc",maxResults:5e3,onError:_,streamFilterBy:"group"})}),[e,p,r]);const w=e=>{g(e)};Qr((()=>{w(1)}),[o,i]);const x=to(null);eo((()=>{f!==m.current&&(Rp(x.current),m.current=f)}),[f]);const k=`Show ${u} new or updated ${u>1?"annotations":"annotation"}`;return po("div",{className:"NotebookView",children:[po("header",{className:"NotebookView__heading",ref:x,children:po("h1",{className:"NotebookView__group-name",children:d})}),po("div",{
|
|
571
|
+
className:"NotebookView__filters",children:po(nm,{})}),po("div",{className:"NotebookView__results hyp-u-layout-row--align-center u-font--large",children:[u>0&&!s&&po(_o,{icon:"refresh",onClick:()=>t.applyPendingUpdates(),variant:"primary",title:k}),po(rm,{forcedVisibleCount:a,isFiltered:s,isLoading:l,resultCount:c})]}),po("div",{className:"NotebookView__items",children:[v&&po("div",{className:"NotebookView__messages",children:po(Ho,{title:"Too many results to show",children:["This preview of the Notebook can show"," ",po("strong",{children:["up to ",5e3," results"]})," at a time (there are"," ",c," to show here)."," ",po("a",{href:"mailto:support@hypothes.is?subject=Hypothesis%20Notebook&body=Please%20notify%20me%20when%20the%20Hypothesis%20Notebook%20is%20updated%20to%20support%20more%20than%205000%20annotations",children:"Contact us"})," ","if you would like to be notified when support for more annotations is available."]})}),po(im,{currentPage:f,isLoading:l,onChangePage:w,threads:h.children})]})]})
|
|
572
|
+
}),["loadAnnotationsService","streamer"]);var sm=ri((function({toastMessenger:e}){const t=ii(),n=t.mainFrame(),r=t.focusedGroup(),o=`Share Annotations in ${r&&r.name||"..."}`,i=r&&n,a=i&&(s=n.uri,l=r.id,ma(s)?`https://hyp.is/go?url=${encodeURIComponent(s)}&group=${l}`:null);var s,l;return po(Pp,{title:o,panelName:"shareGroupAnnotations",children:[!i&&po("div",{className:"flex flex-row items-center justify-center",children:po(qo,{})}),i&&po("div",{className:"text-color-text-light space-y-3",children:a?po(m,{children:[po("div",{className:"text-color-text font-medium","data-testid":"sharing-intro",children:"private"===r.type?po("p",{children:"Use this link to share these annotations with other group members:"}):po("p",{children:"Use this link to share these annotations with anyone:"})}),po("div",{children:po(Vo,{children:[po(Go,{"aria-label":"Use this URL to share these annotations",type:"text",value:a,readOnly:!0}),po(_o,{icon:"copy",onClick:()=>{try{ba(a),e.success("Copied share link to clipboard")}catch(t){
|
|
573
|
+
e.error("Unable to copy link")}},title:"Copy share link",variant:"dark"})]})}),po("p",{"data-testid":"sharing-details",children:["private"===r.type?po("span",{children:["Annotations in the private group"," ",po("em",{children:r.name})," are only visible to group members."]}):po("span",{children:["Anyone using this link may view the annotations in the group"," ",po("em",{children:r.name}),"."]})," ",po("span",{children:["Private (",po(Mo,{name:"lock",classes:"inline -mt-0.5"})," ",po("em",{children:"Only Me"}),") annotations are only visible to you."]})]}),po(xa,{shareURI:a})]}):po("p",{"data-testid":"no-sharing",children:"These annotations cannot be shared because this document is not available on the web."})})]})}),["toastMessenger"]);function lm({message:e,onDismiss:t}){const n=e.type.charAt(0).toUpperCase()+e.type.slice(1),r="notice"===e.type?"cancel":e.type;return po("li",{className:Ur("toast-message-container",{"is-dismissed":e.isDismissed}),onClick:()=>t(e.id),children:po("div",{
|
|
574
|
+
className:Ur("toast-message",`toast-message--${e.type}`),children:[po("div",{className:"toast-message__type",children:po(Mo,{name:r,classes:"toast-message__icon"})}),po("div",{className:"toast-message__message",children:[po("strong",{children:[n,": "]}),e.message,e.moreInfoURL&&po("div",{className:"toast-message__link",children:po("a",{href:e.moreInfoURL,onClick:e=>e.stopPropagation(),target:"_new",children:"More info"})})]})]})})}var cm=ri((function({toastMessenger:e}){return po("div",{children:po("ul",{"aria-live":"polite","aria-relevant":"additions",className:"ToastMessages",children:ii().getToastMessages().map((t=>po(lm,{message:t,onDismiss:t=>e.dismiss(t)},t.id)))})})}),["toastMessenger"]);function um(e){return e.organization&&e.organization.name}function hm(e){const t={};return e.forEach((e=>{if("object"!=typeof e.organization)return;const n="__default__"===(r=e.organization).id?"__default__":`${r.name.toLowerCase()}${r.id}`;var r;void 0===t[n]&&(t[n]=Object.assign({},e.organization),t[n].groups=[]),
|
|
575
|
+
function(e,t){const n=Object.assign({},e),r=t.groups;!r.length&&e.organization.logo&&(n.logo=e.organization.logo),r.push(n)}(e,t[n])})),t}function dm(e){const t=hm(e),n=[],r=[];return Object.keys(t).sort().forEach((e=>{"__default__"===e?n.push(...t[e].groups):r.push(...t[e].groups)})),n.length&&r.push(...n),r}function pm({heading:e,children:t}){return po(m,{children:[e&&po("h2",{className:"MenuSection__heading",children:e}),po("ul",{className:"MenuSection__content",children:x(t).map((e=>po("li",{children:e},e.key)))})]})}var mm=ri((function({isExpanded:e,group:t,groups:n,onExpand:r,toastMessenger:o}){const i=t.links.html,a=i||t.canLeave,s=t.scopes&&!t.scopes.enforced||t.isScopedToUri,l=ii(),c=l.focusedGroupId(),u=t.id===c,h=t=>{t.stopPropagation(),t.preventDefault(),r(!e)},d="private"===t.type?"Copy invite link":"Copy activity link";return po(Vd,{icon:t.logo||"blank",iconAlt:um(t),isDisabled:!s,isExpanded:!!a&&e,isSelected:u,isSubmenuVisible:a?e:void 0,label:t.name,onClick:s?()=>{
|
|
576
|
+
l.clearDirectLinkedGroupFetchFailed(),l.clearDirectLinkedIds(),n.focus(t.id)}:h,onToggleSubmenu:h,submenu:po(m,{children:[po("ul",{children:[i&&po("li",{children:po(Vd,{href:i,icon:"external",isSubmenuItem:!0,label:"View group activity"})}),i&&po("li",{children:po(Vd,{onClick:()=>(e=>{try{ba(e),o.success(`Copied link for "${t.name}"`)}catch(e){o.error("Unable to copy link")}})(i),icon:"copy",isSubmenuItem:!0,label:d})}),t.canLeave&&po("li",{children:po(Vd,{icon:"leave",isSubmenuItem:!0,label:"Leave group",onClick:async()=>{const e=`Are you sure you want to leave the group "${t.name}"?`;await Xo({title:"Leave group?",message:e,confirmAction:"Leave"})&&n.leave(t.id)}})})]}),!s&&po("p",{className:"GroupListItem__footer",children:"This group is restricted to specific URLs."})]})})}),["groups","toastMessenger"]);function fm({expandedGroup:e,onExpandGroup:t,groups:n,heading:r}){return po(pm,{heading:r,children:n.map((n=>po(mm,{isExpanded:n===e,onExpand:e=>t(e?n:null),group:n},n.id)))})}
|
|
577
|
+
var gm=ri((function({settings:e}){const t=ii(),n=t.getCurrentlyViewingGroups(),r=t.getFeaturedGroups(),o=t.getMyGroups(),i=t.focusedGroup(),a=t.profile().userid,s=no((()=>dm(o)),[o]),l=no((()=>dm(r)),[r]),c=no((()=>dm(n)),[n]),u=t.defaultAuthority(),h=a&&!Qo(a,u),d=t.getLink("groups.new"),[p,m]=Zr(null);let f;if(i){const t=i.organization.logo||function(e){const t=P(e);return t&&t.icon?t.icon:null}(e)||"",n=um(i)?um(i):"";f=po("span",{className:"GroupList__menu-label",children:[t&&po("img",{className:"GroupList__menu-icon",src:t,alt:n}),i.name]})}else f=po("span",{children:"…"});return!!qp(e)&&n.length+r.length+o.length<2?f:po($d,{align:"left",contentClass:"GroupList__content",label:f,onOpenChanged:()=>m(null),title:i?`Select group (now viewing: ${i.name})`:"Select group",children:[c.length>0&&po(fm,{expandedGroup:p,onExpandGroup:m,heading:"Currently Viewing",groups:c}),l.length>0&&po(fm,{expandedGroup:p,onExpandGroup:m,heading:"Featured Groups",groups:l}),s.length>0&&po(fm,{expandedGroup:p,onExpandGroup:m,
|
|
578
|
+
heading:"My Groups",groups:s}),h&&po(Vd,{icon:"add",href:d,label:"New private group"})]})}),["settings"]);function vm({alwaysExpanded:e,query:t,onSearch:n}){const r=ii().isLoading(),o=to(),[i,a]=Zr(t),[s,l]=Zr(t);return t!==i&&(l(t),a(t)),po("form",{action:"#",className:"SearchInput__form",name:"searchForm",onSubmit:e=>{e.preventDefault(),(o.current.value||i)&&n(o.current.value)},children:[po("input",{"aria-label":"Search",className:Ur("SearchInput__input",{"is-expanded":e||t}),dir:"auto",type:"text",name:"query",placeholder:r?"Loading…":"Search…",disabled:r,ref:o,value:s||"",onInput:e=>l(e.target.value)}),!r&&po("div",{className:"SearchInput__button-container",children:po(_o,{icon:"search",onClick:()=>o.current.focus(),size:"small",title:"Search annotations"})}),r&&po("div",{style:"margin:0.5em 0",children:po(qo,{size:"small"})})]})}function ym(){const e=ii(),t=e.sortKey(),n=e.sortKeys().map((n=>po(Vd,{label:n,onClick:()=>e.setSortKey(n),isSelected:n===t},n))),r=po("span",{className:"TopBar__menu-label",
|
|
579
|
+
children:po(Mo,{name:"sort",classes:"TopBar__menu-icon"})});return po("div",{className:"SortMenu",children:po($d,{label:r,title:`Sort by ${t}`,align:"right",menuIndicator:!1,children:n})})}var _m=ri((function({router:e}){return po(vm,{query:ii().routeParams().q,onSearch:t=>{e.navigate("stream",{q:t})},alwaysExpanded:!0})}),["router"]);var bm=ri((function({auth:e,frameSync:t,onLogout:n,settings:r}){const o=ii(),i=o.defaultAuthority(),a=Qo(e.userid,i),s=P(r),l=o.isFeatureEnabled("notebook_launch"),[c,u]=Zr(!1),h=e=>s&&!!s[e],d=!a||h("onProfileRequestProvided"),p=!a||h("onLogoutRequestProvided"),m=()=>{t.notifyHost("openNotebook",o.focusedGroupId())},f=()=>a&&t.notifyHost("profileRequested"),g=(()=>{const t={};return d&&(a||(t.href=o.getLink("user",{user:e.username})),t.onClick=f),t})(),v=po("span",{className:"TopBar__menu-label",children:po(Mo,{name:"profile",classes:"TopBar__menu-icon"})});return po("div",{className:"UserMenu",onKeyDown:e=>{"n"===e.key&&(m(),u(!1))},children:po($d,{label:v,title:e.displayName,
|
|
580
|
+
align:"right",open:c,onOpenChanged:u,children:[po(pm,{children:[po(Vd,{label:e.displayName,isDisabled:!d,...g}),!a&&po(Vd,{label:"Account settings",href:o.getLink("account.settings")}),l&&po(Vd,{label:"Open notebook",onClick:()=>m()})]}),p&&po(pm,{children:po(Vd,{label:"Log out",onClick:n})})]})})}),["frameSync","settings"]);var wm=ri((function({auth:e,frameSync:t,isSidebar:n,onLogin:r,onLogout:o,onSignUp:i,settings:a,streamer:s}){const l=!qp(a),c=ti(["accentColor"],a),u=ii(),h=u.filterQuery(),d=u.pendingUpdateCount(),p=u.isSidebarPanelOpen("help"),f=u.isSidebarPanelOpen("shareGroupAnnotations"),g=()=>{const e=P(a);e&&e.onHelpRequestProvided?t.notifyHost("helpRequested"):u.toggleSidebarPanel("help")},v=po(m,{children:["unknown"===e.status&&po("span",{className:"TopBar__login-links",children:"⋯"}),"logged-out"===e.status&&po("span",{className:"TopBar__login-links u-font--large hyp-u-horizontal-spacing--2",children:[po(wo,{classes:"InlineLinkButton",onClick:i,style:c,variant:"primary",children:"Sign up"
|
|
581
|
+
}),po("div",{children:"/"}),po(wo,{classes:"InlineLinkButton",onClick:r,style:c,variant:"primary",children:"Log in"})]}),"logged-in"===e.status&&po(bm,{auth:e,onLogout:o})]});return po("div",{className:"TopBar",children:[!n&&po("div",{className:"TopBar__inner content",children:[po(_m,{}),po("div",{className:"hyp-u-stretch"}),po(_o,{icon:"help",expanded:p,onClick:g,size:"small",title:"Help"}),v]}),n&&po("div",{className:"TopBar__inner content",children:[po(gm,{}),po("div",{className:"hyp-u-stretch"}),d>0&&po(_o,{icon:"refresh",onClick:()=>s.applyPendingUpdates(),size:"small",variant:"primary",title:`Show ${d} new/updated ${1===d?"annotation":"annotations"}`}),po(vm,{query:h||null,onSearch:u.setFilterQuery}),po(ym,{}),l&&po(_o,{icon:"share",expanded:f,onClick:()=>{u.toggleSidebarPanel("shareGroupAnnotations")},size:"small",title:"Share annotations on this page"}),po(_o,{icon:"help",expanded:p,onClick:g,size:"small",title:"Help"}),v]})]})}),["frameSync","settings","streamer"])
|
|
582
|
+
;var xm=ri((function({auth:e,frameSync:t,settings:n,session:r,toastMessenger:o}){const i=ii(),a=i.hasFetchedProfile(),s=i.profile(),l=i.route(),c=no((()=>a?function(e){const t=Zo(e.userid);if(t&&e.userid){let n=t.username;return e.user_info&&e.user_info.display_name&&(n=e.user_info.display_name),{status:"logged-in",displayName:n,userid:e.userid,username:t.username}}return{status:"logged-out"}}(s):{status:"unknown"}),[a,s]),u=no((()=>ti(["appBackgroundColor"],n)),[n]),h="clean"===n.theme,d="sidebar"===l;Qr((()=>{(function(e,t,n){const r="object"==typeof t.preferences&&!!t.preferences.show_sidebar_tutorial,o=P(n)||{onHelpRequestProvided:!1};return e&&!o.onHelpRequestProvided&&r})(d,s,n)&&i.openSidebarPanel("help")}),[d,s,n,i]);const p=async()=>{if(P(n))t.notifyHost("loginRequested");else try{await e.login(),i.closeSidebarPanel("loginPrompt"),i.clearGroups(),r.reload()}catch(e){o.error(e.message)}},m=()=>{P(n)?t.notifyHost("signupRequested"):window.open(i.getLink("signup"))};return po("div",{
|
|
583
|
+
className:Ur("HypothesisApp","js-thread-list-scroll-root",{"theme-clean":h,"HypothesisApp--notebook":"notebook"===l}),style:u,children:["notebook"!==l&&po(wm,{auth:c,onLogin:p,onSignUp:m,onLogout:async()=>{await(async()=>{const e=i.countDrafts();if(0===e)return!0;let t="";return 1===e?t="You have an unsaved annotation.\nDo you really want to discard this draft?":e>1&&(t="You have "+e+" unsaved annotations.\nDo you really want to discard these drafts?"),Xo({title:"Discard drafts?",message:t,confirmAction:"Discard"})})()&&(i.clearGroups(),i.removeAnnotations(i.unsavedAnnotations()),i.discardAllDrafts(),P(n)?t.notifyHost("logoutRequested"):r.logout())},isSidebar:d}),po("div",{className:"HypothesisApp__content",children:[po(cm,{}),po(Yp,{auth:"logged-in"===c.status?c:{}}),po(sm,{}),l&&po("main",{children:["annotation"===l&&po(xp,{onLogin:p}),"notebook"===l&&po(am,{}),"stream"===l&&po(Hp,{}),"sidebar"===l&&po(jp,{onLogin:p,onSignUp:m})]})]})]})}),["auth","frameSync","session","settings","toastMessenger"])
|
|
584
|
+
;function km({error:e}){return po("div",{className:"LaunchErrorPanel",children:po(Ho,{title:"Unable to start Hypothesis",children:e.message})})}class Sm{constructor(e,t){this._api=e,this._store=t}_applyDraftChanges(e){const t={},n=this._store.getDraft(e);return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?fa(e.user):ga(e.user,e.group)),{...e,...t}}_initialize(e,t=new Date){const n=this._store.getDefault("annotationPrivacy"),r=this._store.focusedGroupId(),o=this._store.profile();if(!r)throw new Error("Cannot create annotation without a group");const i=o.userid,a=o.user_info,s="s:"+q(8),l=Object.assign({created:t.toISOString(),group:r,permissions:va(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:a,$tag:s,hidden:!1,links:{},document:{title:""}},e);return Ni(l)&&(l.permissions=fa(i)),l}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),Ni(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!Ci(n)}),
|
|
585
|
+
Mi(n)?this._store.selectTab("note"):zi(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){const e=this._store.mainFrame();if(!this._store.isLoggedIn())return void this._store.openSidebarPanel("loginPrompt");if(!e)return;const t={target:[],uri:e.uri};this.create(t)}async delete(e){await this._api.annotation.delete({id:e.id}),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:Ci(e)?ga(t,e.group):fa(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e){let t;const n=this._applyDraftChanges(e);let r;t=Si(e)?this._api.annotation.create({},n):this._api.annotation.update({id:e.id},n),this._store.annotationSaveStarted(e);try{r=await t}finally{this._store.annotationSaveFinished(e)}return Object.keys(e).forEach((t=>{"$"===t[0]&&(r[t]=e[t])})),
|
|
586
|
+
this._store.removeDraft(e),this._store.addAnnotations([r]),r}}Sm.$inject=["api","store"];class Cm extends Error{constructor(e,t,n=""){let r="Network request failed";t&&(r+=` (${t.status})`),n&&(r+=`: ${n}`),super(r),this.url=e,this.response=t,this.reason=n}}async function Am(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Cm(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){throw new Cm(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Cm(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Em(e,t){const n={};for(const r in t)if(t.hasOwnProperty(r)){const o=t[r],i=":"+r;-1!==e.indexOf(i)?e=e.replace(i,encodeURIComponent(String(o))):n[r]=o}return{url:e,unusedParams:n}}function Tm(e){const t={};for(const n in e)e.hasOwnProperty(n)&&"$"!==n[0]&&(t[n]=e[n]);return t}class Nm{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>function(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){
|
|
587
|
+
return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;return t.split(".").forEach((e=>{n=n[e]})),n}(o,t),u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.970.0"};l&&(u.Authorization="Bearer "+l);const h=r();h&&(u["X-Client-Id"]=h);const{url:d,unusedParams:p}=Em(c.url,a),m=new URL(d);for(let[e,t]of Object.entries(p)){Array.isArray(t)||(t=[t]);for(let n of t)null!=n&&m.searchParams.append(e,n.toString())}return await Am(m.toString(),{body:s?JSON.stringify(Tm(s)):null,headers:u,method:c.method})}finally{i()}}}(r,e,{getAccessToken:t.getAccessToken,getClientId:o,onRequestStarted:n.apiRequestStarted,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={
|
|
588
|
+
list:i("groups.read")},this.profile={groups:{read:i("profile.groups.read")},read:i("profile.read"),update:i("profile.update")}}setClientId(e){this._clientId=e}}Nm.$inject=["apiRoutes","auth","store"];var Lm={};function Mm(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,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var zm=Mm;Mm.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Mm.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Mm.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime()
|
|
589
|
+
;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),this._options.unref&&this._timer.unref(),!0},Mm.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)},Mm.prototype.try=function(e){
|
|
590
|
+
console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Mm.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Mm.prototype.start=Mm.prototype.try,Mm.prototype.errors=function(){return this._errors},Mm.prototype.attempts=function(){return this._attempts},Mm.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=zm;e.operation=function(n){var r=e.timeouts(n);return new t(r,{forever:n&&(n.forever||n.retries===1/0),unref:n&&n.unref,maxRetryTime:n&&n.maxRetryTime})},e.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var n in e)t[n]=e[n];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],o=0;o<t.retries;o++)r.push(this.createTimeout(o,t))
|
|
591
|
+
;return e&&e.forever&&!r.length&&r.push(this.createTimeout(o,t)),r.sort((function(e,t){return e-t})),r},e.createTimeout=function(e,t){var n=t.randomize?Math.random()+1:1,r=Math.round(n*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return r=Math.min(r,t.maxTimeout)},e.wrap=function(t,n,r){if(n instanceof Array&&(r=n,n=null),!r)for(var o in r=[],t)"function"==typeof t[o]&&r.push(o);for(var i=0;i<r.length;i++){var a=r[i],s=t[a];t[a]=function(r){var o=e.operation(n),i=Array.prototype.slice.call(arguments,1),a=i.pop();i.push((function(e){o.retry(e)||(e&&(arguments[0]=o.mainError()),a.apply(this,arguments))})),o.attempt((function(){r.apply(t,i)}))}.bind(t,s),t[a].options=n}}}(Lm);var Om=Lm;function Im(e,t){return new Promise(((n,r)=>{const o=Om.operation(t);o.attempt((async()=>{try{const t=await e();o.retry(),n(t)}catch(e){o.retry(e)||r(e)}}))}))}function Rm(e){return Im((()=>Am(e)))}class Pm{constructor(e){this._apiUrl=e.apiUrl,this._routeCache=null,this._linkCache=null}routes(){
|
|
592
|
+
return this._routeCache||(this._routeCache=Rm(this._apiUrl).then((e=>e.links))),this._routeCache}links(){return this._linkCache||(this._linkCache=this.routes().then((e=>Rm(e.links.url)))),this._linkCache}}Pm.$inject=["settings"];class Dm extends Error{constructor(e,t){super(e),this.cause=t}}class Bm{constructor(e){this.clientId=e.clientId,this.tokenEndpoint=e.tokenEndpoint,this.authorizationEndpoint=e.authorizationEndpoint,this.revokeEndpoint=e.revokeEndpoint}exchangeAuthCode(e){return this._getAccessToken({client_id:this.clientId,grant_type:"authorization_code",code:e})}exchangeGrantToken(e){return this._getAccessToken({grant_type:"urn:ietf:params:oauth:grant-type:jwt-bearer",assertion:e})}refreshToken(e){return this._getAccessToken({grant_type:"refresh_token",refresh_token:e})}async revokeToken(e){try{await this._formPost(this.revokeEndpoint,{token:e})}catch(e){throw new Dm("Failed to revoke access token",e)}}authorize(e,t){const n=q(16),r=new Promise(((t,r)=>{e.addEventListener("message",(function o(i){
|
|
593
|
+
"object"==typeof i.data&&i.data.state===n&&("authorization_response"===i.data.type&&t(i.data),"authorization_canceled"===i.data.type&&r(new Error("Authorization window was closed")),e.removeEventListener("message",o))}))})),o=new URL(this.authorizationEndpoint);return o.searchParams.set("client_id",this.clientId),o.searchParams.set("origin",e.location.origin),o.searchParams.set("response_mode","web_message"),o.searchParams.set("response_type","code"),o.searchParams.set("state",n),t.location=o.toString(),r.then((e=>e.code))}async _formPost(e,t){const n=new URLSearchParams;for(let[e,r]of Object.entries(t))n.set(e,r);n.sort();return Am(e,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:n.toString()})}async _getAccessToken(e){let t;try{t=await this._formPost(this.tokenEndpoint,e)}catch(e){throw new Dm("Failed to fetch access token",e)}return{accessToken:t.access_token,expiresAt:Date.now()+1e3*(t.expires_in-10),refreshToken:t.refresh_token}}static openAuthPopupWindow(e){
|
|
594
|
+
const t=`left=${e.screen.width/2-237.5},top=${e.screen.height/2-215},width=475,height=430`,n=e.open("about:blank","Log in to Hypothesis",t);if(!n)throw new Error("Failed to open login window");return n}}class Fm extends Zp{constructor(e,t,n,r,o){let i,a,s;super();const l=(c="token",u=r.apiUrl,new URL(c,u).href);var c,u;function h(){let e=new URL(r.apiUrl).hostname;return e=e.replace(/\./g,"%2E"),`hypothesis.oauth.${e}.token`}function d(e){n.setObject(h(),e)}const p=async()=>{if(s)return s;const e=await t.links();return s=new Bm({clientId:r.oauthClientId,authorizationEndpoint:e["oauth.authorize"],revokeEndpoint:e["oauth.revoke"],tokenEndpoint:l}),s},m=()=>{var e;return null===(e=P(r))||void 0===e?void 0:e.grantToken},f=async()=>{if(!a){const e=m();void 0!==e?a=e?p().then((t=>t.exchangeGrantToken(e))).catch((e=>{var t;throw t="You must reload the page to annotate.",o.error(`Hypothesis login lost: ${t}`,{autoDismiss:!1}),e})):Promise.resolve(null):i?(a=(async e=>{const t=await p(),n=await t.exchangeAuthCode(e)
|
|
595
|
+
;return d(n),n})(i),i=null):a=Promise.resolve(function(){const e=n.getObject(h());return e&&"string"==typeof e.accessToken&&"string"==typeof e.refreshToken&&"number"==typeof e.expiresAt?{accessToken:e.accessToken,refreshToken:e.refreshToken,expiresAt:e.expiresAt}:null}())}const e=a,t=await a;if(!t)return null;if(e!==a)return f();if(Date.now()>t.expiresAt){const e=m();return a=(async(e,t)=>{const n=await p();let r;try{if(r=await n.refreshToken(e),Date.now()>r.expiresAt)throw new Error("Refreshed token expired in the past")}catch{return null}return t.persist&&d(r),r})(t.refreshToken,{persist:void 0===e}),f()}return t.accessToken};(()=>{e.addEventListener("storage",(({key:e})=>{e===h()&&(a=null,this.emit("oauthTokensChanged"))}))})(),this.login=async function(){const t=Bm.openAuthPopupWindow(e),n=await p(),r=await n.authorize(e,t);i=r,a=null},this.logout=async function(){const[e,t]=await Promise.all([a,p()]);e&&await t.revokeToken(e.accessToken),a=Promise.resolve(null),n.removeItem(h())},this.getAccessToken=f}}
|
|
596
|
+
Fm.$inject=["$window","apiRoutes","localStorage","settings","toastMessenger"];class jm{constructor(e,t){this._annotationsService=e,this._store=t,this._saving=new Set,this._failed=new Set}init(){const e=e=>!this._saving.has(e)&&!this._failed.has(e);this._store.subscribe((()=>{this._store.newHighlights().forEach((t=>{const n=t.$tag;e(n)&&(this._saving.add(n),Im((()=>this._annotationsService.save(t))).catch((()=>{this._failed.add(n)})).finally((()=>{this._saving.delete(n)})))}))}))}isSaving(){return this._saving.size>0}}jm.$inject=["annotationsService","store"];var Hm=function(e,t,n,r){var o=n?n.call(r,e,t):void 0;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var i=Object.keys(e),a=Object.keys(t);if(i.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(t),l=0;l<i.length;l++){var c=i[l];if(!s(c))return!1;var u=e[c],h=t[c];if(!1===(o=n?n.call(r,u,h,c):void 0)||void 0===o&&u!==h)return!1}return!0};function Um(e,t,n){
|
|
597
|
+
const r=Array.isArray(t),o=()=>r?t.map((e=>e())):t();let i=o();return e((()=>{const e=o();if(r?Hm(e,i):e===i)return;const t=i;i=e,n(e,t)}))}class qm{constructor(e,t){this._frameSync=e,this._store=t}init(){const e=()=>this._store.profile().features;Um(this._store.subscribe,[e,()=>this._store.frames()],(()=>{this._frameSync.notifyHost("featureFlagsUpdated",e()||{})}))}}function $m(e,t){return!!function(e){if(null===e||"object"!=typeof e)return!1;for(let t of["frame1","frame2","type"])if("string"!=typeof e[t])return!1;return!0}(e)&&JSON.stringify(e,Object.keys(t).sort())===JSON.stringify(t,Object.keys(t).sort())}qm.$inject=["frameSync","store"];class Gm{constructor({hostFrame:e,source:t}){this._hostFrame=e,this._source=t,this._listeners=new ha}destroy(){this._listeners.removeAll()}async discover(e){let t=!1;if(("guest"===this._source&&"host"===e||"guest"===this._source&&"sidebar"===e||"sidebar"===this._source&&"host"===e||"notebook"===this._source&&"sidebar"===e)&&(t=!0),
|
|
598
|
+
!t)throw new Error("Invalid request of channel/port");return new Promise(((t,n)=>{const r=()=>{this._hostFrame.postMessage({frame1:this._source,frame2:e,type:"request"},"*")},o=setInterval(r,250),i=setTimeout((()=>{clearInterval(o),n(new Error(`Unable to establish ${this._source}-${e} communication channel`))}),2e4),a=this._listeners.add(window,"message",(n=>{const{data:r,ports:s}=n;$m(r,{frame1:this._source,frame2:e,type:"offer"})&&(clearInterval(o),clearTimeout(i),this._listeners.remove(a),t(s[0]))}));r()}))}}class Vm{constructor(){this._port=null,this._methods=new Map,this._sequence=1,this._callbacks=new Map,this._listeners=new ha,this._pendingCalls=[]}on(e,t){if(this._port)throw new Error("Cannot add a method handler after a port is connected");this._methods.set(e,t)}connect(e){this._port=e,this._listeners.add(e,"message",(e=>this._handle(e))),e.start();for(let[e,t]of this._pendingCalls)this.call(e,...t);this._pendingCalls=[]}destroy(){var e;this._destroyed=!0,this._listeners.removeAll(),
|
|
599
|
+
null===(e=this._port)||void 0===e||e.close()}call(e,...t){if(this._port||this._pendingCalls.push([e,t]),!this._port||this._destroyed)return;const n=this._sequence++,r=t[t.length-1];"function"==typeof r&&(this._callbacks.set(n,r),t=t.slice(0,-1));const o={arguments:t,method:e,protocol:"frame-rpc",sequence:n,version:"1.0.0"};this._port.postMessage(o)}_parseMessage({data:e}){return e&&"object"==typeof e?"frame-rpc"!==e.protocol||"1.0.0"!==e.version?null:Array.isArray(e.arguments)?e:null:null}_handle(e){const t=this._parseMessage(e),n=this._port;if(t&&n)if("method"in t){const e=this._methods.get(t.method);if(!e)return;const r=(...e)=>{const r={arguments:e,protocol:"frame-rpc",response:t.sequence,version:"1.0.0"};n.postMessage(r)};e(...t.arguments,r)}else if("response"in t){const e=this._callbacks.get(t.response);this._callbacks.delete(t.response),e&&e(...t.arguments)}}}function Wm({$tag:e,target:t,uri:n}){return{$tag:e,target:t,uri:n}}class Ym{constructor(e,t,n){this._window=e,this._annotationsService=t,
|
|
600
|
+
this._store=n,this._portFinder=new Gm({hostFrame:this._window.parent,source:"sidebar"}),this._listeners=new ha,this._hostRPC=new Vm,this._guestRPC=[],this._inFrame=new Set,this._highlightsVisible=!1,this._setupSyncToGuests(),this._setupHostEvents()}_setupSyncToGuests(){let e=0;Um(this._store.subscribe,[()=>this._store.allAnnotations(),()=>this._store.frames()],(([t,n],[r])=>{let o=0;const i=new Set,a=[];t.forEach((e=>{ki(e)||(Ci(e)&&++o,i.add(e.$tag),this._inFrame.has(e.$tag)||a.push(e))}));const s=r.filter((e=>!i.has(e.$tag)));a.length>0&&(this._guestRPC.forEach((e=>e.call("loadAnnotations",a.map(Wm)))),a.forEach((e=>{this._inFrame.add(e.$tag)}))),s.forEach((e=>{this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag))),this._inFrame.delete(e.$tag)})),n.length>0&&n.every((e=>e.isAnnotationFetchComplete))&&(0!==o&&o===e||(this._hostRPC.call("publicAnnotationCountChanged",o),e=o))}))}_connectGuest(e){const t=new Vm;t.on("documentInfoChanged",(e=>{this._store.connectFrame({id:e.frameIdentifier,
|
|
601
|
+
metadata:e.metadata,uri:e.uri})})),t.on("createAnnotation",(e=>{if(!this._store.isLoggedIn())return this._hostRPC.call("openSidebar"),this._store.openSidebarPanel("loginPrompt"),void this._guestRPC.forEach((t=>t.call("deleteAnnotation",e.$tag)));this._inFrame.add(e.$tag),e.$highlight||this._hostRPC.call("openSidebar"),this._hostRPC.call("showHighlights"),this._annotationsService.create(e)}));let n={};const r=ua((()=>{this._store.updateAnchorStatus(n),n={}}),10);t.on("syncAnchoringStatus",(({$tag:e,$orphan:t})=>{this._inFrame.add(e),n[e]=t?"orphan":"anchored",r()})),t.on("showAnnotations",(e=>{this._store.selectAnnotations(this._store.findIDsForTags(e)),this._store.selectTab("annotation")})),t.on("focusAnnotations",(e=>{this._store.focusAnnotations(e||[])})),t.on("toggleAnnotationSelection",(e=>{this._store.toggleSelectedAnnotations(this._store.findIDsForTags(e))})),t.on("openSidebar",(()=>{this._hostRPC.call("openSidebar")})),t.on("closeSidebar",(()=>{this._hostRPC.call("closeSidebar")})),
|
|
602
|
+
this._guestRPC.push(t),t.connect(e),t.call("setHighlightsVisible",this._highlightsVisible)}_setupHostEvents(){this._hostRPC.on("sidebarOpened",(()=>{this._store.setSidebarOpened(!0)})),this._hostRPC.on("frameDestroyed",(e=>{const t=this._store.frames().find((t=>t.id===e));t&&this._store.destroyFrame(t)})),this._hostRPC.on("setHighlightsVisible",(e=>{this._highlightsVisible=e,this._guestRPC.forEach((t=>t.call("setHighlightsVisible",e)))}))}async connect(){const e=await this._portFinder.discover("host");this._hostRPC.connect(e),this._hostRPC.call("ready"),this._listeners.add(e,"message",(e=>{const{data:t,ports:n}=e;$m(t,{frame1:"guest",frame2:"sidebar",type:"offer"})&&this._connectGuest(n[0])}))}notifyHost(e,...t){this._hostRPC.call(e,...t)}focusAnnotations(e){this._store.focusAnnotations(e),this._guestRPC.forEach((t=>t.call("focusAnnotations",e)))}scrollToAnnotation(e){this._guestRPC.forEach((t=>t.call("scrollToAnnotation",e)))}destroy(){this._portFinder.destroy(),this._listeners.removeAll()}}function Km(e){
|
|
603
|
+
return Object.keys(e).reduce(((e,t)=>(e[t]=t,e)),{})}Ym.$inject=["$window","annotationsService","store"];const Xm={id:"__default__",name:"__DEFAULT__",logo:"data:image/svg+xml;utf8,"+encodeURIComponent(Yo)};const Zm=["organization","scopes"];class Jm{constructor(e,t,n,r,o,i){this._store=e,this._api=t,this._auth=n,this._settings=o,this._toastMessenger=i,this._serviceConfig=P(o),this._reloadSetUp=!1}_mainURI(){var e,t;return null!==(e=null===(t=this._store.mainFrame())||void 0===t?void 0:t.uri)&&void 0!==e?e:null}async _filterGroups(e,t,n,r){if(r){const t=e.find((e=>e.id===r));t&&!t.isScopedToUri&&t.scopes&&t.scopes.enforced&&(e=e.filter((e=>e.id!==r)),this._store.setDirectLinkedGroupFetchFailed(),r=null)}if(t)return e;const o=e.some((e=>"__world__"!==e.id&&e.isScopedToUri));return o?"__world__"===r||"__world__"===n?e:e.filter((e=>"__world__"!==e.id)):e}_setupAutoReload(){this._reloadSetUp||(this._reloadSetUp=!0,Um(this._store.subscribe,(()=>this._mainURI()),(()=>{this.load()})),
|
|
604
|
+
Um(this._store.subscribe,[()=>this._store.hasFetchedProfile(),()=>this._store.profile().userid],((e,[t])=>{t&&this.load()})))}_addGroupsToStore(e,t){!function(e){e.forEach((e=>{e.organization&&"object"==typeof e.organization||(e.organization=Xm)}))}(e);const n=0===this._store.allGroups().length,r=this._store.getDefault("focusedGroup");this._store.loadGroups(e),n&&(t&&e.some((e=>e.id===t))?this.focus(t):r&&e.some((e=>e.id===r))&&this.focus(r))}_fetchGroup(e){return this._api.group.read({id:e,expand:Zm})}async _loadGroupsForUserAndDocument(){var e;const t=()=>function(e,t){const n=t(e);return null!==n?Promise.resolve(n):new Promise((n=>{const r=e.subscribe((()=>{const o=t(e);null!==o&&(r(),n(o))}))}))}(this._store,(()=>this._mainURI()));let n=null;"sidebar"===this._store.route()&&(n=await t()),this._setupAutoReload();const r=this._store.directLinkedAnnotationId();let o=null;r&&(o=this._api.annotation.get({id:r}).catch((()=>null)));const i=this._store.directLinkedGroupId();let a=null
|
|
605
|
+
;i&&(a=this._fetchGroup(i).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),null))));const s={expand:Zm},l=null===(e=this._serviceConfig)||void 0===e?void 0:e.authority;l&&(s.authority=l),n&&(s.document_uri=n);const[c,u,h,d,p]=await Promise.all([this._api.profile.groups.read({expand:Zm}),this._api.groups.list(s),this._auth.getAccessToken(),o,a]);p&&!u.some((e=>e.id===p.id))&&u.push(p);let m=null;if(d){m=d.group;const e=c.concat(u).find((e=>e.id===d.group));if(!e)try{const e=await this._fetchGroup(d.group);u.push(e)}catch(e){this._toastMessenger.error("Unable to fetch group for linked annotation")}}const f=null!==h,g=await this._filterGroups(J(c,u,n,this._settings),f,m,i),v=m||i||null;return this._addGroupsToStore(g,v),g}async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:Zm});let n;const r=async e=>{try{return await this._fetchGroup(e)}catch(e){return n=e,null}
|
|
606
|
+
},o=await Promise.all(e.map((e=>t.find((t=>t.id===e||t.groupid===e))||r(e)))),i=o.filter((e=>null!==e)),a=this._store.directLinkedGroupId();return this._addGroupsToStore(i,a),n&&this._toastMessenger.error(`Unable to fetch groups: ${n.message}`,{autoDismiss:!1}),i}async load(){var e;if(null!==(e=this._serviceConfig)&&void 0!==e&&e.groups){let e=[];try{e=await this._serviceConfig.groups}catch(e){this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(e)}return this._loadGroupsForUserAndDocument()}focus(e){const t=this._store.focusedGroupId();this._store.focusGroup(e);const n=this._store.focusedGroupId();if(t!==n&&null!==t&&n){const e=this._store.newAnnotations().filter((e=>!ki(e))).map((e=>({...e,group:n})));e.length&&this._store.addAnnotations(e),this._store.setDefault("focusedGroup",n)}}leave(e){return this._api.group.member.delete({pubid:e,userid:"me"})}}Jm.$inject=["store","api","auth","session","settings","toastMessenger"];class Qm{
|
|
607
|
+
constructor(e,t,n,r){this._api=e,this._store=t,this._streamer=n,this._streamFilter=r,this._searchClient=null}load({groupId:e,uris:t,onError:n,maxResults:r,sortBy:o,sortOrder:i,streamFilterBy:a="uri"}){if(this._store.removeAnnotations(this._store.savedAnnotations()),this._searchClient&&this._searchClient.cancel(),"group"===a)this._streamFilter.resetFilter().addClause("/group","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()});else t&&t.length>0&&(this._streamFilter.resetFilter().addClause("/uri","one_of",t),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}));const s={incremental:!0,separateReplies:!1,maxResults:r,sortBy:o,sortOrder:i};this._searchClient=new em(this._api.search,s),this._searchClient.on("resultCount",(e=>{this._store.setAnnotationResultCount(e)})),this._searchClient.on("results",(e=>{e.length&&this._store.addAnnotations(e)})),this._searchClient.on("error",(e=>{"function"==typeof n?n(e):console.error(e)})),
|
|
608
|
+
this._searchClient.on("end",(()=>{this._searchClient=null,t&&t.length>0&&this._store.frames().forEach((e=>{t.indexOf(e.uri)>=0&&this._store.updateFrameAnnotationFetchStatus(e.uri,!0)})),this._store.annotationFetchFinished()})),this._store.annotationFetchStarted(),this._searchClient.get({group:e,uri:t})}async loadThread(e){let t,n;this._store.clearAnnotations();try{this._store.annotationFetchStarted(),t=await this._api.annotation.get({id:e}),ki(t)&&(t=await this._api.annotation.get({id:t.references[0]})),n=await this._api.search({references:t.id})}finally{this._store.annotationFetchFinished()}const r=[t,...n.rows];if(this._store.addAnnotations(r),!ki(t)){const e=t.id;this._streamFilter.addClause("/references","one_of",e,!0).addClause("/id","equals",e,!0),this._streamer.setConfig("filter",{filter:this._streamFilter.getFilter()}),this._streamer.connect()}return r}}Qm.$inject=["api","store","streamer","streamFilter"];class ef{constructor(){this._store={}}getItem(e){return e in this._store?this._store[e]:null}
|
|
609
|
+
setItem(e,t){this._store[e]=t}removeItem(e){delete this._store[e]}}class tf{constructor(e){let t="hypothesis.testKey";try{this._storage=e.localStorage,e.localStorage.setItem(t,t),e.localStorage.getItem(t),e.localStorage.removeItem(t)}catch(e){this._storage=new ef}}getItem(e){return this._storage.getItem(e)}getObject(e){const t=this._storage.getItem(e);return t?JSON.parse(t):null}setItem(e,t){this._storage.setItem(e,t)}setObject(e,t){const n=JSON.stringify(t);this._storage.setItem(e,n)}removeItem(e){this._storage.removeItem(e)}}tf.$inject=["$window"];const nf={annotationPrivacy:"hypothesis.privacy",focusedGroup:"hypothesis.groups.focus"};class rf{constructor(e,t){this._storage=e,this._store=t}init(){Object.keys(nf).forEach((e=>{const t=this._storage.getItem(nf[e]);this._store.setDefault(e,t)})),Um(this._store.subscribe,(()=>this._store.getDefaults()),((e,t)=>{for(let n in e)t[n]!==e[n]&&n in nf&&this._storage.setItem(nf[n],e[n])}))}}rf.$inject=["localStorage","store"];class of{constructor(e,t){this._window=e,
|
|
610
|
+
this._store=t,this._didRegisterPopstateListener=!1}currentRoute(){const e=this._window.location.pathname.slice(1).split("/"),t=new URLSearchParams(this._window.location.search),n={};for(let[e,r]of t)n[e]=r;"client"===e[0]&&e.shift();let r;switch(e[0].replace(/\.html$/,"")){case"a":r="annotation",n.id=e[1]||"";break;case"notebook":r="notebook";break;case"stream":r="stream";break;default:r="sidebar"}return{route:r,params:n}}routeUrl(e,t={}){let n;const r={...t};switch(e){case"annotation":{const e=t.id;delete r.id,n=`/a/${e}`}break;case"notebook":n="/notebook";break;case"stream":n="/stream";break;default:throw new Error(`Cannot generate URL for route "${e}"`)}let o=!1;const i=new URLSearchParams;for(let[e,t]of Object.entries(r))o=!0,i.set(e,t);return o&&(n+="?"+i.toString()),n}sync(){const{route:e,params:t}=this.currentRoute();this._store.changeRoute(e,t),this._didRegisterPopstateListener||(this._window.addEventListener("popstate",(()=>{this.sync()})),this._didRegisterPopstateListener=!0)}navigate(e,t){
|
|
611
|
+
this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}of.$inject=["$window","store"];class af{constructor(e,t){this._apiRoutes=e,this._store=t}async init(){try{const e=await this._apiRoutes.links();this._store.updateLinks(e)}catch(e){console.warn(`Failed to fetch Hypothesis links: ${e.message}`)}}}af.$inject=["apiRoutes","store"];class sf{constructor(e,t,n,r,o){var i,a;this._api=t,this._auth=n,this._store=e,this._toastMessenger=o,this._authority=null!==(i=null===(a=P(r))||void 0===a?void 0:a.authority)&&void 0!==i?i:null,this._lastLoad=null,this._lastLoadTime=null,n.on("oauthTokensChanged",(()=>this.reload()))}load(){return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=Im((()=>{const e=this._authority?{authority:this._authority}:{};return this._api.profile.read(e)})).then((e=>(this.update(e),this._lastLoadTime=Date.now(),e))).catch((e=>{throw this._lastLoadTime=null,e}))),this._lastLoad}async dismissSidebarTutorial(){
|
|
612
|
+
const e=await this._api.profile.update({},{preferences:{show_sidebar_tutorial:!1}});this.update(e)}update(e){const t=this._store.profile(),n=e.userid!==t.userid;return this._store.updateProfile(e),this._lastLoad=Promise.resolve(e),this._lastLoadTime=Date.now(),n&&(e.userid?Cr({id:e.userid}):Cr(null)),e}async logout(){try{return await this._auth.logout(),this.reload()}catch(e){throw this._toastMessenger.error("Log out failed"),new Error(e)}}reload(){return this._lastLoad=null,this._lastLoadTime=null,this.load()}}sf.$inject=["store","api","auth","settings","toastMessenger"];class lf{constructor(){this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}}}addClause(e,t,n,r=!1){return this._filter.clauses.push({field:e,operator:t,value:n,case_sensitive:r}),this}getFilter(){return this._filter}resetFilter(){return this._filter={match_policy:"include_any",clauses:[],actions:{create:!0,update:!0,delete:!0}},this}}class cf extends Zp{constructor(e){super();const t=[];let n
|
|
613
|
+
;const r=()=>{for(;t.length>0;){const e=JSON.stringify(t.shift());n.send(e)}};this.close=()=>{n.close(1e3)},this.send=e=>{t.push(e),this.isConnected()&&r()},this.isConnected=()=>n.readyState===WebSocket.OPEN,(()=>{n=new WebSocket(e),n.onopen=e=>{r(),this.emit("open",e)},n.onclose=e=>{if(1e3===e.code||1001===e.code)return void this.emit("close",e);const t=new Error(`WebSocket closed abnormally, code: ${e.code}`);console.warn(t),this.emit("disconnect")},n.onerror=e=>{this.emit("error",e)},n.onmessage=e=>{this.emit("message",e)}})()}}class uf{constructor(e,t,n,r,o){this._auth=t,this._groups=n,this._session=r,this._store=e,this._websocketURL=o.websocketUrl,this.clientId=q(32),this._socket=null,this._updateImmediately=!0,this._configMessages={},this._reconnectionAttempts=0,this._reconnectSetUp=!1}applyPendingUpdates(){const e=Object.values(this._store.pendingUpdates());e.length&&this._store.addAnnotations(e);const t=Object.keys(this._store.pendingDeletions()).map((e=>({id:e})))
|
|
614
|
+
;t.length&&this._store.removeAnnotations(t),this._store.clearPendingUpdates()}_handleSocketError(e){K("Error connecting to H push notification service:",e);const t=new URL(this._websocketURL).hostname;-1!==["localhost","127.0.0.1"].indexOf(t)&&K("Check that your H service is configured to allow WebSocket connections from "+window.location.origin)}_handleSocketMessage(e){const t=JSON.parse(e.data);if(t)if("annotation-notification"===t.type){const e=t.payload;switch(t.options.action){case"create":case"update":case"past":this._store.receiveRealTimeUpdates({updatedAnnotations:e});break;case"delete":this._store.receiveRealTimeUpdates({deletedAnnotations:e})}this._updateImmediately&&this.applyPendingUpdates()}else if("session-change"===t.type)this._session.update(t.model),this._groups.load();else if("whoyouare"===t.type){const e=this._store.profile().userid;t.userid!==e&&console.warn('WebSocket user ID "%s" does not match logged-in ID "%s"',t.userid,e)}else K("Received unsupported notification",t.type)}
|
|
615
|
+
_sendClientConfig(e){Object.keys(this._configMessages).forEach((t=>{this._configMessages[t]&&e.send(this._configMessages[t])}))}setConfig(e,t){var n;this._configMessages[e]=t,null!==(n=this._socket)&&void 0!==n&&n.isConnected()&&this._socket.send(t)}async _reconnect(){var e;if(!this._websocketURL)return;let t,n;null===(e=this._socket)||void 0===e||e.close();try{t=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(t){const e=new URL(this._websocketURL);e.searchParams.set("access_token",t),n=e.toString()}else n=this._websocketURL;const r=new cf(n);r.on("open",(()=>{this._reconnectionAttempts=0,this._sendClientConfig(r)})),r.on("disconnect",(()=>{if(++this._reconnectionAttempts,this._reconnectionAttempts<10){const e=1e3*2**this._reconnectionAttempts;setTimeout((()=>this._reconnect()),e)}else console.error("Gave up trying to reconnect to Hypothesis real time update service")})),r.on("error",(e=>this._handleSocketError(e))),
|
|
616
|
+
r.on("message",(e=>this._handleSocketMessage(e))),this._socket=r,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,Um(this._store.subscribe,(()=>this._store.profile().userid),(()=>{this._reconnect()}))),this._socket||await this._reconnect()}}uf.$inject=["store","auth","groups","session","settings"];class hf{constructor(e){this._storage=e}filter(e,t=null){const n=this._storage.getObject("hypothesis.user.tags.list")||[];let r=0;return n.filter((n=>{if(null!==t&&r>=t)return!1;const o=n.split(/\W+/),i=new RegExp(`^${Z(e)}`,"i");return!(!o.some((e=>e.match(i)))&&!n.match(i))&&(++r,!0)}))}store(e){const t=this._storage.getObject("hypothesis.user.tags.map")||{};e.forEach((e=>{t[e]?(t[e].count+=1,t[e].updated=Date.now()):t[e]={text:e,count:1,updated:Date.now()}})),
|
|
617
|
+
this._storage.setObject("hypothesis.user.tags.map",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("hypothesis.user.tags.list",n)}}hf.$inject=["localStorage"];class df{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),e.visible||this._store.setForcedVisible(e.id,!0)}}df.$inject=["store"];class pf{constructor(e){this._store=e}dismiss(e){const t=this._store.getToastMessage(e);t&&!t.isDismissed&&(this._store.updateToastMessage({...t,isDismissed:!0}),setTimeout((()=>{this._store.removeToastMessage(e)}),500))}_addMessage(e,t,{autoDismiss:n=!0,moreInfoURL:r=""}={}){if(this._store.hasToastMessage(e,t))return;const o=q(10),i={type:e,id:o,message:t,moreInfoURL:r};this._store.addToastMessage({isDismissed:!1,...i}),n&&setTimeout((()=>{this.dismiss(o)}),5e3)}error(e,t){this._addMessage("error",e,t)}success(e,t){this._addMessage("success",e,t)}notice(e,t){this._addMessage("notice",e,t)}}
|
|
618
|
+
function mf(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ff(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function gf(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?ff(Object(n),!0).forEach((function(t){mf(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):ff(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function vf(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}pf.$inject=["store"];var yf="function"==typeof Symbol&&Symbol.observable||"@@observable",_f=function(){
|
|
619
|
+
return Math.random().toString(36).substring(7).split("").join(".")},bf={INIT:"@@redux/INIT"+_f(),REPLACE:"@@redux/REPLACE"+_f(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+_f()}};function wf(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}function xf(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(vf(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(vf(1));return n(xf)(e,t)}if("function"!=typeof e)throw new Error(vf(2));var o=e,i=t,a=[],s=a,l=!1;function c(){s===a&&(s=a.slice())}function u(){if(l)throw new Error(vf(3));return i}function h(e){if("function"!=typeof e)throw new Error(vf(4));if(l)throw new Error(vf(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(vf(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}
|
|
620
|
+
function d(e){if(!wf(e))throw new Error(vf(7));if(void 0===e.type)throw new Error(vf(8));if(l)throw new Error(vf(9));try{l=!0,i=o(i,e)}finally{l=!1}for(var t=a=s,n=0;n<t.length;n++){(0,t[n])()}return e}function p(e){if("function"!=typeof e)throw new Error(vf(10));o=e,d({type:bf.REPLACE})}function m(){var e,t=h;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(vf(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[yf]=function(){return this},e}return d({type:bf.INIT}),(r={dispatch:d,subscribe:h,getState:u,replaceReducer:p})[yf]=m,r}function kf(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++){var o=t[r];"function"==typeof e[o]&&(n[o]=e[o])}var i,a=Object.keys(n);try{!function(e){Object.keys(e).forEach((function(t){var n=e[t];if(void 0===n(void 0,{type:bf.INIT}))throw new Error(vf(12));if(void 0===n(void 0,{type:bf.PROBE_UNKNOWN_ACTION()}))throw new Error(vf(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i
|
|
621
|
+
;for(var r=!1,o={},s=0;s<a.length;s++){var l=a[s],c=n[l],u=e[l],h=c(u,t);if(void 0===h)throw t&&t.type,new Error(vf(14));o[l]=h,r=r||h!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}function Sf(e,t){return function(){return t(e.apply(this,arguments))}}function Cf(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return 0===t.length?function(e){return e}:1===t.length?t[0]:t.reduce((function(e,t){return function(){return e(t.apply(void 0,arguments))}}))}function Af(e){return function(t){var n=t.dispatch,r=t.getState;return function(t){return function(o){return"function"==typeof o?o(n,r,e):t(o)}}}}var Ef=Af();Ef.withExtraArgument=Af;var Tf=Ef;function Nf(e,t=[],n=[]){const r={},o={},i={};e.forEach((e=>{e.namespace?(r[e.namespace]=e.initialState(...t),o[e.namespace]=function(e){return(t={},n)=>{const r=e[n.type];if(!r)return t;const o=r(t,n);return Array.isArray(o)?o:{...t,...o}}}(e.reducers),i[e.namespace]={selectors:e.selectors,rootSelectors:e.rootSelectors||{}
|
|
622
|
+
}):console.warn("Store module does not specify a namespace",e)}));const a=function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return function(e){return function(){var n=e.apply(void 0,arguments),r=function(){throw new Error(vf(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=Cf.apply(void 0,i)(n.dispatch),gf(gf({},n),{},{dispatch:r})}}}(...[Tf],...n);const s=xf(kf(o),r,a),l=Object.assign({},...e.map((e=>e.actionCreators))),c=function(e,t){if("function"==typeof e)return Sf(e,t);if("object"!=typeof e||null===e)throw new Error(vf(16));var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=Sf(o,t))}return n}(l,s.dispatch),u=function(e,t){const n={};return Object.keys(e).forEach((r=>{const{selectors:o,rootSelectors:i={}}=e[r];Object.keys(o).forEach((e=>{if(n[e])throw new Error(`Duplicate selector "${e}"`);n[e]=(...n)=>o[e](t()[r],...n)})),Object.keys(i).forEach((e=>{
|
|
623
|
+
if(n[e])throw new Error(`Duplicate selector "${e}"`);n[e]=(...n)=>i[e](t(),...n)}))})),n}(i,s.getState);return Object.assign(s,c,u),s}function Lf(e,t){if(!(e instanceof Function)){const t=e;e=()=>t}return{initialState:e,...t}}function Mf(e){let t=0;return function(n){return function(r){if(!window.debug)return void n(r);++t;const o=r.type+" ("+t.toString()+")";console.group(o),console.log("Prev State:",e.getState()),console.log("Action:",r),n(r),console.log("Next State:",e.getState()),console.groupEnd()}}}const zf={API_REQUEST_STARTED:e=>({...e,activeApiRequests:e.activeApiRequests+1}),API_REQUEST_FINISHED(e){if(0===e.activeApiRequests)throw new Error("API_REQUEST_FINISHED action when no requests were active");return{...e,activeApiRequests:e.activeApiRequests-1}},ANNOTATION_SAVE_STARTED(e,t){let n=[];t.annotation.$tag&&!e.activeAnnotationSaveRequests.includes(t.annotation.$tag)&&n.push(t.annotation.$tag);const r=e.activeAnnotationSaveRequests.concat(n);return{...e,activeAnnotationSaveRequests:r}},
|
|
624
|
+
ANNOTATION_SAVE_FINISHED(e,t){const n=e.activeAnnotationSaveRequests.filter((e=>e!==t.annotation.$tag));return{...e,activeAnnotationSaveRequests:n}},ANNOTATION_FETCH_STARTED:e=>({...e,activeAnnotationFetches:e.activeAnnotationFetches+1}),ANNOTATION_FETCH_FINISHED(e){if(0===e.activeAnnotationFetches)throw new Error("ANNOTATION_FETCH_FINISHED action when no annotation fetches were active");return{...e,hasFetchedAnnotations:!0,activeAnnotationFetches:e.activeAnnotationFetches-1}},SET_ANNOTATION_RESULT_COUNT:(e,t)=>({annotationResultCount:t.resultCount})},Of=Km(zf);var If=Lf({activeAnnotationSaveRequests:[],activeApiRequests:0,activeAnnotationFetches:0,hasFetchedAnnotations:!1,annotationResultCount:null},{reducers:zf,namespace:"activity",actionCreators:{annotationFetchStarted:function(){return{type:Of.ANNOTATION_FETCH_STARTED}},annotationFetchFinished:function(){return{type:Of.ANNOTATION_FETCH_FINISHED}},annotationSaveStarted:function(e){return{type:Of.ANNOTATION_SAVE_STARTED,annotation:e}},
|
|
625
|
+
annotationSaveFinished:function(e){return{type:Of.ANNOTATION_SAVE_FINISHED,annotation:e}},apiRequestStarted:function(){return{type:Of.API_REQUEST_STARTED}},apiRequestFinished:function(){return{type:Of.API_REQUEST_FINISHED}},setAnnotationResultCount:function(e){return{type:Of.SET_ANNOTATION_RESULT_COUNT,resultCount:e}}},selectors:{hasFetchedAnnotations:function(e){return e.hasFetchedAnnotations},isLoading:function(e){return e.activeApiRequests>0||!e.hasFetchedAnnotations},isFetchingAnnotations:function(e){return e.activeAnnotationFetches>0},isSavingAnnotation:function(e,t){return!!t.$tag&&e.activeAnnotationSaveRequests.includes(t.$tag)},annotationResultCount:function(e){return e.annotationResultCount}}});var Rf=function(e,t){return e===t};function Pf(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?Rf:i,s=o.maxSize,l=void 0===s?1:s,c=o.resultEqualityCheck,u=function(e){return function(t,n){if(null===t||null===n||t.length!==n.length)return!1
|
|
626
|
+
;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(a),h=1===l?(n=u,{get:function(e){return r&&n(r.key,e)?r.value:"NOT_FOUND"},put:function(e,t){r={key:e,value:t}},getEntries:function(){return r?[r]:[]},clear:function(){r=void 0}}):function(e,t){var n=[];function r(e){var r=n.findIndex((function(n){return t(e,n.key)}));if(r>-1){var o=n[r];return r>0&&(n.splice(r,1),n.unshift(o)),o.value}return"NOT_FOUND"}return{get:r,put:function(t,o){"NOT_FOUND"===r(t)&&(n.unshift({key:t,value:o}),n.length>e&&n.pop())},getEntries:function(){return n},clear:function(){n=[]}}}(l,u);function d(){var t=h.get(arguments);if("NOT_FOUND"===t){if(t=e.apply(null,arguments),c){var n=h.getEntries(),r=n.find((function(e){return c(e.value,t)}));r&&(t=r.value)}h.put(arguments,t)}return t}return d.clearCache=function(){return h.clear()},d}function Df(e){var t=Array.isArray(e[0])?e[0]:e;if(!t.every((function(e){return"function"==typeof e}))){var n=t.map((function(e){
|
|
627
|
+
return"function"==typeof e?"function "+(e.name||"unnamed")+"()":typeof e})).join(", ");throw new Error("createSelector expects all input-selectors to be functions, but received the following types: ["+n+"]")}return t}function Bf(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];var o=function(){for(var t=arguments.length,r=new Array(t),o=0;o<t;o++)r[o]=arguments[o];var i,a=0,s={memoizeOptions:void 0},l=r.pop();if("object"==typeof l&&(s=l,l=r.pop()),"function"!=typeof l)throw new Error("createSelector expects an output function after the inputs, but received: ["+typeof l+"]");var c=s,u=c.memoizeOptions,h=void 0===u?n:u,d=Array.isArray(h)?h:[h],p=Df(r),m=e.apply(void 0,[function(){return a++,l.apply(null,arguments)}].concat(d)),f=e((function(){for(var e=[],t=p.length,n=0;n<t;n++)e.push(p[n].apply(null,arguments));return i=m.apply(null,e)}));return Object.assign(f,{resultFunc:l,memoizedResultFunc:m,dependencies:p,lastResult:function(){return i},recomputations:function(){
|
|
628
|
+
return a},resetRecomputations:function(){return a=0}}),f};return o}var Ff=Bf(Pf);function jf(e,t){return e.reduce(((e,n)=>t(n)?e+1:e),0)}function Hf(e){const t={};return e.forEach((e=>t[e]=!0)),t}function Uf(e){return Object.keys(e).filter((t=>!0===e[t]))}const qf={CHANGE_ROUTE:(e,{name:t,params:n})=>({name:t,params:n})},$f=Km(qf);var Gf=Lf({name:null,params:{}},{namespace:"route",reducers:qf,actionCreators:{changeRoute:function(e,t={}){return{type:$f.CHANGE_ROUTE,name:e,params:t}}},selectors:{route:function(e){return e.name},routeParams:function(e){return e.params}}});function Vf(e,t){return e.find((e=>e.id===t))}function Wf(e,t){return e.find((e=>e.$tag===t))}const Yf={ADD_ANNOTATIONS:function(e,t){const n={},r={},o=[],i=[],a=[];let s=e.nextTag;return t.annotations.forEach((t=>{let i;t.id&&(i=Vf(e.annotations,t.id)),!i&&t.$tag&&(i=Wf(e.annotations,t.$tag)),i?(a.push(Object.assign({},i,t)),t.id&&(n[t.id]=!0),i.$tag&&(r[i.$tag]=!0)):(o.push(function(e,t){let n=e.$orphan;return e.id||(n=!1),
|
|
629
|
+
Object.assign({},e,{$anchorTimeout:!1,$tag:e.$tag||t,$orphan:n})}(t,"t"+s)),++s)})),e.annotations.forEach((e=>{n[e.id]||r[e.$tag]||i.push(e)})),{annotations:o.concat(a).concat(i),nextTag:s}},CLEAR_ANNOTATIONS:function(){return{annotations:[],focused:{},highlighted:{}}},FOCUS_ANNOTATIONS:function(e,t){return{focused:Hf(t.focusedTags)}},HIDE_ANNOTATION:function(e,t){return{annotations:e.annotations.map((e=>e.id!==t.id?e:{...e,hidden:!0}))}},HIGHLIGHT_ANNOTATIONS:function(e,t){return{highlighted:t.highlighted}},REMOVE_ANNOTATIONS:function(e,t){return{annotations:[...t.remainingAnnotations]}},UNHIDE_ANNOTATION:function(e,t){return{annotations:e.annotations.map((e=>e.id!==t.id?e:Object.assign({},e,{hidden:!1})))}},UPDATE_ANCHOR_STATUS:function(e,t){return{annotations:e.annotations.map((e=>{if(!t.statusUpdates.hasOwnProperty(e.$tag))return e;const n=t.statusUpdates[e.$tag];return"timeout"===n?Object.assign({},e,{$anchorTimeout:!0}):Object.assign({},e,{$orphan:"orphan"===n})}))}},UPDATE_FLAG_STATUS:function(e,t){
|
|
630
|
+
return{annotations:e.annotations.map((e=>{if(e.id&&e.id===t.id){if(e.flagged===t.isFlagged)return e;const n=Object.assign({},e,{flagged:t.isFlagged});if(n.moderation){const r=t.isFlagged?1:-1;n.moderation=Object.assign({},e.moderation,{flagCount:e.moderation.flagCount+r})}return n}return e}))}}},Kf=Km(Yf);function Xf(e){return(t,n)=>{const r=function(e,t){const n={},r={};return t.forEach((e=>{e.id&&(n[e.id]=!0),e.$tag&&(r[e.$tag]=!0)})),e.filter((e=>!(e.id&&e.id in n||e.$tag&&e.$tag in r)))}(n().annotations.annotations,e);t({type:Kf.REMOVE_ANNOTATIONS,annotationsToRemove:e,remainingAnnotations:r})}}function Zf(e){return{type:Kf.UPDATE_ANCHOR_STATUS,statusUpdates:e}}const Jf=Ff((e=>e.annotations),(e=>jf(e,zi)));const Qf=Ff((e=>e.focused),(e=>Uf(e))),eg=Ff((e=>e.highlighted),(e=>Uf(e)))
|
|
631
|
+
;const tg=Ff((e=>e.annotations),(e=>e.some(Ei))),ng=Ff((e=>e.annotations),(e=>e.filter((e=>Si(e)&&!Ni(e))))),rg=Ff((e=>e.annotations),(e=>e.filter((e=>Si(e)&&Ni(e))))),og=Ff((e=>e.annotations),(e=>jf(e,Mi))),ig=Ff((e=>e.annotations),(e=>jf(e,Li)));var ag=Lf({annotations:[],focused:{},highlighted:{},nextTag:1},{namespace:"annotations",reducers:Yf,actionCreators:{addAnnotations:function(e){return function(t,n){const r=e.filter((e=>!Vf(n().annotations.annotations,e.id)));if(t({type:Kf.ADD_ANNOTATIONS,annotations:e,currentAnnotationCount:n().annotations.annotations.length}),"sidebar"!==Gf.selectors.route(n().route))return;const o=r.filter(Ei).map((e=>e.id));o.length>0&&setTimeout((()=>{const e=n().annotations.annotations,r=o.map((t=>Vf(e,t))).filter((e=>e&&Ei(e))).reduce(((e,t)=>(e[t.$tag]="timeout",e)),{});t(Zf(r))}),500)}},clearAnnotations:function(){return{type:Kf.CLEAR_ANNOTATIONS}},focusAnnotations:function(e){return{type:Kf.FOCUS_ANNOTATIONS,focusedTags:e}},hideAnnotation:function(e){return{
|
|
632
632
|
type:Kf.HIDE_ANNOTATION,id:e}},highlightAnnotations:function(e){return{type:Kf.HIGHLIGHT_ANNOTATIONS,highlighted:Hf(e)}},removeAnnotations:Xf,unhideAnnotation:function(e){return{type:Kf.UNHIDE_ANNOTATION,id:e}},updateAnchorStatus:Zf,updateFlagStatus:function(e,t){return{type:Kf.UPDATE_FLAG_STATUS,id:e,isFlagged:t}}},selectors:{allAnnotations:function(e){return e.annotations},annotationCount:Jf,annotationExists:function(e,t){return e.annotations.some((e=>e.id===t))},findAnnotationByID:function(e,t){return Vf(e.annotations,t)},findIDsForTags:function(e,t){const n=[];return t.forEach((t=>{const r=Wf(e.annotations,t);r&&r.id&&n.push(r.id)})),n},focusedAnnotations:Qf,highlightedAnnotations:eg,isAnnotationFocused:function(e,t){return!0===e.focused[t]},isWaitingToAnchorAnnotations:tg,newAnnotations:ng,newHighlights:rg,noteCount:og,orphanCount:ig,savedAnnotations:function(e){return e.annotations.filter((e=>!Si(e)))}}});const sg={SET_DEFAULT:function(e,t){return{[t.defaultKey]:t.value}}},lg=Km(sg);var cg=Lf({
|
|
633
633
|
annotationPrivacy:null,focusedGroup:null},{namespace:"defaults",reducers:sg,actionCreators:{setDefault:function(e,t){return{type:lg.SET_DEFAULT,defaultKey:e,value:t}}},selectors:{getDefault:function(e,t){return e[t]},getDefaults:function(e){return e}}});const ug={UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED:(e,t)=>({directLinkedGroupFetchFailed:t.directLinkedGroupFetchFailed}),UPDATE_DIRECT_LINKED_GROUP_ID:(e,t)=>({directLinkedGroupId:t.directLinkedGroupId}),UPDATE_DIRECT_LINKED_ANNOTATION_ID:(e,t)=>({directLinkedAnnotationId:t.directLinkedAnnotationId}),CLEAR_DIRECT_LINKED_IDS:()=>({directLinkedAnnotationId:null,directLinkedGroupId:null}),CLEAR_SELECTION:function(){return{directLinkedAnnotationId:null,directLinkedGroupId:null,directLinkedGroupFetchFailed:!1}}},hg=Km(ug);var dg=Lf((function(e){return{directLinkedGroupId:e.group||null,directLinkedAnnotationId:e.annotations||null,directLinkedGroupFetchFailed:!1}}),{namespace:"directLinked",reducers:ug,actionCreators:{setDirectLinkedGroupFetchFailed:function(){
|
|
634
634
|
return{type:hg.UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED,directLinkedGroupFetchFailed:!0}},setDirectLinkedGroupId:function(e){return{type:hg.UPDATE_DIRECT_LINKED_GROUP_ID,directLinkedGroupId:e}},setDirectLinkedAnnotationId:function(e){return{type:hg.UPDATE_DIRECT_LINKED_ANNOTATION_ID,directLinkedAnnotationId:e}},clearDirectLinkedGroupFetchFailed:function(){return{type:hg.UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED,directLinkedGroupFetchFailed:!1}},clearDirectLinkedIds:function(){return{type:hg.CLEAR_DIRECT_LINKED_IDS}}},selectors:{directLinkedAnnotationId:function(e){return e.directLinkedAnnotationId},directLinkedGroupFetchFailed:function(e){return e.directLinkedGroupFetchFailed},directLinkedGroupId:function(e){return e.directLinkedGroupId}}});class pg{constructor(e,t){this.annotation={id:e.id,$tag:e.$tag},this.isPrivate=t.isPrivate,this.tags=t.tags,this.text=t.text}match(e){return this.annotation.$tag&&e.$tag===this.annotation.$tag||this.annotation.id&&e.id===this.annotation.id}isEmpty(){
|
|
635
635
|
return!this.text&&0===this.tags.length}}const mg={DISCARD_ALL_DRAFTS:function(){return[]},REMOVE_DRAFT:function(e,t){return e.filter((e=>!e.match(t.annotation)))},UPDATE_DRAFT:function(e,t){const n=e.filter((e=>!e.match(t.draft.annotation)));return n.push(t.draft),n}},fg=Km(mg);function gg(e){return{type:fg.REMOVE_DRAFT,annotation:e}}function vg(e,t){const n=e;for(let e=0;e<n.length;e++){const r=n[e];if(r.match(t))return r}return null}function yg(e,t){const n=vg(e,t);return n?n.isEmpty()?null:n:null}const _g=Ff((e=>e),(e=>e.filter((e=>!e.annotation.id)).map((e=>e.annotation))));var bg=Lf([],{namespace:"drafts",reducers:mg,actionCreators:{createDraft:function(e,t){return{type:fg.UPDATE_DRAFT,draft:new pg(e,t)}},deleteNewAndEmptyDrafts:function(){return(e,t)=>{const n=t().drafts.filter((e=>Si(e.annotation)&&!yg(t().drafts,e.annotation))).map((t=>(e(gg(t.annotation)),t.annotation)));e(Xf(n))}},discardAllDrafts:function(){return{type:fg.DISCARD_ALL_DRAFTS}},removeDraft:gg},selectors:{countDrafts:function(e){
|
|
636
636
|
return e.length},getDraft:vg,getDraftIfNotEmpty:yg,unsavedAnnotations:_g}});function wg(e){var t,n;return!!(null!==(t=e.user)&&void 0!==t&&t.username||null!==(n=e.user)&&void 0!==n&&n.userid)}function xg(e){if(!wg(e))return{};const t=e.user.username||e.user.userid||"";return{user:{value:t,display:e.user.displayName||t}}}const kg={CHANGE_FOCUS_MODE_USER:function(e,t){return{focusActive:wg({user:t.user}),focusFilters:xg({user:t.user})}},SET_FILTER:function(e,t){var n;const r={...e.filters,[t.filterName]:t.filterOption};return""===(null===(n=t.filterOption)||void 0===n?void 0:n.value)&&delete r[t.filterName],{filters:r}},SET_FILTER_QUERY:function(e,t){return{query:t.query}},SET_FOCUS_MODE:function(e,t){var n;return{focusActive:null!==(n=t.active)&&void 0!==n?n:!e.focusActive}},CLEAR_SELECTION:function(){return{filters:{},focusActive:!1,query:null}}},Sg=Km(kg);const Cg=Ff((e=>e.focusActive),(e=>e.focusFilters),((e,t)=>{var n;return{active:e,configured:!(null==t||!t.user),
|
|
637
|
-
displayName:(null==t||null===(n=t.user)||void 0===n?void 0:n.display)||""}})),Ag=Ff((e=>e.filters),(e=>e.focusActive),(e=>e.focusFilters),((e,t,n)=>t?{...n,...e}:{...e}));const
|
|
638
|
-
return e.focusFilters},hasAppliedFilter:function(e){return!(!e.query&&!Object.keys(Ag(e)).length)}}});const Ng={CONNECT_FRAME:function(e,t){return[...e,t.frame]},DESTROY_FRAME:function(e,t){return e.filter((e=>e!==t.frame))},UPDATE_FRAME_ANNOTATION_FETCH_STATUS:function(e,t){return e.map((e=>e.uri&&e.uri===t.uri?Object.assign({},e,{isAnnotationFetchComplete:t.isAnnotationFetchComplete}):e))}},Lg=Km(Ng);const Mg=Ff((e=>e),(e=>e.find((e=>!e.id))||null));const zg=Bf(
|
|
639
|
-
type:Lg.UPDATE_FRAME_ANNOTATION_FETCH_STATUS,isAnnotationFetchComplete:t,uri:e}}},selectors:{frames:function(e){return e},mainFrame:Mg,searchUris:zg}});const Ig={features:{},preferences:{},userid:null};const
|
|
637
|
+
displayName:(null==t||null===(n=t.user)||void 0===n?void 0:n.display)||""}})),Ag=Ff((e=>e.filters),(e=>e.focusActive),(e=>e.focusFilters),((e,t,n)=>t?{...n,...e}:{...e}));const Eg=Ff((e=>Ag(e)),(e=>{const t={};return Object.keys(e).forEach((n=>t[n]=e[n].value)),t}));var Tg=Lf((function(e){const t=e.focus||{};return{filters:{},focusActive:wg(t),focusFilters:xg(t),query:e.query||null}}),{namespace:"filters",reducers:kg,actionCreators:{changeFocusModeUser:function(e){return{type:Sg.CHANGE_FOCUS_MODE_USER,user:e}},setFilter:function(e,t){return(n,r)=>{var o;null!==(o=r().filters.focusFilters)&&void 0!==o&&o[e]&&n({type:Sg.SET_FOCUS_MODE,active:!1}),n({type:Sg.SET_FILTER,filterName:e,filterOption:t})}},setFilterQuery:function(e){return{type:Sg.SET_FILTER_QUERY,query:e}},toggleFocusMode:function(e){return{type:Sg.SET_FOCUS_MODE,active:e}}},selectors:{filterQuery:function(e){return e.query},focusState:Cg,getFilter:function(e,t){return Ag(e)[t]},getFilters:Ag,getFilterValues:Eg,getFocusFilters:function(e){
|
|
638
|
+
return e.focusFilters},hasAppliedFilter:function(e){return!(!e.query&&!Object.keys(Ag(e)).length)}}});const Ng={CONNECT_FRAME:function(e,t){return[...e,t.frame]},DESTROY_FRAME:function(e,t){return e.filter((e=>e!==t.frame))},UPDATE_FRAME_ANNOTATION_FETCH_STATUS:function(e,t){return e.map((e=>e.uri&&e.uri===t.uri?Object.assign({},e,{isAnnotationFetchComplete:t.isAnnotationFetchComplete}):e))}},Lg=Km(Ng);const Mg=Ff((e=>e),(e=>e.find((e=>!e.id))||null));const zg=Bf(Pf,Hm)((e=>e.reduce(((e,t)=>e.concat(function(e){let t=[e.uri];return e.metadata&&e.metadata.documentFingerprint&&(t=e.metadata.link.map((e=>e.href))),e.metadata&&e.metadata.link&&e.metadata.link.forEach((e=>{e.href.startsWith("doi:")&&t.push(e.href)})),t}(t))),[])),(e=>e));var Og=Lf([],{namespace:"frames",reducers:Ng,actionCreators:{connectFrame:function(e){return{type:Lg.CONNECT_FRAME,frame:e}},destroyFrame:function(e){return{type:Lg.DESTROY_FRAME,frame:e}},updateFrameAnnotationFetchStatus:function(e,t){return{
|
|
639
|
+
type:Lg.UPDATE_FRAME_ANNOTATION_FETCH_STATUS,isAnnotationFetchComplete:t,uri:e}}},selectors:{frames:function(e){return e},mainFrame:Mg,searchUris:zg}});const Ig={features:{},preferences:{},userid:null};const Rg={UPDATE_PROFILE:function(e,t){return{profile:{...t.profile}}}},Pg=Km(Rg);var Dg=Lf((function(e){var t;return{defaultAuthority:null!==(t=null==e?void 0:e.authDomain)&&void 0!==t?t:"",profile:Ig}}),{namespace:"session",reducers:Rg,actionCreators:{updateProfile:function(e){return{type:Pg.UPDATE_PROFILE,profile:e}}},selectors:{defaultAuthority:function(e){return e.defaultAuthority},hasFetchedProfile:function(e){return e.profile!==Ig},isFeatureEnabled:function(e,t){return!!e.profile.features[t]},isLoggedIn:function(e){return null!==e.profile.userid},profile:function(e){return e.profile}}});const Bg={FILTER_GROUPS(e,t){var n;if(null===(n=t.filteredGroupIds)||void 0===n||!n.length)return{filteredGroupIds:null};const r=e.groups.filter((e=>t.filteredGroupIds.includes(e.id)));if(!r.length)return{
|
|
640
640
|
filteredGroupIds:null};let o=e.focusedGroupId;return o&&t.filteredGroupIds.includes(o)||(o=r[0].id),{filteredGroupIds:t.filteredGroupIds,focusedGroupId:o}},FOCUS_GROUP(e,t){const n=e.groups.find((e=>e.id===t.id));return n?{focusedGroupId:t.id}:(console.error(`Attempted to focus group ${t.id} which is not loaded`),{})},LOAD_GROUPS(e,t){const n=t.groups;let r=e.focusedGroupId;return null!==e.focusedGroupId&&n.find((t=>t.id===e.focusedGroupId))||(r=n.length>0?n[0].id:null),{focusedGroupId:r,groups:t.groups}},CLEAR_GROUPS:()=>({filteredGroupIds:null,focusedGroupId:null,groups:[]})},Fg=Km(Bg);function jg(e){return e.filteredGroupIds?e.groups.filter((t=>{var n;return null===(n=e.filteredGroupIds)||void 0===n?void 0:n.includes(t.id)})):e.groups}function Hg(e,t){return e.groups.find((e=>e.id===t))}
|
|
641
641
|
const Ug=Ff((e=>jg(e)),(e=>e.filter((e=>!e.isMember&&e.isScopedToUri)))),qg=Ff((e=>jg(e)),(e=>e.filter((e=>e.isScopedToUri)))),$g=Ff((e=>jg(e.groups)),(e=>Dg.selectors.isLoggedIn(e.session)),((e,t)=>t?e.filter((e=>e.isMember)):[])),Gg=Ff((e=>jg(e.groups)),(e=>$g(e)),(e=>Ug(e.groups)),((e,t,n)=>e.filter((e=>!t.includes(e)&&!n.includes(e)))));var Vg=Lf({filteredGroupIds:null,groups:[],focusedGroupId:null},{namespace:"groups",reducers:Bg,actionCreators:{filterGroups:function(e){return{type:Fg.FILTER_GROUPS,filteredGroupIds:e}},focusGroup:function(e){return{type:Fg.FOCUS_GROUP,id:e}},loadGroups:function(e){return{type:Fg.LOAD_GROUPS,groups:e}},clearGroups:function(){return{type:Fg.CLEAR_GROUPS}}},selectors:{allGroups:function(e){return e.groups},filteredGroups:jg,filteredGroupIds:function(e){return e.filteredGroupIds},focusedGroup:function(e){return e.focusedGroupId?Hg(e,e.focusedGroupId):null},focusedGroupId:function(e){return e.focusedGroupId},getFeaturedGroups:Ug,getGroup:Hg,getInScopeGroups:qg},
|
|
642
|
-
rootSelectors:{getCurrentlyViewingGroups:Gg,getMyGroups:$g}});const Wg={UPDATE_LINKS:(e,t)=>({...t.links})},Yg=Km(Wg);var Kg=Lf(null,{namespace:"links",reducers:Wg,actionCreators:{updateLinks:function(e){return{type:Yg.UPDATE_LINKS,links:e}}},selectors:{getLink:function(e,t,n={}){if(!e)return"";const r=e[t];if(!r)throw new Error(`Unknown link "${t}"`);const{url:o,unusedParams:i}=
|
|
642
|
+
rootSelectors:{getCurrentlyViewingGroups:Gg,getMyGroups:$g}});const Wg={UPDATE_LINKS:(e,t)=>({...t.links})},Yg=Km(Wg);var Kg=Lf(null,{namespace:"links",reducers:Wg,actionCreators:{updateLinks:function(e){return{type:Yg.UPDATE_LINKS,links:e}}},selectors:{getLink:function(e,t,n={}){if(!e)return"";const r=e[t];if(!r)throw new Error(`Unknown link "${t}"`);const{url:o,unusedParams:i}=Em(r,n),a=Object.keys(i);if(a.length>0)throw new Error(`Unused parameters: ${a.join(", ")}`);return o}}});const Xg={RECEIVE_REAL_TIME_UPDATES:(e,t)=>({pendingUpdates:{...t.pendingUpdates},pendingDeletions:{...t.pendingDeletions}}),CLEAR_PENDING_UPDATES:()=>({pendingUpdates:{},pendingDeletions:{}}),ADD_ANNOTATIONS(e,{annotations:t}){const n={...e.pendingUpdates};return t.forEach((e=>delete n[e.id])),{pendingUpdates:n}},REMOVE_ANNOTATIONS(e,{annotationsToRemove:t}){const n={...e.pendingUpdates},r={...e.pendingDeletions};return t.forEach((e=>{delete n[e.id],delete r[e.id]})),{pendingUpdates:n,pendingDeletions:r}},FOCUS_GROUP:()=>({
|
|
643
643
|
pendingUpdates:{},pendingDeletions:{}})},Zg=Km(Xg);const Jg=Ff((e=>[e.pendingUpdates,e.pendingDeletions]),(([e,t])=>Object.keys(e).length+Object.keys(t).length));var Qg=Lf({pendingUpdates:{},pendingDeletions:{}},{namespace:"realTimeUpdates",reducers:Xg,actionCreators:{receiveRealTimeUpdates:function({updatedAnnotations:e=[],deletedAnnotations:t=[]}){return(n,r)=>{const o={...r().realTimeUpdates.pendingUpdates},i={...r().realTimeUpdates.pendingDeletions};e.forEach((e=>{const t=r().groups,n=r().route;e.group!==Vg.selectors.focusedGroupId(t)&&"sidebar"===Gf.selectors.route(n)||(o[e.id]=e)})),t.forEach((e=>{const t=e.id;delete o[t];const n=r().annotations;ag.selectors.annotationExists(n,t)&&(i[t]=!0)})),n({type:Zg.RECEIVE_REAL_TIME_UPDATES,pendingUpdates:o,pendingDeletions:i})}},clearPendingUpdates:function(){return{type:Zg.CLEAR_PENDING_UPDATES}}},selectors:{hasPendingDeletion:function(e,t){return e.pendingDeletions.hasOwnProperty(t)},pendingDeletions:function(e){return e.pendingDeletions},
|
|
644
644
|
pendingUpdates:function(e){return e.pendingUpdates},pendingUpdateCount:Jg}});const ev={annotation:"Location",note:"Oldest",orphan:"Location"};function tv(e){const t={};return e.annotations&&!e.query&&(t[e.annotations]=!0),t}const nv=(e,t)=>t===e?{}:{selectedTab:e,sortKey:ev[e]},rv={CLEAR_SELECTION:function(){return{forcedVisible:{},selected:{}}},SELECT_ANNOTATIONS:function(e,t){return{selected:t.selection}},SELECT_TAB:function(e,t){return nv(t.tab,e.selectedTab)},SET_EXPANDED:function(e,t){const n={...e.expanded};return n[t.id]=t.expanded,{expanded:n}},SET_FORCED_VISIBLE:function(e,t){return{forcedVisible:{...e.forcedVisible,[t.id]:t.visible}}},SET_SORT_KEY:function(e,t){return{sortKey:t.key}},TOGGLE_SELECTED_ANNOTATIONS:function(e,t){const n={...e.selected};return t.toggleIds.forEach((e=>{n[e]=!n[e]})),{selected:n}},ADD_ANNOTATIONS(e,t){const n=t.annotations.filter((e=>!ki(e))),r=jf(t.annotations,Mi)===n.length;return 0===t.currentAnnotationCount&&r?nv("note",e.selectedTab):{}},
|
|
645
645
|
CHANGE_FOCUS_MODE_USER:function(){return{forcedVisible:{},selected:{}}},SET_FILTER:function(){return{forcedVisible:{},selected:{},expanded:{}}},SET_FILTER_QUERY:function(){return{forcedVisible:{},selected:{},expanded:{}}},SET_FOCUS_MODE:function(){return{forcedVisible:{},selected:{}}},REMOVE_ANNOTATIONS:function(e,t){let n=e.selectedTab;"orphan"===n&&0===jf(t.remainingAnnotations,Li)&&(n="annotation");const r=e=>(t.annotationsToRemove.forEach((t=>{t.id&&delete e[t.id],t.$tag&&delete e[t.$tag]})),e);return{...nv(n,e.selectedTab),expanded:r({...e.expanded}),forcedVisible:r({...e.forcedVisible}),selected:r({...e.selected})}}},ov=Km(rv);function iv(e){return e.expanded}const av=Ff((e=>e.forcedVisible),(e=>Uf(e))),sv=Ff((e=>e.selected),(e=>Uf(e).length>0)),lv=Ff((e=>e.selected),(e=>Uf(e)));function cv(e){return e.selectedTab}const uv=Ff((e=>e),(e=>({expanded:iv(e),forcedVisible:av(e),selected:lv(e),sortKey:hv(e),selectedTab:cv(e)})));function hv(e){return e.sortKey}const dv=Ff((e=>e.selectedTab),(e=>{
|
|
646
646
|
const t=["Newest","Oldest"];return"note"!==e&&t.push("Location"),t}));var pv=Lf((function(e){return{selected:tv(e),expanded:tv(e)||{},forcedVisible:{},selectedTab:"annotation",sortKey:ev.annotation}}),{namespace:"selection",reducers:rv,actionCreators:{clearSelection:function(){return{type:ov.CLEAR_SELECTION}},selectAnnotations:function(e){return t=>{t({type:ov.CLEAR_SELECTION}),t({type:ov.SELECT_ANNOTATIONS,selection:Hf(e)})}},selectTab:function(e){return{type:ov.SELECT_TAB,tab:e}},setExpanded:function(e,t){return{type:ov.SET_EXPANDED,id:e,expanded:t}},setForcedVisible:function(e,t){return{type:ov.SET_FORCED_VISIBLE,id:e,visible:t}},setSortKey:function(e){return{type:ov.SET_SORT_KEY,key:e}},toggleSelectedAnnotations:function(e){return{type:ov.TOGGLE_SELECTED_ANNOTATIONS,toggleIds:e}}},selectors:{expandedMap:iv,forcedVisibleThreads:av,hasSelectedAnnotations:sv,selectedAnnotations:lv,selectedTab:cv,selectionState:uv,sortKey:hv,sortKeys:dv}});const mv={OPEN_SIDEBAR_PANEL:function(e,t){return{
|
|
647
647
|
activePanelName:t.panelName}},CLOSE_SIDEBAR_PANEL:function(e,t){let n=e.activePanelName;return t.panelName===n&&(n=null),{activePanelName:n}},TOGGLE_SIDEBAR_PANEL:function(e,t){let n;const r=e.activePanelName===t.panelName,o=void 0!==t.panelState?t.panelState:!r;return n=o?t.panelName:r&&!o?null:e.activePanelName,{activePanelName:n}}},fv=Km(mv);var gv=Lf({activePanelName:null},{namespace:"sidebarPanels",reducers:mv,actionCreators:{openSidebarPanel:function(e){return{type:fv.OPEN_SIDEBAR_PANEL,panelName:e}},closeSidebarPanel:function(e){return{type:fv.CLOSE_SIDEBAR_PANEL,panelName:e}},toggleSidebarPanel:function(e,t){return{type:fv.TOGGLE_SIDEBAR_PANEL,panelName:e,panelState:t}}},selectors:{isSidebarPanelOpen:function(e,t){return e.activePanelName===t}}});const vv={ADD_MESSAGE:function(e,t){return{messages:e.messages.concat({...t.message})}},REMOVE_MESSAGE:function(e,t){return{messages:e.messages.filter((e=>e.id!==t.id))}},UPDATE_MESSAGE:function(e,t){return{
|
|
648
|
-
messages:e.messages.map((e=>e.id&&e.id===t.message.id?{...t.message}:e))}}},yv=Km(vv);var _v=Lf({messages:[]},{namespace:"toastMessages",reducers:vv,actionCreators:{addToastMessage:function(e){return{type:yv.ADD_MESSAGE,message:e}},removeToastMessage:function(e){return{type:yv.REMOVE_MESSAGE,id:e}},updateToastMessage:function(e){return{type:yv.UPDATE_MESSAGE,message:e}}},selectors:{getToastMessage:function(e,t){return e.messages.find((e=>e.id===t))},getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}});const bv={SET_SIDEBAR_OPENED:(e,t)=>!0===t.opened?{sidebarHasOpened:!0}:{}},wv=Km(bv);var xv=Lf({sidebarHasOpened:!1},{namespace:"viewer",reducers:bv,actionCreators:{setSidebarOpened:function(e){return{type:wv.SET_SIDEBAR_OPENED,opened:e}}},selectors:{hasSidebarOpened:function(e){return e.sidebarHasOpened}}});function kv(e){return Nf([If,ag,cg,dg,bg,
|
|
648
|
+
messages:e.messages.map((e=>e.id&&e.id===t.message.id?{...t.message}:e))}}},yv=Km(vv);var _v=Lf({messages:[]},{namespace:"toastMessages",reducers:vv,actionCreators:{addToastMessage:function(e){return{type:yv.ADD_MESSAGE,message:e}},removeToastMessage:function(e){return{type:yv.REMOVE_MESSAGE,id:e}},updateToastMessage:function(e){return{type:yv.UPDATE_MESSAGE,message:e}}},selectors:{getToastMessage:function(e,t){return e.messages.find((e=>e.id===t))},getToastMessages:function(e){return e.messages},hasToastMessage:function(e,t,n){return e.messages.some((e=>e.type===t&&e.message===n))}}});const bv={SET_SIDEBAR_OPENED:(e,t)=>!0===t.opened?{sidebarHasOpened:!0}:{}},wv=Km(bv);var xv=Lf({sidebarHasOpened:!1},{namespace:"viewer",reducers:bv,actionCreators:{setSidebarOpened:function(e){return{type:wv.SET_SIDEBAR_OPENED,opened:e}}},selectors:{hasSidebarOpened:function(e){return e.sidebarHasOpened}}});function kv(e){return Nf([If,ag,cg,dg,bg,Tg,Og,Kg,Vg,Qg,Gf,pv,Dg,gv,_v,xv],[e],[Mf])}kv.$inject=["settings"];class Sv{
|
|
649
649
|
constructor(){this._providers=new Map,this._instances=new Map,this._constructing=new Set}get(e){if(this._instances.has(e))return this._instances.get(e);const t=this._providers.get(e);if(!t)throw new Error(`"${e}" is not registered`);if("value"in t)return this._instances.set(e,t.value),t.value;if(this._constructing.has(e))throw new Error(`Encountered a circular dependency when constructing "${e}"`);this._constructing.add(e);try{const n=[],r="class"in t&&t.class.$inject||"factory"in t&&t.factory.$inject||[];for(const t of r)try{n.push(this.get(t))}catch(n){const r=new Error(`Failed to construct dependency "${t}" of "${e}": ${n.message}`);throw r.cause=n,r}let o;if(t.class)o=new t.class(...n);else{o=(0,t.factory)(...n)}return this._instances.set(e,o),o}finally{this._constructing.delete(e)}}register(e,t){if("function"==typeof t)t={class:t};else if(!function(e){return"object"==typeof e&&null!==e&&("value"in e||"function"==typeof e.class||"function"==typeof e.factory)
|
|
650
|
-
}(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)}}}const Cv=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document),Av=function(e){const{version:t,origin:n}=
|
|
651
|
-
function
|
|
652
|
-
;if("A"===t.tagName){const e=t;"_blank"===e.target&&(e.rel="noopener")}}))}(document.body),function(e=n){let t=!1;try{document.createElement("div").dir="auto"}catch(e){t=!0}if(t){const t=e.vnode;e.vnode=e=>{"string"==typeof e.type&&"dir"in e.props&&"auto"===e.props.dir&&(e.props.dir=""),t&&t(e)}}}(),
|
|
653
|
-
if(n===n.top)throw new Error("The target parent frame has exceeded the ancestor tree. Try reducing the `requestConfigFromFrame.ancestorLevel` value in the `hypothesisConfig`");n=n.parent}return n}(r.ancestorLevel,t);return{...await W(e,o,r.origin),...n.group?{group:n.group}:{}}}throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified")}(Cv).then((e=>{!function(e,t){const n=new Sv;n.register("annotationsService",Sm).register("api",Nm).register("apiRoutes",
|
|
654
|
-
}).register("settings",{value:e}),n.run(Nv),n.run(
|
|
650
|
+
}(t))throw new Error(`Invalid provider for "${e}"`);return this._providers.set(e,t),this}run(e){const t="Injector.run";this.register(t,{factory:e});try{return this.get(t)}finally{this._instances.delete(t),this._providers.delete(t)}}}const Cv=function(t){for(var n={},r=t.querySelectorAll("script.js-hypothesis-config"),o=0;o<r.length;o++){var i=void 0;try{i=JSON.parse(r[o].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),i={}}e(n,i)}return n}(document),Av=function(e){const{version:t,origin:n}=R(e.location.href);return"1.970.0"!==t?(console.warn(`The Hypothesis sidebar is using a different version (1.970.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 Ev(e,t){e.setClientId(t.clientId)}
|
|
651
|
+
function Tv(e,t,n){e.load(),t.load(),n.sync()}function Nv(e,t,n,r){e.init(),t.init(),n.init(),r.init()}function Lv(e,t){"sidebar"===t.route()&&e.connect()}Cv.sentry&&Av&&function(e){const t=function(){let e=import.meta.url;return e?new URL(e).origin:null}(),n=t?[t]:void 0;wr({dsn:e.dsn,environment:e.environment,allowUrls:n,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.970.0",beforeSend:(e,t)=>{if(Sr>=5)return K("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Sr;try{const n=t&&t.originalException;n instanceof Event&&Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted})}catch(e){}return e}});try{Yt("host_config",R(window.location.href))}catch(e){}Yt("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),kr(((e,t)=>{Wt(e,{tags:{context:t}})}))}(Cv.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target
|
|
652
|
+
;if("A"===t.tagName){const e=t;"_blank"===e.target&&(e.rel="noopener")}}))}(document.body),function(e=n){let t=!1;try{document.createElement("div").dir="auto"}catch(e){t=!0}if(t){const t=e.vnode;e.vnode=e=>{"string"==typeof e.type&&"dir"in e.props&&"auto"===e.props.dir&&(e.props.dir=""),t&&t(e)}}}(),Ev.$inject=["api","streamer"],Tv.$inject=["groups","session","router"],Nv.$inject=["autosaveService","features","persistedDefaults","serviceURL"],Lv.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&mo.clear();for(let[t,n]of Object.entries(e))mo.set(t,n)}(Ko);const Mv=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",te)}(),async function(e,t=window){const n=H(window),r=n.requestConfigFromFrame;if(!r)return V(e,n);if("string"==typeof r)return await G(e,t);if("number"==typeof r.ancestorLevel&&"string"==typeof r.origin){const o=function(e,t=window){let n=t;for(let t=0;t<e;t++){
|
|
653
|
+
if(n===n.top)throw new Error("The target parent frame has exceeded the ancestor tree. Try reducing the `requestConfigFromFrame.ancestorLevel` value in the `hypothesisConfig`");n=n.parent}return n}(r.ancestorLevel,t);return{...await W(e,o,r.origin),...n.group?{group:n.group}:{}}}throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified")}(Cv).then((e=>{!function(e,t){const n=new Sv;n.register("annotationsService",Sm).register("api",Nm).register("apiRoutes",Pm).register("auth",Fm).register("autosaveService",jm).register("features",qm).register("frameSync",Ym).register("groups",Jm).register("loadAnnotationsService",Qm).register("localStorage",tf).register("persistedDefaults",rf).register("router",of).register("serviceURL",af).register("session",sf).register("streamer",uf).register("streamFilter",lf).register("tags",hf).register("threadsService",df).register("toastMessenger",pf).register("store",{factory:kv}),n.register("$window",{value:window
|
|
654
|
+
}).register("settings",{value:e}),n.run(Nv),n.run(Ev),n.run(Tv),n.run(ee),n.run(Lv),I(po(ni.Provider,{value:n,children:po(xm,{})}),t)}(e,Mv)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),I(po(km,{error:e}),t)}(e,Mv)));
|
|
655
655
|
//# sourceMappingURL=sidebar.bundle.js.map
|