hypothesis 1.1122.0 → 1.1124.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 +11 -11
- package/build/scripts/annotator.bundle.js +1 -1
- package/build/scripts/annotator.bundle.js.map +1 -1
- package/build/scripts/sidebar.bundle.js +470 -469
- package/build/scripts/sidebar.bundle.js.map +1 -1
- package/build/styles/annotator.css +12 -5
- package/build/styles/annotator.css.map +1 -1
- package/build/styles/katex.min.css +1 -1
- package/build/styles/sidebar.css +16 -9
- package/build/styles/sidebar.css.map +1 -1
- package/build/styles/ui-playground.css +8 -1
- package/build/styles/ui-playground.css.map +1 -1
- package/package.json +2 -2
|
@@ -1,104 +1,105 @@
|
|
|
1
1
|
function e(e){const t=new URL(e).hash.slice(1),n=new URLSearchParams(t).get("config");return JSON.parse(n||"{}")}function t({services:e}){return Array.isArray(e)&&e[0]?e[0]:null}function n(e){if("string"==typeof e&&"false"===e.trim().toLocaleLowerCase())return!1;const t=Number(e);return isNaN(t)?"string"==typeof e:Boolean(t)}function r(e){return parseInt(e)}function o(e){return e&&"function"==typeof e.toString?e.toString():""}function i(e){const t=e.toString(16);return 1===t.length?"0"+t:t}function a(e){const t=new Uint8Array(e/2);return window.crypto.getRandomValues(t),Array.from(t).map(i).join("")}function s(e,t,n,r=[],o=2e3,i=window){const s=a(10),l={jsonrpc:"2.0",method:n,params:r,id:s};try{e.postMessage(l,t)}catch(e){return Promise.reject(e)}let c;const u=new Promise(((e,n)=>{c=r=>{if(r.origin!==t)return;if(!(r.data instanceof Object)||"2.0"!==r.data.jsonrpc||r.data.id!==s)return;const{error:o,result:i}=r.data;void 0!==o?n(o):void 0!==i?e(i):n(new Error("RPC reply had no result or error"))},
|
|
2
2
|
i.addEventListener("message",c)})),d=[u];var h,p;return o&&d.push((h=o,p=`Request to ${t} timed out`,new Promise(((e,t)=>{setTimeout((()=>t(new Error(p))),h)})))),Promise.race(d).then((e=>(i.removeEventListener("message",c),e))).catch((e=>{throw i.removeEventListener("message",c),e}))}function l(e,t=window){let n=t;for(let t=0;t<e;t++){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}let c=new Set;function u(...e){const t=e.join();c.has(t)||(console.warn(...e),c.add(t))}u.reset=()=>{c.clear()};var d="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function h(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var p=e=>{if("string"!=typeof e)throw new TypeError("Expected a string")
|
|
3
3
|
;return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")};function m(e,n,r,o){const i=n.find((e=>"__world__"===e.id));i&&e.unshift(i);const a=e.map((e=>e.id));n=n.filter((e=>!a.includes(e.id))),n.forEach((e=>e.isMember=!1)),e.forEach((e=>e.isMember=!0));const s=e.concat(n);return s.forEach((e=>{e.canLeave=!!function(e){const n=t(e);return!n||!!n.allowLeavingGroups}(o)&&"private"===e.type})),s.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(p).join(".*"))))}(t,e.scopes.uri_patterns);return!0}(e,r))),s}let f=[];function g(e,t,n){const r=(e=>({changeFocusModeUser:t=>{var n;e.changeFocusModeUser(t);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())
|
|
4
|
-
;r.length&&!o.length&&console.error("No matching groups found in list of filtered group IDs"),e.filterGroups(o)},showContentInfo:t=>{e.setContentInfo(t)}}))(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 u(`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)}f.forEach((e=>{o(e)})),f=[],window.removeEventListener("message",v),n.addEventListener("message",o)}function v(e){f.push(e)}
|
|
5
|
-
|
|
6
|
-
;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());
|
|
7
|
-
projectId:e.projectId}}function F(e){
|
|
8
|
-
;
|
|
9
|
-
;e.prototype=t.prototype=n,
|
|
10
|
-
Object.keys(e))
|
|
11
|
-
new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function
|
|
12
|
-
|
|
13
|
-
e.apply(n,t)}})):n.addEventListener("readystatechange",i),e.apply(n,t)}})),
|
|
14
|
-
throw
|
|
15
|
-
return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)
|
|
16
|
-
;try{if(e.target!==t.target)return!0}catch(e){}return!1}(
|
|
17
|
-
;n.mechanism.data=
|
|
18
|
-
;if(null===t||["number","boolean","string"].includes(typeof t)&&("number"!=typeof(s=t)||s==s))return t;var s
|
|
19
|
-
}catch(e){}
|
|
20
|
-
;return this.then((t=>{o=!1,r=t,e&&e()}),(t=>{o=!0,r=t,e&&e()})).then((()=>{o?n(r):t(r)}))}))}__init3(){this._resolve=e=>{this._setResult(
|
|
21
|
-
e&&e>0&&n(!1)}),e);t.forEach((e=>{
|
|
22
|
-
"string"==typeof o?o="string"==typeof e?o+e:[
|
|
23
|
-
user_report:"default"};function
|
|
24
|
-
;return e&&
|
|
25
|
-
this._contexts={},this._sdkProcessingMetadata={}}static clone(e){
|
|
26
|
-
...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){
|
|
27
|
-
...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):
|
|
28
|
-
this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts}
|
|
29
|
-
e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...
|
|
30
|
-
function
|
|
31
|
-
event_id:n},i)})),n}captureMessage(e,t,n){
|
|
32
|
-
configureScope(e){const{scope:t,client:n}=this.getStackTop();t&&n&&e(t)}run(e){
|
|
33
|
-
;if(t){
|
|
34
|
-
|
|
35
|
-
;return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${
|
|
36
|
-
;return e.forEach((e=>{const{name:n}=e
|
|
37
|
-
;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{r=e}))),r}captureMessage(e,t,n,r){let o=n&&n.event_id;
|
|
38
|
-
;return t?this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e)))):
|
|
39
|
-
}}sendSession(e){if(this._dsn){
|
|
40
|
-
return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){const{normalizeDepth:r=3,normalizeMaxBreadth:o=1e3}=this.getOptions()
|
|
41
|
-
e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=
|
|
42
|
-
;if(!this._isEnabled())return
|
|
43
|
-
;
|
|
44
|
-
function
|
|
45
|
-
static __initStatic(){this.id="FunctionToString"}__init(){this.name=
|
|
46
|
-
}(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)
|
|
47
|
-
if(!t||!t.length)return!0;
|
|
48
|
-
if("number"==typeof e.framesToPop)return e.framesToPop;if(
|
|
49
|
-
}(e,t,n,o),
|
|
50
|
-
logger:"console"},level:(
|
|
51
|
-
;i.path||(
|
|
52
|
-
}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){
|
|
53
|
-
("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)
|
|
54
|
-
"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}))}function
|
|
55
|
-
t
|
|
56
|
-
;return n||r?[-1!==e.indexOf("@")?e.split("@")[0]:"?",n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]};let
|
|
57
|
-
onunhandledrejection:
|
|
58
|
-
;if(!t.getIntegration(
|
|
59
|
-
|
|
60
|
-
;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
4
|
+
;r.length&&!o.length&&console.error("No matching groups found in list of filtered group IDs"),e.filterGroups(o)},showContentInfo:t=>{e.setContentInfo(t)}}))(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 u(`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)}f.forEach((e=>{o(e)})),f=[],window.removeEventListener("message",v),n.addEventListener("message",o)}function v(e){f.push(e)}g.$inject=["store","settings","$window"];const _=Object.prototype.toString;function b(e){switch(_.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return T(e,Error)}}function y(e,t){return _.call(e)===`[object ${t}]`}
|
|
5
|
+
function w(e){return y(e,"ErrorEvent")}function x(e){return y(e,"DOMError")}function k(e){return y(e,"String")}function S(e){return null===e||"object"!=typeof e&&"function"!=typeof e}function C(e){return y(e,"Object")}function E(e){return"undefined"!=typeof Event&&T(e,Event)}function A(e){return Boolean(e&&e.then&&"function"==typeof e.then)}function T(e,t){try{return e instanceof t}catch(e){return!1}}function N(e){return e&&e.Math==Math?e:void 0}const M="object"==typeof globalThis&&N(globalThis)||"object"==typeof window&&N(window)||"object"==typeof self&&N(self)||"object"==typeof global&&N(global)||function(){return this}()||{};function L(e,t,n){const r=n||M,o=r.__SENTRY__=r.__SENTRY__||{};return o[e]||(o[e]=t())}const z=M;function R(e,t){try{let n=e;const r=5,o=80,i=[];let a=0,s=0;const l=" > ",c=l.length;let u;for(;n&&a++<r&&(u=O(n,t),!("html"===u||a>1&&s+i.length*c+u.length>=o));)i.push(u),s+=u.length,n=n.parentNode;return i.reverse().join(l)}catch(e){return"<unknown>"}}function O(e,t){const n=e,r=[]
|
|
6
|
+
;let o,i,a,s,l;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const c=t&&t.length?t.filter((e=>n.getAttribute(e))).map((e=>[e,n.getAttribute(e)])):null;if(c&&c.length)c.forEach((e=>{r.push(`[${e[0]}="${e[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),o=n.className,o&&k(o))for(i=o.split(/\s+/),l=0;l<i.length;l++)r.push(`.${i[l]}`);const u=["type","name","title","alt"];for(l=0;l<u.length;l++)a=u[l],s=n.getAttribute(a),s&&r.push(`[${a}="${s}"]`);return r.join("")}class I extends Error{constructor(e,t="warn"){super(e),this.message=e,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=t}}const D=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function P(e,t=!1){const{host:n,path:r,pass:o,port:i,projectId:a,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&o?`:${o}`:""}@${n}${i?`:${i}`:""}/${r?`${r}/`:r}${a}`}function B(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",
|
|
7
|
+
path:e.path||"",projectId:e.projectId}}function F(e){const t="string"==typeof e?function(e){const t=D.exec(e);if(!t)throw new I(`Invalid Sentry Dsn: ${e}`);const[n,r,o="",i,a="",s]=t.slice(1);let l="",c=s;const u=c.split("/");if(u.length>1&&(l=u.slice(0,-1).join("/"),c=u.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return B({host:i,pass:o,path:l,projectId:c,port:a,protocol:n,publicKey:r})}(e):B(e);return function(e){if("undefined"!=typeof __SENTRY_DEBUG__&&!__SENTRY_DEBUG__)return;const{port:t,projectId:n,protocol:r}=e;if(["protocol","publicKey","host","projectId"].forEach((t=>{if(!e[t])throw new I(`Invalid Sentry Dsn: ${t} missing`)})),!n.match(/^\d+$/))throw new I(`Invalid Sentry Dsn: Invalid projectId ${n}`);if(!function(e){return"http"===e||"https"===e}(r))throw new I(`Invalid Sentry Dsn: Invalid protocol ${r}`);if(t&&isNaN(parseInt(t,10)))throw new I(`Invalid Sentry Dsn: Invalid port ${t}`)}(t),t}const H=["debug","info","warn","error","log","assert","trace"];function j(e){if(!("console"in M))return e()
|
|
8
|
+
;const t=M.console,n={};H.forEach((e=>{const r=t[e]&&t[e].__sentry_original__;e in t&&r&&(n[e]=t[e],t[e]=r)}));try{return e()}finally{Object.keys(n).forEach((e=>{t[e]=n[e]}))}}function U(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1}};return"undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?H.forEach((n=>{t[n]=(...t)=>{e&&j((()=>{M.console[n](`Sentry Logger [${n}]:`,...t)}))}})):H.forEach((e=>{t[e]=()=>{}})),t}let q;function $(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.substr(0,t)}...`}function G(e,t){if(!Array.isArray(e))return"";const n=[];for(let t=0;t<e.length;t++){const r=e[t];try{n.push(String(r))}catch(e){n.push("[value cannot be serialized]")}}return n.join(t)}function V(e,t){return!!k(e)&&(y(t,"RegExp")?t.test(e):"string"==typeof t&&-1!==e.indexOf(t))}function Y(e,t,n){if(!(t in e))return;const r=e[t],o=n(r);if("function"==typeof o)try{K(o,r)}catch(e){}e[t]=o}function W(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}function K(e,t){
|
|
9
|
+
const n=t.prototype||{};e.prototype=t.prototype=n,W(e,"__sentry_original__",t)}function X(e){return e.__sentry_original__}function Z(e){if(b(e))return{message:e.message,name:e.name,stack:e.stack,...Q(e)};if(E(e)){const t={type:e.type,target:J(e.target),currentTarget:J(e.currentTarget),...Q(e)};return"undefined"!=typeof CustomEvent&&T(e,CustomEvent)&&(t.detail=e.detail),t}return e}function J(e){try{return t=e,"undefined"!=typeof Element&&T(t,Element)?R(e):Object.prototype.toString.call(e)}catch(e){return"<unknown>"}var t}function Q(e){if("object"==typeof e&&null!==e){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}return{}}function ee(e,t=40){const n=Object.keys(Z(e));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=t)return $(n[0],t);for(let e=n.length;e>0;e--){const r=n.slice(0,e).join(", ");if(!(r.length>t))return e===n.length?r:$(r,t)}return""}function te(e){return ne(e,new Map)}function ne(e,t){if(C(e)){const n=t.get(e);if(void 0!==n)return n
|
|
10
|
+
;const r={};t.set(e,r);for(const n of Object.keys(e))void 0!==e[n]&&(r[n]=ne(e[n],t));return r}if(Array.isArray(e)){const n=t.get(e);if(void 0!==n)return n;const r=[];return t.set(e,r),e.forEach((e=>{r.push(ne(e,t))})),r}return e}q="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?L("logger",U):U();function re(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,n=0)=>{const r=[];for(const o of e.split("\n").slice(n)){const e=o.replace(/\(error: (.*)\)/,"$1");for(const n of t){const t=n(e);if(t){r.push(t);break}}}return function(e){if(!e.length)return[];let t=e;const n=t[0].function||"",r=t[t.length-1].function||"";-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(t=t.slice(1));-1!==r.indexOf("sentryWrapped")&&(t=t.slice(0,-1));return t.slice(0,50).map((e=>({...e,filename:e.filename||t[0].filename,function:e.function||"?"}))).reverse()}(r)}}function oe(e){try{return e&&"function"==typeof e&&e.name||"<anonymous>"}catch(e){return"<anonymous>"}}function ie(){
|
|
11
|
+
if(!("fetch"in z))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch(e){return!1}}function ae(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}const se={},le={};function ce(e){if(!le[e])switch(le[e]=!0,e){case"console":!function(){if(!("console"in z))return;H.forEach((function(e){e in z.console&&Y(z.console,e,(function(t){return function(...n){de("console",{args:n,level:e}),t&&t.apply(z.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in z))return;const e=de.bind(null,"dom"),t=ve(e,!0);z.document.addEventListener("click",t,!1),z.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const n=z[t]&&z[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Y(n,"addEventListener",(function(t){return function(n,r,o){if("click"===n||"keypress"==n)try{const r=this,i=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},a=i[n]=i[n]||{refCount:0};if(!a.handler){
|
|
12
|
+
const r=ve(e);a.handler=r,t.call(this,n,r,o)}a.refCount+=1}catch(e){}return t.call(this,n,r,o)}})),Y(n,"removeEventListener",(function(e){return function(t,n,r){if("click"===t||"keypress"==t)try{const n=this,o=n.__sentry_instrumentation_handlers__||{},i=o[t];i&&(i.refCount-=1,i.refCount<=0&&(e.call(this,t,i.handler,r),i.handler=void 0,delete o[t]),0===Object.keys(o).length&&delete n.__sentry_instrumentation_handlers__)}catch(e){}return e.call(this,t,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in z))return;const e=XMLHttpRequest.prototype;Y(e,"open",(function(e){return function(...t){const n=this,r=t[1],o=n.__sentry_xhr__={method:k(t[0])?t[0].toUpperCase():t[0],url:t[1]};k(r)&&"POST"===o.method&&r.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const i=function(){if(4===n.readyState){try{o.status_code=n.status}catch(e){}de("xhr",{args:t,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:n})}}
|
|
13
|
+
;return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?Y(n,"onreadystatechange",(function(e){return function(...t){return i(),e.apply(n,t)}})):n.addEventListener("readystatechange",i),e.apply(n,t)}})),Y(e,"send",(function(e){return function(...t){return this.__sentry_xhr__&&void 0!==t[0]&&(this.__sentry_xhr__.body=t[0]),de("xhr",{args:t,startTimestamp:Date.now(),xhr:this}),e.apply(this,t)}}))}();break;case"fetch":!function(){if(!function(){if(!ie())return!1;if(ae(z.fetch))return!0;let e=!1;const t=z.document;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=ae(n.contentWindow.fetch)),t.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}())return;Y(z,"fetch",(function(e){return function(...t){const n={args:t,fetchData:{method:he(t),url:pe(t)},
|
|
14
|
+
startTimestamp:Date.now()};return de("fetch",{...n}),e.apply(z,t).then((e=>(de("fetch",{...n,endTimestamp:Date.now(),response:e}),e)),(e=>{throw de("fetch",{...n,endTimestamp:Date.now(),error:e}),e}))}}))}();break;case"history":!function(){if(!function(){const e=z.chrome,t=e&&e.app&&e.app.runtime,n="history"in z&&!!z.history.pushState&&!!z.history.replaceState;return!t&&n}())return;const e=z.onpopstate;function t(e){return function(...t){const n=t.length>2?t[2]:void 0;if(n){const e=me,t=String(n);me=t,de("history",{from:e,to:t})}return e.apply(this,t)}}z.onpopstate=function(...t){const n=z.location.href,r=me;if(me=n,de("history",{from:r,to:n}),e)try{return e.apply(this,t)}catch(e){}},Y(z.history,"pushState",t),Y(z.history,"replaceState",t)}();break;case"error":_e=z.onerror,z.onerror=function(e,t,n,r,o){return de("error",{column:r,error:o,line:n,msg:e,url:t}),!!_e&&_e.apply(this,arguments)};break;case"unhandledrejection":be=z.onunhandledrejection,z.onunhandledrejection=function(e){
|
|
15
|
+
return de("unhandledrejection",e),!be||be.apply(this,arguments)};break;default:return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn("unknown instrumentation type:",e))}}function ue(e,t){se[e]=se[e]||[],se[e].push(t),ce(e)}function de(e,t){if(e&&se[e])for(const n of se[e]||[])try{n(t)}catch(t){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${oe(n)}\nError:`,t)}}function he(e=[]){return"Request"in z&&T(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function pe(e=[]){return"string"==typeof e[0]?e[0]:"Request"in z&&T(e[0],Request)?e[0].url:String(e[0])}let me;let fe,ge;function ve(e,t=!1){return n=>{if(!n||ge===n)return;if(function(e){if("keypress"!==e.type)return!1;try{const 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))return
|
|
16
|
+
;const r="keypress"===n.type?"input":n.type;(void 0===fe||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}(ge,n))&&(e({event:n,name:r,global:t}),ge=n),clearTimeout(fe),fe=z.setTimeout((()=>{fe=void 0}),1e3)}}let _e=null;let be=null;function ye(){const e=M,t=e.crypto||e.msCrypto;if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");const n=t&&t.getRandomValues?()=>t.getRandomValues(new Uint8Array(1))[0]:()=>16*Math.random();return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(e=>(e^(15&n())>>e/4).toString(16)))}function we(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function xe(e){const{message:t,event_id:n}=e;if(t)return t;const r=we(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ke(e,t,n){const 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 Se(e,t){const n=we(e);if(!n)return
|
|
17
|
+
;const r=n.mechanism;if(n.mechanism={type:"generic",handled:!0,...r,...t},t&&"data"in t){const e={...r&&r.data,...t.data};n.mechanism.data=e}}function Ce(e){if(e&&e.__sentry_captured__)return!0;try{W(e,"__sentry_captured__",!0)}catch(e){}return!1}function Ee(e){return Array.isArray(e)?e:[e]}function Ae(){return!("undefined"!=typeof __SENTRY_BROWSER_BUNDLE__&&__SENTRY_BROWSER_BUNDLE__)&&"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)}function Te(e,t=1/0,n=1/0){try{return Me("",e,t,n)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function Ne(e,t=3,n=102400){const r=Te(e,t);return o=r,function(e){return~-encodeURI(e).split(/%..|./).length}(JSON.stringify(o))>n?Ne(e,t-1,n):r;var o}function Me(e,t,n=1/0,r=1/0,o=function(){const e="function"==typeof WeakSet,t=e?new WeakSet:[];return[function(n){if(e)return!!t.has(n)||(t.add(n),!1);for(let e=0;e<t.length;e++)if(t[e]===n)return!0;return t.push(n),!1},function(n){
|
|
18
|
+
if(e)t.delete(n);else for(let e=0;e<t.length;e++)if(t[e]===n){t.splice(e,1);break}}]}()){const[i,a]=o;if(null===t||["number","boolean","string"].includes(typeof t)&&("number"!=typeof(s=t)||s==s))return t;var s;const l=function(e,t){try{return"domain"===e&&t&&"object"==typeof t&&t._events?"[Domain]":"domainEmitter"===e?"[DomainEmitter]":"undefined"!=typeof global&&t===global?"[Global]":"undefined"!=typeof window&&t===window?"[Window]":"undefined"!=typeof document&&t===document?"[Document]":function(e){return C(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}(t)?"[SyntheticEvent]":"number"==typeof t&&t!=t?"[NaN]":void 0===t?"[undefined]":"function"==typeof t?`[Function: ${oe(t)}]`:"symbol"==typeof t?`[${String(t)}]`:"bigint"==typeof t?`[BigInt: ${String(t)}]`:`[object ${Object.getPrototypeOf(t).constructor.name}]`}catch(e){return`**non-serializable** (${e})`}}(e,t);if(!l.startsWith("[object "))return l;if(t.__sentry_skip_normalization__)return t;if(0===n)return l.replace("object ","")
|
|
19
|
+
;if(i(t))return"[Circular ~]";const c=t;if(c&&"function"==typeof c.toJSON)try{return Me("",c.toJSON(),n-1,r,o)}catch(e){}const u=Array.isArray(t)?[]:{};let d=0;const h=Z(t);for(const e in h){if(!Object.prototype.hasOwnProperty.call(h,e))continue;if(d>=r){u[e]="[MaxProperties ~]";break}const t=h[e];u[e]=Me(e,t,n-1,r,o),d+=1}return a(t),u}var Le;function ze(e){return new Oe((t=>{t(e)}))}function Re(e){return new Oe(((t,n)=>{n(e)}))}!function(e){e[e.PENDING=0]="PENDING";e[e.RESOLVED=1]="RESOLVED";e[e.REJECTED=2]="REJECTED"}(Le||(Le={}));class Oe{__init(){this._state=Le.PENDING}__init2(){this._handlers=[]}constructor(e){Oe.prototype.__init.call(this),Oe.prototype.__init2.call(this),Oe.prototype.__init3.call(this),Oe.prototype.__init4.call(this),Oe.prototype.__init5.call(this),Oe.prototype.__init6.call(this);try{e(this._resolve,this._reject)}catch(e){this._reject(e)}}then(e,t){return new Oe(((n,r)=>{this._handlers.push([!1,t=>{if(e)try{n(e(t))}catch(e){r(e)}else n(t)},e=>{if(t)try{n(t(e))}catch(e){r(e)}else r(e)
|
|
20
|
+
}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new Oe(((t,n)=>{let r,o;return this.then((t=>{o=!1,r=t,e&&e()}),(t=>{o=!0,r=t,e&&e()})).then((()=>{o?n(r):t(r)}))}))}__init3(){this._resolve=e=>{this._setResult(Le.RESOLVED,e)}}__init4(){this._reject=e=>{this._setResult(Le.REJECTED,e)}}__init5(){this._setResult=(e,t)=>{this._state===Le.PENDING&&(A(t)?t.then(this._resolve,this._reject):(this._state=e,this._value=t,this._executeHandlers()))}}__init6(){this._executeHandlers=()=>{if(this._state===Le.PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===Le.RESOLVED&&e[1](this._value),this._state===Le.REJECTED&&e[2](this._value),e[0]=!0)}))}}}function Ie(e){const 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 Re(new I("Not adding Promise because buffer limit was reached."));const o=r();return-1===t.indexOf(o)&&t.push(o),
|
|
21
|
+
o.then((()=>n(o))).then(null,(()=>n(o).then(null,(()=>{})))),o},drain:function(e){return new Oe(((n,r)=>{let o=t.length;if(!o)return n(!0);const i=setTimeout((()=>{e&&e>0&&n(!1)}),e);t.forEach((e=>{ze(e).then((()=>{--o||(clearTimeout(i),n(!0))}),r)}))}))}}}function De(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+n+r}}const Pe=["fatal","error","warning","log","info","debug"];const Be={nowSeconds:()=>Date.now()/1e3};const Fe=Ae()?function(){try{return(e=module,t="perf_hooks",e.require(t)).performance}catch(e){return}var e,t}():function(){const{performance:e}=z;if(!e||!e.now)return;return{now:()=>e.now(),timeOrigin:Date.now()-e.now()}}(),He=void 0===Fe?Be:{nowSeconds:()=>(Fe.timeOrigin+Fe.now())/1e3},je=Be.nowSeconds.bind(Be),Ue=He.nowSeconds.bind(He);function qe(e,t=[]){return[e,t]}function $e(e,t){const[n,r]=e;return[n,[...r,t]]}function Ge(e,t){
|
|
22
|
+
e[1].forEach((e=>{const n=e[0].type;t(e,n)}))}function Ve(e,t){return(t||new TextEncoder).encode(e)}function Ye(e,t){const[n,r]=e;let o=JSON.stringify(n);function i(e){"string"==typeof o?o="string"==typeof e?o+e:[Ve(o,t),e]:o.push("string"==typeof e?Ve(e,t):e)}for(const e of r){const[t,n]=e;if(i(`\n${JSON.stringify(t)}\n`),"string"==typeof n||n instanceof Uint8Array)i(n);else{let e;try{e=JSON.stringify(n)}catch(t){e=JSON.stringify(Te(n))}i(e)}}return"string"==typeof o?o:function(e){const t=e.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(t);let r=0;for(const t of e)n.set(t,r),r+=t.length;return n}(o)}function We(e,t){const n="string"==typeof e.data?Ve(e.data,t):e.data;return[te({type:"attachment",length:n.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),n]}(()=>{const{performance:e}=z;if(!e||!e.now)return;const 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
|
|
23
|
+
;(i||s<t)&&(o<=s&&e.timeOrigin)})();const Ke={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default"};function Xe(e){return Ke[e]}function Ze(e,{statusCode:t,headers:n},r=Date.now()){const o={...e},i=n&&n["x-sentry-rate-limits"],a=n&&n["retry-after"];if(i)for(const e of i.trim().split(",")){const[t,n]=e.split(":",2),i=parseInt(t,10),a=1e3*(isNaN(i)?60:i);if(n)for(const e of n.split(";"))o[e]=r+a;else o.all=r+a}else a?o.all=r+function(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${e}`);return isNaN(r)?6e4:r-t}(a,r):429===t&&(o.all=r+6e4);return o}function Je(e){const t=Ue(),n={sid:ye(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(e){return te({sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,
|
|
24
|
+
did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}})}(n)};return e&&Qe(n,e),n}function Qe(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Ue(),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:ye()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),
|
|
25
|
+
t.status&&(e.status=t.status)}class et{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={}}static clone(e){const t=new et;return e&&(t._breadcrumbs=[...e._breadcrumbs],t._tags={...e._tags},t._extra={...e._extra},t._contexts={...e._contexts},t._user=e._user,t._level=e._level,t._span=e._span,t._session=e._session,t._transactionName=e._transactionName,t._fingerprint=e._fingerprint,t._eventProcessors=[...e._eventProcessors],t._requestSession=e._requestSession,t._attachments=[...e._attachments]),t}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{},this._session&&Qe(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(e){return this._requestSession=e,
|
|
26
|
+
this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this._tags={...this._tags,[e]:t},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts={...this._contexts,[e]:t},this._notifyScopeListeners(),this}setSpan(e){return this._span=e,this._notifyScopeListeners(),this}getSpan(){return this._span}getTransaction(){const e=this.getSpan();return e&&e.transaction}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){
|
|
27
|
+
if(!e)return this;if("function"==typeof e){const t=e(this);return t instanceof et?t:this}return e instanceof et?(this._tags={...this._tags,...e._tags},this._extra={...this._extra,...e._extra},this._contexts={...this._contexts,...e._contexts},e._user&&Object.keys(e._user).length&&(this._user=e._user),e._level&&(this._level=e._level),e._fingerprint&&(this._fingerprint=e._fingerprint),e._requestSession&&(this._requestSession=e._requestSession)):C(e)&&(this._tags={...this._tags,...e.tags},this._extra={...this._extra,...e.extra},this._contexts={...this._contexts,...e.contexts},e.user&&(this._user=e.user),e.level&&(this._level=e.level),e.fingerprint&&(this._fingerprint=e.fingerprint),e.requestSession&&(this._requestSession=e.requestSession)),this}clear(){return this._breadcrumbs=[],this._tags={},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(),
|
|
28
|
+
this._attachments=[],this}addBreadcrumb(e,t){const n="number"==typeof t?t:100;if(n<=0)return this;const r={timestamp:je(),...e};return this._breadcrumbs=[...this._breadcrumbs,r].slice(-n),this._notifyScopeListeners(),this}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}getAttachments(){return this._attachments}clearAttachments(){return this._attachments=[],this}applyToEvent(e,t={}){if(this._extra&&Object.keys(this._extra).length&&(e.extra={...this._extra,...e.extra}),this._tags&&Object.keys(this._tags).length&&(e.tags={...this._tags,...e.tags}),this._user&&Object.keys(this._user).length&&(e.user={...this._user,...e.user}),this._contexts&&Object.keys(this._contexts).length&&(e.contexts={...this._contexts,...e.contexts}),this._level&&(e.level=this._level),this._transactionName&&(e.transaction=this._transactionName),this._span){e.contexts={trace:this._span.getTraceContext(),...e.contexts}
|
|
29
|
+
;const t=this._span.transaction&&this._span.transaction.name;t&&(e.tags={transaction:t,...e.tags})}return this._applyFingerprint(e),e.breadcrumbs=[...e.breadcrumbs||[],...this._breadcrumbs],e.breadcrumbs=e.breadcrumbs.length>0?e.breadcrumbs:void 0,e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...this._sdkProcessingMetadata},this._notifyEventProcessors([...tt(),...this._eventProcessors],e,t)}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...e},this}_notifyEventProcessors(e,t,n,r=0){return new Oe(((o,i)=>{const a=e[r];if(null===t||"function"!=typeof a)o(t);else{const s=a({...t},n);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&a.id&&null===s&&q.log(`Event processor "${a.id}" dropped event`),A(s)?s.then((t=>this._notifyEventProcessors(e,t,n,r+1).then(o))).then(null,i):this._notifyEventProcessors(e,s,n,r+1).then(o).then(null,i)}}))}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{
|
|
30
|
+
e(this)})),this._notifyingListeners=!1)}_applyFingerprint(e){e.fingerprint=e.fingerprint?Ee(e.fingerprint):[],this._fingerprint&&(e.fingerprint=e.fingerprint.concat(this._fingerprint)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}}function tt(){return L("globalEventProcessors",(()=>[]))}function nt(e){tt().push(e)}const rt=100;class ot{__init(){this._stack=[{}]}constructor(e,t=new et,n=4){this._version=n,ot.prototype.__init.call(this),this.getStackTop().scope=t,e&&this.bindClient(e)}isOlderThan(e){return this._version<e}bindClient(e){this.getStackTop().client=e,e&&e.setupIntegrations&&e.setupIntegrations()}pushScope(){const e=et.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:e}),e}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(e){const t=this.pushScope();try{e(t)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this._stack}getStackTop(){
|
|
31
|
+
return this._stack[this._stack.length-1]}captureException(e,t){const n=this._lastEventId=t&&t.event_id?t.event_id:ye(),r=new Error("Sentry syntheticException");return this._withClient(((o,i)=>{o.captureException(e,{originalException:e,syntheticException:r,...t,event_id:n},i)})),n}captureMessage(e,t,n){const r=this._lastEventId=n&&n.event_id?n.event_id:ye(),o=new Error(e);return this._withClient(((i,a)=>{i.captureMessage(e,t,{originalException:e,syntheticException:o,...n,event_id:r},a)})),r}captureEvent(e,t){const n=t&&t.event_id?t.event_id:ye();return"transaction"!==e.type&&(this._lastEventId=n),this._withClient(((r,o)=>{r.captureEvent(e,{...t,event_id:n},o)})),n}lastEventId(){return this._lastEventId}addBreadcrumb(e,t){const{scope:n,client:r}=this.getStackTop();if(!n||!r)return;const{beforeBreadcrumb:o=null,maxBreadcrumbs:i=rt}=r.getOptions&&r.getOptions()||{};if(i<=0)return;const a={timestamp:je(),...e},s=o?j((()=>o(a,t))):a;null!==s&&n.addBreadcrumb(s,i)}setUser(e){const t=this.getScope();t&&t.setUser(e)}
|
|
32
|
+
setTags(e){const t=this.getScope();t&&t.setTags(e)}setExtras(e){const t=this.getScope();t&&t.setExtras(e)}setTag(e,t){const n=this.getScope();n&&n.setTag(e,t)}setExtra(e,t){const n=this.getScope();n&&n.setExtra(e,t)}setContext(e,t){const n=this.getScope();n&&n.setContext(e,t)}configureScope(e){const{scope:t,client:n}=this.getStackTop();t&&n&&e(t)}run(e){const t=at(this);try{e(this)}finally{at(t)}}getIntegration(e){const t=this.getClient();if(!t)return null;try{return t.getIntegration(e)}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn(`Cannot retrieve integration ${e.id} from the current Hub`),null}}startTransaction(e,t){return this._callExtensionMethod("startTransaction",e,t)}traceHeaders(){return this._callExtensionMethod("traceHeaders")}captureSession(e=!1){if(e)return this.endSession();this._sendSessionUpdate()}endSession(){const e=this.getStackTop(),t=e&&e.scope,n=t&&t.getSession();n&&function(e,t){let n={};t?n={status:t}:"ok"===e.status&&(n={status:"exited"}),Qe(e,n)}(n),
|
|
33
|
+
this._sendSessionUpdate(),t&&t.setSession()}startSession(e){const{scope:t,client:n}=this.getStackTop(),{release:r,environment:o}=n&&n.getOptions()||{},{userAgent:i}=M.navigator||{},a=Je({release:r,environment:o,...t&&{user:t.getUser()},...i&&{userAgent:i},...e});if(t){const e=t.getSession&&t.getSession();e&&"ok"===e.status&&Qe(e,{status:"exited"}),this.endSession(),t.setSession(a)}return a}shouldSendDefaultPii(){const e=this.getClient(),t=e&&e.getOptions();return Boolean(t&&t.sendDefaultPii)}_sendSessionUpdate(){const{scope:e,client:t}=this.getStackTop();if(!e)return;const n=e.getSession();n&&t&&t.captureSession&&t.captureSession(n)}_withClient(e){const{scope:t,client:n}=this.getStackTop();n&&e(n,t)}_callExtensionMethod(e,...t){const n=it().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[e])return n.extensions[e].apply(this,t);("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn(`Extension method ${e} couldn't be found, doing nothing.`)}}function it(){
|
|
34
|
+
return M.__SENTRY__=M.__SENTRY__||{extensions:{},hub:void 0},M}function at(e){const t=it(),n=ct(t);return ut(t,e),n}function st(){const e=it();return lt(e)&&!ct(e).isOlderThan(4)||ut(e,new ot),Ae()?function(e){try{const t=it().__SENTRY__,n=t&&t.extensions&&t.extensions.domain&&t.extensions.domain.active;if(!n)return ct(e);if(!lt(n)||ct(n).isOlderThan(4)){const t=ct(e).getStackTop();ut(n,new ot(t.client,et.clone(t.scope)))}return ct(n)}catch(t){return ct(e)}}(e):ct(e)}function lt(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function ct(e){return L("hub",(()=>new ot),e)}function ut(e,t){if(!e)return!1;return(e.__SENTRY__=e.__SENTRY__||{}).hub=t,!0}function dt(e,t){return st().captureException(e,{captureContext:t})}function ht(e,t){st().setExtra(e,t)}function pt(e){st().withScope(e)}function mt(e,t){return n={sentry_key:e.publicKey,sentry_version:"7",...t&&{sentry_client:`${t.name}/${t.version}`}},Object.keys(n).map((e=>`${encodeURIComponent(e)}=${encodeURIComponent(n[e])}`)).join("&");var n}
|
|
35
|
+
function ft(e,t={}){const n="string"==typeof t?t:t.tunnel,r="string"!=typeof t&&t._metadata?t._metadata.sdk:void 0;return n||`${function(e){return`${function(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}(e)}${e.projectId}/envelope/`}(e)}?${mt(e,r)}`}function gt(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function vt(e,t,n,r){const o=gt(n),i=e.type||"event";!function(e,t){t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]])}(e,n&&n.sdk);const a=function(e,t,n,r){const o=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!n&&{dsn:P(r)},..."transaction"===e.type&&o&&{trace:te({...o})}}}(e,o,r,t);delete e.sdkProcessingMetadata;return qe(a,[[{
|
|
36
|
+
type:i},e]])}const _t=[];function bt(e){const t=e.defaultIntegrations||[],n=e.integrations;let r;t.forEach((e=>{e.isDefaultInstance=!0})),r=Array.isArray(n)?[...t,...n]:"function"==typeof n?Ee(n(t)):t;const o=function(e){const t={};return e.forEach((e=>{const{name:n}=e,r=t[n];r&&!r.isDefaultInstance&&e.isDefaultInstance||(t[n]=e)})),Object.values(t)}(r),i=o.findIndex((e=>"Debug"===e.name));if(-1!==i){const[e]=o.splice(i,1);o.push(e)}return o}const yt="Not capturing exception because it's already been captured.";class wt{__init(){this._integrations={}}__init2(){this._integrationsInitialized=!1}__init3(){this._numProcessing=0}__init4(){this._outcomes={}}constructor(e){if(wt.prototype.__init.call(this),wt.prototype.__init2.call(this),wt.prototype.__init3.call(this),wt.prototype.__init4.call(this),this._options=e,e.dsn){this._dsn=F(e.dsn);const t=ft(this._dsn,e);this._transport=e.transport({recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})
|
|
37
|
+
}else("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn("No DSN provided, client will not do anything.")}captureException(e,t,n){if(Ce(e))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.log(yt));let r=t&&t.event_id;return this._process(this.eventFromException(e,t).then((e=>this._captureEvent(e,t,n))).then((e=>{r=e}))),r}captureMessage(e,t,n,r){let o=n&&n.event_id;const i=S(e)?this.eventFromMessage(String(e),t,n):this.eventFromException(e,n);return this._process(i.then((e=>this._captureEvent(e,n,r))).then((e=>{o=e}))),o}captureEvent(e,t,n){if(t&&t.originalException&&Ce(t.originalException))return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.log(yt));let r=t&&t.event_id;return this._process(this._captureEvent(e,t,n).then((e=>{r=e}))),r}captureSession(e){this._isEnabled()?"string"!=typeof e.release?("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn("Discarded session because of missing or non-string release"):(this.sendSession(e),Qe(e,{
|
|
38
|
+
init:!1})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn("SDK not enabled, will not capture session.")}getDsn(){return this._dsn}getOptions(){return this._options}getTransport(){return this._transport}flush(e){const t=this._transport;return t?this._isClientDoneProcessing(e).then((n=>t.flush(e).then((e=>n&&e)))):ze(!0)}close(e){return this.flush(e).then((e=>(this.getOptions().enabled=!1,e)))}setupIntegrations(){this._isEnabled()&&!this._integrationsInitialized&&(this._integrations=function(e){const t={};return e.forEach((e=>{t[e.name]=e,-1===_t.indexOf(e.name)&&(e.setupOnce(nt,st),_t.push(e.name),("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.log(`Integration installed: ${e.name}`))})),t}(this._options.integrations),this._integrationsInitialized=!0)}getIntegrationById(e){return this._integrations[e]}getIntegration(e){try{return this._integrations[e.id]||null}catch(t){
|
|
39
|
+
return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn(`Cannot retrieve integration ${e.id} from the current Client`),null}}sendEvent(e,t={}){if(this._dsn){let n=vt(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])n=$e(n,We(e,this._options.transportOptions&&this._options.transportOptions.textEncoder));this._sendEnvelope(n)}}sendSession(e){if(this._dsn){const t=function(e,t,n,r){const o=gt(n);return qe({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&{dsn:P(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e]])}(e,this._dsn,this._options._metadata,this._options.tunnel);this._sendEnvelope(t)}}recordDroppedEvent(e,t){if(this._options.sendClientReports){const n=`${e}:${t}`;("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.log(`Adding outcome: "${n}"`),this._outcomes[n]=this._outcomes[n]+1||1}}_updateSessionFromEvent(e,t){let n=!1,r=!1;const o=t.exception&&t.exception.values;if(o){r=!0;for(const e of o){const t=e.mechanism
|
|
40
|
+
;if(t&&!1===t.handled){n=!0;break}}}const i="ok"===e.status;(i&&0===e.errors||i&&n)&&(Qe(e,{...n&&{status:"crashed"},errors:e.errors||Number(r||n)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Oe((t=>{let n=0;const r=setInterval((()=>{0==this._numProcessing?(clearInterval(r),t(!0)):(n+=1,e&&n>=e&&(clearInterval(r),t(!1)))}),1)}))}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._dsn}_prepareEvent(e,t,n){const{normalizeDepth:r=3,normalizeMaxBreadth:o=1e3}=this.getOptions(),i={...e,event_id:e.event_id||t.event_id||ye(),timestamp:e.timestamp||je()};this._applyClientOptions(i),this._applyIntegrationsMetadata(i);let a=n;t.captureContext&&(a=et.clone(a).update(t.captureContext));let s=ze(i);if(a){const e=[...t.attachments||[],...a.getAttachments()];e.length&&(t.attachments=e),s=a.applyToEvent(i,t)}return s.then((e=>"number"==typeof r&&r>0?this._normalizeEvent(e,r,o):e))}_normalizeEvent(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({
|
|
41
|
+
...e,...e.data&&{data:Te(e.data,t,n)}})))},...e.user&&{user:Te(e.user,t,n)},...e.contexts&&{contexts:Te(e.contexts,t,n)},...e.extra&&{extra:Te(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Te(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map((e=>(e.data&&(e.data=Te(e.data,t,n)),e)))),r}_applyClientOptions(e){const t=this.getOptions(),{environment:n,release:r,dist:o,maxValueLength:i=250}=t;"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=$(e.message,i));const a=e.exception&&e.exception.values&&e.exception.values[0];a&&a.value&&(a.value=$(a.value,i));const s=e.request;s&&s.url&&(s.url=$(s.url,i))}_applyIntegrationsMetadata(e){const t=Object.keys(this._integrations);t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}_captureEvent(e,t={},n){
|
|
42
|
+
return this._processEvent(e,t,n).then((e=>e.event_id),(e=>{if("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__){const t=e;"log"===t.logLevel?q.log(t.message):q.warn(t)}}))}_processEvent(e,t,n){const{beforeSend:r,sampleRate:o}=this.getOptions();if(!this._isEnabled())return Re(new I("SDK not enabled, will not capture event.","log"));const i="transaction"===e.type;return!i&&"number"==typeof o&&Math.random()>o?(this.recordDroppedEvent("sample_rate","error"),Re(new I(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"))):this._prepareEvent(e,t,n).then((n=>{if(null===n)throw this.recordDroppedEvent("event_processor",e.type||"error"),new I("An event processor returned null, will not send event.","log");if(t.data&&!0===t.data.__sentry__||i||!r)return n;return function(e){const t="`beforeSend` method has to return `null` or a valid event.";if(A(e))return e.then((e=>{if(!C(e)&&null!==e)throw new I(t);return e}),(e=>{throw new I(`beforeSend rejected with ${e}`)}))
|
|
43
|
+
;if(!C(e)&&null!==e)throw new I(t);return e}(r(n,t))})).then((r=>{if(null===r)throw this.recordDroppedEvent("before_send",e.type||"error"),new I("`beforeSend` returned `null`, will not send event.","log");const o=n&&n.getSession();!i&&o&&this._updateSessionFromEvent(o,r);const a=r.transaction_info;if(i&&a&&r.transaction!==e.transaction){const e="custom";r.transaction_info={...a,source:e,changes:[...a.changes,{source:e,timestamp:r.timestamp,propagations:a.propagations}]}}return this.sendEvent(r,t),r})).then(null,(e=>{if(e instanceof I)throw e;throw this.captureException(e,{data:{__sentry__:!0},originalException:e}),new I(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e){this._numProcessing+=1,e.then((e=>(this._numProcessing-=1,e)),(e=>(this._numProcessing-=1,e)))}_sendEnvelope(e){this._transport&&this._dsn?this._transport.send(e).then(null,(e=>{
|
|
44
|
+
("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.error("Error while sending event:",e)})):("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.error("Transport disabled")}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.keys(e).map((t=>{const[n,r]=t.split(":");return{reason:n,category:r,quantity:e[t]}}))}}function xt(e,t,n=Ie(e.bufferSize||30)){let r={};return{send:function(o){const i=[];if(Ge(o,((t,n)=>{const o=Xe(n);!function(e,t,n=Date.now()){return function(e,t){return e[t]||e.all||0}(e,t)>n}(r,o)?i.push(t):e.recordDroppedEvent("ratelimit_backoff",o)})),0===i.length)return ze();const a=qe(o[0],i),s=t=>{Ge(a,((n,r)=>{e.recordDroppedEvent(t,Xe(r))}))};return n.add((()=>t({body:Ye(a,e.textEncoder)}).then((e=>{void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),r=Ze(r,e)}),(e=>{
|
|
45
|
+
("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.error("Failed while sending event:",e),s("network_error")})))).then((e=>e),(e=>{if(e instanceof I)return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.error("Skipped sending event because buffer is full."),s("queue_overflow"),ze();throw e}))},flush:e=>n.drain(e)}}let kt;class St{constructor(){St.prototype.__init.call(this)}static __initStatic(){this.id="FunctionToString"}__init(){this.name=St.id}setupOnce(){kt=Function.prototype.toString,Function.prototype.toString=function(...e){const t=X(this)||this;return kt.apply(t,e)}}}St.__initStatic();const Ct=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class Et{static __initStatic(){this.id="InboundFilters"}__init(){this.name=Et.id}constructor(e={}){this._options=e,Et.prototype.__init.call(this)}setupOnce(e,t){const n=e=>{const n=t();if(n){const t=n.getIntegration(Et);if(t){const r=n.getClient(),o=r?r.getOptions():{},i=function(e={},t={}){return{
|
|
46
|
+
allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...Ct],ignoreInternal:void 0===e.ignoreInternal||e.ignoreInternal}}(t._options,o);return function(e,t){if(t.ignoreInternal&&function(e){try{return"SentryError"===e.exception.values[0].type}catch(e){}return!1}(e))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${xe(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;return function(e){if(e.message)return[e.message];if(e.exception)try{const{type:t="",value:n=""}=e.exception.values&&e.exception.values[0]||{};return[`${n}`,`${t}: ${n}`]}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.error(`Cannot extract message for event ${xe(e)}`),[]}return[]}(e).some((e=>t.some((t=>V(e,t)))))
|
|
47
|
+
}(e,t.ignoreErrors))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${xe(e)}`),!0;if(function(e,t){if(!t||!t.length)return!1;const n=At(e);return!!n&&t.some((e=>V(n,e)))}(e,t.denyUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${xe(e)}.\nUrl: ${At(e)}`),!0;if(!function(e,t){if(!t||!t.length)return!0;const n=At(e);return!n||t.some((e=>V(n,e)))}(e,t.allowUrls))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${xe(e)}.\nUrl: ${At(e)}`),!0;return!1}(e,i)?null:e}}return e};n.id=this.name,e(n)}}function At(e){try{let t;try{t=e.exception.values[0].stacktrace.frames}catch(e){}return t?function(e=[]){for(let t=e.length-1;t>=0;t--){const n=e[t];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}
|
|
48
|
+
return null}(t):null}catch(t){return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.error(`Cannot extract url for event ${xe(e)}`),null}}function Tt(e,t){const n=Mt(e,t),r={type:t&&t.name,value:zt(t)};return n.length&&(r.stacktrace={frames:n}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Nt(e,t){return{exception:{values:[Tt(e,t)]}}}function Mt(e,t){const n=t.stacktrace||t.stack||"",r=function(e){if(e){if("number"==typeof e.framesToPop)return e.framesToPop;if(Lt.test(e.message))return 1}return 0}(t);try{return e(n,r)}catch(e){}return[]}Et.__initStatic();const Lt=/Minified React error #\d+;/i;function zt(e){const t=e&&e.message;return t?t.error&&"string"==typeof t.error.message?t.error.message:t:"No error message"}function Rt(e,t,n,r,o){let i;if(w(t)&&t.error){return Nt(e,t.error)}if(x(t)||y(t,"DOMException")){const o=t;if("stack"in t)i=Nt(e,t);else{const t=o.name||(x(o)?"DOMError":"DOMException"),a=o.message?`${t}: ${o.message}`:t;i=Ot(e,a,n,r),ke(i,a)}
|
|
49
|
+
return"code"in o&&(i.tags={...i.tags,"DOMException.code":`${o.code}`}),i}if(b(t))return Nt(e,t);if(C(t)||E(t)){return i=function(e,t,n,r){const o=st().getClient(),i=o&&o.getOptions().normalizeDepth,a={exception:{values:[{type:E(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:`Non-Error ${r?"promise rejection":"exception"} captured with keys: ${ee(t)}`}]},extra:{__serialized__:Ne(t,i)}};if(n){const t=Mt(e,n);t.length&&(a.exception.values[0].stacktrace={frames:t})}return a}(e,t,n,o),Se(i,{synthetic:!0}),i}return i=Ot(e,t,n,r),ke(i,`${t}`,void 0),Se(i,{synthetic:!0}),i}function Ot(e,t,n,r){const o={message:t};if(r&&n){const r=Mt(e,n);r.length&&(o.exception={values:[{value:t,stacktrace:{frames:r}}]})}return o}class It{static __initStatic(){this.id="Breadcrumbs"}__init(){this.name=It.id}constructor(e){It.prototype.__init.call(this),this.options={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e}}setupOnce(){this.options.console&&ue("console",Dt),this.options.dom&&ue("dom",function(e){
|
|
50
|
+
function t(t){let n,r="object"==typeof e?e.serializeAttribute:void 0;"string"==typeof r&&(r=[r]);try{n=t.event.target?R(t.event.target,r):R(t.event,r)}catch(e){n="<unknown>"}0!==n.length&&st().addBreadcrumb({category:`ui.${t.name}`,message:n},{event:t.event,name:t.name,global:t.global})}return t}(this.options.dom)),this.options.xhr&&ue("xhr",Pt),this.options.fetch&&ue("fetch",Bt),this.options.history&&ue("history",Ft)}}function Dt(e){const t={category:"console",data:{arguments:e.args,logger:"console"},level:(n=e.level,"warn"===n?"warning":Pe.includes(n)?n:"log"),message:G(e.args," ")};var n;if("assert"===e.level){if(!1!==e.args[0])return;t.message=`Assertion failed: ${G(e.args.slice(1)," ")||"console.assert"}`,t.data.arguments=e.args.slice(1)}st().addBreadcrumb(t,{input:e.args,level:e.level})}function Pt(e){if(e.endTimestamp){if(e.xhr.__sentry_own_request__)return;const{method:t,url:n,status_code:r,body:o}=e.xhr.__sentry_xhr__||{};st().addBreadcrumb({category:"xhr",data:{method:t,url:n,status_code:r},
|
|
51
|
+
type:"http"},{xhr:e.xhr,input:o})}else;}function Bt(e){e.endTimestamp&&(e.fetchData.url.match(/sentry_key/)&&"POST"===e.fetchData.method||(e.error?st().addBreadcrumb({category:"fetch",data:e.fetchData,level:"error",type:"http"},{data:e.error,input:e.args}):st().addBreadcrumb({category:"fetch",data:{...e.fetchData,status_code:e.response.status},type:"http"},{input:e.args,response:e.response})))}function Ft(e){let t=e.from,n=e.to;const r=De(z.location.href);let o=De(t);const i=De(n);o.path||(o=r),r.protocol===i.protocol&&r.host===i.host&&(n=i.relative),r.protocol===o.protocol&&r.host===o.host&&(t=o.relative),st().addBreadcrumb({category:"navigation",data:{from:t,to:n}})}It.__initStatic();class Ht extends wt{constructor(e){e._metadata=e._metadata||{},e._metadata.sdk=e._metadata.sdk||{name:"sentry.javascript.browser",packages:[{name:"npm:@sentry/browser",version:"7.16.0"}],version:"7.16.0"},super(e),e.sendClientReports&&z.document&&z.document.addEventListener("visibilitychange",(()=>{
|
|
52
|
+
"hidden"===z.document.visibilityState&&this._flushOutcomes()}))}eventFromException(e,t){return function(e,t,n,r){const o=Rt(e,t,n&&n.syntheticException||void 0,r);return Se(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),ze(o)}(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",n){return function(e,t,n="info",r,o){const i=Ot(e,t,r&&r.syntheticException||void 0,o);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),ze(i)}(this._options.stackParser,e,t,n,this._options.attachStacktrace)}sendEvent(e,t){const n=this.getIntegrationById("Breadcrumbs");n&&n.options&&n.options.sentry&&st().addBreadcrumb({category:"sentry."+("transaction"===e.type?"transaction":"event"),event_id:e.event_id,level:e.level,message:xe(e)},{event:e}),super.sendEvent(e,t)}_prepareEvent(e,t,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,n)}_flushOutcomes(){const e=this._clearOutcomes()
|
|
53
|
+
;if(0===e.length)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.log("No outcomes to send"));if(!this._dsn)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.log("No dsn provided, will not send outcomes"));("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.log("Sending outcomes:",e);const t=ft(this._dsn,this._options),n=(r=e,qe((o=this._options.tunnel&&P(this._dsn))?{dsn:o}:{},[[{type:"client_report"},{timestamp:i||je(),discarded_events:r}]]));var r,o,i;try{const e="[object Navigator]"===Object.prototype.toString.call(z&&z.navigator);if(e&&"function"==typeof z.navigator.sendBeacon&&!this._options.transportOptions){z.navigator.sendBeacon.bind(z.navigator)(t,Ye(n))}else this._sendEnvelope(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.error(e)}}}let jt;function Ut(e,t=function(){if(jt)return jt;if(ae(z.fetch))return jt=z.fetch.bind(z);const e=z.document;let t=z.fetch;if(e&&"function"==typeof e.createElement)try{
|
|
54
|
+
const n=e.createElement("iframe");n.hidden=!0,e.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(t=r.fetch),e.head.removeChild(n)}catch(e){("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return jt=t.bind(z)}()){return xt(e,(function(n){const r={body:n.body,method:"POST",referrerPolicy:"origin",headers:e.headers,keepalive:n.body.length<=65536,...e.fetchOptions};return t(e.url,r).then((e=>({statusCode:e.status,headers:{"x-sentry-rate-limits":e.headers.get("X-Sentry-Rate-Limits"),"retry-after":e.headers.get("Retry-After")}})))}))}function qt(e){return xt(e,(function(t){return new Oe(((n,r)=>{const o=new XMLHttpRequest;o.onerror=r,o.onreadystatechange=()=>{4===o.readyState&&n({statusCode:o.status,headers:{"x-sentry-rate-limits":o.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":o.getResponseHeader("Retry-After")}})},o.open("POST",e.url)
|
|
55
|
+
;for(const t in e.headers)Object.prototype.hasOwnProperty.call(e.headers,t)&&o.setRequestHeader(t,e.headers[t]);o.send(t.body)}))}))}function $t(e,t,n,r){const o={filename:e,function:t,in_app:!0};return void 0!==n&&(o.lineno=n),void 0!==r&&(o.colno=r),o}const Gt=/^\s*at (?:(.*\).*?|.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Vt=/\((\S*)(?::(\d+))(?::(\d+))\)/,Yt=[30,e=>{const t=Gt.exec(e);if(t){if(t[2]&&0===t[2].indexOf("eval")){const e=Vt.exec(t[2]);e&&(t[2]=e[1],t[3]=e[2],t[4]=e[3])}const[e,n]=Qt(t[1]||"?",t[2]);return $t(n,e,t[3]?+t[3]:void 0,t[4]?+t[4]:void 0)}}],Wt=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|safari-extension|safari-web-extension|capacitor)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Kt=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Xt=[50,e=>{const t=Wt.exec(e);if(t){
|
|
56
|
+
if(t[3]&&t[3].indexOf(" > eval")>-1){const e=Kt.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],n=t[1]||"?";return[n,e]=Qt(n,e),$t(e,n,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}}],Zt=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Jt=re(...[Yt,Xt,[40,e=>{const t=Zt.exec(e);return t?$t(t[2],t[1]||"?",+t[3],t[4]?+t[4]:void 0):void 0}]]),Qt=(e,t)=>{const 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]};let en=0;function tn(){return en>0}function nn(){en+=1,setTimeout((()=>{en-=1}))}function rn(e,t={},n){if("function"!=typeof e)return e;try{const t=e.__sentry_wrapped__;if(t)return t;if(X(e))return e}catch(t){return e}const r=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const o=r.map((e=>rn(e,t)));return e.apply(this,o)
|
|
57
|
+
}catch(e){throw nn(),pt((n=>{n.addEventProcessor((e=>(t.mechanism&&(ke(e,void 0,void 0),Se(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),dt(e)})),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch(e){}K(r,e),W(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch(e){}return r}class on{static __initStatic(){this.id="GlobalHandlers"}__init(){this.name=on.id}__init2(){this._installFunc={onerror:an,onunhandledrejection:sn}}constructor(e){on.prototype.__init.call(this),on.prototype.__init2.call(this),this._options={onerror:!0,onunhandledrejection:!0,...e}}setupOnce(){Error.stackTraceLimit=50;const e=this._options;for(const n in e){const r=this._installFunc[n];r&&e[n]&&(t=n,("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.log(`Global Handler attached: ${t}`),r(),this._installFunc[n]=void 0)}var t}}function an(){ue("error",(e=>{const[t,n,r]=un();if(!t.getIntegration(on))return
|
|
58
|
+
;const{msg:o,url:i,line:a,column:s,error:l}=e;if(tn()||l&&l.__sentry_own_request__)return;const c=void 0===l&&k(o)?function(e,t,n,r){const o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let i=w(e)?e.message:e,a="Error";const s=i.match(o);s&&(a=s[1],i=s[2]);return ln({exception:{values:[{type:a,value:i}]}},t,n,r)}(o,i,a,s):ln(Rt(n,l||o,void 0,r,!1),i,a,s);c.level="error",cn(t,l,c,"onerror")}))}function sn(){ue("unhandledrejection",(e=>{const[t,n,r]=un();if(!t.getIntegration(on))return;let o=e;try{"reason"in e?o=e.reason:"detail"in e&&"reason"in e.detail&&(o=e.detail.reason)}catch(e){}if(tn()||o&&o.__sentry_own_request__)return!0;const i=S(o)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(o)}`}]}}:Rt(n,o,void 0,r,!0);i.level="error",cn(t,o,i,"onunhandledrejection")}))}function ln(e,t,n,r){
|
|
59
|
+
const 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,d=k(t)&&t.length>0?t:function(){try{return z.document.location.href}catch(e){return""}}();return 0===l.length&&l.push({colno:c,filename:d,function:"?",in_app:!0,lineno:u}),e}function cn(e,t,n,r){Se(n,{handled:!1,type:r}),e.captureEvent(n,{originalException:t})}function un(){const e=st(),t=e.getClient(),n=t&&t.getOptions()||{stackParser:()=>[],attachStacktrace:!1};return[e,n.stackParser,n.attachStacktrace]}on.__initStatic()
|
|
60
|
+
;const dn=["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"];class hn{static __initStatic(){this.id="TryCatch"}__init(){this.name=hn.id}constructor(e){hn.prototype.__init.call(this),this._options={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,...e}}setupOnce(){this._options.setTimeout&&Y(z,"setTimeout",pn),this._options.setInterval&&Y(z,"setInterval",pn),this._options.requestAnimationFrame&&Y(z,"requestAnimationFrame",mn),this._options.XMLHttpRequest&&"XMLHttpRequest"in z&&Y(XMLHttpRequest.prototype,"send",fn);const e=this._options.eventTarget;if(e){
|
|
61
|
+
(Array.isArray(e)?e:dn).forEach(gn)}}}function pn(e){return function(...t){const n=t[0];return t[0]=rn(n,{mechanism:{data:{function:oe(e)},handled:!0,type:"instrument"}}),e.apply(this,t)}}function mn(e){return function(t){return e.apply(this,[rn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:oe(e)},handled:!0,type:"instrument"}})])}}function fn(e){return function(...t){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in n&&"function"==typeof n[e]&&Y(n,e,(function(t){const n={mechanism:{data:{function:e,handler:oe(t)},handled:!0,type:"instrument"}},r=X(t);return r&&(n.mechanism.data.handler=oe(r)),rn(t,n)}))})),e.apply(this,t)}}function gn(e){const t=z,n=t[e]&&t[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(Y(n,"addEventListener",(function(t){return function(n,r,o){try{"function"==typeof r.handleEvent&&(r.handleEvent=rn(r.handleEvent,{mechanism:{data:{function:"handleEvent",handler:oe(r),target:e},handled:!0,type:"instrument"}}))
|
|
62
|
+
}catch(e){}return t.apply(this,[n,rn(r,{mechanism:{data:{function:"addEventListener",handler:oe(r),target:e},handled:!0,type:"instrument"}}),o])}})),Y(n,"removeEventListener",(function(e){return function(t,n,r){const o=n;try{const n=o&&o.__sentry_wrapped__;n&&e.call(this,t,n,r)}catch(e){}return e.call(this,t,o,r)}})))}hn.__initStatic();class vn{static __initStatic(){this.id="LinkedErrors"}__init(){this.name=vn.id}constructor(e={}){vn.prototype.__init.call(this),this._key=e.key||"cause",this._limit=e.limit||5}setupOnce(){const e=st().getClient();e&&nt(((t,n)=>{const r=st().getIntegration(vn);return r?function(e,t,n,r,o){if(!(r.exception&&r.exception.values&&o&&T(o.originalException,Error)))return r;const i=_n(e,n,o.originalException,t);return r.exception.values=[...i,...r.exception.values],r}(e.getOptions().stackParser,r._key,r._limit,t,n):t}))}}function _n(e,t,n,r,o=[]){if(!T(n[r],Error)||o.length+1>=t)return o;const i=Tt(e,n[r]);return _n(e,t,n[r],r,[i,...o])}vn.__initStatic();class bn{constructor(){
|
|
63
|
+
bn.prototype.__init.call(this)}static __initStatic(){this.id="HttpContext"}__init(){this.name=bn.id}setupOnce(){nt((e=>{if(st().getIntegration(bn)){if(!z.navigator&&!z.location&&!z.document)return e;const t=e.request&&e.request.url||z.location&&z.location.href,{referrer:n}=z.document||{},{userAgent:r}=z.navigator||{},o={...t&&{url:t},headers:{...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}}};return{...e,request:o}}return e}))}}bn.__initStatic();class yn{constructor(){yn.prototype.__init.call(this)}static __initStatic(){this.id="Dedupe"}__init(){this.name=yn.id}setupOnce(e,t){const n=e=>{const n=t().getIntegration(yn);if(n){try{if(function(e,t){if(!t)return!1;if(function(e,t){const n=e.message,r=t.message;if(!n&&!r)return!1;if(n&&!r||!n&&r)return!1;if(n!==r)return!1;if(!xn(e,t))return!1;if(!wn(e,t))return!1;return!0}(e,t))return!0;if(function(e,t){const n=kn(t),r=kn(e);if(!n||!r)return!1;if(n.type!==r.type||n.value!==r.value)return!1;if(!xn(e,t))return!1;if(!wn(e,t))return!1;return!0
|
|
64
|
+
}(e,t))return!0;return!1}(e,n._previousEvent))return("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn("Event dropped due to being a duplicate of previously captured event."),null}catch(t){return n._previousEvent=e}return n._previousEvent=e}return e};n.id=this.name,e(n)}}function wn(e,t){let n=Sn(e),r=Sn(t);if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;if(r.length!==n.length)return!1;for(let e=0;e<r.length;e++){const t=r[e],o=n[e];if(t.filename!==o.filename||t.lineno!==o.lineno||t.colno!==o.colno||t.function!==o.function)return!1}return!0}function xn(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;try{return!(n.join("")!==r.join(""))}catch(e){return!1}}function kn(e){return e.exception&&e.exception.values&&e.exception.values[0]}function Sn(e){const t=e.exception;if(t)try{return t.values[0].stacktrace.frames}catch(e){return}}yn.__initStatic();const Cn=[new Et,new St,new hn,new It,new on,new vn,new yn,new bn];function En(e={}){
|
|
65
|
+
void 0===e.defaultIntegrations&&(e.defaultIntegrations=Cn),void 0===e.release&&z.SENTRY_RELEASE&&z.SENTRY_RELEASE.id&&(e.release=z.SENTRY_RELEASE.id),void 0===e.autoSessionTracking&&(e.autoSessionTracking=!0),void 0===e.sendClientReports&&(e.sendClientReports=!0);const t={...e,stackParser:(n=e.stackParser||Jt,Array.isArray(n)?re(...n):n),integrations:bt(e),transport:e.transport||(ie()?Ut:qt)};var n;!function(e,t){!0===t.debug&&("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__?q.enable():console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle."));const n=st(),r=n.getScope();r&&r.update(t.initialScope);const o=new e(t);n.bindClient(o)}(Ht,t),e.autoSessionTracking&&function(){if(void 0===z.document)return void(("undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__)&&q.warn("Session tracking in non-browser environment with @sentry/browser is not supported."));const e=st();if(!e.captureSession)return;An(e),ue("history",(({from:e,to:t})=>{void 0!==e&&e!==t&&An(st())}))}()}
|
|
66
|
+
function An(e){e.startSession({ignoreDuration:!0}),e.captureSession()}function Tn(e){const t=t=>{const{data:n}=t;if(n&&"hypothesis-error"===(null==n?void 0:n.type)){const{context:t,error:r}=n;e(r instanceof Error?r:function(e){const t=new Error(e.message);return t.stack=e.stack,t}(r),t)}};return window.addEventListener("message",t),()=>window.removeEventListener("message",t)}let Nn=0;function Mn(e){!function(e){st().setUser(e)}(e)}!function(){function e(e){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){
|
|
66
67
|
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 d(e){i(e.target)&&(t||a(e.target))&&s(e.target)}function h(e){i(e.target)&&(e.target.classList.contains("focus-visible")||e.target.hasAttribute("data-focus-visible-added"))&&(n=!0,window.clearTimeout(r),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),
|
|
67
68
|
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())}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",d,!0),e.addEventListener("blur",h,!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",""))}
|
|
68
|
-
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)}();var
|
|
69
|
-
for(var n in t)e[n]=t[n];return e}function
|
|
70
|
-
;e.__d&&(i=(o=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=
|
|
71
|
-
"function"==typeof n.type&&(n.__d=l)):l&&h.__e==l&&l.parentNode!=e&&(l=
|
|
72
|
-
;if(n)for(t in n)r&&n[t]===r[t]||
|
|
73
|
-
n.__c?f=(u=t.__c=n.__c).__=u.__E:("prototype"in S&&S.prototype.render?t.__c=u=new S(g,_):(t.__c=u=new
|
|
74
|
-
null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,_),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(h,p,m)}))}if(u.context=_,u.props=g,u.__v=t,u.__P=e,y=
|
|
75
|
-
e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){
|
|
76
|
-
;for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||
|
|
77
|
-
return this.constructor(e,n)}function
|
|
78
|
-
e.children}};return n.Provider.__=n.Consumer.contextType=n}
|
|
79
|
-
;if(r.t=e,!r.__c&&(r.__=[n?n(t):
|
|
80
|
-
t?(null==n.__&&(n.__=!0,t.sub(
|
|
81
|
-
t.some((function(e){e.__h&&(e.__h=[])})),t=[],
|
|
82
|
-
const
|
|
83
|
-
p["aria-expanded"]=s),
|
|
84
|
-
|
|
85
|
-
columnNumber:5})}function
|
|
86
|
-
function
|
|
87
|
-
className:"Hyp-Dialog__close",children:
|
|
88
|
-
fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:62,columnNumber:5})}function
|
|
89
|
-
;return
|
|
90
|
-
children:[t&&
|
|
91
|
-
const
|
|
92
|
-
;function
|
|
93
|
-
var
|
|
94
|
-
;const
|
|
69
|
+
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)}();var Ln={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)}}else if("object"===i){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){e.push(o.toString());continue}for(var s in o)t.call(o,s)&&o[s]&&e.push(s)}}}return e.join(" ")}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(Ln);var zn,Rn,On,In,Dn,Pn,Bn=Ln.exports,Fn={},Hn=[],jn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function Un(e,t){
|
|
70
|
+
for(var n in t)e[n]=t[n];return e}function qn(e){var t=e.parentNode;t&&t.removeChild(e)}function $n(e,t,n,r,o){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:null==o?++On:o};return null==o&&null!=Rn.vnode&&Rn.vnode(i),i}function Gn(e){return e.children}function Vn(e,t){this.props=e,this.context=t}function Yn(e,t){if(null==t)return e.__?Yn(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?Yn(e):null}function Wn(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 Wn(e)}}function Kn(e){(!e.__d&&(e.__d=!0)&&In.push(e)&&!Xn.__r++||Dn!==Rn.debounceRendering)&&((Dn=Rn.debounceRendering)||setTimeout)(Xn)}function Xn(){for(var e;Xn.__r=In.length;)e=In.sort((function(e,t){return e.__v.__b-t.__v.__b})),In=[],e.some((function(e){var t,n,r,o,i,a
|
|
71
|
+
;e.__d&&(i=(o=(t=e).__v).__e,(a=t.__P)&&(n=[],(r=Un({},o)).__v=o.__v+1,ir(a,o,r,t.__n,void 0!==a.ownerSVGElement,null!=o.__h?[i]:null,n,null==i?Yn(o):i,o.__h),ar(n,o),o.__e!=i&&Wn(o)))}))}function Zn(e,t,n,r,o,i,a,s,l,c){var u,d,h,p,m,f,g,v=r&&r.__k||Hn,_=v.length;for(n.__k=[],u=0;u<t.length;u++)if(null!=(p=n.__k[u]=null==(p=t[u])||"boolean"==typeof p?null:"string"==typeof p||"number"==typeof p||"bigint"==typeof p?$n(null,p,null,null,p):Array.isArray(p)?$n(Gn,{children:p},null,null,null):p.__b>0?$n(p.type,p.props,p.key,p.ref?p.ref:null,p.__v):p)){if(p.__=n,p.__b=n.__b+1,null===(h=v[u])||h&&p.key==h.key&&p.type===h.type)v[u]=void 0;else for(d=0;d<_;d++){if((h=v[d])&&p.key==h.key&&p.type===h.type){v[d]=void 0;break}h=null}ir(e,p,h=h||Fn,o,i,a,s,l,c),m=p.__e,(d=p.ref)&&h.ref!=d&&(g||(g=[]),h.ref&&g.push(h.ref,null,p),g.push(d,p.__c||m,p)),null!=m?(null==f&&(f=m),"function"==typeof p.type&&p.__k===h.__k?p.__d=l=Jn(p,l,e):l=er(e,p,h,v,m,l),
|
|
72
|
+
"function"==typeof n.type&&(n.__d=l)):l&&h.__e==l&&l.parentNode!=e&&(l=Yn(h))}for(n.__e=f,u=_;u--;)null!=v[u]&&cr(v[u],v[u]);if(g)for(u=0;u<g.length;u++)lr(g[u],g[++u],g[++u])}function Jn(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?Jn(r,t,n):er(n,r,r,o,r.__e,t));return t}function Qn(e,t){return t=t||[],null==e||"boolean"==typeof e||(Array.isArray(e)?e.some((function(e){Qn(e,t)})):t.push(e)),t}function er(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 tr(e,t,n){"-"===t[0]?e.setProperty(t,n):e[t]=null==n?"":"number"!=typeof n||jn.test(t)?n:n+"px"}function nr(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||tr(e.style,t,"")
|
|
73
|
+
;if(n)for(t in n)r&&n[t]===r[t]||tr(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?or:rr,i):e.removeEventListener(t,i?or:rr,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&&-1==t.indexOf("-")?e.removeAttribute(t):e.setAttribute(t,n))}}function rr(e){this.l[e.type+!1](Rn.event?Rn.event(e):e)}function or(e){this.l[e.type+!0](Rn.event?Rn.event(e):e)}function ir(e,t,n,r,o,i,a,s,l){var c,u,d,h,p,m,f,g,v,_,b,y,w,x,k,S=t.type;if(void 0!==t.constructor)return null;null!=n.__h&&(l=n.__h,s=t.__e=n.__e,t.__h=null,i=[s]),(c=Rn.__b)&&c(t);try{e:if("function"==typeof S){if(g=t.props,v=(c=S.contextType)&&r[c.__c],_=c?v?v.props.value:c.__:r,
|
|
74
|
+
n.__c?f=(u=t.__c=n.__c).__=u.__E:("prototype"in S&&S.prototype.render?t.__c=u=new S(g,_):(t.__c=u=new Vn(g,_),u.constructor=S,u.render=ur),v&&v.sub(u),u.props=g,u.state||(u.state={}),u.context=_,u.__n=r,d=u.__d=!0,u.__h=[],u._sb=[]),null==u.__s&&(u.__s=u.state),null!=S.getDerivedStateFromProps&&(u.__s==u.state&&(u.__s=Un({},u.__s)),Un(u.__s,S.getDerivedStateFromProps(g,u.__s))),h=u.props,p=u.state,d)null==S.getDerivedStateFromProps&&null!=u.componentWillMount&&u.componentWillMount(),null!=u.componentDidMount&&u.__h.push(u.componentDidMount);else{if(null==S.getDerivedStateFromProps&&g!==h&&null!=u.componentWillReceiveProps&&u.componentWillReceiveProps(g,_),!u.__e&&null!=u.shouldComponentUpdate&&!1===u.shouldComponentUpdate(g,u.__s,_)||t.__v===n.__v){for(u.props=g,u.state=u.__s,t.__v!==n.__v&&(u.__d=!1),u.__v=t,t.__e=n.__e,t.__k=n.__k,t.__k.forEach((function(e){e&&(e.__=t)})),b=0;b<u._sb.length;b++)u.__h.push(u._sb[b]);u._sb=[],u.__h.length&&a.push(u);break e}
|
|
75
|
+
null!=u.componentWillUpdate&&u.componentWillUpdate(g,u.__s,_),null!=u.componentDidUpdate&&u.__h.push((function(){u.componentDidUpdate(h,p,m)}))}if(u.context=_,u.props=g,u.__v=t,u.__P=e,y=Rn.__r,w=0,"prototype"in S&&S.prototype.render){for(u.state=u.__s,u.__d=!1,y&&y(t),c=u.render(u.props,u.state,u.context),x=0;x<u._sb.length;x++)u.__h.push(u._sb[x]);u._sb=[]}else do{u.__d=!1,y&&y(t),c=u.render(u.props,u.state,u.context),u.state=u.__s}while(u.__d&&++w<25);u.state=u.__s,null!=u.getChildContext&&(r=Un(Un({},r),u.getChildContext())),d||null==u.getSnapshotBeforeUpdate||(m=u.getSnapshotBeforeUpdate(h,p)),k=null!=c&&c.type===Gn&&null==c.key?c.props.children:c,Zn(e,Array.isArray(k)?k:[k],t,n,r,o,i,a,s,l),u.base=t.__e,t.__h=null,u.__h.length&&a.push(u),f&&(u.__E=u.__=null),u.__e=!1}else null==i&&t.__v===n.__v?(t.__k=n.__k,t.__e=n.__e):t.__e=sr(n.__e,t,n,r,o,i,a,l);(c=Rn.diffed)&&c(t)}catch(e){t.__v=null,(l||null!=i)&&(t.__e=s,t.__h=!!l,i[i.indexOf(s)]=null),Rn.__e(e,t,n)}}function ar(e,t){Rn.__c&&Rn.__c(t,e),
|
|
76
|
+
e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(e){Rn.__e(e,t.__v)}}))}function sr(e,t,n,r,o,i,a,s){var l,c,u,d=n.props,h=t.props,p=t.type,m=0;if("svg"===p&&(o=!0),null!=i)for(;m<i.length;m++)if((l=i[m])&&"setAttribute"in l==!!p&&(p?l.localName===p:3===l.nodeType)){e=l,i[m]=null;break}if(null==e){if(null===p)return document.createTextNode(h);e=o?document.createElementNS("http://www.w3.org/2000/svg",p):document.createElement(p,h.is&&h),i=null,s=!1}if(null===p)d===h||s&&e.data===h||(e.data=h);else{if(i=i&&zn.call(e.childNodes),c=(d=n.props||Fn).dangerouslySetInnerHTML,u=h.dangerouslySetInnerHTML,!s){if(null!=i)for(d={},m=0;m<e.attributes.length;m++)d[e.attributes[m].name]=e.attributes[m].value;(u||c)&&(u&&(c&&u.__html==c.__html||u.__html===e.innerHTML)||(e.innerHTML=u&&u.__html||""))}if(function(e,t,n,r,o){var i;for(i in n)"children"===i||"key"===i||i in t||nr(e,i,null,n[i],r)
|
|
77
|
+
;for(i in t)o&&"function"!=typeof t[i]||"children"===i||"key"===i||"value"===i||"checked"===i||n[i]===t[i]||nr(e,i,t[i],n[i],r)}(e,h,d,o,s),u)t.__k=[];else if(m=t.props.children,Zn(e,Array.isArray(m)?m:[m],t,n,r,o&&"foreignObject"!==p,i,a,i?i[0]:n.__k&&Yn(n,0),s),null!=i)for(m=i.length;m--;)null!=i[m]&&qn(i[m]);s||("value"in h&&void 0!==(m=h.value)&&(m!==e.value||"progress"===p&&!m||"option"===p&&m!==d.value)&&nr(e,"value",m,d.value,!1),"checked"in h&&void 0!==(m=h.checked)&&m!==e.checked&&nr(e,"checked",m,d.checked,!1))}return e}function lr(e,t,n){try{"function"==typeof e?e(t):e.current=t}catch(e){Rn.__e(e,n)}}function cr(e,t,n){var r,o;if(Rn.unmount&&Rn.unmount(e),(r=e.ref)&&(r.current&&r.current!==e.__e||lr(r,null,t)),null!=(r=e.__c)){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(e){Rn.__e(e,t)}r.base=r.__P=null,e.__c=void 0}if(r=e.__k)for(o=0;o<r.length;o++)r[o]&&cr(r[o],t,n||"function"!=typeof e.type);n||null==e.__e||qn(e.__e),e.__=e.__e=e.__d=void 0}function ur(e,t,n){
|
|
78
|
+
return this.constructor(e,n)}function dr(e,t,n){var r,o,i;Rn.__&&Rn.__(e,t),o=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],ir(t,e=(!r&&n||t).__k=function(e,t,n){var r,o,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?o=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?zn.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)void 0===a[i]&&(a[i]=e.defaultProps[i]);return $n(e,a,r,o,null)}(Gn,null,[e]),o||Fn,Fn,void 0!==t.ownerSVGElement,!r&&n?[n]:o?null:t.firstChild?zn.call(t.childNodes):null,i,!r&&n?n:o?o.__e:t.firstChild,r),ar(i,e)}function hr(e,t){var n={__c:t="__cC"+Pn++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var n,r;return this.getChildContext||(n=[],(r={})[t]=this,this.getChildContext=function(){return r},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&n.some(Kn)},this.sub=function(e){n.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){n.splice(n.indexOf(e),1),t&&t.call(e)}}),
|
|
79
|
+
e.children}};return n.Provider.__=n.Consumer.contextType=n}zn=Hn.slice,Rn={__e:function(e,t,n,r){for(var o,i,a;t=t.__;)if((o=t.__c)&&!o.__)try{if((i=o.constructor)&&null!=i.getDerivedStateFromError&&(o.setState(i.getDerivedStateFromError(e)),a=o.__d),null!=o.componentDidCatch&&(o.componentDidCatch(e,r||{}),a=o.__d),a)return o.__E=o}catch(t){e=t}throw e}},On=0,Vn.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=Un({},this.state),"function"==typeof e&&(e=e(Un({},n),this.props)),e&&Un(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),Kn(this))},Vn.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),Kn(this))},Vn.prototype.render=Gn,In=[],Xn.__r=0,Pn=0;var pr,mr,fr,gr,vr=0,_r=[],br=[],yr=Rn.__b,wr=Rn.__r,xr=Rn.diffed,kr=Rn.__c,Sr=Rn.unmount;function Cr(e,t){Rn.__h&&Rn.__h(mr,e,vr||t),vr=0;var n=mr.__H||(mr.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({__V:br}),n.__[e]}function Er(e){return vr=1,Ar(Hr,e)}function Ar(e,t,n){var r=Cr(pr++,2)
|
|
80
|
+
;if(r.t=e,!r.__c&&(r.__=[n?n(t):Hr(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=mr,!mr.u)){mr.u=!0;var o=mr.shouldComponentUpdate;mr.shouldComponentUpdate=function(e,t,n){if(!r.__c.__H)return!0;var i=r.__c.__H.__.filter((function(e){return e.__c}));if(i.every((function(e){return!e.__N})))return!o||o.call(this,e,t,n);var a=!1;return i.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),!(!a&&r.__c.props===e)&&(!o||o.call(this,e,t,n))}}return r.__N||r.__}function Tr(e,t){var n=Cr(pr++,3);!Rn.__s&&Fr(n.__H,t)&&(n.__=e,n.i=t,mr.__H.__h.push(n))}function Nr(e,t){var n=Cr(pr++,4);!Rn.__s&&Fr(n.__H,t)&&(n.__=e,n.i=t,mr.__h.push(n))}function Mr(e){return vr=5,Lr((function(){return{current:e}}),[])}function Lr(e,t){var n=Cr(pr++,7);return Fr(n.__H,t)?(n.__V=e(),n.i=t,n.__h=e,n.__V):n.__}function zr(e,t){return vr=8,Lr((function(){return e}),t)}function Rr(e){var t=mr.context[e.__c],n=Cr(pr++,9);return n.c=e,
|
|
81
|
+
t?(null==n.__&&(n.__=!0,t.sub(mr)),t.props.value):e.__}function Or(){for(var e;e=_r.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Pr),e.__H.__h.forEach(Br),e.__H.__h=[]}catch(t){e.__H.__h=[],Rn.__e(t,e.__v)}}Rn.__b=function(e){"function"!=typeof e.type||e.__m||null===e.__?e.__m||(e.__m=e.__&&e.__.__m?e.__.__m:""):e.__m=(e.__&&e.__.__m?e.__.__m:"")+(e.__&&e.__.__k?e.__.__k.indexOf(e):0),mr=null,yr&&yr(e)},Rn.__r=function(e){wr&&wr(e),pr=0;var t=(mr=e.__c).__H;t&&(fr===mr?(t.__h=[],mr.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=br,e.__N=e.i=void 0}))):(t.__h.forEach(Pr),t.__h.forEach(Br),t.__h=[])),fr=mr},Rn.diffed=function(e){xr&&xr(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==_r.push(t)&&gr===Rn.requestAnimationFrame||((gr=Rn.requestAnimationFrame)||Dr)(Or)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==br&&(e.__=e.__V),e.i=void 0,e.__V=br}))),fr=mr=null},Rn.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Pr),e.__h=e.__h.filter((function(e){return!e.__||Br(e)}))}catch(n){
|
|
82
|
+
t.some((function(e){e.__h&&(e.__h=[])})),t=[],Rn.__e(n,e.__v)}})),kr&&kr(e,t)},Rn.unmount=function(e){Sr&&Sr(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach((function(e){try{Pr(e)}catch(e){t=e}})),n.__H=void 0,t&&Rn.__e(t,n.__v))};var Ir="function"==typeof requestAnimationFrame;function Dr(e){var t,n=function(){clearTimeout(r),Ir&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);Ir&&(t=requestAnimationFrame(n))}function Pr(e){var t=mr,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),mr=t}function Br(e){var t=mr;e.__c=e.__(),mr=t}function Fr(e,t){return!e||e.length!==t.length||t.some((function(t,n){return t!==e[n]}))}function Hr(e,t){return"function"==typeof t?t(e):t}var jr=0;function Ur(e,t,n,r,o){var i,a,s={};for(a in t)"ref"==a?i=t[a]:s[a]=t[a];var l={type:e,props:s,key:n,ref:i,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:--jr,__source:o,__self:r};if("function"==typeof e&&(i=e.defaultProps))for(a in i)void 0===s[a]&&(s[a]=i[a]);return Rn.vnode&&Rn.vnode(l),l}
|
|
83
|
+
const qr=new Map;function $r({name:e,className:t="",inline:n=!1,title:r=""}){const o=qr.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=Mr();Nr((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",t)}),[t,o]);const a={};return r&&(a.title=r),Ur("span",{className:Bn("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 Gr(e,t){const n="string"==typeof e?Symbol(e):e;return qr.set(n,t),n}var Vr="/home/runner/work/frontend-shared/frontend-shared/src/components/buttons.js";function Yr({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 d;const h=null!==(d=null==u?void 0:u.role)&&void 0!==d?d:"button",p={"aria-label":u.title};return"tab"===h?p["aria-selected"]=l:(p["aria-pressed"]=l,
|
|
84
|
+
p["aria-expanded"]=s),Ur("button",{ref:e,className:Bn(n,`${n}--${i}`,`${n}--${a}`,{[`${n}--icon-${o}`]:r},t),type:c,...p,...u},void 0,!1,{fileName:Vr,lineNumber:82,columnNumber:5})}function Wr({className:e="Hyp-IconButton",...t}){const{icon:n}=t;return Ur(Yr,{className:e,...t,children:Ur($r,{name:n},void 0,!1,{fileName:Vr,lineNumber:110,columnNumber:7})},void 0,!1,{fileName:Vr,lineNumber:109,columnNumber:5})}function Kr({children:e,className:t="Hyp-LabeledButton",...n}){const{icon:r,iconPosition:o="left"}=n;return Ur(Yr,{className:t,...n,children:[r&&"left"===o&&Ur($r,{name:r},void 0,!1,{fileName:Vr,lineNumber:129,columnNumber:43}),e,r&&"right"===o&&Ur($r,{name:r},void 0,!1,{fileName:Vr,lineNumber:131,columnNumber:44})]},void 0,!0,{fileName:Vr,lineNumber:128,columnNumber:5})}function Xr(e){return Ur(Yr,{className:"Hyp-LinkButton",...e},void 0,!1,{fileName:Vr,lineNumber:143,columnNumber:10})}
|
|
85
|
+
Gr("checkbox",' <svg\n width="16"\n height="16"\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 Zr="/home/runner/work/frontend-shared/frontend-shared/src/components/containers.js";function Jr({children:e,classes:t,containerRef:n,elementRef:r,...o}){return Ur("div",{className:Bn("Hyp-Frame",t),...o,ref:null!=r?r:n,children:e},void 0,!1,{fileName:Zr,lineNumber:41,columnNumber:5})}function Qr({children:e,classes:t,containerRef:n,elementRef:r,...o}){return Ur("div",{className:Bn("Hyp-Card",t),...o,ref:null!=r?r:n,children:e},void 0,!1,{fileName:Zr,lineNumber:65,
|
|
86
|
+
columnNumber:5})}function eo({children:e,direction:t="row",classes:n,containerRef:r,elementRef:o,...i}){return Ur("div",{className:Bn(`Hyp-Actions--${t}`,n),...i,ref:null!=o?o:r,children:e},void 0,!1,{fileName:Zr,lineNumber:92,columnNumber:5})}var to='<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',no="/home/runner/work/frontend-shared/frontend-shared/src/components/Dialog.js";const ro=Gr("cancel",to);let oo=0;function io(e){const[t]=Er((()=>(++oo,`${e}-${oo}`)));return t}
|
|
87
|
+
function ao({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 d=io("dialog-description"),h=io("dialog-title"),p=Mr();Tr((()=>{if(null!==i){const e=null==i?void 0:i.current;e&&!e.disabled?e.focus():p.current.focus()}}),[]),Nr((()=>{const e=p.current.querySelector("p");e&&(e.id=d,p.current.setAttribute("aria-describedby",d))}),[d]);const m=a&&c,f=e||m;return Ur("div",{"aria-labelledby":h,className:Bn("Hyp-Dialog",{"Hyp-Dialog--closeable":a&&u},r),ref:p,role:s,tabIndex:-1,children:[Ur("header",{className:"Hyp-Dialog__header",children:[o&&Ur("div",{className:"Hyp-Dialog__header-icon",children:Ur($r,{name:o,title:l,"data-testid":"header-icon"},void 0,!1,{fileName:no,lineNumber:139,columnNumber:13})},void 0,!1,{fileName:no,lineNumber:138,columnNumber:11}),Ur("h2",{className:"Hyp-Dialog__title",id:h,children:l},void 0,!1,{fileName:no,lineNumber:142,columnNumber:9}),a&&u&&Ur("div",{
|
|
88
|
+
className:"Hyp-Dialog__close",children:Ur(Wr,{"data-testid":"close-button",icon:ro,title:"Close",onClick:a},void 0,!1,{fileName:no,lineNumber:147,columnNumber:13})},void 0,!1,{fileName:no,lineNumber:146,columnNumber:11})]},void 0,!0,{fileName:no,lineNumber:136,columnNumber:7}),n,f&&Ur("div",{className:"Hyp-Dialog__actions",children:[m&&Ur(Kr,{"data-testid":"cancel-button",onClick:a,children:t},void 0,!1,{fileName:no,lineNumber:160,columnNumber:13}),e]},void 0,!0,{fileName:no,lineNumber:158,columnNumber:9})]},void 0,!0,{fileName:no,lineNumber:125,columnNumber:5})}function so({name:e,classes:t="",containerClasses:n="",title:r=""}){const o=qr.get(e);if(!o)throw new Error(`Icon "${e.toString()}" is not registered`);const i=Mr();Nr((()=>{const e=i.current.querySelector("svg");e&&e.setAttribute("class",Bn("Hyp-Icon",t))}),[t,o]);const a={};return r&&(a.title=r),Ur("span",{className:n,dangerouslySetInnerHTML:{__html:o},ref:i,...a},void 0,!1,{
|
|
89
|
+
fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Icon.js",lineNumber:62,columnNumber:5})}function lo({children:e,classes:t="",linkRef:n,...r}){return Ur("a",{className:Bn("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:26,columnNumber:5})}function co(e,t,n,{useCapture:r=!1}={}){return t.forEach((t=>e.addEventListener(t,n,r))),()=>{t.forEach((t=>e.removeEventListener(t,n,r)))}}function uo(e,t,n){Tr((()=>{if(!t)return()=>{};const r=co(document.body,["keydown"],(e=>{"Escape"===e.key&&n()})),o=co(document.body,["focus"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0}),i=co(document.body,["mousedown","click"],(t=>{e.current&&!e.current.contains(t.target)&&n()}),{useCapture:!0});return()=>{r(),i(),o()}}),[e,t,n])}var ho="/home/runner/work/frontend-shared/frontend-shared/src/components/Modal.js";function po({children:e,onCancel:t,...n}){const r=Mr()
|
|
90
|
+
;return uo(r,!0,(()=>{t&&t()})),Ur(Gn,{children:[Ur("div",{className:"Hyp-Modal__overlay"},void 0,!1,{fileName:ho,lineNumber:39,columnNumber:7}),Ur("div",{className:"Hyp-Modal",ref:r,children:Ur(ao,{onCancel:t,...n,children:e},void 0,!1,{fileName:ho,lineNumber:41,columnNumber:9})},void 0,!1,{fileName:ho,lineNumber:40,columnNumber:7})]},void 0,!0)}function mo({message:e,confirmAction:t,onConfirm:n,onCancel:r,...o}){return Ur(po,{onCancel:r,buttons:[Ur(Kr,{onClick:n,variant:"primary","data-testid":"confirm-button",children:t},"ok",!1,{fileName:ho,lineNumber:76,columnNumber:9})],...o,children:Ur("p",{children:e},void 0,!1,{fileName:ho,lineNumber:87,columnNumber:7})},void 0,!1,{fileName:ho,lineNumber:73,columnNumber:5})}var fo="/home/runner/work/frontend-shared/frontend-shared/src/components/Panel.js";const go=Gr("cancel",to);function vo({children:e,icon:t,onClose:n,title:r}){const o=!!n;return Ur("div",{className:Bn("Hyp-Panel",{"Hyp-Panel--closeable":o}),children:[Ur("header",{className:"Hyp-Panel__header",
|
|
91
|
+
children:[t&&Ur("div",{className:"Hyp-Panel__header-icon",children:Ur($r,{name:t,title:r},void 0,!1,{fileName:fo,lineNumber:38,columnNumber:13})},void 0,!1,{fileName:fo,lineNumber:37,columnNumber:11}),Ur("h2",{className:"Hyp-Panel__title",children:r},void 0,!1,{fileName:fo,lineNumber:41,columnNumber:9}),o&&Ur("div",{className:"Hyp-Panel__close",children:Ur(Wr,{icon:go,title:"Close",onClick:n},void 0,!1,{fileName:fo,lineNumber:44,columnNumber:13})},void 0,!1,{fileName:fo,lineNumber:43,columnNumber:11})]},void 0,!0,{fileName:fo,lineNumber:35,columnNumber:7}),Ur("div",{className:"Hyp-Panel__content",children:e},void 0,!1,{fileName:fo,lineNumber:48,columnNumber:7})]},void 0,!0,{fileName:fo,lineNumber:30,columnNumber:5})}
|
|
92
|
+
const _o=Gr("spinner",'<svg viewBox="0 0 64 64" width="16" height="16">\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>')
|
|
93
|
+
;function bo({classes:e="",size:t="medium"}){return Ur(so,{name:_o,containerClasses:Bn(`Hyp-Spinner--${t}`,e)},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/Spinner.js",lineNumber:33,columnNumber:5})}var yo="/home/runner/work/frontend-shared/frontend-shared/src/components/TextInput.js";function wo({classes:e="",inputRef:t,hasError:n=!1,type:r="text",...o}){return Ur("input",{className:Bn("Hyp-TextInput",{"has-error":n},e),...o,ref:t,type:r},void 0,!1,{fileName:yo,lineNumber:40,columnNumber:5})}function xo({children:e,classes:t=""}){return Ur("div",{className:Bn("Hyp-TextInputWithButton",t),children:e},void 0,!1,{fileName:yo,lineNumber:69,columnNumber:5})}
|
|
94
|
+
var ko='<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="M6 4l4 4-4 4"></path></g></svg>',So='<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="24px" height="28px" viewBox="0 0 24 28" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <rect fill="#ffffff" stroke="none" width="17.14407" height="16.046612" x="3.8855932" y="3.9449153" />\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <path d="M0,2.00494659 C0,0.897645164 0.897026226,0 2.00494659,0 L21.9950534,0 C23.1023548,0 24,0.897026226 24,2.00494659 L24,21.9950534 C24,23.1023548 23.1029738,24 21.9950534,24 L2.00494659,24 C0.897645164,24 0,23.1029738 0,21.9950534 L0,2.00494659 Z M9,24 L12,28 L15,24 L9,24 Z M7.00811294,4 L4,4 L4,20 L7.00811294,20 L7.00811294,15.0028975 C7.00811294,12.004636 8.16824717,12.0097227 9,12 C10,12.0072451 11.0189302,12.0606714 11.0189302,14.003477 L11.0189302,20 L14.0270431,20 L14.0270431,13.1087862 C14.0270433,10 12,9.00309038 10,9.00309064 C8.01081726,9.00309091 8,9.00309086 7.00811294,11.0019317 L7.00811294,4 Z M19,19.9869002 C20.1045695,19.9869002 21,19.0944022 21,17.9934501 C21,16.892498 20.1045695,16 19,16 C17.8954305,16 17,16.892498 17,17.9934501 C17,19.0944022 17.8954305,19.9869002 19,19.9869002 Z" fill="currentColor"></path>\n </g>\n</svg>\n'
|
|
95
|
+
;const Co={add:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8.99302964,2.86682521 L9,3 L9,6.999 L13,7 C13.5522847,7 14,7.44771525 14,8 C14,8.51283584 13.6139598,8.93550716 13.1166211,8.99327227 L13,9 L9,9 L9,13 C9,14.2873563 7.13555291,14.3317479 7.00697036,13.1331748 L7,13 L7,9 L3,9 C2.44771525,9 2,8.55228475 2,8 C2,7.48716416 2.38604019,7.06449284 2.88337887,7.00672773 L3,7 L7,7 L7,3 C7,1.71264368 8.86444709,1.66825208 8.99302964,2.86682521 Z"></path></svg>',
|
|
95
96
|
annotate:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M15 0c.27 0 .505.099.703.297A.961.961 0 0116 1v15l-4-3H1a.974.974 0 01-.703-.29A.953.953 0 010 12V1C0 .719.096.482.29.29A.966.966 0 011 0h14zM7 3l-.469.063c-.312.041-.656.187-1.031.437-.375.25-.719.646-1.031 1.188C4.156 5.229 4 6 4 7l.002.063.006.062a.896.896 0 01.008.11l-.002.074-.006.066a1.447 1.447 0 00.43 1.188C4.729 8.854 5.082 9 5.5 9c.417 0 .77-.146 1.063-.438C6.854 8.271 7 7.918 7 7.5c0-.417-.146-.77-.438-1.063A1.447 1.447 0 005.5 6c-.073 0-.146.005-.219.016-.073.01-.14.026-.203.046.177-1.03.542-1.632 1.094-1.804L7 4V3zm5 0l-.469.063c-.312.041-.656.187-1.031.437-.375.25-.719.646-1.031 1.188C9.156 5.229 9 6 9 7l.002.063.006.062a.896.896 0 01.008.11l-.002.074-.006.066a1.447 1.447 0 00.43 1.188c.291.291.645.437 1.062.437.417 0 .77-.146 1.063-.438.291-.291.437-.645.437-1.062 0-.417-.146-.77-.438-1.063A1.447 1.447 0 0010.5 6c-.073 0-.146.005-.219.016-.073.01-.14.026-.203.046.177-1.03.542-1.632 1.094-1.804L12 4V3z"/>\n</svg>\n',
|
|
96
|
-
"arrow-left":'<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="M7 12L3 8l4-4M4 8h9-9z"></path></g></svg>\n',"arrow-right":'<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="M9 4l4 4-4 4m3-4H3h9z"></path></g></svg>\n',cancel:
|
|
97
|
+
"arrow-left":'<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="M7 12L3 8l4-4M4 8h9-9z"></path></g></svg>\n',"arrow-right":'<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="M9 4l4 4-4 4m3-4H3h9z"></path></g></svg>\n',cancel:to,"caret-right":ko,
|
|
97
98
|
"cc-std":'<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="currentColor" stroke="none" d="M7.985 0c2.238 0 4.143.781 5.715 2.343a7.694 7.694 0 011.714 2.579C15.804 5.888 16 6.914 16 8a8.164 8.164 0 01-.579 3.078 7.344 7.344 0 01-1.707 2.536 8.222 8.222 0 01-2.657 1.772c-.99.41-2.014.614-3.071.614a7.775 7.775 0 01-3.036-.607 8.047 8.047 0 01-2.6-1.757A7.846 7.846 0 010 8c0-1.057.202-2.074.607-3.05A8.033 8.033 0 012.371 2.33C3.895.777 5.766 0 7.985 0zm.03 1.443c-1.83 0-3.367.638-4.615 1.914a6.878 6.878 0 00-1.45 2.15A6.301 6.301 0 001.443 8c0 .858.168 1.684.507 2.479a6.627 6.627 0 001.45 2.129 6.593 6.593 0 002.129 1.428c.79.329 1.619.493 2.485.493.857 0 1.688-.166 2.494-.5a6.91 6.91 0 002.178-1.442c1.247-1.22 1.871-2.748 1.871-4.586a6.57 6.57 0 00-.486-2.515 6.397 6.397 0 00-1.413-2.114C11.37 2.086 9.824 1.443 8.014 1.443zm-.1 5.229l-1.073.557c-.114-.238-.254-.405-.42-.5a.95.95 0 00-.465-.143c-.714 0-1.072.472-1.072 1.415 0 .428.09.77.271 1.028.181.257.448.386.8.386.467 0 .796-.229.987-.686l.985.5a2.35 2.35 0 01-2.1 1.257c-.714 0-1.29-.218-1.729-.657-.438-.438-.657-1.047-.657-1.828 0-.762.222-1.367.665-1.814.442-.448 1.002-.672 1.678-.672.991 0 1.7.385 2.13 1.157zm4.613 0l-1.057.557c-.114-.238-.255-.405-.421-.5a.972.972 0 00-.479-.143c-.714 0-1.072.472-1.072 1.415 0 .428.091.77.272 1.028.18.257.447.386.8.386.466 0 .795-.229.985-.686l1 .5c-.218.39-.514.698-.885.922a2.308 2.308 0 01-1.214.335c-.724 0-1.302-.218-1.735-.657-.434-.438-.65-1.047-.65-1.828 0-.762.22-1.367.664-1.814.442-.448 1.002-.672 1.678-.672.99 0 1.696.385 2.114 1.157z"></path></g></svg>',
|
|
98
99
|
"cc-zero":'<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="currentColor" stroke="none" d="M7.983 0c2.238 0 4.148.78 5.72 2.342a7.662 7.662 0 011.715 2.582c.39.962.582 1.99.582 3.076a8.13 8.13 0 01-.583 3.087 7.262 7.262 0 01-1.703 2.526 8.213 8.213 0 01-2.655 1.77c-.99.41-2.018.617-3.076.617a7.902 7.902 0 01-3.042-.6 8.301 8.301 0 01-2.6-1.759A8.087 8.087 0 01.6 11.042 7.84 7.84 0 010 8c0-1.057.2-2.07.6-3.042a8.12 8.12 0 011.77-2.633C3.893.772 5.764 0 7.983 0zm.034 1.44c-1.829 0-3.369.64-4.616 1.915a6.962 6.962 0 00-1.457 2.157 6.388 6.388 0 000 4.969 6.83 6.83 0 003.585 3.558c.79.324 1.62.487 2.488.487.857 0 1.681-.165 2.482-.498a6.88 6.88 0 002.184-1.446C13.931 11.364 14.56 9.838 14.56 8a6.57 6.57 0 00-.487-2.515 6.418 6.418 0 00-1.418-2.118C11.37 2.081 9.826 1.44 8.017 1.44zM8 3.395c2.641 0 3.305 2.492 3.305 4.605 0 2.113-.664 4.605-3.305 4.605S4.694 10.113 4.694 8l.007-.355c.073-2.027.804-4.25 3.299-4.25zm1.316 3.227L7.35 10.017c-.274.412-.083.645.219.774l.135.044c.091.022.19.034.297.034 1.357 0 1.422-1.938 1.422-2.869l-.007-.409a7.282 7.282 0 00-.06-.72l-.04-.25zM8 5.132c-1.258 0-1.406 1.66-1.421 2.646L6.577 8c0 .24.005.544.035.865l.027.244 1.759-3.232c.182-.316.09-.542-.101-.706A1.222 1.222 0 008 5.13z"></path></g></svg>',
|
|
99
|
-
"collapse-menu":'<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="M4 10l4-4 4 4"></path></g></svg>',collapse:'<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="M5 11l-4 4 4-4zm-3-1h4v4m9-13l-4 4 4-4zm-1 5h-4V2"></path></g></svg>',collapsed:
|
|
100
|
+
"collapse-menu":'<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="M4 10l4-4 4 4"></path></g></svg>',collapse:'<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="M5 11l-4 4 4-4zm-3-1h4v4m9-13l-4 4 4-4zm-1 5h-4V2"></path></g></svg>',collapsed:ko,
|
|
100
101
|
copy:'<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="M9 15H1V5h3m11-4v10H7V1h8z"></path></g></svg>',edit:'<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="M11 4l1 1-9 9-2 1 1-2 9-9zm3-3l1 1-1 1-1-1 1-1z"></path></g></svg>\n',
|
|
101
|
-
email:'<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="M1 3v10h14V3H1zm0 0l7 6 7-6H1z"></path></g></svg>',"expand-menu":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M7.456 11.788L1.226 5.92a.695.695 0 0 1 0-1.025l.726-.684a.804.804 0 0 1 1.087-.001L8 8.861l4.961-4.65a.804.804 0 0 1 1.087.001l.727.684c.3.283.3.742 0 1.025l-6.23 5.867a.804.804 0 0 1-1.09 0z"/>\n</svg>',error:
|
|
102
|
+
email:'<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="M1 3v10h14V3H1zm0 0l7 6 7-6H1z"></path></g></svg>',"expand-menu":'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M7.456 11.788L1.226 5.92a.695.695 0 0 1 0-1.025l.726-.684a.804.804 0 0 1 1.087-.001L8 8.861l4.961-4.65a.804.804 0 0 1 1.087.001l.727.684c.3.283.3.742 0 1.025l-6.23 5.867a.804.804 0 0 1-1.09 0z"/>\n</svg>',error:to,
|
|
102
103
|
expand:'<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="M2 14l4-4-4 4zm3 1H1v-4m13-9l-4 4 4-4zm-3-1h4v4"></path></g></svg>',external:'<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="M7 3h6v6m-1-5l-9 9 9-9z"></path></g></svg>',
|
|
103
104
|
facebook:'<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="currentColor" stroke="none" d="M15.999 8.049c0-4.445-3.582-8.049-8-8.049S0 3.604 0 8.049C0 12.066 2.925 15.396 6.75 16v-5.624H4.717V8.049H6.75V6.276c0-2.018 1.195-3.132 3.022-3.132.875 0 1.79.157 1.79.157v1.981h-1.008c-.994 0-1.304.62-1.304 1.257v1.51h2.219l-.355 2.327H9.25V16c3.825-.604 6.75-3.934 6.75-7.951z"></path></g></svg>',flag:'<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="M3 9v6V1h12l-4 4 4 4H3z"></path></g></svg>',
|
|
104
105
|
"flag--active":'<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="currentColor" stroke="none" d="M2 1a1 1 0 01.883-.993L3 0h12c.852 0 1.297.986.783 1.623l-.076.084L12.415 5l3.292 3.293c.575.575.253 1.523-.485 1.684l-.108.017L15 10H4v5a1 1 0 01-1.993.117L2 15V1z"></path></g></svg>',
|
|
@@ -113,7 +114,7 @@ hide:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0
|
|
|
113
114
|
highlight:'<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="M12 15H1h11zm-.5-6v2l-1 1v-2l1-1zm.5-7v6h-2V2h2zm0-1h-2 2zm0 8h-2 2z"></path></g></svg>',image:'<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="M15 1v14H1V1h14zM1 15l3-8 4 6 3-4 4 6m-4-9a1 1 0 110-2 1 1 0 010 2z"></path></g></svg>',
|
|
114
115
|
leave:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M8,0 C12.0522847,0 16,3.94771525 16,8 C16,12.0522847 12.0522847,16 8,16 C3.94771525,16 0,12.0522847 0,8 C0,3.94771525 3.94771525,0 8,0 Z M8,2 C5.05228475,2 2,5.05228475 2,8 C2,10.9477153 5.05228475,14 8,14 C10.9477153,14 14,10.9477153 14,8 C14,5.05228475 10.9477153,2 8,2 Z M10.7864022,6.62017694 L10.7071068,6.70710678 L9.415,8 L10.7071068,9.29289322 C11.0976311,9.68341751 11.0976311,10.3165825 10.7071068,10.7071068 C10.3466228,11.0675907 9.77939176,11.0953203 9.38710056,10.7902954 L9.29289322,10.7071068 L8,9.415 L6.70710678,10.7071068 C5.79286771,11.6213459 4.43536121,10.3192478 5.21359778,9.37982306 L5.29289322,9.29289322 L6.585,8 L5.29289322,6.70710678 C4.90236893,6.31658249 4.90236893,5.68341751 5.29289322,5.29289322 C5.65337718,4.93240926 6.22060824,4.90467972 6.61289944,5.20970461 L6.70710678,5.29289322 L8,6.585 L9.29289322,5.29289322 C10.2071323,4.37865415 11.5646388,5.68075222 10.7864022,6.62017694 Z"></path></svg>',
|
|
115
116
|
link:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M9.68027557,6.09714063 C10.0850762,6.47284645 10.1086623,7.10557198 9.73295644,7.51037264 C9.35725062,7.9151733 8.72452509,7.93875933 8.31972443,7.56305351 C7.52101725,6.821753 6.4700536,6.81243414 5.66500421,7.53509692 L2.58706553,11.1273971 L2.50815798,11.2094765 C1.81384474,11.8538863 1.84803625,12.885989 2.50815798,13.4986648 C3.17004601,14.1129799 4.31769172,14.1788096 5.06581128,13.6063341 L5.156,13.529 L6.16163376,12.3189006 C6.48720494,11.9265987 7.04943452,11.8464869 7.46827399,12.1138931 L7.56977663,12.1880051 C7.96207853,12.5135762 8.04219031,13.0758058 7.77478412,13.4946453 L7.70067217,13.5961479 L6.64329964,14.8702449 L6.554056,14.9645777 C5.02884562,16.3801643 2.59807851,16.3107974 1.14760683,14.9645777 C-0.293859995,13.6267155 -0.415580233,11.3582822 0.996093014,9.89228498 L1.095,9.794 L4.19491885,6.17921998 L4.2738264,6.09714063 C5.8499647,4.63428646 8.10413728,4.63428646 9.68027557,6.09714063 Z M14.8523932,1.03542234 C16.29386,2.37328448 16.4155802,4.64171776 15.003907,6.10771502 L14.904,6.205 L11.7857496,9.84275726 L11.7261736,9.90285937 C10.1500353,11.3657135 7.89586272,11.3657135 6.31972443,9.90285937 C5.91492376,9.52715355 5.89133773,8.89442802 6.26704356,8.48962736 C6.64274938,8.0848267 7.27547491,8.06124067 7.68027557,8.43694649 C8.47898275,9.178247 9.5299464,9.18756586 10.3349958,8.46490308 L13.4129345,4.87260289 L13.491842,4.79052353 C14.1861553,4.1461137 14.1519637,3.11401104 13.491842,2.50133522 C12.829954,1.88702005 11.6823083,1.82119037 10.9341887,2.39366585 L10.843,2.47 L9.83836624,3.6810994 C9.51279506,4.0734013 8.95056548,4.15351308 8.53172601,3.88610689 L8.43022337,3.81199494 C8.03792147,3.48642376 7.95780969,2.92419418 8.22521588,2.5053547 L8.29932783,2.40385206 L9.35670036,1.12975511 L9.445944,1.03542234 C10.9711544,-0.380164327 13.4019215,-0.310797434 14.8523932,1.03542234 Z"></path></svg>',
|
|
116
|
-
lock:'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="48px" height="56px" viewBox="0 0 48 56" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <rect x="0" y="24" width="48" height="32"></rect>\n <path d="M24,0 C24,0 8,0 8,16 L8,32 L16,32 L16,16.0000004 C16,8 24,8 24,8 C24,8 32,8 32,16 L32,32 L40,32 L40,16 C40,0 24,0 24,0 Z"></path>\n </g>\n </g>\n</svg>',logo:
|
|
117
|
+
lock:'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="48px" height="56px" viewBox="0 0 48 56" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <rect x="0" y="24" width="48" height="32"></rect>\n <path d="M24,0 C24,0 8,0 8,16 L8,32 L16,32 L16,16.0000004 C16,8 24,8 24,8 C24,8 32,8 32,16 L32,32 L40,32 L40,16 C40,0 24,0 24,0 Z"></path>\n </g>\n </g>\n</svg>',logo:So,pointer:'<svg xmlns="http://www.w3.org/2000/svg" width="15" height="8" viewBox="0 0 15 8" aria-hidden="true" focusable="false"><path d="M0 8 L7 0 L15 8" stroke="currentColor" strokeWidth="2" /></svg>\n',
|
|
117
118
|
profile:'<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="M1 15c0-2.761 3.134-5 7-5s7 2.239 7 5M8 7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"></path></g></svg>\n',
|
|
118
119
|
public:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">\n <path fill="currentColor" fill-rule="nonzero" d="M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0zm2.655 11.535c.244-.242.442-.719.442-1.063a1.13 1.13 0 0 0-.288-.696l-.442-.442a1.033 1.033 0 0 0-.73-.302H7.484C7.181 8.88 6.791 8 6.452 8c-.34 0-.674-.08-.978-.231l-.357-.179a.386.386 0 0 1-.213-.345c0-.153.118-.317.263-.366l1.006-.335a.618.618 0 0 1 .163-.026c.106 0 .258.056.338.126l.3.26c.046.04.106.063.169.063h.182a.258.258 0 0 0 .23-.373l-.503-1.006a.306.306 0 0 1-.027-.116c0-.06.035-.143.078-.185l.32-.31a.258.258 0 0 1 .18-.074h.29c.06 0 .141-.034.183-.076l.258-.258c.1-.1.1-.264 0-.364l-.151-.152c-.101-.1-.101-.264 0-.365l.333-.333.151-.151a.516.516 0 0 0 0-.73l-.912-.913a6.45 6.45 0 0 0-.787.078v.365a.516.516 0 0 1-.747.461l-.775-.387a6.487 6.487 0 0 0-3.329 3.287c.32.474.813 1.205 1.116 1.65.138.203.4.503.582.668l.026.023c.308.278.65.516 1.021.702.452.227 1.111.586 1.575.842.328.182.53.527.53.903v1.032c0 .274.11.537.303.73.484.484.785 1.246.73 1.653v.884c.473 0 .932-.055 1.376-.152l.56-1.511c.067-.177.106-.362.155-.544a.771.771 0 0 1 .199-.346l.365-.364zm2.797-2.946l.94.235c.036-.27.06-.544.06-.824a6.4 6.4 0 0 0-.688-2.882l-.419.21a.773.773 0 0 0-.298.263l-.632.947a.908.908 0 0 0-.13.43c0 .13.058.321.13.43l.58.87c.107.16.27.274.457.32z"/>\n</svg>',
|
|
119
120
|
refresh:'<?xml version="1.0" encoding="UTF-8" standalone="no"?>\n<svg width="16px" height="16px" viewBox="0 0 16 16" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">\n \x3c!-- Generator: Sketch 39.1 (31720) - http://www.bohemiancoding.com/sketch --\x3e\n <defs/>\n <g stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">\n <g fill="currentColor">\n <g>\n <path d="M0,8 C0,12.418278 3.581722,16 8,16 C12.418278,16 16,12.418278 16,8 C16,4.89580324 14.2154684,2.11256098 11.4682644,0.789110134 L10.6002482,2.59092808 C12.661769,3.58405472 14,5.6712248 14,8 C14,11.3137085 11.3137085,14 8,14 C4.6862915,14 2,11.3137085 2,8 C2,5.65296151 3.35941993,3.55225774 5.44569583,2.56903563 L4.59307587,0.759881355 C1.81273067,2.07020511 0,4.87140735 0,8 Z" />\n <polygon points="7 8.58578644 7 0 9 0 9 8.58578644 10.2928932 7.29289322 11 6.58578644 12.4142136 8 11.7071068 8.70710678 8.70710678 11.7071068 8 12.4142136 7.64644661 12.0606602 7.29289322 11.7071068 4.29289322 8.70710678 3.58578644 8 5 6.58578644 5.70710678 7.29289322"/>\n </g>\n </g>\n </g>\n</svg>',
|
|
@@ -123,93 +124,93 @@ search:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="
|
|
|
123
124
|
share:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false"><path fill="currentColor" d="M15,9 C15.5128358,9 15.9355072,9.38604019 15.9932723,9.88337887 L16,10 L16,15 C16,15.5128358 15.6139598,15.9355072 15.1166211,15.9932723 L15,16 L1,16 C0.487164161,16 0.0644928393,15.6139598 0.00672773133,15.1166211 L0,15 L0,10 C0,9.44771525 0.44771525,9 1,9 C1.51283584,9 1.93550716,9.38604019 1.99327227,9.88337887 L2,10 L2,14 L14,14 L14,10 C14,9.48716416 14.3860402,9.06449284 14.8833789,9.00672773 L15,9 Z M8.61289944,0.209704612 L8.70710678,0.292893219 L12.7071068,4.29289322 C13.0976311,4.68341751 13.0976311,5.31658249 12.7071068,5.70710678 C12.3466228,6.06759074 11.7793918,6.09532028 11.3871006,5.79029539 L11.2928932,5.70710678 L9,3.415 L9,11 C9,11.5522847 8.55228475,12 8,12 C7.48716416,12 7.06449284,11.6139598 7.00672773,11.1166211 L7,11 L7,3.415 L4.70710678,5.70710678 C4.34662282,6.06759074 3.77939176,6.09532028 3.38710056,5.79029539 L3.29289322,5.70710678 C2.93240926,5.34662282 2.90467972,4.77939176 3.20970461,4.38710056 L3.29289322,4.29289322 L7.29289322,0.292893219 C7.62333685,-0.0375504127 8.12750547,-0.0883878944 8.51140295,0.140380774 L8.61289944,0.209704612 Z"></path></svg>',
|
|
124
125
|
success:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><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="M13 3L6 13 3 8"></path></g></svg>\n',sort:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true" focusable="false" class="Icon Icon--sort"><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="M5 9V2v7zM1 5l4-4 4 4m2 2v7-7zm-4 4l4 4 4-4"></path></g></svg>\n',
|
|
125
126
|
trash:'<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="M2 4h12l-2 11H4L2 4zM1 1h14H1z"></path></g></svg>\n',
|
|
126
|
-
twitter:'<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="currentColor" stroke="none" d="M15.969 3.049c-.59.259-1.22.436-1.884.516a3.305 3.305 0 0 0 1.442-1.815c-.634.37-1.336.64-2.084.79a3.28 3.28 0 0 0-5.59 2.988 9.29 9.29 0 0 1-6.76-3.418A3.214 3.214 0 0 0 .65 3.76c0 1.14.58 2.142 1.459 2.73a3.27 3.27 0 0 1-1.485-.41v.04a3.282 3.282 0 0 0 2.63 3.218 3.33 3.33 0 0 1-1.474.057 3.291 3.291 0 0 0 3.069 2.278A6.578 6.578 0 0 1 .78 13.076c-.26 0-.52-.015-.78-.044a9.33 9.33 0 0 0 5.038 1.472c6.036 0 9.332-4.997 9.332-9.323 0-.14 0-.28-.01-.42.64-.46 1.2-1.04 1.64-1.7l-.031-.012z"></path></g></svg>'};async function
|
|
127
|
-
document.body.appendChild(r),new Promise((o=>{const i=e=>{
|
|
128
|
-
;return n.displayName=`withServices(${r})`,n}function
|
|
129
|
-
return Math.random().toString(36).substring(7).split("").join(".")},
|
|
130
|
-
function h(e){if(!
|
|
131
|
-
;for(var r=!1,o={},s=0;s<a.length;s++){var l=a[s],c=n[l],u=e[l],d=c(u,t);if(void 0===d)throw t&&t.type,new Error(
|
|
132
|
-
;for(let t of e)o[t.namespace]=
|
|
133
|
-
initialState:e,...t}}function
|
|
134
|
-
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})};const
|
|
135
|
-
setAnnotationResultCount:function(e){return
|
|
136
|
-
}):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 h(){var t=d.get(arguments);if("NOT_FOUND"===t){if(t=e.apply(null,arguments),c){var n=d.getEntries(),r=n.find((function(e){return c(e.value,t)}));r&&(t=r.value)}d.put(arguments,t)}return t}return h.clearCache=function(){return d.clear()},h}function
|
|
137
|
-
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,d=void 0===u?n:u,h=Array.isArray(d)?d:[d],p=
|
|
138
|
-
"localhost"===n&&(n="");let r=n;return e.document&&e.document.title&&(r=e.document.title[0]),{uri:t,domain:n,title:r}}function
|
|
139
|
-
return!!e.$highlight||!
|
|
140
|
-
actionCreators:{changeRoute:function(e,t={}){return
|
|
141
|
-
HIGHLIGHT_ANNOTATIONS:(e,t)=>({highlighted:t.highlighted}),REMOVE_ANNOTATIONS:(e,t)=>({annotations:[...t.remainingAnnotations]}),UNHIDE_ANNOTATION:(e,t)=>({annotations:e.annotations.map((e=>e.id!==t.id?e:Object.assign({},e,{hidden:!1})))}),UPDATE_ANCHOR_STATUS:(e,t)=>({annotations:e.annotations.map((e=>{if(!
|
|
142
|
-
;t(
|
|
143
|
-
const e=n().annotations.annotations,r=o.map((t=>t?
|
|
144
|
-
isAnnotationHovered:function(e,t){return!0===e.hovered[t]},isWaitingToAnchorAnnotations:
|
|
145
|
-
directLinkedGroupFetchFailed:!1})};const
|
|
146
|
-
return e.directLinkedGroupId}}});class
|
|
147
|
-
deleteNewAndEmptyDrafts:function(){return(e,t)=>{const n=t().drafts.drafts.filter((e=>!e.annotation.id&&!
|
|
148
|
-
focusActive:null!==(n=t.active)&&void 0!==n?n:!e.focusActive}},CLEAR_SELECTION:()=>({filters:{},focusActive:!1,query:null})};const
|
|
149
|
-
toggleFocusMode:function(e){return
|
|
150
|
-
UPDATE_FRAME_ANNOTATION_FETCH_STATUS:(e,t)=>({frames:e.frames.map((e=>e.uri&&e.uri===t.uri?Object.assign({},e,{isAnnotationFetchComplete:t.isAnnotationFetchComplete}):e))}),SET_CONTENT_INFO:(e,t)=>({contentInfo:t.info})};const
|
|
151
|
-
getContentInfo:function(e){return e.contentInfo},frames:function(e){return e.frames},mainFrame:
|
|
152
|
-
;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:[]})};function
|
|
153
|
-
const
|
|
154
|
-
rootSelectors:{getCurrentlyViewingGroups:
|
|
155
|
-
const n={...e.pendingUpdates},r={...e.pendingDeletions};for(let e of t)e.id&&(delete n[e.id],delete r[e.id]);return{pendingUpdates:n,pendingDeletions:r}},FOCUS_GROUP:()=>({pendingUpdates:{},pendingDeletions:{}})};const
|
|
156
|
-
}},selectors:{hasPendingDeletion:function(e,t){return
|
|
157
|
-
const n=t.annotations.filter((e=>!
|
|
158
|
-
selected:
|
|
159
|
-
return
|
|
160
|
-
isSidebarPanelOpen:function(e,t){return e.activePanelName===t}}}),
|
|
161
|
-
return
|
|
162
|
-
return e.id||e.$tag}function
|
|
163
|
-
const n=(e.references||[]).filter((t=>t!==e.id));return
|
|
164
|
-
if(!e)return[];const t=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]=
|
|
165
|
-
const
|
|
166
|
-
;function
|
|
167
|
-
;return e.children.reduce(((e,n)=>e+
|
|
168
|
-
const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:
|
|
169
|
-
;n.filterFn=t=>function(e,t){const n=(e,t)=>new
|
|
170
|
-
var
|
|
171
|
-
function f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function g(){var e
|
|
172
|
-
const{eventTarget:n,eventType:r,listener:o}=t;n.removeEventListener(r,o),this._listeners.delete(e)}}removeAll(){this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners.clear()}}const
|
|
173
|
-
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),t.setSelectionRange(0,t.value.length),document.execCommand("copy")}finally{t.remove()}}const
|
|
174
|
-
lineNumber:18,columnNumber:7})},void 0,!1,{fileName:
|
|
175
|
-
fileName:
|
|
176
|
-
fileName:
|
|
177
|
-
;const
|
|
178
|
-
"text-brand hover:text-brand-dark":"brand"===o,"text-color-text-light hover:text-brand":"text-light"===o,"text-color-text hover:text-brand-dark":"text"===o},{"no-underline hover:no-underline":"none"===r,"underline hover:underline":"always"===r,"no-underline hover:underline":"hover"===r},t),elementRef:n,"data-component":"Link",children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/Link.js",lineNumber:32,columnNumber:5})};const
|
|
179
|
-
"no-underline enabled:hover:underline":"hover"===i},{"font-semibold":"primary"===a},t),"data-component":"LinkButton",children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/LinkButton.js",lineNumber:37,columnNumber:5})};function
|
|
180
|
-
iconName:"email",label:"Share via email",uri:`mailto:?subject=${encodeURIComponent("Let's Annotate")}&body=${t}`})]})}function
|
|
181
|
-
title:"Share",onClick:()=>c(!l),expanded:l}),l&&
|
|
182
|
-
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."})}),d&&
|
|
183
|
-
;return
|
|
184
|
-
n.flag(e).catch((()=>i.error("Flagging annotation failed")))}}),p&&e.flagged&&
|
|
185
|
-
const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.observe(e),()=>n.disconnect()}const n=new
|
|
186
|
-
"bg-gradient-to-b from-excerpt-stop-1 via-excerpt-stop-2 to-excerpt-stop-3":!r&&f,"bg-none":r,"opacity-0 pointer-events-none":!f}),title:"Show the full excerpt"}),m&&r&&
|
|
187
|
-
;for(let[e,o]of n)t.includes(e)&&("t"===e?r.append("start",
|
|
188
|
-
;let n=t[2];const r=new URLSearchParams(e.search);let o=r.get("start"),i=r.get("end");if(!o){const e=n.match(/\/start\/([^/]+)/);e&&(o=e[1],n=n.replace(e[0],""))}if(!i){const e=n.match(/\/end\/([^/]+)/);e&&(i=e[1],n=n.replace(e[0],""))}const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),
|
|
189
|
-
return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},
|
|
190
|
-
;if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return
|
|
191
|
-
;var
|
|
192
|
-
var
|
|
193
|
-
return"undefined"==typeof window?null:window},
|
|
194
|
-
;if("function"==typeof a){var y=o.createElement("template");y.content&&y.content.ownerDocument&&(o=y.content.ownerDocument)}var w=
|
|
195
|
-
})),G=null,V=null,Y=!0,W=!0,K=!1,X=!1,Z=!1,J=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!1,ie="user-content-",ae=!0,se=!1,le={},ce=null,ue=
|
|
196
|
-
H="ALLOWED_TAGS"in e?
|
|
197
|
-
e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),te&&(ee=!0),le&&(H=
|
|
198
|
-
},Ee=
|
|
199
|
-
t.setAttribute(e,"")}catch(e){}},Oe=function(e){var t,n;if(Q)e="<remove></remove>"+e;else{var r=
|
|
200
|
-
},Pe=function(e){return"object"===
|
|
201
|
-
!0):"noscript"!==r&&"noembed"!==r||!
|
|
202
|
-
},je=function(e){return e.indexOf("-")>0},Ue=function(e){var t,r,o,i;Be("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U};for(i=a.length;i--;){var l=t=a[i],c=l.name,u=l.namespaceURI;if(r="value"===c?t.value:
|
|
203
|
-
Fe(n)||(n.content instanceof i&&e(n.content),Ue(n));Be("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){var o,a,l,c,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((be=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Pe(e)){if("function"!=typeof e.toString)throw
|
|
204
|
-
;if(!(o=Oe(e)))return ee?null:ne?x:""}o&&Q&&ze(o.firstChild);for(var p=Ie(se?e:o);l=p.nextNode();)3===l.nodeType&&l===c||Fe(l)||(l.content instanceof i&&qe(l.content),Ue(l),c=l);if(c=null,se)return e;if(ee){if(te)for(u=E.call(o.ownerDocument);o.firstChild;)u.appendChild(o.firstChild);else u=o;return U.shadowroot&&(u=T.call(r,u,!0)),u}var m=Z?o.outerHTML:o.innerHTML;return Z&&H["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&
|
|
205
|
-
var t,n=""+e,r=
|
|
206
|
-
;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__=
|
|
127
|
+
twitter:'<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="currentColor" stroke="none" d="M15.969 3.049c-.59.259-1.22.436-1.884.516a3.305 3.305 0 0 0 1.442-1.815c-.634.37-1.336.64-2.084.79a3.28 3.28 0 0 0-5.59 2.988 9.29 9.29 0 0 1-6.76-3.418A3.214 3.214 0 0 0 .65 3.76c0 1.14.58 2.142 1.459 2.73a3.27 3.27 0 0 1-1.485-.41v.04a3.282 3.282 0 0 0 2.63 3.218 3.33 3.33 0 0 1-1.474.057 3.291 3.291 0 0 0 3.069 2.278A6.578 6.578 0 0 1 .78 13.076c-.26 0-.52-.015-.78-.044a9.33 9.33 0 0 0 5.038 1.472c6.036 0 9.332-4.997 9.332-9.323 0-.14 0-.28-.01-.42.64-.46 1.2-1.04 1.64-1.7l-.031-.012z"></path></g></svg>'};async function Eo({title:e="Confirm",message:t,confirmAction:n="Yes"}){const r=document.createElement("div");return r.setAttribute("data-testid","confirm-container"),r.style.position="relative",r.style.zIndex="10",
|
|
128
|
+
document.body.appendChild(r),new Promise((o=>{const i=e=>{dr(null,r),r.remove(),o(e)};dr(Ur(mo,{title:e,message:t,confirmAction:n,onConfirm:()=>i(!0),onCancel:()=>i(!1)}),r)}))}function Ao(e){if(!e)return null;const t=e.match(/^acct:([^@]+)@(.+)/);return t?{username:t[1],provider:t[2]}:null}function To(e){const t=Ao(e);return t?t.username:""}function No(e,t){const n=Ao(e);return!!n&&n.provider!==t}const Mo={accentColor:"color",appBackgroundColor:"backgroundColor",ctaBackgroundColor:"backgroundColor",ctaTextColor:"color",selectionFontFamily:"fontFamily",annotationFontFamily:"fontFamily"};function Lo(e,t){const n={};if(!t.branding)return n;const{branding:r}=t;return e.forEach((e=>{const t=Mo[e],o=r[e];t&&o&&(n[t]=o)})),n}const zo=hr({get(e){throw new Error(`Missing ServiceContext provider to provide "${e}" prop`)}});function Ro(e,t){function n(n){const r=Rr(zo),o={};for(let e of t)e in n||(o[e]=r.get(e));const i={...o,...n};return Ur(e,{...i})}const r=e.displayName||e.name
|
|
129
|
+
;return n.displayName=`withServices(${r})`,n}function Oo(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Io(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 Do(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?Io(Object(n),!0).forEach((function(t){Oo(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Io(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function Po(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. "}var Bo="function"==typeof Symbol&&Symbol.observable||"@@observable",Fo=function(){
|
|
130
|
+
return Math.random().toString(36).substring(7).split("").join(".")},Ho={INIT:"@@redux/INIT"+Fo(),REPLACE:"@@redux/REPLACE"+Fo(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Fo()}};function jo(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 Uo(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(Po(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(Po(1));return n(Uo)(e,t)}if("function"!=typeof e)throw new Error(Po(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(Po(3));return i}function d(e){if("function"!=typeof e)throw new Error(Po(4));if(l)throw new Error(Po(5));var t=!0;return c(),s.push(e),function(){if(t){if(l)throw new Error(Po(6));t=!1,c();var n=s.indexOf(e);s.splice(n,1),a=null}}}
|
|
131
|
+
function h(e){if(!jo(e))throw new Error(Po(7));if(void 0===e.type)throw new Error(Po(8));if(l)throw new Error(Po(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(Po(10));o=e,h({type:Ho.REPLACE})}function m(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(Po(11));function n(){e.next&&e.next(u())}return n(),{unsubscribe:t(n)}}})[Bo]=function(){return this},e}return h({type:Ho.INIT}),(r={dispatch:h,subscribe:d,getState:u,replaceReducer:p})[Bo]=m,r}function qo(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:Ho.INIT}))throw new Error(Po(12));if(void 0===n(void 0,{type:Ho.PROBE_UNKNOWN_ACTION()}))throw new Error(Po(13))}))}(n)}catch(e){i=e}return function(e,t){if(void 0===e&&(e={}),i)throw i
|
|
132
|
+
;for(var r=!1,o={},s=0;s<a.length;s++){var l=a[s],c=n[l],u=e[l],d=c(u,t);if(void 0===d)throw t&&t.type,new Error(Po(14));o[l]=d,r=r||d!==u}return(r=r||a.length!==Object.keys(e).length)?o:e}}function $o(e,t){return function(){return t(e.apply(this,arguments))}}function Go(){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 Vo(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 Yo=Vo();Yo.withExtraArgument=Vo;var Wo=Yo;function Ko(e){return(t={},n)=>{const r=e[n.type];if(!r)return t;const o=r(t,n);return{...t,...o}}}function Xo(e,t){const n={};for(let[r,o]of Object.entries(e))n[r]=(...e)=>o(t(),...e);return n}function Zo(e,t){return Object.assign(e,t)}function Jo(e,t=[],n=[]){const r={};for(let n of e)r[n.namespace]=n.initialState(...t);const o={}
|
|
133
|
+
;for(let t of e)o[t.namespace]=Ko(t.reducers);const i=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(Po(15))},o={getState:n.getState,dispatch:function(){return r.apply(void 0,arguments)}},i=t.map((function(e){return e(o)}));return r=Go.apply(void 0,i)(n.dispatch),Do(Do({},n),{},{dispatch:r})}}}(...[Wo],...n);const a=Uo(qo(o),r,i),s={};for(let t of e)Zo(s,t.actionCreators);const l=function(e,t){if("function"==typeof e)return $o(e,t);if("object"!=typeof e||null===e)throw new Error(Po(16));var n={};for(var r in e){var o=e[r];"function"==typeof o&&(n[r]=$o(o,t))}return n}(s,a.dispatch);Object.assign(a,l);const c={};for(let t of e){const{namespace:e,selectors:n,rootSelectors:r}=t;if(Zo(c,Xo(n,(()=>a.getState()[e]))),r){Zo(c,Xo(r,a.getState))}}return Object.assign(a,c),a}function Qo(e,t,n){return{type:t,...n}}function ei(e,t){if(!(e instanceof Function)){const t=e;e=()=>t}return{
|
|
134
|
+
initialState:e,...t}}function ti(e){let t=0;return n=>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 ni={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}},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}),
|
|
135
|
+
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})};const ri=ei({activeAnnotationSaveRequests:[],activeApiRequests:0,activeAnnotationFetches:0,hasFetchedAnnotations:!1,annotationResultCount:null},{reducers:ni,namespace:"activity",actionCreators:{annotationFetchStarted:function(){return Qo(0,"ANNOTATION_FETCH_STARTED",void 0)},annotationFetchFinished:function(){return Qo(0,"ANNOTATION_FETCH_FINISHED",void 0)},annotationSaveStarted:function(e){return Qo(0,"ANNOTATION_SAVE_STARTED",{annotation:e})},annotationSaveFinished:function(e){return Qo(0,"ANNOTATION_SAVE_FINISHED",{annotation:e})},apiRequestStarted:function(){return Qo(0,"API_REQUEST_STARTED",void 0)},apiRequestFinished:function(){return Qo(0,"API_REQUEST_FINISHED",void 0)},
|
|
136
|
+
setAnnotationResultCount:function(e){return Qo(0,"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 oi=function(e,t){return e===t};function ii(e,t){var n,r,o="object"==typeof t?t:{equalityCheck:t},i=o.equalityCheck,a=void 0===i?oi: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;for(var r=t.length,o=0;o<r;o++)if(!e(t[o],n[o]))return!1;return!0}}(a),d=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}
|
|
137
|
+
}):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 h(){var t=d.get(arguments);if("NOT_FOUND"===t){if(t=e.apply(null,arguments),c){var n=d.getEntries(),r=n.find((function(e){return c(e.value,t)}));r&&(t=r.value)}d.put(arguments,t)}return t}return h.clearCache=function(){return d.clear()},h}function ai(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){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 si(e){
|
|
138
|
+
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,d=void 0===u?n:u,h=Array.isArray(d)?d:[d],p=ai(r),m=e.apply(void 0,[function(){return a++,l.apply(null,arguments)}].concat(h)),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(){return a},resetRecomputations:function(){return a=0}}),f};return o}var li=si(ii);function ci(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function ui(e){const t=e.uri;let n;try{n=new URL(t).hostname}catch{n=""}
|
|
139
|
+
"localhost"===n&&(n="");let r=n;return e.document&&e.document.title&&(r=e.document.title[0]),{uri:t,domain:n,title:r}}function di(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 hi(e){const t=ui(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 pi(e){let t=ui(e).title;return t.length>30&&(t=t.slice(0,30)+"…"),t}function mi(e){return(e.references||[]).length>0}function fi(e){return!!e.id}function gi(e){return!e.id}function vi(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 _i(e){return!!(e.target&&e.target.length>0&&e.target[0].selector)}function bi(e){return _i(e)&&void 0===e.$orphan&&!e.$anchorTimeout}function yi(e){return!!e.hidden}function wi(e){
|
|
140
|
+
return!!e.$highlight||!gi(e)&&!(ki(e)||mi(e)||e.hidden||e.text||e.tags&&e.tags.length)}function xi(e){return _i(e)&&!0===e.$orphan}function ki(e){return!_i(e)&&!mi(e)}function Si(e){return!(!_i(e)||xi(e))}function Ci(e){return mi(e)?"Reply":wi(e)?"Highlight":ki(e)?"Page note":"Annotation"}function Ei(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 Ai(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}function Ti(e,t){return e.reduce(((e,n)=>t(n)?e+1:e),0)}function Ni(e){const t={};return e.forEach((e=>t[e]=!0)),t}function Mi(e){return Object.keys(e).filter((t=>!0===e[t]))}function Li(e){return Object.entries(e)}const zi={CHANGE_ROUTE:(e,{name:t,params:n})=>({name:t,params:n})};const Ri=ei({name:null,params:{}},{namespace:"route",reducers:zi,
|
|
141
|
+
actionCreators:{changeRoute:function(e,t={}){return Qo(0,"CHANGE_ROUTE",{name:e,params:t})}},selectors:{route:function(e){return e.name},routeParams:function(e){return e.params}}});function Oi(e,t){return e.find((e=>e.id===t))}function Ii(e,t){return e.find((e=>e.$tag===t))}function Di(e,t){let n=e.$orphan;return e.id||(n=!1),Object.assign({},e,{$anchorTimeout:!1,$tag:e.$tag||t,$orphan:n})}const Pi={ADD_ANNOTATIONS(e,t){const n=new Set,r=new Set,o=[],i=[],a=[];let s=e.nextTag;for(let i of t.annotations){let t;i.id&&(t=Oi(e.annotations,i.id)),!t&&i.$tag&&(t=Ii(e.annotations,i.$tag)),t?(a.push(Object.assign({},t,i)),i.id&&n.add(i.id),t.$tag&&r.add(t.$tag)):(o.push(Di(i,"t"+s)),++s)}for(let t of e.annotations)n.has(t.id)||r.has(t.$tag)||i.push(t);return{annotations:o.concat(a).concat(i),nextTag:s}},CLEAR_ANNOTATIONS:()=>({annotations:[],highlighted:{},hovered:{}}),HOVER_ANNOTATIONS:(e,t)=>({hovered:Ni(t.tags)}),HIDE_ANNOTATION:(e,t)=>({annotations:e.annotations.map((e=>e.id!==t.id?e:{...e,hidden:!0}))}),
|
|
142
|
+
HIGHLIGHT_ANNOTATIONS:(e,t)=>({highlighted:t.highlighted}),REMOVE_ANNOTATIONS:(e,t)=>({annotations:[...t.remainingAnnotations]}),UNHIDE_ANNOTATION:(e,t)=>({annotations:e.annotations.map((e=>e.id!==t.id?e:Object.assign({},e,{hidden:!1})))}),UPDATE_ANCHOR_STATUS:(e,t)=>({annotations:e.annotations.map((e=>{if(!ci(t.statusUpdates,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:(e,t)=>({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 e=t.isFlagged?1:-1;n.moderation={...n.moderation,flagCount:n.moderation.flagCount+e}}return n}return e}))})};function Bi(e){return(t,n)=>{const r=function(e,t){const n=new Set,r=new Set;for(let e of t)e.id&&n.add(e.id),e.$tag&&r.add(e.$tag);return e.filter((e=>!(e.id&&n.has(e.id)||e.$tag&&r.has(e.$tag))))}(n().annotations.annotations,e)
|
|
143
|
+
;t(Qo(0,"REMOVE_ANNOTATIONS",{annotationsToRemove:e,remainingAnnotations:r}))}}function Fi(e){return Qo(0,"UPDATE_ANCHOR_STATUS",{statusUpdates:e})}const Hi=li((e=>e.annotations),(e=>Ti(e,Si)));const ji=li((e=>e.hovered),(e=>Mi(e))),Ui=li((e=>e.highlighted),(e=>Mi(e)));const qi=li((e=>e.annotations),(e=>e.some(bi))),$i=li((e=>e.annotations),(e=>e.filter((e=>gi(e)&&!wi(e))))),Gi=li((e=>e.annotations),(e=>e.filter((e=>gi(e)&&wi(e))))),Vi=li((e=>e.annotations),(e=>Ti(e,ki))),Yi=li((e=>e.annotations),(e=>Ti(e,xi)));const Wi=ei({annotations:[],hovered:{},highlighted:{},nextTag:1},{namespace:"annotations",reducers:Pi,actionCreators:{addAnnotations:function(e){return function(t,n){const r=e.filter((e=>!e.id||!Oi(n().annotations.annotations,e.id)));if(t(Qo(0,"ADD_ANNOTATIONS",{annotations:e,currentAnnotationCount:n().annotations.annotations.length})),"sidebar"!==Ri.selectors.route(n().route))return;const o=r.filter(bi).map((e=>e.id));o.length>0&&setTimeout((()=>{
|
|
144
|
+
const e=n().annotations.annotations,r=o.map((t=>t?Oi(e,t):null)).filter((e=>e&&bi(e))).reduce(((e,t)=>(e[t.$tag]="timeout",e)),{});t(Fi(r))}),500)}},clearAnnotations:function(){return Qo(0,"CLEAR_ANNOTATIONS",void 0)},hoverAnnotations:function(e){return Qo(0,"HOVER_ANNOTATIONS",{tags:e})},hideAnnotation:function(e){return Qo(0,"HIDE_ANNOTATION",{id:e})},highlightAnnotations:function(e){return Qo(0,"HIGHLIGHT_ANNOTATIONS",{highlighted:Ni(e)})},removeAnnotations:Bi,unhideAnnotation:function(e){return Qo(0,"UNHIDE_ANNOTATION",{id:e})},updateAnchorStatus:Fi,updateFlagStatus:function(e,t){return Qo(0,"UPDATE_FLAG_STATUS",{id:e,isFlagged:t})}},selectors:{allAnnotations:function(e){return e.annotations},annotationCount:Hi,annotationExists:function(e,t){return e.annotations.some((e=>e.id===t))},findAnnotationByID:function(e,t){return Oi(e.annotations,t)},findIDsForTags:function(e,t){const n=[];for(let r of t){const t=Ii(e.annotations,r);t&&t.id&&n.push(t.id)}return n},hoveredAnnotations:ji,highlightedAnnotations:Ui,
|
|
145
|
+
isAnnotationHovered:function(e,t){return!0===e.hovered[t]},isWaitingToAnchorAnnotations:qi,newAnnotations:$i,newHighlights:Gi,noteCount:Vi,orphanCount:Yi,savedAnnotations:function(e){return e.annotations.filter((e=>fi(e)))}}}),Ki={SET_DEFAULT:(e,t)=>({[t.defaultKey]:t.value})};const Xi=ei({annotationPrivacy:null,focusedGroup:null},{namespace:"defaults",reducers:Ki,actionCreators:{setDefault:function(e,t){return Qo(0,"SET_DEFAULT",{defaultKey:e,value:t})}},selectors:{getDefault:function(e,t){return e[t]},getDefaults:function(e){return e}}});const Zi={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:()=>({directLinkedAnnotationId:null,directLinkedGroupId:null,
|
|
146
|
+
directLinkedGroupFetchFailed:!1})};const Ji=ei((function(e){return{directLinkedGroupId:e.group||null,directLinkedAnnotationId:e.annotations||null,directLinkedGroupFetchFailed:!1}}),{namespace:"directLinked",reducers:Zi,actionCreators:{setDirectLinkedGroupFetchFailed:function(){return Qo(0,"UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED",{directLinkedGroupFetchFailed:!0})},setDirectLinkedGroupId:function(e){return Qo(0,"UPDATE_DIRECT_LINKED_GROUP_ID",{directLinkedGroupId:e})},setDirectLinkedAnnotationId:function(e){return Qo(0,"UPDATE_DIRECT_LINKED_ANNOTATION_ID",{directLinkedAnnotationId:e})},clearDirectLinkedGroupFetchFailed:function(){return Qo(0,"UPDATE_DIRECT_LINKED_GROUP_FETCH_FAILED",{directLinkedGroupFetchFailed:!1})},clearDirectLinkedIds:function(){return Qo(0,"CLEAR_DIRECT_LINKED_IDS",void 0)}},selectors:{directLinkedAnnotationId:function(e){return e.directLinkedAnnotationId},directLinkedGroupFetchFailed:function(e){return e.directLinkedGroupFetchFailed},directLinkedGroupId:function(e){
|
|
147
|
+
return e.directLinkedGroupId}}});class Qi{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(){return!this.text&&0===this.tags.length}}const ea={DISCARD_ALL_DRAFTS:()=>({drafts:[]}),REMOVE_DRAFT:(e,t)=>({drafts:e.drafts.filter((e=>!e.match(t.annotation)))}),UPDATE_DRAFT(e,t){const n=e.drafts.filter((e=>!e.match(t.draft.annotation)));return n.push(t.draft),{drafts:n}}};function ta(e){return Qo(0,"REMOVE_DRAFT",{annotation:e})}function na(e,t){const n=e.drafts;for(let e=0;e<n.length;e++){const r=n[e];if(r.match(t))return r}return null}function ra(e,t){const n=na(e,t);return n?n.isEmpty()?null:n:null}const oa=li((e=>e.drafts),(e=>e.filter((e=>!e.annotation.id)).map((e=>e.annotation)))),ia=ei({drafts:[]},{namespace:"drafts",reducers:ea,actionCreators:{createDraft:function(e,t){return Qo(0,"UPDATE_DRAFT",{draft:new Qi(e,t)})},
|
|
148
|
+
deleteNewAndEmptyDrafts:function(){return(e,t)=>{const n=t().drafts.drafts.filter((e=>!e.annotation.id&&!ra(t().drafts,e.annotation))).map((t=>(e(ta(t.annotation)),t.annotation)));e(Bi(n))}},discardAllDrafts:function(){return Qo(0,"DISCARD_ALL_DRAFTS",void 0)},removeDraft:ta},selectors:{countDrafts:function(e){return e.drafts.length},getDraft:na,getDraftIfNotEmpty:ra,unsavedAnnotations:oa}});function aa(e){var t,n;return!!(null!==(t=e.user)&&void 0!==t&&t.username||null!==(n=e.user)&&void 0!==n&&n.userid)}function sa(e){const t=e.user;if(!t||!aa(e))return{};const n=t.username||t.userid||"";return{user:{value:n,display:t.displayName||n}}}const la={CHANGE_FOCUS_MODE_USER:(e,t)=>({focusActive:aa({user:t.user}),focusFilters:sa({user:t.user})}),SET_FILTER(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:(e,t)=>({query:t.query}),SET_FOCUS_MODE(e,t){var n;return{
|
|
149
|
+
focusActive:null!==(n=t.active)&&void 0!==n?n:!e.focusActive}},CLEAR_SELECTION:()=>({filters:{},focusActive:!1,query:null})};const ca=li((e=>e.focusActive),(e=>e.focusFilters),((e,t)=>{var n;return{active:e,configured:!(null==t||!t.user),displayName:(null==t||null===(n=t.user)||void 0===n?void 0:n.display)||""}})),ua=li((e=>e.filters),(e=>e.focusActive),(e=>e.focusFilters),((e,t,n)=>t?{...n,...e}:{...e}));const da=li((e=>ua(e)),(e=>{const t={};for(let[n,r]of Object.entries(e))r&&(t[n]=r.value);return t}));const ha=ei((function(e){const t=e.focus||{};return{filters:{},focusActive:aa(t),focusFilters:sa(t),query:e.query||null}}),{namespace:"filters",reducers:la,actionCreators:{changeFocusModeUser:function(e){return Qo(0,"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(Qo(0,"SET_FOCUS_MODE",{active:!1})),n(Qo(0,"SET_FILTER",{filterName:e,filterOption:t}))}},setFilterQuery:function(e){return Qo(0,"SET_FILTER_QUERY",{query:e})},
|
|
150
|
+
toggleFocusMode:function(e){return Qo(0,"SET_FOCUS_MODE",{active:e})}},selectors:{filterQuery:function(e){return e.query},focusState:ca,getFilter:function(e,t){return ua(e)[t]},getFilters:ua,getFilterValues:da,getFocusFilters:function(e){return e.focusFilters},hasAppliedFilter:function(e){return!(!e.query&&!Object.keys(ua(e)).length)}}});var pa=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],d=t[c];if(!1===(o=n?n.call(r,u,d,c):void 0)||void 0===o&&u!==d)return!1}return!0};const ma={CONNECT_FRAME(e,t){const n=e.frames.findIndex((e=>e.id===t.frame.id)),r=[...e.frames];return-1!==n?r[n]=t.frame:r.push(t.frame),{frames:r}},DESTROY_FRAME(e,t){const n=e.frames.filter((e=>e!==t.frame));return{frames:n}},
|
|
151
|
+
UPDATE_FRAME_ANNOTATION_FETCH_STATUS:(e,t)=>({frames:e.frames.map((e=>e.uri&&e.uri===t.uri?Object.assign({},e,{isAnnotationFetchComplete:t.isAnnotationFetchComplete}):e))}),SET_CONTENT_INFO:(e,t)=>({contentInfo:t.info})};const fa=li((e=>e.frames),(e=>e.find((e=>!e.id))||null));const ga=si(ii,pa)((e=>e.frames.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));const va=ei({frames:[],contentInfo:null},{namespace:"frames",reducers:ma,actionCreators:{connectFrame:function(e){return Qo(0,"CONNECT_FRAME",{frame:e})},destroyFrame:function(e){return Qo(0,"DESTROY_FRAME",{frame:e})},setContentInfo:function(e){return Qo(0,"SET_CONTENT_INFO",{info:e})},updateFrameAnnotationFetchStatus:function(e,t){return Qo(0,"UPDATE_FRAME_ANNOTATION_FETCH_STATUS",{uri:e,isAnnotationFetchComplete:t})}},selectors:{
|
|
152
|
+
getContentInfo:function(e){return e.contentInfo},frames:function(e){return e.frames},mainFrame:fa,searchUris:ga}}),_a={features:{},preferences:{},userid:null};const ba={UPDATE_PROFILE:(e,t)=>({profile:{...t.profile}})};const ya=ei((function(e){var t;return{defaultAuthority:null!==(t=null==e?void 0:e.authDomain)&&void 0!==t?t:"",profile:_a}}),{namespace:"session",reducers:ba,actionCreators:{updateProfile:function(e){return Qo(0,"UPDATE_PROFILE",{profile:e})}},selectors:{defaultAuthority:function(e){return e.defaultAuthority},hasFetchedProfile:function(e){return e.profile!==_a},isFeatureEnabled:function(e,t){return!!e.profile.features[t]},isLoggedIn:function(e){return null!==e.profile.userid},profile:function(e){return e.profile}}}),wa={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{filteredGroupIds:null};let o=e.focusedGroupId
|
|
153
|
+
;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:[]})};function xa(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 ka(e,t){return e.groups.find((e=>e.id===t))}
|
|
154
|
+
const Sa=li((e=>xa(e)),(e=>e.filter((e=>!e.isMember&&e.isScopedToUri)))),Ca=li((e=>xa(e)),(e=>e.filter((e=>e.isScopedToUri)))),Ea=li((e=>xa(e.groups)),(e=>ya.selectors.isLoggedIn(e.session)),((e,t)=>t?e.filter((e=>e.isMember)):[])),Aa=li((e=>xa(e.groups)),(e=>Ea(e)),(e=>Sa(e.groups)),((e,t,n)=>e.filter((e=>!t.includes(e)&&!n.includes(e))))),Ta=ei({filteredGroupIds:null,groups:[],focusedGroupId:null},{namespace:"groups",reducers:wa,actionCreators:{filterGroups:function(e){return Qo(0,"FILTER_GROUPS",{filteredGroupIds:e})},focusGroup:function(e){return Qo(0,"FOCUS_GROUP",{id:e})},loadGroups:function(e){return Qo(0,"LOAD_GROUPS",{groups:e})},clearGroups:function(){return Qo(0,"CLEAR_GROUPS",void 0)}},selectors:{allGroups:function(e){return e.groups},filteredGroups:xa,filteredGroupIds:function(e){return e.filteredGroupIds},focusedGroup:function(e){return e.focusedGroupId?ka(e,e.focusedGroupId):null},focusedGroupId:function(e){return e.focusedGroupId},getFeaturedGroups:Sa,getGroup:ka,getInScopeGroups:Ca},
|
|
155
|
+
rootSelectors:{getCurrentlyViewingGroups:Aa,getMyGroups:Ea}});function Na(e,t){const n={};for(const r in t)if(ci(t,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}}const Ma={UPDATE_LINKS:(e,t)=>({...t.links})};const La=ei(null,{namespace:"links",reducers:Ma,actionCreators:{updateLinks:function(e){return Qo(0,"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}=Na(r,n),a=Object.keys(i);if(a.length>0)throw new Error(`Unused parameters: ${a.join(", ")}`);return o}}}),za={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};for(let e of t)e.id&&delete n[e.id];return{pendingUpdates:n}},REMOVE_ANNOTATIONS(e,{annotationsToRemove:t}){
|
|
156
|
+
const n={...e.pendingUpdates},r={...e.pendingDeletions};for(let e of t)e.id&&(delete n[e.id],delete r[e.id]);return{pendingUpdates:n,pendingDeletions:r}},FOCUS_GROUP:()=>({pendingUpdates:{},pendingDeletions:{}})};const Ra=li((e=>[e.pendingUpdates,e.pendingDeletions]),(([e,t])=>Object.keys(e).length+Object.keys(t).length));const Oa=ei({pendingUpdates:{},pendingDeletions:{}},{namespace:"realTimeUpdates",reducers:za,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!==Ta.selectors.focusedGroupId(t)&&"sidebar"===Ri.selectors.route(n)||(o[e.id]=e)})),t.forEach((e=>{const t=e.id;delete o[t];const n=r().annotations;Wi.selectors.annotationExists(n,t)&&(i[t]=!0)})),n(Qo(0,"RECEIVE_REAL_TIME_UPDATES",{pendingUpdates:o,pendingDeletions:i}))}},clearPendingUpdates:function(){return Qo(0,"CLEAR_PENDING_UPDATES",void 0)
|
|
157
|
+
}},selectors:{hasPendingDeletion:function(e,t){return ci(e.pendingDeletions,t)},pendingDeletions:function(e){return e.pendingDeletions},pendingUpdates:function(e){return e.pendingUpdates},pendingUpdateCount:Ra}}),Ia={annotation:"Location",note:"Oldest",orphan:"Location"};function Da(e){const t={};return e.annotations&&!e.query&&(t[e.annotations]=!0),t}const Pa=(e,t)=>t===e?{}:{selectedTab:e,sortKey:Ia[e]},Ba={CLEAR_ANNOTATION_FOCUS_REQUEST:()=>({focusRequest:null}),CLEAR_SELECTION:()=>({forcedVisible:{},selected:{}}),SELECT_ANNOTATIONS:(e,t)=>({selected:t.selection}),SELECT_TAB:(e,t)=>Pa(t.tab,e.selectedTab),SET_EXPANDED(e,t){const n={...e.expanded};return n[t.id]=t.expanded,{expanded:n}},SET_ANNOTATION_FOCUS_REQUEST:(e,t)=>({focusRequest:t.id}),SET_FORCED_VISIBLE:(e,t)=>({forcedVisible:{...e.forcedVisible,[t.id]:t.visible}}),SET_SORT_KEY:(e,t)=>({sortKey:t.key}),TOGGLE_SELECTED_ANNOTATIONS(e,t){const n={...e.selected};return t.toggleIds.forEach((e=>{n[e]=!n[e]})),{selected:n}},ADD_ANNOTATIONS(e,t){
|
|
158
|
+
const n=t.annotations.filter((e=>!mi(e))),r=Ti(t.annotations,ki)===n.length;return 0===t.currentAnnotationCount&&r?Pa("note",e.selectedTab):{}},CHANGE_FOCUS_MODE_USER:()=>({forcedVisible:{},selected:{}}),SET_FILTER:()=>({forcedVisible:{},selected:{},expanded:{}}),SET_FILTER_QUERY:()=>({forcedVisible:{},selected:{},expanded:{}}),SET_FOCUS_MODE:()=>({forcedVisible:{},selected:{}}),REMOVE_ANNOTATIONS(e,t){let n=e.selectedTab;"orphan"===n&&0===Ti(t.remainingAnnotations,xi)&&(n="annotation");const r=e=>(t.annotationsToRemove.forEach((t=>{t.id&&delete e[t.id],t.$tag&&delete e[t.$tag]})),e);return{...Pa(n,e.selectedTab),expanded:r({...e.expanded}),forcedVisible:r({...e.forcedVisible}),selected:r({...e.selected})}}};function Fa(){return Qo(0,"CLEAR_SELECTION",void 0)}function Ha(e){return e.expanded}const ja=li((e=>e.forcedVisible),(e=>Mi(e))),Ua=li((e=>e.selected),(e=>Mi(e).length>0)),qa=li((e=>e.selected),(e=>Mi(e)));function $a(e){return e.selectedTab}const Ga=li((e=>e),(e=>({expanded:Ha(e),forcedVisible:ja(e),
|
|
159
|
+
selected:qa(e),sortKey:Va(e),selectedTab:$a(e)})));function Va(e){return e.sortKey}const Ya=li((e=>e.selectedTab),(e=>{const t=["Newest","Oldest"];return"note"!==e&&t.push("Location"),t})),Wa=ei((function(e){return{selected:Da(e),expanded:Da(e),forcedVisible:{},selectedTab:"annotation",sortKey:Ia.annotation,focusRequest:null}}),{namespace:"selection",reducers:Ba,actionCreators:{clearAnnotationFocusRequest:function(){return Qo(0,"CLEAR_ANNOTATION_FOCUS_REQUEST",void 0)},clearSelection:Fa,selectAnnotations:function(e){return t=>{t(Fa()),t(Qo(0,"SELECT_ANNOTATIONS",{selection:Ni(e)}))}},selectTab:function(e){return Qo(0,"SELECT_TAB",{tab:e})},setAnnotationFocusRequest:function(e){return Qo(0,"SET_ANNOTATION_FOCUS_REQUEST",{id:e})},setExpanded:function(e,t){return Qo(0,"SET_EXPANDED",{id:e,expanded:t})},setForcedVisible:function(e,t){return Qo(0,"SET_FORCED_VISIBLE",{id:e,visible:t})},setSortKey:function(e){return Qo(0,"SET_SORT_KEY",{key:e})},toggleSelectedAnnotations:function(e){
|
|
160
|
+
return Qo(0,"TOGGLE_SELECTED_ANNOTATIONS",{toggleIds:e})}},selectors:{expandedMap:Ha,annotationFocusRequest:function(e){return e.focusRequest},forcedVisibleThreads:ja,hasSelectedAnnotations:Ua,selectedAnnotations:qa,selectedTab:$a,selectionState:Ga,sortKey:Va,sortKeys:Ya}}),Ka={OPEN_SIDEBAR_PANEL:(e,t)=>({activePanelName:t.panelName}),CLOSE_SIDEBAR_PANEL(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}}};const Xa=ei({activePanelName:null},{namespace:"sidebarPanels",reducers:Ka,actionCreators:{openSidebarPanel:function(e){return Qo(0,"OPEN_SIDEBAR_PANEL",{panelName:e})},closeSidebarPanel:function(e){return Qo(0,"CLOSE_SIDEBAR_PANEL",{panelName:e})},toggleSidebarPanel:function(e,t){return Qo(0,"TOGGLE_SIDEBAR_PANEL",{panelName:e,panelState:t})}},selectors:{
|
|
161
|
+
isSidebarPanelOpen:function(e,t){return e.activePanelName===t}}}),Za={ADD_MESSAGE:(e,t)=>({messages:e.messages.concat({...t.message})}),REMOVE_MESSAGE:(e,t)=>({messages:e.messages.filter((e=>e.id!==t.id))}),UPDATE_MESSAGE:(e,t)=>({messages:e.messages.map((e=>e.id&&e.id===t.message.id?{...t.message}:e))})};const Ja=ei({messages:[]},{namespace:"toastMessages",reducers:Za,actionCreators:{addToastMessage:function(e){return Qo(0,"ADD_MESSAGE",{message:e})},removeToastMessage:function(e){return Qo(0,"REMOVE_MESSAGE",{id:e})},updateToastMessage:function(e){return Qo(0,"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))}}}),Qa={SET_SIDEBAR_OPENED:(e,t)=>!0===t.opened?{sidebarHasOpened:!0}:{}};const es=ei({sidebarHasOpened:!1},{namespace:"viewer",reducers:Qa,actionCreators:{setSidebarOpened:function(e){
|
|
162
|
+
return Qo(0,"SET_SIDEBAR_OPENED",{opened:e})}},selectors:{hasSidebarOpened:function(e){return e.sidebarHasOpened}}});class ts{constructor(e,t,n,r){this.name=e,this.method=t,this.args=n,this.result=r}matches(e,t){return this.name===e&&this.args.every(((e,n)=>t[n]===e))}}function ns(e){return Jo([ri,Wi,Xi,Ji,ia,ha,va,La,Ta,Oa,Ri,Wa,ya,Xa,Ja,es],[e],[ti])}function rs(){var e;return function(e){const[,t]=Ar((e=>e+1),0),n=Mr([]).current,r=Mr(null);if(!r.current){const t=new Map,o=(e,r)=>{const o=e[r];if("function"!=typeof o)return o;let i=t.get(r);return i||(i=(...t)=>{const i=n.find((e=>e.matches(r,t)));if(i)return i.result;const a=e.getState(),s=o.apply(e,t);return a===e.getState()&&n.push(new ts(r,o,t,s)),s},t.set(r,i),i)};r.current=new Proxy(e,{get:o})}return Nr((()=>e.subscribe((()=>{n.find((t=>t.method.apply(e,t.args)!==t.result))&&(n.splice(0,n.length),t(0))}))),[n,e]),r.current}((e="store",Rr(zo).get(e)))}ns.$inject=["settings"];const os={collapsed:!1,depth:0,visible:!0,replyCount:0};function is(e){
|
|
163
|
+
return e.id||e.$tag}function as(e,t,n){const r=e[n];return!(!r||r.parent===t)&&(!r.parent||as(e,t,r.parent))}function ss(e,t,n=[]){if(e[t].parent||!n.length)return;const r=n[n.length-1];e[r]||(e[r]={...os,children:[],id:r},ss(e,r,n.slice(0,-1))),as(e,t,r)&&(e[t].parent=r,e[r].children.push(e[t]))}function ls(e,t){return Object.assign({},t(e),{children:e.children.map((e=>ls(e,t)))})}function cs(e,t,n){const r=e.children.map((e=>cs(e,n,n))).slice().sort(t);return{...e,children:r}}function us(e,t){const n=e.children.map((e=>us(e,t+1))),r=n.reduce(((e,t)=>e+1+t.replyCount),0);return{...e,children:n,depth:t,replyCount:r}}function ds(e){return e.children.some((e=>e.visible||ds(e)))}const hs=(e,t)=>e.annotation&&t.annotation?e.annotation.created<t.annotation.created?-1:e.annotation.created>t.annotation.created?1:0:0;function ps(e,t){const n=t.selected.length>0,r=t.forcedVisible.length>0;let o=function(e){const t={};e.forEach((e=>{const n=is(e);t[n]={...os,children:[],annotation:e,id:n}})),e.forEach((e=>{
|
|
164
|
+
const n=(e.references||[]).filter((t=>t!==e.id));return ss(t,is(e),n)}));const n=[];for(const e in t)t[e].parent||(t[e].collapsed=!0,n.push(t[e]));return{...os,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=ls(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||ds(e))),o=ls(o,(e=>{const n={collapsed:e.collapsed};if(ci(t.expanded,e.id))n.collapsed=!t.expanded[e.id];else{const r=t.filterFn&&ds(e);n.collapsed=e.collapsed&&!r}return{...e,...n}})),o=cs(o,t.sortCompareFn,hs),o=us(o,-1),o}function ms(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 fs(e){
|
|
165
|
+
if(!e)return[];const t=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]=ms(r);o&&(n[e]=o+":"+t(i))}return n}function gs(e){const t={},n=e=>"tag"===e?"tags":e;if(e){const r=fs(e);for(const e of r){let[r,o]=ms(e);r||(r="any",o=e);const i=n(r);t[i]?t[i].push(o):t[i]=[o]}}return t}
|
|
166
|
+
const vs=/[\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
|
|
167
|
+
;function _s(e){return function(e){return e.replace(vs,"")}((t=e,t.normalize("NFKD"))).toLowerCase();var t}class bs{constructor(e,t){this.term=t.normalize(e),this.matcher=t}matches(e){const t=this.matcher;return t.fieldValues(e).some((e=>t.matches(t.normalize(e),this.term)))}}class ys{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)))}}function ws(e){return{fieldValues:e,matches:(e,t)=>e.includes(t),normalize:_s}}const xs={quote:ws((e=>{var t;return[null!==(t=Ai(e))&&void 0!==t?t:""]})),since:{fieldValues:e=>[new Date(e.updated).valueOf()],matches:(e,t)=>(Date.now()-e)/1e3<=t,normalize:e=>e},tag:ws((e=>e.tags)),text:ws((e=>[e.text])),uri:ws((e=>[e.uri])),user:ws((e=>{var t,n;return[e.user,null!==(t=null===(n=e.user_info)||void 0===n?void 0:n.display_name)&&void 0!==t?t:""]}))};function ks(e){return xi(e)?"orphan":ki(e)?"note":"annotation"}function Ss(e,t){const n=e.visible===t
|
|
168
|
+
;return e.children.reduce(((e,n)=>e+Ss(n,t)),n?1:0)}function Cs(e){return Ss(e,!1)}function Es(e){return Ss(e,!0)}function As(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 As(n);throw new Error("Thread contains no annotations")}function Ts(e){return As([e]).reduce(((e,t)=>t.created>e?t.created:e),"")}function Ns(e){return As([e]).reduce(((e,t)=>(e||(e=t.created),t.created<e?t.created:e)),"")}const Ms={Newest:(e,t)=>{const n=Ts(e),r=Ts(t);return n>r?-1:n<r?1:0},Oldest:(e,t)=>{const n=Ns(e),r=Ns(t);return n<r?-1:n>r?1:0},Location:(e,t)=>{if(!e.annotation||!t.annotation)return function(e,t){return e.annotation||t.annotation?e.annotation?1:-1:0}(e,t);const n=Ei(e.annotation),r=Ei(t.annotation);return n<r?-1:n>r?1:0}};const Ls=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){
|
|
169
|
+
const t=e.selection,n={expanded:t.expanded,forcedVisible:t.forcedVisible,selected:t.selected,sortCompareFn:Ms[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=fs(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":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)
|
|
170
|
+
;n.filterFn=t=>function(e,t){const n=(e,t)=>new bs(t,xs[e]),r=Object.entries(t).filter((([,e])=>e.terms.length>0)).map((([e,t])=>{let r;if("any"===e){const e=["quote","text","tag","user"];r=t.terms.map((t=>new ys("or",e.map((e=>n(e,t))))))}else r=t.terms.map((t=>n(e,t)));return new ys(t.operator,r)})),o=new ys("and",r);return e.filter((e=>e.id&&o.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,!bi(n)&&ks(n)===r);var n,r}),ps(e.annotations,n)}));function zs(){const e=rs(),t=e.allAnnotations(),n=e.filterQuery(),r=e.route(),o=e.selectionState(),i=e.getFilterValues(),a=Lr((()=>({annotations:t,route:r,selection:{...o,filterQuery:n,filters:i}})),[t,n,r,o,i]);return Ls(a)}
|
|
171
|
+
var Rs=/^\s+|\s+$/g,Os=/^[-+]0x[0-9a-f]+$/i,Is=/^0b[01]+$/i,Ds=/^0o[0-7]+$/i,Ps=parseInt,Bs="object"==typeof d&&d&&d.Object===Object&&d,Fs="object"==typeof self&&self&&self.Object===Object&&self,Hs=Bs||Fs||Function("return this")(),js=Object.prototype.toString,Us=Math.max,qs=Math.min,$s=function(){return Hs.Date.now()};function Gs(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function Vs(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&"[object Symbol]"==js.call(e)}(e))return NaN;if(Gs(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=Gs(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(Rs,"");var n=Is.test(e);return n||Ds.test(e)?Ps(e.slice(2),n?2:8):Os.test(e)?NaN:+e}var Ys=function(e,t,n){var r,o,i,a,s,l,c=0,u=!1,d=!1,h=!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)}function m(e){return c=e,s=setTimeout(g,t),u?p(e):a}
|
|
172
|
+
function f(e){var n=e-l;return void 0===l||n>=t||n<0||d&&e-c>=i}function g(){var e=$s();if(f(e))return v(e);s=setTimeout(g,function(e){var n=t-(e-l);return d?qs(n,i-(e-c)):n}(e))}function v(e){return s=void 0,h&&r?p(e):(r=o=void 0,a)}function _(){var e=$s(),n=f(e);if(r=arguments,o=this,l=e,n){if(void 0===s)return m(l);if(d)return s=setTimeout(g,t),p(l)}return void 0===s&&(s=setTimeout(g,t)),a}return t=Vs(t)||0,Gs(n)&&(u=!!n.leading,i=(d="maxWait"in n)?Us(Vs(n.maxWait)||0,t):i,h="trailing"in n?!!n.trailing:h),_.cancel=function(){void 0!==s&&clearTimeout(s),c=0,r=l=o=s=void 0},_.flush=function(){return void 0===s?a:v($s())},_};class Ws{constructor(){var e,t,n;n=void 0,(t="_listeners")in(e=this)?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,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){
|
|
173
|
+
const{eventTarget:n,eventType:r,listener:o}=t;n.removeEventListener(r,o),this._listeners.delete(e)}}removeAll(){this._listeners.forEach((({eventTarget:e,eventType:t,listener:n})=>{e.removeEventListener(t,n)})),this._listeners.clear()}}const Ks={defaultHeight:200,marginAbove:800,marginBelow:800};function Xs(e){const t=window.getComputedStyle(e);return e.getBoundingClientRect().height+(parseFloat(t.marginTop)+parseFloat(t.marginBottom))}function Zs(e,t,n){var r;const o=No(e.user,t);return(n||o)&&null!==(r=e.user_info)&&void 0!==r&&r.display_name?e.user_info.display_name:To(e.user)}function Js(e){return/^http(s?):/i.test(e)}function Qs(e){return{read:[e],update:[e],delete:[e]}}function el(e,t){return Object.assign(Qs(e),{read:["group:"+t]})}function tl(e,t,n){return"private"===function(e){switch(e){case"private":case"shared":return e;default:return"shared"}}(n)&&e?Qs(e):el(e,t)}function nl(e){return e.read.some((e=>0===e.indexOf("group:")))}function rl(e){return!nl(e)}function ol(e){
|
|
174
|
+
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),t.setSelectionRange(0,t.value.length),document.execCommand("copy")}finally{t.remove()}}const il=(e=window.navigator.userAgent)=>e.indexOf("Mac OS")>=0;var al="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/ArrowRight.js";function sl(e){return Ur("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",...e,children:Ur("g",{"fill-rule":"evenodd",fill:"none",children:[Ur("path",{d:"M0 0h16v16H0z"},void 0,!1,{fileName:al,lineNumber:19,columnNumber:9}),Ur("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"m9 4 4 4-4 4m3-4H3h9z"},void 0,!1,{fileName:al,lineNumber:20,columnNumber:9})]},void 0,!0,{fileName:al,
|
|
175
|
+
lineNumber:18,columnNumber:7})},void 0,!1,{fileName:al,lineNumber:10,columnNumber:5})}var ll="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/External.js";function cl(e){return Ur("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",...e,children:Ur("g",{"fill-rule":"evenodd",fill:"none",children:[Ur("path",{d:"M0 0h16v16H0z"},void 0,!1,{fileName:ll,lineNumber:19,columnNumber:9}),Ur("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M7 3h6v6m-1-5-9 9 9-9z"},void 0,!1,{fileName:ll,lineNumber:20,columnNumber:9})]},void 0,!0,{fileName:ll,lineNumber:18,columnNumber:7})},void 0,!1,{fileName:ll,lineNumber:10,columnNumber:5})}var ul="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/PointerDown.js";function dl(e){return Ur("svg",{width:"16",height:"9",xmlns:"http://www.w3.org/2000/svg",...e,children:Ur("path",{d:"m15.5 0-7 8-8-8",stroke:"currentColor"},void 0,!1,{
|
|
176
|
+
fileName:ul,lineNumber:11,columnNumber:7})},void 0,!1,{fileName:ul,lineNumber:10,columnNumber:5})}var hl="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/PointerUp.js";function pl(e){return Ur("svg",{width:"16",height:"9",xmlns:"http://www.w3.org/2000/svg",...e,children:Ur("path",{d:"m.5 9 7-8 8 8",stroke:"currentColor"},void 0,!1,{fileName:hl,lineNumber:11,columnNumber:7})},void 0,!1,{fileName:hl,lineNumber:10,columnNumber:5})}var ml="/home/runner/work/frontend-shared/frontend-shared/src/components/icons/Profile.js";function fl(e){return Ur("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16","aria-hidden":"true",...e,children:Ur("g",{"fill-rule":"evenodd",fill:"none",children:[Ur("path",{d:"M0 0h16v16H0z"},void 0,!1,{fileName:ml,lineNumber:19,columnNumber:9}),Ur("path",{stroke:"currentColor","stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M1 15c0-2.761 3.134-5 7-5s7 2.239 7 5M8 7a3 3 0 1 1 0-6 3 3 0 0 1 0 6z"},void 0,!1,{
|
|
177
|
+
fileName:ml,lineNumber:20,columnNumber:9})]},void 0,!0,{fileName:ml,lineNumber:18,columnNumber:7})},void 0,!1,{fileName:ml,lineNumber:10,columnNumber:5})}hr({}),hr({}),hr({});const gl=function({elementRef:e,children:t,classes:n,unstyled:r=!1,expanded:o,pressed:i,title:a,role:s,...l}){const c={"aria-label":a};return"tab"===s?c["aria-selected"]=i:(c["aria-pressed"]=i,c["aria-expanded"]=o),Ur("button",{role:null!=s?s:"button",...c,"data-base-component":"ButtonBase","data-component":"ButtonBase",...l,className:Bn({"focus-visible-ring rounded-sm":!r,"transition-colors":!r,"whitespace-nowrap flex items-center":!r},n),title:a,ref:e,children:t},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/input/ButtonBase.js",lineNumber:58,columnNumber:5})};Bn("input-group:border input-group:rounded-none","input-group:first:rounded-l-sm input-group:last:rounded-r-sm","input-group:border-l-0 input-group:first:border-l")
|
|
178
|
+
;const vl=function({children:e,classes:t,elementRef:n,active:r=!1,variant:o="raised",width:i="full",...a}){return Ur("div",{...a,ref:n,className:Bn("rounded-sm border bg-white",{"shadow hover:shadow-md":"raised"===o,"shadow-md":r&&"raised"===o},{"w-full":"full"===i,"w-auto":"auto"===i},t),"data-component":"Card",children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/layout/Card.js",lineNumber:36,columnNumber:5})};const _l=function({children:e,classes:t,elementRef:n,unstyled:r=!1,...o}){return Ur("a",{"data-base-component":"LinkBase","data-component":"LinkBase",...o,className:Bn({"focus-visible-ring rounded-sm":!r},t),rel:"noopener noreferrer",ref:n,children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/LinkBase.js",lineNumber:24,columnNumber:5})};const bl=function({children:e,classes:t,elementRef:n,underline:r="none",color:o="brand",...i}){return Ur(_l,{...i,classes:Bn({
|
|
179
|
+
"text-brand hover:text-brand-dark":"brand"===o,"text-color-text-light hover:text-brand":"text-light"===o,"text-color-text hover:text-brand-dark":"text"===o},{"no-underline hover:no-underline":"none"===r,"underline hover:underline":"always"===r,"no-underline hover:underline":"hover"===r},t),elementRef:n,"data-component":"Link",children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/Link.js",lineNumber:32,columnNumber:5})};const yl=function({children:e,classes:t,elementRef:n,color:r="brand",inline:o=!1,underline:i="none",variant:a="secondary",...s}){return Ur(gl,{...s,elementRef:n,classes:Bn("aria-pressed:font-semibold aria-expanded:font-semibold",{inline:o,"flex items-center":!o},{"text-brand enabled:hover:text-brand-dark":"brand"===r,"text-color-text enabled:hover:text-brand-dark":"text"===r,"text-color-text-light enabled:hover:text-brand":"text-light"===r},{"no-underline hover:no-underline":"none"===i,"underline enabled:hover:underline":"always"===i,
|
|
180
|
+
"no-underline enabled:hover:underline":"hover"===i},{"font-semibold":"primary"===a},t),"data-component":"LinkButton",children:e},void 0,!1,{fileName:"/home/runner/work/frontend-shared/frontend-shared/src/components/navigation/LinkButton.js",lineNumber:37,columnNumber:5})};function wl({classes:e,direction:t="up"}){return Ur("up"===t?pl:dl,{name:"pointer",className:Bn("absolute inline z-2 text-grey-3 fill-white",e)})}function xl({label:e,iconName:t,uri:n}){return Ur("li",{children:Ur(lo,{"aria-label":e,classes:"text-grey-6 hover:text-color-text block",href:n,title:e,target:"_blank",children:Ur(so,{name:t})})})}function kl({shareURI:e}){const t=encodeURIComponent(e);return Ur("ul",{className:"flex flex-row gap-x-4 items-center justify-center border-t pt-2",children:[Ur(xl,{iconName:"twitter",label:"Tweet share link",uri:`https://twitter.com/intent/tweet?url=${t}&hashtags=annotated`}),Ur(xl,{iconName:"facebook",label:"Share on Facebook",uri:`https://www.facebook.com/sharer/sharer.php?u=${t}`}),Ur(xl,{
|
|
181
|
+
iconName:"email",label:"Share via email",uri:`mailto:?subject=${encodeURIComponent("Let's Annotate")}&body=${t}`})]})}function Sl(){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)()}var Cl=Ro((function({annotation:e,toastMessenger:t,group:n,shareUri:r}){const o=rl(e.permissions),i=Js(e.uri),a=Mr(null),s=Mr(null),[l,c]=Er(!1),u=Mr(l);if(uo(a,l,(()=>c(!1))),Tr((()=>{var e,t;u.current!==l&&(u.current=l,l&&!Sl()&&(null===(e=s.current)||void 0===e||e.focus(),null===(t=s.current)||void 0===t||t.select()))}),[l]),!n)return null;const d=i,h="private"===n.type?Ur("span",{children:["Only members of the group ",Ur("em",{children:n.name})," may view this annotation."]}):Ur("span",{children:"Anyone using this link may view this annotation."}),p=o?Ur("span",{children:"Only you may view this annotation."}):h;return Ur("div",{className:"relative",ref:a,children:[Ur(Wr,{icon:"share",
|
|
182
|
+
title:"Share",onClick:()=>c(!l),expanded:l}),l&&Ur(Qr,{classes:Bn("w-96 max-w-[85vw]","absolute bottom-8 right-1 touch:bottom-touch-minimum","space-y-2 p-2","theme-clean:border theme-clean:border-solid theme-clean:border-grey-3"),children:[Ur("div",{className:"flex items-center",children:Ur("h2",{className:"text-brand text-lg font-medium",children:"Share this annotation"})}),Ur("div",{className:Bn("flex w-full text-sm touch:text-base"),children:Ur(xo,{children:[Ur(wo,{"aria-label":"Use this URL to share this annotation",type:"text",value:r,readOnly:!0,inputRef:s}),Ur(Wr,{icon:"copy",title:"Copy share link to clipboard",onClick:()=>{try{ol(r),t.success("Copied share link to clipboard")}catch(e){t.error("Unable to copy link")}},variant:"dark"})]})}),Ur("div",{className:"text-base font-normal","data-testid":"share-details",children:Ur(Gn,i?{children:p}:{
|
|
183
|
+
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."})}),d&&Ur(kl,{shareURI:r}),Ur(wl,{direction:"down",classes:"bottom-[-9px] right-1 touch:right-[9px]"})]})]})}),["toastMessenger"]);var El=Ro((function({annotation:e,annotationsService:n,onReply:r,settings:o,toastMessenger:i}){const a=rs(),s=a.profile(),l=a.getGroup(e.group),c=a.isLoggedIn(),u=t=>function(e,t,n){return-1!==e[t].indexOf(n||"")}(e.permissions,t,s.userid),d=u("delete"),h=u("update"),p=function(e){const n=t(e);return!1!==(null==n?void 0:n.allowFlagging)}(o)&&!!s.userid&&s.userid!==e.user,m=function(e){const n=t(e);return!1!==(null==n?void 0:n.enableShareLinks)}(o)&&function(e){var t,n,r,o,i,a
|
|
184
|
+
;return Js(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 Ur("div",{className:"flex text-xl","data-testid":"annotation-action-bar",children:[h&&Ur(Wr,{icon:"edit",title:"Edit",onClick:()=>{a.createDraft(e,{tags:e.tags,text:e.text,isPrivate:rl(e.permissions)})}}),d&&Ur(Wr,{icon:"trash",title:"Delete",onClick:async()=>{const t=Ci(e);if(await Eo({title:`Delete ${t.toLowerCase()}?`,message:`Are you sure you want to delete this ${t.toLowerCase()}?`,confirmAction:"Delete"}))try{await n.delete(e),i.success(`${t} deleted`,{visuallyHidden:!0})}catch(e){i.error(e.message)}}}),Ur(Wr,{icon:"reply",title:"Reply",onClick:()=>{c?r():a.openSidebarPanel("loginPrompt")}}),m&&Ur(Cl,{annotation:e,group:l,shareUri:m}),p&&!e.flagged&&Ur(Wr,{icon:"flag",title:"Report this annotation to moderators",onClick:()=>{
|
|
185
|
+
n.flag(e).catch((()=>i.error("Flagging annotation failed")))}}),p&&e.flagged&&Ur(Wr,{pressed:!0,icon:"flag--active",title:"Annotation has been reported to the moderators"})]})}),["annotationsService","settings","toastMessenger"]);function Al({isCollapsed:e,setCollapsed:t,linkStyle:n={}}){return Ur("div",{className:Bn("absolute block right-0 bottom-0","w-20 bg-gradient-to-l from-white"),children:Ur("div",{className:"flex justify-end",children:Ur(yl,{color:"text",onClick:()=>t(!e),expanded:!e,title:"Toggle visibility of full excerpt text",style:n,underline:"always",inline:!0,children:e?"More":"Less"})})})}const Tl=()=>{};var Nl=Ro((function({children:e,collapse:t=!1,collapsedHeight:n,inlineControls:r=!0,onCollapsibleChanged:o=Tl,onToggleCollapsed:i=Tl,overflowThreshold:a=0,settings:s={}}){const[l,c]=Er(!0),u=Mr(),[d,h]=Er(0),p=zr((()=>{const e=u.current.clientHeight;h(e);o(e>n+a)}),[n,o,a]);Nr((()=>{const e=function(e,t){if("undefined"!=typeof ResizeObserver){
|
|
186
|
+
const n=new ResizeObserver((()=>t(e.clientWidth,e.clientHeight)));return n.observe(e),()=>n.disconnect()}const n=new Ws;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=d>n+a,f=m&&(r?l:t),g={};0!==d&&(g["max-height"]=f?n:d);const v=e=>r?c(e):i(e);return Ur("div",{"data-testid":"excerpt-container",className:Bn("relative overflow-hidden","transition-[max-height] ease-in duration-150"),style:g,children:[Ur("div",{className:Bn("inline-block w-full"),"data-testid":"excerpt-content",ref:u,children:e}),Ur("div",{"data-testid":"excerpt-expand",role:"presentation",onClick:()=>v(!1),className:Bn("transition-[opacity] duration-150 ease-linear","absolute w-full bottom-0 h-touch-minimum",{
|
|
187
|
+
"bg-gradient-to-b from-excerpt-stop-1 via-excerpt-stop-2 to-excerpt-stop-3":!r&&f,"bg-none":r,"opacity-0 pointer-events-none":!f}),title:"Show the full excerpt"}),m&&r&&Ur(Al,{isCollapsed:l,setCollapsed:v,linkStyle:Lo(["selectionFontFamily"],s)})]})}),["settings"]);function Ml(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 Ll(e){const t=/(\d+)([hms]?)/g,n={h:3600,m:60,s:1};let r,o=0;for(;null!==(r=t.exec(e));)if(r[2]){const e=r[2];o+=Number(r[1])*n[e]}else o+=+r[1];return o.toString()}function zl(e,t){const n=function(e){const t=["end","start","t"],n=new URLSearchParams(e.search),r=new URLSearchParams
|
|
188
|
+
;for(let[e,o]of n)t.includes(e)&&("t"===e?r.append("start",Ll(o)):r.append(e,o));r.sort();let o=r.toString();return o&&(o=`?${o}`),o}(t);return Ml(`https://www.youtube.com/embed/${e}${n}`)}function Rl(e,t,n,{aspectRatio:r}={}){return o=>{if(o.hostname!==e)return null;const i=t.exec(o.pathname);if(!i)return null;const a=i[1];return Ml(n(a),r)}}const Ol=[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?zl(t[1],e):null},function(e){if("youtu.be"!==e.hostname)return null;const t=/^\/([^/]+)\/?$/.exec(e.pathname);return t?zl(t[1],e):null},Rl("vimeo.com",/^\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),Rl("vimeo.com",/^\/channels\/[^/]+\/([^/?#]+)\/?$/,(e=>`https://player.vimeo.com/video/${e}`)),Rl("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
|
|
189
|
+
;let n=t[2];const r=new URLSearchParams(e.search);let o=r.get("start"),i=r.get("end");if(!o){const e=n.match(/\/start\/([^/]+)/);e&&(o=e[1],n=n.replace(e[0],""))}if(!i){const e=n.match(/\/end\/([^/]+)/);e&&(i=e[1],n=n.replace(e[0],""))}const a=new URL(`https://archive.org/embed/${n}`);return o&&a.searchParams.append("start",o),i&&a.searchParams.append("end",i),Ml(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 Il(e){if(e.href!==e.textContent)try{const t=encodeURI(e.textContent);if(e.href!==t)return null}catch{return null}const t=function(e){let t,n;for(n=0;n<Ol.length;n++)if(t=Ol[n](e),t)return t;return null}(e);return t&&e.parentElement.replaceChild(t,e),t}function Dl(e){return Dl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){
|
|
190
|
+
return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dl(e)}function Pl(e,t){return Pl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},Pl(e,t)}function Bl(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}function Fl(e,t,n){return Fl=Bl()?Reflect.construct:function(e,t,n){var r=[null];r.push.apply(r,t);var o=new(Function.bind.apply(e,r));return n&&Pl(o,n.prototype),o},Fl.apply(null,arguments)}function Hl(e){return function(e){if(Array.isArray(e))return jl(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return jl(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name)
|
|
191
|
+
;if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jl(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function jl(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}var Ul=Object.hasOwnProperty,ql=Object.setPrototypeOf,$l=Object.isFrozen,Gl=Object.getPrototypeOf,Vl=Object.getOwnPropertyDescriptor,Yl=Object.freeze,Wl=Object.seal,Kl=Object.create,Xl="undefined"!=typeof Reflect&&Reflect,Zl=Xl.apply,Jl=Xl.construct;Zl||(Zl=function(e,t,n){return e.apply(t,n)}),Yl||(Yl=function(e){return e}),Wl||(Wl=function(e){return e}),Jl||(Jl=function(e,t){return Fl(e,Hl(t))})
|
|
192
|
+
;var Ql,ec=uc(Array.prototype.forEach),tc=uc(Array.prototype.pop),nc=uc(Array.prototype.push),rc=uc(String.prototype.toLowerCase),oc=uc(String.prototype.match),ic=uc(String.prototype.replace),ac=uc(String.prototype.indexOf),sc=uc(String.prototype.trim),lc=uc(RegExp.prototype.test),cc=(Ql=TypeError,function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return Jl(Ql,t)});function uc(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return Zl(e,t,r)}}function dc(e,t,n){n=n||rc,ql&&ql(e,null);for(var r=t.length;r--;){var o=t[r];if("string"==typeof o){var i=n(o);i!==o&&($l(t)||(t[r]=i),o=i)}e[o]=!0}return e}function hc(e){var t,n=Kl(null);for(t in e)Zl(Ul,e,[t])&&(n[t]=e[t]);return n}function pc(e,t){for(;null!==e;){var n=Vl(e,t);if(n){if(n.get)return uc(n.get);if("function"==typeof n.value)return uc(n.value)}e=Gl(e)}return function(e){return console.warn("fallback value for",e),null}}
|
|
193
|
+
var mc=Yl(["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"]),fc=Yl(["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"]),gc=Yl(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),vc=Yl(["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"]),_c=Yl(["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"]),bc=Yl(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),yc=Yl(["#text"]),wc=Yl(["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"]),xc=Yl(["accent-height","accumulate","additive","alignment-baseline","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),kc=Yl(["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"]),Sc=Yl(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),Cc=Wl(/\{\{[\w\W]*|[\w\W]*\}\}/gm),Ec=Wl(/<%[\w\W]*|[\w\W]*%>/gm),Ac=Wl(/^data-[\-\w.\u00B7-\uFFFF]/),Tc=Wl(/^aria-[\-\w]+$/),Nc=Wl(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|cid|xmpp):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Mc=Wl(/^(?:\w+script|data):/i),Lc=Wl(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),zc=Wl(/^html$/i),Rc=function(){
|
|
194
|
+
return"undefined"==typeof window?null:window},Oc=function(e,t){if("object"!==Dl(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},createScriptURL:function(e){return e}})}catch(e){return console.warn("TrustedTypes policy "+o+" could not be created."),null}};var Ic=function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Rc(),n=function(t){return e(t)};if(n.version="2.4.0",n.removed=[],!t||!t.document||9!==t.document.nodeType)return n.isSupported=!1,n;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,d=void 0===u?t.NamedNodeMap||t.MozNamedAttrMap:u,h=t.HTMLFormElement,p=t.DOMParser,m=t.trustedTypes,f=l.prototype,g=pc(f,"cloneNode"),v=pc(f,"nextSibling"),_=pc(f,"childNodes"),b=pc(f,"parentNode")
|
|
195
|
+
;if("function"==typeof a){var y=o.createElement("template");y.content&&y.content.ownerDocument&&(o=y.content.ownerDocument)}var w=Oc(m,r),x=w?w.createHTML(""):"",k=o,S=k.implementation,C=k.createNodeIterator,E=k.createDocumentFragment,A=k.getElementsByTagName,T=r.importNode,N={};try{N=hc(o).documentMode?o.documentMode:{}}catch(e){}var M={};n.isSupported="function"==typeof b&&S&&void 0!==S.createHTMLDocument&&9!==N;var L,z,R=Cc,O=Ec,I=Ac,D=Tc,P=Mc,B=Lc,F=Nc,H=null,j=dc({},[].concat(Hl(mc),Hl(fc),Hl(gc),Hl(_c),Hl(yc))),U=null,q=dc({},[].concat(Hl(wc),Hl(xc),Hl(kc),Hl(Sc))),$=Object.seal(Object.create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}
|
|
196
|
+
})),G=null,V=null,Y=!0,W=!0,K=!1,X=!1,Z=!1,J=!1,Q=!1,ee=!1,te=!1,ne=!1,re=!0,oe=!1,ie="user-content-",ae=!0,se=!1,le={},ce=null,ue=dc({},["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"]),de=null,he=dc({},["audio","video","img","source","image","track"]),pe=null,me=dc({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fe="http://www.w3.org/1998/Math/MathML",ge="http://www.w3.org/2000/svg",ve="http://www.w3.org/1999/xhtml",_e=ve,be=!1,ye=["application/xhtml+xml","text/html"],we="text/html",xe=null,ke=o.createElement("form"),Se=function(e){return e instanceof RegExp||e instanceof Function},Ce=function(e){xe&&xe===e||(e&&"object"===Dl(e)||(e={}),e=hc(e),L=L=-1===ye.indexOf(e.PARSER_MEDIA_TYPE)?we:e.PARSER_MEDIA_TYPE,z="application/xhtml+xml"===L?function(e){return e}:rc,
|
|
197
|
+
H="ALLOWED_TAGS"in e?dc({},e.ALLOWED_TAGS,z):j,U="ALLOWED_ATTR"in e?dc({},e.ALLOWED_ATTR,z):q,pe="ADD_URI_SAFE_ATTR"in e?dc(hc(me),e.ADD_URI_SAFE_ATTR,z):me,de="ADD_DATA_URI_TAGS"in e?dc(hc(he),e.ADD_DATA_URI_TAGS,z):he,ce="FORBID_CONTENTS"in e?dc({},e.FORBID_CONTENTS,z):ue,G="FORBID_TAGS"in e?dc({},e.FORBID_TAGS,z):{},V="FORBID_ATTR"in e?dc({},e.FORBID_ATTR,z):{},le="USE_PROFILES"in e&&e.USE_PROFILES,Y=!1!==e.ALLOW_ARIA_ATTR,W=!1!==e.ALLOW_DATA_ATTR,K=e.ALLOW_UNKNOWN_PROTOCOLS||!1,X=e.SAFE_FOR_TEMPLATES||!1,Z=e.WHOLE_DOCUMENT||!1,ee=e.RETURN_DOM||!1,te=e.RETURN_DOM_FRAGMENT||!1,ne=e.RETURN_TRUSTED_TYPE||!1,Q=e.FORCE_BODY||!1,re=!1!==e.SANITIZE_DOM,oe=e.SANITIZE_NAMED_PROPS||!1,ae=!1!==e.KEEP_CONTENT,se=e.IN_PLACE||!1,F=e.ALLOWED_URI_REGEXP||F,_e=e.NAMESPACE||ve,e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&($.tagNameCheck=e.CUSTOM_ELEMENT_HANDLING.tagNameCheck),
|
|
198
|
+
e.CUSTOM_ELEMENT_HANDLING&&Se(e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&($.attributeNameCheck=e.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),e.CUSTOM_ELEMENT_HANDLING&&"boolean"==typeof e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements&&($.allowCustomizedBuiltInElements=e.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),X&&(W=!1),te&&(ee=!0),le&&(H=dc({},Hl(yc)),U=[],!0===le.html&&(dc(H,mc),dc(U,wc)),!0===le.svg&&(dc(H,fc),dc(U,xc),dc(U,Sc)),!0===le.svgFilters&&(dc(H,gc),dc(U,xc),dc(U,Sc)),!0===le.mathMl&&(dc(H,_c),dc(U,kc),dc(U,Sc))),e.ADD_TAGS&&(H===j&&(H=hc(H)),dc(H,e.ADD_TAGS,z)),e.ADD_ATTR&&(U===q&&(U=hc(U)),dc(U,e.ADD_ATTR,z)),e.ADD_URI_SAFE_ATTR&&dc(pe,e.ADD_URI_SAFE_ATTR,z),e.FORBID_CONTENTS&&(ce===ue&&(ce=hc(ce)),dc(ce,e.FORBID_CONTENTS,z)),ae&&(H["#text"]=!0),Z&&dc(H,["html","head","body"]),H.table&&(dc(H,["tbody"]),delete G.tbody),Yl&&Yl(e),xe=e)
|
|
199
|
+
},Ee=dc({},["mi","mo","mn","ms","mtext"]),Ae=dc({},["foreignobject","desc","title","annotation-xml"]),Te=dc({},["title","style","font","a","script"]),Ne=dc({},fc);dc(Ne,gc),dc(Ne,vc);var Me=dc({},_c);dc(Me,bc);var Le=function(e){var t=b(e);t&&t.tagName||(t={namespaceURI:ve,tagName:"template"});var n=rc(e.tagName),r=rc(t.tagName);return e.namespaceURI===ge?t.namespaceURI===ve?"svg"===n:t.namespaceURI===fe?"svg"===n&&("annotation-xml"===r||Ee[r]):Boolean(Ne[n]):e.namespaceURI===fe?t.namespaceURI===ve?"math"===n:t.namespaceURI===ge?"math"===n&&Ae[r]:Boolean(Me[n]):e.namespaceURI===ve&&(!(t.namespaceURI===ge&&!Ae[r])&&(!(t.namespaceURI===fe&&!Ee[r])&&(!Me[n]&&(Te[n]||!Ne[n]))))},ze=function(e){nc(n.removed,{element:e});try{e.parentNode.removeChild(e)}catch(t){try{e.outerHTML=x}catch(t){e.remove()}}},Re=function(e,t){try{nc(n.removed,{attribute:t.getAttributeNode(e),from:t})}catch(e){nc(n.removed,{attribute:null,from:t})}if(t.removeAttribute(e),"is"===e&&!U[e])if(ee||te)try{ze(t)}catch(e){}else try{
|
|
200
|
+
t.setAttribute(e,"")}catch(e){}},Oe=function(e){var t,n;if(Q)e="<remove></remove>"+e;else{var r=oc(e,/^[\r\n\t ]+/);n=r&&r[0]}"application/xhtml+xml"===L&&(e='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+e+"</body></html>");var i=w?w.createHTML(e):e;if(_e===ve)try{t=(new p).parseFromString(i,L)}catch(e){}if(!t||!t.documentElement){t=S.createDocument(_e,"template",null);try{t.documentElement.innerHTML=be?"":i}catch(e){}}var a=t.body||t.documentElement;return e&&n&&a.insertBefore(o.createTextNode(n),a.childNodes[0]||null),_e===ve?A.call(t,Z?"html":"body")[0]:Z?t.documentElement:a},Ie=function(e){return C.call(e.ownerDocument||e,e,c.SHOW_ELEMENT|c.SHOW_COMMENT|c.SHOW_TEXT,null,!1)},De=function(e){return e instanceof h&&("string"!=typeof e.nodeName||"string"!=typeof e.textContent||"function"!=typeof e.removeChild||!(e.attributes instanceof d)||"function"!=typeof e.removeAttribute||"function"!=typeof e.setAttribute||"string"!=typeof e.namespaceURI||"function"!=typeof e.insertBefore)
|
|
201
|
+
},Pe=function(e){return"object"===Dl(s)?e instanceof s:e&&"object"===Dl(e)&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName},Be=function(e,t,r){M[e]&&ec(M[e],(function(e){e.call(n,t,r,xe)}))},Fe=function(e){var t;if(Be("beforeSanitizeElements",e,null),De(e))return ze(e),!0;if(lc(/[\u0080-\uFFFF]/,e.nodeName))return ze(e),!0;var r=z(e.nodeName);if(Be("uponSanitizeElement",e,{tagName:r,allowedTags:H}),e.hasChildNodes()&&!Pe(e.firstElementChild)&&(!Pe(e.content)||!Pe(e.content.firstElementChild))&&lc(/<[/\w]/g,e.innerHTML)&&lc(/<[/\w]/g,e.textContent))return ze(e),!0;if("select"===r&&lc(/<template/i,e.innerHTML))return ze(e),!0;if(!H[r]||G[r]){if(!G[r]&&je(r)){if($.tagNameCheck instanceof RegExp&&lc($.tagNameCheck,r))return!1;if($.tagNameCheck instanceof Function&&$.tagNameCheck(r))return!1}if(ae&&!ce[r]){var o=b(e)||e.parentNode,i=_(e)||e.childNodes;if(i&&o)for(var a=i.length-1;a>=0;--a)o.insertBefore(g(i[a],!0),v(e))}return ze(e),!0}return e instanceof l&&!Le(e)?(ze(e),
|
|
202
|
+
!0):"noscript"!==r&&"noembed"!==r||!lc(/<\/no(script|embed)/i,e.innerHTML)?(X&&3===e.nodeType&&(t=e.textContent,t=ic(t,R," "),t=ic(t,O," "),e.textContent!==t&&(nc(n.removed,{element:e.cloneNode()}),e.textContent=t)),Be("afterSanitizeElements",e,null),!1):(ze(e),!0)},He=function(e,t,n){if(re&&("id"===t||"name"===t)&&(n in o||n in ke))return!1;if(W&&!V[t]&&lc(I,t));else if(Y&&lc(D,t));else if(!U[t]||V[t]){if(!(je(e)&&($.tagNameCheck instanceof RegExp&&lc($.tagNameCheck,e)||$.tagNameCheck instanceof Function&&$.tagNameCheck(e))&&($.attributeNameCheck instanceof RegExp&&lc($.attributeNameCheck,t)||$.attributeNameCheck instanceof Function&&$.attributeNameCheck(t))||"is"===t&&$.allowCustomizedBuiltInElements&&($.tagNameCheck instanceof RegExp&&lc($.tagNameCheck,n)||$.tagNameCheck instanceof Function&&$.tagNameCheck(n))))return!1}else if(pe[t]);else if(lc(F,ic(n,B,"")));else if("src"!==t&&"xlink:href"!==t&&"href"!==t||"script"===e||0!==ac(n,"data:")||!de[e]){if(K&&!lc(P,ic(n,B,"")));else if(n)return!1}else;return!0
|
|
203
|
+
},je=function(e){return e.indexOf("-")>0},Ue=function(e){var t,r,o,i;Be("beforeSanitizeAttributes",e,null);var a=e.attributes;if(a){var s={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:U};for(i=a.length;i--;){var l=t=a[i],c=l.name,u=l.namespaceURI;if(r="value"===c?t.value:sc(t.value),o=z(c),s.attrName=o,s.attrValue=r,s.keepAttr=!0,s.forceKeepAttr=void 0,Be("uponSanitizeAttribute",e,s),r=s.attrValue,!s.forceKeepAttr&&(Re(c,e),s.keepAttr))if(lc(/\/>/i,r))Re(c,e);else{X&&(r=ic(r,R," "),r=ic(r,O," "));var d=z(e.nodeName);if(He(d,o,r)){if(!oe||"id"!==o&&"name"!==o||(Re(c,e),r=ie+r),w&&"object"===Dl(m)&&"function"==typeof m.getAttributeType)if(u);else switch(m.getAttributeType(d,o)){case"TrustedHTML":r=w.createHTML(r);break;case"TrustedScriptURL":r=w.createScriptURL(r)}try{u?e.setAttributeNS(u,c,r):e.setAttribute(c,r),tc(n.removed)}catch(e){}}}}Be("afterSanitizeAttributes",e,null)}},qe=function e(t){var n,r=Ie(t);for(Be("beforeSanitizeShadowDOM",t,null);n=r.nextNode();)Be("uponSanitizeShadowNode",n,null),
|
|
204
|
+
Fe(n)||(n.content instanceof i&&e(n.content),Ue(n));Be("afterSanitizeShadowDOM",t,null)};return n.sanitize=function(e){var o,a,l,c,u,d=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if((be=!e)&&(e="\x3c!--\x3e"),"string"!=typeof e&&!Pe(e)){if("function"!=typeof e.toString)throw cc("toString is not a function");if("string"!=typeof(e=e.toString()))throw cc("dirty is not a string, aborting")}if(!n.isSupported){if("object"===Dl(t.toStaticHTML)||"function"==typeof t.toStaticHTML){if("string"==typeof e)return t.toStaticHTML(e);if(Pe(e))return t.toStaticHTML(e.outerHTML)}return e}if(J||Ce(d),n.removed=[],"string"==typeof e&&(se=!1),se){if(e.nodeName){var h=z(e.nodeName);if(!H[h]||G[h])throw cc("root node is forbidden and cannot be sanitized in-place")}}else if(e instanceof s)1===(a=(o=Oe("\x3c!----\x3e")).ownerDocument.importNode(e,!0)).nodeType&&"BODY"===a.nodeName||"HTML"===a.nodeName?o=a:o.appendChild(a);else{if(!ee&&!X&&!Z&&-1===e.indexOf("<"))return w&&ne?w.createHTML(e):e
|
|
205
|
+
;if(!(o=Oe(e)))return ee?null:ne?x:""}o&&Q&&ze(o.firstChild);for(var p=Ie(se?e:o);l=p.nextNode();)3===l.nodeType&&l===c||Fe(l)||(l.content instanceof i&&qe(l.content),Ue(l),c=l);if(c=null,se)return e;if(ee){if(te)for(u=E.call(o.ownerDocument);o.firstChild;)u.appendChild(o.firstChild);else u=o;return U.shadowroot&&(u=T.call(r,u,!0)),u}var m=Z?o.outerHTML:o.innerHTML;return Z&&H["!doctype"]&&o.ownerDocument&&o.ownerDocument.doctype&&o.ownerDocument.doctype.name&&lc(zc,o.ownerDocument.doctype.name)&&(m="<!DOCTYPE "+o.ownerDocument.doctype.name+">\n"+m),X&&(m=ic(m,R," "),m=ic(m,O," ")),w&&ne?w.createHTML(m):m},n.setConfig=function(e){Ce(e),J=!0},n.clearConfig=function(){xe=null,J=!1},n.isValidAttribute=function(e,t,n){xe||Ce({});var r=z(e),o=z(t);return He(r,o,n)},n.addHook=function(e,t){"function"==typeof t&&(M[e]=M[e]||[],nc(M[e],t))},n.removeHook=function(e){if(M[e])return tc(M[e])},n.removeHooks=function(e){M[e]&&(M[e]=[])},n.removeAllHooks=function(){M={}},n}(),Dc=/["'&<>]/,Pc=function(e){
|
|
206
|
+
var t,n=""+e,r=Dc.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 Bc{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 Bc(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class Fc{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 Fc(t,Bc.range(this,e))}}class Hc{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)+": ";var s=i.slice(n,a).replace(/[^]/g,"$&̲")
|
|
207
|
+
;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__=Hc.prototype,l.position=n,l}}Hc.prototype.__proto__=Error.prototype;var jc=/([A-Z])/g,Uc={"&":"&",">":">","<":"<",'"':""","'":"'"},qc=/[&><"']/g;var $c=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},Gc={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(qc,(e=>Uc[e]))},hyphenate:function(e){return e.replace(jc,"-$1").toLowerCase()},getBaseElem:$c,isCharacterBox:function(e){var t=$c(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"}},Vc={displayMode:{type:"boolean",
|
|
207
208
|
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>",
|
|
208
209
|
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"],
|
|
209
|
-
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
|
|
210
|
-
this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},
|
|
211
|
-
return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){e.url&&!e.protocol&&(e.protocol=
|
|
212
|
-
var
|
|
210
|
+
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 Yc(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 Wc{constructor(e){for(var t in this.displayMode=void 0,
|
|
211
|
+
this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{},Vc)if(Vc.hasOwnProperty(t)){var n=Vc[t];this[t]=void 0!==e[t]?n.processor?n.processor(e[t]):e[t]:Yc(n)}}reportNonstrict(e,t,n){var r=this.strict;if("function"==typeof r&&(r=r(e,t,n)),r&&"ignore"!==r){if(!0===r||"error"===r)throw new Hc("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",n);"warn"===r?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,n){var r=this.strict;if("function"==typeof r)try{r=r(e,t,n)}catch(e){r="error"}
|
|
212
|
+
return!(!r||"ignore"===r)&&(!0===r||"error"===r||("warn"===r?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+r+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){e.url&&!e.protocol&&(e.protocol=Gc.protocolFromUrl(e.url));var t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class Kc{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Xc[Zc[this.id]]}sub(){return Xc[Jc[this.id]]}fracNum(){return Xc[Qc[this.id]]}fracDen(){return Xc[eu[this.id]]}cramp(){return Xc[tu[this.id]]}text(){return Xc[nu[this.id]]}isTight(){return this.size>=2}}
|
|
213
|
+
var Xc=[new Kc(0,0,!1),new Kc(1,0,!0),new Kc(2,1,!1),new Kc(3,1,!0),new Kc(4,2,!1),new Kc(5,2,!0),new Kc(6,3,!1),new Kc(7,3,!0)],Zc=[4,5,4,5,6,7,6,7],Jc=[5,5,5,5,7,7,7,7],Qc=[2,3,4,5,6,7,6,7],eu=[3,3,5,5,7,7,7,7],tu=[1,1,3,3,5,5,7,7],nu=[0,1,2,3,2,3,2,3],ru={DISPLAY:Xc[0],TEXT:Xc[2],SCRIPT:Xc[4],SCRIPTSCRIPT:Xc[6]},ou=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];var iu=[];function au(e){for(var t=0;t<iu.length;t+=2)if(e>=iu[t]&&e<=iu[t+1])return!0;return!1}ou.forEach((e=>e.blocks.forEach((e=>iu.push(...e)))));var su={
|
|
213
214
|
doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",
|
|
214
215
|
doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",
|
|
215
216
|
leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",
|
|
@@ -229,7 +230,7 @@ widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,
|
|
|
229
230
|
baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",
|
|
230
231
|
rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",
|
|
231
232
|
rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",
|
|
232
|
-
shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class
|
|
233
|
+
shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class lu{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return Gc.contains(this.classes,e)}toNode(){for(var e=document.createDocumentFragment(),t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){for(var e="",t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map((e=>e.toText())).join("")}}var cu={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],
|
|
233
234
|
67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],
|
|
234
235
|
8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],
|
|
235
236
|
8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],
|
|
@@ -286,191 +287,191 @@ shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,
|
|
|
286
287
|
8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],
|
|
287
288
|
37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],
|
|
288
289
|
79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],
|
|
289
|
-
120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},
|
|
290
|
-
quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},
|
|
291
|
-
"а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function
|
|
292
|
-
this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||
|
|
293
|
-
textSize:e,sizeMultiplier:
|
|
294
|
-
cssEmPerMu:
|
|
295
|
-
this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},
|
|
296
|
-
this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,
|
|
297
|
-
;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+=
|
|
298
|
-
/[îïíì]/.test(this.text)&&(this.text=
|
|
299
|
-
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
|
|
300
|
-
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
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
var
|
|
320
|
-
|
|
321
|
-
var
|
|
322
|
-
return
|
|
323
|
-
i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},
|
|
324
|
-
mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},
|
|
325
|
-
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 d=e.children[u];c-="kern"===d.type?d.size:d.elem.height+d.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.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=
|
|
326
|
-
var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},_=
|
|
327
|
-
if(120485===n||120486===n)return[
|
|
328
|
-
;return
|
|
329
|
-
mord:
|
|
330
|
-
},
|
|
331
|
-
var n=
|
|
332
|
-
r=
|
|
333
|
-
var d=i.children[0];d.style.height=
|
|
334
|
-
;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
|
|
335
|
-
return this.character?this.character:" "}},newDocumentFragment:
|
|
336
|
-
;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
|
|
337
|
-
;if(c instanceof
|
|
338
|
-
},
|
|
290
|
+
120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}},uu={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],
|
|
291
|
+
quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},du={"Å":"A","Ð":"D","Þ":"o","å":"a","ð":"d","þ":"o","А":"A","Б":"B","В":"B","Г":"F","Д":"A","Е":"E","Ж":"K","З":"3","И":"N","Й":"N","К":"K","Л":"N","М":"M","Н":"H","О":"O","П":"N","Р":"P","С":"C","Т":"T","У":"y","Ф":"O","Х":"X","Ц":"U","Ч":"h","Ш":"W","Щ":"W","Ъ":"B","Ы":"X","Ь":"B","Э":"3","Ю":"X","Я":"R",
|
|
292
|
+
"а":"a","б":"b","в":"a","г":"r","д":"y","е":"e","ж":"m","з":"e","и":"n","й":"n","к":"n","л":"n","м":"m","н":"n","о":"o","п":"n","р":"p","с":"c","т":"o","у":"y","ф":"b","х":"x","ц":"n","ч":"n","ш":"w","щ":"w","ъ":"a","ы":"m","ь":"a","э":"e","ю":"m","я":"r"};function hu(e,t,n){if(!cu[t])throw new Error("Font metrics not found for font: "+t+".");var r=e.charCodeAt(0),o=cu[t][r];if(!o&&e[0]in du&&(r=du[e[0]].charCodeAt(0),o=cu[t][r]),o||"text"!==n||au(r)&&(o=cu[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}var pu={};var mu=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],fu=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],gu=function(e,t){return t.size<2?e:mu[e-1][t.size-1]};class vu{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,
|
|
293
|
+
this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||vu.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=fu[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){var t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,minRuleThickness:this.minRuleThickness};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return new vu(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:gu(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,
|
|
294
|
+
textSize:e,sizeMultiplier:fu[e-1]})}havingBaseStyle(e){e=e||this.style.text();var t=gu(vu.BASESIZE,e);return this.size===t&&this.textSize===vu.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){var e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==vu.BASESIZE?["sizing","reset-size"+this.size,"size"+vu.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){var t;if(!pu[t=e>=5?0:e>=3?1:2]){var n=pu[t]={
|
|
295
|
+
cssEmPerMu:uu.quad[t]/18};for(var r in uu)uu.hasOwnProperty(r)&&(n[r]=uu[r][t])}return pu[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}vu.BASESIZE=6;var _u={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},bu={ex:!0,em:!0,mu:!0},yu=function(e){return"string"!=typeof e&&(e=e.unit),e in _u||e in bu||"ex"===e},wu=function(e,t){var n;if(e.unit in _u)n=_u[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)n=t.fontMetrics().cssEmPerMu;else{var r;if(r=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)n=r.fontMetrics().xHeight;else{if("em"!==e.unit)throw new Hc("Invalid unit: '"+e.unit+"'");n=r.fontMetrics().quad}r!==t&&(n*=r.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*n,t.maxSize)},xu=function(e){return+e.toFixed(4)+"em"},ku=function(e){return e.filter((e=>e)).join(" ")},Su=function(e,t,n){if(this.classes=e||[],this.attributes={},this.height=0,
|
|
296
|
+
this.depth=0,this.maxFontSize=0,this.style=n||{},t){t.style.isTight()&&this.classes.push("mtight");var r=t.getColor();r&&(this.style.color=r)}},Cu=function(e){var t=document.createElement(e);for(var n in t.className=ku(this.classes),this.style)this.style.hasOwnProperty(n)&&(t.style[n]=this.style[n]);for(var r in this.attributes)this.attributes.hasOwnProperty(r)&&t.setAttribute(r,this.attributes[r]);for(var o=0;o<this.children.length;o++)t.appendChild(this.children[o].toNode());return t},Eu=function(e){var t="<"+e;this.classes.length&&(t+=' class="'+Gc.escape(ku(this.classes))+'"');var n="";for(var r in this.style)this.style.hasOwnProperty(r)&&(n+=Gc.hyphenate(r)+":"+this.style[r]+";");for(var o in n&&(t+=' style="'+Gc.escape(n)+'"'),this.attributes)this.attributes.hasOwnProperty(o)&&(t+=" "+o+'="'+Gc.escape(this.attributes[o])+'"');t+=">";for(var i=0;i<this.children.length;i++)t+=this.children[i].toMarkup();return t+="</"+e+">"};class Au{constructor(e,t,n,r){this.children=void 0,this.attributes=void 0,
|
|
297
|
+
this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,Su.call(this,e,n,r),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Gc.contains(this.classes,e)}toNode(){return Cu.call(this,"span")}toMarkup(){return Eu.call(this,"span")}}class Tu{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,Su.call(this,t,r),this.children=n||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return Gc.contains(this.classes,e)}toNode(){return Cu.call(this,"a")}toMarkup(){return Eu.call(this,"a")}}class Nu{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 Gc.contains(this.classes,e)}toNode(){var e=document.createElement("img")
|
|
298
|
+
;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+=Gc.hyphenate(n)+":"+this.style[n]+";");return t&&(e+=' style="'+Gc.escape(t)+'"'),e+="'/>"}}var Mu={"î":"ı̂","ï":"ı̈","í":"ı́","ì":"ı̀"};class Lu{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<ou.length;t++)for(var n=ou[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"),
|
|
299
|
+
/[îïíì]/.test(this.text)&&(this.text=Mu[this.text])}hasClass(e){return Gc.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=xu(this.italic)),this.classes.length>0&&((t=t||document.createElement("span")).className=ku(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+=Gc.escape(ku(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+=Gc.hyphenate(r)+":"+this.style[r]+";");n&&(e=!0,t+=' style="'+Gc.escape(n)+'"');var o=Gc.escape(this.text);return e?(t+=">",t+=o,t+="</span>"):o}}class zu{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){
|
|
300
|
+
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 Ru{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",su[this.pathName]),e}toMarkup(){return this.alternate?"<path d='"+this.alternate+"'/>":"<path d='"+su[this.pathName]+"'/>"}}class Ou{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){
|
|
301
|
+
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 Iu(e){if(e instanceof Lu)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}var Du={bin:1,close:1,inner:1,open:1,punct:1,rel:1},Pu={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1},Bu={math:{},text:{}};function Fu(e,t,n,r,o,i){Bu[e][o]={font:t,group:n,replace:r},i&&r&&(Bu[e][r]=Bu[e][o])}var Hu="math",ju="text",Uu="main",qu="ams",$u="accent-token",Gu="bin",Vu="close",Yu="mathord",Wu="op-token",Ku="open",Xu="rel",Zu="textord";Fu(Hu,Uu,Xu,"≡","\\equiv",!0),Fu(Hu,Uu,Xu,"≺","\\prec",!0),Fu(Hu,Uu,Xu,"≻","\\succ",!0),Fu(Hu,Uu,Xu,"∼","\\sim",!0),Fu(Hu,Uu,Xu,"⊥","\\perp"),Fu(Hu,Uu,Xu,"⪯","\\preceq",!0),
|
|
302
|
+
Fu(Hu,Uu,Xu,"⪰","\\succeq",!0),Fu(Hu,Uu,Xu,"≃","\\simeq",!0),Fu(Hu,Uu,Xu,"∣","\\mid",!0),Fu(Hu,Uu,Xu,"≪","\\ll",!0),Fu(Hu,Uu,Xu,"≫","\\gg",!0),Fu(Hu,Uu,Xu,"≍","\\asymp",!0),Fu(Hu,Uu,Xu,"∥","\\parallel"),Fu(Hu,Uu,Xu,"⋈","\\bowtie",!0),Fu(Hu,Uu,Xu,"⌣","\\smile",!0),Fu(Hu,Uu,Xu,"⊑","\\sqsubseteq",!0),Fu(Hu,Uu,Xu,"⊒","\\sqsupseteq",!0),Fu(Hu,Uu,Xu,"≐","\\doteq",!0),Fu(Hu,Uu,Xu,"⌢","\\frown",!0),Fu(Hu,Uu,Xu,"∋","\\ni",!0),Fu(Hu,Uu,Xu,"∝","\\propto",!0),Fu(Hu,Uu,Xu,"⊢","\\vdash",!0),Fu(Hu,Uu,Xu,"⊣","\\dashv",!0),Fu(Hu,Uu,Xu,"∋","\\owns"),Fu(Hu,Uu,"punct",".","\\ldotp"),Fu(Hu,Uu,"punct","⋅","\\cdotp"),Fu(Hu,Uu,Zu,"#","\\#"),Fu(ju,Uu,Zu,"#","\\#"),Fu(Hu,Uu,Zu,"&","\\&"),Fu(ju,Uu,Zu,"&","\\&"),Fu(Hu,Uu,Zu,"ℵ","\\aleph",!0),Fu(Hu,Uu,Zu,"∀","\\forall",!0),Fu(Hu,Uu,Zu,"ℏ","\\hbar",!0),Fu(Hu,Uu,Zu,"∃","\\exists",!0),Fu(Hu,Uu,Zu,"∇","\\nabla",!0),Fu(Hu,Uu,Zu,"♭","\\flat",!0),Fu(Hu,Uu,Zu,"ℓ","\\ell",!0),Fu(Hu,Uu,Zu,"♮","\\natural",!0),Fu(Hu,Uu,Zu,"♣","\\clubsuit",!0),Fu(Hu,Uu,Zu,"℘","\\wp",!0),Fu(Hu,Uu,Zu,"♯","\\sharp",!0),
|
|
303
|
+
Fu(Hu,Uu,Zu,"♢","\\diamondsuit",!0),Fu(Hu,Uu,Zu,"ℜ","\\Re",!0),Fu(Hu,Uu,Zu,"♡","\\heartsuit",!0),Fu(Hu,Uu,Zu,"ℑ","\\Im",!0),Fu(Hu,Uu,Zu,"♠","\\spadesuit",!0),Fu(Hu,Uu,Zu,"§","\\S",!0),Fu(ju,Uu,Zu,"§","\\S"),Fu(Hu,Uu,Zu,"¶","\\P",!0),Fu(ju,Uu,Zu,"¶","\\P"),Fu(Hu,Uu,Zu,"†","\\dag"),Fu(ju,Uu,Zu,"†","\\dag"),Fu(ju,Uu,Zu,"†","\\textdagger"),Fu(Hu,Uu,Zu,"‡","\\ddag"),Fu(ju,Uu,Zu,"‡","\\ddag"),Fu(ju,Uu,Zu,"‡","\\textdaggerdbl"),Fu(Hu,Uu,Vu,"⎱","\\rmoustache",!0),Fu(Hu,Uu,Ku,"⎰","\\lmoustache",!0),Fu(Hu,Uu,Vu,"⟯","\\rgroup",!0),Fu(Hu,Uu,Ku,"⟮","\\lgroup",!0),Fu(Hu,Uu,Gu,"∓","\\mp",!0),Fu(Hu,Uu,Gu,"⊖","\\ominus",!0),Fu(Hu,Uu,Gu,"⊎","\\uplus",!0),Fu(Hu,Uu,Gu,"⊓","\\sqcap",!0),Fu(Hu,Uu,Gu,"∗","\\ast"),Fu(Hu,Uu,Gu,"⊔","\\sqcup",!0),Fu(Hu,Uu,Gu,"◯","\\bigcirc",!0),Fu(Hu,Uu,Gu,"∙","\\bullet",!0),Fu(Hu,Uu,Gu,"‡","\\ddagger"),Fu(Hu,Uu,Gu,"≀","\\wr",!0),Fu(Hu,Uu,Gu,"⨿","\\amalg"),Fu(Hu,Uu,Gu,"&","\\And"),Fu(Hu,Uu,Xu,"⟵","\\longleftarrow",!0),Fu(Hu,Uu,Xu,"⇐","\\Leftarrow",!0),Fu(Hu,Uu,Xu,"⟸","\\Longleftarrow",!0),
|
|
304
|
+
Fu(Hu,Uu,Xu,"⟶","\\longrightarrow",!0),Fu(Hu,Uu,Xu,"⇒","\\Rightarrow",!0),Fu(Hu,Uu,Xu,"⟹","\\Longrightarrow",!0),Fu(Hu,Uu,Xu,"↔","\\leftrightarrow",!0),Fu(Hu,Uu,Xu,"⟷","\\longleftrightarrow",!0),Fu(Hu,Uu,Xu,"⇔","\\Leftrightarrow",!0),Fu(Hu,Uu,Xu,"⟺","\\Longleftrightarrow",!0),Fu(Hu,Uu,Xu,"↦","\\mapsto",!0),Fu(Hu,Uu,Xu,"⟼","\\longmapsto",!0),Fu(Hu,Uu,Xu,"↗","\\nearrow",!0),Fu(Hu,Uu,Xu,"↩","\\hookleftarrow",!0),Fu(Hu,Uu,Xu,"↪","\\hookrightarrow",!0),Fu(Hu,Uu,Xu,"↘","\\searrow",!0),Fu(Hu,Uu,Xu,"↼","\\leftharpoonup",!0),Fu(Hu,Uu,Xu,"⇀","\\rightharpoonup",!0),Fu(Hu,Uu,Xu,"↙","\\swarrow",!0),Fu(Hu,Uu,Xu,"↽","\\leftharpoondown",!0),Fu(Hu,Uu,Xu,"⇁","\\rightharpoondown",!0),Fu(Hu,Uu,Xu,"↖","\\nwarrow",!0),Fu(Hu,Uu,Xu,"⇌","\\rightleftharpoons",!0),Fu(Hu,qu,Xu,"≮","\\nless",!0),Fu(Hu,qu,Xu,"","\\@nleqslant"),Fu(Hu,qu,Xu,"","\\@nleqq"),Fu(Hu,qu,Xu,"⪇","\\lneq",!0),Fu(Hu,qu,Xu,"≨","\\lneqq",!0),Fu(Hu,qu,Xu,"","\\@lvertneqq"),Fu(Hu,qu,Xu,"⋦","\\lnsim",!0),Fu(Hu,qu,Xu,"⪉","\\lnapprox",!0),Fu(Hu,qu,Xu,"⊀","\\nprec",!0),
|
|
305
|
+
Fu(Hu,qu,Xu,"⋠","\\npreceq",!0),Fu(Hu,qu,Xu,"⋨","\\precnsim",!0),Fu(Hu,qu,Xu,"⪹","\\precnapprox",!0),Fu(Hu,qu,Xu,"≁","\\nsim",!0),Fu(Hu,qu,Xu,"","\\@nshortmid"),Fu(Hu,qu,Xu,"∤","\\nmid",!0),Fu(Hu,qu,Xu,"⊬","\\nvdash",!0),Fu(Hu,qu,Xu,"⊭","\\nvDash",!0),Fu(Hu,qu,Xu,"⋪","\\ntriangleleft"),Fu(Hu,qu,Xu,"⋬","\\ntrianglelefteq",!0),Fu(Hu,qu,Xu,"⊊","\\subsetneq",!0),Fu(Hu,qu,Xu,"","\\@varsubsetneq"),Fu(Hu,qu,Xu,"⫋","\\subsetneqq",!0),Fu(Hu,qu,Xu,"","\\@varsubsetneqq"),Fu(Hu,qu,Xu,"≯","\\ngtr",!0),Fu(Hu,qu,Xu,"","\\@ngeqslant"),Fu(Hu,qu,Xu,"","\\@ngeqq"),Fu(Hu,qu,Xu,"⪈","\\gneq",!0),Fu(Hu,qu,Xu,"≩","\\gneqq",!0),Fu(Hu,qu,Xu,"","\\@gvertneqq"),Fu(Hu,qu,Xu,"⋧","\\gnsim",!0),Fu(Hu,qu,Xu,"⪊","\\gnapprox",!0),Fu(Hu,qu,Xu,"⊁","\\nsucc",!0),Fu(Hu,qu,Xu,"⋡","\\nsucceq",!0),Fu(Hu,qu,Xu,"⋩","\\succnsim",!0),Fu(Hu,qu,Xu,"⪺","\\succnapprox",!0),Fu(Hu,qu,Xu,"≆","\\ncong",!0),Fu(Hu,qu,Xu,"","\\@nshortparallel"),Fu(Hu,qu,Xu,"∦","\\nparallel",!0),Fu(Hu,qu,Xu,"⊯","\\nVDash",!0),Fu(Hu,qu,Xu,"⋫","\\ntriangleright"),
|
|
306
|
+
Fu(Hu,qu,Xu,"⋭","\\ntrianglerighteq",!0),Fu(Hu,qu,Xu,"","\\@nsupseteqq"),Fu(Hu,qu,Xu,"⊋","\\supsetneq",!0),Fu(Hu,qu,Xu,"","\\@varsupsetneq"),Fu(Hu,qu,Xu,"⫌","\\supsetneqq",!0),Fu(Hu,qu,Xu,"","\\@varsupsetneqq"),Fu(Hu,qu,Xu,"⊮","\\nVdash",!0),Fu(Hu,qu,Xu,"⪵","\\precneqq",!0),Fu(Hu,qu,Xu,"⪶","\\succneqq",!0),Fu(Hu,qu,Xu,"","\\@nsubseteqq"),Fu(Hu,qu,Gu,"⊴","\\unlhd"),Fu(Hu,qu,Gu,"⊵","\\unrhd"),Fu(Hu,qu,Xu,"↚","\\nleftarrow",!0),Fu(Hu,qu,Xu,"↛","\\nrightarrow",!0),Fu(Hu,qu,Xu,"⇍","\\nLeftarrow",!0),Fu(Hu,qu,Xu,"⇏","\\nRightarrow",!0),Fu(Hu,qu,Xu,"↮","\\nleftrightarrow",!0),Fu(Hu,qu,Xu,"⇎","\\nLeftrightarrow",!0),Fu(Hu,qu,Xu,"△","\\vartriangle"),Fu(Hu,qu,Zu,"ℏ","\\hslash"),Fu(Hu,qu,Zu,"▽","\\triangledown"),Fu(Hu,qu,Zu,"◊","\\lozenge"),Fu(Hu,qu,Zu,"Ⓢ","\\circledS"),Fu(Hu,qu,Zu,"®","\\circledR"),Fu(ju,qu,Zu,"®","\\circledR"),Fu(Hu,qu,Zu,"∡","\\measuredangle",!0),Fu(Hu,qu,Zu,"∄","\\nexists"),Fu(Hu,qu,Zu,"℧","\\mho"),Fu(Hu,qu,Zu,"Ⅎ","\\Finv",!0),Fu(Hu,qu,Zu,"⅁","\\Game",!0),Fu(Hu,qu,Zu,"‵","\\backprime"),
|
|
307
|
+
Fu(Hu,qu,Zu,"▲","\\blacktriangle"),Fu(Hu,qu,Zu,"▼","\\blacktriangledown"),Fu(Hu,qu,Zu,"■","\\blacksquare"),Fu(Hu,qu,Zu,"⧫","\\blacklozenge"),Fu(Hu,qu,Zu,"★","\\bigstar"),Fu(Hu,qu,Zu,"∢","\\sphericalangle",!0),Fu(Hu,qu,Zu,"∁","\\complement",!0),Fu(Hu,qu,Zu,"ð","\\eth",!0),Fu(ju,Uu,Zu,"ð","ð"),Fu(Hu,qu,Zu,"╱","\\diagup"),Fu(Hu,qu,Zu,"╲","\\diagdown"),Fu(Hu,qu,Zu,"□","\\square"),Fu(Hu,qu,Zu,"□","\\Box"),Fu(Hu,qu,Zu,"◊","\\Diamond"),Fu(Hu,qu,Zu,"¥","\\yen",!0),Fu(ju,qu,Zu,"¥","\\yen",!0),Fu(Hu,qu,Zu,"✓","\\checkmark",!0),Fu(ju,qu,Zu,"✓","\\checkmark"),Fu(Hu,qu,Zu,"ℶ","\\beth",!0),Fu(Hu,qu,Zu,"ℸ","\\daleth",!0),Fu(Hu,qu,Zu,"ℷ","\\gimel",!0),Fu(Hu,qu,Zu,"ϝ","\\digamma",!0),Fu(Hu,qu,Zu,"ϰ","\\varkappa"),Fu(Hu,qu,Ku,"┌","\\@ulcorner",!0),Fu(Hu,qu,Vu,"┐","\\@urcorner",!0),Fu(Hu,qu,Ku,"└","\\@llcorner",!0),Fu(Hu,qu,Vu,"┘","\\@lrcorner",!0),Fu(Hu,qu,Xu,"≦","\\leqq",!0),Fu(Hu,qu,Xu,"⩽","\\leqslant",!0),Fu(Hu,qu,Xu,"⪕","\\eqslantless",!0),Fu(Hu,qu,Xu,"≲","\\lesssim",!0),Fu(Hu,qu,Xu,"⪅","\\lessapprox",!0),
|
|
308
|
+
Fu(Hu,qu,Xu,"≊","\\approxeq",!0),Fu(Hu,qu,Gu,"⋖","\\lessdot"),Fu(Hu,qu,Xu,"⋘","\\lll",!0),Fu(Hu,qu,Xu,"≶","\\lessgtr",!0),Fu(Hu,qu,Xu,"⋚","\\lesseqgtr",!0),Fu(Hu,qu,Xu,"⪋","\\lesseqqgtr",!0),Fu(Hu,qu,Xu,"≑","\\doteqdot"),Fu(Hu,qu,Xu,"≓","\\risingdotseq",!0),Fu(Hu,qu,Xu,"≒","\\fallingdotseq",!0),Fu(Hu,qu,Xu,"∽","\\backsim",!0),Fu(Hu,qu,Xu,"⋍","\\backsimeq",!0),Fu(Hu,qu,Xu,"⫅","\\subseteqq",!0),Fu(Hu,qu,Xu,"⋐","\\Subset",!0),Fu(Hu,qu,Xu,"⊏","\\sqsubset",!0),Fu(Hu,qu,Xu,"≼","\\preccurlyeq",!0),Fu(Hu,qu,Xu,"⋞","\\curlyeqprec",!0),Fu(Hu,qu,Xu,"≾","\\precsim",!0),Fu(Hu,qu,Xu,"⪷","\\precapprox",!0),Fu(Hu,qu,Xu,"⊲","\\vartriangleleft"),Fu(Hu,qu,Xu,"⊴","\\trianglelefteq"),Fu(Hu,qu,Xu,"⊨","\\vDash",!0),Fu(Hu,qu,Xu,"⊪","\\Vvdash",!0),Fu(Hu,qu,Xu,"⌣","\\smallsmile"),Fu(Hu,qu,Xu,"⌢","\\smallfrown"),Fu(Hu,qu,Xu,"≏","\\bumpeq",!0),Fu(Hu,qu,Xu,"≎","\\Bumpeq",!0),Fu(Hu,qu,Xu,"≧","\\geqq",!0),Fu(Hu,qu,Xu,"⩾","\\geqslant",!0),Fu(Hu,qu,Xu,"⪖","\\eqslantgtr",!0),Fu(Hu,qu,Xu,"≳","\\gtrsim",!0),Fu(Hu,qu,Xu,"⪆","\\gtrapprox",!0),
|
|
309
|
+
Fu(Hu,qu,Gu,"⋗","\\gtrdot"),Fu(Hu,qu,Xu,"⋙","\\ggg",!0),Fu(Hu,qu,Xu,"≷","\\gtrless",!0),Fu(Hu,qu,Xu,"⋛","\\gtreqless",!0),Fu(Hu,qu,Xu,"⪌","\\gtreqqless",!0),Fu(Hu,qu,Xu,"≖","\\eqcirc",!0),Fu(Hu,qu,Xu,"≗","\\circeq",!0),Fu(Hu,qu,Xu,"≜","\\triangleq",!0),Fu(Hu,qu,Xu,"∼","\\thicksim"),Fu(Hu,qu,Xu,"≈","\\thickapprox"),Fu(Hu,qu,Xu,"⫆","\\supseteqq",!0),Fu(Hu,qu,Xu,"⋑","\\Supset",!0),Fu(Hu,qu,Xu,"⊐","\\sqsupset",!0),Fu(Hu,qu,Xu,"≽","\\succcurlyeq",!0),Fu(Hu,qu,Xu,"⋟","\\curlyeqsucc",!0),Fu(Hu,qu,Xu,"≿","\\succsim",!0),Fu(Hu,qu,Xu,"⪸","\\succapprox",!0),Fu(Hu,qu,Xu,"⊳","\\vartriangleright"),Fu(Hu,qu,Xu,"⊵","\\trianglerighteq"),Fu(Hu,qu,Xu,"⊩","\\Vdash",!0),Fu(Hu,qu,Xu,"∣","\\shortmid"),Fu(Hu,qu,Xu,"∥","\\shortparallel"),Fu(Hu,qu,Xu,"≬","\\between",!0),Fu(Hu,qu,Xu,"⋔","\\pitchfork",!0),Fu(Hu,qu,Xu,"∝","\\varpropto"),Fu(Hu,qu,Xu,"◀","\\blacktriangleleft"),Fu(Hu,qu,Xu,"∴","\\therefore",!0),Fu(Hu,qu,Xu,"∍","\\backepsilon"),Fu(Hu,qu,Xu,"▶","\\blacktriangleright"),Fu(Hu,qu,Xu,"∵","\\because",!0),
|
|
310
|
+
Fu(Hu,qu,Xu,"⋘","\\llless"),Fu(Hu,qu,Xu,"⋙","\\gggtr"),Fu(Hu,qu,Gu,"⊲","\\lhd"),Fu(Hu,qu,Gu,"⊳","\\rhd"),Fu(Hu,qu,Xu,"≂","\\eqsim",!0),Fu(Hu,Uu,Xu,"⋈","\\Join"),Fu(Hu,qu,Xu,"≑","\\Doteq",!0),Fu(Hu,qu,Gu,"∔","\\dotplus",!0),Fu(Hu,qu,Gu,"∖","\\smallsetminus"),Fu(Hu,qu,Gu,"⋒","\\Cap",!0),Fu(Hu,qu,Gu,"⋓","\\Cup",!0),Fu(Hu,qu,Gu,"⩞","\\doublebarwedge",!0),Fu(Hu,qu,Gu,"⊟","\\boxminus",!0),Fu(Hu,qu,Gu,"⊞","\\boxplus",!0),Fu(Hu,qu,Gu,"⋇","\\divideontimes",!0),Fu(Hu,qu,Gu,"⋉","\\ltimes",!0),Fu(Hu,qu,Gu,"⋊","\\rtimes",!0),Fu(Hu,qu,Gu,"⋋","\\leftthreetimes",!0),Fu(Hu,qu,Gu,"⋌","\\rightthreetimes",!0),Fu(Hu,qu,Gu,"⋏","\\curlywedge",!0),Fu(Hu,qu,Gu,"⋎","\\curlyvee",!0),Fu(Hu,qu,Gu,"⊝","\\circleddash",!0),Fu(Hu,qu,Gu,"⊛","\\circledast",!0),Fu(Hu,qu,Gu,"⋅","\\centerdot"),Fu(Hu,qu,Gu,"⊺","\\intercal",!0),Fu(Hu,qu,Gu,"⋒","\\doublecap"),Fu(Hu,qu,Gu,"⋓","\\doublecup"),Fu(Hu,qu,Gu,"⊠","\\boxtimes",!0),Fu(Hu,qu,Xu,"⇢","\\dashrightarrow",!0),Fu(Hu,qu,Xu,"⇠","\\dashleftarrow",!0),Fu(Hu,qu,Xu,"⇇","\\leftleftarrows",!0),
|
|
311
|
+
Fu(Hu,qu,Xu,"⇆","\\leftrightarrows",!0),Fu(Hu,qu,Xu,"⇚","\\Lleftarrow",!0),Fu(Hu,qu,Xu,"↞","\\twoheadleftarrow",!0),Fu(Hu,qu,Xu,"↢","\\leftarrowtail",!0),Fu(Hu,qu,Xu,"↫","\\looparrowleft",!0),Fu(Hu,qu,Xu,"⇋","\\leftrightharpoons",!0),Fu(Hu,qu,Xu,"↶","\\curvearrowleft",!0),Fu(Hu,qu,Xu,"↺","\\circlearrowleft",!0),Fu(Hu,qu,Xu,"↰","\\Lsh",!0),Fu(Hu,qu,Xu,"⇈","\\upuparrows",!0),Fu(Hu,qu,Xu,"↿","\\upharpoonleft",!0),Fu(Hu,qu,Xu,"⇃","\\downharpoonleft",!0),Fu(Hu,Uu,Xu,"⊶","\\origof",!0),Fu(Hu,Uu,Xu,"⊷","\\imageof",!0),Fu(Hu,qu,Xu,"⊸","\\multimap",!0),Fu(Hu,qu,Xu,"↭","\\leftrightsquigarrow",!0),Fu(Hu,qu,Xu,"⇉","\\rightrightarrows",!0),Fu(Hu,qu,Xu,"⇄","\\rightleftarrows",!0),Fu(Hu,qu,Xu,"↠","\\twoheadrightarrow",!0),Fu(Hu,qu,Xu,"↣","\\rightarrowtail",!0),Fu(Hu,qu,Xu,"↬","\\looparrowright",!0),Fu(Hu,qu,Xu,"↷","\\curvearrowright",!0),Fu(Hu,qu,Xu,"↻","\\circlearrowright",!0),Fu(Hu,qu,Xu,"↱","\\Rsh",!0),Fu(Hu,qu,Xu,"⇊","\\downdownarrows",!0),Fu(Hu,qu,Xu,"↾","\\upharpoonright",!0),Fu(Hu,qu,Xu,"⇂","\\downharpoonright",!0),
|
|
312
|
+
Fu(Hu,qu,Xu,"⇝","\\rightsquigarrow",!0),Fu(Hu,qu,Xu,"⇝","\\leadsto"),Fu(Hu,qu,Xu,"⇛","\\Rrightarrow",!0),Fu(Hu,qu,Xu,"↾","\\restriction"),Fu(Hu,Uu,Zu,"‘","`"),Fu(Hu,Uu,Zu,"$","\\$"),Fu(ju,Uu,Zu,"$","\\$"),Fu(ju,Uu,Zu,"$","\\textdollar"),Fu(Hu,Uu,Zu,"%","\\%"),Fu(ju,Uu,Zu,"%","\\%"),Fu(Hu,Uu,Zu,"_","\\_"),Fu(ju,Uu,Zu,"_","\\_"),Fu(ju,Uu,Zu,"_","\\textunderscore"),Fu(Hu,Uu,Zu,"∠","\\angle",!0),Fu(Hu,Uu,Zu,"∞","\\infty",!0),Fu(Hu,Uu,Zu,"′","\\prime"),Fu(Hu,Uu,Zu,"△","\\triangle"),Fu(Hu,Uu,Zu,"Γ","\\Gamma",!0),Fu(Hu,Uu,Zu,"Δ","\\Delta",!0),Fu(Hu,Uu,Zu,"Θ","\\Theta",!0),Fu(Hu,Uu,Zu,"Λ","\\Lambda",!0),Fu(Hu,Uu,Zu,"Ξ","\\Xi",!0),Fu(Hu,Uu,Zu,"Π","\\Pi",!0),Fu(Hu,Uu,Zu,"Σ","\\Sigma",!0),Fu(Hu,Uu,Zu,"Υ","\\Upsilon",!0),Fu(Hu,Uu,Zu,"Φ","\\Phi",!0),Fu(Hu,Uu,Zu,"Ψ","\\Psi",!0),Fu(Hu,Uu,Zu,"Ω","\\Omega",!0),Fu(Hu,Uu,Zu,"A","Α"),Fu(Hu,Uu,Zu,"B","Β"),Fu(Hu,Uu,Zu,"E","Ε"),Fu(Hu,Uu,Zu,"Z","Ζ"),Fu(Hu,Uu,Zu,"H","Η"),Fu(Hu,Uu,Zu,"I","Ι"),Fu(Hu,Uu,Zu,"K","Κ"),Fu(Hu,Uu,Zu,"M","Μ"),Fu(Hu,Uu,Zu,"N","Ν"),Fu(Hu,Uu,Zu,"O","Ο"),
|
|
313
|
+
Fu(Hu,Uu,Zu,"P","Ρ"),Fu(Hu,Uu,Zu,"T","Τ"),Fu(Hu,Uu,Zu,"X","Χ"),Fu(Hu,Uu,Zu,"¬","\\neg",!0),Fu(Hu,Uu,Zu,"¬","\\lnot"),Fu(Hu,Uu,Zu,"⊤","\\top"),Fu(Hu,Uu,Zu,"⊥","\\bot"),Fu(Hu,Uu,Zu,"∅","\\emptyset"),Fu(Hu,qu,Zu,"∅","\\varnothing"),Fu(Hu,Uu,Yu,"α","\\alpha",!0),Fu(Hu,Uu,Yu,"β","\\beta",!0),Fu(Hu,Uu,Yu,"γ","\\gamma",!0),Fu(Hu,Uu,Yu,"δ","\\delta",!0),Fu(Hu,Uu,Yu,"ϵ","\\epsilon",!0),Fu(Hu,Uu,Yu,"ζ","\\zeta",!0),Fu(Hu,Uu,Yu,"η","\\eta",!0),Fu(Hu,Uu,Yu,"θ","\\theta",!0),Fu(Hu,Uu,Yu,"ι","\\iota",!0),Fu(Hu,Uu,Yu,"κ","\\kappa",!0),Fu(Hu,Uu,Yu,"λ","\\lambda",!0),Fu(Hu,Uu,Yu,"μ","\\mu",!0),Fu(Hu,Uu,Yu,"ν","\\nu",!0),Fu(Hu,Uu,Yu,"ξ","\\xi",!0),Fu(Hu,Uu,Yu,"ο","\\omicron",!0),Fu(Hu,Uu,Yu,"π","\\pi",!0),Fu(Hu,Uu,Yu,"ρ","\\rho",!0),Fu(Hu,Uu,Yu,"σ","\\sigma",!0),Fu(Hu,Uu,Yu,"τ","\\tau",!0),Fu(Hu,Uu,Yu,"υ","\\upsilon",!0),Fu(Hu,Uu,Yu,"ϕ","\\phi",!0),Fu(Hu,Uu,Yu,"χ","\\chi",!0),Fu(Hu,Uu,Yu,"ψ","\\psi",!0),Fu(Hu,Uu,Yu,"ω","\\omega",!0),Fu(Hu,Uu,Yu,"ε","\\varepsilon",!0),Fu(Hu,Uu,Yu,"ϑ","\\vartheta",!0),
|
|
314
|
+
Fu(Hu,Uu,Yu,"ϖ","\\varpi",!0),Fu(Hu,Uu,Yu,"ϱ","\\varrho",!0),Fu(Hu,Uu,Yu,"ς","\\varsigma",!0),Fu(Hu,Uu,Yu,"φ","\\varphi",!0),Fu(Hu,Uu,Gu,"∗","*",!0),Fu(Hu,Uu,Gu,"+","+"),Fu(Hu,Uu,Gu,"−","-",!0),Fu(Hu,Uu,Gu,"⋅","\\cdot",!0),Fu(Hu,Uu,Gu,"∘","\\circ",!0),Fu(Hu,Uu,Gu,"÷","\\div",!0),Fu(Hu,Uu,Gu,"±","\\pm",!0),Fu(Hu,Uu,Gu,"×","\\times",!0),Fu(Hu,Uu,Gu,"∩","\\cap",!0),Fu(Hu,Uu,Gu,"∪","\\cup",!0),Fu(Hu,Uu,Gu,"∖","\\setminus",!0),Fu(Hu,Uu,Gu,"∧","\\land"),Fu(Hu,Uu,Gu,"∨","\\lor"),Fu(Hu,Uu,Gu,"∧","\\wedge",!0),Fu(Hu,Uu,Gu,"∨","\\vee",!0),Fu(Hu,Uu,Zu,"√","\\surd"),Fu(Hu,Uu,Ku,"⟨","\\langle",!0),Fu(Hu,Uu,Ku,"∣","\\lvert"),Fu(Hu,Uu,Ku,"∥","\\lVert"),Fu(Hu,Uu,Vu,"?","?"),Fu(Hu,Uu,Vu,"!","!"),Fu(Hu,Uu,Vu,"⟩","\\rangle",!0),Fu(Hu,Uu,Vu,"∣","\\rvert"),Fu(Hu,Uu,Vu,"∥","\\rVert"),Fu(Hu,Uu,Xu,"=","="),Fu(Hu,Uu,Xu,":",":"),Fu(Hu,Uu,Xu,"≈","\\approx",!0),Fu(Hu,Uu,Xu,"≅","\\cong",!0),Fu(Hu,Uu,Xu,"≥","\\ge"),Fu(Hu,Uu,Xu,"≥","\\geq",!0),Fu(Hu,Uu,Xu,"←","\\gets"),Fu(Hu,Uu,Xu,">","\\gt",!0),Fu(Hu,Uu,Xu,"∈","\\in",!0),
|
|
315
|
+
Fu(Hu,Uu,Xu,"","\\@not"),Fu(Hu,Uu,Xu,"⊂","\\subset",!0),Fu(Hu,Uu,Xu,"⊃","\\supset",!0),Fu(Hu,Uu,Xu,"⊆","\\subseteq",!0),Fu(Hu,Uu,Xu,"⊇","\\supseteq",!0),Fu(Hu,qu,Xu,"⊈","\\nsubseteq",!0),Fu(Hu,qu,Xu,"⊉","\\nsupseteq",!0),Fu(Hu,Uu,Xu,"⊨","\\models"),Fu(Hu,Uu,Xu,"←","\\leftarrow",!0),Fu(Hu,Uu,Xu,"≤","\\le"),Fu(Hu,Uu,Xu,"≤","\\leq",!0),Fu(Hu,Uu,Xu,"<","\\lt",!0),Fu(Hu,Uu,Xu,"→","\\rightarrow",!0),Fu(Hu,Uu,Xu,"→","\\to"),Fu(Hu,qu,Xu,"≱","\\ngeq",!0),Fu(Hu,qu,Xu,"≰","\\nleq",!0),Fu(Hu,Uu,"spacing"," ","\\ "),Fu(Hu,Uu,"spacing"," ","\\space"),Fu(Hu,Uu,"spacing"," ","\\nobreakspace"),Fu(ju,Uu,"spacing"," ","\\ "),Fu(ju,Uu,"spacing"," "," "),Fu(ju,Uu,"spacing"," ","\\space"),Fu(ju,Uu,"spacing"," ","\\nobreakspace"),Fu(Hu,Uu,"spacing",null,"\\nobreak"),Fu(Hu,Uu,"spacing",null,"\\allowbreak"),Fu(Hu,Uu,"punct",",",","),Fu(Hu,Uu,"punct",";",";"),Fu(Hu,qu,Gu,"⊼","\\barwedge",!0),Fu(Hu,qu,Gu,"⊻","\\veebar",!0),Fu(Hu,Uu,Gu,"⊙","\\odot",!0),Fu(Hu,Uu,Gu,"⊕","\\oplus",!0),Fu(Hu,Uu,Gu,"⊗","\\otimes",!0),
|
|
316
|
+
Fu(Hu,Uu,Zu,"∂","\\partial",!0),Fu(Hu,Uu,Gu,"⊘","\\oslash",!0),Fu(Hu,qu,Gu,"⊚","\\circledcirc",!0),Fu(Hu,qu,Gu,"⊡","\\boxdot",!0),Fu(Hu,Uu,Gu,"△","\\bigtriangleup"),Fu(Hu,Uu,Gu,"▽","\\bigtriangledown"),Fu(Hu,Uu,Gu,"†","\\dagger"),Fu(Hu,Uu,Gu,"⋄","\\diamond"),Fu(Hu,Uu,Gu,"⋆","\\star"),Fu(Hu,Uu,Gu,"◃","\\triangleleft"),Fu(Hu,Uu,Gu,"▹","\\triangleright"),Fu(Hu,Uu,Ku,"{","\\{"),Fu(ju,Uu,Zu,"{","\\{"),Fu(ju,Uu,Zu,"{","\\textbraceleft"),Fu(Hu,Uu,Vu,"}","\\}"),Fu(ju,Uu,Zu,"}","\\}"),Fu(ju,Uu,Zu,"}","\\textbraceright"),Fu(Hu,Uu,Ku,"{","\\lbrace"),Fu(Hu,Uu,Vu,"}","\\rbrace"),Fu(Hu,Uu,Ku,"[","\\lbrack",!0),Fu(ju,Uu,Zu,"[","\\lbrack",!0),Fu(Hu,Uu,Vu,"]","\\rbrack",!0),Fu(ju,Uu,Zu,"]","\\rbrack",!0),Fu(Hu,Uu,Ku,"(","\\lparen",!0),Fu(Hu,Uu,Vu,")","\\rparen",!0),Fu(ju,Uu,Zu,"<","\\textless",!0),Fu(ju,Uu,Zu,">","\\textgreater",!0),Fu(Hu,Uu,Ku,"⌊","\\lfloor",!0),Fu(Hu,Uu,Vu,"⌋","\\rfloor",!0),Fu(Hu,Uu,Ku,"⌈","\\lceil",!0),Fu(Hu,Uu,Vu,"⌉","\\rceil",!0),Fu(Hu,Uu,Zu,"\\","\\backslash"),Fu(Hu,Uu,Zu,"∣","|"),
|
|
317
|
+
Fu(Hu,Uu,Zu,"∣","\\vert"),Fu(ju,Uu,Zu,"|","\\textbar",!0),Fu(Hu,Uu,Zu,"∥","\\|"),Fu(Hu,Uu,Zu,"∥","\\Vert"),Fu(ju,Uu,Zu,"∥","\\textbardbl"),Fu(ju,Uu,Zu,"~","\\textasciitilde"),Fu(ju,Uu,Zu,"\\","\\textbackslash"),Fu(ju,Uu,Zu,"^","\\textasciicircum"),Fu(Hu,Uu,Xu,"↑","\\uparrow",!0),Fu(Hu,Uu,Xu,"⇑","\\Uparrow",!0),Fu(Hu,Uu,Xu,"↓","\\downarrow",!0),Fu(Hu,Uu,Xu,"⇓","\\Downarrow",!0),Fu(Hu,Uu,Xu,"↕","\\updownarrow",!0),Fu(Hu,Uu,Xu,"⇕","\\Updownarrow",!0),Fu(Hu,Uu,Wu,"∐","\\coprod"),Fu(Hu,Uu,Wu,"⋁","\\bigvee"),Fu(Hu,Uu,Wu,"⋀","\\bigwedge"),Fu(Hu,Uu,Wu,"⨄","\\biguplus"),Fu(Hu,Uu,Wu,"⋂","\\bigcap"),Fu(Hu,Uu,Wu,"⋃","\\bigcup"),Fu(Hu,Uu,Wu,"∫","\\int"),Fu(Hu,Uu,Wu,"∫","\\intop"),Fu(Hu,Uu,Wu,"∬","\\iint"),Fu(Hu,Uu,Wu,"∭","\\iiint"),Fu(Hu,Uu,Wu,"∏","\\prod"),Fu(Hu,Uu,Wu,"∑","\\sum"),Fu(Hu,Uu,Wu,"⨂","\\bigotimes"),Fu(Hu,Uu,Wu,"⨁","\\bigoplus"),Fu(Hu,Uu,Wu,"⨀","\\bigodot"),Fu(Hu,Uu,Wu,"∮","\\oint"),Fu(Hu,Uu,Wu,"∯","\\oiint"),Fu(Hu,Uu,Wu,"∰","\\oiiint"),Fu(Hu,Uu,Wu,"⨆","\\bigsqcup"),Fu(Hu,Uu,Wu,"∫","\\smallint"),
|
|
318
|
+
Fu(ju,Uu,"inner","…","\\textellipsis"),Fu(Hu,Uu,"inner","…","\\mathellipsis"),Fu(ju,Uu,"inner","…","\\ldots",!0),Fu(Hu,Uu,"inner","…","\\ldots",!0),Fu(Hu,Uu,"inner","⋯","\\@cdots",!0),Fu(Hu,Uu,"inner","⋱","\\ddots",!0),Fu(Hu,Uu,Zu,"⋮","\\varvdots"),Fu(Hu,Uu,$u,"ˊ","\\acute"),Fu(Hu,Uu,$u,"ˋ","\\grave"),Fu(Hu,Uu,$u,"¨","\\ddot"),Fu(Hu,Uu,$u,"~","\\tilde"),Fu(Hu,Uu,$u,"ˉ","\\bar"),Fu(Hu,Uu,$u,"˘","\\breve"),Fu(Hu,Uu,$u,"ˇ","\\check"),Fu(Hu,Uu,$u,"^","\\hat"),Fu(Hu,Uu,$u,"⃗","\\vec"),Fu(Hu,Uu,$u,"˙","\\dot"),Fu(Hu,Uu,$u,"˚","\\mathring"),Fu(Hu,Uu,Yu,"","\\@imath"),Fu(Hu,Uu,Yu,"","\\@jmath"),Fu(Hu,Uu,Zu,"ı","ı"),Fu(Hu,Uu,Zu,"ȷ","ȷ"),Fu(ju,Uu,Zu,"ı","\\i",!0),Fu(ju,Uu,Zu,"ȷ","\\j",!0),Fu(ju,Uu,Zu,"ß","\\ss",!0),Fu(ju,Uu,Zu,"æ","\\ae",!0),Fu(ju,Uu,Zu,"œ","\\oe",!0),Fu(ju,Uu,Zu,"ø","\\o",!0),Fu(ju,Uu,Zu,"Æ","\\AE",!0),Fu(ju,Uu,Zu,"Œ","\\OE",!0),Fu(ju,Uu,Zu,"Ø","\\O",!0),Fu(ju,Uu,$u,"ˊ","\\'"),Fu(ju,Uu,$u,"ˋ","\\`"),Fu(ju,Uu,$u,"ˆ","\\^"),Fu(ju,Uu,$u,"˜","\\~"),Fu(ju,Uu,$u,"ˉ","\\="),Fu(ju,Uu,$u,"˘","\\u"),
|
|
319
|
+
Fu(ju,Uu,$u,"˙","\\."),Fu(ju,Uu,$u,"¸","\\c"),Fu(ju,Uu,$u,"˚","\\r"),Fu(ju,Uu,$u,"ˇ","\\v"),Fu(ju,Uu,$u,"¨",'\\"'),Fu(ju,Uu,$u,"˝","\\H"),Fu(ju,Uu,$u,"◯","\\textcircled");var Ju={"--":!0,"---":!0,"``":!0,"''":!0};Fu(ju,Uu,Zu,"–","--",!0),Fu(ju,Uu,Zu,"–","\\textendash"),Fu(ju,Uu,Zu,"—","---",!0),Fu(ju,Uu,Zu,"—","\\textemdash"),Fu(ju,Uu,Zu,"‘","`",!0),Fu(ju,Uu,Zu,"‘","\\textquoteleft"),Fu(ju,Uu,Zu,"’","'",!0),Fu(ju,Uu,Zu,"’","\\textquoteright"),Fu(ju,Uu,Zu,"“","``",!0),Fu(ju,Uu,Zu,"“","\\textquotedblleft"),Fu(ju,Uu,Zu,"”","''",!0),Fu(ju,Uu,Zu,"”","\\textquotedblright"),Fu(Hu,Uu,Zu,"°","\\degree",!0),Fu(ju,Uu,Zu,"°","\\degree"),Fu(ju,Uu,Zu,"°","\\textdegree",!0),Fu(Hu,Uu,Zu,"£","\\pounds"),Fu(Hu,Uu,Zu,"£","\\mathsterling",!0),Fu(ju,Uu,Zu,"£","\\pounds"),Fu(ju,Uu,Zu,"£","\\textsterling",!0),Fu(Hu,qu,Zu,"✠","\\maltese"),Fu(ju,qu,Zu,"✠","\\maltese");for(var Qu=0;Qu<'0123456789/@."'.length;Qu++){var ed='0123456789/@."'.charAt(Qu);Fu(Hu,Uu,Zu,ed,ed)}for(var td=0;td<'0123456789!@*()-=+";:?/.,'.length;td++){
|
|
320
|
+
var nd='0123456789!@*()-=+";:?/.,'.charAt(td);Fu(ju,Uu,Zu,nd,nd)}for(var rd="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz",od=0;od<rd.length;od++){var id=rd.charAt(od);Fu(Hu,Uu,Yu,id,id),Fu(ju,Uu,Zu,id,id)}Fu(Hu,qu,Zu,"C","ℂ"),Fu(ju,qu,Zu,"C","ℂ"),Fu(Hu,qu,Zu,"H","ℍ"),Fu(ju,qu,Zu,"H","ℍ"),Fu(Hu,qu,Zu,"N","ℕ"),Fu(ju,qu,Zu,"N","ℕ"),Fu(Hu,qu,Zu,"P","ℙ"),Fu(ju,qu,Zu,"P","ℙ"),Fu(Hu,qu,Zu,"Q","ℚ"),Fu(ju,qu,Zu,"Q","ℚ"),Fu(Hu,qu,Zu,"R","ℝ"),Fu(ju,qu,Zu,"R","ℝ"),Fu(Hu,qu,Zu,"Z","ℤ"),Fu(ju,qu,Zu,"Z","ℤ"),Fu(Hu,Uu,Yu,"h","ℎ"),Fu(ju,Uu,Yu,"h","ℎ");for(var ad="",sd=0;sd<rd.length;sd++){var ld=rd.charAt(sd);Fu(Hu,Uu,Yu,ld,ad=String.fromCharCode(55349,56320+sd)),Fu(ju,Uu,Zu,ld,ad),Fu(Hu,Uu,Yu,ld,ad=String.fromCharCode(55349,56372+sd)),Fu(ju,Uu,Zu,ld,ad),Fu(Hu,Uu,Yu,ld,ad=String.fromCharCode(55349,56424+sd)),Fu(ju,Uu,Zu,ld,ad),Fu(Hu,Uu,Yu,ld,ad=String.fromCharCode(55349,56580+sd)),Fu(ju,Uu,Zu,ld,ad),Fu(Hu,Uu,Yu,ld,ad=String.fromCharCode(55349,56736+sd)),Fu(ju,Uu,Zu,ld,ad),
|
|
321
|
+
Fu(Hu,Uu,Yu,ld,ad=String.fromCharCode(55349,56788+sd)),Fu(ju,Uu,Zu,ld,ad),Fu(Hu,Uu,Yu,ld,ad=String.fromCharCode(55349,56840+sd)),Fu(ju,Uu,Zu,ld,ad),Fu(Hu,Uu,Yu,ld,ad=String.fromCharCode(55349,56944+sd)),Fu(ju,Uu,Zu,ld,ad),sd<26&&(Fu(Hu,Uu,Yu,ld,ad=String.fromCharCode(55349,56632+sd)),Fu(ju,Uu,Zu,ld,ad),Fu(Hu,Uu,Yu,ld,ad=String.fromCharCode(55349,56476+sd)),Fu(ju,Uu,Zu,ld,ad))}Fu(Hu,Uu,Yu,"k",ad=String.fromCharCode(55349,56668)),Fu(ju,Uu,Zu,"k",ad);for(var cd=0;cd<10;cd++){var ud=cd.toString();Fu(Hu,Uu,Yu,ud,ad=String.fromCharCode(55349,57294+cd)),Fu(ju,Uu,Zu,ud,ad),Fu(Hu,Uu,Yu,ud,ad=String.fromCharCode(55349,57314+cd)),Fu(ju,Uu,Zu,ud,ad),Fu(Hu,Uu,Yu,ud,ad=String.fromCharCode(55349,57324+cd)),Fu(ju,Uu,Zu,ud,ad),Fu(Hu,Uu,Yu,ud,ad=String.fromCharCode(55349,57334+cd)),Fu(ju,Uu,Zu,ud,ad)}for(var dd=0;dd<"ÐÞþ".length;dd++){var hd="ÐÞþ".charAt(dd);Fu(Hu,Uu,Yu,hd,hd),Fu(ju,Uu,Zu,hd,hd)}
|
|
322
|
+
var pd=[["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"]],md=[["mathbf","textbf","Main-Bold"],["","",""],["mathsf","textsf","SansSerif-Regular"],["mathboldsf","textboldsf","SansSerif-Bold"],["mathtt","texttt","Typewriter-Regular"]],fd=function(e,t,n){
|
|
323
|
+
return Bu[n][e]&&Bu[n][e].replace&&(e=Bu[n][e].replace),{value:e,metrics:hu(e,t,n)}},gd=function(e,t,n,r,o){var i,a=fd(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 Lu(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 Lu(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},vd=(e,t)=>{if(ku(e.classes)!==ku(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},_d=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),
|
|
324
|
+
i.maxFontSize>r&&(r=i.maxFontSize)}e.height=t,e.depth=n,e.maxFontSize=r},bd=function(e,t,n,r){var o=new Au(e,t,n,r);return _d(o),o},yd=(e,t,n,r)=>new Au(e,t,n,r),wd=function(e){var t=new lu(e);return _d(t),t},xd=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")},kd={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"},
|
|
325
|
+
mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},Sd={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},Cd={fontMap:kd,makeSymbol:gd,mathsym:function(e,t,n,r){return void 0===r&&(r=[]),"boldsymbol"===n.font&&fd(e,"Main-Bold",t).metrics?gd(e,"Main-Bold",t,n,r.concat(["mathbf"])):"\\"===e||"main"===Bu[t][e].font?gd(e,"Main-Regular",t,n,r):gd(e,"AMS-Regular",t,n,r.concat(["amsrm"]))},makeSpan:bd,makeSvgSpan:yd,makeLineSpan:function(e,t,n){var r=bd([e],[],t);return r.height=Math.max(n||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),r.style.borderBottomWidth=xu(r.height),r.maxFontSize=1,r},makeAnchor:function(e,t,n,r){var o=new Tu(e,t,n,r);return _d(o),o},makeFragment:wd,wrapFragment:function(e,t){return e instanceof lu?bd([],[e],t):e},makeVList:function(e,t){for(var{children:n,depth:r}=function(e){if("individualShift"===e.positionType){
|
|
326
|
+
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 d=e.children[u];c-="kern"===d.type?d.size:d.elem.height+d.elem.depth}l=c}else if("bottom"===e.positionType)l=-e.positionData;else{var h=e.children[0];if("elem"!==h.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)l=-h.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");l=-h.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=bd(["pstrut"],[]);l.style.height=xu(o);for(var c=[],u=r,d=r,h=r,p=0;p<n.length;p++){var m=n[p];if("kern"===m.type)h+=m.size;else{
|
|
327
|
+
var f=m.elem,g=m.wrapperClasses||[],v=m.wrapperStyle||{},_=bd(g,[l,f],void 0,v);_.style.top=xu(-o-h-f.depth),m.marginLeft&&(_.style.marginLeft=m.marginLeft),m.marginRight&&(_.style.marginRight=m.marginRight),c.push(_),h+=f.height+f.depth}u=Math.min(u,h),d=Math.max(d,h)}var b,y=bd(["vlist"],c);if(y.style.height=xu(d),u<0){var w=bd([],[]),x=bd(["vlist"],[w]);x.style.height=xu(-u);var k=bd(["vlist-s"],[new Lu("")]);b=[bd(["vlist-r"],[y,k]),bd(["vlist-r"],[x])]}else b=[bd(["vlist-r"],[y])];var S=bd(["vlist-t"],b);return 2===b.length&&S.classes.push("vlist-t2"),S.height=d,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[pd[o][2],pd[o][r]]}if(120782<=n&&n<=120831){var i=Math.floor((n-120782)/10);return[md[i][2],md[i][r]]}
|
|
328
|
+
if(120485===n||120486===n)return[pd[0][2],pd[0][r]];if(120486<n&&n<120782)return["",""];throw new Hc("Unsupported character: "+e)}(o,r);return gd(o,l,r,t,i.concat(c))}if(s){var u,d;if("boldsymbol"===s){var h=function(e,t,n,r,o){return"textord"!==o&&fd(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(o,r,0,0,n);u=h.fontName,d=[h.fontClass]}else a?(u=kd[s].fontName,d=[s]):(u=xd(s,t.fontWeight,t.fontShape),d=[s,t.fontWeight,t.fontShape]);if(fd(o,u,r).metrics)return gd(o,u,r,t,i.concat(d));if(Ju.hasOwnProperty(o)&&"Typewriter"===u.slice(0,10)){for(var p=[],m=0;m<o.length;m++)p.push(gd(o[m],u,r,t,i.concat(d)));return wd(p)}}if("mathord"===n)return gd(o,"Math-Italic",r,t,i.concat(["mathnormal"]));if("textord"===n){var f=Bu[r][o]&&Bu[r][o].font;if("ams"===f){var g=xd("amsrm",t.fontWeight,t.fontShape);return gd(o,g,r,t,i.concat("amsrm",t.fontWeight,t.fontShape))}if("main"!==f&&f){var v=xd(f,t.fontWeight,t.fontShape)
|
|
329
|
+
;return gd(o,v,r,t,i.concat(v,t.fontWeight,t.fontShape))}var _=xd("textrm",t.fontWeight,t.fontShape);return gd(o,_,r,t,i.concat(t.fontWeight,t.fontShape))}throw new Error("unexpected type: "+n+" in makeOrd")},makeGlue:(e,t)=>{var n=bd(["mspace"],[],t),r=wu(e,t);return n.style.marginRight=xu(r),n},staticSvg:function(e,t){var[n,r,o]=Sd[e],i=new Ru(n),a=new zu([i],{width:xu(r),height:xu(o),style:"width:"+xu(r),viewBox:"0 0 "+1e3*r+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),s=yd(["overlay"],[a],t);return s.height=o,s.style.height=xu(o),s.style.width=xu(r),s},svgData:Sd,tryCombineChars:e=>{for(var t=0;t<e.length-1;t++){var n=e[t],r=e[t+1];n instanceof Lu&&r instanceof Lu&&vd(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}},Ed={number:3,unit:"mu"},Ad={number:4,unit:"mu"},Td={number:5,unit:"mu"},Nd={mord:{mop:Ed,mbin:Ad,mrel:Td,minner:Ed},mop:{mord:Ed,mop:Ed,mrel:Td,minner:Ed},mbin:{mord:Ad,mop:Ad,mopen:Ad,minner:Ad},mrel:{
|
|
330
|
+
mord:Td,mop:Td,mopen:Td,minner:Td},mopen:{},mclose:{mop:Ed,mbin:Ad,mrel:Td,minner:Ed},mpunct:{mord:Ed,mop:Ed,mrel:Td,mopen:Ed,mclose:Ed,mpunct:Ed,minner:Ed},minner:{mord:Ed,mop:Ed,mbin:Ad,mrel:Td,mopen:Ed,mpunct:Ed,minner:Ed}},Md={mord:{mop:Ed},mop:{mord:Ed,mop:Ed},mbin:{},mrel:{},mopen:{},mclose:{mop:Ed},mpunct:{},minner:{mop:Ed}},Ld={},zd={},Rd={};function Od(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)Ld[n[l]]=s;t&&(i&&(zd[t]=i),a&&(Rd[t]=a))}function Id(e){var{type:t,htmlBuilder:n,mathmlBuilder:r}=e;Od({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:n,mathmlBuilder:r})}var Dd=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e
|
|
331
|
+
},Pd=function(e){return"ordgroup"===e.type?e.body:[e]},Bd=Cd.makeSpan,Fd=["leftmost","mbin","mopen","mrel","mop","mpunct"],Hd=["rightmost","mrel","mclose","mpunct"],jd={display:ru.DISPLAY,text:ru.TEXT,script:ru.SCRIPT,scriptscript:ru.SCRIPTSCRIPT},Ud={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},qd=function(e,t,n,r){void 0===r&&(r=[null,null]);for(var o=[],i=0;i<e.length;i++){var a=Kd(e[i],t);if(a instanceof lu){var s=a.children;o.push(...s)}else o.push(a)}if(Cd.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(jd[c.style]))}var u=Bd([r[0]||"leftmost"],[],t),d=Bd([r[1]||"rightmost"],[],t),h="root"===n;return $d(o,((e,t)=>{var n=t.classes[0],r=e.classes[0];"mbin"===n&&Gc.contains(Hd,r)?t.classes[0]="mord":"mbin"===r&&Gc.contains(Fd,n)&&(e.classes[0]="mord")}),{node:u},d,h),$d(o,((e,t)=>{
|
|
332
|
+
var n=Yd(t),r=Yd(e),o=n&&r?e.hasClass("mtight")?Md[n][r]:Nd[n][r]:null;if(o)return Cd.makeGlue(o,l)}),{node:u},d,h),o},$d=function e(t,n,r,o,i){o&&t.push(o);for(var a=0;a<t.length;a++){var s=t[a],l=Gd(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=Bd(["leftmost"])),r.insertAfter=(e=>n=>{t.splice(e+1,0,n),a++})(a)}}o&&t.pop()},Gd=function(e){return e instanceof lu||e instanceof Tu||e instanceof Au&&e.hasClass("enclosing")?e:null},Vd=function e(t,n){var r=Gd(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},Yd=function(e,t){return e?(t&&(e=Vd(e,t)),Ud[e.classes[0]]||null):null},Wd=function(e,t){var n=["nulldelimiter"].concat(e.baseSizingClasses());return Bd(t.concat(n))},Kd=function(e,t,n){if(!e)return Bd();if(zd[e.type]){var r=zd[e.type](e,t);if(n&&t.size!==n.size){
|
|
333
|
+
r=Bd(t.sizingClasses(n),[r],t);var o=t.sizeMultiplier/n.sizeMultiplier;r.height*=o,r.depth*=o}return r}throw new Hc("Got group of unknown type: '"+e.type+"'")};function Xd(e,t){var n=Bd(["base"],e,t),r=Bd(["strut"]);return r.style.height=xu(n.height+n.depth),n.depth&&(r.style.verticalAlign=xu(-n.depth)),n.children.unshift(r),n}function Zd(e,t){var n=null;1===e.length&&"tag"===e[0].type&&(n=e[0].tag,e=e[0].body);var r,o=qd(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(Xd(s,t)),s=[])}else o[l].hasClass("newline")&&(s.pop(),s.length>0&&(a.push(Xd(s,t)),s=[]),a.push(o[l]));s.length>0&&a.push(Xd(s,t)),n?((i=Xd(qd(n,t,!0))).classes=["tag"],a.push(i)):r&&a.push(r);var u=Bd(["katex-html"],a);if(u.setAttribute("aria-hidden","true"),i){
|
|
334
|
+
var d=i.children[0];d.style.height=xu(u.height+u.depth),u.depth&&(d.style.verticalAlign=xu(-u.depth))}return u}function Jd(e){return new lu(e)}class Qd{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=ku(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+=Gc.escape(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+Gc.escape(ku(this.classes))+'"'),e+=">"
|
|
335
|
+
;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 eh{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return Gc.escape(this.toText())}toText(){return this.text}}var th={MathNode:Qd,TextNode:eh,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",xu(this.width)),e}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+xu(this.width)+'"/>'}toText(){
|
|
336
|
+
return this.character?this.character:" "}},newDocumentFragment:Jd},nh=function(e,t,n){return!Bu[t][e]||!Bu[t][e].replace||55349===e.charCodeAt(0)||Ju.hasOwnProperty(e)&&n&&(n.fontFamily&&"tt"===n.fontFamily.slice(4,6)||n.font&&"tt"===n.font.slice(4,6))||(e=Bu[t][e].replace),new th.TextNode(e)},rh=function(e){return 1===e.length?e[0]:new th.MathNode("mrow",e)},oh=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"
|
|
337
|
+
;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 Gc.contains(["\\imath","\\jmath"],o)?null:(Bu[r][o]&&Bu[r][o].replace&&(o=Bu[r][o].replace),hu(o,Cd.fontMap[n].fontName,r)?Cd.fontMap[n].variant:null)},ih=function(e,t,n){if(1===e.length){var r=sh(e[0],t);return n&&r instanceof Qd&&"mo"===r.type&&(r.setAttribute("lspace","0em"),r.setAttribute("rspace","0em")),[r]}for(var o,i=[],a=0;a<e.length;a++){var s=sh(e[a],t);if(s instanceof Qd&&o instanceof Qd){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 eh&&"."===l.text){o.children.push(...s.children);continue}}else if("mi"===o.type&&1===o.children.length){var c=o.children[0]
|
|
338
|
+
;if(c instanceof eh&&"̸"===c.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){var u=s.children[0];u instanceof eh&&u.text.length>0&&(u.text=u.text.slice(0,1)+"̸"+u.text.slice(1),i.pop())}}}i.push(s),o=s}return i},ah=function(e,t,n){return rh(ih(e,t,n))},sh=function(e,t){if(!e)return new th.MathNode("mrow");if(Rd[e.type])return Rd[e.type](e,t);throw new Hc("Got group of unknown type: '"+e.type+"'")};function lh(e,t,n,r,o){var i,a=ih(e,n);i=1===a.length&&a[0]instanceof Qd&&Gc.contains(["mrow","mtable"],a[0].type)?a[0]:new th.MathNode("mrow",a);var s=new th.MathNode("annotation",[new th.TextNode(t)]);s.setAttribute("encoding","application/x-tex");var l=new th.MathNode("semantics",[i,s]),c=new th.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 Cd.makeSpan([u],[c])}var ch=function(e){return new vu({style:e.displayMode?ru.DISPLAY:ru.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})
|
|
339
|
+
},uh=function(e,t){if(t.displayMode){var n=["katex-display"];t.leqno&&n.push("leqno"),t.fleqn&&n.push("fleqn"),e=Cd.makeSpan(n,[e])}return e},dh={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":"="},hh={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],
|
|
339
340
|
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"],
|
|
340
341
|
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],
|
|
341
|
-
xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},
|
|
342
|
-
;if(
|
|
343
|
-
for(var w=0;w<y;w++){var x=new
|
|
344
|
-
;if(r.isShifty&&
|
|
345
|
-
o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},
|
|
346
|
-
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:
|
|
347
|
-
mathmlBuilder:(e,t)=>{var n=
|
|
348
|
-
var n,r=t.style,o=t.havingStyle(r.sup()),i=
|
|
349
|
-
var i=
|
|
350
|
-
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.slice(5),body:
|
|
351
|
-
isCharacterBox:
|
|
352
|
-
;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"}}}
|
|
353
|
-
handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=
|
|
354
|
-
argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=
|
|
355
|
-
var n=new
|
|
356
|
-
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
|
|
357
|
-
handler(e){var{parser:t,funcName:n}=e,r=
|
|
358
|
-
var r=t.havingBaseStyle(n),o=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=
|
|
359
|
-
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";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
|
|
360
|
-
;"\\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"):
|
|
361
|
-
s="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=
|
|
342
|
+
xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},ph=function(e,t,n,r,o){var i,a=e.height+e.depth+n+r;if(/fbox|color|angl/.test(t)){if(i=Cd.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 Ou({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&l.push(new Ou({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));var c=new zu(l,{width:"100%",height:xu(a)});i=Cd.makeSvgSpan([],[c],o)}return i.height=a,i.style.height=xu(a),i},mh=function(e){var t=new th.MathNode("mo",[new th.TextNode(dh[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},fh=function(e,t){var{span:n,minWidth:r,height:o}=function(){var n=4e5,r=e.label.slice(1)
|
|
343
|
+
;if(Gc.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 Ru(i),u=new zu([c],{width:"100%",height:xu(a),viewBox:"0 0 "+n+" "+o,preserveAspectRatio:"none"});return{span:Cd.makeSvgSpan([],[u],t),minWidth:0,height:a}}var d,h,p,m=[],f=hh[r],[g,v,_]=f,b=_/1e3,y=g.length;if(1===y)d=["hide-tail"],h=[f[3]];else if(2===y)d=["halfarrow-left","halfarrow-right"],h=["xMinYMin","xMaxYMin"];else{if(3!==y)throw new Error("Correct katexImagesData or update code here to support\n "+y+" children.");d=["brace-left","brace-center","brace-right"],h=["xMinYMin","xMidYMin","xMaxYMin"]}
|
|
344
|
+
for(var w=0;w<y;w++){var x=new Ru(g[w]),k=new zu([x],{width:"400em",height:xu(b),viewBox:"0 0 "+n+" "+_,preserveAspectRatio:h[w]+" slice"}),S=Cd.makeSvgSpan([d[w]],[k],t);if(1===y)return{span:S,minWidth:v,height:b};S.style.height=xu(b),m.push(S)}return{span:Cd.makeSpan(["stretchy"],m,t),minWidth:v,height:b}}();return n.height=o,n.style.height=xu(o),r>0&&(n.style.minWidth=xu(r)),n};function gh(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 vh(e){var t=_h(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 _h(e){return e&&("atom"===e.type||Pu.hasOwnProperty(e.type))?e:null}var bh=(e,t)=>{var n,r,o;e&&"supsub"===e.type?(n=(r=gh(e.base,"accent")).base,e.base=n,o=function(e){if(e instanceof Au)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Kd(e,t)),e.base=r):n=(r=gh(e,"accent")).base;var i=Kd(n,t.havingCrampedStyle()),a=0
|
|
345
|
+
;if(r.isShifty&&Gc.isCharacterBox(n)){var s=Gc.getBaseElem(n);a=Iu(Kd(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=fh(r,t),l=Cd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"elem",elem:l,wrapperClasses:["svg-align"],wrapperStyle:a>0?{width:"calc(100% - "+xu(2*a)+")",marginLeft:xu(2*a)}:void 0}]},t);else{var d,h;"\\vec"===r.label?(d=Cd.staticSvg("vec",t),h=Cd.svgData.vec[1]):((d=Iu(d=Cd.makeOrd({mode:r.mode,text:r.label},t,"textord"))).italic=0,h=d.width,c&&(u+=d.depth)),l=Cd.makeSpan(["accent-body"],[d]);var p="\\textcircled"===r.label;p&&(l.classes.push("accent-full"),u=i.height);var m=a;p||(m-=h/2),l.style.left=xu(m),"\\textcircled"===r.label&&(l.style.top=".2em"),l=Cd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:i},{type:"kern",size:-u},{type:"elem",elem:l}]},t)}var f=Cd.makeSpan(["mord","accent"],[l],t);return o?(o.children[0]=f,
|
|
346
|
+
o.height=Math.max(f.height,o.height),o.classes[0]="mord",o):f},yh=(e,t)=>{var n=e.isStretchy?mh(e.label):new th.MathNode("mo",[nh(e.label,e.mode)]),r=new th.MathNode("mover",[sh(e.base,t),n]);return r.setAttribute("accent","true"),r},wh=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map((e=>"\\"+e)).join("|"));Od({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=Dd(t[0]),r=!wh.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:bh,mathmlBuilder:yh}),Od({type:"accent",
|
|
347
|
+
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:bh,mathmlBuilder:yh}),Od({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=Kd(e.base,t),r=fh(e,t),o="\\utilde"===e.label?.12:0,i=Cd.makeVList({positionType:"top",positionData:n.height,children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:n}]},t);return Cd.makeSpan(["mord","accentunder"],[i],t)},
|
|
348
|
+
mathmlBuilder:(e,t)=>{var n=mh(e.label),r=new th.MathNode("munder",[sh(e.base,t),n]);return r.setAttribute("accentunder","true"),r}});var xh=e=>{var t=new th.MathNode("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};Od({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){
|
|
349
|
+
var n,r=t.style,o=t.havingStyle(r.sup()),i=Cd.wrapFragment(Kd(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=Cd.wrapFragment(Kd(e.below,o,t),t)).classes.push(a+"-arrow-pad"));var s,l=fh(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 d=-t.fontMetrics().axisHeight+n.height+.5*l.height+.111;s=Cd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:i,shift:u},{type:"elem",elem:l,shift:c},{type:"elem",elem:n,shift:d}]},t)}else s=Cd.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"),Cd.makeSpan(["mrel","x-arrow"],[s],t)},mathmlBuilder(e,t){var n,r=mh(e.label);if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){var o=xh(sh(e.body,t));if(e.below){
|
|
350
|
+
var i=xh(sh(e.below,t));n=new th.MathNode("munderover",[r,i,o])}else n=new th.MathNode("mover",[r,o])}else if(e.below){var a=xh(sh(e.below,t));n=new th.MathNode("munder",[r,a])}else n=xh(),n=new th.MathNode("mover",[r,n]);return n}});var kh=Cd.makeSpan;function Sh(e,t){var n=qd(e.body,t,!0);return kh([e.mclass],n,t)}function Ch(e,t){var n,r=ih(e.body,t);return"minner"===e.mclass?n=new th.MathNode("mpadded",r):"mord"===e.mclass?e.isCharacterBox?(n=r[0]).type="mi":n=new th.MathNode("mi",r):(e.isCharacterBox?(n=r[0]).type="mo":n=new th.MathNode("mo",r),"mbin"===e.mclass?(n.attributes.lspace="0.22em",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}Od({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{
|
|
351
|
+
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.slice(5),body:Pd(o),isCharacterBox:Gc.isCharacterBox(o)}},htmlBuilder:Sh,mathmlBuilder:Ch});var Eh=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};Od({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){var{parser:n}=e;return{type:"mclass",mode:n.mode,mclass:Eh(t[0]),body:Pd(t[1]),isCharacterBox:Gc.isCharacterBox(t[1])}}}),Od({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){var n,{parser:r,funcName:o}=e,i=t[1],a=t[0];n="\\stackrel"!==o?Eh(i):"mrel";var s={type:"op",mode:i.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==o,body:Pd(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],
|
|
352
|
+
isCharacterBox:Gc.isCharacterBox(l)}},htmlBuilder:Sh,mathmlBuilder:Ch}),Od({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){var{parser:n}=e;return{type:"pmb",mode:n.mode,mclass:Eh(t[0]),body:Pd(t[0])}},htmlBuilder(e,t){var n=qd(e.body,t,!0),r=Cd.makeSpan([e.mclass],n,t);return r.style.textShadow="0.02em 0.01em 0.04px",r},mathmlBuilder(e,t){var n=ih(e.body,t),r=new th.MathNode("mstyle",n);return r.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),r}});var Ah={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},Th=e=>"textord"===e.type&&"@"===e.text;function Nh(e,t,n){var r=Ah[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]],[])]}
|
|
353
|
+
;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"}}}Od({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=Cd.wrapFragment(Kd(e.label,n,t),t);return r.classes.push("cd-label-"+e.side),r.style.bottom=xu(.8-r.depth),r.height=0,r.depth=0,r},mathmlBuilder(e,t){var n=new th.MathNode("mrow",[sh(e.label,t)]);return(n=new th.MathNode("mpadded",[n])).setAttribute("width","0"),"left"===e.side&&n.setAttribute("lspace","-1width"),n.setAttribute("voffset","0.7em"),(n=new th.MathNode("mstyle",[n])).setAttribute("displaystyle","false"),n.setAttribute("scriptlevel","1"),n}}),Od({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},
|
|
354
|
+
handler(e,t){var{parser:n}=e;return{type:"cdlabelparent",mode:n.mode,fragment:t[0]}},htmlBuilder(e,t){var n=Cd.wrapFragment(Kd(e.fragment,t),t);return n.classes.push("cd-vert-arrow"),n},mathmlBuilder:(e,t)=>new th.MathNode("mrow",[sh(e.fragment,t)])}),Od({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){for(var{parser:n}=e,r=gh(t[0],"ordgroup").body,o="",i=0;i<r.length;i++){o+=gh(r[i],"textord").text}var a,s=parseInt(o);if(isNaN(s))throw new Hc("\\@char has non-numeric argument "+o);if(s<0||s>=1114111)throw new Hc("\\@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 Mh=(e,t)=>{var n=qd(e.body,t.withColor(e.color),!1);return Cd.makeFragment(n)},Lh=(e,t)=>{var n=ih(e.body,t.withColor(e.color)),r=new th.MathNode("mstyle",n);return r.setAttribute("mathcolor",e.color),r};Od({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,
|
|
355
|
+
argTypes:["color","original"]},handler(e,t){var{parser:n}=e,r=gh(t[0],"color-token").color,o=t[1];return{type:"color",mode:n.mode,color:r,body:Pd(o)}},htmlBuilder:Mh,mathmlBuilder:Lh}),Od({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){var{parser:n,breakOnTokenText:r}=e,o=gh(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:Mh,mathmlBuilder:Lh}),Od({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&&gh(o,"size").value}},htmlBuilder(e,t){var n=Cd.makeSpan(["mspace"],[],t);return e.newLine&&(n.classes.push("newline"),e.size&&(n.style.marginTop=xu(wu(e.size,t)))),n},mathmlBuilder(e,t){
|
|
356
|
+
var n=new th.MathNode("mspace");return e.newLine&&(n.setAttribute("linebreak","newline"),e.size&&n.setAttribute("height",xu(wu(e.size,t)))),n}});var zh={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},Rh=e=>{var t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new Hc("Expected a control sequence",e);return t},Oh=(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)};Od({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(zh[r.text])return"\\global"!==n&&"\\\\globallong"!==n||(r.text=zh[r.text]),gh(t.parseFunction(),"internal");throw new Hc("Invalid token after macro prefix",r)}}),Od({type:"internal",
|
|
357
|
+
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 Hc("Expected a control sequence",r);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 Hc('Invalid argument number "'+r.text+'"');if(parseInt(r.text)!==a+1)throw new Hc('Argument number "'+r.text+'" out of order');a++,s.push([])}else{if("EOF"===r.text)throw new Hc("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===zh[n]),{type:"internal",mode:t.mode}}}),Od({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},
|
|
358
|
+
handler(e){var{parser:t,funcName:n}=e,r=Rh(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);return Oh(t,r,o,"\\\\globallet"===n),{type:"internal",mode:t.mode}}}),Od({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){var{parser:t,funcName:n}=e,r=Rh(t.gullet.popToken()),o=t.gullet.popToken(),i=t.gullet.popToken();return Oh(t,r,i,"\\\\globalfuture"===n),t.gullet.pushToken(i),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});var Ih=function(e,t,n){var r=hu(Bu.math[e]&&Bu.math[e].replace||e,t,n);if(!r)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return r},Dh=function(e,t,n,r){var o=n.havingBaseStyle(t),i=Cd.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},Ph=function(e,t,n){
|
|
359
|
+
var r=t.havingBaseStyle(n),o=(1-t.sizeMultiplier/r.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=xu(o),e.height-=o,e.depth+=o},Bh=function(e,t,n,r,o,i){var a=function(e,t,n,r){return Cd.makeSymbol(e,"Size"+t+"-Regular",n,r)}(e,t,o,r),s=Dh(Cd.makeSpan(["delimsizing","size"+t],[a],r),ru.TEXT,r,i);return n&&Ph(s,r,ru.TEXT),s},Fh=function(e,t,n){var r;return r="Size1-Regular"===t?"delim-size1":"delim-size4",{type:"elem",elem:Cd.makeSpan(["delimsizinginner",r],[Cd.makeSpan([],[Cd.makeSymbol(e,t,n)])])}},Hh=function(e,t,n){var r=cu["Size4-Regular"][e.charCodeAt(0)]?cu["Size4-Regular"][e.charCodeAt(0)][4]:cu["Size1-Regular"][e.charCodeAt(0)][4],o=new Ru("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"⎟":
|
|
360
|
+
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";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 zu([o],{width:xu(r),height:xu(t),style:"width:"+xu(r),viewBox:"0 0 "+1e3*r+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),a=Cd.makeSvgSpan([],[i],n);return a.height=t,a.style.height=xu(t),a.style.width=xu(r),{type:"elem",elem:a}},jh={type:"kern",size:-.008},Uh=["|","\\lvert","\\rvert","\\vert"],qh=["\\|","\\lVert","\\rVert","\\Vert"],$h=function(e,t,n,r,o,i){var a,s,l,c,u="",d=0;a=l=c=e,s=null;var h="Size1-Regular"
|
|
361
|
+
;"\\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"):Gc.contains(Uh,e)?(l="∣",u="vert",d=333):Gc.contains(qh,e)?(l="∥",u="doublevert",d=556):"["===e||"\\lbrack"===e?(a="⎡",l="⎢",c="⎣",h="Size4-Regular",u="lbrack",d=667):"]"===e||"\\rbrack"===e?(a="⎤",l="⎥",c="⎦",h="Size4-Regular",u="rbrack",d=667):"\\lfloor"===e||"⌊"===e?(l=a="⎢",c="⎣",h="Size4-Regular",u="lfloor",d=667):"\\lceil"===e||"⌈"===e?(a="⎡",l=c="⎢",h="Size4-Regular",u="lceil",d=667):"\\rfloor"===e||"⌋"===e?(l=a="⎥",c="⎦",h="Size4-Regular",u="rfloor",d=667):"\\rceil"===e||"⌉"===e?(a="⎤",l=c="⎥",h="Size4-Regular",u="rceil",d=667):"("===e||"\\lparen"===e?(a="⎛",l="⎜",c="⎝",h="Size4-Regular",u="lparen",d=875):")"===e||"\\rparen"===e?(a="⎞",l="⎟",c="⎠",h="Size4-Regular",u="rparen",d=875):"\\{"===e||"\\lbrace"===e?(a="⎧",s="⎨",c="⎩",l="⎪",h="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(a="⎫",
|
|
362
|
+
s="⎬",c="⎭",l="⎪",h="Size4-Regular"):"\\lgroup"===e||"⟮"===e?(a="⎧",c="⎩",l="⎪",h="Size4-Regular"):"\\rgroup"===e||"⟯"===e?(a="⎫",c="⎭",l="⎪",h="Size4-Regular"):"\\lmoustache"===e||"⎰"===e?(a="⎧",c="⎭",l="⎪",h="Size4-Regular"):"\\rmoustache"!==e&&"⎱"!==e||(a="⎫",c="⎩",l="⎪",h="Size4-Regular");var p=Ih(a,h,o),m=p.height+p.depth,f=Ih(l,h,o),g=f.height+f.depth,v=Ih(c,h,o),_=v.height+v.depth,b=0,y=1;if(null!==s){var w=Ih(s,h,o);b=w.height+w.depth,y=2}var x=m+_+b,k=x+Math.max(0,Math.ceil((t-x)/(y*g)))*y*g,S=r.fontMetrics().axisHeight;n&&(S*=r.sizeMultiplier);var C=k/2-S,E=[];if(u.length>0){var A=k-m-_,T=Math.round(1e3*k),N=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":
|
|
362
363
|
return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":
|
|
363
364
|
return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":
|
|
364
|
-
return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(u,Math.round(1e3*A)),M=new
|
|
365
|
-
var I=k-m-_+.016;E.push(
|
|
365
|
+
return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(u,Math.round(1e3*A)),M=new Ru(u,N),L=(d/1e3).toFixed(3)+"em",z=(T/1e3).toFixed(3)+"em",R=new zu([M],{width:L,height:z,viewBox:"0 0 "+d+" "+T}),O=Cd.makeSvgSpan([],[R],r);O.height=T/1e3,O.style.width=L,O.style.height=z,E.push({type:"elem",elem:O})}else{if(E.push(Fh(c,h,o)),E.push(jh),null===s){
|
|
366
|
+
var I=k-m-_+.016;E.push(Hh(l,I,r))}else{var D=(k-m-_-b)/2+.016;E.push(Hh(l,D,r)),E.push(jh),E.push(Fh(s,h,o)),E.push(jh),E.push(Hh(l,D,r))}E.push(jh),E.push(Fh(a,h,o))}var P=r.havingBaseStyle(ru.TEXT),B=Cd.makeVList({positionType:"bottom",positionData:C,children:E},P);return Dh(Cd.makeSpan(["delimsizing","mult"],[B],P),ru.TEXT,r,i)},Gh=function(e,t,n,r,o){var i=function(e,t,n){t*=1e3;var r="";switch(e){case"sqrtMain":r=function(e,t){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":
|
|
366
367
|
r=function(e,t){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){
|
|
367
368
|
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){
|
|
368
369
|
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){
|
|
369
|
-
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
|
|
370
|
-
;return
|
|
371
|
-
type:"stack"}],
|
|
372
|
-
var n,r,o=t.havingBaseSizing(),i=
|
|
373
|
-
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
|
|
374
|
-
},
|
|
375
|
-
mode:e.parser.mode,size:
|
|
376
|
-
;--r.leftrightDepth,r.expect("\\right",!1);var i=
|
|
377
|
-
;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return
|
|
378
|
-
number:.6,unit:"pt"},t),u=
|
|
379
|
-
s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=
|
|
380
|
-
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};
|
|
381
|
-
argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=
|
|
382
|
-
handler:o},l=0;l<n.length;++l)
|
|
383
|
-
_&&(e.gullet.macros.get("\\df@tag")?(_.push(e.subparse([new
|
|
384
|
-
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:_,leqno:h}}function
|
|
385
|
-
x.depth=w,v+=y,x.pos=v,v+=w+C,s[n]=x,_(i[n+1])}var E,A,T=v/2+t.fontMetrics().axisHeight,N=e.cols||[],M=[],L=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n<o;++n){var z=s[n],R=z.pos-T,O=e.tags[n],I=void 0;(I=!0===O?
|
|
386
|
-
;(r>0||e.hskipBeforeAndAfter)&&0!==(j=
|
|
387
|
-
},
|
|
388
|
-
for(var b=e.cols||[],y="",w=1;w<b.length;w++)y+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",y.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;d+=k[0].length>0?"left ":"",d+=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()),""!==d&&(c=new
|
|
389
|
-
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+=
|
|
390
|
-
;throw new
|
|
391
|
-
type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:
|
|
392
|
-
type:"align",align:"l",pregap:0,postgap:0}]},
|
|
393
|
-
;return
|
|
394
|
-
}if(
|
|
395
|
-
argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new
|
|
396
|
-
props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=
|
|
397
|
-
var n,r=
|
|
398
|
-
;x<p&&(h+=.5*(p-x),m+=.5*(p-x)),f=
|
|
399
|
-
n=new
|
|
400
|
-
throw new Error("Unrecognized genfrac command")}switch(o){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:
|
|
401
|
-
;var
|
|
402
|
-
token:o}}}),
|
|
403
|
-
type:"elem",elem:a}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=
|
|
404
|
-
command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:
|
|
405
|
-
mathmlBuilder:(e,t)=>new
|
|
406
|
-
var n=
|
|
407
|
-
allowedInText:!1},handler:(e,t,n)=>{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=
|
|
408
|
-
mathmlBuilder:(e,t)=>{var n=new
|
|
409
|
-
var n=
|
|
410
|
-
var{funcName:n,parser:r}=e,o=r.mode;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}}}),
|
|
411
|
-
;l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var h=
|
|
412
|
-
size:l.kern},{type:"elem",elem:l.elem,marginLeft:
|
|
413
|
-
;1===p.length&&p[0]instanceof
|
|
414
|
-
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=
|
|
415
|
-
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:
|
|
416
|
-
var u=l[c];u instanceof
|
|
417
|
-
case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof
|
|
418
|
-
children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return
|
|
419
|
-
;return n=
|
|
420
|
-
;return
|
|
421
|
-
var n=
|
|
422
|
-
numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&
|
|
423
|
-
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=
|
|
424
|
-
var{body:n,index:r}=e;return r?new
|
|
425
|
-
;return n?"op"===n.type?n.limits&&(t.style.size===
|
|
426
|
-
;var w=4*u.defaultRuleThickness;if(d-r.depth-(o.height-h)<w){h=w-(d-r.depth)+o.height;var x=.8*u.xHeight-(d-r.depth);x>0&&(d+=x,h-=x)}var k=[{type:"elem",elem:o,shift:h,marginRight:_,marginLeft:b},{type:"elem",elem:r,shift:-d,marginRight:_}];g=
|
|
427
|
-
;if(e.sub&&i.push(
|
|
428
|
-
}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var
|
|
429
|
-
;if("text"===e.mode){var r=
|
|
430
|
-
;return n?
|
|
431
|
-
},mathmlBuilder(e,t){var n=new
|
|
432
|
-
return
|
|
433
|
-
;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
|
|
434
|
-
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
|
|
435
|
-
|
|
436
|
-
;if(i&&!t)throw new
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
"\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new
|
|
455
|
-
if(t){if(t.length!==e+1)throw new
|
|
456
|
-
if(!/^[1-9]$/.test(s.text))throw new
|
|
457
|
-
;for(var a=new
|
|
458
|
-
"ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),
|
|
370
|
+
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 Ru(e,i),s=new zu([a],{width:"400em",height:xu(t),viewBox:"0 0 400000 "+n,preserveAspectRatio:"xMinYMin slice"})
|
|
371
|
+
;return Cd.makeSvgSpan(["hide-tail"],[s],o)},Vh=["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","⌊","⌋","\\lceil","\\rceil","⌈","⌉","\\surd"],Yh=["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","⟮","⟯","\\lmoustache","\\rmoustache","⎰","⎱"],Wh=["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"],Kh=[0,1.2,1.8,2.4,3],Xh=[{type:"small",style:ru.SCRIPTSCRIPT},{type:"small",style:ru.SCRIPT},{type:"small",style:ru.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Zh=[{type:"small",style:ru.SCRIPTSCRIPT},{type:"small",style:ru.SCRIPT},{type:"small",style:ru.TEXT},{type:"stack"}],Jh=[{type:"small",style:ru.SCRIPTSCRIPT},{type:"small",style:ru.SCRIPT},{type:"small",style:ru.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{
|
|
372
|
+
type:"stack"}],Qh=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.")},ep=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=Ih(e,Qh(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]},tp=function(e,t,n,r,o,i){var a;"<"===e||"\\lt"===e||"⟨"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"⟩"!==e||(e="\\rangle"),a=Gc.contains(Wh,e)?Xh:Gc.contains(Vh,e)?Jh:Zh;var s=ep(e,t,a,r);return"small"===s.type?function(e,t,n,r,o,i){var a=Cd.makeSymbol(e,"Main-Regular",o,r),s=Dh(a,t,r,i);return n&&Ph(s,r,t),s}(e,s.style,n,r,o,i):"large"===s.type?Bh(e,s.size,n,r,o,i):$h(e,t,n,r,o,i)},np={sqrtImage:function(e,t){
|
|
373
|
+
var n,r,o=t.havingBaseSizing(),i=ep("\\surd",e*o.sizeMultiplier,Jh,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=Gh("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*Kh[i.size],c=(Kh[i.size]+s)/a,l=(Kh[i.size]+s+.08)/a,(n=Gh("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=Gh("sqrtTall",l,u,s,t)).style.minWidth="0.742em",r=1.056),n.height=c,n.style.height=xu(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"),Gc.contains(Vh,e)||Gc.contains(Wh,e))return Bh(e,t,!1,n,r,o);if(Gc.contains(Yh,e))return $h(e,Kh[t],!1,n,r,o);throw new Hc("Illegal delimiter: '"+e+"'")},sizeToMaxHeight:Kh,customSizedDelim:tp,leftRightDelim:function(e,t,n,r,o,i){
|
|
374
|
+
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 tp(e,c,!0,r,o,i)}},rp={"\\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}
|
|
375
|
+
},op=["(","\\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 ip(e,t){var n=_h(e);if(n&&Gc.contains(op,n.text))return n;throw new Hc(n?"Invalid delimiter '"+n.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function ap(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}Od({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=ip(t[0],e);return{type:"delimsizing",
|
|
376
|
+
mode:e.parser.mode,size:rp[e.funcName].size,mclass:rp[e.funcName].mclass,delim:n.text}},htmlBuilder:(e,t)=>"."===e.delim?Cd.makeSpan([e.mclass]):np.sizedDelim(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{var t=[];"."!==e.delim&&t.push(nh(e.delim,e.mode));var n=new th.MathNode("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?n.setAttribute("fence","true"):n.setAttribute("fence","false"),n.setAttribute("stretchy","true");var r=xu(np.sizeToMaxHeight[e.size]);return n.setAttribute("minsize",r),n.setAttribute("maxsize",r),n}}),Od({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 Hc("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:ip(t[0],e).text,color:n}}}),Od({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=ip(t[0],e),r=e.parser;++r.leftrightDepth;var o=r.parseExpression(!1)
|
|
377
|
+
;--r.leftrightDepth,r.expect("\\right",!1);var i=gh(r.parseFunction(),"leftright-right");return{type:"leftright",mode:r.mode,body:o,left:n.text,right:i.delim,rightColor:i.color}},htmlBuilder:(e,t)=>{ap(e);for(var n,r,o=qd(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?Wd(t,["mopen"]):np.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]=np.leftRightDelim(u.delim,i,a,u.options,e.mode,[]))}if("."===e.right)r=Wd(t,["mclose"]);else{var d=e.rightColor?t.withColor(e.rightColor):t;r=np.leftRightDelim(e.right,i,a,d,e.mode,["mclose"])}return o.push(r),Cd.makeSpan(["minner"],o,t)},mathmlBuilder:(e,t)=>{ap(e);var n=ih(e.body,t);if("."!==e.left){var r=new th.MathNode("mo",[nh(e.left,e.mode)]);r.setAttribute("fence","true"),n.unshift(r)}if("."!==e.right){var o=new th.MathNode("mo",[nh(e.right,e.mode)])
|
|
378
|
+
;o.setAttribute("fence","true"),e.rightColor&&o.setAttribute("mathcolor",e.rightColor),n.push(o)}return rh(n)}}),Od({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{var n=ip(t[0],e);if(!e.parser.leftrightDepth)throw new Hc("\\middle without preceding \\left",n);return{type:"middle",mode:e.parser.mode,delim:n.text}},htmlBuilder:(e,t)=>{var n;if("."===e.delim)n=Wd(t,[]);else{n=np.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?nh("|","text"):nh(e.delim,e.mode),r=new th.MathNode("mo",[n]);return r.setAttribute("fence","true"),r.setAttribute("lspace","0.05em"),r.setAttribute("rspace","0.05em"),r}});var sp=(e,t)=>{var n,r,o=Cd.wrapFragment(Kd(e.body,t),t),i=e.label.slice(1),a=t.sizeMultiplier,s=0,l=Gc.isCharacterBox(e.body);if("sout"===i)(n=Cd.makeSpan(["stretchy","sout"])).height=t.fontMetrics().defaultRuleThickness/a,s=-.5*t.fontMetrics().xHeight;else if("phase"===i){var c=wu({
|
|
379
|
+
number:.6,unit:"pt"},t),u=wu({number:.35,unit:"ex"},t);a/=t.havingBaseSizing().sizeMultiplier;var d=o.height+o.depth+c+u;o.style.paddingLeft=xu(d/2+c);var h=Math.floor(1e3*d*a),p=function(e){return"M400000 "+e+" H0 L"+e/2+" 0 l65 45 L145 "+(e-80)+" H400000z"}(h),m=new zu([new Ru("phase",p)],{width:"400em",height:xu(h/1e3),viewBox:"0 0 400000 "+h,preserveAspectRatio:"xMinYMin slice"});(n=Cd.makeSvgSpan(["hide-tail"],[m],t)).style.height=xu(d),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=ph(o,i,f,g,t),/fbox|boxed|fcolorbox/.test(i)?(n.style.borderStyle="solid",n.style.borderWidth=xu(v)):"angl"===i&&.049!==v&&(n.style.borderTopWidth=xu(v),n.style.borderRightWidth=xu(v)),
|
|
380
|
+
s=o.depth+g,e.backgroundColor&&(n.style.backgroundColor=e.backgroundColor,e.borderColor&&(n.style.borderColor=e.borderColor))}if(e.backgroundColor)r=Cd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:n,shift:s},{type:"elem",elem:o,shift:0}]},t);else{var _=/cancel|phase/.test(i)?["svg-align"]:[];r=Cd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:o,shift:0},{type:"elem",elem:n,shift:s,wrapperClasses:_}]},t)}return/cancel/.test(i)&&(r.height=o.height,r.depth=o.depth),/cancel/.test(i)&&!l?Cd.makeSpan(["mord","cancel-lap"],[r],t):Cd.makeSpan(["mord"],[r],t)},lp=(e,t)=>{var n=0,r=new th.MathNode(e.label.indexOf("colorbox")>-1?"mpadded":"menclose",[sh(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":
|
|
381
|
+
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};Od({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=gh(t[0],"color-token").color,a=t[1];return{type:"enclose",mode:r.mode,label:o,backgroundColor:i,body:a}},htmlBuilder:sp,mathmlBuilder:lp}),Od({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,
|
|
382
|
+
argTypes:["color","color","text"]},handler(e,t,n){var{parser:r,funcName:o}=e,i=gh(t[0],"color-token").color,a=gh(t[1],"color-token").color,s=t[2];return{type:"enclose",mode:r.mode,label:o,backgroundColor:a,borderColor:i,body:s}},htmlBuilder:sp,mathmlBuilder:lp}),Od({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]}}}),Od({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:sp,mathmlBuilder:lp}),Od({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 cp={};function up(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,
|
|
383
|
+
handler:o},l=0;l<n.length;++l)cp[n[l]]=s;i&&(zd[t]=i),a&&(Rd[t]=a)}var dp={};function hp(e,t){dp[e]=t}function pp(e){var t=[];e.consumeSpaces();var n=e.fetch().text;for("\\relax"===n&&(e.consume(),e.consumeSpaces(),n=e.fetch().text);"\\hline"===n||"\\hdashline"===n;)e.consume(),t.push("\\hdashline"===n),e.consumeSpaces(),n=e.fetch().text;return t}var mp=e=>{if(!e.parser.settings.displayMode)throw new Hc("{"+e.envName+"} can be used only in display mode.")};function fp(e){if(-1===e.indexOf("ed"))return-1===e.indexOf("*")}function gp(e,t,n){var{hskipBeforeAndAfter:r,addJot:o,cols:i,arraystretch:a,colSeparationType:s,autoTag:l,singleRow:c,emptySingleRow:u,maxNumCols:d,leqno:h}=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 Hc("Invalid \\arraystretch: "+p)}e.gullet.beginGroup();var m=[],f=[m],g=[],v=[],_=null!=l?[]:void 0;function b(){l&&e.gullet.macros.set("\\@eqnsw","1",!0)}
|
|
384
|
+
function y(){_&&(e.gullet.macros.get("\\df@tag")?(_.push(e.subparse([new Fc("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):_.push(Boolean(l)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(b(),v.push(pp(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(d&&m.length===d){if(c||s)throw new Hc("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){y(),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 Hc("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),y(),v.push(pp(e)),m=[],f.push(m),b()}}
|
|
385
|
+
return e.gullet.endGroup(),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:_,leqno:h}}function vp(e){return"d"===e.slice(0,1)?"display":"text"}var _p=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,d=5*u;e.colSeparationType&&"small"===e.colSeparationType&&(d=t.havingStyle(ru.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778);var h="CD"===e.colSeparationType?wu({number:3,unit:"ex"},t):12*u,p=3*u,m=e.arraystretch*h,f=.7*m,g=.3*m,v=0;function _(e){for(var t=0;t<e.length;++t)t>0&&(v+=.25),l.push({pos:v,isDashed:e[t]})}for(_(i[0]),n=0;n<e.body.length;++n){var b=e.body[n],y=f,w=g;a<b.length&&(a=b.length);var x=new Array(b.length);for(r=0;r<b.length;++r){var k=Kd(b[r],t);w<k.depth&&(w=k.depth),y<k.height&&(y=k.height),x[r]=k}var S=e.rowGaps[n],C=0;S&&(C=wu(S,t))>0&&(w<(C+=g)&&(w=C),C=0),
|
|
386
|
+
e.addJot&&(w+=p),x.height=y,x.depth=w,v+=y,x.pos=v,v+=w+C,s[n]=x,_(i[n+1])}var E,A,T=v/2+t.fontMetrics().axisHeight,N=e.cols||[],M=[],L=[];if(e.tags&&e.tags.some((e=>e)))for(n=0;n<o;++n){var z=s[n],R=z.pos-T,O=e.tags[n],I=void 0;(I=!0===O?Cd.makeSpan(["eqn-num"],[],t):!1===O?Cd.makeSpan([],[],t):Cd.makeSpan([],qd(O,t,!0),t)).depth=z.depth,I.height=z.height,L.push({type:"elem",elem:I,shift:R})}for(r=0,A=0;r<a||A<N.length;++r,++A){for(var D=N[A]||{},P=!0;"separator"===D.type;){if(P||((E=Cd.makeSpan(["arraycolsep"],[])).style.width=xu(t.fontMetrics().doubleRuleSep),M.push(E)),"|"!==D.separator&&":"!==D.separator)throw new Hc("Invalid separator type: "+D.separator);var B="|"===D.separator?"solid":"dashed",F=Cd.makeSpan(["vertical-separator"],[],t);F.style.height=xu(v),F.style.borderRightWidth=xu(c),F.style.borderRightStyle=B,F.style.margin="0 "+xu(-c/2);var H=v-T;H&&(F.style.verticalAlign=xu(-H)),M.push(F),D=N[++A]||{},P=!1}if(!(r>=a)){var j=void 0
|
|
387
|
+
;(r>0||e.hskipBeforeAndAfter)&&0!==(j=Gc.deflt(D.pregap,d))&&((E=Cd.makeSpan(["arraycolsep"],[])).style.width=xu(j),M.push(E));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=Cd.makeVList({positionType:"individualShift",children:U},t),U=Cd.makeSpan(["col-align-"+(D.align||"c")],[U]),M.push(U),(r<a-1||e.hskipBeforeAndAfter)&&0!==(j=Gc.deflt(D.postgap,d))&&((E=Cd.makeSpan(["arraycolsep"],[])).style.width=xu(j),M.push(E))}}if(s=Cd.makeSpan(["mtable"],M),l.length>0){for(var V=Cd.makeLineSpan("hline",t,c),Y=Cd.makeLineSpan("hdashline",t,c),W=[{type:"elem",elem:s,shift:0}];l.length>0;){var K=l.pop(),X=K.pos-T;K.isDashed?W.push({type:"elem",elem:Y,shift:X}):W.push({type:"elem",elem:V,shift:X})}s=Cd.makeVList({positionType:"individualShift",children:W},t)}if(0===L.length)return Cd.makeSpan(["mord"],[s],t);var Z=Cd.makeVList({positionType:"individualShift",children:L},t);return Z=Cd.makeSpan(["tag"],[Z],t),Cd.makeFragment([s,Z])
|
|
388
|
+
},bp={c:"center ",l:"left ",r:"right "},yp=function(e,t){for(var n=[],r=new th.MathNode("mtd",[],["mtr-glue"]),o=new th.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 th.MathNode("mtd",[sh(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 th.MathNode("mtr",s))}var c=new th.MathNode("mtable",n),u=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);c.setAttribute("rowspacing",xu(u));var d="",h="";if(e.cols&&e.cols.length>0){var p=e.cols,m="",f=!1,g=0,v=p.length;"separator"===p[0].type&&(d+="top ",g=1),"separator"===p[p.length-1].type&&(d+="bottom ",v-=1);for(var _=g;_<v;_++)"align"===p[_].type?(h+=bp[p[_].align],f&&(m+="none "),f=!0):"separator"===p[_].type&&f&&(m+="|"===p[_].separator?"solid ":"dashed ",f=!1);c.setAttribute("columnalign",h.trim()),/[sd]/.test(m)&&c.setAttribute("columnlines",m.trim())}if("align"===e.colSeparationType){
|
|
389
|
+
for(var b=e.cols||[],y="",w=1;w<b.length;w++)y+=w%2?"0em ":"1em ";c.setAttribute("columnspacing",y.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;d+=k[0].length>0?"left ":"",d+=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()),""!==d&&(c=new th.MathNode("menclose",[c])).setAttribute("notation",d.trim()),e.arraystretch&&e.arraystretch<1&&(c=new th.MathNode("mstyle",[c])).setAttribute("scriptlevel","1"),c},wp=function(e,t){-1===e.envName.indexOf("ed")&&mp(e);var n,r=[],o=e.envName.indexOf("at")>-1?"alignat":"align",i="split"===e.envName,a=gp(e.parser,{cols:r,addJot:!0,autoTag:i?void 0:fp(e.envName),emptySingleRow:!0,
|
|
390
|
+
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+=gh(t[0].body[u],"textord").text}n=Number(c),s=2*n}var d=!s;a.body.forEach((function(e){for(var t=1;t<e.length;t+=2){var r=gh(e[t],"styling");gh(r.body[0],"ordgroup").body.unshift(l)}if(d)s<e.length&&(s=e.length);else{var o=e.length/2;if(n<o)throw new Hc("Too many math in a row: expected "+n+", but got "+o,e[0])}}));for(var h=0;h<s;++h){var p="r",m=0;h%2==1?p="l":h>0&&d&&(m=1),r[h]={type:"align",align:p,pregap:m,postgap:0}}return a.colSeparationType=d?"align":"alignat",a};up({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){var n=(_h(t[0])?[t[0]]:gh(t[0],"ordgroup").body).map((function(e){var t=vh(e).text;if(-1!=="lcr".indexOf(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"}
|
|
391
|
+
;throw new Hc("Unknown column alignment: "+t,e)})),r={cols:n,hskipBeforeAndAfter:!0,maxNumCols:n.length};return gp(e.parser,r,vp(e.envName))},htmlBuilder:_p,mathmlBuilder:yp}),up({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){var t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")],n="c",r={hskipBeforeAndAfter:!1,cols:[{type:"align",align:n}]};if("*"===e.envName.charAt(e.envName.length-1)){var o=e.parser;if(o.consumeSpaces(),"["===o.fetch().text){if(o.consume(),o.consumeSpaces(),n=o.fetch().text,-1==="lcr".indexOf(n))throw new Hc("Expected l or c or r",o.nextToken);o.consume(),o.consumeSpaces(),o.expect("]"),o.consume(),r.cols=[{type:"align",align:n}]}}var i=gp(e.parser,r,vp(e.envName)),a=Math.max(0,...i.body.map((e=>e.length)));return i.cols=new Array(a).fill({type:"align",align:n}),t?{
|
|
392
|
+
type:"leftright",mode:e.mode,body:[i],left:t[0],right:t[1],rightColor:void 0}:i},htmlBuilder:_p,mathmlBuilder:yp}),up({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){var t=gp(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:_p,mathmlBuilder:yp}),up({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){var n=(_h(t[0])?[t[0]]:gh(t[0],"ordgroup").body).map((function(e){var t=vh(e).text;if(-1!=="lc".indexOf(t))return{type:"align",align:t};throw new Hc("Unknown column alignment: "+t,e)}));if(n.length>1)throw new Hc("{subarray} can contain only one column");var r={cols:n,hskipBeforeAndAfter:!1,arraystretch:.5};if((r=gp(e.parser,r,"script")).body.length>0&&r.body[0].length>1)throw new Hc("{subarray} can contain only one column");return r},htmlBuilder:_p,mathmlBuilder:yp}),up({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){var t=gp(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{
|
|
393
|
+
type:"align",align:"l",pregap:0,postgap:0}]},vp(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:_p,mathmlBuilder:yp}),up({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:wp,htmlBuilder:_p,mathmlBuilder:yp}),up({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){Gc.contains(["gather","gather*"],e.envName)&&mp(e);var t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:fp(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return gp(e.parser,t,"display")},htmlBuilder:_p,mathmlBuilder:yp}),up({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:wp,htmlBuilder:_p,mathmlBuilder:yp}),up({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){mp(e);var t={autoTag:fp(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno}
|
|
394
|
+
;return gp(e.parser,t,"display")},htmlBuilder:_p,mathmlBuilder:yp}),up({type:"array",names:["CD"],props:{numArgs:0},handler:e=>(mp(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 Hc("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(Th(l[u])){i.push(c);var d=vh(l[u+=1]).text,h=new Array(2);if(h[0]={type:"ordgroup",mode:"math",body:[]},h[1]={type:"ordgroup",mode:"math",body:[]},"=|.".indexOf(d)>-1);else{if(!("<>AV".indexOf(d)>-1))throw new Hc('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=d,("mathord"===(r=l[f]).type||"atom"===r.type)&&r.text===o){m=!1,u=f;break
|
|
395
|
+
}if(Th(l[f]))throw new Hc("Missing a "+d+" character to complete a CD arrow.",l[f]);h[p].body.push(l[f])}if(m)throw new Hc("Missing a "+d+" character to complete a CD arrow.",l[u])}}var g={type:"styling",body:[Nh(d,h,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:_p,mathmlBuilder:yp}),hp("\\nonumber","\\gdef\\@eqnsw{0}"),hp("\\notag","\\nonumber"),Od({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new Hc(e.funcName+" valid only within array environment")}});var xp=cp;Od({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,
|
|
396
|
+
argTypes:["text"]},handler(e,t){var{parser:n,funcName:r}=e,o=t[0];if("ordgroup"!==o.type)throw new Hc("Invalid environment name",o);for(var i="",a=0;a<o.body.length;++a)i+=gh(o.body[a],"textord").text;if("\\begin"===r){if(!xp.hasOwnProperty(i))throw new Hc("No such environment: "+i,o);var s=xp[i],{args:l,optArgs:c}=n.parseArguments("\\begin{"+i+"}",s),u={mode:n.mode,envName:i,parser:n},d=s.handler(u,l,c);n.expect("\\end",!1);var h=n.nextToken,p=gh(n.parseFunction(),"environment");if(p.name!==i)throw new Hc("Mismatch: \\begin{"+i+"} matched by \\end{"+p.name+"}",h);return d}return{type:"environment",mode:n.mode,name:i,nameGroup:o}}});var kp=(e,t)=>{var n=e.font,r=t.withFont(n);return Kd(e.body,r)},Sp=(e,t)=>{var n=e.font,r=t.withFont(n);return sh(e.body,r)},Cp={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak","\\bm":"\\boldsymbol"};Od({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],
|
|
397
|
+
props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{var{parser:n,funcName:r}=e,o=Dd(t[0]),i=r;return i in Cp&&(i=Cp[i]),{type:"font",mode:n.mode,font:i.slice(1),body:o}},htmlBuilder:kp,mathmlBuilder:Sp}),Od({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{var{parser:n}=e,r=t[0],o=Gc.isCharacterBox(r);return{type:"mclass",mode:n.mode,mclass:Eh(r),body:[{type:"font",mode:n.mode,font:"boldsymbol",body:r}],isCharacterBox:o}}}),Od({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:kp,mathmlBuilder:Sp});var Ep=(e,t)=>{var n=t;return"display"===e?n=n.id>=ru.SCRIPT.id?n.text():ru.DISPLAY:"text"===e&&n.size===ru.DISPLAY.size?n=ru.TEXT:"script"===e?n=ru.SCRIPT:"scriptscript"===e&&(n=ru.SCRIPTSCRIPT),n},Ap=(e,t)=>{
|
|
398
|
+
var n,r=Ep(e.size,t.style),o=r.fracNum(),i=r.fracDen();n=t.havingStyle(o);var a=Kd(e.numer,n,t);if(e.continued){var s=8.5/t.fontMetrics().ptPerEm,l=3.5/t.fontMetrics().ptPerEm;a.height=a.height<s?s:a.height,a.depth=a.depth<l?l:a.depth}n=t.havingStyle(i);var c,u,d,h,p,m,f,g,v,_,b=Kd(e.denom,n,t);if(e.hasBarLine?(e.barSize?(u=wu(e.barSize,t),c=Cd.makeLineSpan("frac-line",t,u)):c=Cd.makeLineSpan("frac-line",t),u=c.height,d=c.height):(c=null,u=0,d=t.fontMetrics().defaultRuleThickness),r.size===ru.DISPLAY.size||"display"===e.size?(h=t.fontMetrics().num1,p=u>0?3*d:7*d,m=t.fontMetrics().denom1):(u>0?(h=t.fontMetrics().num2,p=d):(h=t.fontMetrics().num3,p=3*d),m=t.fontMetrics().denom2),c){var y=t.fontMetrics().axisHeight;h-a.depth-(y+.5*u)<p&&(h+=p-(h-a.depth-(y+.5*u))),y-.5*u-(b.height-m)<p&&(m+=p-(y-.5*u-(b.height-m)));var w=-(y-.5*u);f=Cd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:c,shift:w},{type:"elem",elem:a,shift:-h}]},t)}else{var x=h-a.depth-(b.height-m)
|
|
399
|
+
;x<p&&(h+=.5*(p-x),m+=.5*(p-x)),f=Cd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:b,shift:m},{type:"elem",elem:a,shift:-h}]},t)}return n=t.havingStyle(r),f.height*=n.sizeMultiplier/t.sizeMultiplier,f.depth*=n.sizeMultiplier/t.sizeMultiplier,g=r.size===ru.DISPLAY.size?t.fontMetrics().delim1:r.size===ru.SCRIPTSCRIPT.size?t.havingStyle(ru.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,v=null==e.leftDelim?Wd(t,["mopen"]):np.customSizedDelim(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),_=e.continued?Cd.makeSpan([]):null==e.rightDelim?Wd(t,["mclose"]):np.customSizedDelim(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),Cd.makeSpan(["mord"].concat(n.sizingClasses(t)),[v,Cd.makeSpan(["mfrac"],[f]),_],t)},Tp=(e,t)=>{var n=new th.MathNode("mfrac",[sh(e.numer,t),sh(e.denom,t)]);if(e.hasBarLine){if(e.barSize){var r=wu(e.barSize,t);n.setAttribute("linethickness",xu(r))}}else n.setAttribute("linethickness","0px");var o=Ep(e.size,t.style);if(o.size!==t.style.size){
|
|
400
|
+
n=new th.MathNode("mstyle",[n]);var i=o.size===ru.DISPLAY.size?"true":"false";n.setAttribute("displaystyle",i),n.setAttribute("scriptlevel","0")}if(null!=e.leftDelim||null!=e.rightDelim){var a=[];if(null!=e.leftDelim){var s=new th.MathNode("mo",[new th.TextNode(e.leftDelim.replace("\\",""))]);s.setAttribute("fence","true"),a.push(s)}if(a.push(n),null!=e.rightDelim){var l=new th.MathNode("mo",[new th.TextNode(e.rightDelim.replace("\\",""))]);l.setAttribute("fence","true"),a.push(l)}return rh(a)}return n};Od({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:
|
|
401
|
+
throw new Error("Unrecognized genfrac command")}switch(o){case"\\dfrac":case"\\dbinom":c="display";break;case"\\tfrac":case"\\tbinom":c="text"}return{type:"genfrac",mode:r.mode,continued:!1,numer:i,denom:a,hasBarLine:n,leftDelim:s,rightDelim:l,size:c,barSize:null}},htmlBuilder:Ap,mathmlBuilder:Tp}),Od({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}}}),Od({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}}})
|
|
402
|
+
;var Np=["display","text","script","scriptscript"],Mp=function(e){var t=null;return e.length>0&&(t="."===(t=e)?null:t),t};Od({type:"genfrac",names:["\\genfrac"],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=Dd(t[0]),s="atom"===a.type&&"open"===a.family?Mp(a.text):null,l=Dd(t[1]),c="atom"===l.type&&"close"===l.family?Mp(l.text):null,u=gh(t[2],"size"),d=null;n=!!u.isBlank||(d=u.value).number>0;var h="auto",p=t[3];if("ordgroup"===p.type){if(p.body.length>0){var m=gh(p.body[0],"textord");h=Np[Number(m.text)]}}else p=gh(p,"textord"),h=Np[Number(p.text)];return{type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:n,barSize:d,leftDelim:s,rightDelim:c,size:h}},htmlBuilder:Ap,mathmlBuilder:Tp}),Od({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:gh(t[0],"size").value,
|
|
403
|
+
token:o}}}),Od({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{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}(gh(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:Ap,mathmlBuilder:Tp});var Lp=(e,t)=>{var n,r,o=t.style;"supsub"===e.type?(n=e.sup?Kd(e.sup,t.havingStyle(o.sup()),t):Kd(e.sub,t.havingStyle(o.sub()),t),r=gh(e.base,"horizBrace")):r=gh(e,"horizBrace");var i,a=Kd(r.base,t.havingBaseStyle(ru.DISPLAY)),s=fh(r,t);if(r.isOver?(i=Cd.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=Cd.makeVList({positionType:"bottom",positionData:a.depth+.1+s.height,children:[{type:"elem",elem:s},{type:"kern",size:.1},{
|
|
404
|
+
type:"elem",elem:a}]},t)).children[0].children[0].children[0].classes.push("svg-align"),n){var l=Cd.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t);i=r.isOver?Cd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:l},{type:"kern",size:.2},{type:"elem",elem:n}]},t):Cd.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 Cd.makeSpan(["mord",r.isOver?"mover":"munder"],[i],t)};Od({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:Lp,mathmlBuilder:(e,t)=>{var n=mh(e.label);return new th.MathNode(e.isOver?"mover":"munder",[sh(e.base,t),n])}}),Od({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=t[1],o=gh(t[0],"url").url;return n.settings.isTrusted({
|
|
405
|
+
command:"\\href",url:o})?{type:"href",mode:n.mode,href:o,body:Pd(r)}:n.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{var n=qd(e.body,t,!1);return Cd.makeAnchor(e.href,[],n,t)},mathmlBuilder:(e,t)=>{var n=ah(e.body,t);return n instanceof Qd||(n=new Qd("mrow",[n])),n.setAttribute("href",e.href),n}}),Od({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{var{parser:n}=e,r=gh(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:Pd(s)}}}),Od({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:Pd(t[0])}},htmlBuilder(e,t){var n=qd(e.body,t,!1);return Cd.makeFragment(n)},
|
|
406
|
+
mathmlBuilder:(e,t)=>new th.MathNode("mrow",ih(e.body,t))}),Od({type:"html",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=gh(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 d=c[u].split("=");if(2!==d.length)throw new Hc("Error parsing key-value for \\htmlData");l["data-"+d[0].trim()]=d[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:Pd(s)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{
|
|
407
|
+
var n=qd(e.body,t,!1),r=["enclosing"];e.attributes.class&&r.push(...e.attributes.class.trim().split(/\s+/));var o=Cd.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)=>ah(e.body,t)}),Od({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInText:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"htmlmathml",mode:n.mode,html:Pd(t[0]),mathml:Pd(t[1])}},htmlBuilder:(e,t)=>{var n=qd(e.html,t,!1);return Cd.makeFragment(n)},mathmlBuilder:(e,t)=>ah(e.mathml,t)});var zp=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 Hc("Invalid size: '"+e+"' in \\includegraphics");var n={number:+(t[1]+t[2]),unit:t[3]};if(!yu(n))throw new Hc("Invalid unit: '"+n.unit+"' in \\includegraphics.");return n};Od({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],
|
|
408
|
+
allowedInText:!1},handler:(e,t,n)=>{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=gh(n[0],"raw").string.split(","),c=0;c<l.length;c++){var u=l[c].split("=");if(2===u.length){var d=u[1].trim();switch(u[0].trim()){case"alt":s=d;break;case"width":o=zp(d);break;case"height":i=zp(d);break;case"totalheight":a=zp(d);break;default:throw new Hc("Invalid key: '"+u[0]+"' in \\includegraphics.")}}}var h=gh(t[0],"url").url;return""===s&&(s=(s=(s=h).replace(/^.*[\\/]/,"")).substring(0,s.lastIndexOf("."))),r.settings.isTrusted({command:"\\includegraphics",url:h})?{type:"includegraphics",mode:r.mode,alt:s,width:o,height:i,totalheight:a,src:h}:r.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{var n=wu(e.height,t),r=0;e.totalheight.number>0&&(r=wu(e.totalheight,t)-n);var o=0;e.width.number>0&&(o=wu(e.width,t));var i={height:xu(n+r)};o>0&&(i.width=xu(o)),r>0&&(i.verticalAlign=xu(-r));var a=new Nu(e.src,e.alt,i);return a.height=n,a.depth=r,a},
|
|
409
|
+
mathmlBuilder:(e,t)=>{var n=new th.MathNode("mglyph",[]);n.setAttribute("alt",e.alt);var r=wu(e.height,t),o=0;if(e.totalheight.number>0&&(o=wu(e.totalheight,t)-r,n.setAttribute("valign",xu(-o))),n.setAttribute("height",xu(r+o)),e.width.number>0){var i=wu(e.width,t);n.setAttribute("width",xu(i))}return n.setAttribute("src",e.src),n}}),Od({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=gh(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)=>Cd.makeGlue(e.dimension,t),mathmlBuilder(e,t){
|
|
410
|
+
var n=wu(e.dimension,t);return new th.SpaceNode(n)}}),Od({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=Cd.makeSpan([],[Kd(e.body,t)]),n=Cd.makeSpan(["inner"],[n],t)):n=Cd.makeSpan(["inner"],[Kd(e.body,t)]);var r=Cd.makeSpan(["fix"],[]),o=Cd.makeSpan([e.alignment],[n,r],t),i=Cd.makeSpan(["strut"]);return i.style.height=xu(o.height+o.depth),o.depth&&(i.style.verticalAlign=xu(-o.depth)),o.children.unshift(i),o=Cd.makeSpan(["thinbox"],[o],t),Cd.makeSpan(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{var n=new th.MathNode("mpadded",[sh(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}}),Od({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){
|
|
411
|
+
var{funcName:n,parser:r}=e,o=r.mode;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}}}),Od({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new Hc("Mismatched "+e.funcName)}});var Rp=(e,t)=>{switch(t.style.size){case ru.DISPLAY.size:return e.display;case ru.TEXT.size:return e.text;case ru.SCRIPT.size:return e.script;case ru.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};Od({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{var{parser:n}=e;return{type:"mathchoice",mode:n.mode,display:Pd(t[0]),text:Pd(t[1]),script:Pd(t[2]),scriptscript:Pd(t[3])}},htmlBuilder:(e,t)=>{var n=Rp(e,t),r=qd(n,t,!1);return Cd.makeFragment(r)},mathmlBuilder:(e,t)=>{var n=Rp(e,t);return ah(n,t)}});var Op=(e,t,n,r,o,i,a)=>{e=Cd.makeSpan([],[e]);var s,l,c,u=n&&Gc.isCharacterBox(n);if(t){var d=Kd(t,r.havingStyle(o.sup()),r)
|
|
412
|
+
;l={elem:d,kern:Math.max(r.fontMetrics().bigOpSpacing1,r.fontMetrics().bigOpSpacing3-d.depth)}}if(n){var h=Kd(n,r.havingStyle(o.sub()),r);s={elem:h,kern:Math.max(r.fontMetrics().bigOpSpacing2,r.fontMetrics().bigOpSpacing4-h.height)}}if(l&&s){var p=r.fontMetrics().bigOpSpacing5+s.elem.height+s.elem.depth+s.kern+e.depth+a;c=Cd.makeVList({positionType:"bottom",positionData:p,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:xu(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e},{type:"kern",size:l.kern},{type:"elem",elem:l.elem,marginLeft:xu(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}else if(s){var m=e.height-a;c=Cd.makeVList({positionType:"top",positionData:m,children:[{type:"kern",size:r.fontMetrics().bigOpSpacing5},{type:"elem",elem:s.elem,marginLeft:xu(-i)},{type:"kern",size:s.kern},{type:"elem",elem:e}]},r)}else{if(!l)return e;var f=e.depth+a;c=Cd.makeVList({positionType:"bottom",positionData:f,children:[{type:"elem",elem:e},{type:"kern",
|
|
413
|
+
size:l.kern},{type:"elem",elem:l.elem,marginLeft:xu(i)},{type:"kern",size:r.fontMetrics().bigOpSpacing5}]},r)}var g=[c];if(s&&0!==i&&!u){var v=Cd.makeSpan(["mspace"],[],r);v.style.marginRight=xu(i),g.unshift(v)}return Cd.makeSpan(["mop","op-limits"],g,r)},Ip=["\\smallint"],Dp=(e,t)=>{var n,r,o,i=!1;"supsub"===e.type?(n=e.sup,r=e.sub,o=gh(e.base,"op"),i=!0):o=gh(e,"op");var a,s=t.style,l=!1;if(s.size===ru.DISPLAY.size&&o.symbol&&!Gc.contains(Ip,o.name)&&(l=!0),o.symbol){var c=l?"Size2-Regular":"Size1-Regular",u="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(u=o.name.slice(1),o.name="oiint"===u?"\\iint":"\\iiint"),a=Cd.makeSymbol(o.name,c,"math",t,["mop","op-symbol",l?"large-op":"small-op"]),u.length>0){var d=a.italic,h=Cd.staticSvg(u+"Size"+(l?"2":"1"),t);a=Cd.makeVList({positionType:"individualShift",children:[{type:"elem",elem:a,shift:0},{type:"elem",elem:h,shift:l?.08:0}]},t),o.name="\\"+u,a.classes.unshift("mop"),a.italic=d}}else if(o.body){var p=qd(o.body,t,!0)
|
|
414
|
+
;1===p.length&&p[0]instanceof Lu?(a=p[0]).classes[0]="mop":a=Cd.makeSpan(["mop"],p,t)}else{for(var m=[],f=1;f<o.name.length;f++)m.push(Cd.mathsym(o.name[f],o.mode,t));a=Cd.makeSpan(["mop"],m,t)}var g=0,v=0;return(a instanceof Lu||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(g=(a.height-a.depth)/2-t.fontMetrics().axisHeight,v=a.italic),i?Op(a,n,r,t,s,v,g):(g&&(a.style.position="relative",a.style.top=xu(g)),a)},Pp=(e,t)=>{var n;if(e.symbol)n=new Qd("mo",[nh(e.name,e.mode)]),Gc.contains(Ip,e.name)&&n.setAttribute("largeop","false");else if(e.body)n=new Qd("mo",ih(e.body,t));else{n=new Qd("mi",[new eh(e.name.slice(1))]);var r=new Qd("mo",[nh("","text")]);n=e.parentIsSupSub?new Qd("mrow",[n,r]):Jd([n,r])}return n},Bp={"∏":"\\prod","∐":"\\coprod","∑":"\\sum","⋀":"\\bigwedge","⋁":"\\bigvee","⋂":"\\bigcap","⋃":"\\bigcup","⨀":"\\bigodot","⨁":"\\bigoplus","⨂":"\\bigotimes","⨄":"\\biguplus","⨆":"\\bigsqcup"};Od({type:"op",
|
|
415
|
+
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=Bp[o]),{type:"op",mode:n.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:Dp,mathmlBuilder:Pp}),Od({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:Pd(r)}},htmlBuilder:Dp,mathmlBuilder:Pp});var Fp={"∫":"\\int","∬":"\\iint","∭":"\\iiint","∮":"\\oint","∯":"\\oiint","∰":"\\oiiint"};Od({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"],
|
|
416
|
+
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:Dp,mathmlBuilder:Pp}),Od({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:Dp,mathmlBuilder:Pp}),Od({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=Fp[r]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:r}},htmlBuilder:Dp,mathmlBuilder:Pp});var Hp=(e,t)=>{var n,r,o,i,a=!1;if("supsub"===e.type?(n=e.sup,r=e.sub,o=gh(e.base,"operatorname"),a=!0):o=gh(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=qd(s,t.withFont("mathrm"),!0),c=0;c<l.length;c++){
|
|
417
|
+
var u=l[c];u instanceof Lu&&(u.text=u.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}i=Cd.makeSpan(["mop"],l,t)}else i=Cd.makeSpan(["mop"],[],t);return a?Op(i,n,r,t,t.style,0,0):i};function jp(e,t,n){for(var r=qd(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 Cd.makeFragment(r)}Od({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:Pd(o),alwaysHandleSupSub:"\\operatornamewithlimits"===r,limits:!1,parentIsSupSub:!1}},htmlBuilder:Hp,mathmlBuilder:(e,t)=>{for(var n=ih(e.body,t.withFont("mathrm")),r=!0,o=0;o<n.length;o++){var i=n[o];if(i instanceof th.SpaceNode);else if(i instanceof th.MathNode)switch(i.type){case"mi":case"mn":case"ms":
|
|
418
|
+
case"mspace":case"mtext":break;case"mo":var a=i.children[0];1===i.children.length&&a instanceof th.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 th.TextNode(s)]}var l=new th.MathNode("mi",n);l.setAttribute("mathvariant","normal");var c=new th.MathNode("mo",[nh("","text")]);return e.parentIsSupSub?new th.MathNode("mrow",[l,c]):th.newDocumentFragment([l,c])}}),hp("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),Id({type:"ordgroup",htmlBuilder:(e,t)=>e.semisimple?Cd.makeFragment(qd(e.body,t,!1)):Cd.makeSpan(["mord"],qd(e.body,t,!0),t),mathmlBuilder:(e,t)=>ah(e.body,t,!0)}),Od({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=Kd(e.body,t.havingCrampedStyle()),r=Cd.makeLineSpan("overline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Cd.makeVList({positionType:"firstBaseline",
|
|
419
|
+
children:[{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r},{type:"kern",size:o}]},t);return Cd.makeSpan(["mord","overline"],[i],t)},mathmlBuilder(e,t){var n=new th.MathNode("mo",[new th.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new th.MathNode("mover",[sh(e.body,t),n]);return r.setAttribute("accent","true"),r}}),Od({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:Pd(r)}},htmlBuilder:(e,t)=>{var n=qd(e.body,t.withPhantom(),!1);return Cd.makeFragment(n)},mathmlBuilder:(e,t)=>{var n=ih(e.body,t);return new th.MathNode("mphantom",n)}}),Od({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=Cd.makeSpan([],[Kd(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
|
|
420
|
+
;return n=Cd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t),Cd.makeSpan(["mord"],[n],t)},mathmlBuilder:(e,t)=>{var n=ih(Pd(e.body),t),r=new th.MathNode("mphantom",n),o=new th.MathNode("mpadded",[r]);return o.setAttribute("height","0px"),o.setAttribute("depth","0px"),o}}),Od({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=Cd.makeSpan(["inner"],[Kd(e.body,t.withPhantom())]),r=Cd.makeSpan(["fix"],[]);return Cd.makeSpan(["mord","rlap"],[n,r],t)},mathmlBuilder:(e,t)=>{var n=ih(Pd(e.body),t),r=new th.MathNode("mphantom",n),o=new th.MathNode("mpadded",[r]);return o.setAttribute("width","0px"),o}}),Od({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){var{parser:n}=e,r=gh(t[0],"size").value,o=t[1];return{type:"raisebox",mode:n.mode,dy:r,body:o}},htmlBuilder(e,t){var n=Kd(e.body,t),r=wu(e.dy,t)
|
|
421
|
+
;return Cd.makeVList({positionType:"shift",positionData:-r,children:[{type:"elem",elem:n}]},t)},mathmlBuilder(e,t){var n=new th.MathNode("mpadded",[sh(e.body,t)]),r=e.dy.number+e.dy.unit;return n.setAttribute("voffset",r),n}}),Od({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0},handler(e){var{parser:t}=e;return{type:"internal",mode:t.mode}}}),Od({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=gh(t[0],"size"),a=gh(t[1],"size");return{type:"rule",mode:r.mode,shift:o&&gh(o,"size").value,width:i.value,height:a.value}},htmlBuilder(e,t){var n=Cd.makeSpan(["mord","rule"],[],t),r=wu(e.width,t),o=wu(e.height,t),i=e.shift?wu(e.shift,t):0;return n.style.borderRightWidth=xu(r),n.style.borderTopWidth=xu(o),n.style.bottom=xu(i),n.width=r,n.height=o+i,n.depth=-i,n.maxFontSize=1.125*o*t.sizeMultiplier,n},mathmlBuilder(e,t){
|
|
422
|
+
var n=wu(e.width,t),r=wu(e.height,t),o=e.shift?wu(e.shift,t):0,i=t.color&&t.getColor()||"black",a=new th.MathNode("mspace");a.setAttribute("mathbackground",i),a.setAttribute("width",xu(n)),a.setAttribute("height",xu(r));var s=new th.MathNode("mpadded",[a]);return o>=0?s.setAttribute("height",xu(o)):(s.setAttribute("height",xu(o)),s.setAttribute("depth",xu(-o))),s.setAttribute("voffset",xu(o)),s}});var Up=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];Od({type:"sizing",names:Up,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:Up.indexOf(r)+1,body:i}},htmlBuilder:(e,t)=>{var n=t.havingSize(e.size);return jp(e.body,n,t)},mathmlBuilder:(e,t)=>{var n=t.havingSize(e.size),r=ih(e.body,n),o=new th.MathNode("mstyle",r);return o.setAttribute("mathsize",xu(n.sizeMultiplier)),o}}),Od({type:"smash",names:["\\smash"],props:{
|
|
423
|
+
numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,n)=>{var{parser:r}=e,o=!1,i=!1,a=n[0]&&gh(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=Cd.makeSpan([],[Kd(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=Cd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n}]},t);return Cd.makeSpan(["mord"],[i],t)},mathmlBuilder:(e,t)=>{var n=new th.MathNode("mpadded",[sh(e.body,t)]);return e.smashHeight&&n.setAttribute("height","0px"),e.smashDepth&&n.setAttribute("depth","0px"),n}}),Od({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,n){
|
|
424
|
+
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=Kd(e.body,t.havingCrampedStyle());0===n.height&&(n.height=t.fontMetrics().xHeight),n=Cd.wrapFragment(n,t);var r=t.fontMetrics().defaultRuleThickness,o=r;t.style.id<ru.TEXT.id&&(o=t.fontMetrics().xHeight);var i=r+o/4,a=n.height+n.depth+i+r,{span:s,ruleWidth:l,advanceWidth:c}=np.sqrtImage(a,t),u=s.height-l;u>n.height+n.depth+i&&(i=(i+u-n.height-n.depth)/2);var d=s.height-n.height-i-l;n.style.paddingLeft=xu(c);var h=Cd.makeVList({positionType:"firstBaseline",children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:-(n.height+d)},{type:"elem",elem:s},{type:"kern",size:l}]},t);if(e.index){var p=t.havingStyle(ru.SCRIPTSCRIPT),m=Kd(e.index,p,t),f=.6*(h.height-h.depth),g=Cd.makeVList({positionType:"shift",positionData:-f,children:[{type:"elem",elem:m}]},t),v=Cd.makeSpan(["root"],[g]);return Cd.makeSpan(["mord","sqrt"],[v,h],t)}return Cd.makeSpan(["mord","sqrt"],[h],t)},mathmlBuilder(e,t){
|
|
425
|
+
var{body:n,index:r}=e;return r?new th.MathNode("mroot",[sh(n,t),sh(r,t)]):new th.MathNode("msqrt",[sh(n,t)])}});var qp={display:ru.DISPLAY,text:ru.TEXT,script:ru.SCRIPT,scriptscript:ru.SCRIPTSCRIPT};Od({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=qp[e.style],r=t.havingStyle(n).withFont("");return jp(e.body,r,t)},mathmlBuilder(e,t){var n=qp[e.style],r=t.havingStyle(n),o=ih(e.body,r),i=new th.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}});Id({type:"supsub",htmlBuilder(e,t){var n=function(e,t){var n=e.base
|
|
426
|
+
;return n?"op"===n.type?n.limits&&(t.style.size===ru.DISPLAY.size||n.alwaysHandleSupSub)?Dp:null:"operatorname"===n.type?n.alwaysHandleSupSub&&(t.style.size===ru.DISPLAY.size||n.limits)?Hp:null:"accent"===n.type?Gc.isCharacterBox(n.base)?bh:null:"horizBrace"===n.type&&!e.sub===n.isOver?Lp:null:null}(e,t);if(n)return n(e,t);var r,o,i,{base:a,sup:s,sub:l}=e,c=Kd(a,t),u=t.fontMetrics(),d=0,h=0,p=a&&Gc.isCharacterBox(a);if(s){var m=t.havingStyle(t.style.sup());r=Kd(s,m,t),p||(d=c.height-m.fontMetrics().supDrop*m.sizeMultiplier/t.sizeMultiplier)}if(l){var f=t.havingStyle(t.style.sub());o=Kd(l,f,t),p||(h=c.depth+f.fontMetrics().subDrop*f.sizeMultiplier/t.sizeMultiplier)}i=t.style===ru.DISPLAY?u.sup1:t.style.cramped?u.sup3:u.sup2;var g,v=t.sizeMultiplier,_=xu(.5/u.ptPerEm/v),b=null;if(o){var y=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);(c instanceof Lu||y)&&(b=xu(-c.italic))}if(r&&o){d=Math.max(d,i,r.depth+.25*u.xHeight),h=Math.max(h,u.sub2)
|
|
427
|
+
;var w=4*u.defaultRuleThickness;if(d-r.depth-(o.height-h)<w){h=w-(d-r.depth)+o.height;var x=.8*u.xHeight-(d-r.depth);x>0&&(d+=x,h-=x)}var k=[{type:"elem",elem:o,shift:h,marginRight:_,marginLeft:b},{type:"elem",elem:r,shift:-d,marginRight:_}];g=Cd.makeVList({positionType:"individualShift",children:k},t)}else if(o){h=Math.max(h,u.sub1,o.height-.8*u.xHeight);var S=[{type:"elem",elem:o,marginLeft:b,marginRight:_}];g=Cd.makeVList({positionType:"shift",positionData:h,children:S},t)}else{if(!r)throw new Error("supsub must have either sup or sub.");d=Math.max(d,i,r.depth+.25*u.xHeight),g=Cd.makeVList({positionType:"shift",positionData:-d,children:[{type:"elem",elem:r,marginRight:_}]},t)}var C=Yd(c,"right")||"mord";return Cd.makeSpan([C],[c,Cd.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=[sh(e.base,t)]
|
|
428
|
+
;if(e.sub&&i.push(sh(e.sub,t)),e.sup&&i.push(sh(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===ru.DISPLAY||a&&"operatorname"===a.type&&a.alwaysHandleSupSub&&(t.style===ru.DISPLAY||a.limits)?"munderover":"msubsup"}else{var s=e.base;o=s&&"op"===s.type&&s.limits&&(t.style===ru.DISPLAY||s.alwaysHandleSupSub)||s&&"operatorname"===s.type&&s.alwaysHandleSupSub&&(s.limits||t.style===ru.DISPLAY)?"munder":"msub"}else{var l=e.base;o=l&&"op"===l.type&&l.limits&&(t.style===ru.DISPLAY||l.alwaysHandleSupSub)||l&&"operatorname"===l.type&&l.alwaysHandleSupSub&&(l.limits||t.style===ru.DISPLAY)?"mover":"msup"}return new th.MathNode(o,i)}}),Id({type:"atom",htmlBuilder:(e,t)=>Cd.mathsym(e.text,e.mode,t,["m"+e.family]),mathmlBuilder(e,t){var n=new th.MathNode("mo",[nh(e.text,e.mode)]);if("bin"===e.family){var r=oh(e,t);"bold-italic"===r&&n.setAttribute("mathvariant",r)
|
|
429
|
+
}else"punct"===e.family?n.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||n.setAttribute("stretchy","false");return n}});var $p={mi:"italic",mn:"normal",mtext:"normal"};Id({type:"mathord",htmlBuilder:(e,t)=>Cd.makeOrd(e,t,"mathord"),mathmlBuilder(e,t){var n=new th.MathNode("mi",[nh(e.text,e.mode,t)]),r=oh(e,t)||"italic";return r!==$p[n.type]&&n.setAttribute("mathvariant",r),n}}),Id({type:"textord",htmlBuilder:(e,t)=>Cd.makeOrd(e,t,"textord"),mathmlBuilder(e,t){var n,r=nh(e.text,e.mode,t),o=oh(e,t)||"normal";return n="text"===e.mode?new th.MathNode("mtext",[r]):/[0-9]/.test(e.text)?new th.MathNode("mn",[r]):"\\prime"===e.text?new th.MathNode("mo",[r]):new th.MathNode("mi",[r]),o!==$p[n.type]&&n.setAttribute("mathvariant",o),n}});var Gp={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Vp={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};Id({type:"spacing",htmlBuilder(e,t){if(Vp.hasOwnProperty(e.text)){var n=Vp[e.text].className||""
|
|
430
|
+
;if("text"===e.mode){var r=Cd.makeOrd(e,t,"textord");return r.classes.push(n),r}return Cd.makeSpan(["mspace",n],[Cd.mathsym(e.text,e.mode,t)],t)}if(Gp.hasOwnProperty(e.text))return Cd.makeSpan(["mspace",Gp[e.text]],[],t);throw new Hc('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){if(!Vp.hasOwnProperty(e.text)){if(Gp.hasOwnProperty(e.text))return new th.MathNode("mspace");throw new Hc('Unknown type of space "'+e.text+'"')}return new th.MathNode("mtext",[new th.TextNode(" ")])}});var Yp=()=>{var e=new th.MathNode("mtd",[]);return e.setAttribute("width","50%"),e};Id({type:"tag",mathmlBuilder(e,t){var n=new th.MathNode("mtable",[new th.MathNode("mtr",[Yp(),new th.MathNode("mtd",[ah(e.body,t)]),Yp(),new th.MathNode("mtd",[ah(e.tag,t)])])]);return n.setAttribute("width","100%"),n}});var Wp={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Kp={"\\textbf":"textbf","\\textmd":"textmd"},Xp={"\\textit":"textit","\\textup":"textup"},Zp=(e,t)=>{var n=e.font
|
|
431
|
+
;return n?Wp[n]?t.withTextFontFamily(Wp[n]):Kp[n]?t.withTextFontWeight(Kp[n]):t.withTextFontShape(Xp[n]):t};Od({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:Pd(o),font:r}},htmlBuilder(e,t){var n=Zp(e,t),r=qd(e.body,n,!0);return Cd.makeSpan(["mord","text"],r,n)},mathmlBuilder(e,t){var n=Zp(e,t);return ah(e.body,n)}}),Od({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=Kd(e.body,t),r=Cd.makeLineSpan("underline-line",t),o=t.fontMetrics().defaultRuleThickness,i=Cd.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 Cd.makeSpan(["mord","underline"],[i],t)
|
|
432
|
+
},mathmlBuilder(e,t){var n=new th.MathNode("mo",[new th.TextNode("‾")]);n.setAttribute("stretchy","true");var r=new th.MathNode("munder",[sh(e.body,t),n]);return r.setAttribute("accentunder","true"),r}}),Od({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=Kd(e.body,t),r=t.fontMetrics().axisHeight,o=.5*(n.height-r-(n.depth+r));return Cd.makeVList({positionType:"shift",positionData:o,children:[{type:"elem",elem:n}]},t)},mathmlBuilder:(e,t)=>new th.MathNode("mpadded",[sh(e.body,t)],["vcenter"])}),Od({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,n){throw new Hc("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){for(var n=Jp(e),r=[],o=t.havingStyle(t.style.text()),i=0;i<n.length;i++){var a=n[i];"~"===a&&(a="\\textasciitilde"),r.push(Cd.makeSymbol(a,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}
|
|
433
|
+
return Cd.makeSpan(["mord","text"].concat(o.sizingClasses(t)),Cd.tryCombineChars(r),o)},mathmlBuilder(e,t){var n=new th.TextNode(Jp(e)),r=new th.MathNode("mtext",[n]);return r.setAttribute("mathvariant","monospace"),r}});var Jp=e=>e.body.replace(/ /g,e.star?"␣":" "),Qp=Ld,em=new RegExp("[̀-ͯ]+$");class tm{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 Fc("EOF",new Bc(this,t,t));var n=this.tokenRegex.exec(e);if(null===n||n.index!==t)throw new Hc("Unexpected character: '"+e[t]+"'",new Fc(e[t],new Bc(this,t,t+1)));var r=n[6]||n[3]||(n[2]?"\\ ":" ")
|
|
434
|
+
;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 Fc(r,new Bc(this,t,this.tokenRegex.lastIndex))}}class nm{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 Hc("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){
|
|
435
|
+
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 rm=dp;hp("\\noexpand",(function(e){var t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}})),hp("\\expandafter",(function(e){var t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}})),hp("\\@firstoftwo",(function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}})),hp("\\@secondoftwo",(function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}})),hp("\\@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}})),
|
|
436
|
+
hp("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),hp("\\TextOrMath",(function(e){var t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}}));var om={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};hp("\\char",(function(e){var t,n=e.popToken(),r="";if("'"===n.text)t=8,n=e.popToken();else if('"'===n.text)t=16,n=e.popToken();else if("`"===n.text)if("\\"===(n=e.popToken()).text[0])r=n.text.charCodeAt(1);else{if("EOF"===n.text)throw new Hc("\\char` missing argument");r=n.text.charCodeAt(0)}else t=10;if(t){if(null==(r=om[n.text])||r>=t)throw new Hc("Invalid base-"+t+" digit "+n.text);for(var o;null!=(o=om[e.future().text])&&o<t;)r*=t,r+=o,e.popToken()}return"\\@char{"+r+"}"}));var im=(e,t,n)=>{var r=e.consumeArg().tokens;if(1!==r.length)throw new Hc("\\newcommand's first argument must be a macro name");var o=r[0].text,i=e.isDefined(o)
|
|
437
|
+
;if(i&&!t)throw new Hc("\\newcommand{"+o+"} attempting to redefine "+o+"; use \\renewcommand");if(!i&&!n)throw new Hc("\\renewcommand{"+o+"} when command "+o+" does not yet exist; use \\newcommand");var a=0;if(1===(r=e.consumeArg().tokens).length&&"["===r[0].text){for(var s="",l=e.expandNextToken();"]"!==l.text&&"EOF"!==l.text;)s+=l.text,l=e.expandNextToken();if(!s.match(/^\s*[0-9]+\s*$/))throw new Hc("Invalid number of arguments: "+s);a=parseInt(s),r=e.consumeArg().tokens}return e.macros.set(o,{tokens:r,numArgs:a}),""};hp("\\newcommand",(e=>im(e,!1,!0))),hp("\\renewcommand",(e=>im(e,!0,!1))),hp("\\providecommand",(e=>im(e,!0,!0))),hp("\\message",(e=>{var t=e.consumeArgs(1)[0];return console.log(t.reverse().map((e=>e.text)).join("")),""})),hp("\\errmessage",(e=>{var t=e.consumeArgs(1)[0];return console.error(t.reverse().map((e=>e.text)).join("")),""})),hp("\\show",(e=>{var t=e.popToken(),n=t.text;return console.log(t,e.macros.get(n),Qp[n],Bu.math[n],Bu.text[n]),""})),hp("\\bgroup","{"),hp("\\egroup","}"),
|
|
438
|
+
hp("~","\\nobreakspace"),hp("\\lq","`"),hp("\\rq","'"),hp("\\aa","\\r a"),hp("\\AA","\\r A"),hp("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`©}"),hp("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),hp("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}"),hp("ℬ","\\mathscr{B}"),hp("ℰ","\\mathscr{E}"),hp("ℱ","\\mathscr{F}"),hp("ℋ","\\mathscr{H}"),hp("ℐ","\\mathscr{I}"),hp("ℒ","\\mathscr{L}"),hp("ℳ","\\mathscr{M}"),hp("ℛ","\\mathscr{R}"),hp("ℭ","\\mathfrak{C}"),hp("ℌ","\\mathfrak{H}"),hp("ℨ","\\mathfrak{Z}"),hp("\\Bbbk","\\Bbb{k}"),hp("·","\\cdotp"),hp("\\llap","\\mathllap{\\textrm{#1}}"),hp("\\rlap","\\mathrlap{\\textrm{#1}}"),hp("\\clap","\\mathclap{\\textrm{#1}}"),hp("\\mathstrut","\\vphantom{(}"),hp("\\underbar","\\underline{\\text{#1}}"),hp("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}'),hp("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}"),hp("\\ne","\\neq"),hp("≠","\\neq"),
|
|
439
|
+
hp("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}"),hp("∉","\\notin"),hp("≘","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}"),hp("≙","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}"),hp("≚","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}"),hp("≛","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}"),hp("≝","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}"),hp("≞","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}"),hp("≟","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}"),hp("⟂","\\perp"),hp("‼","\\mathclose{!\\mkern-0.8mu!}"),hp("∌","\\notni"),hp("⌜","\\ulcorner"),hp("⌝","\\urcorner"),hp("⌞","\\llcorner"),hp("⌟","\\lrcorner"),hp("©","\\copyright"),hp("®","\\textregistered"),hp("️","\\textregistered"),hp("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),
|
|
440
|
+
hp("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),hp("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),hp("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),hp("\\vdots","\\mathord{\\varvdots\\rule{0pt}{15pt}}"),hp("⋮","\\vdots"),hp("\\varGamma","\\mathit{\\Gamma}"),hp("\\varDelta","\\mathit{\\Delta}"),hp("\\varTheta","\\mathit{\\Theta}"),hp("\\varLambda","\\mathit{\\Lambda}"),hp("\\varXi","\\mathit{\\Xi}"),hp("\\varPi","\\mathit{\\Pi}"),hp("\\varSigma","\\mathit{\\Sigma}"),hp("\\varUpsilon","\\mathit{\\Upsilon}"),hp("\\varPhi","\\mathit{\\Phi}"),hp("\\varPsi","\\mathit{\\Psi}"),hp("\\varOmega","\\mathit{\\Omega}"),hp("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),hp("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),hp("\\boxed","\\fbox{$\\displaystyle{#1}$}"),hp("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),hp("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),
|
|
441
|
+
hp("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;");var am={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi",
|
|
442
|
+
"\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"};hp("\\dots",(function(e){var t="\\dotso",n=e.expandAfterFuture().text;return n in am?t=am[n]:("\\not"===n.slice(0,4)||n in Bu.math&&Gc.contains(["bin","rel"],Bu.math[n].group))&&(t="\\dotsb"),t}));var sm={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};hp("\\dotso",(function(e){return e.future().text in sm?"\\ldots\\,":"\\ldots"})),hp("\\dotsc",(function(e){var t=e.future().text;return t in sm&&","!==t?"\\ldots\\,":"\\ldots"})),hp("\\cdots",(function(e){return e.future().text in sm?"\\@cdots\\,":"\\@cdots"})),hp("\\dotsb","\\cdots"),hp("\\dotsm","\\cdots"),hp("\\dotsi","\\!\\cdots"),hp("\\dotsx","\\ldots\\,"),hp("\\DOTSI","\\relax"),hp("\\DOTSB","\\relax"),hp("\\DOTSX","\\relax"),hp("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),hp("\\,","\\tmspace+{3mu}{.1667em}"),hp("\\thinspace","\\,"),
|
|
443
|
+
hp("\\>","\\mskip{4mu}"),hp("\\:","\\tmspace+{4mu}{.2222em}"),hp("\\medspace","\\:"),hp("\\;","\\tmspace+{5mu}{.2777em}"),hp("\\thickspace","\\;"),hp("\\!","\\tmspace-{3mu}{.1667em}"),hp("\\negthinspace","\\!"),hp("\\negmedspace","\\tmspace-{4mu}{.2222em}"),hp("\\negthickspace","\\tmspace-{5mu}{.277em}"),hp("\\enspace","\\kern.5em "),hp("\\enskip","\\hskip.5em\\relax"),hp("\\quad","\\hskip1em\\relax"),hp("\\qquad","\\hskip2em\\relax"),hp("\\tag","\\@ifstar\\tag@literal\\tag@paren"),hp("\\tag@paren","\\tag@literal{({#1})}"),hp("\\tag@literal",(e=>{if(e.macros.get("\\df@tag"))throw new Hc("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"})),hp("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),hp("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),hp("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),
|
|
444
|
+
hp("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),hp("\\newline","\\\\\\relax"),hp("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");var lm=xu(cu["Main-Regular"]["T".charCodeAt(0)][1]-.7*cu["Main-Regular"]["A".charCodeAt(0)][1]);hp("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+lm+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),hp("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+lm+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),hp("\\hspace","\\@ifstar\\@hspacer\\@hspace"),hp("\\@hspace","\\hskip #1\\relax"),hp("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),hp("\\ordinarycolon",":"),hp("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),hp("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),hp("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),
|
|
445
|
+
hp("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),hp("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),hp("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),hp("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),hp("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),hp("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),hp("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),hp("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),
|
|
446
|
+
hp("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),hp("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),hp("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),hp("∷","\\dblcolon"),hp("∹","\\eqcolon"),hp("≔","\\coloneqq"),hp("≕","\\eqqcolon"),hp("⩴","\\Coloneqq"),hp("\\ratio","\\vcentcolon"),hp("\\coloncolon","\\dblcolon"),hp("\\colonequals","\\coloneqq"),hp("\\coloncolonequals","\\Coloneqq"),hp("\\equalscolon","\\eqqcolon"),hp("\\equalscoloncolon","\\Eqqcolon"),hp("\\colonminus","\\coloneq"),hp("\\coloncolonminus","\\Coloneq"),hp("\\minuscolon","\\eqcolon"),hp("\\minuscoloncolon","\\Eqcolon"),hp("\\coloncolonapprox","\\Colonapprox"),hp("\\coloncolonsim","\\Colonsim"),hp("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),
|
|
447
|
+
hp("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),hp("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),hp("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),hp("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}"),hp("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),hp("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),hp("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),hp("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),hp("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),hp("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),hp("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),hp("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),hp("\\gvertneqq","\\html@mathml{\\@gvertneqq}{≩}"),hp("\\lvertneqq","\\html@mathml{\\@lvertneqq}{≨}"),hp("\\ngeqq","\\html@mathml{\\@ngeqq}{≱}"),hp("\\ngeqslant","\\html@mathml{\\@ngeqslant}{≱}"),hp("\\nleqq","\\html@mathml{\\@nleqq}{≰}"),
|
|
448
|
+
hp("\\nleqslant","\\html@mathml{\\@nleqslant}{≰}"),hp("\\nshortmid","\\html@mathml{\\@nshortmid}{∤}"),hp("\\nshortparallel","\\html@mathml{\\@nshortparallel}{∦}"),hp("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{⊈}"),hp("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{⊉}"),hp("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{⊊}"),hp("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{⫋}"),hp("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{⊋}"),hp("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{⫌}"),hp("\\imath","\\html@mathml{\\@imath}{ı}"),hp("\\jmath","\\html@mathml{\\@jmath}{ȷ}"),hp("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}"),hp("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}"),hp("⟦","\\llbracket"),hp("⟧","\\rrbracket"),hp("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}"),hp("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}"),hp("⦃","\\lBrace"),hp("⦄","\\rBrace"),
|
|
449
|
+
hp("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}"),hp("⦵","\\minuso"),hp("\\darr","\\downarrow"),hp("\\dArr","\\Downarrow"),hp("\\Darr","\\Downarrow"),hp("\\lang","\\langle"),hp("\\rang","\\rangle"),hp("\\uarr","\\uparrow"),hp("\\uArr","\\Uparrow"),hp("\\Uarr","\\Uparrow"),hp("\\N","\\mathbb{N}"),hp("\\R","\\mathbb{R}"),hp("\\Z","\\mathbb{Z}"),hp("\\alef","\\aleph"),hp("\\alefsym","\\aleph"),hp("\\Alpha","\\mathrm{A}"),hp("\\Beta","\\mathrm{B}"),hp("\\bull","\\bullet"),hp("\\Chi","\\mathrm{X}"),hp("\\clubs","\\clubsuit"),hp("\\cnums","\\mathbb{C}"),hp("\\Complex","\\mathbb{C}"),hp("\\Dagger","\\ddagger"),hp("\\diamonds","\\diamondsuit"),hp("\\empty","\\emptyset"),hp("\\Epsilon","\\mathrm{E}"),hp("\\Eta","\\mathrm{H}"),hp("\\exist","\\exists"),hp("\\harr","\\leftrightarrow"),hp("\\hArr","\\Leftrightarrow"),hp("\\Harr","\\Leftrightarrow"),hp("\\hearts","\\heartsuit"),hp("\\image","\\Im"),
|
|
450
|
+
hp("\\infin","\\infty"),hp("\\Iota","\\mathrm{I}"),hp("\\isin","\\in"),hp("\\Kappa","\\mathrm{K}"),hp("\\larr","\\leftarrow"),hp("\\lArr","\\Leftarrow"),hp("\\Larr","\\Leftarrow"),hp("\\lrarr","\\leftrightarrow"),hp("\\lrArr","\\Leftrightarrow"),hp("\\Lrarr","\\Leftrightarrow"),hp("\\Mu","\\mathrm{M}"),hp("\\natnums","\\mathbb{N}"),hp("\\Nu","\\mathrm{N}"),hp("\\Omicron","\\mathrm{O}"),hp("\\plusmn","\\pm"),hp("\\rarr","\\rightarrow"),hp("\\rArr","\\Rightarrow"),hp("\\Rarr","\\Rightarrow"),hp("\\real","\\Re"),hp("\\reals","\\mathbb{R}"),hp("\\Reals","\\mathbb{R}"),hp("\\Rho","\\mathrm{P}"),hp("\\sdot","\\cdot"),hp("\\sect","\\S"),hp("\\spades","\\spadesuit"),hp("\\sub","\\subset"),hp("\\sube","\\subseteq"),hp("\\supe","\\supseteq"),hp("\\Tau","\\mathrm{T}"),hp("\\thetasym","\\vartheta"),hp("\\weierp","\\wp"),hp("\\Zeta","\\mathrm{Z}"),hp("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),hp("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),hp("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),
|
|
451
|
+
hp("\\bra","\\mathinner{\\langle{#1}|}"),hp("\\ket","\\mathinner{|{#1}\\rangle}"),hp("\\braket","\\mathinner{\\langle{#1}\\rangle}"),hp("\\Bra","\\left\\langle#1\\right|"),hp("\\Ket","\\left|#1\\right\\rangle");var cm=e=>t=>{var n=t.consumeArg().tokens,r=t.consumeArg().tokens,o=t.consumeArg().tokens,i=t.consumeArg().tokens,a=t.macros.get("|"),s=t.macros.get("\\|");t.macros.beginGroup();var l=t=>n=>{e&&(n.macros.set("|",a),o.length&&n.macros.set("\\|",s));var i=t;!t&&o.length&&("|"===n.future().text&&(n.popToken(),i=!0));return{tokens:i?o:r,numArgs:0}};t.macros.set("|",l(!1)),o.length&&t.macros.set("\\|",l(!0));var c=t.consumeArg().tokens,u=t.expandTokens([...i,...c,...n]);return t.macros.endGroup(),{tokens:u.reverse(),numArgs:0}};hp("\\bra@ket",cm(!1)),hp("\\bra@set",cm(!0)),hp("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),hp("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),
|
|
452
|
+
hp("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),hp("\\angln","{\\angl n}"),hp("\\blue","\\textcolor{##6495ed}{#1}"),hp("\\orange","\\textcolor{##ffa500}{#1}"),hp("\\pink","\\textcolor{##ff00af}{#1}"),hp("\\red","\\textcolor{##df0030}{#1}"),hp("\\green","\\textcolor{##28ae7b}{#1}"),hp("\\gray","\\textcolor{gray}{#1}"),hp("\\purple","\\textcolor{##9d38bd}{#1}"),hp("\\blueA","\\textcolor{##ccfaff}{#1}"),hp("\\blueB","\\textcolor{##80f6ff}{#1}"),hp("\\blueC","\\textcolor{##63d9ea}{#1}"),hp("\\blueD","\\textcolor{##11accd}{#1}"),hp("\\blueE","\\textcolor{##0c7f99}{#1}"),hp("\\tealA","\\textcolor{##94fff5}{#1}"),hp("\\tealB","\\textcolor{##26edd5}{#1}"),hp("\\tealC","\\textcolor{##01d1c1}{#1}"),hp("\\tealD","\\textcolor{##01a995}{#1}"),hp("\\tealE","\\textcolor{##208170}{#1}"),hp("\\greenA","\\textcolor{##b6ffb0}{#1}"),hp("\\greenB","\\textcolor{##8af281}{#1}"),hp("\\greenC","\\textcolor{##74cf70}{#1}"),hp("\\greenD","\\textcolor{##1fab54}{#1}"),hp("\\greenE","\\textcolor{##0d923f}{#1}"),
|
|
453
|
+
hp("\\goldA","\\textcolor{##ffd0a9}{#1}"),hp("\\goldB","\\textcolor{##ffbb71}{#1}"),hp("\\goldC","\\textcolor{##ff9c39}{#1}"),hp("\\goldD","\\textcolor{##e07d10}{#1}"),hp("\\goldE","\\textcolor{##a75a05}{#1}"),hp("\\redA","\\textcolor{##fca9a9}{#1}"),hp("\\redB","\\textcolor{##ff8482}{#1}"),hp("\\redC","\\textcolor{##f9685d}{#1}"),hp("\\redD","\\textcolor{##e84d39}{#1}"),hp("\\redE","\\textcolor{##bc2612}{#1}"),hp("\\maroonA","\\textcolor{##ffbde0}{#1}"),hp("\\maroonB","\\textcolor{##ff92c6}{#1}"),hp("\\maroonC","\\textcolor{##ed5fa6}{#1}"),hp("\\maroonD","\\textcolor{##ca337c}{#1}"),hp("\\maroonE","\\textcolor{##9e034e}{#1}"),hp("\\purpleA","\\textcolor{##ddd7ff}{#1}"),hp("\\purpleB","\\textcolor{##c6b9fc}{#1}"),hp("\\purpleC","\\textcolor{##aa87ff}{#1}"),hp("\\purpleD","\\textcolor{##7854ab}{#1}"),hp("\\purpleE","\\textcolor{##543b78}{#1}"),hp("\\mintA","\\textcolor{##f5f9e8}{#1}"),hp("\\mintB","\\textcolor{##edf2df}{#1}"),hp("\\mintC","\\textcolor{##e0e5cc}{#1}"),hp("\\grayA","\\textcolor{##f6f7f7}{#1}"),
|
|
454
|
+
hp("\\grayB","\\textcolor{##f0f1f2}{#1}"),hp("\\grayC","\\textcolor{##e3e5e6}{#1}"),hp("\\grayD","\\textcolor{##d6d8da}{#1}"),hp("\\grayE","\\textcolor{##babec2}{#1}"),hp("\\grayF","\\textcolor{##888d93}{#1}"),hp("\\grayG","\\textcolor{##626569}{#1}"),hp("\\grayH","\\textcolor{##3b3e40}{#1}"),hp("\\grayI","\\textcolor{##21242c}{#1}"),hp("\\kaBlue","\\textcolor{##314453}{#1}"),hp("\\kaGreen","\\textcolor{##71B307}{#1}");var um={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class dm{constructor(e,t,n){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new nm(rm,t.macros),this.mode=n,this.stack=[]}feed(e){this.lexer=new tm(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){
|
|
455
|
+
return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){var t,n,r;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:r,end:n}=this.consumeArg(["]"]))}else({tokens:r,start:t,end:n}=this.consumeArg());return this.pushToken(new Fc("EOF",n.loc)),this.pushTokens(r),t.range(n,"")}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){var t=[],n=e&&e.length>0;n||this.consumeSpaces();var r,o=this.future(),i=0,a=0;do{if(r=this.popToken(),t.push(r),"{"===r.text)++i;else if("}"===r.text){if(-1===--i)throw new Hc("Extra }",r)}else if("EOF"===r.text)throw new Hc("Unexpected end of input in a macro argument, expected '"+(e&&n?e[a]:"}")+"'",r);if(e&&n)if((0===i||1===i&&"{"===e[a])&&r.text===e[a]){if(++a===e.length){t.splice(-a,a);break}}else a=0}while(0!==i||n);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:r}}consumeArgs(e,t){
|
|
456
|
+
if(t){if(t.length!==e+1)throw new Hc("The length of delimiters doesn't match the number of args!");for(var n=t[0],r=0;r<n.length;r++){var o=this.popToken();if(n[r]!==o.text)throw new Hc("Use of the macro doesn't match its definition",o)}}for(var i=[],a=0;a<e;a++)i.push(this.consumeArg(t&&t[a+1]).tokens);return i}expandOnce(e){var t=this.popToken(),n=t.text,r=t.noexpand?null:this._getExpansion(n);if(null==r||e&&r.unexpandable){if(e&&null==r&&"\\"===n[0]&&!this.isDefined(n))throw new Hc("Undefined control sequence: "+n);return this.pushToken(t),t}if(this.expansionCount++,this.expansionCount>this.settings.maxExpand)throw new Hc("Too many expansions: infinite loop or need to increase maxExpand setting");var o=r.tokens,i=this.consumeArgs(r.numArgs,r.delimiters);if(r.numArgs)for(var a=(o=o.slice()).length-1;a>=0;--a){var s=o[a];if("#"===s.text){if(0===a)throw new Hc("Incomplete placeholder at end of macro body",s);if("#"===(s=o[--a]).text)o.splice(a+1,1);else{
|
|
457
|
+
if(!/^[1-9]$/.test(s.text))throw new Hc("Not a valid argument number",s);o.splice(a,2,...i[+s.text-1])}}}return this.pushTokens(o),o}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;){var e=this.expandOnce();if(e instanceof Fc)return e.treatAsRelax&&(e.text="\\relax"),this.stack.pop()}throw new Error}expandMacro(e){return this.macros.has(e)?this.expandTokens([new Fc(e)]):void 0}expandTokens(e){var t=[],n=this.stack.length;for(this.pushTokens(e);this.stack.length>n;){var r=this.expandOnce(!0);r instanceof Fc&&(r.treatAsRelax&&(r.noexpand=!1,r.treatAsRelax=!1),t.push(this.stack.pop()))}return t}expandMacroAsText(e){var t=this.expandMacro(e);return t?t.map((e=>e.text)).join(""):t}_getExpansion(e){var t=this.macros.get(e);if(null==t)return t;if(1===e.length){var n=this.lexer.catcodes[e];if(null!=n&&13!==n)return}var r="function"==typeof t?t(this):t;if("string"==typeof r){var o=0;if(-1!==r.indexOf("#"))for(var i=r.replace(/##/g,"");-1!==i.indexOf("#"+(o+1));)++o
|
|
458
|
+
;for(var a=new tm(r,this.settings),s=[],l=a.lex();"EOF"!==l.text;)s.push(l),l=a.lex();return s.reverse(),{tokens:s,numArgs:o}}return r}isDefined(e){return this.macros.has(e)||Qp.hasOwnProperty(e)||Bu.math.hasOwnProperty(e)||Bu.text.hasOwnProperty(e)||um.hasOwnProperty(e)}isExpandable(e){var t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:Qp.hasOwnProperty(e)&&!Qp[e].primitive}}var hm=/^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/,pm=Object.freeze({"₊":"+","₋":"-","₌":"=","₍":"(","₎":")","₀":"0","₁":"1","₂":"2","₃":"3","₄":"4","₅":"5","₆":"6","₇":"7","₈":"8","₉":"9","ₐ":"a","ₑ":"e","ₕ":"h","ᵢ":"i","ⱼ":"j","ₖ":"k","ₗ":"l","ₘ":"m","ₙ":"n","ₒ":"o","ₚ":"p","ᵣ":"r","ₛ":"s","ₜ":"t","ᵤ":"u","ᵥ":"v","ₓ":"x","ᵦ":"β","ᵧ":"γ","ᵨ":"ρ","ᵩ":"ϕ","ᵪ":"χ","⁺":"+","⁻":"-","⁼":"=","⁽":"(","⁾":")","⁰":"0","¹":"1","²":"2","³":"3","⁴":"4","⁵":"5","⁶":"6","⁷":"7","⁸":"8","⁹":"9","ᴬ":"A","ᴮ":"B","ᴰ":"D","ᴱ":"E","ᴳ":"G","ᴴ":"H","ᴵ":"I","ᴶ":"J","ᴷ":"K","ᴸ":"L","ᴹ":"M","ᴺ":"N","ᴼ":"O","ᴾ":"P",
|
|
459
|
+
"ᴿ":"R","ᵀ":"T","ᵁ":"U","ⱽ":"V","ᵂ":"W","ᵃ":"a","ᵇ":"b","ᶜ":"c","ᵈ":"d","ᵉ":"e","ᶠ":"f","ᵍ":"g","ʰ":"h","ⁱ":"i","ʲ":"j","ᵏ":"k","ˡ":"l","ᵐ":"m","ⁿ":"n","ᵒ":"o","ᵖ":"p","ʳ":"r","ˢ":"s","ᵗ":"t","ᵘ":"u","ᵛ":"v","ʷ":"w","ˣ":"x","ʸ":"y","ᶻ":"z","ᵝ":"β","ᵞ":"γ","ᵟ":"δ","ᵠ":"ϕ","ᵡ":"χ","ᶿ":"θ"}),mm={"́":{text:"\\'",math:"\\acute"},"̀":{text:"\\`",math:"\\grave"},"̈":{text:'\\"',math:"\\ddot"},"̃":{text:"\\~",math:"\\tilde"},"̄":{text:"\\=",math:"\\bar"},"̆":{text:"\\u",math:"\\breve"},"̌":{text:"\\v",math:"\\check"},"̂":{text:"\\^",math:"\\hat"},"̇":{text:"\\.",math:"\\dot"},"̊":{text:"\\r",math:"\\mathring"},"̋":{text:"\\H"},"̧":{text:"\\c"}},fm={"á":"á","à":"à","ä":"ä","ǟ":"ǟ","ã":"ã","ā":"ā","ă":"ă","ắ":"ắ","ằ":"ằ","ẵ":"ẵ","ǎ":"ǎ","â":"â","ấ":"ấ","ầ":"ầ","ẫ":"ẫ","ȧ":"ȧ","ǡ":"ǡ","å":"å","ǻ":"ǻ","ḃ":"ḃ","ć":"ć","ḉ":"ḉ","č":"č","ĉ":"ĉ","ċ":"ċ","ç":"ç","ď":"ď","ḋ":"ḋ","ḑ":"ḑ","é":"é","è":"è","ë":"ë","ẽ":"ẽ","ē":"ē","ḗ":"ḗ","ḕ":"ḕ","ĕ":"ĕ","ḝ":"ḝ","ě":"ě","ê":"ê",
|
|
459
460
|
"ế":"ế","ề":"ề","ễ":"ễ","ė":"ė","ȩ":"ȩ","ḟ":"ḟ","ǵ":"ǵ","ḡ":"ḡ","ğ":"ğ","ǧ":"ǧ","ĝ":"ĝ","ġ":"ġ","ģ":"ģ","ḧ":"ḧ","ȟ":"ȟ","ĥ":"ĥ","ḣ":"ḣ","ḩ":"ḩ","í":"í","ì":"ì","ï":"ï","ḯ":"ḯ","ĩ":"ĩ","ī":"ī","ĭ":"ĭ","ǐ":"ǐ","î":"î","ǰ":"ǰ","ĵ":"ĵ","ḱ":"ḱ","ǩ":"ǩ","ķ":"ķ","ĺ":"ĺ","ľ":"ľ","ļ":"ļ","ḿ":"ḿ","ṁ":"ṁ","ń":"ń","ǹ":"ǹ","ñ":"ñ","ň":"ň","ṅ":"ṅ","ņ":"ņ","ó":"ó","ò":"ò","ö":"ö","ȫ":"ȫ","õ":"õ","ṍ":"ṍ","ṏ":"ṏ","ȭ":"ȭ","ō":"ō","ṓ":"ṓ","ṑ":"ṑ","ŏ":"ŏ","ǒ":"ǒ","ô":"ô","ố":"ố","ồ":"ồ","ỗ":"ỗ","ȯ":"ȯ","ȱ":"ȱ","ő":"ő","ṕ":"ṕ","ṗ":"ṗ","ŕ":"ŕ","ř":"ř","ṙ":"ṙ","ŗ":"ŗ","ś":"ś","ṥ":"ṥ","š":"š","ṧ":"ṧ","ŝ":"ŝ","ṡ":"ṡ","ş":"ş","ẗ":"ẗ","ť":"ť","ṫ":"ṫ","ţ":"ţ","ú":"ú","ù":"ù","ü":"ü","ǘ":"ǘ","ǜ":"ǜ","ǖ":"ǖ","ǚ":"ǚ","ũ":"ũ","ṹ":"ṹ","ū":"ū","ṻ":"ṻ","ŭ":"ŭ","ǔ":"ǔ","û":"û","ů":"ů","ű":"ű","ṽ":"ṽ","ẃ":"ẃ","ẁ":"ẁ","ẅ":"ẅ","ŵ":"ŵ","ẇ":"ẇ","ẘ":"ẘ","ẍ":"ẍ","ẋ":"ẋ","ý":"ý","ỳ":"ỳ","ÿ":"ÿ","ỹ":"ỹ","ȳ":"ȳ","ŷ":"ŷ",
|
|
460
461
|
"ẏ":"ẏ","ẙ":"ẙ","ź":"ź","ž":"ž","ẑ":"ẑ","ż":"ż","Á":"Á","À":"À","Ä":"Ä","Ǟ":"Ǟ","Ã":"Ã","Ā":"Ā","Ă":"Ă","Ắ":"Ắ","Ằ":"Ằ","Ẵ":"Ẵ","Ǎ":"Ǎ","Â":"Â","Ấ":"Ấ","Ầ":"Ầ","Ẫ":"Ẫ","Ȧ":"Ȧ","Ǡ":"Ǡ","Å":"Å","Ǻ":"Ǻ","Ḃ":"Ḃ","Ć":"Ć","Ḉ":"Ḉ","Č":"Č","Ĉ":"Ĉ","Ċ":"Ċ","Ç":"Ç","Ď":"Ď","Ḋ":"Ḋ","Ḑ":"Ḑ","É":"É","È":"È","Ë":"Ë","Ẽ":"Ẽ","Ē":"Ē","Ḗ":"Ḗ","Ḕ":"Ḕ","Ĕ":"Ĕ","Ḝ":"Ḝ","Ě":"Ě","Ê":"Ê","Ế":"Ế","Ề":"Ề","Ễ":"Ễ","Ė":"Ė","Ȩ":"Ȩ","Ḟ":"Ḟ","Ǵ":"Ǵ","Ḡ":"Ḡ","Ğ":"Ğ","Ǧ":"Ǧ","Ĝ":"Ĝ","Ġ":"Ġ","Ģ":"Ģ","Ḧ":"Ḧ","Ȟ":"Ȟ","Ĥ":"Ĥ","Ḣ":"Ḣ","Ḩ":"Ḩ","Í":"Í","Ì":"Ì","Ï":"Ï","Ḯ":"Ḯ","Ĩ":"Ĩ","Ī":"Ī","Ĭ":"Ĭ","Ǐ":"Ǐ","Î":"Î","İ":"İ","Ĵ":"Ĵ","Ḱ":"Ḱ","Ǩ":"Ǩ","Ķ":"Ķ","Ĺ":"Ĺ","Ľ":"Ľ","Ļ":"Ļ","Ḿ":"Ḿ","Ṁ":"Ṁ","Ń":"Ń","Ǹ":"Ǹ","Ñ":"Ñ","Ň":"Ň","Ṅ":"Ṅ","Ņ":"Ņ","Ó":"Ó","Ò":"Ò","Ö":"Ö","Ȫ":"Ȫ","Õ":"Õ","Ṍ":"Ṍ","Ṏ":"Ṏ","Ȭ":"Ȭ","Ō":"Ō","Ṓ":"Ṓ","Ṑ":"Ṑ","Ŏ":"Ŏ","Ǒ":"Ǒ","Ô":"Ô","Ố":"Ố","Ồ":"Ồ","Ỗ":"Ỗ","Ȯ":"Ȯ","Ȱ":"Ȱ","Ő":"Ő","Ṕ":"Ṕ",
|
|
461
|
-
"Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class
|
|
462
|
-
this.fetch().text!==e)throw new
|
|
463
|
-
;"internal"!==o.type&&n.push(o)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++)if("infix"===e[r].type){if(-1!==n)throw new
|
|
464
|
-
var t,n,r=this.parseGroup("atom",e);if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type){var i="\\limits"===o.text;r.limits=i,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new
|
|
465
|
-
var u=this.fetch().text;if(!
|
|
466
|
-
;for(var r=[],o=[],i=0;i<n;i++){var a=t.argTypes&&t.argTypes[i],s=i<t.numOptionalArgs;(t.primitive&&null==a||"sqrt"===t.type&&1===i&&null==o[0])&&(a="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",a,s);if(s)o.push(l);else{if(null==l)throw new
|
|
467
|
-
return this.parseArgumentGroup(n);default:throw new
|
|
468
|
-
!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new
|
|
469
|
-
mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:
|
|
470
|
-
text:o+o}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new
|
|
471
|
-
type:s,mode:this.mode,loc:l,text:t};o=a}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(
|
|
472
|
-
;if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new
|
|
473
|
-
return
|
|
462
|
+
"Ṗ":"Ṗ","Ŕ":"Ŕ","Ř":"Ř","Ṙ":"Ṙ","Ŗ":"Ŗ","Ś":"Ś","Ṥ":"Ṥ","Š":"Š","Ṧ":"Ṧ","Ŝ":"Ŝ","Ṡ":"Ṡ","Ş":"Ş","Ť":"Ť","Ṫ":"Ṫ","Ţ":"Ţ","Ú":"Ú","Ù":"Ù","Ü":"Ü","Ǘ":"Ǘ","Ǜ":"Ǜ","Ǖ":"Ǖ","Ǚ":"Ǚ","Ũ":"Ũ","Ṹ":"Ṹ","Ū":"Ū","Ṻ":"Ṻ","Ŭ":"Ŭ","Ǔ":"Ǔ","Û":"Û","Ů":"Ů","Ű":"Ű","Ṽ":"Ṽ","Ẃ":"Ẃ","Ẁ":"Ẁ","Ẅ":"Ẅ","Ŵ":"Ŵ","Ẇ":"Ẇ","Ẍ":"Ẍ","Ẋ":"Ẋ","Ý":"Ý","Ỳ":"Ỳ","Ÿ":"Ÿ","Ỹ":"Ỹ","Ȳ":"Ȳ","Ŷ":"Ŷ","Ẏ":"Ẏ","Ź":"Ź","Ž":"Ž","Ẑ":"Ẑ","Ż":"Ż","ά":"ά","ὰ":"ὰ","ᾱ":"ᾱ","ᾰ":"ᾰ","έ":"έ","ὲ":"ὲ","ή":"ή","ὴ":"ὴ","ί":"ί","ὶ":"ὶ","ϊ":"ϊ","ΐ":"ΐ","ῒ":"ῒ","ῑ":"ῑ","ῐ":"ῐ","ό":"ό","ὸ":"ὸ","ύ":"ύ","ὺ":"ὺ","ϋ":"ϋ","ΰ":"ΰ","ῢ":"ῢ","ῡ":"ῡ","ῠ":"ῠ","ώ":"ώ","ὼ":"ὼ","Ύ":"Ύ","Ὺ":"Ὺ","Ϋ":"Ϋ","Ῡ":"Ῡ","Ῠ":"Ῠ","Ώ":"Ώ","Ὼ":"Ὼ"};class gm{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new dm(e,t,this.mode),this.settings=t,this.leftrightDepth=0}expect(e,t){if(void 0===t&&(t=!0),
|
|
463
|
+
this.fetch().text!==e)throw new Hc("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{var e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){var t=this.nextToken;this.consume(),this.gullet.pushToken(new Fc("}")),this.gullet.pushTokens(e);var n=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,n}parseExpression(e,t){for(var n=[];;){"math"===this.mode&&this.consumeSpaces();var r=this.fetch();if(-1!==gm.endOfExpression.indexOf(r.text))break;if(t&&r.text===t)break;if(e&&Qp[r.text]&&Qp[r.text].infix)break;var o=this.parseAtom(t);if(!o)break
|
|
464
|
+
;"internal"!==o.type&&n.push(o)}return"text"===this.mode&&this.formLigatures(n),this.handleInfixNodes(n)}handleInfixNodes(e){for(var t,n=-1,r=0;r<e.length;r++)if("infix"===e[r].type){if(-1!==n)throw new Hc("only one infix operator per group",e[r].token);n=r,t=e[r].replaceWith}if(-1!==n&&t){var o,i,a=e.slice(0,n),s=e.slice(n+1);return o=1===a.length&&"ordgroup"===a[0].type?a[0]:{type:"ordgroup",mode:this.mode,body:a},i=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},["\\\\abovefrac"===t?this.callFunction(t,[o,e[n],i],[]):this.callFunction(t,[o,i],[])]}return e}handleSupSubscript(e){var t=this.fetch(),n=t.text;this.consume(),this.consumeSpaces();var r=this.parseGroup(e);if(!r)throw new Hc("Expected group after '"+n+"'",t);return r}formatUnsupportedCmd(e){for(var t=[],n=0;n<e.length;n++)t.push({type:"textord",mode:"text",text:e[n]});var r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){
|
|
465
|
+
var t,n,r=this.parseGroup("atom",e);if("text"===this.mode)return r;for(;;){this.consumeSpaces();var o=this.fetch();if("\\limits"===o.text||"\\nolimits"===o.text){if(r&&"op"===r.type){var i="\\limits"===o.text;r.limits=i,r.alwaysHandleSupSub=!0}else{if(!r||"operatorname"!==r.type)throw new Hc("Limit controls must follow a math operator",o);r.alwaysHandleSupSub&&(r.limits="\\limits"===o.text)}this.consume()}else if("^"===o.text){if(t)throw new Hc("Double superscript",o);t=this.handleSupSubscript("superscript")}else if("_"===o.text){if(n)throw new Hc("Double subscript",o);n=this.handleSupSubscript("subscript")}else if("'"===o.text){if(t)throw new Hc("Double superscript",o);var a={type:"textord",mode:this.mode,text:"\\prime"},s=[a];for(this.consume();"'"===this.fetch().text;)s.push(a),this.consume();"^"===this.fetch().text&&s.push(this.handleSupSubscript("superscript")),t={type:"ordgroup",mode:this.mode,body:s}}else{if(!pm[o.text])break;var l=pm[o.text],c=hm.test(o.text);for(this.consume();;){
|
|
466
|
+
var u=this.fetch().text;if(!pm[u])break;if(hm.test(u)!==c)break;this.consume(),l+=pm[u]}var d=new gm(l,this.settings).parse();c?n={type:"ordgroup",mode:"math",body:d}:t={type:"ordgroup",mode:"math",body:d}}}return t||n?{type:"supsub",mode:this.mode,base:r,sup:t,sub:n}:r}parseFunction(e,t){var n=this.fetch(),r=n.text,o=Qp[r];if(!o)return null;if(this.consume(),t&&"atom"!==t&&!o.allowedInArgument)throw new Hc("Got function '"+r+"' with no arguments"+(t?" as "+t:""),n);if("text"===this.mode&&!o.allowedInText)throw new Hc("Can't use function '"+r+"' in text mode",n);if("math"===this.mode&&!1===o.allowedInMath)throw new Hc("Can't use function '"+r+"' in math mode",n);var{args:i,optArgs:a}=this.parseArguments(r,o);return this.callFunction(r,i,a,n,e)}callFunction(e,t,n,r,o){var i={funcName:e,parser:this,token:r,breakOnTokenText:o},a=Qp[e];if(a&&a.handler)return a.handler(i,t,n);throw new Hc("No function handler for "+e)}parseArguments(e,t){var n=t.numArgs+t.numOptionalArgs;if(0===n)return{args:[],optArgs:[]}
|
|
467
|
+
;for(var r=[],o=[],i=0;i<n;i++){var a=t.argTypes&&t.argTypes[i],s=i<t.numOptionalArgs;(t.primitive&&null==a||"sqrt"===t.type&&1===i&&null==o[0])&&(a="primitive");var l=this.parseGroupOfType("argument to '"+e+"'",a,s);if(s)o.push(l);else{if(null==l)throw new Hc("Null argument, please report this as a bug");r.push(l)}}return{args:r,optArgs:o}}parseGroupOfType(e,t,n){switch(t){case"color":return this.parseColorGroup(n);case"size":return this.parseSizeGroup(n);case"url":return this.parseUrlGroup(n);case"math":case"text":return this.parseArgumentGroup(n,t);case"hbox":var r=this.parseArgumentGroup(n,"text");return null!=r?{type:"styling",mode:r.mode,body:[r],style:"text"}:null;case"raw":var o=this.parseStringGroup("raw",n);return null!=o?{type:"raw",mode:"text",string:o.text}:null;case"primitive":if(n)throw new Hc("A primitive argument cannot be optional");var i=this.parseGroup(e);if(null==i)throw new Hc("Expected group as "+e,this.fetch());return i;case"original":case null:case void 0:
|
|
468
|
+
return this.parseArgumentGroup(n);default:throw new Hc("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){var n=this.gullet.scanArgument(t);if(null==n)return null;for(var r,o="";"EOF"!==(r=this.fetch()).text;)o+=r.text,this.consume();return this.consume(),n.text=o,n}parseRegexGroup(e,t){for(var n,r=this.fetch(),o=r,i="";"EOF"!==(n=this.fetch()).text&&e.test(i+n.text);)i+=(o=n).text,this.consume();if(""===i)throw new Hc("Invalid "+t+": '"+r.text+"'",r);return r.range(o,i)}parseColorGroup(e){var t=this.parseStringGroup("color",e);if(null==t)return null;var n=/^(#[a-f0-9]{3}|#?[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!n)throw new Hc("Invalid color: '"+t.text+"'",t);var r=n[0];return/^[0-9a-f]{6}$/i.test(r)&&(r="#"+r),{type:"color-token",mode:this.mode,color:r}}parseSizeGroup(e){var t,n=!1;if(this.gullet.consumeSpaces(),
|
|
469
|
+
!(t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size")))return null;e||0!==t.text.length||(t.text="0pt",n=!0);var r=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!r)throw new Hc("Invalid size: '"+t.text+"'",t);var o={number:+(r[1]+r[2]),unit:r[3]};if(!yu(o))throw new Hc("Invalid unit: '"+o.unit+"'",t);return{type:"size",mode:this.mode,value:o,isBlank:n}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);var t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;var n=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:n}}parseArgumentGroup(e,t){var n=this.gullet.scanArgument(e);if(null==n)return null;var r=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();var o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();var i={type:"ordgroup",
|
|
470
|
+
mode:this.mode,loc:n.loc,body:o};return t&&this.switchMode(r),i}parseGroup(e,t){var n,r=this.fetch(),o=r.text;if("{"===o||"\\begingroup"===o){this.consume();var i="{"===o?"}":"\\endgroup";this.gullet.beginGroup();var a=this.parseExpression(!1,i),s=this.fetch();this.expect(i),this.gullet.endGroup(),n={type:"ordgroup",mode:this.mode,loc:Bc.range(r,s),body:a,semisimple:"\\begingroup"===o||void 0}}else if(null==(n=this.parseFunction(t,e)||this.parseSymbol())&&"\\"===o[0]&&!um.hasOwnProperty(o)){if(this.settings.throwOnError)throw new Hc("Undefined control sequence: "+o,r);n=this.formatUnsupportedCmd(o),this.consume()}return n}formLigatures(e){for(var t=e.length-1,n=0;n<t;++n){var r=e[n],o=r.text;"-"===o&&"-"===e[n+1].text&&(n+1<t&&"-"===e[n+2].text?(e.splice(n,3,{type:"textord",mode:"text",loc:Bc.range(r,e[n+2]),text:"---"}),t-=2):(e.splice(n,2,{type:"textord",mode:"text",loc:Bc.range(r,e[n+1]),text:"--"}),t-=1)),"'"!==o&&"`"!==o||e[n+1].text!==o||(e.splice(n,2,{type:"textord",mode:"text",loc:Bc.range(r,e[n+1]),
|
|
471
|
+
text:o+o}),t-=1)}}parseSymbol(){var e=this.fetch(),t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();var n=t.slice(5),r="*"===n.charAt(0);if(r&&(n=n.slice(1)),n.length<2||n.charAt(0)!==n.slice(-1))throw new Hc("\\verb assertion failed --\n please report what input caused this bug");return{type:"verb",mode:"text",body:n=n.slice(1,-1),star:r}}fm.hasOwnProperty(t[0])&&!Bu[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=fm[t[0]]+t.slice(1));var o,i=em.exec(t);if(i&&("i"===(t=t.substring(0,i.index))?t="ı":"j"===t&&(t="ȷ")),Bu[this.mode][t]){this.settings.strict&&"math"===this.mode&&"ÐÞþ".indexOf(t)>=0&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);var a,s=Bu[this.mode][t].group,l=Bc.range(e);if(Du.hasOwnProperty(s)){var c=s;a={type:"atom",mode:this.mode,family:c,loc:l,text:t}}else a={
|
|
472
|
+
type:s,mode:this.mode,loc:l,text:t};o=a}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(au(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:Bc.range(e),text:t}}if(this.consume(),i)for(var u=0;u<i[0].length;u++){var d=i[0][u];if(!mm[d])throw new Hc("Unknown accent ' "+d+"'",e);var h=mm[d][this.mode]||mm[d].text;if(!h)throw new Hc("Accent "+d+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:Bc.range(e),label:h,isStretchy:!1,isShifty:!0,base:o}}return o}}gm.endOfExpression=["}","\\endgroup","\\end","\\right","&"];var vm=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");var n=new gm(e,t);delete n.gullet.macros.current["\\df@tag"];var r=n.parse()
|
|
473
|
+
;if(delete n.gullet.macros.current["\\current@color"],delete n.gullet.macros.current["\\color"],n.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new Hc("\\tag works only in display equations");r=[{type:"tag",mode:"text",body:r,tag:n.subparse([new Fc("\\df@tag")])}]}return r};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."));var _m=function(e,t,n){if(n.throwOnError||!(e instanceof Hc))throw e;var r=Cd.makeSpan(["katex-error"],[new Lu(t)]);return r.setAttribute("title",e.toString()),r.setAttribute("style","color:"+n.errorColor),r},bm=function(e,t){var n=new Wc(t);try{return function(e,t,n){var r,o=ch(n);if("mathml"===n.output)return lh(e,t,o,n.displayMode,!0);if("html"===n.output){var i=Zd(e,o);r=Cd.makeSpan(["katex"],[i])}else{var a=lh(e,t,o,n.displayMode,!1),s=Zd(e,o);r=Cd.makeSpan(["katex"],[a,s])}return uh(r,n)}(vm(e,n),e,n)}catch(t){
|
|
474
|
+
return _m(t,e,n)}},ym=function(e,t){return bm(e,t).toMarkup()},wm={exports:{}};!function(e){(function(){function t(e){var t={omitExtraWLInCodeBlocks:{defaultValue:!1,describe:"Omit the default extra whiteline added to code blocks",type:"boolean"},noHeaderId:{defaultValue:!1,describe:"Turn on/off generated header id",type:"boolean"},prefixHeaderId:{defaultValue:!1,describe:"Add a prefix to the generated header ids. Passing a string will prefix that string to the header id. Setting to true will add a generic 'section-' prefix",type:"string"},rawPrefixHeaderId:{defaultValue:!1,describe:'Setting this option to true will prevent showdown from modifying the prefix. This might result in malformed IDs (if, for instance, the " char is used in the prefix)',type:"boolean"},ghCompatibleHeaderId:{defaultValue:!1,describe:"Generate header ids compatible with github style (spaces are replaced with dashes, a bunch of non alphanumeric chars are removed)",type:"boolean"},rawHeaderId:{defaultValue:!1,
|
|
474
475
|
describe:"Remove only spaces, ' and \" from generated header ids (including prefixes), replacing them with dashes (-). WARNING: This might result in malformed ids",type:"boolean"},headerLevelStart:{defaultValue:!1,describe:"The header blocks level start",type:"integer"},parseImgDimensions:{defaultValue:!1,describe:"Turn on/off image dimension parsing",type:"boolean"},simplifiedAutoLink:{defaultValue:!1,describe:"Turn on/off GFM autolink style",type:"boolean"},excludeTrailingPunctuationFromURLs:{defaultValue:!1,describe:"Excludes trailing punctuation from links generated with autoLinking",type:"boolean"},literalMidWordUnderscores:{defaultValue:!1,describe:"Parse midword underscores as literal underscores",type:"boolean"},literalMidWordAsterisks:{defaultValue:!1,describe:"Parse midword asterisks as literal asterisks",type:"boolean"},strikethrough:{defaultValue:!1,describe:"Turn on/off strikethrough support",type:"boolean"},tables:{defaultValue:!1,describe:"Turn on/off tables support",type:"boolean"},
|
|
475
476
|
tablesHeaderId:{defaultValue:!1,describe:"Add an id to table headers",type:"boolean"},ghCodeBlocks:{defaultValue:!0,describe:"Turn on/off GFM fenced code blocks support",type:"boolean"},tasklists:{defaultValue:!1,describe:"Turn on/off GFM tasklist support",type:"boolean"},smoothLivePreview:{defaultValue:!1,describe:"Prevents weird effects in live previews due to incomplete input",type:"boolean"},smartIndentationFix:{defaultValue:!1,describe:"Tries to smartly fix indentation in es6 strings",type:"boolean"},disableForced4SpacesIndentedSublists:{defaultValue:!1,describe:"Disables the requirement of indenting nested sublists by 4 spaces",type:"boolean"},simpleLineBreaks:{defaultValue:!1,describe:"Parses simple line breaks as <br> (GFM Style)",type:"boolean"},requireSpaceBeforeHeadingText:{defaultValue:!1,describe:"Makes adding a space between `#` and the header text mandatory (GFM Style)",type:"boolean"},ghMentions:{defaultValue:!1,describe:"Enables github @mentions",type:"boolean"},ghMentionsLink:{
|
|
476
477
|
defaultValue:"https://github.com/{u}",describe:"Changes the link generated by @mentions. Only applies if ghMentions option is enabled.",type:"string"},encodeEmails:{defaultValue:!0,describe:"Encode e-mail addresses through the use of Character Entities, transforming ASCII e-mail addresses into its equivalent decimal entities",type:"boolean"},openLinksInNewWindow:{defaultValue:!1,describe:"Open all links in new windows",type:"boolean"},backslashEscapesHTMLTags:{defaultValue:!1,describe:"Support for HTML Tag escaping. ex: <div>foo</div>",type:"boolean"},emoji:{defaultValue:!1,describe:"Enable emoji support. Ex: `this is a :smile: emoji`",type:"boolean"},underline:{defaultValue:!1,describe:"Enable support for underline. Syntax is double or triple underscores: `__underline word__`. With this option enabled, underscores no longer parses into `<em>` and `<strong>`",type:"boolean"},ellipsis:{defaultValue:!0,describe:"Replaces three dots with the ellipsis unicode character",type:"boolean"},completeHTMLDocument:{
|
|
@@ -541,120 +542,120 @@ var o=new Array(r+1).join("#"),i="";if(e.hasChildNodes()){i=o+" ";for(var a=e.ch
|
|
|
541
542
|
r||(o=n.subParser("makeMarkdown.header")(e,t,4)+"\n\n");break;case"h5":r||(o=n.subParser("makeMarkdown.header")(e,t,5)+"\n\n");break;case"h6":r||(o=n.subParser("makeMarkdown.header")(e,t,6)+"\n\n");break;case"p":r||(o=n.subParser("makeMarkdown.paragraph")(e,t)+"\n\n");break;case"blockquote":r||(o=n.subParser("makeMarkdown.blockquote")(e,t)+"\n\n");break;case"hr":r||(o=n.subParser("makeMarkdown.hr")(e,t)+"\n\n");break;case"ol":r||(o=n.subParser("makeMarkdown.list")(e,t,"ol")+"\n\n");break;case"ul":r||(o=n.subParser("makeMarkdown.list")(e,t,"ul")+"\n\n");break;case"precode":r||(o=n.subParser("makeMarkdown.codeBlock")(e,t)+"\n\n");break;case"pre":r||(o=n.subParser("makeMarkdown.pre")(e,t)+"\n\n");break;case"table":r||(o=n.subParser("makeMarkdown.table")(e,t)+"\n\n");break;case"code":o=n.subParser("makeMarkdown.codeSpan")(e,t);break;case"em":case"i":o=n.subParser("makeMarkdown.emphasis")(e,t);break;case"strong":case"b":o=n.subParser("makeMarkdown.strong")(e,t);break;case"del":
|
|
542
543
|
o=n.subParser("makeMarkdown.strikethrough")(e,t);break;case"a":o=n.subParser("makeMarkdown.links")(e,t);break;case"img":o=n.subParser("makeMarkdown.image")(e,t);break;default:o=e.outerHTML+"\n\n"}return o})),n.subParser("makeMarkdown.paragraph",(function(e,t){var r="";if(e.hasChildNodes())for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);return r=r.trim()})),n.subParser("makeMarkdown.pre",(function(e,t){var n=e.getAttribute("prenum");return"<pre>"+t.preList[n]+"</pre>"})),n.subParser("makeMarkdown.strikethrough",(function(e,t){var r="";if(e.hasChildNodes()){r+="~~";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);r+="~~"}return r})),n.subParser("makeMarkdown.strong",(function(e,t){var r="";if(e.hasChildNodes()){r+="**";for(var o=e.childNodes,i=o.length,a=0;a<i;++a)r+=n.subParser("makeMarkdown.node")(o[a],t);r+="**"}return r})),n.subParser("makeMarkdown.table",(function(e,t){
|
|
543
544
|
var r,o,i="",a=[[],[]],s=e.querySelectorAll("thead>tr>th"),l=e.querySelectorAll("tbody>tr");for(r=0;r<s.length;++r){var c=n.subParser("makeMarkdown.tableCell")(s[r],t),u="---";if(s[r].hasAttribute("style"))switch(s[r].getAttribute("style").toLowerCase().replace(/\s/g,"")){case"text-align:left;":u=":---";break;case"text-align:right;":u="---:";break;case"text-align:center;":u=":---:"}a[0][r]=c.trim(),a[1][r]=u}for(r=0;r<l.length;++r){var d=a.push([])-1,h=l[r].getElementsByTagName("td");for(o=0;o<s.length;++o){var p=" ";void 0!==h[o]&&(p=n.subParser("makeMarkdown.tableCell")(h[o],t)),a[d].push(p)}}var m=3;for(r=0;r<a.length;++r)for(o=0;o<a[r].length;++o){var f=a[r][o].length;f>m&&(m=f)}for(r=0;r<a.length;++r){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=""
|
|
544
|
-
;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(d)}(
|
|
545
|
-
;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=
|
|
546
|
-
;n&&(t?n.className=t:n.style.width="350px")}}(o.current,{className:"w-full md:w-[380px]"})}),[e]),
|
|
547
|
-
className:
|
|
548
|
-
;const[o,i]=
|
|
549
|
-
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
|
|
550
|
-
o===t&&i===n?(a=
|
|
551
|
-
classes:"text-tiny touch:text-base",name:t})})}function
|
|
552
|
-
})),s=(e=a(),t=-1,n=!1)=>{t<0&&(t=e.findIndex((e=>0===e.tabIndex)))<0&&(t=0);for(let[r,o]of e.entries())o.tabIndex=r===t?0:-1,r===t&&n&&o.focus()};s(a(),0,t);const l=new
|
|
553
|
-
"aria-label":"Markdown editor toolbar",ref:r,children:[
|
|
554
|
-
href:"https://web.hypothes.is/help/formatting-annotations-with-markdown/",icon:"help",target:"_blank",title:"Formatting help","aria-label":"Formatting help"}),
|
|
555
|
-
;case"numlist":n((e=>
|
|
556
|
-
className:
|
|
557
|
-
;t<-1?t=a.length-1:t>=a.length&&(t=-1),c(t)},b=l>=0?`${h}-AutocompleteList-item-${l}`:"";return
|
|
558
|
-
"aria-activedescendant":b,"aria-controls":`${h}-AutocompleteList`,dir:"auto"}),
|
|
559
|
-
return null!==e.offsetParent}function
|
|
560
|
-
"function"==typeof l&&p.current!==d&&(p.current=d,l(d))}),[d,l]);const m=e=>{if("mousedown"===e.type)
|
|
561
|
-
className:
|
|
562
|
-
className:
|
|
563
|
-
children:y}),
|
|
564
|
-
"aria-expanded":g?s:void 0,children:k}),
|
|
565
|
-
title:"Change annotation sharing setting",align:"left",children:[
|
|
566
|
-
;const t=`${
|
|
567
|
-
children:["(",e,")"]})]})}function
|
|
568
|
-
;return`${n} hr${n>1?"s":""} ago`},nextUpdate:36e5},{test:(e,t)=>e.getFullYear()===t.getFullYear(),formatter:function(e,t,n){return
|
|
569
|
-
const[o,i]=
|
|
570
|
-
var
|
|
571
|
-
}),n>0&&h&&
|
|
572
|
-
const r=`${n?"Show replies":"Hide replies"} (${t})`;return
|
|
573
|
-
annotation:e}),h&&
|
|
574
|
-
className:
|
|
575
|
-
className:
|
|
576
|
-
className:"flex","data-testid":"thread-container",children:[r&&
|
|
577
|
-
}),[e]),c=
|
|
578
|
-
;const[i,a]=
|
|
579
|
-
children:[
|
|
580
|
-
variant:"primary",onClick:t,children:"Log in"})]})]})})}var
|
|
581
|
-
className:"whitespace-nowrap font-bold",children:o})]}),e>0&&
|
|
582
|
-
className:
|
|
583
|
-
"aria-label":"Hypothesis homepage",target:"_blank",title:"Hypothesis homepage",children:
|
|
584
|
-
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
|
|
585
|
-
;if(e.parentElement)return"body"===e.parentElement.tagName.toLowerCase()?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}var
|
|
586
|
-
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 d=n.maxSynchronousAlignments;return null==d&&(d=3),t._scrollSettings={startTime:l,endIterations:0,target:e,time:n.time,ease:n.ease,align:n.align,isWindow:n.isWindow||
|
|
587
|
-
function
|
|
588
|
-
r.selectTab(e)},u="annotation"===o&&0===a&&!l,d="note"===o&&0===i;return
|
|
589
|
-
classes:"text-center",children:
|
|
590
|
-
}),[a,r,s,g,m]),
|
|
591
|
-
t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),
|
|
592
|
-
classes:
|
|
593
|
-
children:["To reply to an annotation, select the"," ",
|
|
594
|
-
e.error("Unable to copy version info")}},icon:"copy",children:"Copy version details"})})]})}),["toastMessenger"]);function
|
|
595
|
-
e.preventDefault(),s(t)};return
|
|
596
|
-
var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){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}},
|
|
597
|
-
order:this._sortOrder,_separate_replies:this._separateReplies,...e};t&&(o.search_after=t);try{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
|
|
598
|
-
className:
|
|
599
|
-
title:"Filter by user"})}function
|
|
600
|
-
;return
|
|
601
|
-
const{paginatedThreads:i,totalPages:a}=
|
|
602
|
-
f!==m.current&&(x.current&&
|
|
603
|
-
})," at a time (there are"," ",c," to show here)."," ",
|
|
604
|
-
"data-testid":"sharing-intro",children:"private"===r.type?
|
|
605
|
-
className:"text-[24px]",children:
|
|
606
|
-
onClick:e=>e.stopPropagation(),target:"_new",children:"More info"})})]})]})}var
|
|
607
|
-
;!r.length&&e.organization.logo&&(n.logo=e.organization.logo),r.push(n)}(e,t[n])})),t}function
|
|
608
|
-
n.focus(t.id)}:d,onToggleSubmenu:d,submenu:
|
|
609
|
-
const n=
|
|
610
|
-
expandedGroup:m,onExpandGroup:f,heading:"My Groups",groups:l}),h&&
|
|
611
|
-
;!n.metaKey&&!n.ctrlKey&&n.target instanceof HTMLElement&&["INPUT","TEXTAREA"].includes(n.target.tagName)||(t.current=document.activeElement,null===(r=e.current)||void 0===r||r.focus(),n.preventDefault(),n.stopPropagation())}),[e]),r=
|
|
612
|
-
"max-w-[150px] p-1.5 ml-[2px]":c},"transition-[max-width] duration-300 ease-out"),"data-testid":"search-input",dir:"auto",type:"text",name:"query",placeholder:r?"Loading…":"Search…",disabled:r,inputRef:o,value:s||"",onInput:e=>l(e.target.value)}),!r&&
|
|
613
|
-
const i=
|
|
614
|
-
const c=!
|
|
615
|
-
;e&&e.onHelpRequestProvided?n.notifyHost("helpRequested"):d.toggleSidebarPanel("help")},size:"small",title:"Help"}),"logged-in"===e.status?
|
|
616
|
-
}),[s,l]),d=
|
|
617
|
-
;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?"),
|
|
618
|
-
;return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?
|
|
619
|
-
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._activity.reportActivity("delete",e),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._activity.reportActivity("flag",e),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:
|
|
620
|
-
return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}
|
|
621
|
-
throw new
|
|
622
|
-
method:c.method})}finally{i()}}}class
|
|
623
|
-
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
|
|
624
|
-
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},
|
|
625
|
-
;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=
|
|
626
|
-
;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}}}(
|
|
627
|
-
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
|
|
628
|
-
r.searchParams.set("origin",e.location.origin),r.searchParams.set("response_mode","web_message"),r.searchParams.set("response_type","code"),r.searchParams.set("state",t);const o=`left=${e.screen.width/2-237.5},top=${e.screen.height/2-215},width=475,height=430`;if(!e.open(r.toString(),"Log in to Hypothesis",o))throw new Error("Failed to open login window");return n.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
|
|
629
|
-
;return e=e.replace(/\./g,"%2E"),`hypothesis.oauth.${e}.token`}function p(e){r.setObject(h(),e)}const m=async()=>{if(l)return l;const e=await n.links();return l=new
|
|
630
|
-
const e=f();return s=(async(e,t)=>{const n=await m();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&&p(r),r})(t.refreshToken,{persist:void 0===e}),g()}return t.accessToken};(()=>{e.addEventListener("storage",(({key:e})=>{e===h()&&(s=null,this.emit("oauthTokensChanged"))}))})(),this.login=async function(){const t=await m(),n=await t.authorize(e);a=n,s=null},this.logout=async function(){const[e,t]=await Promise.all([s,m()]);e&&await t.revokeToken(e.accessToken),s=Promise.resolve(null),r.removeItem(h())},this.getAccessToken=g}}
|
|
631
|
-
|
|
632
|
-
this._hostFrame.postMessage({frame1:this._source,frame2:e,type:"request",requestId:n},"*")},i=setInterval(o,250),a=setTimeout((()=>{clearInterval(i),r(new Error(`Unable to establish ${this._source}-${e} communication channel`))}),2e4),s=this._listeners.add(window,"message",(r=>{const{data:o,ports:l}=r;
|
|
633
|
-
this._receivedCloseEvent=!1}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(),
|
|
634
|
-
;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
|
|
635
|
-
|
|
636
|
-
this._guestRPC.delete(n),n=e.frameIdentifier,this._guestRPC.set(n,t),this._store.connectFrame({id:e.frameIdentifier,metadata:e.metadata,uri:e.uri})})),t.on("close",(()=>{const e=this._store.frames().find((e=>e.id===n));e&&this._store.destroyFrame(e),t.destroy(),this._guestRPC.delete(n)})),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 r={};const o=
|
|
545
|
+
;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(d)}(wm);var xm=wm.exports;const km=Ic(window);function Sm(){return[{type:"output",filter:function(e){return e.replace(/<a href=/g,'<a target="_blank" href=')}}]}let Cm;function Em(e){return"{math:"+e.toString()+"}"}function Am(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
|
|
546
|
+
;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=Em(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=km.sanitize(function(e){return Cm||(Cm=new xm.Converter({extensions:[Sm],simplifiedAutoLink:!0,literalMidWordUnderscores:!0,strikethrough:!0})),Cm.makeHtml(e)}(t.content)),r=function(e,t){return t.reduce(((e,t)=>{let n;try{n=t.inline?ym(t.expression):ym(t.expression,{displayMode:!0})}catch(e){n=Pc(t.expression)}return e.replace(Em(t.id),n)}),e)}(n,t.mathBlocks);return r}function Tm({children:e,classes:t,...n}){return Ur("div",{dir:"auto",lang:"",className:Bn("StyledText",t),...n,children:e})}function Nm({markdown:e,classes:t,style:n}){const r=Lr((()=>e?Am(e):""),[e]),o=Mr();return Tr((()=>{!function(e,{className:t}={}){const n=Array.from(e.getElementsByTagName("a"));for(let e of n){const n=Il(e)
|
|
547
|
+
;n&&(t?n.className=t:n.style.width="350px")}}(o.current,{className:"w-full md:w-[380px]"})}),[e]),Ur("div",{className:"w-full break-words cursor-text",children:Ur(Tm,{children:Ur("div",{className:t,"data-testid":"markdown-text",ref:o,dangerouslySetInnerHTML:{__html:r},style:n})})})}function Mm({children:e}){return Ur("ul",{className:"flex flex-wrap gap-2 leading-none","aria-label":"Annotation tags",children:e})}function Lm({href:e,onRemoveTag:t,tag:n}){return Ur("li",{className:"flex items-center border rounded-sm bg-grey-0",children:[Ur("div",{className:"grow px-1.5 py-1 touch:p-2",children:e?Ur(lo,{classes:"text-color-text-light hover:text-brand",href:e,lang:"",target:"_blank","aria-label":`Tag: ${n}`,title:`View annotations with tag: ${n}`,children:n}):Ur("span",{className:"text-color-text-light cursor-default","aria-label":`Tag: ${n}`,lang:"",children:n})}),t&&Ur("button",{
|
|
548
|
+
className:Bn("px-1.5 py-1 touch:p-2","border-l rounded-sm rounded-l-none","text-grey-6 hover:text-color-text hover:bg-grey-2","transition-colors duration-200","focus-visible-ring ring-inset"),onClick:()=>{t(n)},title:`Remove tag: ${n}`,children:Ur(so,{classes:"font-base",name:"cancel",title:`Remove ${n}`})})]})}function zm({classes:e,setCollapsed:t,collapsed:n}){const r=n?"More":"Less";return Ur(Kr,{classes:Bn("text-grey-7 font-normal",e),expanded:!n,onClick:()=>t(!n),title:`Toggle visibility of full annotation text: Show ${r}`,children:Ur("div",{className:"flex items-center gap-x-2",children:[Ur(so,{classes:Bn("!text-tiny"),name:n?"expand":"collapse",title:n?"expand":"collapse"}),Ur("div",{children:r})]})})}km.addHook("afterSanitizeAttributes",(e=>{"target"in e&&e.setAttribute("target","_blank")}));var Rm=Ro((function({annotation:e,settings:t}){var n,r
|
|
549
|
+
;const[o,i]=Er(!0),[a,s]=Er(!1),l=rs(),c=l.defaultAuthority(),u=l.getDraft(e),d=null!==(n=null==u?void 0:u.tags)&&void 0!==n?n:e.tags,h=null!==(r=null==u?void 0:u.text)&&void 0!==r?r:e.text,p=h.length>0,m=d.length>0,f=Lo(["annotationFontFamily"],t),g=Lr((()=>e&&!No(null==e?void 0:e.user,c)),[e,c]),v=e=>l.getLink("search.tag",{tag:e});return Ur("div",{className:"space-y-4",children:[p&&Ur(Nl,{collapse:o,collapsedHeight:400,inlineControls:!1,onCollapsibleChanged:s,onToggleCollapsed:i,overflowThreshold:20,children:Ur(Nm,{markdown:h,classes:Bn({"p-redacted-text":yi(e)}),style:f})}),(a||m)&&Ur("div",{className:"flex flex-row gap-x-2",children:[Ur("div",{className:"grow",children:m&&Ur(Mm,{children:d.map((e=>Ur(Lm,{tag:e,href:g?v(e):void 0},e)))})}),a&&Ur("div",{children:Ur(zm,{classes:Bn("-mt-3"),collapsed:o,setCollapsed:i})})]})]})}),["settings"]);const Om=0,Im=1;function Dm(e,t,n,r){let o=e.selectionStart,i=e.selectionEnd;return o>=t+n?(o+=r.length-n,
|
|
550
|
+
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 Pm(e,t=Om){const n=e.text.slice(e.selectionStart,e.selectionEnd);let r,o="";if(t===Im&&(o="!"),n.match(/[a-z]+:\/\/.*/)){const t="Description";return r=Dm(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=Dm(e,e.selectionStart,n.length,t+i+")"),r.selectionStart=e.selectionStart+t.length,r.selectionEnd=r.selectionStart+i.length,r}}function Bm(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=Dm(e,e.selectionStart,0,r),a.selectionStart=a.selectionEnd-r.length),
|
|
551
|
+
o===t&&i===n?(a=Dm(a,a.selectionStart-t.length,t.length,""),a=Dm(a,a.selectionEnd,n.length,"")):(a=Dm(a,a.selectionStart,0,t),a=Dm(a,a.selectionEnd,0,n)),a}function Fm(e,t){const n=e.indexOf("\n",t);return n<0?e.length:n}function Hm(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=Fm(e.text,t);for(;i<=Fm(e.text,n);){const t=i===e.text.length,a=i-o,s=Fm((e=r(e,o,i)).text,o)-o;if(n+=s-a,t)break;o=o+s+1,i=Fm(e.text,o)}return e}function jm(e,t){const n=e.selectionStart,r=e.selectionEnd;let o=!0;return Hm(e,n,r,((e,n)=>(e.text.slice(n,n+t.length)!==t&&(o=!1),e))),Hm(e,n,r,o?(e,n)=>Dm(e,n,t.length,""):(e,n)=>e.text.slice(n,n+t.length)===t?e:Dm(e,n,0,t))}const Um={bold:"b",image:"g",italic:"i",link:"l",list:"u",math:"m",numlist:"o",quote:"q"};function qm({classes:e,icon:t,linkRef:n,...r}){return Ur(lo,{classes:Bn("flex justify-center items-center","text-grey-7 hover:!text-grey-7","touch:h-touch-minimum touch:w-touch-minimum",e),linkRef:n,...r,children:Ur(so,{
|
|
552
|
+
classes:"text-tiny touch:text-base",name:t})})}function $m({disabled:e=!1,iconName:t="",label:n,onClick:r,shortcutKey:o,title:i=""}){const a=Lr((()=>il()?"Cmd":"Ctrl"),[]);let s=i;o&&(s+=` (${a}-${o.toUpperCase()})`);const l={disabled:e,icon:t,onClick:r,title:s};return n?Ur(Kr,{classes:Bn("font-normal bg-transparent","hover:!bg-transparent"),...l,children:n}):Ur(Wr,{classes:"px-2 py-2.5 text-tiny touch:text-base",...l})}function Gm({classes:e,containerRef:t,...n}){return Ur("textarea",{className:Bn("border rounded-sm p-2","text-color-text-light bg-grey-0","focus:bg-white focus:outline-none focus:shadow-focus-inner",e),...n,ref:t})}function Vm({isPreviewing:e,onCommand:t,onTogglePreview:n}){const r=Mr(null);return function(e,{autofocus:t=!1,horizontal:n=!0,vertical:r=!0,selector:o="a,button"}={}){Tr((()=>{if(!e.current)throw new Error("Container ref not set");const i=e.current,a=()=>Array.from(i.querySelectorAll(o)).filter((e=>{return null!==e.offsetParent&&!("boolean"==typeof(t=e).disabled&&t.disabled);var t
|
|
553
|
+
})),s=(e=a(),t=-1,n=!1)=>{t<0&&(t=e.findIndex((e=>0===e.tabIndex)))<0&&(t=0);for(let[r,o]of e.entries())o.tabIndex=r===t?0:-1,r===t&&n&&o.focus()};s(a(),0,t);const l=new Ws;l.add(i,"focusin",(e=>{const t=a(),n=t.indexOf(e.target);n>=0&&s(t,n)})),l.add(i,"keydown",(e=>{const t=a();let o=t.findIndex((e=>0===e.tabIndex)),i=!1;n&&"ArrowLeft"===e.key||r&&"ArrowUp"===e.key?(0===o?o=t.length-1:--o,i=!0):n&&"ArrowRight"===e.key||r&&"ArrowDown"===e.key?(o===t.length-1?o=0:++o,i=!0):"Home"===e.key?(o=0,i=!0):"End"===e.key&&(o=t.length-1,i=!0),i&&(s(t,o,!0),e.preventDefault(),e.stopPropagation())}));const c=new MutationObserver((()=>{s()}));return c.observe(i,{subtree:!0,attributes:!0,attributeFilter:["disabled"],childList:!0}),()=>{l.removeAll(),c.disconnect()}}),[t,e,n,o,r])}(r),Ur("div",{className:Bn("flex flex-wrap w-full items-center","p-1 border-x border-t rounded-t bg-white","touch:h-auto touch:overflow-x-scroll touch:flex-nowrap touch:pb-2.5"),"data-testid":"markdown-toolbar",role:"toolbar",
|
|
554
|
+
"aria-label":"Markdown editor toolbar",ref:r,children:[Ur($m,{disabled:e,iconName:"format-bold",onClick:()=>t("bold"),shortcutKey:Um.bold,title:"Bold"}),Ur($m,{disabled:e,iconName:"format-italic",onClick:()=>t("italic"),shortcutKey:Um.italic,title:"Italic"}),Ur($m,{disabled:e,iconName:"format-quote",onClick:()=>t("quote"),shortcutKey:Um.quote,title:"Quote"}),Ur($m,{disabled:e,iconName:"link",onClick:()=>t("link"),shortcutKey:Um.link,title:"Insert link"}),Ur($m,{disabled:e,iconName:"image",onClick:()=>t("image"),shortcutKey:Um.image,title:"Insert image"}),Ur($m,{disabled:e,iconName:"format-functions",onClick:()=>t("math"),title:"Insert math (LaTeX is supported)"}),Ur($m,{disabled:e,iconName:"format-list-numbered",onClick:()=>t("numlist"),shortcutKey:Um.numlist,title:"Numbered list"}),Ur($m,{disabled:e,iconName:"format-list-unordered",onClick:()=>t("list"),shortcutKey:Um.list,title:"Bulleted list"}),Ur("div",{className:"grow flex justify-end",children:[Ur(qm,{classes:Bn("px-2 py-2.5"),
|
|
555
|
+
href:"https://web.hypothes.is/help/formatting-annotations-with-markdown/",icon:"help",target:"_blank",title:"Formatting help","aria-label":"Formatting help"}),Ur($m,{label:e?"Write":"Preview",onClick:n})]})]})}function Ym({label:e="",onEditText:t=(()=>{}),text:n="",textStyle:r={}}){const[o,i]=Er(!1),a=Mr(null);Tr((()=>{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)?Bm(e,"$$","$$","Insert LaTeX"):Bm(e,"\\(","\\)","Insert LaTeX")};switch(e){case"bold":n((e=>Bm(e,"**","**","Bold")));break;case"italic":n((e=>Bm(e,"*","*","Italic")));break;case"quote":n((e=>jm(e,"> ")));break;case"link":n((e=>Pm(e)));break;case"image":n((e=>Pm(e,Im)));break;case"math":n(r);break
|
|
556
|
+
;case"numlist":n((e=>jm(e,"1. ")));break;case"list":n((e=>jm(e,"* ")));break;default:throw new Error(`Unknown toolbar command "${e}"`)}}(e,a.current),t(a.current.value))};return Ur("div",{className:"leading-none",children:[Ur(Vm,{onCommand:s,isPreviewing:o,onTogglePreview:()=>i(!o)}),o?Ur(Nm,{markdown:n,classes:"border bg-grey-1 p-2",style:r}):Ur(Gm,{"aria-label":e,dir:"auto",classes:Bn("w-full min-h-[8em] resize-y","rounded-t-none","text-base touch:text-touch-base"),containerRef:a,onClick:e=>e.stopPropagation(),onKeyDown:e=>{if(e.ctrlKey||e.metaKey)for(let[t,n]of Object.entries(Um))n===e.key&&(e.stopPropagation(),e.preventDefault(),s(t))},onInput:e=>t(e.target.value),value:n,style:r})]})}const Wm=e=>e;function Km({activeItem:e=-1,id:t,itemPrefixId:n,list:r,listFormatter:o=Wm,onSelectItem:i,open:a=!1}){const s=Lr((()=>r.map(((t,r)=>{const a=n?{id:`${n}${r}`}:{};return Ur("li",{role:"option","aria-selected":(e===r).toString(),
|
|
557
|
+
className:Bn("flex items-center","border-l-4 py-1 px-3 cursor-pointer hover:bg-grey-2","touch:h-touch-minimum",{"border-brand bg-grey-1":e===r,"border-transparent":e!==r}),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 Ur("div",{className:"relative",children:Ur("div",{className:Bn({hidden:c},"absolute top-[3px] z-3","min-w-[10em]"),"data-testid":"autocomplete-list-container",children:Ur(vl,{width:"auto",children:[Ur("ul",{tabIndex:-1,"aria-label":"Suggestions",role:"listbox",...l,children:s}),Ur(wl,{direction:"up",classes:"top-[-8px] left-[3px]"})]})})})}let Xm=0;var Zm=Ro((function({onAddTag:e,onRemoveTag:t,onTagInput:n,tagList:r,tags:o}){const i=Mr(),[a,s]=Er([]),[l,c]=Er(-1),[u,d]=Er(!1),[h]=Er((()=>(++Xm,`TagEditor-${Xm}`))),p=Mr();uo(p,u,(()=>{d(!1)}));const m=()=>i.current.value.trim(),f=()=>m()&&m().length>0,g=()=>{i.current.value="",null==n||n("")},v=t=>{e(t)&&(d(!1),c(-1),g(),i.current.focus())},_=e=>{let t=l+e
|
|
558
|
+
;t<-1?t=a.length-1:t>=a.length&&(t=-1),c(t)},b=l>=0?`${h}-AutocompleteList-item-${l}`:"";return Ur("div",{className:"space-y-4",children:[Ur(Mm,{children:r.map((e=>Ur(Lm,{onRemoveTag:t,tag:e},e)))}),Ur("div",{id:h,"data-testid":"combobox-container",ref:p,role:"combobox","aria-expanded":u.toString(),"aria-owns":`${h}-AutocompleteList`,"aria-haspopup":"listbox",children:[Ur(wo,{classes:"w-full",onInput:()=>{null==n||n(m()),(()=>{if(f()){const e=o.filter(m());s(((e,t)=>{const n=[];for(let r of e)t.indexOf(r)<0&&n.push(r);return n.sort()})(e,r)),d(e.length>0)}else d(!1);c(-1)})()},onKeyDown:e=>{switch(e.key){case"ArrowUp":_(-1),e.preventDefault();break;case"ArrowDown":_(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;-1!==l?v(a[l]):1===a.length?v(a[0]):v(m()),e.preventDefault()}},onFocus:()=>{f()&&d(!0)},inputRef:i,placeholder:"Add new tags",type:"text",autoComplete:"off","aria-autocomplete":"list",
|
|
559
|
+
"aria-activedescendant":b,"aria-controls":`${h}-AutocompleteList`,dir:"auto"}),Ur(Km,{id:`${h}-AutocompleteList`,list:a,listFormatter:e=>{const t=m().toLowerCase(),n=e.toLowerCase().indexOf(t);if(-1===n)return Ur("span",{children:e});const r=e.slice(0,n),o=e.slice(n,n+t.length),i=e.slice(n+t.length);return Ur("span",{children:[Ur("strong",{children:r}),o,Ur("strong",{children:i})]})},open:u,onSelectItem:e=>{e&&v(e)},itemPrefixId:`${h}-AutocompleteList-item-`,activeItem:l})]})]})}),["tags"]);function Jm(){return Ur("div",{className:"pt-2 border-t text-sm leading-none",children:Ur(lo,{classes:"flex items-center text-color-text-light",href:"http://creativecommons.org/publicdomain/zero/1.0/",target:"_blank",title:"View more information about the Creative Commons Public Domain dedication",children:[Ur(so,{name:"cc-std",classes:"text-tiny"}),Ur(so,{name:"cc-zero",classes:"ml-px text-tiny"}),Ur("div",{className:"ml-1",children:"Annotations can be freely reused by anyone for any purpose."})]})})}function Qm(e){
|
|
560
|
+
return null!==e.offsetParent}function ef({className:e,closeMenu:t,children:n,visible:r}){const o=Mr();Tr((()=>{let e;return r&&(e=setTimeout((()=>{const e=o.current.querySelector('[role^="menuitem"]');e&&e.focus()}))),()=>{clearTimeout(e)}}),[r]);return Ur("div",{role:"menu",className:e,ref:o,onKeyDown:e=>{const n=Array.from(o.current.querySelectorAll('[role^="menuitem"]')).filter(Qm);let r=n.findIndex((e=>e.contains(document.activeElement))),i=!1;switch(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,i=!0}i&&r>=0&&(e.stopPropagation(),e.preventDefault(),n[r].focus())},children:n})}let tf=!1;const nf=()=>{};function rf({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[d,h]=Er(i);"boolean"==typeof s&&(d=s,h=l||nf);const p=Mr(d);Tr((()=>{
|
|
561
|
+
"function"==typeof l&&p.current!==d&&(p.current=d,l(d))}),[d,l]);const m=e=>{if("mousedown"===e.type)tf=!0;else if("click"===e.type&&tf)return tf=!1,e.stopPropagation(),void e.preventDefault();h(!d)},f=zr((()=>h(!1)),[h]),g=Mr();uo(g,d,f);const v=e=>e.stopPropagation();return Ur("div",{className:"relative","data-testid":"menu-container",ref:g,style:{position:r?"relative":"static"},onClick:v,onMouseDown:v,children:[Ur("button",{"aria-expanded":d?"true":"false","aria-haspopup":!0,className:Bn("focus-visible-ring","flex items-center justify-center rounded-sm transition-colors",{"text-grey-7 hover:text-grey-9":!d,"text-brand":d}),"data-testid":"menu-toggle-button",onMouseDown:m,onClick:m,"aria-label":u,title:u,children:Ur("span",{className:"flex items-center gap-x-1",children:[a,c&&Ur("span",{className:Bn({"rotate-180 text-color-text":d}),children:Ur(so,{name:"expand-menu",classes:"w-2.5 h-2.5"})})]})}),d&&Ur(Gn,{children:[Ur(wl,{direction:"up",classes:Bn("right-0 top-[calc(100%-3px)] w-[15px]",t)}),Ur("div",{
|
|
562
|
+
className:Bn("focus-visible-ring","absolute top-[calc(100%+5px)] z-1 border shadow","bg-white text-lg",{"left-0":"left"===e,"right-0":"right"===e},o),"data-testid":"menu-content",role:"menu",tabIndex:-1,onClick:f,onKeyDown:e=>{const t=e.key;"Enter"!==t&&" "!==t||setTimeout((()=>{f()}))},children:Ur(ef,{visible:!0,children:n})})]})]})}function of({children:e,visible:t}){const n=Mr(),[r,o]=Er(t?"auto":0),[i,a]=Er(t);Tr((()=>{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 Ur("div",{ontransitionend:zr((()=>{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})}function af({title:e,isExpanded:t,onToggleSubmenu:n}){return Ur("div",{"data-testid":"submenu-toggle",role:"none",
|
|
563
|
+
className:Bn("flex flex-col items-center justify-center w-10 h-10","text-grey-6 bg-grey-1","bg-clip-content border-[8px] border-transparent rounded-xl","group-hover:hover:text-grey-8",{"bg-grey-4":t,"group-hover:bg-grey-3":!t}),onClick:n,title:e,children:Ur(so,{name:t?"collapse-menu":"expand-menu",classes:"w-3 h-3"})})}function sf({href:e,icon:t,iconAlt:n,isDisabled:r,isExpanded:o,isSelected:i,isSubmenuItem:a,isSubmenuVisible:s,label:l,onClick:c,onToggleSubmenu:u,submenu:d}){const h=t&&-1!==t.indexOf("/"),p=Mr();let m,f;const g="boolean"==typeof s,v="boolean"==typeof i;Tr((()=>()=>{clearTimeout(m)}),[]);const _=e=>{switch(e.key){case"ArrowRight":u&&(e.stopPropagation(),e.preventDefault(),u(e));break;case"Enter":case" ":c&&c(e)}};let b=null;t&&"blank"!==t&&(b=h?Ur("img",{className:"w-4 h-4",alt:n,src:t}):Ur(so,{name:t,classes:"h-3 w-3"}));const y=a?null:b,w=a?b:null,x=w&&a,k=Ur(Gn,{children:[(y||a||"blank"===t)&&Ur("div",{className:"w-7 flex items-center justify-center","data-testid":"left-item-container",
|
|
564
|
+
children:y}),Ur("span",{className:"flex items-center grow whitespace-nowrap px-1",children:l}),x&&Ur("div",{className:"w-8 flex items-center justify-center","data-testid":"right-item-container",children:w}),g&&Ur(af,{title:`Show actions for ${l}`,isExpanded:s,onToggleSubmenu:u})]}),S=Bn("focus-visible-ring ring-inset","w-full min-w-[150px] flex items-center select-none","border-b","group",{"min-h-[30px] font-normal":a,"min-h-[40px] font-medium":!a,"bg-grey-1 hover:bg-grey-3":a||o,"bg-white hover:bg-grey-1":!a&&!o,"pr-1":!g},{"border-l-[4px] border-l-brand":i,"pl-[4px]":!i,"border-b-grey-3":o,"border-b-transparent":!o,"text-color-text-light":r,"text-color-text":!r});return f=e?Ur("a",{ref:p,className:S,"data-testid":"menu-item",href:e,target:"_blank",tabIndex:-1,rel:"noopener noreferrer",role:"menuitem",onKeyDown:_,children:k}):Ur("div",{ref:p,className:S,"data-testid":"menu-item",tabIndex:-1,onKeyDown:_,onClick:c,role:v?"menuitemradio":"menuitem","aria-checked":v?i:void 0,"aria-haspopup":g,
|
|
565
|
+
"aria-expanded":g?s:void 0,children:k}),Ur(Gn,{children:[f,g&&Ur(of,{visible:s,children:Ur(ef,{closeMenu:e=>{u&&u(e),m=setTimeout((()=>{p.current.focus()}))},visible:s,className:"border-b",children:d})})]})}var lf=Ro((function({group:e,isDisabled:t,isPrivate:n,onCancel:r,onSave:o,onSetPrivate:i,settings:a}){const s=Lo(["ctaTextColor","ctaBackgroundColor"],a),l=Ur("div",{className:"w-9 h-9 flex items-center justify-center text-color-text-inverted",style:s,children:Ur(so,{name:"expand-menu",classes:"w-4 h-4"})});return Ur("div",{className:"flex flex-row gap-x-3",children:[Ur("div",{className:"flex relative",children:[Ur(Kr,{classes:Bn("rounded-r-none"),"data-testid":"publish-control-button",style:s,onClick:o,disabled:t,size:"large",variant:"primary",children:["Post to ",n?"Only Me":e.name]}),Ur("div",{className:Bn("flex flex-row rounded-r-sm bg-grey-7 hover:bg-grey-8"),style:s,children:Ur(rf,{arrowClass:Bn("right-[10px]"),containerPositioned:!1,contentClass:Bn("min-w-full"),label:l,menuIndicator:!1,
|
|
566
|
+
title:"Change annotation sharing setting",align:"left",children:[Ur(sf,{icon:"open"===e.type?"public":"groups",label:e.name,isSelected:!n,onClick:()=>i(!1)}),Ur(sf,{icon:"lock",label:"Only Me",isSelected:n,onClick:()=>i(!0)})]})})]}),Ur("div",{children:Ur(Kr,{classes:"p-2.5",icon:"cancel",onClick:r,size:"large",children:"Cancel"})})]})}),["settings"]);var cf=Ro((function({annotation:e,draft:t,annotationsService:n,settings:r,tags:o,toastMessenger:i}){const[a,s]=Er(null),l=rs(),c=l.getGroup(e.group),u=!t.isPrivate&&c&&"private"!==c.type,d=t.tags,h=t.text,p=!h&&!d.length,m=zr((e=>{l.createDraft(t.annotation,{...t,tags:e})}),[t,l]),f=zr((e=>{if(!e||d.indexOf(e)>=0)return!1;const t=[...d,e];return o.store(t),m(t),!0}),[m,d,o]),g=zr((e=>{const t=[...d],n=t.indexOf(e);return n>=0&&(t.splice(n,1),m(t),!0)}),[m,d]),v=zr((e=>{l.createDraft(t.annotation,{...t,text:e})}),[t,l]),_=zr((n=>{l.createDraft(e,{...t,isPrivate:n}),mi(e)||l.setDefault("annotationPrivacy",n?"private":"shared")}),[e,t,l]),b=async()=>{a&&f(a)
|
|
567
|
+
;const t=`${Ci(e)} ${fi(e)?"updated":"saved"}`;try{await n.save(e),i.success(t,{visuallyHidden:!0})}catch(e){i.error("Saving annotation failed")}},y=zr((()=>{l.removeDraft(e),fi(e)||l.removeAnnotations([e])}),[e,l]);return Ur("div",{"data-testid":"annotation-editor",className:"space-y-4",onKeyDown:e=>{const t=e.key;p||(e.metaKey||e.ctrlKey)&&"Enter"===t&&(e.stopPropagation(),e.preventDefault(),b())},children:[Ur(Ym,{textStyle:Lo(["annotationFontFamily"],r),label:"Annotation body",text:h,onEditText:v}),Ur(Zm,{onAddTag:f,onRemoveTag:g,onTagInput:s,tagList:d}),c&&Ur(lf,{group:c,isDisabled:p,isPrivate:t.isPrivate,onCancel:y,onSave:b,onSetPrivate:_}),u&&Ur(Jm,{})]})}),["annotationsService","settings","tags","toastMessenger"]);function uf({domain:e,link:t,title:n}){return Ur("div",{className:"flex gap-x-1",children:[Ur("div",{className:"text-color-text-light",children:['on "',t?Ur(lo,{href:t,target:"_blank",children:n}):Ur("span",{children:n}),'"']}),e&&Ur("span",{className:"text-color-text-light",
|
|
568
|
+
children:["(",e,")"]})]})}function df({group:e,isPrivate:t}){const n=null==e?void 0:e.links.html;return Ur(Gn,{children:[e&&n&&Ur(lo,{classes:Bn("flex items-baseline gap-x-1","p-muted-link"),href:e.links.html,target:"_blank",children:[Ur(so,{classes:"text-tiny",name:"open"===e.type?"public":"groups"}),Ur("span",{children:e.name})]}),t&&!n&&Ur("div",{className:"text-color-text-light","data-testid":"private-info",children:"Only me"})]})}let hf={};function pf(e,t){return t-e}function mf(e,t,n=window.Intl){const r=JSON.stringify(t);let o=hf[r];return o||(o=hf[r]=new n.DateTimeFormat(void 0,t)),o.format(e)}const ff=[{test:(e,t)=>pf(e,t)<3e4,formatter:()=>"Just now",nextUpdate:1e3},{test:(e,t)=>pf(e,t)<6e4,formatter:function(e,t){return`${Math.floor(pf(e,t)/1e3)} secs ago`},nextUpdate:1e3},{test:(e,t)=>pf(e,t)<36e5,formatter:function(e,t){const n=Math.floor(pf(e,t)/6e4);return`${n} min${n>1?"s":""} ago`},nextUpdate:6e4},{test:(e,t)=>pf(e,t)<864e5,formatter:function(e,t){const n=Math.floor(pf(e,t)/36e5)
|
|
569
|
+
;return`${n} hr${n>1?"s":""} ago`},nextUpdate:36e5},{test:(e,t)=>e.getFullYear()===t.getFullYear(),formatter:function(e,t,n){return mf(e,{month:"short",day:"numeric"},n)},nextUpdate:null}],gf={test:()=>!0,formatter:function(e,t,n){return mf(e,{day:"numeric",month:"short",year:"numeric"},n)},nextUpdate:null};function vf(e,t){for(let n of ff)if(n.test(e,t))return n;return gf}function _f(e){return!isNaN(e.valueOf())}function bf(e,t){let n;const r=new Date(e),o=()=>{const e=function(e,t){if(!e||!_f(e)||!_f(t))return null;let n=vf(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 yf(e,t,n){return e?vf(e,t).formatter(e,t,n):""}function wf(e,t){return mf(e,{year:"numeric",month:"short",day:"2-digit",weekday:"long",hour:"2-digit",minute:"2-digit"},t)}function xf({annotationCreated:e,annotationUpdated:t,annotationUrl:n,withEditedTimestamp:r}){
|
|
570
|
+
const[o,i]=Er((()=>new Date)),a=Lr((()=>new Date(e)),[e]),s=Lr((()=>r&&new Date(t)),[t,r]),l=Lr((()=>({absolute:wf(a),relative:yf(a,o)})),[a,o]),c=Lr((()=>s?{absolute:wf(s),relative:yf(s,o)}:{}),[s,o]);Tr((()=>bf(s?t:e,(()=>i(new Date)))),[e,t,a,s,o]);const u=c&&c.relative!==l.relative?`edited ${c.relative}`:"edited";return Ur("div",{children:[r&&Ur("span",{className:"text-color-text-light text-sm italic","data-testid":"timestamp-edited",title:c.absolute,children:["(",u,")"," "]}),n?Ur(lo,{classes:"p-muted-link",target:"_blank",title:l.absolute,href:n,children:l.relative}):Ur("span",{className:"color-text-color-light","data-testid":"timestamp-created",title:l.absolute,children:l.relative})]})}function kf({authorLink:e,displayName:t}){const n=Ur("h3",{className:"text-color-text font-bold",children:t});return e?Ur(_l,{href:e,target:"_blank",children:n}):Ur("div",{children:n})}function Sf({children:e}){return Ur("div",{className:"flex gap-x-1 items-baseline flex-wrap-reverse",children:e})}
|
|
571
|
+
var Cf=Ro((function({annotation:e,isEditing:t,replyCount:n,threadIsCollapsed:r,settings:o}){var i;const a=rs(),s=a.defaultAuthority(),l=a.isFeatureEnabled("client_display_names"),c=a.getLink("user",{user:e.user}),u=Lr((()=>Zs(e,s,l)),[e,s,l]),d=Lr((()=>function(e,t,n,r){var o;return!No(e.user,n)&&r?r:null!==(o=t.usernameUrl&&`${t.usernameUrl}${To(e.user)}`)&&void 0!==o?o:void 0}(e,o,s,c)),[e,o,s,c]),h=mi(e)&&r,p=(null===(i=e.links)||void 0===i?void 0:i.html)||"",m=Lr((()=>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)&&!h),[e,h]),f=function(e){return{domain:hi(e),titleText:pi(e),titleLink:di(e)}}(e),g=p&&f.titleLink?f.titleLink:"",v="sidebar"!==a.route()&&f.titleText,_=a.getGroup(e.group);return Ur("header",{children:[Ur(Sf,{children:[rl(e.permissions)&&!t&&Ur(so,{classes:"text-tiny",name:"lock",title:"This annotation is visible only to you"}),Ur(kf,{authorLink:d,displayName:u
|
|
572
|
+
}),n>0&&h&&Ur(Xr,{onClick:()=>a.setExpanded(e.id,!0),title:"Expand replies",children:`${n} ${n>1?"replies":"reply"}`}),!t&&e.created&&Ur("div",{className:"flex justify-end grow",children:Ur(xf,{annotationCreated:e.created,annotationUpdated:e.updated,annotationUrl:p,withEditedTimestamp:m})})]}),!mi(e)&&Ur(Sf,{children:[_&&Ur(df,{group:_,isPrivate:rl(e.permissions)}),!t&&wi(e)&&Ur(so,{name:"highlight",title:"This is a highlight. Click 'edit' to add a note or tag.",classes:"text-tiny text-color-text-light"}),v&&Ur(uf,{domain:f.domain,link:g,title:f.titleText})]})]})}),["settings"]);var Ef=Ro((function({quote:e,isHovered:t,isOrphan:n,settings:r}){return Ur(Nl,{collapsedHeight:35,inlineControls:!0,overflowThreshold:20,children:Ur(Tm,{classes:Bn({"p-redacted-text":n}),children:Ur("blockquote",{className:Bn("hover:border-l-blue-quote",{"border-l-blue-quote":t}),style:Lo(["selectionFontFamily"],r),children:e})})})}),["settings"]);function Af({onToggleReplies:e,replyCount:t,threadIsCollapsed:n}){
|
|
573
|
+
const r=`${n?"Show replies":"Hide replies"} (${t})`;return Ur(Xr,{onClick:e,title:r,children:r})}function Tf(){return Ur("div",{className:Bn("flex grow justify-end items-center gap-x-1","h-8 touch:h-touch-minimum"),"data-testid":"saving-message",children:[Ur(bo,{classes:Bn("text-xl","animate-fade-in-slow"),size:"small"}),Ur("div",{className:"text-color-text-light font-medium",children:"Saving..."})]})}var Nf=Ro((function({annotation:e,isReply:t,onToggleReplies:n,replyCount:r,threadIsCollapsed:o,annotationsService:i}){const a=rs(),s=Ai(e),l=a.getDraft(e),c=a.profile().userid,u=a.isAnnotationHovered(e.$tag),d=a.isSavingAnnotation(e),h=!!l&&!d,p=t&&o,m=!d&&!h&&fi(e),f=a.defaultAuthority(),g=a.isFeatureEnabled("client_display_names"),v=Lr((()=>Zs(e,f,g)),[e,f,g]);return Ur("article",{className:"space-y-4","aria-label":`${fi(e)?Ci(e):`New ${Ci(e).toLowerCase()}`} by ${v}`,children:[Ur(Cf,{annotation:e,isEditing:h,replyCount:r,threadIsCollapsed:o}),s&&Ur(Ef,{quote:s,isHovered:u,isOrphan:xi(e)}),!p&&!h&&Ur(Rm,{
|
|
574
|
+
annotation:e}),h&&Ur(cf,{annotation:e,draft:l}),!p&&Ur("footer",{className:"flex items-center",children:[n&&Ur(Af,{onToggleReplies:n,replyCount:r,threadIsCollapsed:o}),d&&Ur(Tf,{}),m&&Ur(eo,{classes:"grow",children:Ur(El,{annotation:e,onReply:()=>{fi(e)&&c&&i.reply(e,c)}})})]})]})}),["annotationsService"]);function Mf({isReply:e,replyCount:t,threadIsCollapsed:n,onToggleReplies:r}){return Ur("article",{className:"space-y-4","aria-label":(e?"Reply":"Annotation")+" with unavailable content",children:[Ur("div",{children:Ur("em",{children:"Message not available."})}),r&&Ur("footer",{className:"flex items-center",children:Ur(Af,{onToggleReplies:r,replyCount:t,threadIsCollapsed:n})})]})}var Lf=Ro((function({annotation:e,api:t,toastMessenger:n}){const r=rs(),o=function(e){return e.moderation?e.moderation.flagCount:null}(e);return null!==o&&(o>0||e.hidden)?Ur("div",{className:Bn("flex gap-x-3 bg-grey-1 text-color-text font-semibold","mb-2 ",{"-mt-3 -ml-3 -mr-3":!mi(e),"-mr-3":mi(e)}),children:[Ur("div",{
|
|
575
|
+
className:Bn("p-3 text-white",{"bg-red-error":!e.hidden,"bg-grey-6":e.hidden}),children:Ur(so,{name:e.hidden?"hide":"flag"})}),Ur("div",{className:"self-center grow",children:[!e.hidden&&Ur("span",{children:["Flagged for review by ",o," ",1===o?"user":"users"]}),e.hidden&&Ur("span",{children:"Hidden from users"})]}),Ur("div",{className:"self-center pr-2",children:Ur(Kr,{classes:"py-1 bg-slate-1",onClick:e.hidden?()=>{const o=e.id;t.annotation.unhide({id:o}).then((()=>{r.unhideAnnotation(o)})).catch((()=>{n.error("Failed to unhide annotation")}))}:()=>{const o=e.id;t.annotation.hide({id:o}).then((()=>{r.hideAnnotation(o)})).catch((()=>{n.error("Failed to hide annotation")}))},title:e.hidden?"Make this annotation visible to everyone":"Hide this annotationn from non-moderators",variant:"dark",children:e.hidden?"Unhide":"Hide"})})]}):null}),["api","toastMessenger"]);function zf({threadIsCollapsed:e,onToggleReplies:t}){const n=e?"collapsed":"expand-menu",r=e?"Expand replies":"Collapse replies";return Ur("div",{
|
|
576
|
+
className:Bn("cursor-auto",{"bg-thread-line":!e}),"data-testid":"thread-collapse-channel",children:Ur("div",{className:Bn("bg-white"),children:Ur(Wr,{classes:Bn("-mt-1 touch:min-w-[auto] touch:min-h-[auto]"),expanded:!e,icon:n,title:r,onClick:t,size:"medium",variant:"light"})})})}var Rf=Ro((function e({thread:t,threadsService:n}){const r=!!t.parent,o=t.children.filter((e=>Es(e)>0)),i=rs(),a=i.hasAppliedFilter(),s=t.annotation&&i.isSavingAnnotation(t.annotation),l=t.annotation&&!!i.getDraft(t.annotation)&&!s,c=zr((()=>i.setExpanded(t.id,!!t.collapsed)),[i,t.id,t.collapsed]),u=!r&&!l&&!a&&t.replyCount>0,d=Lr((()=>t.visible&&Ur(Gn,{children:t.annotation?Ur(Gn,{children:[Ur(Lf,{annotation:t.annotation}),Ur(Nf,{annotation:t.annotation,isReply:r,onToggleReplies:u?c:void 0,replyCount:t.replyCount,threadIsCollapsed:t.collapsed})]}):Ur(Mf,{isReply:r,onToggleReplies:u?c:void 0,replyCount:t.replyCount,threadIsCollapsed:t.collapsed})})),[r,c,u,t.annotation,t.replyCount,t.collapsed,t.visible]);return Ur("section",{
|
|
577
|
+
className:"flex","data-testid":"thread-container",children:[r&&Ur(zf,{threadIsCollapsed:t.collapsed,onToggleReplies:c}),Ur("div",{className:Bn("grow max-w-full"),"data-testid":"thread-content",children:[d,Cs(t)>0&&Ur("div",{className:"space-y-2",children:[!t.parent&&t.annotation&&Ur(Cf,{annotation:t.annotation,isEditing:l,replyCount:t.replyCount,threadIsCollapsed:t.collapsed}),Ur("div",{children:Ur(Kr,{onClick:()=>n.forceVisible(t),children:["Show ",Cs(t)," more in conversation"]})})]}),!t.collapsed&&Ur("ul",{className:Bn("-ml-3"),"data-testid":"thread-children",children:o.map((t=>Ur("li",{className:Bn("mt-2","[text-align:start]"),children:Ur(e,{thread:t,threadsService:n})},t.id)))})]})]})}),["threadsService"]);var Of=Ro((function({frameSync:e,thread:t}){var n,r;const o=rs(),i=null!==(n=null===(r=t.annotation)||void 0===r?void 0:r.$tag)&&void 0!==n?n:null,a=i&&o.isAnnotationHovered(i),s=Lr((()=>Ys((t=>{const n=t?[t]:[];e.hoverAnnotations(n)}),10)),[e]),l=zr((t=>{e.scrollToAnnotation(t)
|
|
578
|
+
}),[e]),c=Lr((()=>Ur(Rf,{thread:t})),[t]),u=o.annotationFocusRequest(),d=Mr(null);return Tr((()=>{u===t.id&&d.current&&(d.current.focus(),o.clearAnnotationFocusRequest())}),[u,o,t.id]),Ur(Qr,{classes:Bn("p-3 cursor-pointer focus-visible-ring",{"is-hovered":a}),"data-testid":"thread-card",elementRef:d,tabIndex:-1,onClick:e=>{var t;(t=e.target).closest("button")||t.closest("a")||!i||l(i)},onMouseEnter:()=>s(null!=i?i:null),onMouseLeave:()=>s(null),children:c},t.id)}),["frameSync"]);function If(){const e=document.querySelector(".js-thread-list-scroll-root");if(!e)throw new Error("Scroll container is missing");return e}function Df(e){return Math.max(e-e%50,0)}function Pf({threads:e}){const[t,n]=Er(0),[r,o]=Er(0);Nr((()=>{const e=new Ws,t=If();n(t.clientHeight),o(Df(t.scrollTop));const r=Ys((()=>{n(t.clientHeight),o(Df(t.scrollTop))}),10,{maxWait:100});return e.add(t,"scroll",r),e.add(window,"resize",r),()=>{e.removeAll(),r.cancel()}}),[])
|
|
579
|
+
;const[i,a]=Er((()=>new Map)),[s,l]=Er(null),c=e,{offscreenLowerHeight:u,offscreenUpperHeight:d,visibleThreads:h}=Lr((()=>function(e,t,n,r,o=Ks){const{defaultHeight:i,marginAbove:a,marginBelow:s}=o,l=[];let c=0,u=0,d=0;return e.forEach((e=>{const o=t.get(e.id)||i;c+o<n-a?u+=o:c<n+r+s?l.push(e):d+=o,c+=o})),{visibleThreads:l,offscreenUpperHeight:u,offscreenLowerHeight:d}}(c,i,r,t)),[c,i,r,t]),p=rs(),m=(()=>{const e=p.unsavedAnnotations();return e.length?e[e.length-1].$tag:null})();return Tr((()=>{m&&(p.setForcedVisible(m,!0),l(m))}),[p,m]),Tr((()=>{if(!s)return;const e=c.findIndex((e=>e.id===s));if(-1===e)return;l(null);const t=c.slice(0,e).reduce(((e,t)=>e+(e=>i.get(e.id)||Ks.defaultHeight)(t)),0);If().scrollTop=t}),[s,c,i]),Tr((()=>{a((e=>{const t=new Map;for(let{id:n}of h){const r=document.getElementById(n);if(!r)return console.warn("ThreadList could not measure thread. Element not found."),e;const o=Xs(r);o!==e.get(n)&&t.set(n,o)}return 0===t.size?e:new Map([...e,...t])}))}),[h]),Ur("div",{
|
|
580
|
+
children:[Ur("div",{style:{height:d}}),h.map((e=>Ur("div",{className:Bn("mb-3"),"data-testid":"thread-card-container",id:e.id,children:Ur(Of,{thread:e})},e.id))),Ur("div",{style:{height:u}})]})}function Bf({errorType:e,onLoginRequest:t,showClearSelection:n=!1}){const r=rs(),o=r.isLoggedIn();return Ur("div",{className:"mb-4",children:Ur(vo,{icon:"restricted",title:"annotation"===e?"Annotation unavailable":"Group unavailable",children:[Ur("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.`}),Ur("div",{className:"flex justify-end space-x-2",children:[n&&Ur(Kr,{variant:o?"primary":void 0,onClick:()=>r.clearSelection(),children:"Show all annotations"}),!o&&Ur(Kr,{
|
|
581
|
+
variant:"primary",onClick:t,children:"Log in"})]})]})})}var Ff=Ro((function({loadAnnotationsService:e,onLogin:t}){const n=rs(),r=n.routeParams().id,o=zs(),i=n.profile().userid,[a,s]=Er(!1);return Tr((()=>{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]),Ur(Gn,{children:[a&&Ur(Bf,{errorType:"annotation",onLoginRequest:t}),Ur(Pf,{threads:o.children})]})}),["loadAnnotationsService"]);function Hf({additionalCount:e=0,entitySingular:t="annotation",entityPlural:n="annotations",filterQuery:r,focusDisplayName:o,resultCount:i}){return Ur(Gn,{children:[i>0&&Ur("span",{children:"Showing "}),Ur("span",{className:"whitespace-nowrap font-bold",children:[i>0?i:"No"," ",1===i?t:n]}),r&&Ur("span",{children:[" ","for ",Ur("span",{className:"break-words",children:`'${r}'`})]}),o&&Ur("span",{children:[" ","by"," ",Ur("span",{
|
|
582
|
+
className:"whitespace-nowrap font-bold",children:o})]}),e>0&&Ur("span",{className:"whitespace-nowrap italic text-color-text-light",children:[" ","(and ",e," more)"]})]})}function jf(){const e=rs(),t=zs(),n=e.annotationCount(),r=e.directLinkedAnnotationId(),o=e.filterQuery(),i=e.focusState(),a=e.forcedVisibleThreads().length,s=e.selectedAnnotations().length,l=Lr((()=>s>0?"selection":o?"query":i.configured?"focus":null),[s,o,i]),c=Lr((()=>"selection"===l?s:Es(t)-a),[l,s,t,a]),u=Lr((()=>{if("selection"===l){return(t.children||[]).filter((e=>e.annotation&&e.visible)).length-s}return a}),[l,a,t.children,s]),d=Lr((()=>{if("selection"===l){return!i.configured&&!r?`Show all (${n})`:"Show all"}return"focus"===l?a>0?"Reset filters":i.active?"Show all":`Show only ${i.displayName}`:"Clear search"}),[n,r,i,l,a]);return Ur(Qr,{classes:Bn("mb-3 p-3",{"sr-only":!l}),children:Ur("div",{className:"flex items-center justify-center space-x-1",children:e.isLoading()?Ur(bo,{}):Ur(Gn,{children:[Ur("div",{
|
|
583
|
+
className:Bn("grow min-w-[0]"),role:"status",children:l&&Ur(Hf,{additionalCount:u,entitySingular:"query"===l?"result":"annotation",entityPlural:"query"===l?"results":"annotations",filterQuery:o,focusDisplayName:"selection"!==l&&i.active?i.displayName:"",resultCount:c})}),l&&Ur(Kr,{icon:"focus"===l?void 0:"cancel",onClick:"focus"!==l||a?()=>e.clearSelection():()=>e.toggleFocusMode(),title:d,variant:"primary",children:d})]})})})}function Uf({onLogin:e}){const t=rs();return Ur("div",{className:"flex flex-col items-center m-6 space-y-6",children:[Ur("span",{className:"text-center",children:["This is a public annotation created with Hypothesis. ",Ur("br",{}),"To reply or make your own annotations on this document,"," ",Ur(lo,{classes:"inline text-color-text underline hover:underline",href:t.getLink("signup"),target:"_blank",children:"create a free account"})," ","or"," ",Ur(Xr,{classes:"inline underline",onClick:e,variant:"dark",children:"log in"}),"."]}),Ur("div",{children:Ur(lo,{href:"https://hypothes.is",
|
|
584
|
+
"aria-label":"Hypothesis homepage",target:"_blank",title:"Hypothesis homepage",children:Ur(so,{name:"logo",classes:"w-16 h-16 text-grey-7"})})})]})}function qf(e,t,n){e.self===e?e.scrollTo(t,n):(e.scrollLeft=t,e.scrollTop=n)}function $f(e){var t=e._scrollSettings;if(t){var n=t.maxSynchronousAlignments,r=function(e,t){var n,r,o,i,a,s,l,c=e.align,u=e.target.getBoundingClientRect(),d=c&&null!=c.left?c.left:.5,h=c&&null!=c.top?c.top:.5,p=c&&null!=c.leftOffset?c.leftOffset:0,m=c&&null!=c.topOffset?c.topOffset:0,f=d,g=h;if(e.isWindow(t))s=Math.min(u.width,t.innerWidth),l=Math.min(u.height,t.innerHeight),r=u.left+t.pageXOffset-t.innerWidth*f+s*f,o=u.top+t.pageYOffset-t.innerHeight*g+l*g,r-=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),_=u.top-(n.top-t.scrollTop);r=v+s*f-t.clientWidth*f,o=_+l*g-t.clientHeight*g,r-=p,o-=m,
|
|
585
|
+
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 qf(e,r.x,r.y),e._scrollSettings=null,t.end("complete");var a=1-t.ease(i);if(qf(e,r.x-r.differenceX*a,r.y-r.differenceY*a),o>=t.time)return t.endIterations++,t.scrollAncestor&&$f(t.scrollAncestor),void $f(e);!function(e){if("requestAnimationFrame"in window)return window.requestAnimationFrame(e);setTimeout(e,16)}($f.bind(null,e))}}function Gf(e){return e.self===e}function Vf(e){return"pageXOffset"in e||(e.scrollHeight!==e.clientHeight||e.scrollWidth!==e.clientWidth)&&"hidden"!==getComputedStyle(e).overflow}function Yf(){return!0}function Wf(e){if(e.assignedSlot)return Wf(e.assignedSlot)
|
|
586
|
+
;if(e.parentElement)return"body"===e.parentElement.tagName.toLowerCase()?e.parentElement.ownerDocument.defaultView||e.parentElement.ownerDocument.ownerWindow:e.parentElement;if(e.getRootNode){var t=e.getRootNode();if(11===t.nodeType)return t.host}}var Kf=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||{};var r=Wf(e),o=1,i=t.validTarget||Yf,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,Vf):Vf(r))&&(o++,s.push(r)),!(r=Wf(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),
|
|
587
|
+
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 d=n.maxSynchronousAlignments;return null==d&&(d=3),t._scrollSettings={startTime:l,endIterations:0,target:e,time:n.time,ease:n.ease,align:n.align,isWindow:n.isWindow||Gf,maxSynchronousAlignments:d,end:u,scrollAncestor:r},"cancellable"in n&&!n.cancellable||(i=u.bind(null,"canceled"),t.addEventListener("touchstart",i,c),t.addEventListener("wheel",i,c)),a&&$f(t),i}(e,r,t,s[o+1],l)),null)}function l(e){--o||n&&n(e)}};function Xf({children:e,icon:t="",panelName:n,title:r,onActiveChanged:o}){const i=rs(),a=i.isSidebarPanelOpen(n),s=Mr(null),l=Mr(a);Tr((()=>{l.current!==a&&(l.current=a,a&&s.current&&Kf(s.current),"function"==typeof o&&o(a))}),[a,o]);const c=zr((()=>{i.toggleSidebarPanel(n,!1)}),[i,n]);return Ur(of,{visible:a,children:Ur("div",{ref:s,className:"mb-4",children:Ur(vo,{title:r,icon:t,onClose:c,children:e})})})}
|
|
588
|
+
function Zf({onLogin:e,onSignUp:t}){return rs().isLoggedIn()?null:Ur(Xf,{icon:"restricted",title:"Login needed",panelName:"loginPrompt",children:[Ur("p",{children:"Please log in to create annotations or highlights."}),Ur(eo,{children:[Ur(Kr,{title:"Sign up",onClick:t,children:"Sign up"}),Ur(Kr,{title:"Log in",variant:"primary",onClick:e,children:"Log in"})]})]})}function Jf({children:e,count:t,isWaitingToAnchor:n,isSelected:r,label:o,onSelect:i}){const a=()=>{r||i()},s=t>0?`${o} (${t} available)`:o;return Ur(Xr,{classes:Bn("inline bg-transparent min-w-[5.25rem] text-color-text hover:!no-underline",{"font-bold":r}),onClick:a,onMouseDown:a,pressed:!!r,role:"tab",tabIndex:0,title:s,children:Ur(Gn,{children:[e,t>0&&!n&&Ur("span",{className:"relative bottom-[3px] left-[2px] text-tiny",children:t})]})})}var Qf=Ro((function({annotationsService:e,isLoading:t,settings:n}){const r=rs(),o=r.selectedTab(),i=r.noteCount(),a=r.annotationCount(),s=r.orphanCount(),l=r.isWaitingToAnchorAnnotations(),c=e=>{r.clearSelection(),
|
|
589
|
+
r.selectTab(e)},u="annotation"===o&&0===a&&!l,d="note"===o&&0===i;return Ur("div",{className:Bn("space-y-3 pb-[9px]"),children:[Ur("div",{className:"flex gap-x-6 theme-clean:ml-[15px]",role:"tablist",children:[Ur(Jf,{count:a,isWaitingToAnchor:l,isSelected:"annotation"===o,label:"Annotations",onSelect:()=>c("annotation"),children:"Annotations"}),Ur(Jf,{count:i,isWaitingToAnchor:l,isSelected:"note"===o,label:"Page notes",onSelect:()=>c("note"),children:"Page Notes"}),s>0&&Ur(Jf,{count:s,isWaitingToAnchor:l,isSelected:"orphan"===o,label:"Orphans",onSelect:()=>c("orphan"),children:"Orphans"})]}),"note"===o&&n.enableExperimentalNewNoteButton&&Ur("div",{className:"flex justify-end",children:Ur(Kr,{"data-testid":"new-note-button",icon:"add",onClick:()=>e.createPageNote(),variant:"primary",style:Lo(["ctaBackgroundColor"],n),children:"New note"})}),!t&&d&&Ur(Jr,{classes:"text-center",children:Ur("span",{"data-testid":"notes-unavailable-message",children:"There are no page notes in this group."})}),!t&&u&&Ur(Jr,{
|
|
590
|
+
classes:"text-center",children:Ur("span",{"data-testid":"annotations-unavailable-message",children:["There are no annotations in this group.",Ur("br",{}),"Create one by selecting some text and clicking the"," ",Ur(so,{classes:"inline m-0.5 -mt-0.5",name:"annotate",title:"Annotate"})," ","button."]})})]})}),["annotationsService","settings"]);var eg=Ro((function({frameSync:e,onLogin:t,onSignUp:n,loadAnnotationsService:r,streamer:o}){const i=zs(),a=rs(),s=a.focusedGroupId(),l=a.hasAppliedFilter()||a.hasSelectedAnnotations(),c=a.isLoading(),u=a.isLoggedIn(),d=a.directLinkedAnnotationId(),h=d?a.findAnnotationByID(d):void 0,p=h?ks(h):"annotation",m=a.searchUris(),f=a.hasSidebarOpened(),g=a.profile().userid,v=h&&!1===h.$orphan?h.$tag:null,_=!(c||!d)&&!h,b=a.directLinkedGroupFetchFailed(),y=_||b,w=!y,x=!y&&!l,k=d&&!u&&!_&&!c,S=Mr(s);Tr((()=>{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})
|
|
591
|
+
}),[a,r,s,g,m]),Tr((()=>{v?(e.hoverAnnotations([v]),e.scrollToAnnotation(v),a.selectTab(p)):h&&a.selectTab(p)}),[p,e,h,v,a]);const C=a.hasFetchedProfile();return Tr((()=>{C&&(f||u)&&o.connect({applyUpdatesImmediately:!1})}),[C,u,f,o]),Ur("div",{children:[Ur("h2",{className:"sr-only",children:"Annotations"}),w&&Ur(jf,{}),Ur(Zf,{onLogin:t,onSignUp:n}),_&&Ur(Bf,{errorType:"annotation",onLoginRequest:t,showClearSelection:!0}),b&&Ur(Bf,{errorType:"group",onLoginRequest:t}),x&&Ur(Qf,{isLoading:c}),Ur(Pf,{threads:i.children}),k&&Ur(Uf,{onLogin:t})]})}),["frameSync","loadAnnotationsService","streamer"]);var tg=Ro((function({api:e,toastMessenger:t}){const n=rs(),r=n.routeParams().q,o=zr((async t=>{const r={_separate_replies:!0,offset:0,limit:20,...gs(t)};try{n.annotationFetchStarted();const t=await e.search(r);n.addAnnotations([...t.rows,...t.replies])}finally{n.annotationFetchFinished()}}),[e,n]);return Tr((()=>{n.setSortKey("Newest"),n.clearAnnotations(),o(r).catch((e=>{
|
|
592
|
+
t.error(`Unable to fetch annotations: ${e.message}`)}))}),[r,o,n,t]),Ur(Pf,{threads:zs().children})}),["api","toastMessenger"]);class ng{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.1124.0",this.userAgent=n.navigator.userAgent,this.urls=t.map((e=>e.uri)).join(", ")||a,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 rg(e){const n=t(e);return!(null==n||!n.authority)&&n.authority!==e.authDomain}function og({commandName:e,iconName:t}){return Ur("span",{className:"whitespace-nowrap",children:[Ur(so,{name:t,
|
|
593
|
+
classes:Bn("mx-1 -mt-1","text-color-text-light inline")}),Ur("em",{children:e})]})}var ig=Ro((function({settings:e}){const t=!rg(e);return Ur("ol",{className:"list-decimal pl-10 space-y-2",children:[Ur("li",{children:["To create an annotation, select text and then select the"," ",Ur(og,{iconName:"annotate",commandName:"Annotate"})," ","button."]}),Ur("li",{children:["To create a highlight (",Ur(lo,{classes:"underline hover:underline",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"," ",Ur(og,{iconName:"highlight",commandName:"Highlight"})," ","button."]}),t&&Ur("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"," ",Ur(lo,{classes:"underline hover:underline",href:"https://web.hypothes.is/help/how-to-join-a-private-group/",target:"_blank",children:"join link"}),")."]}),Ur("li",{
|
|
594
|
+
children:["To reply to an annotation, select the"," ",Ur(og,{iconName:"reply",commandName:"Reply"})," button."]})]})}),["settings"]);function ag({label:e,children:t,classes:n}){return Ur(Gn,{children:[Ur("dt",{className:"col-span-1 sm:text-right font-medium",children:e}),Ur("dd",{className:Bn("col-span-1 sm:col-span-3 text-color-text-light break-words",n),children:t})]})}var sg=Ro((function({toastMessenger:e,versionData:t}){return Ur("div",{className:"space-y-4",children:[Ur("dl",{className:"grid grid-cols-1 sm:grid-cols-4 sm:gap-x-2",children:[Ur(ag,{label:"Version",children:t.version}),Ur(ag,{label:"User Agent",children:t.userAgent}),Ur(ag,{classes:Bn("break-all"),label:"URL",children:t.urls}),Ur(ag,{label:"Fingerprint",children:t.fingerprint}),Ur(ag,{label:"Account",children:t.account}),Ur(ag,{label:"Date",children:t.timestamp})]}),Ur("div",{className:"flex items-center justify-center",children:Ur(Kr,{onClick:()=>{try{ol(t.asFormattedString()),e.success("Copied version info to clipboard")}catch(t){
|
|
595
|
+
e.error("Unable to copy version info")}},icon:"copy",children:"Copy version details"})})]})}),["toastMessenger"]);function lg({children:e,onClick:t}){return Ur(yl,{color:"brand",onClick:t,underline:"hover",children:Ur("div",{className:"flex items-center gap-x-1",children:[e,Ur(sl,{className:"w-em h-em"})]})})}function cg({linkText:e,url:t}){return Ur("div",{className:"flex-1 flex items-center justify-center border-r last-of-type:border-r-0 text-lg font-medium",children:Ur(bl,{color:"text-light",href:t,target:"_blank",children:Ur("div",{className:"flex items-center gap-x-2",children:[Ur("span",{children:e})," ",Ur(cl,{className:"w-3 h-3"})]})})})}var ug=Ro((function({auth:e,session:t}){const n=rs(),r=n.frames(),o=n.mainFrame(),i=!!n.profile().preferences.show_sidebar_tutorial,[a,s]=Er("tutorial"),l=Lr((()=>{const t=e||{status:"logged-out"},n=[...r].sort(((e,t)=>e===o?-1:t===o?1:0));return new ng(t,n)}),[e,r,o]),c=`https://web.hypothes.is/get-help/?sys_info=${l.asEncodedURLString()}`,u=(e,t)=>{
|
|
596
|
+
e.preventDefault(),s(t)};return Ur(Xf,{title:"Help",panelName:"help",onActiveChanged:zr((e=>{!e&&i&&t.dismissSidebarTutorial()}),[t,i]),children:Ur("div",{className:"space-y-4",children:[Ur("div",{className:"flex items-center",children:[Ur("h3",{className:"grow text-lg font-medium","data-testid":"subpanel-title",children:{tutorial:"Getting started",versionInfo:"About this version"}[a]}),"versionInfo"===a&&Ur(lg,{onClick:e=>u(e,"tutorial"),children:"Getting started"}),"tutorial"===a&&Ur(lg,{onClick:e=>u(e,"versionInfo"),children:"About this version"})]}),Ur("div",{className:"border-y py-4",children:["tutorial"===a&&Ur(ig,{}),"versionInfo"===a&&Ur(sg,{versionData:l})]}),Ur("div",{className:"flex items-center",children:[Ur(cg,{linkText:"Help topics",url:"https://web.hypothes.is/help/"}),Ur(cg,{linkText:"New support ticket",url:c})]})]})})}),["session"]),dg={exports:{}};function hg(){}hg.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){
|
|
597
|
+
var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){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}},dg.exports=hg;var pg=dg.exports.TinyEmitter=hg;class mg extends Error{constructor(e){super(`Results size exceeds ${e}`)}}function fg(e){return 0===e?50:200}class gg extends pg{constructor(e,{getPageSize:t=fg,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,
|
|
598
|
+
order:this._sortOrder,_separate_replies:this._separateReplies,...e};t&&(o.search_after=t);try{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 mg(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 vg({defaultOption:e,icon:t,onSelect:n,options:r,selectedOption:o,title:i}){const a=[e,...r],s=null!=o?o:e,l=Ur("span",{
|
|
599
|
+
className:Bn("shrink-0 flex items-center gap-x-2","text-color-text font-bold text-lg"),children:[t&&Ur(t,{className:"w-4 h-4"}),s.display]});return Ur(rf,{label:l,title:i,contentClass:Bn("max-h-[70vh] tall:max-h-[504px] overflow-y-auto"),children:a.map((e=>Ur(sf,{onClick:()=>n(e),isSelected:e.value===s.value,label:e.display},e.value)))})}function _g(){const e=rs(),t=e.getFilter("user"),n=function(){const e=rs(),t=e.allAnnotations(),n=e.getFocusFilters(),r=To(e.profile().userid),o=e.defaultAuthority(),i=e.isFeatureEnabled("client_display_names");return Lr((()=>{const e={};if(t.forEach((t=>{const n=To(t.user);e[n]=Zs(t,o,i)})),n.user){const t=To(n.user.value)||n.user.value;e[t]=n.user.display}const a=Object.keys(e).map((t=>({display:t===r?`${e[t]} (Me)`:e[t],value:t})));return a.sort(((e,t)=>r===e.value?-1:r===t.value?1:e.display.localeCompare(t.display))),a}),[t,r,o,i,n.user])}();return Ur(vg,{defaultOption:{value:"",display:"Everybody"},icon:fl,onSelect:t=>e.setFilter("user",t),options:n,selectedOption:t,
|
|
600
|
+
title:"Filter by user"})}function bg({forcedVisibleCount:e,isFiltered:t,isLoading:n,resultCount:r}){const o=zs(),i=n?r:Es(o),a=o.children.length>0,s=t&&e>0,l=i-e,c=o.children.length;return Ur("div",{className:"flex gap-x-1 leading-none",children:[n&&Ur(bo,{size:"small"}),!n&&Ur("h2",{className:"font-bold",children:[!a&&Ur("span",{children:"No results"}),a&&t&&Ur("span",{children:[l," ",1===l?"result":"results"]}),a&&!t&&Ur("span",{children:[c," ",1===c?"thread":"threads"]})]}),s&&Ur("h3",{className:"italic font-normal",children:["(and ",e," more)"]}),!t&&a&&Ur("h3",{className:"italic font-normal",children:["(",i," ",1===i?"annotation":"annotations",")"]})]})}function yg({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),n.blur()}
|
|
601
|
+
;return Ur("div",{className:"flex items-center text-lg","data-testid":"pagination-navigation",children:[Ur("div",{className:"w-28 h-10",children:o&&Ur(Kr,{classes:"p-navigation-button",icon:"arrow-left",title:"Go to previous page",onClick:t=>a(e-1,t.target),variant:"dark",children:"prev"})}),Ur("ul",{className:Bn("hidden","md:flex md:items-center md:justify-center md:gap-x-2","md:grow"),children:i.map(((t,n)=>Ur("li",{children:null===t?Ur("div",{"data-testid":"pagination-gap",children:"..."}):Ur(Kr,{classes:"p-navigation-button",title:`Go to page ${t}`,pressed:t===e,onClick:e=>a(t,e.target),variant:"dark",children:t.toString()},`page-${n}`)},n)))}),Ur("div",{className:Bn("w-28 h-10 flex justify-end","grow md:grow-0"),children:r&&Ur(Kr,{classes:"p-navigation-button",icon:"arrow-right",iconPosition:"right",title:"Go to next page",onClick:t=>a(e+1,t.target),variant:"dark",children:"next"})})]})}function wg({currentPage:e,isLoading:t,onChangePage:n,threads:r,pageSize:o=25}){
|
|
602
|
+
const{paginatedThreads:i,totalPages:a}=Lr((()=>{const t=r.filter((e=>Es(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 Ur(Gn,{children:[Ur(Pf,{threads:i}),!t&&Ur(yg,{currentPage:e,onChangePage:n,totalPages:a})]})}var xg=Ro((function({loadAnnotationsService:e,streamer:t}){var n;const r=rs(),o=r.getFilterValues(),i=r.focusedGroup(),a=r.forcedVisibleThreads().length,s=r.hasAppliedFilter(),l=r.isLoading(),c=r.annotationResultCount(),u=r.pendingUpdateCount(),d=zs(),h=null!==(n=null==i?void 0:i.name)&&void 0!==n?n:"…",p=(null==i?void 0:i.id)||r.directLinkedGroupId(),m=Mr(1),[f,g]=Er(1),[v,_]=Er(!1),b=e=>{e instanceof mg&&_(!0)},y=r.hasFetchedProfile();Tr((()=>{y&&t.connect({applyUpdatesImmediately:!1})}),[y,t]),Tr((()=>{r.setSortKey("Newest"),p&&e.load({groupId:p,sortBy:"updated",sortOrder:"desc",maxResults:5e3,onError:b,streamFilterBy:"group"})}),[e,p,r]);const w=e=>{g(e)};Tr((()=>{w(1)}),[o,i]);const x=Mr(null);Nr((()=>{
|
|
603
|
+
f!==m.current&&(x.current&&Kf(x.current),m.current=f)}),[f]);const k=`Show ${u} new or updated ${u>1?"annotations":"annotation"}`;return Ur("div",{className:"grid gap-2 lg:grid-cols-2","data-testid":"notebook-container",children:[Ur("header",{className:"leading-none lg:col-span-2",ref:x,children:Ur("h1",{className:"text-2xl font-bold","data-testid":"notebook-group-name",children:h})}),Ur("div",{className:"justify-self-start",children:Ur(_g,{})}),Ur("div",{className:"flex items-center lg:justify-self-end text-lg font-medium",children:[u>0&&!s&&Ur(Wr,{icon:"refresh",onClick:()=>t.applyPendingUpdates(),variant:"primary",title:k}),Ur(bg,{forcedVisibleCount:a,isFiltered:s,isLoading:l,resultCount:null!=c?c:0})]}),Ur("div",{className:"lg:col-span-2",children:[v&&Ur("div",{className:"py-4","data-testid":"notebook-messages",children:Ur(vo,{title:"Too many results to show",children:["This preview of the Notebook can show"," ",Ur("strong",{children:["up to ",5e3," results"]
|
|
604
|
+
})," at a time (there are"," ",c," to show here)."," ",Ur("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."]})}),Ur(wg,{currentPage:f,isLoading:l,onChangePage:w,threads:d.children})]})]})}),["loadAnnotationsService","streamer"]);var kg=Ro((function({toastMessenger:e}){const t=rs(),n=t.mainFrame(),r=t.focusedGroup(),o=`Share Annotations in ${r&&r.name||"..."}`,i=r&&n,a=i&&(s=n.uri,l=r.id,Js(s)?`https://hyp.is/go?url=${encodeURIComponent(s)}&group=${l}`:null);var s,l;return Ur(Xf,{title:o,panelName:"shareGroupAnnotations",children:[!i&&Ur("div",{className:"flex flex-row items-center justify-center",children:Ur(bo,{})}),i&&Ur("div",{className:"text-color-text-light space-y-3",children:a?Ur(Gn,{children:[Ur("div",{className:"text-color-text font-medium",
|
|
605
|
+
"data-testid":"sharing-intro",children:"private"===r.type?Ur("p",{children:"Use this link to share these annotations with other group members:"}):Ur("p",{children:"Use this link to share these annotations with anyone:"})}),Ur("div",{children:Ur(xo,{children:[Ur(wo,{"aria-label":"Use this URL to share these annotations",type:"text",value:a,readOnly:!0}),Ur(Wr,{icon:"copy",onClick:()=>{try{ol(a),e.success("Copied share link to clipboard")}catch(t){e.error("Unable to copy link")}},title:"Copy share link",variant:"dark"})]})}),Ur("p",{"data-testid":"sharing-details",children:["private"===r.type?Ur("span",{children:["Annotations in the private group"," ",Ur("em",{children:r.name})," are only visible to group members."]}):Ur("span",{children:["Anyone using this link may view the annotations in the group"," ",Ur("em",{children:r.name}),"."]})," ",Ur("span",{children:["Private (",Ur(so,{name:"lock",classes:"inline -mt-0.5"})," ",Ur("em",{children:"Only Me"}),") annotations are only visible to you."]})]}),Ur("div",{
|
|
606
|
+
className:"text-[24px]",children:Ur(kl,{shareURI:a})})]}):Ur("p",{"data-testid":"no-sharing",children:"These annotations cannot be shared because this document is not available on the web."})})]})}),["toastMessenger"]);function Sg({message:e,onDismiss:t}){const n="notice"!==e.type?`${e.type.charAt(0).toUpperCase()+e.type.slice(1)}: `:"",r="notice"===e.type?"cancel":e.type;return Ur(Qr,{classes:Bn("p-0 flex border",{"sr-only":e.visuallyHidden,"border-red-error":"error"===e.type,"border-yellow-notice":"notice"===e.type,"border-green-success":"success"===e.type}),onClick:()=>t(e.id),children:[Ur("div",{className:Bn("flex items-center p-3 text-white",{"bg-red-error":"error"===e.type,"bg-yellow-notice":"notice"===e.type,"bg-green-success":"success"===e.type}),children:Ur(so,{name:r,classes:Bn("mt-[2px]")})}),Ur("div",{className:Bn("grow p-3 !mt-0"),"data-testid":"toast-message-text",children:[Ur("strong",{children:n}),e.message,e.moreInfoURL&&Ur("div",{className:"text-right",children:Ur(lo,{href:e.moreInfoURL,
|
|
607
|
+
onClick:e=>e.stopPropagation(),target:"_new",children:"More info"})})]})]})}var Cg=Ro((function({toastMessenger:e}){return Ur("div",{children:Ur("ul",{"aria-live":"polite","aria-relevant":"additions",className:"absolute z-2 left-0 w-full",children:rs().getToastMessages().map((t=>Ur("li",{className:Bn("relative w-full container hover:cursor-pointer",{"mb-2":!t.visuallyHidden,"motion-safe:animate-slide-in-from-right lg:animate-fade-in":!t.isDismissed,"motion-reduce:animate-fade-in":!t.isDismissed,"animate-fade-out":t.isDismissed}),children:Ur(Sg,{message:t,onDismiss:t=>e.dismiss(t)})},t.id)))})})}),["toastMessenger"]);function Eg(e){return e.organization&&e.organization.name}function Ag(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]={...e.organization,groups:[]}),function(e,t){const n=Object.assign({},e),r=t.groups
|
|
608
|
+
;!r.length&&e.organization.logo&&(n.logo=e.organization.logo),r.push(n)}(e,t[n])})),t}function Tg(e){const t=Ag(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 Ng({heading:e,children:t}){return Ur(Gn,{children:[e&&Ur("h2",{className:"text-color-text-light p-3 leading-none uppercase",children:e}),Ur("ul",{className:"border-b",children:Qn(t).map((e=>Ur("li",{children:e},e.key)))})]})}var Mg=Ro((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=rs(),c=l.focusedGroupId(),u=t.id===c,d=t=>{t.stopPropagation(),t.preventDefault(),r(!e)},h="private"===t.type?"Copy invite link":"Copy activity link";return Ur(sf,{icon:t.logo||"blank",iconAlt:Eg(t),isDisabled:!s,isExpanded:!!a&&e,isSelected:u,isSubmenuVisible:a?e:void 0,label:t.name,onClick:s?()=>{l.clearDirectLinkedGroupFetchFailed(),l.clearDirectLinkedIds(),
|
|
609
|
+
n.focus(t.id)}:d,onToggleSubmenu:d,submenu:Ur(Gn,{children:[Ur("ul",{children:[i&&Ur("li",{children:Ur(sf,{href:i,icon:"external",isSubmenuItem:!0,label:"View group activity"})}),i&&Ur("li",{children:Ur(sf,{onClick:()=>(e=>{try{ol(e),o.success(`Copied link for "${t.name}"`)}catch(e){o.error("Unable to copy link")}})(i),icon:"copy",isSubmenuItem:!0,label:h})}),t.canLeave&&Ur("li",{children:Ur(sf,{icon:"leave",isSubmenuItem:!0,label:"Leave group",onClick:async()=>{const e=`Are you sure you want to leave the group "${t.name}"?`;await Eo({title:"Leave group?",message:e,confirmAction:"Leave"})&&n.leave(t.id)}})})]}),!s&&Ur("p",{className:Bn("p-2 pl-9 bg-grey-1 hyphens-none"),"data-testid":"unselectable-group-note",children:"This group is restricted to specific URLs."})]})})}),["groups","toastMessenger"]);function Lg({expandedGroup:e,onExpandGroup:t,groups:n,heading:r}){return Ur(Ng,{heading:r,children:n.map((n=>Ur(Mg,{isExpanded:n===e,onExpand:e=>t(e?n:null),group:n},n.id)))})}var zg=Ro((function({settings:e}){
|
|
610
|
+
const n=rs(),r=n.getCurrentlyViewingGroups(),o=n.getFeaturedGroups(),i=n.getMyGroups(),a=n.focusedGroup(),s=n.profile().userid,l=Lr((()=>Tg(i)),[i]),c=Lr((()=>Tg(o)),[o]),u=Lr((()=>Tg(r)),[r]),d=n.defaultAuthority(),h=s&&!No(s,d),p=n.getLink("groups.new"),[m,f]=Er(null);let g;if(a){const n=a.organization.logo||function(e){const n=t(e);return n&&n.icon?n.icon:null}(e)||"",r=Eg(a)?Eg(a):"";g=Ur("span",{className:Bn("shrink-0 flex items-center gap-x-1 text-lg text-color-text font-bold"),children:[n&&Ur("img",{className:Bn("relative top-[1px] w-4 h-4"),src:n,alt:r}),a.name]})}else g=Ur("span",{children:"…"});return!!rg(e)&&r.length+o.length+i.length<2?g:Ur(rf,{align:"left",contentClass:"min-w-[250px]",label:g,onOpenChanged:()=>f(null),title:a?`Select group (now viewing: ${a.name})`:"Select group",children:[u.length>0&&Ur(Lg,{expandedGroup:m,onExpandGroup:f,heading:"Currently Viewing",groups:u}),c.length>0&&Ur(Lg,{expandedGroup:m,onExpandGroup:f,heading:"Featured Groups",groups:c}),l.length>0&&Ur(Lg,{
|
|
611
|
+
expandedGroup:m,onExpandGroup:f,heading:"My Groups",groups:l}),h&&Ur(sf,{icon:"add",href:p,label:"New private group"})]})}),["settings"]);const Rg={alt:1,ctrl:2,meta:4,shift:8};function Og(e,t,{rootElement:n=document.documentElement}={}){const r=n=>{(function(e,t){const n=t.split("+").map((e=>e.toLowerCase()));let r=0,o=null;for(const e of n){const t=Rg[e];if(t)r|=t;else{if(null!==o)throw new Error("Multiple non-modifier keys specified");o=e}}if(!o)throw new Error(`Invalid shortcut: ${t}`);return((e.ctrlKey?Rg.ctrl:0)|(e.metaKey?Rg.meta:0)|(e.altKey?Rg.alt:0)|(e.shiftKey?Rg.shift:0))===r&&e.key.toLowerCase()===o})(n,e)&&t(n)};return n.addEventListener("keydown",r),()=>n.removeEventListener("keydown",r)}function Ig(e,t,{rootElement:n}={}){Tr((()=>{if(e)return Og(e,t,{rootElement:n})}),[e,t,n])}function Dg({alwaysExpanded:e,query:t,onSearch:n}){const r=rs().isLoading(),o=Mr();!function(e){const t=Mr(),n=zr((n=>{var r
|
|
612
|
+
;!n.metaKey&&!n.ctrlKey&&n.target instanceof HTMLElement&&["INPUT","TEXTAREA"].includes(n.target.tagName)||(t.current=document.activeElement,null===(r=e.current)||void 0===r||r.focus(),n.preventDefault(),n.stopPropagation())}),[e]),r=zr((()=>{var n;document.activeElement===e.current&&(t.current&&(t.current.focus(),t.current=null),null===(n=e.current)||void 0===n||n.blur())}),[e]),o=il()?"meta":"ctrl";Ig("/",n),Ig(`${o}+k`,n),Ig("escape",r)}(o);const[i,a]=Er(t),[s,l]=Er(t);t!==i&&(l(t),a(t));const c=e||t;return Ur("form",{action:"#",className:Bn("relative","flex items-center","bg-white/90 hover:bg-white transition-colors"),name:"searchForm",onSubmit:e=>{var t,r,a;(e.preventDefault(),null!==(t=o.current)&&void 0!==t&&t.value||i)&&n(null!==(r=null===(a=o.current)||void 0===a?void 0:a.value)&&void 0!==r?r:"")},children:[Ur(wo,{"aria-label":"Search",classes:Bn("order-1","text-base",{"border-0":!c,"focus:border":!0,border:c},{"max-w-0 p-0":!c,"focus:max-w-[150px] focus:p-1.5 focus:ml-[2px]":!0,
|
|
613
|
+
"max-w-[150px] p-1.5 ml-[2px]":c},"transition-[max-width] duration-300 ease-out"),"data-testid":"search-input",dir:"auto",type:"text",name:"query",placeholder:r?"Loading…":"Search…",disabled:r,inputRef:o,value:s||"",onInput:e=>l(e.target.value)}),!r&&Ur("div",{className:"order-0",children:Ur(Wr,{icon:"search",onClick:()=>{var e;return null===(e=o.current)||void 0===e?void 0:e.focus()},size:"small",title:"Search annotations"})}),r&&Ur(bo,{size:"small"})]})}function Pg(){const e=rs(),t=e.sortKey(),n=e.sortKeys().map((n=>Ur(sf,{label:n,onClick:()=>e.setSortKey(n),isSelected:n===t},n))),r=Ur("span",{className:"p-1",children:Ur(so,{name:"sort"})});return Ur("div",{className:"SortMenu",children:Ur(rf,{label:r,title:`Sort by ${t}`,align:"right",menuIndicator:!1,children:n})})}var Bg=Ro((function({router:e}){return Ur(Dg,{query:rs().routeParams().q,onSearch:t=>{e.navigate("stream",{q:t})},alwaysExpanded:!0})}),["router"]);var Fg=Ro((function({auth:e,frameSync:n,onLogout:r,settings:o}){
|
|
614
|
+
const i=rs(),a=i.defaultAuthority(),s=No(e.userid,a),l=t(o),[c,u]=Er(!1),d=e=>l&&!!l[e],h=!s||d("onProfileRequestProvided"),p=!s||d("onLogoutRequestProvided"),m=()=>{n.notifyHost("openNotebook",i.focusedGroupId())},f=()=>s&&n.notifyHost("profileRequested"),g=(()=>{const t={};return h&&(s||(t.href=i.getLink("user",{user:e.username})),t.onClick=f),t})(),v=Ur("span",{className:"p-1",children:Ur(so,{name:"profile"})});return Ur("div",{"data-testid":"user-menu",onKeyDown:e=>{"n"===e.key&&(m(),u(!1))},children:Ur(rf,{label:v,title:e.displayName,align:"right",open:c,onOpenChanged:u,children:[Ur(Ng,{children:[Ur(sf,{label:e.displayName,isDisabled:!h,...g}),!s&&Ur(sf,{label:"Account settings",href:i.getLink("account.settings")}),Ur(sf,{label:"Open notebook",onClick:()=>m()})]}),p&&Ur(Ng,{children:Ur(sf,{label:"Log out",onClick:r})})]})})}),["frameSync","settings"]);var Hg=Ro((function({auth:e,frameSync:n,isSidebar:r,onLogin:o,onLogout:i,onSignUp:a,settings:s,streamer:l}){
|
|
615
|
+
const c=!rg(s),u=Lo(["accentColor"],s),d=rs(),h=d.filterQuery(),p=d.pendingUpdateCount(),m=d.isSidebarPanelOpen("help"),f=d.isSidebarPanelOpen("shareGroupAnnotations");return Ur("div",{className:Bn("absolute h-10 left-0 top-0 right-0 z-4","text-grey-7 border-b theme-clean:border-b-0 bg-white"),"data-testid":"top-bar",children:Ur("div",{className:Bn("container flex items-center h-full","text-xl"),"data-testid":"top-bar-content",children:[Ur(r?zg:Bg,{}),Ur("div",{className:"grow flex items-center justify-end",children:[r&&Ur(Gn,{children:[p>0&&Ur(Wr,{icon:"refresh",onClick:()=>l.applyPendingUpdates(),size:"small",variant:"primary",title:`Show ${p} new/updated ${1===p?"annotation":"annotations"}`}),Ur(Dg,{query:h||null,onSearch:d.setFilterQuery}),Ur(Pg,{}),c&&Ur(Wr,{icon:"share",expanded:f,onClick:()=>{d.toggleSidebarPanel("shareGroupAnnotations")},size:"small",title:"Share annotations on this page"})]}),Ur(Wr,{icon:"help",expanded:m,onClick:()=>{const e=t(s)
|
|
616
|
+
;e&&e.onHelpRequestProvided?n.notifyHost("helpRequested"):d.toggleSidebarPanel("help")},size:"small",title:"Help"}),"logged-in"===e.status?Ur(Fg,{auth:e,onLogout:i}):Ur("div",{className:"flex items-center text-lg font-medium space-x-1","data-testid":"login-links",children:["unknown"===e.status&&Ur("span",{children:"⋯"}),"logged-out"===e.status&&Ur(Gn,{children:[Ur(Xr,{classes:"inline",onClick:a,style:u,variant:"primary",children:"Sign up"}),Ur("div",{children:"/"}),Ur(Xr,{classes:"inline",onClick:o,style:u,variant:"primary",children:"Log in"})]})]})]})]})})}),["frameSync","settings","streamer"]);var jg=Ro((function({auth:e,frameSync:n,settings:r,session:o,toastMessenger:i}){const a=rs(),s=a.hasFetchedProfile(),l=a.profile(),c=a.route(),u=Lr((()=>s?function(e){const t=Ao(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"}}(l):{status:"unknown"
|
|
617
|
+
}),[s,l]),d=Lr((()=>Lo(["appBackgroundColor"],r)),[r]),h="clean"===r.theme,p="sidebar"===c;Tr((()=>{(function(e,n,r){const o="object"==typeof n.preferences&&!!n.preferences.show_sidebar_tutorial,i=t(r)||{onHelpRequestProvided:!1};return e&&!i.onHelpRequestProvided&&o})(p,l,r)&&a.openSidebarPanel("help")}),[p,l,r,a]);const m=async()=>{if(t(r))n.notifyHost("loginRequested");else try{await e.login(),a.closeSidebarPanel("loginPrompt"),a.clearGroups(),o.reload()}catch(e){i.error(e.message)}},f=()=>{t(r)?n.notifyHost("signupRequested"):window.open(a.getLink("signup"))};return Ur("div",{className:Bn("h-full min-h-full overflow-scroll","lg:pb-16 bg-grey-2","js-thread-list-scroll-root",{"theme-clean":h,"pt-[49px]":"notebook"!==c,"p-4 lg:p-12":"notebook"===c}),"data-testid":"hypothesis-app",style:d,children:["notebook"!==c&&Ur(Hg,{auth:u,onLogin:m,onSignUp:f,onLogout:async()=>{await(async()=>{const e=a.countDrafts();if(0===e)return!0;let t=""
|
|
618
|
+
;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?"),Eo({title:"Discard drafts?",message:t,confirmAction:"Discard"})})()&&(a.clearGroups(),a.removeAnnotations(a.unsavedAnnotations()),a.discardAllDrafts(),t(r)?n.notifyHost("logoutRequested"):o.logout())},isSidebar:p}),Ur("div",{className:"container",children:[Ur(Cg,{}),Ur(ug,{auth:"logged-in"===u.status?u:{}}),Ur(kg,{}),c&&Ur("main",{children:["annotation"===c&&Ur(Ff,{onLogin:m}),"notebook"===c&&Ur(xg,{}),"stream"===c&&Ur(tg,{}),"sidebar"===c&&Ur(eg,{onLogin:m,onSignUp:f})]})]})]})}),["auth","frameSync","session","settings","toastMessenger"]);function Ug({error:e}){return Ur("div",{className:Bn("m-2 mt-12"),children:Ur(vo,{title:"Unable to start Hypothesis",children:e.message})})}class qg{constructor(e,t,n){this._activity=e,this._api=t,this._store=n}_applyDraftChanges(e){const t={},n=this._store.getDraft(e)
|
|
619
|
+
;return n&&(t.tags=n.tags,t.text=n.text,t.permissions=n.isPrivate?Qs(e.user):el(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;if(!i)throw new Error("Cannot create annotation when logged out");const s=o.user_info,l="s:"+a(8),c=Object.assign({created:t.toISOString(),group:r,permissions:tl(i,r,n),tags:[],text:"",updated:t.toISOString(),user:i,user_info:s,$tag:l,hidden:!1,links:{},document:{title:""}},e);return wi(c)&&(c.permissions=Qs(i)),c}create(e,t=new Date){const n=this._initialize(e,t);this._store.addAnnotations([n]),this._store.deleteNewAndEmptyDrafts(),wi(n)||this._store.createDraft(n,{tags:n.tags,text:n.text,isPrivate:!vi(n)}),ki(n)?this._store.selectTab("note"):Si(n)&&this._store.selectTab("annotation"),(n.references||[]).forEach((e=>{this._store.setExpanded(e,!0)}))}createPageNote(){
|
|
620
|
+
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._activity.reportActivity("delete",e),this._store.removeAnnotations([e])}async flag(e){await this._api.annotation.flag({id:e.id}),this._activity.reportActivity("flag",e),this._store.updateFlagStatus(e.id,!0)}reply(e,t){const n={group:e.group,permissions:vi(e)?el(t,e.group):Qs(t),references:(e.references||[]).concat(e.id),target:[{source:e.target[0].source}],uri:e.uri};this.create(n)}async save(e){let t,n;const r=this._applyDraftChanges(e);let o;fi(e)?(t=this._api.annotation.update({id:e.id},r),n="update"):(t=this._api.annotation.create({},r),n="create"),this._store.annotationSaveStarted(e);try{o=await t,this._activity.reportActivity(n,o)}finally{this._store.annotationSaveFinished(e)}for(let[t,n]of Object.entries(e))if(t.startsWith("$")){o[t]=n}
|
|
621
|
+
return this._store.removeDraft(e),this._store.addAnnotations([o]),o}}qg.$inject=["annotationActivity","api","store"];class $g{constructor(e){this._rpc=e.rpc,this._reportConfig=e.reportActivity}reportActivity(e,t){if(!this._rpc||!this._reportConfig)return;let n;switch(e){case"create":n=new Date(t.created).toISOString();break;case"update":n=new Date(t.updated).toISOString();break;default:n=(new Date).toISOString()}const r={date:n,annotation:{id:t.id,isShared:nl(t.permissions)}};this._reportConfig.events.includes(e)&&function(e,t,n,r=[]){const o={jsonrpc:"2.0",method:n,params:r};e.postMessage(o,t)}(this._rpc.targetFrame,this._rpc.origin,this._reportConfig.method,[e,r])}}$g.$inject=["settings"];class Gg 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 Vg(e,t){let n,r;try{n=await fetch(e,t)}catch(t){throw new Gg(e,null,t.message)}if(204===n.status)return null;try{r=await n.json()}catch(t){
|
|
622
|
+
throw new Gg(e,n,"Failed to parse response")}var o;if(!n.ok)throw new Gg(e,n,null===(o=r)||void 0===o?void 0:o.reason);return r}function Yg(e){const t={};for(let[n,r]of Object.entries(e))n.startsWith("$")||(t[n]=r);return t}function Wg(e){return"url"in e}function Kg(e,t,{getAccessToken:n,getClientId:r,onRequestStarted:o,onRequestFinished:i}){return async(a,s)=>{o();try{const[o,l]=await Promise.all([e,n()]),c=function(e,t){let n=e;const r=t.split(".");for(let[e,t]of r.entries()){const o=n[t];if(!o||Wg(o)){if(o&&e===r.length-1)return o;break}n=o}return null}(o,t);if(!c)throw new Error(`Missing API route: ${t}`);const u={"Content-Type":"application/json","Hypothesis-Client-Version":"1.1124.0"};l&&(u.Authorization="Bearer "+l);const d=r();d&&(u["X-Client-Id"]=d);const{url:h,unusedParams:p}=Na(c.url,a),m=new URL(h);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 Vg(m.toString(),{body:s?JSON.stringify(Yg(s)):null,headers:u,
|
|
623
|
+
method:c.method})}finally{i()}}}class Xg{constructor(e,t,n){const r=e.routes();this._clientId=null;const o=()=>this._clientId,i=e=>Kg(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={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}}Xg.$inject=["apiRoutes","auth","store"];var Zg={exports:{}},Jg={};function Qg(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,
|
|
624
|
+
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 ev=Qg;Qg.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},Qg.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},Qg.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var n=this._timeouts.shift();if(void 0===n){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),n=this._cachedTimeouts.slice(-1)}var r=this;return this._timer=setTimeout((function(){r._attempts++,
|
|
625
|
+
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},Qg.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)},Qg.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},Qg.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},Qg.prototype.start=Qg.prototype.try,Qg.prototype.errors=function(){return this._errors},Qg.prototype.attempts=function(){return this._attempts},Qg.prototype.mainError=function(){if(0===this._errors.length)return null
|
|
626
|
+
;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=ev;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));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)
|
|
627
|
+
;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}}}(Jg);var tv=h(Zg.exports=Jg);function nv(e,t){return new Promise(((n,r)=>{const o=tv.operation(t);o.attempt((async()=>{try{const t=await e();o.retry(),n(t)}catch(e){o.retry(e)||r(e)}}))}))}function rv(e){return nv((()=>Vg(e)))}class ov{constructor(e){this._apiURL=e.apiUrl,this._routeCache=null,this._linkCache=null}routes(){return this._routeCache||(this._routeCache=rv(this._apiURL).then((e=>e.links))),this._routeCache}links(){return this._linkCache||(this._linkCache=this.routes().then((async e=>{const t=e.links;return await rv(t.url)}))),this._linkCache}}ov.$inject=["settings"];class iv extends Error{constructor(e,t){super(e),this.cause=t}}class av{constructor(e){this.clientId=e.clientId,
|
|
628
|
+
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 iv("Failed to revoke access token",e)}}authorize(e){const t=a(16),n=new Promise(((n,r)=>{e.addEventListener("message",(function o(i){"object"==typeof i.data&&i.data.state===t&&("authorization_response"===i.data.type&&n(i.data),"authorization_canceled"===i.data.type&&r(new Error("Authorization window was closed")),e.removeEventListener("message",o))}))})),r=new URL(this.authorizationEndpoint);r.searchParams.set("client_id",this.clientId),
|
|
629
|
+
r.searchParams.set("origin",e.location.origin),r.searchParams.set("response_mode","web_message"),r.searchParams.set("response_type","code"),r.searchParams.set("state",t);const o=`left=${e.screen.width/2-237.5},top=${e.screen.height/2-215},width=475,height=430`;if(!e.open(r.toString(),"Log in to Hypothesis",o))throw new Error("Failed to open login window");return n.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 Vg(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 iv("Failed to fetch access token",e)}return{accessToken:t.access_token,expiresAt:Date.now()+1e3*(t.expires_in-10),refreshToken:t.refresh_token}}}class sv extends pg{constructor(e,n,r,o,i){let a,s,l;super();const c=(u="token",d=o.apiUrl,new URL(u,d).href);var u,d;function h(){let e=new URL(o.apiUrl).hostname
|
|
630
|
+
;return e=e.replace(/\./g,"%2E"),`hypothesis.oauth.${e}.token`}function p(e){r.setObject(h(),e)}const m=async()=>{if(l)return l;const e=await n.links();return l=new av({clientId:o.oauthClientId,authorizationEndpoint:e["oauth.authorize"],revokeEndpoint:e["oauth.revoke"],tokenEndpoint:c}),l},f=()=>{var e;return null===(e=t(o))||void 0===e?void 0:e.grantToken},g=async()=>{if(!s){const e=f();void 0!==e?s=e?m().then((t=>t.exchangeGrantToken(e))).catch((e=>{var t;throw t="You must reload the page to annotate.",i.error(`Hypothesis login lost: ${t}`,{autoDismiss:!1}),e})):Promise.resolve(null):a?(s=(async e=>{const t=await m(),n=await t.exchangeAuthCode(e);return p(n),n})(a),a=null):s=Promise.resolve(function(){const e=r.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=s,t=await s;if(!t)return null;if(e!==s)return g();if(Date.now()>t.expiresAt){
|
|
631
|
+
const e=f();return s=(async(e,t)=>{const n=await m();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&&p(r),r})(t.refreshToken,{persist:void 0===e}),g()}return t.accessToken};(()=>{e.addEventListener("storage",(({key:e})=>{e===h()&&(s=null,this.emit("oauthTokensChanged"))}))})(),this.login=async function(){const t=await m(),n=await t.authorize(e);a=n,s=null},this.logout=async function(){const[e,t]=await Promise.all([s,m()]);e&&await t.revokeToken(e.accessToken),s=Promise.resolve(null),r.removeItem(h())},this.getAccessToken=g}}sv.$inject=["$window","apiRoutes","localStorage","settings","toastMessenger"];class lv{constructor(e,t,n){this._annotationsService=e,this._toastMessenger=t,this._store=n,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),
|
|
632
|
+
nv((()=>this._annotationsService.save(t))).then((()=>{this._toastMessenger.success("Highlight saved",{visuallyHidden:!0})})).catch((()=>{this._failed.add(n)})).finally((()=>{this._saving.delete(n)})))}))}))}isSaving(){return this._saving.size>0}}function cv(e,t){return!!function(e){if(null===e||"object"!=typeof e)return!1;for(let t of["frame1","frame2","type","requestId"])if("string"!=typeof e[t])return!1;return!0}(e)&&JSON.stringify(e,Object.keys(t).sort())===JSON.stringify(t,Object.keys(t).sort())}lv.$inject=["annotationsService","toastMessenger","store"];class uv{constructor({hostFrame:e,source:t}){this._hostFrame=e,this._source=t,this._listeners=new Ws}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),!t)throw new Error("Invalid request of channel/port");const n=a(6);return new Promise(((t,r)=>{const o=()=>{
|
|
633
|
+
this._hostFrame.postMessage({frame1:this._source,frame2:e,type:"request",requestId:n},"*")},i=setInterval(o,250),a=setTimeout((()=>{clearInterval(i),r(new Error(`Unable to establish ${this._source}-${e} communication channel`))}),2e4),s=this._listeners.add(window,"message",(r=>{const{data:o,ports:l}=r;cv(o,{frame1:this._source,frame2:e,type:"offer",requestId:n})&&(clearInterval(i),clearTimeout(a),this._listeners.remove(s),t(l[0]))}));o()}))}}function dv(e,t,n=[],r=-1){e.postMessage({protocol:"frame-rpc",version:"1.0.0",arguments:n,method:t,sequence:r})}class hv{constructor({userAgent:e=navigator.userAgent,currentWindow:t=window}={}){this._port=null,this._methods=new Map,this._sequence=1,this._callbacks=new Map,this._listeners=new Ws,this._listeners.add(t,"unload",(()=>{this._port&&(dv(this._port,"close"),t!==t.parent&&function(e){const t=e.match(/\bAppleWebKit\/([0-9]+)\b/);return!!t&&!(parseInt(t[1])<=537)}(e)&&t.parent.postMessage({type:"hypothesisPortClosed"},"*",[this._port]))})),this._pendingCalls=[],
|
|
634
|
+
this._receivedCloseEvent=!1}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(),dv(e,"connect");for(let[e,t]of this._pendingCalls)this.call(e,...t);this._pendingCalls=[]}destroy(){this._port&&(dv(this._port,"close"),this._port.close()),this._destroyed=!0,this._listeners.removeAll()}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)),dv(this._port,e,t,n)}_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){if("close"===t.method){if(this._receivedCloseEvent)return;this._receivedCloseEvent=!0}const e=this._methods.get(t.method);if(!e)return
|
|
635
|
+
;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 pv(e,t,n,r){let o=t();return e((()=>{const e=t();if(r?r(e,o):e===o)return;const i=o;o=e,n(e,i)}))}function mv({$tag:e,target:t,uri:n}){return{$tag:e,target:t,uri:n}}function fv(e,t){const n=e.find((e=>e.uri===t.uri));if(n)return n;const r=e.find((e=>null===e.id));return r||e[0]}class gv{constructor(e,t,n){this._window=e,this._annotationsService=t,this._store=n,this._portFinder=new uv({hostFrame:this._window.parent,source:"sidebar"}),this._listeners=new Ws,this._hostRPC=new hv,this._guestRPC=new Map,this._nextGuestId=0,this._inFrame=new Set,this._highlightsVisible=!1,this._setupSyncToGuests(),this._setupHostEvents(),this._setupFeatureFlagSync()}_setupSyncToGuests(){let e=0;const t=(t,n,r)=>{let o=0;const i=new Set,a=[];t.forEach((e=>{
|
|
636
|
+
mi(e)||(vi(e)&&++o,i.add(e.$tag),this._inFrame.has(e.$tag)||a.push(e))}));const s=r.filter((e=>!i.has(e.$tag)));if(a.length>0){const e=new Map;for(let t of a){var l;const r=fv(n,t);if(!r)continue;const o=null!==(l=e.get(r.id))&&void 0!==l?l:[];o.push(t),e.set(r.id,o)}for(let[t,n]of e){const e=this._guestRPC.get(t);e&&e.call("loadAnnotations",n.map(mv))}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))};pv(this._store.subscribe,(()=>[this._store.allAnnotations(),this._store.frames()]),(([e,n],[r])=>t(e,n,r)),pa),pv(this._store.subscribe,(()=>this._store.getContentInfo()),(e=>{this._guestRPC.forEach((t=>{t.call("showContentInfo",e)}))}))}_connectGuest(e){const t=new hv;++this._nextGuestId;let n=`temp-${this._nextGuestId}`;this._guestRPC.set(n,t),t.on("documentInfoChanged",(e=>{
|
|
637
|
+
this._guestRPC.delete(n),n=e.frameIdentifier,this._guestRPC.set(n,t),this._store.connectFrame({id:e.frameIdentifier,metadata:e.metadata,uri:e.uri})})),t.on("close",(()=>{const e=this._store.frames().find((e=>e.id===n));e&&this._store.destroyFrame(e),t.destroy(),this._guestRPC.delete(n)})),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 r={};const o=Ys((()=>{this._store.updateAnchorStatus(r),r={}}),10);t.on("syncAnchoringStatus",(({$tag:e,$orphan:t})=>{this._inFrame.add(e),r[e]=t?"orphan":"anchored",o()})),t.on("showAnnotations",((e,t=!1)=>{const n=this._store.findIDsForTags(e);this._store.selectAnnotations(n),this._store.selectTab("annotation"),
|
|
637
638
|
n.length>0&&t&&(this._store.setAnnotationFocusRequest(n[0]),window.focus())})),t.on("hoverAnnotations",(e=>{this._store.hoverAnnotations(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")})),t.connect(e),t.call("setHighlightsVisible",this._highlightsVisible),t.call("featureFlagsUpdated",this._store.profile().features);const i=this._store.getContentInfo();i&&t.call("showContentInfo",i)}_setupHostEvents(){this._hostRPC.on("sidebarOpened",(()=>{this._store.setSidebarOpened(!0)})),this._hostRPC.on("setHighlightsVisible",(e=>{this._highlightsVisible=e,this._guestRPC.forEach((t=>t.call("setHighlightsVisible",e)))}))}_setupFeatureFlagSync(){const e=()=>this._store.profile().features,t=e=>{this._hostRPC.call("featureFlagsUpdated",e);for(let t of this._guestRPC.values())t.call("featureFlagsUpdated",e)};t(e()),
|
|
638
|
-
|
|
639
|
-
;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,
|
|
640
|
-
_fetchGroup(e){return this._api.group.read({id:e,expand:
|
|
641
|
-
;if(h){f=h.group;const e=c.concat(u).find((e=>e.id===h.group));if(!e)try{const e=await this._fetchGroup(h.group);u.push(e)}catch(e){this._toastMessenger.error("Unable to fetch group for linked annotation")}}const g=null!==d,v=await this._filterGroups(m(c,u,n,this._settings),g,f,i),_=f||i||null;return this._addGroupsToStore(v,_),v}async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:
|
|
642
|
-
this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(e)}return this._loadGroupsForUserAndDocument();var n}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=>!
|
|
643
|
-
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
|
|
644
|
-
t=await this._api.annotation.get({id:e}),
|
|
645
|
-
}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)}}
|
|
646
|
-
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){this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}
|
|
647
|
-
;this._api=n,this._auth=r,this._store=e,this._toastMessenger=i,this._authority=null!==(a=null===(s=t(o))||void 0===s?void 0:s.authority)&&void 0!==a?a:null,this._lastLoad=null,this._lastLoadTime=null,r.on("oauthTokensChanged",(()=>this.reload()))}load(){return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=
|
|
648
|
-
throw this._toastMessenger.error("Log out failed"),new Error(e)}}reload(){return this._lastLoad=null,this._lastLoadTime=null,this.load()}}
|
|
649
|
-
;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
|
|
639
|
+
pv(this._store.subscribe,e,t)}async connect(){const e=await this._portFinder.discover("host");this._hostRPC.connect(e),this._listeners.add(e,"message",(e=>{const{data:t,ports:n}=e;cv(t,{frame1:"guest",frame2:"sidebar",type:"offer"})&&this._connectGuest(n[0])}))}notifyHost(e,...t){this._hostRPC.call(e,...t)}hoverAnnotations(e){this._store.hoverAnnotations(e),this._guestRPC.forEach((t=>t.call("hoverAnnotations",e)))}scrollToAnnotation(e){this._guestRPC.forEach((t=>t.call("scrollToAnnotation",e)))}destroy(){this._portFinder.destroy(),this._listeners.removeAll()}}gv.$inject=["$window","annotationsService","store"];const vv={id:"__default__",name:"__DEFAULT__",logo:"data:image/svg+xml;utf8,"+encodeURIComponent(So)};const _v=["organization","scopes"];class bv{constructor(e,n,r,o,i,a){this._store=e,this._api=n,this._auth=r,this._settings=i,this._toastMessenger=a,this._serviceConfig=t(i),this._reloadSetUp=!1}_mainURI(){var e,t
|
|
640
|
+
;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,pv(this._store.subscribe,(()=>this._mainURI()),(()=>this.load())),pv(this._store.subscribe,(()=>[this._store.hasFetchedProfile(),this._store.profile().userid]),((e,[t])=>{t&&this.load()}),pa))}_addGroupsToStore(e,t){!function(e){e.forEach((e=>{e.organization&&"object"==typeof e.organization||(e.organization=vv)}))}(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))}
|
|
641
|
+
_fetchGroup(e){return this._api.group.read({id:e,expand:_v})}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;i&&(a=this._fetchGroup(i).then((e=>(this._store.clearDirectLinkedGroupFetchFailed(),e))).catch((()=>(this._store.setDirectLinkedGroupFetchFailed(),null))));const s={expand:_v},l=null===(e=this._serviceConfig)||void 0===e?void 0:e.authority;l&&(s.authority=l),n&&(s.document_uri=n);const[c,u,d,h,p]=await Promise.all([this._api.profile.groups.read({expand:_v}),this._api.groups.list(s),this._auth.getAccessToken(),o,a]);p&&!u.some((e=>e.id===p.id))&&u.push(p);let f=null
|
|
642
|
+
;if(h){f=h.group;const e=c.concat(u).find((e=>e.id===h.group));if(!e)try{const e=await this._fetchGroup(h.group);u.push(e)}catch(e){this._toastMessenger.error("Unable to fetch group for linked annotation")}}const g=null!==d,v=await this._filterGroups(m(c,u,n,this._settings),g,f,i),_=f||i||null;return this._addGroupsToStore(v,_),v}async _loadServiceSpecifiedGroups(e){const t=await this._api.profile.groups.read({expand:_v});let n;const r=async e=>{try{return await this._fetchGroup(e)}catch(e){return n=e,null}},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;const t=null===(e=this._serviceConfig)||void 0===e?void 0:e.groups;if(Array.isArray(t)||"function"==typeof(null==(n=t)?void 0:n.then)){let e=[];try{e=await t}catch(e){
|
|
643
|
+
this._toastMessenger.error(`Unable to fetch group configuration: ${e.message}`)}return this._loadServiceSpecifiedGroups(e)}return this._loadGroupsForUserAndDocument();var n}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=>!mi(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"})}}bv.$inject=["store","api","auth","session","settings","toastMessenger"];class yv{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),
|
|
644
|
+
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 gg(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)})),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(),
|
|
645
|
+
t=await this._api.annotation.get({id:e}),mi(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),!mi(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}}yv.$inject=["api","store","streamer","streamFilter"];class wv{constructor(){this._store=new Map}getItem(e){var t;return null!==(t=this._store.get(e))&&void 0!==t?t:null}setItem(e,t){this._store.set(e,t)}removeItem(e){this._store.delete(e)}}class xv{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 wv}}getItem(e){return this._storage.getItem(e)}getObject(e){const t=this._storage.getItem(e);return t?JSON.parse(t):null
|
|
646
|
+
}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)}}xv.$inject=["$window"];const kv={annotationPrivacy:"hypothesis.privacy",focusedGroup:"hypothesis.groups.focus"};class Sv{constructor(e,t){this._storage=e,this._store=t}init(){for(let[e,t]of Li(kv)){const n=this._storage.getItem(t);this._store.setDefault(e,n)}pv(this._store.subscribe,(()=>this._store.getDefaults()),((e,t)=>{for(let[n,r]of Li(e))t[n]!==r&&n in kv&&this._storage.setItem(kv[n],r)}))}}Sv.$inject=["localStorage","store"];class Cv{constructor(e,t){this._window=e,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:
|
|
647
|
+
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){this._window.history.pushState({},"",this.routeUrl(e,t)),this.sync()}}Cv.$inject=["$window","store"];class Ev{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}`)}}}Ev.$inject=["apiRoutes","store"];class Av{constructor(e,n,r,o,i){var a,s
|
|
648
|
+
;this._api=n,this._auth=r,this._store=e,this._toastMessenger=i,this._authority=null!==(a=null===(s=t(o))||void 0===s?void 0:s.authority)&&void 0!==a?a:null,this._lastLoad=null,this._lastLoadTime=null,r.on("oauthTokensChanged",(()=>this.reload()))}load(){return(!this._lastLoad||!this._lastLoadTime||Date.now()-this._lastLoadTime>3e5)&&(this._lastLoadTime=Date.now(),this._lastLoad=nv((()=>{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(){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?Mn({id:e.userid}):Mn(null)),e}async logout(){try{return await this._auth.logout(),this.reload()}catch(e){
|
|
649
|
+
throw this._toastMessenger.error("Log out failed"),new Error(e)}}reload(){return this._lastLoad=null,this._lastLoadTime=null,this.load()}}Av.$inject=["store","api","auth","settings","toastMessenger"];class Tv{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 Nv extends pg{constructor(e){super();const t=[];let n;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)
|
|
650
|
+
;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 Mv{constructor(e,t,n,r,o){this._auth=n,this._groups=r,this._session=o,this._store=e,this._websocketURL=t.links().then((e=>e.websocket)),this.clientId=a(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})));t.length&&this._store.removeAnnotations(t),this._store.clearPendingUpdates()}_handleSocketError(e,t){u("Error connecting to H push notification service:",t);const n=new URL(e).hostname;-1!==["localhost","127.0.0.1"].indexOf(n)&&u("Check that your H service is configured to allow WebSocket connections from "+window.location.origin)}_handleSocketMessage(e){
|
|
650
651
|
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 u("Received unsupported notification",t.type)}_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;const t=await this._websocketURL;if(!t)return;let n,r;null===(e=this._socket)||void 0===e||e.close();try{
|
|
651
|
-
n=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(n){const e=new URL(t);e.searchParams.set("access_token",n),r=e.toString()}else r=t;const o=new
|
|
652
|
-
|
|
653
|
-
e.visible||this._store.setForcedVisible(e.id,!0)}}
|
|
654
|
-
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)}(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
|
|
655
|
-
for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),
|
|
656
|
-
}(),r=n?[n]:void 0;
|
|
657
|
-
|
|
658
|
-
;if("number"!=typeof n.ancestorLevel||"string"!=typeof n.origin)throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified");return{targetFrame:l(n.ancestorLevel,t),origin:n.origin}}(c,a);let d;if(u){const e=await async function(e,t){return{...await s(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(c,u);d=function(e,t){const n=e.services;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=s(t.targetFrame,t.origin,"requestGroups",[n],0).catch((()=>{throw new Error("Unable to fetch groups")})))})),e):e}(e,u)}else d=c;const h={...i,...d};return u&&(h.rpc=u),h.apiUrl=function(e){const n=t(e);if(n){if(n.apiUrl)return n.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(h),h}(
|
|
659
|
-
;n.register("annotationsService",
|
|
652
|
+
n=await this._auth.getAccessToken()}catch(e){throw console.error("Failed to fetch token for WebSocket authentication",e),e}if(n){const e=new URL(t);e.searchParams.set("access_token",n),r=e.toString()}else r=t;const o=new Nv(r);o.on("open",(()=>{this._reconnectionAttempts=0,this._sendClientConfig(o)})),o.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")})),o.on("error",(e=>this._handleSocketError(t,e))),o.on("message",(e=>this._handleSocketMessage(e))),this._socket=o,this.setConfig("client-id",{messageType:"client_id",value:this.clientId}),this.setConfig("auth-check",{type:"whoami",id:1})}async connect(e={}){var t;this._updateImmediately=null===(t=e.applyUpdatesImmediately)||void 0===t||t,this._reconnectSetUp||(this._reconnectSetUp=!0,
|
|
653
|
+
pv(this._store.subscribe,(()=>this._store.profile().userid),(()=>this._reconnect()))),this._socket||await this._reconnect()}}Mv.$inject=["store","apiRoutes","auth","groups","session"];class Lv{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(`^${p(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()}})),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)}}Lv.$inject=["localStorage"];class zv{constructor(e){this._store=e}forceVisible(e){e.children.forEach((e=>{this.forceVisible(e)})),
|
|
654
|
+
e.visible||this._store.setForcedVisible(e.id,!0)}}zv.$inject=["store"];class Rv{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="",visuallyHidden:o=!1}={}){if(this._store.hasToastMessage(e,t))return;const i=a(10),s={type:e,id:i,message:t,moreInfoURL:r,visuallyHidden:o};this._store.addToastMessage({isDismissed:!1,...s}),n&&setTimeout((()=>{this.dismiss(i)}),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)}}Rv.$inject=["store"];class Ov{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),
|
|
655
|
+
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)}(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 Iv=function(e){
|
|
656
|
+
for(var t={},n=e.querySelectorAll("script.js-hypothesis-config"),r=0;r<n.length;r++){var o=void 0;try{o=JSON.parse(n[r].textContent||"")}catch(e){console.warn("Could not parse settings from js-hypothesis-config tags",e),o={}}Object.assign(t,o)}return t}(document),Dv=function(t){const{version:n,origin:r}=e(t.location.href);return"1.1124.0"!==n?(console.warn(`The Hypothesis sidebar is using a different version (1.1124.0) than the host page (${n}). It may not work.`),!1):"null"===t.origin?(console.warn("Hypothesis has been loaded in a sandboxed frame. This is not supported."),!1):t.origin===r||(console.warn(`The Hypothesis sidebar is running in a different origin (${t.origin}) than expected (${r}). It may not work.`),!1)}(window);function Pv(e,t){e.setClientId(t.clientId)}function Bv(e,t,n){e.load(),t.load(),n.sync()}function Fv(e,t,n){e.init(),t.init(),n.init()}function Hv(e,t){"sidebar"===t.route()&&e.connect()}Iv.sentry&&Dv&&function(t){const n=function(){let e=import.meta.url;return e?new URL(e).origin:null
|
|
657
|
+
}(),r=n?[n]:void 0;En({dsn:t.dsn,environment:t.environment,allowUrls:r,ignoreErrors:["Network request failed","Object Not Found Matching Id"],release:"1.1124.0",beforeSend:(e,t)=>{if(Nn>=5)return u("Client-side Sentry quota reached. No further Sentry events will be sent"),null;++Nn;try{const n=t&&t.originalException;n instanceof Event&&(e.extra||(e.extra={}),Object.assign(e.extra,{type:n.type,detail:n.detail,isTrusted:n.isTrusted}))}catch(e){}return e}});try{ht("host_config",e(window.location.href))}catch(e){}ht("loaded_scripts",Array.from(document.querySelectorAll("script")).filter((e=>!e.type||e.type.match(/javascript|module/))).map((e=>e.src||"<inline>"))),Tn(((e,t)=>{dt(e,{tags:{context:t}})}))}(Iv.sentry),function(e){e.addEventListener("click",(e=>{const t=e.target;if("A"===t.tagName){const e=t;"_blank"===e.target&&(e.rel="noopener")}}))}(document.body),Pv.$inject=["api","streamer"],Bv.$inject=["groups","session","router"],Fv.$inject=["autosaveService","persistedDefaults","serviceURL"],
|
|
658
|
+
Hv.$inject=["frameSync","store"],function(e,{reset:t=!1}={}){t&&qr.clear();for(let[t,n]of Object.entries(e))qr.set(t,n)}(Co);const jv=document.querySelector("hypothesis-app");!function(e=window){e.addEventListener("message",v)}(),async function(i,a=window){const c=function(t){const i=e(t.location.href),a=["annotations","group","query","appType","openSidebar","showHighlights","services","branding","enableExperimentalNewNoteButton","focus","requestConfigFromFrame","theme","usernameUrl"],s={openSidebar:n,requestConfigFromFrame:e=>{if("string"==typeof e)return e;const t=function(e){return"object"==typeof e&&null!==e?e:{}}(e);return{origin:o(t.origin),ancestorLevel:r(t.ancestorLevel)}}},l={};for(let[e,t]of Object.entries(i))a.includes(e)&&null!==t&&(s[e]?l[e]=s[e](t):l[e]=t);return l}(window),u=function(e,t){const n=e.requestConfigFromFrame;if(!n)return null
|
|
659
|
+
;if("number"!=typeof n.ancestorLevel||"string"!=typeof n.origin)throw new Error("Improper `requestConfigFromFrame` object. Both `ancestorLevel` and `origin` need to be specified");return{targetFrame:l(n.ancestorLevel,t),origin:n.origin}}(c,a);let d;if(u){const e=await async function(e,t){return{...await s(t.targetFrame,t.origin,"requestConfig",[],3e3),...e.group?{group:e.group}:{}}}(c,u);d=function(e,t){const n=e.services;return Array.isArray(n)?(n.forEach(((e,n)=>{"$rpc:requestGroups"===e.groups&&(e.groups=s(t.targetFrame,t.origin,"requestGroups",[n],0).catch((()=>{throw new Error("Unable to fetch groups")})))})),e):e}(e,u)}else d=c;const h={...i,...d};return u&&(h.rpc=u),h.apiUrl=function(e){const n=t(e);if(n){if(n.apiUrl)return n.apiUrl;throw new Error("Service should contain an apiUrl value.")}return e.apiUrl}(h),h}(Iv).then((e=>{!function(e,t){const n=new Ov
|
|
660
|
+
;n.register("annotationsService",qg).register("annotationActivity",$g).register("api",Xg).register("apiRoutes",ov).register("auth",sv).register("autosaveService",lv).register("frameSync",gv).register("groups",bv).register("loadAnnotationsService",yv).register("localStorage",xv).register("persistedDefaults",Sv).register("router",Cv).register("serviceURL",Ev).register("session",Av).register("streamer",Mv).register("streamFilter",Tv).register("tags",Lv).register("threadsService",zv).register("toastMessenger",Rv).register("store",{factory:ns}),n.register("$window",{value:window}).register("settings",{value:e}),n.run(Fv),n.run(Pv),n.run(Bv),n.run(g),n.run(Hv),dr(Ur(zo.Provider,{value:n,children:Ur(jg,{})}),t)}(e,jv)})).catch((e=>function(e,t){console.error("Failed to start Hypothesis client: ",e),dr(Ur(Ug,{error:e}),t)}(e,jv)));
|
|
660
661
|
//# sourceMappingURL=sidebar.bundle.js.map
|