From fdf0ae769634fa5aa4fb796946aace401f6fe40a Mon Sep 17 00:00:00 2001 From: Edmund Farrow Date: Tue, 21 Jul 2026 15:49:05 +0100 Subject: [PATCH 1/7] freetext-errors - Add error message display with translation --- corsscripts/ascii/extractors/allregexmatch.js | 8 ++- .../ascii/extractors/allregexremainder.js | 8 ++- .../ascii/extractors/extractorresult.js | 26 ++++++++ corsscripts/ascii/extractors/lastblock.js | 12 ++-- corsscripts/ascii/extractors/lastcalc.js | 6 +- corsscripts/ascii/extractors/lastexpr.js | 10 +-- .../ascii/extractors/lastregexmatch.js | 8 ++- .../ascii/extractors/lastregexremainder.js | 8 ++- .../ascii/extractors/laststringremainder.js | 8 ++- .../laststringremainderwhitespace.js | 9 +-- corsscripts/ascii/stackascii.bundle.js | 16 ++--- corsscripts/ascii/stackascii.bundle.js.map | 6 +- corsscripts/ascii/stackascii.css | 41 +++++++++++- corsscripts/ascii/stackascii.js | 33 ++++++++-- .../Question_blocks/ASCII_extractors.md | 7 +- lang/en/qtype_stack.php | 7 ++ stack/cas/castext2/blocks/ascii.block.php | 24 ++++--- stack/cas/castext2/blocks/iframe.block.php | 36 ++++++++++ tests/ascii_block_test.php | 65 +++++++++++++++++-- .../ascii.extractors.allregexmatch.test.js | 46 +++++++++---- ...ascii.extractors.allregexremainder.test.js | 23 +++++-- tests/jest/ascii.extractors.lastblock.test.js | 46 ++++++++----- tests/jest/ascii.extractors.lastcalc.test.js | 40 ++++++++---- tests/jest/ascii.extractors.lastexpr.test.js | 54 +++++++++------ .../ascii.extractors.lastregexmatch.test.js | 36 +++++++--- ...scii.extractors.lastregexremainder.test.js | 25 ++++--- ...cii.extractors.laststringremainder.test.js | 34 +++++++--- ...tors.laststringremainderwhitespace.test.js | 49 +++++++++----- tests/jest/ascii.stackascii.test.js | 53 ++++++++++++--- 29 files changed, 556 insertions(+), 188 deletions(-) create mode 100644 corsscripts/ascii/extractors/extractorresult.js diff --git a/corsscripts/ascii/extractors/allregexmatch.js b/corsscripts/ascii/extractors/allregexmatch.js index 8e7c37db0f2..f504461f334 100644 --- a/corsscripts/ascii/extractors/allregexmatch.js +++ b/corsscripts/ascii/extractors/allregexmatch.js @@ -1,10 +1,12 @@ +import { extractorError, extractorResult } from './extractorresult.js'; + // Extractor: allregexmatch // [[extractor targetinput="ans2" type="allregexmatch" regex="^f\\(x\\)\\s*=\\s*" /]] // Searches the entire raw input for all lines matching operation.regex and returns // a JSON object of the form {"matches":[...]} set as answerEl.value. export default function allregexmatch(raw, blocks, operation) { if (!operation || !operation.regex) { - return 'ERROR'; + return extractorError('asciistringextractorregexrequired'); } const pattern = new RegExp(operation.regex); const matches = []; @@ -17,7 +19,7 @@ export default function allregexmatch(raw, blocks, operation) { } if (matches.length === 0) { - return 'ERROR'; + return extractorError('asciistringextractorregexnotfound'); } - return JSON.stringify({ matches }); + return extractorResult(JSON.stringify({ matches })); } diff --git a/corsscripts/ascii/extractors/allregexremainder.js b/corsscripts/ascii/extractors/allregexremainder.js index dc15f0f5723..4e36de7f1bd 100644 --- a/corsscripts/ascii/extractors/allregexremainder.js +++ b/corsscripts/ascii/extractors/allregexremainder.js @@ -1,3 +1,5 @@ +import { extractorError, extractorResult } from './extractorresult.js'; + // Extractor: allregexremainder // [[extractor targetinput="ans2" type="allregexremainder" regex="^f\\(x\\)\\s*=\\s*" /]] // Searches the entire raw input for all lines matching operation.regex and returns @@ -5,7 +7,7 @@ // from the matches. export default function allregexremainder(raw, blocks, operation) { if (!operation || !operation.regex) { - return 'ERROR'; + return extractorError('asciistringextractorregexrequired'); } const pattern = new RegExp(operation.regex); const matches = []; @@ -18,7 +20,7 @@ export default function allregexremainder(raw, blocks, operation) { } if (matches.length === 0) { - return 'ERROR'; + return extractorError('asciistringextractorregexnotfound'); } - return JSON.stringify({ matches }); + return extractorResult(JSON.stringify({ matches })); } diff --git a/corsscripts/ascii/extractors/extractorresult.js b/corsscripts/ascii/extractors/extractorresult.js new file mode 100644 index 00000000000..6ec3887c65e --- /dev/null +++ b/corsscripts/ascii/extractors/extractorresult.js @@ -0,0 +1,26 @@ +// Shared helpers for ASCII extractors. + +let extractorStrings = {}; + +export function setExtractorStrings(strings = {}) { + extractorStrings = { + ...strings + }; +} + +export function extractorResult(result) { + return { + result: result + }; +} + +export function extractorError(key, detail = '') { + let message = extractorStrings[key] || key; + if (detail !== '') { + message = message + ' ' + String(detail); + } + return { + error: message + }; +} + diff --git a/corsscripts/ascii/extractors/lastblock.js b/corsscripts/ascii/extractors/lastblock.js index 37c9fd134b5..5b934e58c98 100644 --- a/corsscripts/ascii/extractors/lastblock.js +++ b/corsscripts/ascii/extractors/lastblock.js @@ -1,3 +1,5 @@ +import { extractorError, extractorResult } from './extractorresult.js'; + // Extractor: lastblock // Returns the raw content of the last code_inline, or the full content // of the last asciimath_block, in document order. @@ -7,13 +9,13 @@ export default function lastblock(raw, blocks) { for (let i = blocks.length - 1; i >= 0; i--) { const block = blocks[i]; if (block.type === 'code_inline') { - return block.raw; + return extractorResult(block.raw); } if (block.type === 'asciimath_block') { - return block.raw; + return extractorResult(block.raw); } } - return 'ERROR'; + return extractorError('asciistringextractorlastblocknotfound'); } // Fallback: send the final non-empty line when blocks are unavailable. @@ -21,8 +23,8 @@ export default function lastblock(raw, blocks) { for (let i = lines.length - 1; i >= 0; i--) { const trimmed = lines[i].trim(); if (trimmed !== '') { - return lines[i]; + return extractorResult(lines[i]); } } - return 'ERROR'; + return extractorError('asciistringextractorlastblocknotfound'); } diff --git a/corsscripts/ascii/extractors/lastcalc.js b/corsscripts/ascii/extractors/lastcalc.js index 21939015cba..66191f21826 100644 --- a/corsscripts/ascii/extractors/lastcalc.js +++ b/corsscripts/ascii/extractors/lastcalc.js @@ -1,12 +1,14 @@ +import { extractorError, extractorResult } from './extractorresult.js'; + // Extractor: lastcalc // Returns the trimmed content of the last calculation block. export default function lastcalc(raw, blocks) { if (blocks) { for (let i = blocks.length - 1; i >= 0; i--) { if (blocks[i].type === 'calculation') { - return blocks[i].rendered.trim(); + return extractorResult(blocks[i].rendered.trim()); } } } - return 'ERROR'; + return extractorError('asciistringextractorlastcalcnotfound'); } diff --git a/corsscripts/ascii/extractors/lastexpr.js b/corsscripts/ascii/extractors/lastexpr.js index 768a1a59396..07b70e342b1 100644 --- a/corsscripts/ascii/extractors/lastexpr.js +++ b/corsscripts/ascii/extractors/lastexpr.js @@ -1,3 +1,5 @@ +import { extractorError, extractorResult } from './extractorresult.js'; + // Extractor: lastexpr // Returns the trimmed content of the last code_inline, or the last non-empty line // of the last asciimath_block, in document order. @@ -7,14 +9,14 @@ export default function lastexpr(raw, blocks) { for (let i = blocks.length - 1; i >= 0; i--) { const block = blocks[i]; if (block.type === 'code_inline') { - return block.raw.trim(); + return extractorResult(block.raw.trim()); } if (block.type === 'asciimath_block') { const lines = block.raw.split(/\r?\n/); for (let j = lines.length - 1; j >= 0; j--) { const trimmed = lines[j].trim(); if (trimmed !== '') { - return trimmed; + return extractorResult(trimmed); } } } @@ -26,8 +28,8 @@ export default function lastexpr(raw, blocks) { for (let i = lines.length - 1; i >= 0; i--) { const trimmed = lines[i].trim(); if (trimmed !== '') { - return trimmed; + return extractorResult(trimmed); } } - return 'ERROR'; + return extractorError('asciistringextractorlastexprnotfound'); } diff --git a/corsscripts/ascii/extractors/lastregexmatch.js b/corsscripts/ascii/extractors/lastregexmatch.js index dd2ae4d887b..eebae8df9e1 100644 --- a/corsscripts/ascii/extractors/lastregexmatch.js +++ b/corsscripts/ascii/extractors/lastregexmatch.js @@ -1,3 +1,5 @@ +import { extractorError, extractorResult } from './extractorresult.js'; + // Extractor: lastregexmatch // [[extractor targetinput="ans2" type="lastregexmatch" regex="^f\\(x\\)\\s*=\\s*" /]] // Note the escaped backslashes. Searches for a trimmed line matching the given expression. @@ -5,7 +7,7 @@ // Scans lines in reverse order. export default function lastregexmatch(raw, blocks, operation) { if (!operation || !operation.regex) { - return 'ERROR'; + return extractorError('asciistringextractorregexrequired'); } const pattern = new RegExp(operation.regex); @@ -14,8 +16,8 @@ export default function lastregexmatch(raw, blocks, operation) { for (const line of lines) { const trimmed = line.trim(); if (pattern.test(trimmed)) { - return trimmed; + return extractorResult(trimmed); } } - return 'ERROR'; + return extractorError('asciistringextractorregexnotfound'); } diff --git a/corsscripts/ascii/extractors/lastregexremainder.js b/corsscripts/ascii/extractors/lastregexremainder.js index 153218ba0a8..ab8adb339b7 100644 --- a/corsscripts/ascii/extractors/lastregexremainder.js +++ b/corsscripts/ascii/extractors/lastregexremainder.js @@ -1,3 +1,5 @@ +import { extractorError, extractorResult } from './extractorresult.js'; + // Extractor: lastregexremainder // [[extractor targetinput="ans2" type="lastregexmatch" regex="^f\\(x\\)\\s*=\\s*" /]] // Note the escaped backslashes. Searches for a trimmed line matching the given expression. @@ -5,7 +7,7 @@ // Scans lines in reverse order. export default function lastregexremainder(raw, blocks, operation) { if (!operation || !operation.regex) { - return 'ERROR'; + return extractorError('asciistringextractorregexrequired'); } const pattern = new RegExp(operation.regex); @@ -14,8 +16,8 @@ export default function lastregexremainder(raw, blocks, operation) { for (const line of lines) { const trimmed = line.trim(); if (pattern.test(trimmed)) { - return trimmed.replace(pattern, ''); + return extractorResult(trimmed.replace(pattern, '')); } } - return 'ERROR'; + return extractorError('asciistringextractorregexnotfound'); } diff --git a/corsscripts/ascii/extractors/laststringremainder.js b/corsscripts/ascii/extractors/laststringremainder.js index 3a8e692740d..6a94ea2f250 100644 --- a/corsscripts/ascii/extractors/laststringremainder.js +++ b/corsscripts/ascii/extractors/laststringremainder.js @@ -1,3 +1,5 @@ +import { extractorError, extractorResult } from './extractorresult.js'; + // Extractor: laststringremainder // [[extractor targetinput="ans2" type="laststringremainder" string="Answer =" /]] // Searches for a trimmed line (with or without backslashes) matching the given string. @@ -5,7 +7,7 @@ // Scans lines in reverse order. export default function laststringremainder(raw, blocks, operation) { if (!operation || !operation.string) { - return 'ERROR'; + return extractorError('asciistringextractorsearchrequired'); } const lines = raw.split('\n'); @@ -14,8 +16,8 @@ export default function laststringremainder(raw, blocks, operation) { let trimmed = line.replace(/^[\s`]+|[\s`]+$/g, ''); if (trimmed.includes(operation.string)) { trimmed = trimmed.replace(operation.string, ''); - return trimmed.replace(/^[\s`]+|[\s`]+$/g, ''); + return extractorResult(trimmed.replace(/^[\s`]+|[\s`]+$/g, '')); } } - return 'ERROR'; + return extractorError('asciistringextractorsearchnotfound'); } diff --git a/corsscripts/ascii/extractors/laststringremainderwhitespace.js b/corsscripts/ascii/extractors/laststringremainderwhitespace.js index d6af2fb6dd0..8f6bd407de2 100644 --- a/corsscripts/ascii/extractors/laststringremainderwhitespace.js +++ b/corsscripts/ascii/extractors/laststringremainderwhitespace.js @@ -1,3 +1,5 @@ +import { extractorError, extractorResult } from './extractorresult.js'; + // Extractor: laststringremainderwhitespace // [[extractor targetinput="ans2" type="laststringremainderwhitespace" string="f(x) =" /]] // Remove the requirement to write a regex. @@ -6,7 +8,7 @@ // Scans lines in reverse order. export default function laststringremainderwhitespace(raw, blocks, operation) { if (!operation || !operation.search) { - return 'ERROR'; + return extractorError('asciistringextractorsearchrequired'); } var match = escaperegex(operation.search); @@ -31,10 +33,10 @@ export default function laststringremainderwhitespace(raw, blocks, operation) { const matched = trimmed.match(pattern); if (matched) { const retmatch = matched[1]; - return retmatch.trim(); + return extractorResult(retmatch.trim()); } } - return 'ERROR'; + return extractorError('asciistringextractorsearchnotfound'); } function escaperegex(str) { @@ -43,4 +45,3 @@ function escaperegex(str) { // 2. Turn each whitespace character in the search pattern to match to zero or more spaces. return match.replace(/\s+/g, "\\s*"); } - diff --git a/corsscripts/ascii/stackascii.bundle.js b/corsscripts/ascii/stackascii.bundle.js index 814a2c37bb3..d5250894167 100644 --- a/corsscripts/ascii/stackascii.bundle.js +++ b/corsscripts/ascii/stackascii.bundle.js @@ -1,5 +1,5 @@ // Generated – do not edit directly. Edit stackascii.js and its dependencies, then run: npm run build -var __create=Object.create;var __defProp=Object.defineProperty;var __getOwnPropDesc=Object.getOwnPropertyDescriptor;var __getOwnPropNames=Object.getOwnPropertyNames;var __getProtoOf=Object.getPrototypeOf,__hasOwnProp=Object.prototype.hasOwnProperty;var __commonJS=(cb,mod)=>function(){return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_mathjs_min=__commonJS({"mathjs.min.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define([],t):typeof exports=="object"?exports.math=t():e.math=t()})(exports,()=>{var r={31:function(e,r2,n2){var o;(function(e2){function i(e3){var t2=this,r3="";t2.next=function(){var e4=t2.x^t2.x>>>2;return t2.x=t2.y,t2.y=t2.z,t2.z=t2.w,t2.w=t2.v,(t2.d=t2.d+362437|0)+(t2.v=t2.v^t2.v<<4^e4^e4<<1)|0},t2.x=0,t2.y=0,t2.z=0,t2.w=0,e3===((t2.v=0)|e3)?t2.x=e3:r3+=e3;for(var n3=0;n3>>4),t2.next()}function a(e3,t2){return t2.x=e3.x,t2.y=e3.y,t2.z=e3.z,t2.w=e3.w,t2.v=e3.v,t2.d=e3.d,t2}function t(e3,t2){function r3(){return(n3.next()>>>0)/4294967296}var n3=new i(e3),e3=t2&&t2.state;return r3.double=function(){do var e4=((n3.next()>>>11)+(n3.next()>>>0)/4294967296)/2097152;while(e4===0);return e4},r3.int32=n3.next,r3.quick=r3,e3&&(typeof e3=="object"&&a(e3,n3),r3.state=function(){return a(n3,{})}),r3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.xorwow=t})(e=n2.nmd(e),n2.amdD)},67:function(e,r2,n2){var o;(function(e2){function i(e3){var t2,i2=this,r3=(i2.next=function(){var e4=i2.x,t3=i2.i,r4=e4[t3],n4=(r4^=r4>>>7)^r4<<24;return n4=(n4=(n4^=(r4=e4[t3+1&7])^r4>>>10)^((r4=e4[t3+3&7])^r4>>>3))^((r4=e4[t3+4&7])^r4<<7),r4=e4[t3+7&7],n4^=(r4^=r4<<13)^r4<<9,e4[t3]=n4,i2.i=t3+1&7,n4},i2),n3=e3,a2=[];if(n3===(0|n3))a2[0]=n3;else for(n3=""+n3,t2=0;t2>>0)/4294967296}var n3=new i(e3=e3??+new Date),e3=t2&&t2.state;return r3.double=function(){do var e4=((n3.next()>>>11)+(n3.next()>>>0)/4294967296)/2097152;while(e4===0);return e4},r3.int32=n3.next,r3.quick=r3,e3&&(e3.x&&a(e3,n3),r3.state=function(){return a(n3,{})}),r3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.xorshift7=t})(e=n2.nmd(e),n2.amdD)},144:e=>{"use strict";function s(e2,t){return u({},e2,t)}var u=Object.assign||function(e2){for(var t=1;t=e3.length&&n2.slice(0,e3.length)===e3&&(i+=a[o[t2]],n2=n2.slice(e3.length,n2.length),r3=!0)}),r3||(i+=n2.slice(0,1),n2=n2.slice(1,n2.length))})();return i}},180:function(e,r2,n2){var o;(function(e2){function i(e3){var n3,t2=this,r3=(n3=4022871197,function(e4){e4=String(e4);for(var t3=0;t3>>0)*n3)>>>0,n3+=4294967296*(r4-=n3)}return 23283064365386963e-26*(n3>>>0)});t2.next=function(){var e4=2091639*t2.s0+23283064365386963e-26*t2.c;return t2.s0=t2.s1,t2.s1=t2.s2,t2.s2=e4-(t2.c=0|e4)},t2.c=1,t2.s0=r3(" "),t2.s1=r3(" "),t2.s2=r3(" "),t2.s0-=r3(e3),t2.s0<0&&(t2.s0+=1),t2.s1-=r3(e3),t2.s1<0&&(t2.s1+=1),t2.s2-=r3(e3),t2.s2<0&&(t2.s2+=1)}function a(e3,t2){return t2.c=e3.c,t2.s0=e3.s0,t2.s1=e3.s1,t2.s2=e3.s2,t2}function t(e3,t2){var r3=new i(e3),e3=t2&&t2.state,n3=r3.next;return n3.int32=function(){return 4294967296*r3.next()|0},n3.double=function(){return n3()+11102230246251565e-32*(2097152*n3()|0)},n3.quick=n3,e3&&(typeof e3=="object"&&a(e3,r3),n3.state=function(){return a(r3,{})}),n3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.alea=t})(e=n2.nmd(e),n2.amdD)},181:function(e,r2,n2){var o;(function(e2){function i(e3){var t2=this,r3="";t2.x=0,t2.y=0,t2.z=0,t2.w=0,t2.next=function(){var e4=t2.x^t2.x<<11;return t2.x=t2.y,t2.y=t2.z,t2.z=t2.w,t2.w^=t2.w>>>19^e4^e4>>>8},e3===(0|e3)?t2.x=e3:r3+=e3;for(var n3=0;n3>>0)/4294967296}var n3=new i(e3),e3=t2&&t2.state;return r3.double=function(){do var e4=((n3.next()>>>11)+(n3.next()>>>0)/4294967296)/2097152;while(e4===0);return e4},r3.int32=n3.next,r3.quick=r3,e3&&(typeof e3=="object"&&a(e3,n3),r3.state=function(){return a(n3,{})}),r3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.xor128=t})(e=n2.nmd(e),n2.amdD)},234:()=>{},369:function(e){e.exports=(function(){"use strict";function T(){return!0}function ce(){return!1}function fe(){}let B="Argument is not a typed-function.";return(function e2(){function c(e3){return typeof e3=="object"&&e3!==null&&e3.constructor===Object}let t=[{name:"number",test:function(e3){return typeof e3=="number"}},{name:"string",test:function(e3){return typeof e3=="string"}},{name:"boolean",test:function(e3){return typeof e3=="boolean"}},{name:"Function",test:function(e3){return typeof e3=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e3){return e3 instanceof Date}},{name:"RegExp",test:function(e3){return e3 instanceof RegExp}},{name:"Object",test:c},{name:"null",test:function(e3){return e3===null}},{name:"undefined",test:function(e3){return e3===void 0}}],r2={name:"any",test:T,isAny:!0},a,o,i=0,J={createCount:0};function s(e3){var t2=a.get(e3);if(t2)return t2;let r3='Unknown type "'+e3+'"';var n3=e3.toLowerCase();let i2;for(i2 of o)if(i2.toLowerCase()===n3){r3+='. Did you mean "'+i2+'" ?';break}throw new TypeError(r3)}function n2(t2){var e3=1{let t2=a.get(e4);return!t2.isAny&&t2.test(r3)});return e3.length?e3:["any"]}function f(e3){return e3&&typeof e3=="function"&&"_typedFunctionData"in e3}function p(r3,n3,i2){if(!f(r3))throw new TypeError(B);let a2=i2&&i2.exact,o2=Q(Array.isArray(n3)?n3.join(","):n3),e3=X(o2);if(!a2||e3 in r3.signatures){let n4=r3._typedFunctionData.signatureMap.get(e3);if(n4)return n4}var s2=o2.length;let u2,t2;if(a2){let e4;for(e4 in u2=[],r3.signatures)u2.push(r3._typedFunctionData.signatureMap.get(e4))}else u2=r3._typedFunctionData.signatures;for(let t3=0;t3!r4.has(e5.name)))continue}i3.push(e4)}}if((u2=i3).length===0)break}for(t2 of u2)if(t2.params.length<=s2)return t2;throw new TypeError("Signature not found (signature: "+(r3.name||"unnamed")+"("+X(o2,", ")+"))")}function X(e3,t2){return t2=1e4.name).join(t2)}function oe(e3){let t2=(function(e4){if(e4.length===0)return[];let r4=e4.map(s);1e5.index-t3.index);let n4=r4[0].conversionsTo;if(e4.length===1)return n4;n4=n4.concat([]);let i3=new Set(e4);for(let t3=1;t3e4.name)),r3=e3.hasAny,n3=e3.name;var i2=t2.map(function(e4){var t3=s(e4.from);return r3=t3.isAny||r3,n3+="|"+e4.from,{name:e4.from,typeIndex:t3.index,test:t3.test,isAny:t3.isAny,conversion:e4,conversionIndex:e4.index}});return{types:e3.types.concat(i2),name:n3,hasAny:r3,hasConversion:0t2.typeSet.add(e3.name))),t2.typeSet}function Q(e3){let t2=[];if(typeof e3!="string")throw new TypeError("Signatures must be strings");let r3=e3.trim();if(r3==="")return t2;let n3=r3.split(",");for(let e4=0;e4s(e6.trim())),n4=!1,i2=t3?"...":"";return{types:r5.map(function(e6){return n4=e6.isAny||n4,i2+=e6.name+"|",{name:e6.name,typeIndex:e6.index,test:e6.test,isAny:e6.isAny,conversion:null,conversionIndex:-1}}),name:i2.slice(0,-1),hasAny:n4,hasConversion:!1,restParam:t3}})(n3[e4].trim());if(r4.restParam&&e4!==n3.length-1)throw new SyntaxError('Unexpected rest parameter "'+n3[e4]+'": only allowed for the last parameter');if(r4.types.length===0)return null;t2.push(r4)}return t2}function K(e3){return e3=ie(e3),!!e3&&e3.restParam}function ee(e3){if(e3&&e3.types.length!==0){if(e3.types.length===1)return s(e3.types[0].name).test;if(e3.types.length===2){let T2=s(e3.types[0].name).test,t2=s(e3.types[1].name).test;return function(e4){return T2(e4)||t2(e4)}}{let T2=e3.types.map(function(e4){return s(e4.name).test});return function(t2){for(let e4=0;e4{let t2;for(t2 of te(e4.params,r3))n3.add(t2)}),n3.has("any")?["any"]:Array.from(n3)}function g(r3,n3,e3){let t2,i2;var a2=r3||"unnamed";let o2,s2=e3;for(o2=0;o2{let t3=ee(h(e4.params,o2));(o2e3)return(t2=new TypeError("Too many arguments in function "+a2+" (expected: "+e3+", actual: "+n3.length+")")).data={category:"tooManyArgs",fn:a2,index:n3.length,expectedLength:e3},t2;let u2=[];for(let e4=0;e4A(e4)?w(e4.referToSelf.callback):N(e4)?v(e4.referTo.references,e4.referTo.callback):e4),a2=new Array(i2.length).fill(!1),o2=!0;for(;o2;){let t2=!(o2=!1);for(let e4=0;e4{let t3=n3[e4];if(q.test(t3.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}let i2=[],a2=[],o2={},s2=[],u2;for(u2 in r3)if(Object.prototype.hasOwnProperty.call(r3,u2)){let t3=Q(u2);if(t3){i2.forEach(function(e5){if((function(n4,i3){let a3=Math.max(n4.length,i3.length);for(let r5=0;r5=e6:r4?e6>=o3:e6===o3})(e5,t3))throw new TypeError('Conflicting signatures "'+X(e5)+'" and "'+X(t3)+'".')}),i2.push(t3);let ce2=a2.length,fe2=(a2.push(r3[u2]),t3.map(oe)),e4;for(e4 of(function t4(r4,n4,i3){if(n4e6.name).join("|"),hasAny:t5.some(e6=>e6.isAny),hasConversion:!1,restParam:!0}),e5.push(o3)}else e5=o3.types.map(function(e6){return{types:[e6],name:e6.name,hasAny:e6.isAny,hasConversion:e6.conversion,restParam:!1}});return a3=e5,Array.prototype.concat.apply([],a3.map(function(e6){return t4(r4,n4+1,i3.concat([e6]))}))}var a3;return[i3]})(fe2,0,[])){let t4=X(e4);s2.push({params:e4,name:t4,fn:ce2}),e4.every(e5=>!e5.hasConversion)&&(o2[t4]=ce2)}}}s2.sort(se);var e3=le(a2,o2,z);let l2;for(l2 in o2)Object.prototype.hasOwnProperty.call(o2,l2)&&(o2[l2]=e3[o2[l2]]);let c2=[],f2=new Map;for(l2 of s2)f2.has(l2.name)||(l2.fn=e3[l2.fn],c2.push(l2),f2.set(l2.name,l2));var p2=c2[0]&&c2[0].params.length<=2&&!K(c2[0].params),m2=c2[1]&&c2[1].params.length<=2&&!K(c2[1].params),h2=c2[2]&&c2[2].params.length<=2&&!K(c2[2].params),d2=c2[3]&&c2[3].params.length<=2&&!K(c2[3].params),g2=c2[4]&&c2[4].params.length<=2&&!K(c2[4].params),y2=c2[5]&&c2[5].params.length<=2&&!K(c2[5].params),x2=p2&&m2&&h2&&d2&&g2&&y2;for(let e4=0;e4=n5+1}}return e5.length===0?function(e6){return e6.length===0}:e5.length===1?(n4=ee(e5[0]),function(e6){return n4(e6[0])&&e6.length===1}):e5.length===2?(n4=ee(e5[0]),i3=ee(e5[1]),function(e6){return n4(e6[0])&&i3(e6[1])&&e6.length===2}):(r4=e5.map(ee),function(t3){for(let e6=0;e6e6.hasConversion)){let i4=K(e5),a3=e5.map(ue);t3=function(){let t4=[],r4=i4?arguments.length-1:arguments.length;for(let e6=0;e6e4.test),W=c2.map(e4=>e4.implementation),Y=function(){for(let e4=G;e4X(Q(e4))),t2=ie(arguments);if(typeof t2!="function")throw new TypeError("Callback function expected as last argument");return v(e3,t2)},J.referToSelf=w,J.convert=function(t2,e3){let r3=s(e3);if(r3.test(t2))return t2;let n3=r3.conversionsTo;if(n3.length===0)throw new Error("There are no conversions to "+e3+" defined.");for(let e4=0;e4e4.from===t2.from);if(n3){if(!e3||!e3.override)throw new Error('There is already a conversion from "'+t2.from+'" to "'+r3.name+'"');J.removeConversion({from:n3.from,to:t2.to,convert:n3.convert})}r3.conversionsTo.push({from:t2.from,convert:t2.convert,index:i++})},J.addConversions=function(e3,t2){e3.forEach(e4=>J.addConversion(e4,t2))},J.removeConversion=function(r3){S(r3);let e3=s(r3.to),t2=(function(t3){for(let e4=0;e4{var n2=r2(180),i=r2(181),a=r2(31),o=r2(67),s=r2(833),u=r2(717),r2=r2(801);r2.alea=n2,r2.xor128=i,r2.xorwow=a,r2.xorshift7=o,r2.xor4096=s,r2.tychei=u,e.exports=r2},504:e=>{function t(){}t.prototype={on:function(e2,t2,r2){var n2=this.e||(this.e={});return(n2[e2]||(n2[e2]=[])).push({fn:t2,ctx:r2}),this},once:function(e2,t2,r2){var n2=this;function i(){n2.off(e2,i),t2.apply(r2,arguments)}return i._=t2,this.on(e2,i,r2)},emit:function(e2){for(var t2=[].slice.call(arguments,1),r2=((this.e||(this.e={}))[e2]||[]).slice(),n2=0,i=r2.length;n2>>7^(t3=i2.c),t3=t3-(r4=i2.d)|0,r4=r4<<24^r4>>>8^(n3=i2.a),n3=n3-e4|0;return i2.b=e4=e4<<20^e4>>>12^t3,i2.c=t3=t3-r4|0,i2.d=r4<<16^t3>>>16^n3,i2.a=n3-e4|0},i2.a=0,i2.b=0,i2.c=-1640531527,i2.d=1367130551,e3===Math.floor(e3)?(i2.a=e3/4294967296|0,i2.b=0|e3):t2+=e3;for(var r3=0;r3>>0)/4294967296}var n3=new i(e3),e3=t2&&t2.state;return r3.double=function(){do var e4=((n3.next()>>>11)+(n3.next()>>>0)/4294967296)/2097152;while(e4===0);return e4},r3.int32=n3.next,r3.quick=r3,e3&&(typeof e3=="object"&&a(e3,n3),r3.state=function(){return a(n3,{})}),r3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.tychei=t})(e=n2.nmd(e),n2.amdD)},801:function(e,t,r2){var o,s=typeof self<"u"?self:this,u=[],l=Math,c=256,f=l.pow(c,6),p=l.pow(2,52),m=2*p,h=255;function n2(e2,t2,r3){function n3(){for(var e3=a.g(6),t3=f,r4=0;e3>>=1;return(e3+r4)/t3}var i=[],e2=y((function e3(t3,r4){var n4,i2=[],a2=typeof t3;if(r4&&a2=="object")for(n4 in t3)try{i2.push(e3(t3[n4],r4-1))}catch{}return i2.length?i2:a2=="string"?t3:t3+"\0"})((t2=t2==1?{entropy:!0}:t2||{}).entropy?[e2,x(u)]:e2??(function(){try{var e3;return o&&(e3=o.randomBytes)?e3=e3(c):(e3=new Uint8Array(c),(s.crypto||s.msCrypto).getRandomValues(e3)),x(e3)}catch{var t3=s.navigator,t3=t3&&t3.plugins;return[+new Date,s,t3,s.screen,x(u)]}})(),3),i),a=new d(i);return n3.int32=function(){return 0|a.g(4)},n3.quick=function(){return a.g(4)/4294967296},n3.double=n3,y(x(a.S),u),(t2.pass||r3||function(e3,t3,r4,n4){return n4&&(n4.S&&g(n4,a),e3.state=function(){return g(a,{})}),r4?(l.random=e3,t3):e3})(n3,e2,"global"in t2?t2.global:this==l,t2.state)}function d(e2){var t2,r3=e2.length,o2=this,n3=0,i=o2.i=o2.j=0,a=o2.S=[];for(r3||(e2=[r3++]);n3>>15^((e4^=e4<<17)^e4>>>12),o2.i=i3,t3+(r4^r4>>>16)|0},o2),u=e3,l=[],c=128;for(u===(0|u)?(r3=u,u=null):(u+="\0",r3=0,c=Math.max(c,u.length)),n3=0,i2=-32;i2>>15)^r3<<4)^r3>>>13,0<=i2&&(n3=(t2=l[127&i2]^=r3+(a2=a2+1640531527|0))==0?n3+1:0);for(128<=n3&&(l[127&(u&&u.length||0)]=-1),n3=127,i2=512;0>>15)^(t2=(t2^=t2<<17)^t2>>>12);s.w=a2,s.X=l,s.i=n3}function a(e3,t2){return t2.i=e3.i,t2.w=e3.w,t2.X=e3.X.slice(),t2}function t(e3,t2){function r3(){return(n3.next()>>>0)/4294967296}var n3=new i(e3=e3??+new Date),e3=t2&&t2.state;return r3.double=function(){do var e4=((n3.next()>>>11)+(n3.next()>>>0)/4294967296)/2097152;while(e4===0);return e4},r3.int32=n3.next,r3.quick=r3,e3&&(e3.X&&a(e3,n3),r3.state=function(){return a(n3,{})}),r3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.xor4096=t})(e=n2.nmd(e),n2.amdD)},880:e=>{e.exports=function t(e2,r2){"use strict";function n2(e3){return t.insensitive&&(""+e3).toLowerCase()||""+e3}var i,a,o=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,s=/(^[ ]*|[ ]*$)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,e2=n2(e2).replace(s,"")||"",r2=n2(r2).replace(s,"")||"",f=e2.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=r2.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),s=parseInt(e2.match(l),16)||f.length!==1&&e2.match(u)&&Date.parse(e2),o=parseInt(r2.match(l),16)||s&&r2.match(u)&&Date.parse(r2)||null;if(o){if(s{for(var r2 in t)fd.o(t,r2)&&!fd.o(e,r2)&&Object.defineProperty(e,r2,{enumerable:!0,get:t[r2]})},fd.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),fd.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},fd.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var pd={};return(()=>{"use strict";fd.d(pd,{default:()=>cd});var t={},l=(fd.r(t),fd.d(t,{createAbs:()=>ha,createAccessorNode:()=>cf,createAcos:()=>jl,createAcosh:()=>ac,createAcot:()=>oc,createAcoth:()=>sc,createAcsc:()=>uc,createAcsch:()=>lc,createAdd:()=>Jc,createAddScalar:()=>ba,createAnd:()=>Lu,createAndTransform:()=>Kh,createArg:()=>Po,createArrayNode:()=>pf,createAsec:()=>cc,createAsech:()=>fc,createAsin:()=>pc,createAsinh:()=>mc,createAssignmentNode:()=>xf,createAtan:()=>hc,createAtan2:()=>dc,createAtanh:()=>gc,createAtomicMass:()=>ah,createAvogadro:()=>oh,createBellNumbers:()=>qm,createBigNumberClass:()=>Zr,createBigint:()=>Mi,createBignumber:()=>Fi,createBin:()=>nu,createBitAnd:()=>zo,createBitAndTransform:()=>rd,createBitNot:()=>qo,createBitOr:()=>Io,createBitOrTransform:()=>nd,createBitXor:()=>Ro,createBlockNode:()=>vf,createBohrMagneton:()=>P0,createBohrRadius:()=>G0,createBoltzmann:()=>sh,createBoolean:()=>Bi,createCatalan:()=>km,createCbrt:()=>Na,createCeil:()=>Ta,createChain:()=>Ep,createChainClass:()=>bp,createClassicalElectronRadius:()=>V0,createClone:()=>Qn,createColumn:()=>es,createColumnTransform:()=>Th,createCombinations:()=>tm,createCombinationsWithRep:()=>im,createCompare:()=>Hu,createCompareNatural:()=>Wu,createCompareText:()=>Ju,createCompile:()=>Xf,createComplex:()=>Di,createComplexClass:()=>en,createComposition:()=>Pm,createConcat:()=>Ko,createConcatTransform:()=>Hh,createConditionalNode:()=>Nf,createConductanceQuantum:()=>U0,createConj:()=>Uo,createConstantNode:()=>Ff,createCorr:()=>Xp,createCos:()=>xc,createCosh:()=>bc,createCot:()=>vc,createCoth:()=>wc,createCoulomb:()=>I0,createCoulombConstant:()=>k0,createCount:()=>ts,createCreateUnit:()=>Ul,createCross:()=>rs,createCsc:()=>Nc,createCsch:()=>Ac,createCtranspose:()=>js,createCube:()=>Ba,createCumSum:()=>jp,createCumSumTransform:()=>Yh,createDeepEqual:()=>dl,createDenseMatrixClass:()=>Xn,createDerivative:()=>Km,createDet:()=>Sp,createDeuteronMass:()=>Q0,createDiag:()=>ns,createDiff:()=>ys,createDiffTransform:()=>Gh,createDistance:()=>kp,createDivide:()=>qp,createDivideScalar:()=>du,createDot:()=>Kc,createDotDivide:()=>Mu,createDotMultiply:()=>yo,createDotPow:()=>Eu,createE:()=>g0,createEfimovFactor:()=>ih,createEigs:()=>Tp,createElectricConstant:()=>z0,createElectronMass:()=>Z0,createElementaryCharge:()=>R0,createEqual:()=>Qu,createEqualScalar:()=>Ai,createEqualText:()=>tl,createErf:()=>Vs,createEvaluate:()=>Kf,createExp:()=>Fa,createExpm:()=>Bp,createExpm1:()=>Da,createFactorial:()=>dm,createFalse:()=>c0,createFaraday:()=>uh,createFermiCoupling:()=>W0,createFft:()=>$s,createFibonacciHeapClass:()=>Cl,createFilter:()=>is,createFilterTransform:()=>_h,createFineStructure:()=>Y0,createFirstRadiation:()=>lh,createFix:()=>_a,createFlatten:()=>ss,createFloor:()=>ka,createForEach:()=>ls,createForEachTransform:()=>zh,createFormat:()=>ru,createFraction:()=>Oi,createFractionClass:()=>mn,createFreqz:()=>n0,createFunctionAssignmentNode:()=>Of,createFunctionNode:()=>Wf,createGamma:()=>pm,createGasConstant:()=>fh,createGcd:()=>Ya,createGetMatrixDataType:()=>ps,createGravitationConstant:()=>F0,createGravity:()=>vh,createHartreeEnergy:()=>J0,createHasNumericValue:()=>di,createHelp:()=>Ap,createHelpClass:()=>xp,createHex:()=>au,createHypot:()=>Xc,createI:()=>E0,createIdentity:()=>hs,createIfft:()=>Hs,createIm:()=>jo,createImmutableDenseMatrixClass:()=>El,createIndex:()=>tf,createIndexClass:()=>Sl,createIndexNode:()=>zf,createIndexTransform:()=>qh,createInfinity:()=>p0,createIntersect:()=>Rp,createInv:()=>Mp,createInverseConductanceQuantum:()=>j0,createInvmod:()=>mo,createIsInteger:()=>oi,createIsNaN:()=>bi,createIsNegative:()=>fi,createIsNumeric:()=>mi,createIsPositive:()=>yi,createIsPrime:()=>pu,createIsZero:()=>xi,createKldivergence:()=>ym,createKlitzing:()=>H0,createKron:()=>ds,createLN10:()=>b0,createLN2:()=>x0,createLOG10E:()=>w0,createLOG2E:()=>v0,createLarger:()=>ll,createLargerEq:()=>pl,createLcm:()=>Xa,createLeafCount:()=>jm,createLeftShift:()=>ku,createLgamma:()=>mm,createLog:()=>vu,createLog10:()=>eo,createLog1p:()=>wu,createLog2:()=>to,createLoschmidt:()=>ch,createLsolve:()=>Tu,createLsolveAll:()=>Du,createLup:()=>rp,createLusolve:()=>dp,createLyap:()=>zp,createMad:()=>Hp,createMagneticConstant:()=>_0,createMagneticFluxQuantum:()=>L0,createMap:()=>gs,createMapSlices:()=>ga,createMapSlicesTransform:()=>Ch,createMapTransform:()=>Ih,createMatrix:()=>_i,createMatrixClass:()=>dn,createMatrixFromColumns:()=>Pi,createMatrixFromFunction:()=>qi,createMatrixFromRows:()=>ki,createMax:()=>Nl,createMaxTransform:()=>Rh,createMean:()=>Lp,createMeanTransform:()=>Ph,createMedian:()=>$p,createMin:()=>Al,createMinTransform:()=>Uh,createMod:()=>$a,createMode:()=>Ks,createMolarMass:()=>xh,createMolarMassC12:()=>bh,createMolarPlanckConstant:()=>ph,createMolarVolume:()=>mh,createMultinomial:()=>bm,createMultiply:()=>io,createMultiplyScalar:()=>ro,createNaN:()=>m0,createNeutronMass:()=>K0,createNode:()=>nf,createNorm:()=>Qc,createNot:()=>Wo,createNthRoot:()=>oo,createNthRoots:()=>Au,createNuclearMagneton:()=>$0,createNull:()=>f0,createNullish:()=>Jo,createNullishTransform:()=>td,createNumber:()=>Si,createNumeric:()=>mu,createObjectNode:()=>If,createOct:()=>iu,createOnes:()=>xs,createOperatorNode:()=>Pf,createOr:()=>Xo,createOrTransform:()=>ed,createParenthesisNode:()=>jf,createParse:()=>Yf,createParser:()=>tp,createParserClass:()=>ep,createPartitionSelect:()=>vl,createPermutations:()=>wm,createPhi:()=>y0,createPi:()=>h0,createPickRandom:()=>Cm,createPinv:()=>Cp,createPlanckCharge:()=>Eh,createPlanckConstant:()=>D0,createPlanckLength:()=>wh,createPlanckMass:()=>Nh,createPlanckTemperature:()=>Sh,createPlanckTime:()=>Ah,createPolynomialRoot:()=>yp,createPow:()=>gu,createPrint:()=>su,createPrintTransform:()=>Qh,createProd:()=>tu,createProtonMass:()=>X0,createQr:()=>np,createQuantileSeq:()=>Yp,createQuantileSeqTransform:()=>Wh,createQuantumOfCirculation:()=>eh,createRandom:()=>Bm,createRandomInt:()=>Dm,createRange:()=>Ns,createRangeClass:()=>hn,createRangeNode:()=>$f,createRangeTransform:()=>jh,createRationalize:()=>t0,createRe:()=>Lo,createReducedPlanckConstant:()=>O0,createRelationalNode:()=>Gf,createReplacer:()=>a0,createReshape:()=>Es,createResize:()=>Ss,createResolve:()=>Ym,createResultSet:()=>ft,createReviver:()=>i0,createRightArithShift:()=>Pu,createRightLogShift:()=>ju,createRotate:()=>Ms,createRotationMatrix:()=>Ts,createRound:()=>xu,createRow:()=>Bs,createRowTransform:()=>Lh,createRydberg:()=>th,createSQRT1_2:()=>N0,createSQRT2:()=>A0,createSackurTetrode:()=>hh,createSchur:()=>_p,createSec:()=>Ec,createSech:()=>Sc,createSecondRadiation:()=>dh,createSetCartesian:()=>Dc,createSetDifference:()=>_c,createSetDistinct:()=>qc,createSetIntersect:()=>kc,createSetIsSubset:()=>Pc,createSetMultiplicity:()=>jc,createSetPowerset:()=>$c,createSetSize:()=>Gc,createSetSymDifference:()=>Zc,createSetUnion:()=>Yc,createSign:()=>so,createSimplify:()=>Gm,createSimplifyConstant:()=>Vm,createSimplifyCore:()=>Wm,createSin:()=>Mc,createSinh:()=>Cc,createSize:()=>Fs,createSlu:()=>pp,createSmaller:()=>nl,createSmallerEq:()=>ol,createSolveODE:()=>Gs,createSort:()=>wl,createSpaClass:()=>Tl,createSparse:()=>Rl,createSparseMatrixClass:()=>Ei,createSpeedOfLight:()=>B0,createSplitUnit:()=>ji,createSqrt:()=>uo,createSqrtm:()=>Fp,createSquare:()=>lo,createSqueeze:()=>Os,createStd:()=>Jp,createStdTransform:()=>Vh,createStefanBoltzmann:()=>gh,createStirlingS2:()=>_m,createString:()=>Ci,createSubset:()=>_s,createSubsetTransform:()=>$h,createSubtract:()=>fo,createSubtractScalar:()=>wa,createSum:()=>Pp,createSumTransform:()=>Zh,createSylvester:()=>Op,createSymbolNode:()=>Vf,createSymbolicEqual:()=>Xm,createTan:()=>Tc,createTanh:()=>Bc,createTau:()=>d0,createThomsonCrossSection:()=>rh,createTo:()=>lu,createToBest:()=>cu,createTrace:()=>ef,createTranspose:()=>Ps,createTrue:()=>l0,createTypeOf:()=>vi,createTyped:()=>st,createUnaryMinus:()=>fa,createUnaryPlus:()=>ma,createUnequal:()=>yl,createUnitClass:()=>Il,createUnitFunction:()=>kl,createUppercaseE:()=>M0,createUppercasePi:()=>S0,createUsolve:()=>Bu,createUsolveAll:()=>_u,createVacuumImpedance:()=>q0,createVariance:()=>Zp,createVarianceTransform:()=>Xh,createVersion:()=>C0,createWeakMixingAngle:()=>nh,createWienDisplacement:()=>yh,createXgcd:()=>po,createXor:()=>Qo,createZeros:()=>Ls,createZeta:()=>Qs,createZpk2tf:()=>r0}),fd(369));function h(e2,t2){if(n2(e2,t2))return e2[t2];throw typeof e2[t2]=="function"&&q(e2,t2)?new Error('Cannot access method "'+t2+'" as a property'):new Error('No access to property "'+t2+'"')}function D(e2,t2,r3){if(n2(e2,t2))return e2[t2]=r3;throw new Error('No access to property "'+t2+'"')}function n2(e2,t2){return!((typeof e2!="object"||!e2||e2.constructor!==Object)&&!Array.isArray(e2)||!ue(r2,t2)&&(t2 in Object.prototype||t2 in Function.prototype))}function q(e2,t2){return!(e2==null||typeof e2[t2]!="function"||ue(e2,t2)&&Object.getPrototypeOf&&t2 in Object.getPrototypeOf(e2)||!ue(i,t2)&&(t2 in Object.prototype||t2 in Function.prototype))}let r2={length:!0,name:!0},i={toString:!0,valueOf:!0,toLocaleString:!0};class I{constructor(e2){this.wrappedObject=e2,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e2=>this.has(e2)).values()}get(e2){return h(this.wrappedObject,e2)}set(e2,t2){return D(this.wrappedObject,e2,t2),this}has(e2){return n2(this.wrappedObject,e2)&&e2 in this.wrappedObject}entries(){return a(this.keys(),e2=>[e2,this.get(e2)])}forEach(e2){for(let t2 of this.keys())e2(this.get(t2),t2,this)}delete(e2){n2(this.wrappedObject,e2)&&delete this.wrappedObject[e2]}clear(){for(let e2 of this.keys())this.delete(e2)}get size(){return Object.keys(this.wrappedObject).length}}class k{constructor(e2,t2,r3){this.a=e2,this.b=t2,this.bKeys=r3,this[Symbol.iterator]=this.entries}get(e2){return(this.bKeys.has(e2)?this.b:this.a).get(e2)}set(e2,t2){return(this.bKeys.has(e2)?this.b:this.a).set(e2,t2),this}has(e2){return this.b.has(e2)||this.a.has(e2)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return a(this.keys(),e2=>[e2,this.get(e2)])}forEach(e2){for(let t2 of this.keys())e2(this.get(t2),t2,this)}delete(e2){return(this.bKeys.has(e2)?this.b:this.a).delete(e2)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function a(t2,r3){return{next:()=>{var e2=t2.next();return e2.done?e2:{value:r3(e2.value),done:!1}}}}function P(){return new Map}function U(e2){if(!e2)return P();if(fe(e2))return e2;if(ce(e2))return new I(e2);throw new Error("createMap can create maps from objects or Maps")}function A(e2){return typeof e2=="number"}function Q(e2){return!(!e2||typeof e2!="object"||typeof e2.constructor!="function")&&(e2.isBigNumber===!0&&typeof e2.constructor.prototype=="object"&&e2.constructor.prototype.isBigNumber===!0||typeof e2.constructor.isDecimal=="function"&&e2.constructor.isDecimal(e2)===!0)}function R(e2){return typeof e2=="bigint"}function te(e2){return e2&&typeof e2=="object"&&Object.getPrototypeOf(e2).isComplex===!0||!1}function re(e2){return e2&&typeof e2=="object"&&Object.getPrototypeOf(e2).isFraction===!0||!1}function L(e2){return e2&&e2.constructor.prototype.isUnit===!0||!1}function j(e2){return typeof e2=="string"}let b=Array.isArray;function _(e2){return e2&&e2.constructor.prototype.isMatrix===!0||!1}function $(e2){return Array.isArray(e2)||_(e2)}function H(e2){return e2&&e2.isDenseMatrix&&e2.constructor.prototype.isMatrix===!0||!1}function G(e2){return e2&&e2.isSparseMatrix&&e2.constructor.prototype.isMatrix===!0||!1}function V(e2){return e2&&e2.constructor.prototype.isRange===!0||!1}function Z(e2){return e2&&e2.constructor.prototype.isIndex===!0||!1}function W(e2){return typeof e2=="boolean"}function Y(e2){return e2&&e2.constructor.prototype.isResultSet===!0||!1}function J(e2){return e2&&e2.constructor.prototype.isHelp===!0||!1}function X(e2){return typeof e2=="function"}function ne(e2){return e2 instanceof Date}function ie(e2){return e2 instanceof RegExp}function ce(e2){return!(!e2||typeof e2!="object"||e2.constructor!==Object||te(e2)||re(e2))}function fe(e2){return!!e2&&(e2 instanceof Map||e2 instanceof I||typeof e2.set=="function"&&typeof e2.get=="function"&&typeof e2.keys=="function"&&typeof e2.has=="function")}function pe(e2){return fe(e2)&&fe(e2.a)&&fe(e2.b)}function me(e2){return fe(e2)&&ce(e2.wrappedObject)}function he(e2){return e2===null}function de(e2){return e2===void 0}function ge(e2){return e2&&e2.isAccessorNode===!0&&e2.constructor.prototype.isNode===!0||!1}function ye(e2){return e2&&e2.isArrayNode===!0&&e2.constructor.prototype.isNode===!0||!1}function xe(e2){return e2&&e2.isAssignmentNode===!0&&e2.constructor.prototype.isNode===!0||!1}function be(e2){return e2&&e2.isBlockNode===!0&&e2.constructor.prototype.isNode===!0||!1}function ve(e2){return e2&&e2.isConditionalNode===!0&&e2.constructor.prototype.isNode===!0||!1}function ae(e2){return e2&&e2.isConstantNode===!0&&e2.constructor.prototype.isNode===!0||!1}function we(e2){return ae(e2)||oe(e2)&&e2.args.length===1&&ae(e2.args[0])&&"-+~".includes(e2.op)}function Ne(e2){return e2&&e2.isFunctionAssignmentNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Ae(e2){return e2&&e2.isFunctionNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Ee(e2){return e2&&e2.isIndexNode===!0&&e2.constructor.prototype.isNode===!0||!1}function O(e2){return e2&&e2.isNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Se(e2){return e2&&e2.isObjectNode===!0&&e2.constructor.prototype.isNode===!0||!1}function oe(e2){return e2&&e2.isOperatorNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Me(e2){return e2&&e2.isParenthesisNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Ce(e2){return e2&&e2.isRangeNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Te(e2){return e2&&e2.isRelationalNode===!0&&e2.constructor.prototype.isNode===!0||!1}function se(e2){return e2&&e2.isSymbolNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Be(e2){return e2&&e2.constructor.prototype.isChain===!0||!1}function K(e2){var t2=typeof e2;return t2=="object"?e2===null?"null":Q(e2)?"BigNumber":e2.constructor&&e2.constructor.name?e2.constructor.name:"Object":t2}function ee(e2){var t2=typeof e2;if(t2=="number"||t2=="bigint"||t2=="string"||t2=="boolean"||e2==null)return e2;if(typeof e2.clone=="function")return e2.clone();if(Array.isArray(e2))return e2.map(ee);if(e2 instanceof Date)return new Date(e2.valueOf());if(Q(e2))return e2;if(ce(e2)){var r3=e2,n3=ee;let i2={};for(let a2 in r3)ue(r3,a2)&&(i2[a2]=n3(r3[a2]));return i2}if(t2=="function")return e2;throw new TypeError(`Cannot clone: unknown type of value (value: ${e2})`)}function Fe(e2,t2){for(let r3 in t2)ue(t2,r3)&&(e2[r3]=t2[r3]);return e2}function De(e2,t2){let r3,n3,i2;if(Array.isArray(e2)){if(!Array.isArray(t2)||e2.length!==t2.length)return!1;for(n3=0,i2=e2.length;n3!(e4&&e4[0]==="?")).every(e4=>i2[e4]!==void 0))return u2(t3);{let a2=n3.filter(e4=>i2[e4]===void 0);throw new Error(`Cannot create function "${r3}", some dependencies are missing: ${a2.map(e4=>`"${e4}"`).join(", ")}.`)}}return t2.isFactory=!0,t2.fn=o2,t2.dependencies=s2.slice().sort(),e2&&(t2.meta=e2),t2}function ze(e2){return typeof e2=="function"&&typeof e2.fn=="string"&&Array.isArray(e2.dependencies)}function qe(e2){return e2&&e2[0]==="?"?e2.slice(1):e2}function v(e2){return typeof e2=="boolean"||!!isFinite(e2)&&e2===Math.round(e2)}function Ie(e2,t2){if(t2.number==="bigint")try{BigInt(e2)}catch{return t2.numberFallback}return t2.number}let ke=Math.sign||function(e2){return 0l2.length||u2-c2+1>l2.length;)l2.push(0);else{let a3=Math.abs(u2-c2)-(l2.length-1);for(let e4=0;e4=i3)return We(e3,t3);{let e4=o3.coefficients,r5=o3.exponent,n5=(e4=(e4=e4.length{throw new Error('Option "precision" must be a number or BigNumber')})),e2.wordSize!==void 0&&(r3=it(e2.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e2.notation&&(n3=e2.notation)}return{notation:n3,precision:t2,wordSize:r3}}function Ve(e2){var t2=String(e2).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t2)throw new SyntaxError("Invalid number "+e2);let r3=t2[1],n3=t2[2],i2=parseFloat(t2[4]||"0");e2=n3.indexOf("."),i2+=e2!==-1?e2-1:n3.length-1;let a2=n3.replace(".","").replace(/^0*/,function(e3){return i2-=e3.length,""}).replace(/0*$/,"").split("").map(function(e3){return parseInt(e3)});return a2.length===0&&(a2.push(0),i2++),{sign:r3,coefficients:a2,exponent:i2}}function Ze(e2,t2){if(isNaN(e2)||!isFinite(e2))return String(e2);e2=Ve(e2),e2=typeof t2=="number"?Ye(e2,e2.exponent+1+t2):e2;let r3=e2.coefficients,n3=e2.exponent+1;return t2=n3+(t2||0),r3.lengtht2&&5<=n3.splice(t2,n3.length-t2)[0]){let e3=t2-1;for(n3[e3]++;n3[e3]===10;)n3.pop(),e3===0&&(n3.unshift(0),r3.exponent++,e3++),e3--,n3[e3]++}return r3}function Je(t2){let r3=[];for(let e2=0;e2/^[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11BC0}-\u{11BE0}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E4D0}-\u{1E4EB}\u{1E5D0}-\u{1E5ED}\u{1E5F0}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E900}-\u{1E943}\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}][0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11BC0}-\u{11BE0}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E4D0}-\u{1E4EB}\u{1E5D0}-\u{1E5ED}\u{1E5F0}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E900}-\u{1E943}\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}]*$/u.test(e3)},{name:"string",test:j},{name:"Chain",test:Be},{name:"Array",test:b},{name:"Matrix",test:_},{name:"DenseMatrix",test:H},{name:"SparseMatrix",test:G},{name:"Range",test:V},{name:"Index",test:Z},{name:"boolean",test:W},{name:"ResultSet",test:Y},{name:"Help",test:J},{name:"function",test:X},{name:"Date",test:ne},{name:"RegExp",test:ie},{name:"null",test:he},{name:"undefined",test:de},{name:"AccessorNode",test:ge},{name:"ArrayNode",test:ye},{name:"AssignmentNode",test:xe},{name:"BlockNode",test:be},{name:"ConditionalNode",test:ve},{name:"ConstantNode",test:ae},{name:"FunctionNode",test:Ae},{name:"FunctionAssignmentNode",test:Ne},{name:"IndexNode",test:Ee},{name:"Node",test:O},{name:"ObjectNode",test:Se},{name:"OperatorNode",test:oe},{name:"ParenthesisNode",test:Me},{name:"RangeNode",test:Ce},{name:"RelationalNode",test:Te},{name:"SymbolNode",test:se},{name:"Map",test:fe},{name:"Object",test:ce}]),a2.addConversions([{from:"number",to:"BigNumber",convert:function(e3){if(r3||ut(e3),1515 significant digits to BigNumber (value: "+e3+"). Use function bignumber(x) to convert to BigNumber.");return new r3(e3)}},{from:"number",to:"Complex",convert:function(e3){return n3||lt(e3),new n3(e3,0)}},{from:"BigNumber",to:"Complex",convert:function(e3){return n3||lt(e3),new n3(e3.toNumber(),0)}},{from:"bigint",to:"number",convert:function(e3){if(e3>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+e3+")");return Number(e3)}},{from:"bigint",to:"BigNumber",convert:function(e3){return r3||ut(e3),new r3(e3.toString())}},{from:"bigint",to:"Fraction",convert:function(e3){return i2||ct(e3),new i2(e3)}},{from:"Fraction",to:"BigNumber",convert:function(e3){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e3){return n3||lt(e3),new n3(e3.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e3){i2||ct(e3);let t3=new i2(e3);if(t3.valueOf()!==e3)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e3+"). Use function fraction(x) to convert to Fraction.");return t3}},{from:"string",to:"number",convert:function(e3){var t3=Number(e3);if(isNaN(t3))throw new Error('Cannot convert "'+e3+'" to a number');return t3}},{from:"string",to:"BigNumber",convert:function(t3){r3||ut(t3);try{return new r3(t3)}catch{throw new Error('Cannot convert "'+t3+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(t3){try{return BigInt(t3)}catch{throw new Error('Cannot convert "'+t3+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(t3){i2||ct(t3);try{return new i2(t3)}catch{throw new Error('Cannot convert "'+t3+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t3){n3||lt(t3);try{return new n3(t3)}catch{throw new Error('Cannot convert "'+t3+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e3){return+e3}},{from:"boolean",to:"BigNumber",convert:function(e3){return r3||ut(e3),new r3(+e3)}},{from:"boolean",to:"bigint",convert:function(e3){return BigInt(+e3)}},{from:"boolean",to:"Fraction",convert:function(e3){return i2||ct(e3),new i2(+e3)}},{from:"boolean",to:"string",convert:function(e3){return String(e3)}},{from:"Array",to:"Matrix",convert:function(e3){if(t2)return new t2(e3);throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}},{from:"Matrix",to:"Array",convert:function(e3){return e3.valueOf()}}]),a2.onMismatch=(e3,t3,r4)=>{var n4=a2.createError(e3,t3,r4);if(["wrongType","mismatch"].includes(n4.data.category)&&t3.length===1&&$(t3[0])&&r4.some(e4=>!e4.params.includes(","))){let t4=new TypeError(`Function '${e3}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e3})'.`);throw t4.data=n4.data,t4}throw n4},a2.onMismatch=(e3,t3,r4)=>{var n4=a2.createError(e3,t3,r4);if(["wrongType","mismatch"].includes(n4.data.category)&&t3.length===1&&$(t3[0])&&r4.some(e4=>!e4.params.includes(","))){let t4=new TypeError(`Function '${e3}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e3})'.`);throw t4.data=n4.data,t4}throw n4},a2});function ut(e2){throw new Error(`Cannot convert value ${e2} into a BigNumber: no class 'BigNumber' provided`)}function lt(e2){throw new Error(`Cannot convert value ${e2} into a Complex number: no class 'Complex' provided`)}function ct(e2){throw new Error(`Cannot convert value ${e2} into a Fraction, no class 'Fraction' provided.`)}let ft=s("ResultSet",[],()=>{function t2(e2){if(!(this instanceof t2))throw new SyntaxError("Constructor must be called with the new operator");this.entries=e2||[]}return t2.prototype.type="ResultSet",t2.prototype.isResultSet=!0,t2.prototype.valueOf=function(){return this.entries},t2.prototype.toString=function(){return"["+this.entries.map(String).join(", ")+"]"},t2.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},t2.fromJSON=function(e2){return new t2(e2.entries)},t2},{isClass:!0});var pt,mt,ht=9e15,dt=1e9,gt="0123456789abcdef",yt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",xt="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",bt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ht,maxE:ht,crypto:!1},w=!0,vt="[DecimalError] ",wt=vt+"Invalid argument: ",Nt=vt+"Precision limit exceeded",At=vt+"crypto unavailable",Et="[object Decimal]",St=Math.floor,d=Math.pow,Mt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ct=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Tt=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Bt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ft=1e7,Dt=yt.length-1,Ot=xt.length-1,o={toStringTag:Et};function _t(e2){var t2,r3,n3,i2=e2.length-1,a2="",o2=e2[0];if(0r3-1&&(a2[n3+1]===void 0&&(a2[n3+1]=0),a2[n3+1]+=a2[n3]/r3|0,a2[n3]%=r3)}return a2.reverse()}o.absoluteValue=o.abs=function(){var e2=new this.constructor(this);return e2.s<0&&(e2.s=1),B(e2)},o.ceil=function(){return B(new this.constructor(this),this.e+1,2)},o.clampedTo=o.clamp=function(e2,t2){var r3=this.constructor;if(e2=new r3(e2),t2=new r3(t2),!e2.s||!t2.s)return new r3(NaN);if(e2.gt(t2))throw Error(wt+t2);return this.cmp(e2)<0?e2:0e2.e^o2<0?1:-1;for(t2=0,r3=(s2=i2.length)<(n3=a2.length)?s2:n3;t2a2[t2]^o2<0?1:-1;return s2===n3?0:n3this.d.length-2},o.isNaN=function(){return!this.s},o.isNegative=o.isNeg=function(){return this.s<0},o.isPositive=o.isPos=function(){return 0(n3=Math.max(Math.ceil(s2/7),o2)+2)&&(a2=n3,t2.length=1),t2.reverse(),n3=a2;n3--;)t2.push(0);t2.reverse()}else{for((c2=(n3=l2.length)<(o2=f2.length))&&(o2=n3),n3=0;n3(i2=(c2=Math.ceil(a2/7))>i2?c2+1:i2+1)&&(n3=i2,r3.length=1),r3.reverse();n3--;)r3.push(0);r3.reverse()}for((i2=s2.length)-(n3=u2.length)<0&&(n3=i2,r3=u2,u2=s2,s2=r3),t2=0;n3;)t2=(s2[--n3]=s2[n3]+u2[n3]+t2)/Ft|0,s2[n3]%=Ft;for(t2&&(s2.unshift(t2),++l2),i2=s2.length;s2[--i2]==0;)s2.pop();return e2.d=s2,e2.e=jt(s2,l2),w?B(e2,a2,o2):e2},o.precision=o.sd=function(e2){var t2;if(e2!==void 0&&e2!==!!e2&&e2!==1&&e2!==0)throw Error(wt+e2);return this.d?(t2=Ht(this.d),e2&&this.e+1>t2&&(t2=this.e+1)):t2=NaN,t2},o.round=function(){var e2=this.constructor;return B(new e2(this),this.e+1,e2.rounding)},o.sine=o.sin=function(){var e2,t2,r3=this,n3=r3.constructor;return r3.isFinite()?r3.isZero()?new n3(r3):(e2=n3.precision,t2=n3.rounding,n3.precision=e2+Math.max(r3.e,r3.sd())+7,n3.rounding=1,r3=(function(e3,t3){var r4,n4=t3.d.length;if(n4<3)return t3.isZero()?t3:Kt(e3,2,t3,t3);r4=16<(r4=1.4*Math.sqrt(n4))?16:0|r4,t3=Kt(e3,2,t3=t3.times(1/er(5,r4)),t3);for(var i2,a2=new e3(5),o2=new e3(16),s2=new e3(20);r4--;)i2=t3.times(t3),t3=t3.times(a2.plus(i2.times(o2.times(i2).minus(s2))));return t3})(n3,tr(n3,r3)),n3.precision=e2,n3.rounding=t2,B(2=e2.d.length-1&&(r3=l2<0?-l2:l2)<=9007199254740991)return i2=Vt(u2,s2,r3,n3),e2.s<0?new u2(1).div(i2):B(i2,n3,a2);if((o2=s2.s)<0){if(t2u2.maxE+1||t2=n3.toExpPos):(zt(e2,1,dt),t2===void 0?t2=n3.rounding:zt(t2,0,8),Ut(r3=B(new n3(r3),e2,t2),e2<=r3.e||r3.e<=n3.toExpNeg,e2));return r3.isNeg()&&!r3.isZero()?"-"+t2:t2},o.toSignificantDigits=o.toSD=function(e2,t2){var r3=this.constructor;return e2===void 0?(e2=r3.precision,t2=r3.rounding):(zt(e2,1,dt),t2===void 0?t2=r3.rounding:zt(t2,0,8)),B(new r3(this),e2,t2)},o.toString=function(){var e2=this,t2=e2.constructor,t2=Ut(e2,e2.e<=t2.toExpNeg||e2.e>=t2.toExpPos);return e2.isNeg()&&!e2.isZero()?"-"+t2:t2},o.truncated=o.trunc=function(){return B(new this.constructor(this),this.e+1,1)},o.valueOf=o.toJSON=function(){var e2=this,t2=e2.constructor,t2=Ut(e2,e2.e<=t2.toExpNeg||e2.e>=t2.toExpPos);return e2.isNeg()?"-"+t2:t2};var N=function(e2,t2,r3,n3,i2,a2){var o2,s2,u2,l2,c2,f2,p2,m2,h2,d2,g2,y2,x2,b2,v2,w2,N2,A2,E2,S2=e2.constructor,M2=e2.s==t2.s?1:-1,C2=e2.d,T2=t2.d;if(!(C2&&C2[0]&&T2&&T2[0]))return new S2(e2.s&&t2.s&&(C2?!T2||C2[0]!=T2[0]:T2)?C2&&C2[0]==0||!T2?0*M2:M2/0:NaN);for(s2=a2?(c2=1,e2.e-t2.e):(a2=Ft,St(e2.e/(c2=7))-St(t2.e/c2)),A2=T2.length,w2=C2.length,h2=(M2=new S2(M2)).d=[],u2=0;T2[u2]==(C2[u2]||0);u2++);if(T2[u2]>(C2[u2]||0)&&s2--,r3==null?(x2=r3=S2.precision,n3=S2.rounding):x2=i2?r3+(e2.e-t2.e)+1:r3,x2<0)h2.push(1),f2=!0;else{if(x2=x2/c2+2|0,u2=0,A2==1){for(T2=T2[l2=0],x2++;(u2=a2/2&&++N2;l2=0,(o2=Rt(T2,d2,A2,g2))<0?(y2=d2[0],1<(l2=(y2=A2!=g2?y2*a2+(d2[1]||0):y2)/N2|0)?(o2=Rt(p2=kt(T2,l2=a2<=l2?a2-1:l2,a2),d2,m2=p2.length,g2=d2.length))==1&&(l2--,Pt(p2,A2t2[i2]?1:-1;break}return a2}function Pt(e2,t2,r3,n3){for(var i2=0;r3--;)e2[r3]-=i2,i2=e2[r3]=(s2=c2.length)){if(!n3)break e;for(;s2++<=f2;)c2.push(0);l2=u2=0,o2=(a2%=7)-7+(i2=1)}else{for(l2=s2=c2[f2],i2=1;10<=s2;s2/=10)i2++;u2=(o2=(a2%=7)-7+i2)<0?0:l2/d(10,i2-o2-1)%10|0}if(n3=n3||t2<0||c2[f2+1]!==void 0||(o2<0?l2:l2%d(10,i2-o2-1)),u2=r3<4?(u2||n3)&&(r3==0||r3==(e2.s<0?3:2)):5p2.maxE?(e2.d=null,e2.e=NaN):e2.ee2.constructor.maxE?(e2.d=null,e2.e=NaN):e2.ei2-1;)c2[r3]=0,r3||(++a2,c2.unshift(1));for(s2=c2.length;!c2[s2-1];--s2);for(o2=0,l2="";o2s2)for(a2-=s2;a2--;)l2+="0";else a2t2&&(e2.length=t2,1)}function ir(e2){return new this(e2).abs()}function ar(e2){return new this(e2).acos()}function or(e2){return new this(e2).acosh()}function sr(e2,t2){return new this(e2).plus(t2)}function ur(e2){return new this(e2).asin()}function lr(e2){return new this(e2).asinh()}function cr(e2){return new this(e2).atan()}function fr(e2){return new this(e2).atanh()}function pr(e2,t2){e2=new this(e2),t2=new this(t2);var r3,n3=this.precision,i2=this.rounding,a2=n3+4;return e2.s&&t2.s?e2.d||t2.d?!t2.d||e2.isZero()?(r3=t2.s<0?$t(this,n3,i2):new this(0)).s=e2.s:!e2.d||t2.isZero()?(r3=$t(this,a2,1).times(.5)).s=e2.s:r3=t2.s<0?(this.precision=a2,this.rounding=1,r3=this.atan(N(e2,t2,a2,1)),t2=$t(this,a2,1),this.precision=n3,this.rounding=i2,e2.s<0?r3.minus(t2):r3.plus(t2)):this.atan(N(e2,t2,a2,1)):(r3=$t(this,a2,1).times(0"u"||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(At);this[t2]=!0}else this[t2]=!1}return this}function yr(e2){return new this(e2).cos()}function xr(e2){return new this(e2).cosh()}function br(e2,t2){return new this(e2).div(t2)}function vr(e2){return new this(e2).exp()}function wr(e2){return B(e2=new this(e2),e2.e+1,3)}function Nr(){var e2,t2,r3=new this(0);for(w=!1,e2=0;e2a2.maxE?(i3.e=NaN,i3.d=null):e3.e{let{on:t2,config:r3}=e2,n3=Vr.clone({precision:r3.precision,modulo:Vr.EUCLID});return n3.prototype=Object.create(n3.prototype),n3.prototype.type="BigNumber",n3.prototype.isBigNumber=!0,n3.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n3.fromJSON=function(e3){return new n3(e3.value)},t2&&t2("config",function(e3,t3){e3.precision!==t3.precision&&n3.config({precision:e3.precision})}),n3},{isClass:!0}),Wr=Math.cosh||function(e2){return Math.abs(e2)<1e-9?1-e2:.5*(Math.exp(e2)+Math.exp(-e2))},Yr=Math.sinh||function(e2){return Math.abs(e2)<1e-9?e2:.5*(Math.exp(e2)-Math.exp(-e2))},Jr=function(){throw SyntaxError("Invalid Param")};function Xr(e2,t2){var r3=Math.abs(e2),n3=Math.abs(t2);return e2===0?Math.log(n3):t2===0?Math.log(r3):r3<3e3&&n3<3e3?.5*Math.log(e2*e2+t2*t2):(e2*=.5,t2*=.5,.5*Math.log(e2*e2+t2*t2)+Math.LN2)}function Qr(e2,n3){let i2=Kr;if(e2==null)i2.re=i2.im=0;else if(n3!==void 0)i2.re=e2,i2.im=n3;else switch(typeof e2){case"object":if("im"in e2&&"re"in e2)i2.re=e2.re,i2.im=e2.im;else if("abs"in e2&&"arg"in e2){if(!isFinite(e2.abs)&&isFinite(e2.arg))return u.INFINITY;i2.re=e2.abs*Math.cos(e2.arg),i2.im=e2.abs*Math.sin(e2.arg)}else if("r"in e2&&"phi"in e2){if(!isFinite(e2.r)&&isFinite(e2.phi))return u.INFINITY;i2.re=e2.r*Math.cos(e2.phi),i2.im=e2.r*Math.sin(e2.phi)}else e2.length===2?(i2.re=e2[0],i2.im=e2[1]):Jr();break;case"string":i2.im=i2.re=0;let n4=e2.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),t2=1,r3=0;n4===null&&Jr();for(let e3=0;e3function(){try{return mod||(0,cb[__getOwnPropNames(cb)[0]])((mod={exports:{}}).exports,mod),mod.exports}catch(e){throw mod=0,e}};var __copyProps=(to,from,except,desc)=>{if(from&&typeof from=="object"||typeof from=="function")for(let key of __getOwnPropNames(from))!__hasOwnProp.call(to,key)&&key!==except&&__defProp(to,key,{get:()=>from[key],enumerable:!(desc=__getOwnPropDesc(from,key))||desc.enumerable});return to};var __toESM=(mod,isNodeMode,target)=>(target=mod!=null?__create(__getProtoOf(mod)):{},__copyProps(isNodeMode||!mod||!mod.__esModule?__defProp(target,"default",{value:mod,enumerable:!0}):target,mod));var require_mathjs_min=__commonJS({"mathjs.min.js"(exports,module){(function(e,t){typeof exports=="object"&&typeof module=="object"?module.exports=t():typeof define=="function"&&define.amd?define([],t):typeof exports=="object"?exports.math=t():e.math=t()})(exports,()=>{var r={31:function(e,r2,n2){var o;(function(e2){function i(e3){var t2=this,r3="";t2.next=function(){var e4=t2.x^t2.x>>>2;return t2.x=t2.y,t2.y=t2.z,t2.z=t2.w,t2.w=t2.v,(t2.d=t2.d+362437|0)+(t2.v=t2.v^t2.v<<4^e4^e4<<1)|0},t2.x=0,t2.y=0,t2.z=0,t2.w=0,e3===((t2.v=0)|e3)?t2.x=e3:r3+=e3;for(var n3=0;n3>>4),t2.next()}function a(e3,t2){return t2.x=e3.x,t2.y=e3.y,t2.z=e3.z,t2.w=e3.w,t2.v=e3.v,t2.d=e3.d,t2}function t(e3,t2){function r3(){return(n3.next()>>>0)/4294967296}var n3=new i(e3),e3=t2&&t2.state;return r3.double=function(){do var e4=((n3.next()>>>11)+(n3.next()>>>0)/4294967296)/2097152;while(e4===0);return e4},r3.int32=n3.next,r3.quick=r3,e3&&(typeof e3=="object"&&a(e3,n3),r3.state=function(){return a(n3,{})}),r3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.xorwow=t})(e=n2.nmd(e),n2.amdD)},67:function(e,r2,n2){var o;(function(e2){function i(e3){var t2,i2=this,r3=(i2.next=function(){var e4=i2.x,t3=i2.i,r4=e4[t3],n4=(r4^=r4>>>7)^r4<<24;return n4=(n4=(n4^=(r4=e4[t3+1&7])^r4>>>10)^((r4=e4[t3+3&7])^r4>>>3))^((r4=e4[t3+4&7])^r4<<7),r4=e4[t3+7&7],n4^=(r4^=r4<<13)^r4<<9,e4[t3]=n4,i2.i=t3+1&7,n4},i2),n3=e3,a2=[];if(n3===(0|n3))a2[0]=n3;else for(n3=""+n3,t2=0;t2>>0)/4294967296}var n3=new i(e3=e3??+new Date),e3=t2&&t2.state;return r3.double=function(){do var e4=((n3.next()>>>11)+(n3.next()>>>0)/4294967296)/2097152;while(e4===0);return e4},r3.int32=n3.next,r3.quick=r3,e3&&(e3.x&&a(e3,n3),r3.state=function(){return a(n3,{})}),r3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.xorshift7=t})(e=n2.nmd(e),n2.amdD)},144:e=>{"use strict";function s(e2,t){return u({},e2,t)}var u=Object.assign||function(e2){for(var t=1;t=e3.length&&n2.slice(0,e3.length)===e3&&(i+=a[o[t2]],n2=n2.slice(e3.length,n2.length),r3=!0)}),r3||(i+=n2.slice(0,1),n2=n2.slice(1,n2.length))})();return i}},180:function(e,r2,n2){var o;(function(e2){function i(e3){var n3,t2=this,r3=(n3=4022871197,function(e4){e4=String(e4);for(var t3=0;t3>>0)*n3)>>>0,n3+=4294967296*(r4-=n3)}return 23283064365386963e-26*(n3>>>0)});t2.next=function(){var e4=2091639*t2.s0+23283064365386963e-26*t2.c;return t2.s0=t2.s1,t2.s1=t2.s2,t2.s2=e4-(t2.c=0|e4)},t2.c=1,t2.s0=r3(" "),t2.s1=r3(" "),t2.s2=r3(" "),t2.s0-=r3(e3),t2.s0<0&&(t2.s0+=1),t2.s1-=r3(e3),t2.s1<0&&(t2.s1+=1),t2.s2-=r3(e3),t2.s2<0&&(t2.s2+=1)}function a(e3,t2){return t2.c=e3.c,t2.s0=e3.s0,t2.s1=e3.s1,t2.s2=e3.s2,t2}function t(e3,t2){var r3=new i(e3),e3=t2&&t2.state,n3=r3.next;return n3.int32=function(){return 4294967296*r3.next()|0},n3.double=function(){return n3()+11102230246251565e-32*(2097152*n3()|0)},n3.quick=n3,e3&&(typeof e3=="object"&&a(e3,r3),n3.state=function(){return a(r3,{})}),n3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.alea=t})(e=n2.nmd(e),n2.amdD)},181:function(e,r2,n2){var o;(function(e2){function i(e3){var t2=this,r3="";t2.x=0,t2.y=0,t2.z=0,t2.w=0,t2.next=function(){var e4=t2.x^t2.x<<11;return t2.x=t2.y,t2.y=t2.z,t2.z=t2.w,t2.w^=t2.w>>>19^e4^e4>>>8},e3===(0|e3)?t2.x=e3:r3+=e3;for(var n3=0;n3>>0)/4294967296}var n3=new i(e3),e3=t2&&t2.state;return r3.double=function(){do var e4=((n3.next()>>>11)+(n3.next()>>>0)/4294967296)/2097152;while(e4===0);return e4},r3.int32=n3.next,r3.quick=r3,e3&&(typeof e3=="object"&&a(e3,n3),r3.state=function(){return a(n3,{})}),r3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.xor128=t})(e=n2.nmd(e),n2.amdD)},234:()=>{},369:function(e){e.exports=(function(){"use strict";function T(){return!0}function ce(){return!1}function fe(){}let B="Argument is not a typed-function.";return(function e2(){function c(e3){return typeof e3=="object"&&e3!==null&&e3.constructor===Object}let t=[{name:"number",test:function(e3){return typeof e3=="number"}},{name:"string",test:function(e3){return typeof e3=="string"}},{name:"boolean",test:function(e3){return typeof e3=="boolean"}},{name:"Function",test:function(e3){return typeof e3=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(e3){return e3 instanceof Date}},{name:"RegExp",test:function(e3){return e3 instanceof RegExp}},{name:"Object",test:c},{name:"null",test:function(e3){return e3===null}},{name:"undefined",test:function(e3){return e3===void 0}}],r2={name:"any",test:T,isAny:!0},a,o,i=0,J={createCount:0};function s(e3){var t2=a.get(e3);if(t2)return t2;let r3='Unknown type "'+e3+'"';var n3=e3.toLowerCase();let i2;for(i2 of o)if(i2.toLowerCase()===n3){r3+='. Did you mean "'+i2+'" ?';break}throw new TypeError(r3)}function n2(t2){var e3=1{let t2=a.get(e4);return!t2.isAny&&t2.test(r3)});return e3.length?e3:["any"]}function f(e3){return e3&&typeof e3=="function"&&"_typedFunctionData"in e3}function p(r3,n3,i2){if(!f(r3))throw new TypeError(B);let a2=i2&&i2.exact,o2=Q(Array.isArray(n3)?n3.join(","):n3),e3=X(o2);if(!a2||e3 in r3.signatures){let n4=r3._typedFunctionData.signatureMap.get(e3);if(n4)return n4}var s2=o2.length;let u2,t2;if(a2){let e4;for(e4 in u2=[],r3.signatures)u2.push(r3._typedFunctionData.signatureMap.get(e4))}else u2=r3._typedFunctionData.signatures;for(let t3=0;t3!r4.has(e5.name)))continue}i3.push(e4)}}if((u2=i3).length===0)break}for(t2 of u2)if(t2.params.length<=s2)return t2;throw new TypeError("Signature not found (signature: "+(r3.name||"unnamed")+"("+X(o2,", ")+"))")}function X(e3,t2){return t2=1e4.name).join(t2)}function oe(e3){let t2=(function(e4){if(e4.length===0)return[];let r4=e4.map(s);1e5.index-t3.index);let n4=r4[0].conversionsTo;if(e4.length===1)return n4;n4=n4.concat([]);let i3=new Set(e4);for(let t3=1;t3e4.name)),r3=e3.hasAny,n3=e3.name;var i2=t2.map(function(e4){var t3=s(e4.from);return r3=t3.isAny||r3,n3+="|"+e4.from,{name:e4.from,typeIndex:t3.index,test:t3.test,isAny:t3.isAny,conversion:e4,conversionIndex:e4.index}});return{types:e3.types.concat(i2),name:n3,hasAny:r3,hasConversion:0t2.typeSet.add(e3.name))),t2.typeSet}function Q(e3){let t2=[];if(typeof e3!="string")throw new TypeError("Signatures must be strings");let r3=e3.trim();if(r3==="")return t2;let n3=r3.split(",");for(let e4=0;e4s(e6.trim())),n4=!1,i2=t3?"...":"";return{types:r5.map(function(e6){return n4=e6.isAny||n4,i2+=e6.name+"|",{name:e6.name,typeIndex:e6.index,test:e6.test,isAny:e6.isAny,conversion:null,conversionIndex:-1}}),name:i2.slice(0,-1),hasAny:n4,hasConversion:!1,restParam:t3}})(n3[e4].trim());if(r4.restParam&&e4!==n3.length-1)throw new SyntaxError('Unexpected rest parameter "'+n3[e4]+'": only allowed for the last parameter');if(r4.types.length===0)return null;t2.push(r4)}return t2}function K(e3){return e3=ie(e3),!!e3&&e3.restParam}function ee(e3){if(e3&&e3.types.length!==0){if(e3.types.length===1)return s(e3.types[0].name).test;if(e3.types.length===2){let T2=s(e3.types[0].name).test,t2=s(e3.types[1].name).test;return function(e4){return T2(e4)||t2(e4)}}{let T2=e3.types.map(function(e4){return s(e4.name).test});return function(t2){for(let e4=0;e4{let t2;for(t2 of te(e4.params,r3))n3.add(t2)}),n3.has("any")?["any"]:Array.from(n3)}function g(r3,n3,e3){let t2,i2;var a2=r3||"unnamed";let o2,s2=e3;for(o2=0;o2{let t3=ee(h(e4.params,o2));(o2e3)return(t2=new TypeError("Too many arguments in function "+a2+" (expected: "+e3+", actual: "+n3.length+")")).data={category:"tooManyArgs",fn:a2,index:n3.length,expectedLength:e3},t2;let u2=[];for(let e4=0;e4A(e4)?w(e4.referToSelf.callback):N(e4)?v(e4.referTo.references,e4.referTo.callback):e4),a2=new Array(i2.length).fill(!1),o2=!0;for(;o2;){let t2=!(o2=!1);for(let e4=0;e4{let t3=n3[e4];if(q.test(t3.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}let i2=[],a2=[],o2={},s2=[],u2;for(u2 in r3)if(Object.prototype.hasOwnProperty.call(r3,u2)){let t3=Q(u2);if(t3){i2.forEach(function(e5){if((function(n4,i3){let a3=Math.max(n4.length,i3.length);for(let r5=0;r5=e6:r4?e6>=o3:e6===o3})(e5,t3))throw new TypeError('Conflicting signatures "'+X(e5)+'" and "'+X(t3)+'".')}),i2.push(t3);let ce2=a2.length,fe2=(a2.push(r3[u2]),t3.map(oe)),e4;for(e4 of(function t4(r4,n4,i3){if(n4e6.name).join("|"),hasAny:t5.some(e6=>e6.isAny),hasConversion:!1,restParam:!0}),e5.push(o3)}else e5=o3.types.map(function(e6){return{types:[e6],name:e6.name,hasAny:e6.isAny,hasConversion:e6.conversion,restParam:!1}});return a3=e5,Array.prototype.concat.apply([],a3.map(function(e6){return t4(r4,n4+1,i3.concat([e6]))}))}var a3;return[i3]})(fe2,0,[])){let t4=X(e4);s2.push({params:e4,name:t4,fn:ce2}),e4.every(e5=>!e5.hasConversion)&&(o2[t4]=ce2)}}}s2.sort(se);var e3=le(a2,o2,z);let l2;for(l2 in o2)Object.prototype.hasOwnProperty.call(o2,l2)&&(o2[l2]=e3[o2[l2]]);let c2=[],f2=new Map;for(l2 of s2)f2.has(l2.name)||(l2.fn=e3[l2.fn],c2.push(l2),f2.set(l2.name,l2));var p2=c2[0]&&c2[0].params.length<=2&&!K(c2[0].params),m2=c2[1]&&c2[1].params.length<=2&&!K(c2[1].params),h2=c2[2]&&c2[2].params.length<=2&&!K(c2[2].params),d2=c2[3]&&c2[3].params.length<=2&&!K(c2[3].params),g2=c2[4]&&c2[4].params.length<=2&&!K(c2[4].params),y2=c2[5]&&c2[5].params.length<=2&&!K(c2[5].params),x2=p2&&m2&&h2&&d2&&g2&&y2;for(let e4=0;e4=n5+1}}return e5.length===0?function(e6){return e6.length===0}:e5.length===1?(n4=ee(e5[0]),function(e6){return n4(e6[0])&&e6.length===1}):e5.length===2?(n4=ee(e5[0]),i3=ee(e5[1]),function(e6){return n4(e6[0])&&i3(e6[1])&&e6.length===2}):(r4=e5.map(ee),function(t3){for(let e6=0;e6e6.hasConversion)){let i4=K(e5),a3=e5.map(ue);t3=function(){let t4=[],r4=i4?arguments.length-1:arguments.length;for(let e6=0;e6e4.test),W=c2.map(e4=>e4.implementation),Y=function(){for(let e4=G;e4X(Q(e4))),t2=ie(arguments);if(typeof t2!="function")throw new TypeError("Callback function expected as last argument");return v(e3,t2)},J.referToSelf=w,J.convert=function(t2,e3){let r3=s(e3);if(r3.test(t2))return t2;let n3=r3.conversionsTo;if(n3.length===0)throw new Error("There are no conversions to "+e3+" defined.");for(let e4=0;e4e4.from===t2.from);if(n3){if(!e3||!e3.override)throw new Error('There is already a conversion from "'+t2.from+'" to "'+r3.name+'"');J.removeConversion({from:n3.from,to:t2.to,convert:n3.convert})}r3.conversionsTo.push({from:t2.from,convert:t2.convert,index:i++})},J.addConversions=function(e3,t2){e3.forEach(e4=>J.addConversion(e4,t2))},J.removeConversion=function(r3){S(r3);let e3=s(r3.to),t2=(function(t3){for(let e4=0;e4{var n2=r2(180),i=r2(181),a=r2(31),o=r2(67),s=r2(833),u=r2(717),r2=r2(801);r2.alea=n2,r2.xor128=i,r2.xorwow=a,r2.xorshift7=o,r2.xor4096=s,r2.tychei=u,e.exports=r2},504:e=>{function t(){}t.prototype={on:function(e2,t2,r2){var n2=this.e||(this.e={});return(n2[e2]||(n2[e2]=[])).push({fn:t2,ctx:r2}),this},once:function(e2,t2,r2){var n2=this;function i(){n2.off(e2,i),t2.apply(r2,arguments)}return i._=t2,this.on(e2,i,r2)},emit:function(e2){for(var t2=[].slice.call(arguments,1),r2=((this.e||(this.e={}))[e2]||[]).slice(),n2=0,i=r2.length;n2>>7^(t3=i2.c),t3=t3-(r4=i2.d)|0,r4=r4<<24^r4>>>8^(n3=i2.a),n3=n3-e4|0;return i2.b=e4=e4<<20^e4>>>12^t3,i2.c=t3=t3-r4|0,i2.d=r4<<16^t3>>>16^n3,i2.a=n3-e4|0},i2.a=0,i2.b=0,i2.c=-1640531527,i2.d=1367130551,e3===Math.floor(e3)?(i2.a=e3/4294967296|0,i2.b=0|e3):t2+=e3;for(var r3=0;r3>>0)/4294967296}var n3=new i(e3),e3=t2&&t2.state;return r3.double=function(){do var e4=((n3.next()>>>11)+(n3.next()>>>0)/4294967296)/2097152;while(e4===0);return e4},r3.int32=n3.next,r3.quick=r3,e3&&(typeof e3=="object"&&a(e3,n3),r3.state=function(){return a(n3,{})}),r3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.tychei=t})(e=n2.nmd(e),n2.amdD)},801:function(e,t,r2){var o,s=typeof self<"u"?self:this,u=[],l=Math,c=256,f=l.pow(c,6),p=l.pow(2,52),m=2*p,h=255;function n2(e2,t2,r3){function n3(){for(var e3=a.g(6),t3=f,r4=0;e3>>=1;return(e3+r4)/t3}var i=[],e2=y((function e3(t3,r4){var n4,i2=[],a2=typeof t3;if(r4&&a2=="object")for(n4 in t3)try{i2.push(e3(t3[n4],r4-1))}catch{}return i2.length?i2:a2=="string"?t3:t3+"\0"})((t2=t2==1?{entropy:!0}:t2||{}).entropy?[e2,x(u)]:e2??(function(){try{var e3;return o&&(e3=o.randomBytes)?e3=e3(c):(e3=new Uint8Array(c),(s.crypto||s.msCrypto).getRandomValues(e3)),x(e3)}catch{var t3=s.navigator,t3=t3&&t3.plugins;return[+new Date,s,t3,s.screen,x(u)]}})(),3),i),a=new d(i);return n3.int32=function(){return 0|a.g(4)},n3.quick=function(){return a.g(4)/4294967296},n3.double=n3,y(x(a.S),u),(t2.pass||r3||function(e3,t3,r4,n4){return n4&&(n4.S&&g(n4,a),e3.state=function(){return g(a,{})}),r4?(l.random=e3,t3):e3})(n3,e2,"global"in t2?t2.global:this==l,t2.state)}function d(e2){var t2,r3=e2.length,o2=this,n3=0,i=o2.i=o2.j=0,a=o2.S=[];for(r3||(e2=[r3++]);n3>>15^((e4^=e4<<17)^e4>>>12),o2.i=i3,t3+(r4^r4>>>16)|0},o2),u=e3,l=[],c=128;for(u===(0|u)?(r3=u,u=null):(u+="\0",r3=0,c=Math.max(c,u.length)),n3=0,i2=-32;i2>>15)^r3<<4)^r3>>>13,0<=i2&&(n3=(t2=l[127&i2]^=r3+(a2=a2+1640531527|0))==0?n3+1:0);for(128<=n3&&(l[127&(u&&u.length||0)]=-1),n3=127,i2=512;0>>15)^(t2=(t2^=t2<<17)^t2>>>12);s.w=a2,s.X=l,s.i=n3}function a(e3,t2){return t2.i=e3.i,t2.w=e3.w,t2.X=e3.X.slice(),t2}function t(e3,t2){function r3(){return(n3.next()>>>0)/4294967296}var n3=new i(e3=e3??+new Date),e3=t2&&t2.state;return r3.double=function(){do var e4=((n3.next()>>>11)+(n3.next()>>>0)/4294967296)/2097152;while(e4===0);return e4},r3.int32=n3.next,r3.quick=r3,e3&&(e3.X&&a(e3,n3),r3.state=function(){return a(n3,{})}),r3}e2&&e2.exports?e2.exports=t:n2.amdD&&n2.amdO?(o=function(){return t}.call(r2,n2,r2,e2))!==void 0&&(e2.exports=o):this.xor4096=t})(e=n2.nmd(e),n2.amdD)},880:e=>{e.exports=function t(e2,r2){"use strict";function n2(e3){return t.insensitive&&(""+e3).toLowerCase()||""+e3}var i,a,o=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,s=/(^[ ]*|[ ]*$)/g,u=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,e2=n2(e2).replace(s,"")||"",r2=n2(r2).replace(s,"")||"",f=e2.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=r2.replace(o,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),s=parseInt(e2.match(l),16)||f.length!==1&&e2.match(u)&&Date.parse(e2),o=parseInt(r2.match(l),16)||s&&r2.match(u)&&Date.parse(r2)||null;if(o){if(s{for(var r2 in t)fd.o(t,r2)&&!fd.o(e,r2)&&Object.defineProperty(e,r2,{enumerable:!0,get:t[r2]})},fd.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),fd.r=e=>{typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},fd.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var pd={};return(()=>{"use strict";fd.d(pd,{default:()=>cd});var t={},l=(fd.r(t),fd.d(t,{createAbs:()=>ha,createAccessorNode:()=>cf,createAcos:()=>jl,createAcosh:()=>ac,createAcot:()=>oc,createAcoth:()=>sc,createAcsc:()=>uc,createAcsch:()=>lc,createAdd:()=>Jc,createAddScalar:()=>ba,createAnd:()=>Lu,createAndTransform:()=>Kh,createArg:()=>Po,createArrayNode:()=>pf,createAsec:()=>cc,createAsech:()=>fc,createAsin:()=>pc,createAsinh:()=>mc,createAssignmentNode:()=>xf,createAtan:()=>hc,createAtan2:()=>dc,createAtanh:()=>gc,createAtomicMass:()=>ah,createAvogadro:()=>oh,createBellNumbers:()=>qm,createBigNumberClass:()=>Zr,createBigint:()=>Mi,createBignumber:()=>Fi,createBin:()=>nu,createBitAnd:()=>zo,createBitAndTransform:()=>rd,createBitNot:()=>qo,createBitOr:()=>Io,createBitOrTransform:()=>nd,createBitXor:()=>Ro,createBlockNode:()=>vf,createBohrMagneton:()=>P0,createBohrRadius:()=>G0,createBoltzmann:()=>sh,createBoolean:()=>Bi,createCatalan:()=>km,createCbrt:()=>Na,createCeil:()=>Ta,createChain:()=>Ep,createChainClass:()=>bp,createClassicalElectronRadius:()=>V0,createClone:()=>Qn,createColumn:()=>es,createColumnTransform:()=>Th,createCombinations:()=>tm,createCombinationsWithRep:()=>im,createCompare:()=>Hu,createCompareNatural:()=>Wu,createCompareText:()=>Ju,createCompile:()=>Xf,createComplex:()=>Di,createComplexClass:()=>en,createComposition:()=>Pm,createConcat:()=>Ko,createConcatTransform:()=>Hh,createConditionalNode:()=>Nf,createConductanceQuantum:()=>U0,createConj:()=>Uo,createConstantNode:()=>Ff,createCorr:()=>Xp,createCos:()=>xc,createCosh:()=>bc,createCot:()=>vc,createCoth:()=>wc,createCoulomb:()=>I0,createCoulombConstant:()=>k0,createCount:()=>ts,createCreateUnit:()=>Ul,createCross:()=>rs,createCsc:()=>Nc,createCsch:()=>Ac,createCtranspose:()=>js,createCube:()=>Ba,createCumSum:()=>jp,createCumSumTransform:()=>Yh,createDeepEqual:()=>dl,createDenseMatrixClass:()=>Xn,createDerivative:()=>Km,createDet:()=>Sp,createDeuteronMass:()=>Q0,createDiag:()=>ns,createDiff:()=>ys,createDiffTransform:()=>Gh,createDistance:()=>kp,createDivide:()=>qp,createDivideScalar:()=>du,createDot:()=>Kc,createDotDivide:()=>Mu,createDotMultiply:()=>yo,createDotPow:()=>Eu,createE:()=>g0,createEfimovFactor:()=>ih,createEigs:()=>Tp,createElectricConstant:()=>z0,createElectronMass:()=>Z0,createElementaryCharge:()=>R0,createEqual:()=>Qu,createEqualScalar:()=>Ai,createEqualText:()=>tl,createErf:()=>Vs,createEvaluate:()=>Kf,createExp:()=>Fa,createExpm:()=>Bp,createExpm1:()=>Da,createFactorial:()=>dm,createFalse:()=>c0,createFaraday:()=>uh,createFermiCoupling:()=>W0,createFft:()=>$s,createFibonacciHeapClass:()=>Cl,createFilter:()=>is,createFilterTransform:()=>_h,createFineStructure:()=>Y0,createFirstRadiation:()=>lh,createFix:()=>_a,createFlatten:()=>ss,createFloor:()=>ka,createForEach:()=>ls,createForEachTransform:()=>zh,createFormat:()=>ru,createFraction:()=>Oi,createFractionClass:()=>mn,createFreqz:()=>n0,createFunctionAssignmentNode:()=>Of,createFunctionNode:()=>Wf,createGamma:()=>pm,createGasConstant:()=>fh,createGcd:()=>Ya,createGetMatrixDataType:()=>ps,createGravitationConstant:()=>F0,createGravity:()=>vh,createHartreeEnergy:()=>J0,createHasNumericValue:()=>di,createHelp:()=>Ap,createHelpClass:()=>xp,createHex:()=>au,createHypot:()=>Xc,createI:()=>E0,createIdentity:()=>hs,createIfft:()=>Hs,createIm:()=>jo,createImmutableDenseMatrixClass:()=>El,createIndex:()=>tf,createIndexClass:()=>Sl,createIndexNode:()=>zf,createIndexTransform:()=>qh,createInfinity:()=>p0,createIntersect:()=>Rp,createInv:()=>Mp,createInverseConductanceQuantum:()=>j0,createInvmod:()=>mo,createIsInteger:()=>oi,createIsNaN:()=>bi,createIsNegative:()=>fi,createIsNumeric:()=>mi,createIsPositive:()=>yi,createIsPrime:()=>pu,createIsZero:()=>xi,createKldivergence:()=>ym,createKlitzing:()=>H0,createKron:()=>ds,createLN10:()=>b0,createLN2:()=>x0,createLOG10E:()=>w0,createLOG2E:()=>v0,createLarger:()=>ll,createLargerEq:()=>pl,createLcm:()=>Xa,createLeafCount:()=>jm,createLeftShift:()=>ku,createLgamma:()=>mm,createLog:()=>vu,createLog10:()=>eo,createLog1p:()=>wu,createLog2:()=>to,createLoschmidt:()=>ch,createLsolve:()=>Tu,createLsolveAll:()=>Du,createLup:()=>rp,createLusolve:()=>dp,createLyap:()=>zp,createMad:()=>Hp,createMagneticConstant:()=>_0,createMagneticFluxQuantum:()=>L0,createMap:()=>gs,createMapSlices:()=>ga,createMapSlicesTransform:()=>Ch,createMapTransform:()=>Ih,createMatrix:()=>_i,createMatrixClass:()=>dn,createMatrixFromColumns:()=>Pi,createMatrixFromFunction:()=>qi,createMatrixFromRows:()=>ki,createMax:()=>Nl,createMaxTransform:()=>Rh,createMean:()=>Lp,createMeanTransform:()=>Ph,createMedian:()=>$p,createMin:()=>Al,createMinTransform:()=>Uh,createMod:()=>$a,createMode:()=>Ks,createMolarMass:()=>xh,createMolarMassC12:()=>bh,createMolarPlanckConstant:()=>ph,createMolarVolume:()=>mh,createMultinomial:()=>bm,createMultiply:()=>io,createMultiplyScalar:()=>ro,createNaN:()=>m0,createNeutronMass:()=>K0,createNode:()=>nf,createNorm:()=>Qc,createNot:()=>Wo,createNthRoot:()=>oo,createNthRoots:()=>Au,createNuclearMagneton:()=>$0,createNull:()=>f0,createNullish:()=>Jo,createNullishTransform:()=>td,createNumber:()=>Si,createNumeric:()=>mu,createObjectNode:()=>If,createOct:()=>iu,createOnes:()=>xs,createOperatorNode:()=>Pf,createOr:()=>Xo,createOrTransform:()=>ed,createParenthesisNode:()=>jf,createParse:()=>Yf,createParser:()=>tp,createParserClass:()=>ep,createPartitionSelect:()=>vl,createPermutations:()=>wm,createPhi:()=>y0,createPi:()=>h0,createPickRandom:()=>Cm,createPinv:()=>Cp,createPlanckCharge:()=>Eh,createPlanckConstant:()=>D0,createPlanckLength:()=>wh,createPlanckMass:()=>Nh,createPlanckTemperature:()=>Sh,createPlanckTime:()=>Ah,createPolynomialRoot:()=>yp,createPow:()=>gu,createPrint:()=>su,createPrintTransform:()=>Qh,createProd:()=>tu,createProtonMass:()=>X0,createQr:()=>np,createQuantileSeq:()=>Yp,createQuantileSeqTransform:()=>Wh,createQuantumOfCirculation:()=>eh,createRandom:()=>Bm,createRandomInt:()=>Dm,createRange:()=>Ns,createRangeClass:()=>hn,createRangeNode:()=>$f,createRangeTransform:()=>jh,createRationalize:()=>t0,createRe:()=>Lo,createReducedPlanckConstant:()=>O0,createRelationalNode:()=>Gf,createReplacer:()=>a0,createReshape:()=>Es,createResize:()=>Ss,createResolve:()=>Ym,createResultSet:()=>ft,createReviver:()=>i0,createRightArithShift:()=>Pu,createRightLogShift:()=>ju,createRotate:()=>Ms,createRotationMatrix:()=>Ts,createRound:()=>xu,createRow:()=>Bs,createRowTransform:()=>Lh,createRydberg:()=>th,createSQRT1_2:()=>N0,createSQRT2:()=>A0,createSackurTetrode:()=>hh,createSchur:()=>_p,createSec:()=>Ec,createSech:()=>Sc,createSecondRadiation:()=>dh,createSetCartesian:()=>Dc,createSetDifference:()=>_c,createSetDistinct:()=>qc,createSetIntersect:()=>kc,createSetIsSubset:()=>Pc,createSetMultiplicity:()=>jc,createSetPowerset:()=>$c,createSetSize:()=>Gc,createSetSymDifference:()=>Zc,createSetUnion:()=>Yc,createSign:()=>so,createSimplify:()=>Gm,createSimplifyConstant:()=>Vm,createSimplifyCore:()=>Wm,createSin:()=>Mc,createSinh:()=>Cc,createSize:()=>Fs,createSlu:()=>pp,createSmaller:()=>nl,createSmallerEq:()=>ol,createSolveODE:()=>Gs,createSort:()=>wl,createSpaClass:()=>Tl,createSparse:()=>Rl,createSparseMatrixClass:()=>Ei,createSpeedOfLight:()=>B0,createSplitUnit:()=>ji,createSqrt:()=>uo,createSqrtm:()=>Fp,createSquare:()=>lo,createSqueeze:()=>Os,createStd:()=>Jp,createStdTransform:()=>Vh,createStefanBoltzmann:()=>gh,createStirlingS2:()=>_m,createString:()=>Ci,createSubset:()=>_s,createSubsetTransform:()=>$h,createSubtract:()=>fo,createSubtractScalar:()=>wa,createSum:()=>Pp,createSumTransform:()=>Zh,createSylvester:()=>Op,createSymbolNode:()=>Vf,createSymbolicEqual:()=>Xm,createTan:()=>Tc,createTanh:()=>Bc,createTau:()=>d0,createThomsonCrossSection:()=>rh,createTo:()=>lu,createToBest:()=>cu,createTrace:()=>ef,createTranspose:()=>Ps,createTrue:()=>l0,createTypeOf:()=>vi,createTyped:()=>st,createUnaryMinus:()=>fa,createUnaryPlus:()=>ma,createUnequal:()=>yl,createUnitClass:()=>Il,createUnitFunction:()=>kl,createUppercaseE:()=>M0,createUppercasePi:()=>S0,createUsolve:()=>Bu,createUsolveAll:()=>_u,createVacuumImpedance:()=>q0,createVariance:()=>Zp,createVarianceTransform:()=>Xh,createVersion:()=>C0,createWeakMixingAngle:()=>nh,createWienDisplacement:()=>yh,createXgcd:()=>po,createXor:()=>Qo,createZeros:()=>Ls,createZeta:()=>Qs,createZpk2tf:()=>r0}),fd(369));function h(e2,t2){if(n2(e2,t2))return e2[t2];throw typeof e2[t2]=="function"&&q(e2,t2)?new Error('Cannot access method "'+t2+'" as a property'):new Error('No access to property "'+t2+'"')}function D(e2,t2,r3){if(n2(e2,t2))return e2[t2]=r3;throw new Error('No access to property "'+t2+'"')}function n2(e2,t2){return!((typeof e2!="object"||!e2||e2.constructor!==Object)&&!Array.isArray(e2)||!ue(r2,t2)&&(t2 in Object.prototype||t2 in Function.prototype))}function q(e2,t2){return!(e2==null||typeof e2[t2]!="function"||ue(e2,t2)&&Object.getPrototypeOf&&t2 in Object.getPrototypeOf(e2)||!ue(i,t2)&&(t2 in Object.prototype||t2 in Function.prototype))}let r2={length:!0,name:!0},i={toString:!0,valueOf:!0,toLocaleString:!0};class I{constructor(e2){this.wrappedObject=e2,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e2=>this.has(e2)).values()}get(e2){return h(this.wrappedObject,e2)}set(e2,t2){return D(this.wrappedObject,e2,t2),this}has(e2){return n2(this.wrappedObject,e2)&&e2 in this.wrappedObject}entries(){return a(this.keys(),e2=>[e2,this.get(e2)])}forEach(e2){for(let t2 of this.keys())e2(this.get(t2),t2,this)}delete(e2){n2(this.wrappedObject,e2)&&delete this.wrappedObject[e2]}clear(){for(let e2 of this.keys())this.delete(e2)}get size(){return Object.keys(this.wrappedObject).length}}class k{constructor(e2,t2,r3){this.a=e2,this.b=t2,this.bKeys=r3,this[Symbol.iterator]=this.entries}get(e2){return(this.bKeys.has(e2)?this.b:this.a).get(e2)}set(e2,t2){return(this.bKeys.has(e2)?this.b:this.a).set(e2,t2),this}has(e2){return this.b.has(e2)||this.a.has(e2)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return a(this.keys(),e2=>[e2,this.get(e2)])}forEach(e2){for(let t2 of this.keys())e2(this.get(t2),t2,this)}delete(e2){return(this.bKeys.has(e2)?this.b:this.a).delete(e2)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function a(t2,r3){return{next:()=>{var e2=t2.next();return e2.done?e2:{value:r3(e2.value),done:!1}}}}function P(){return new Map}function U(e2){if(!e2)return P();if(fe(e2))return e2;if(ce(e2))return new I(e2);throw new Error("createMap can create maps from objects or Maps")}function A(e2){return typeof e2=="number"}function Q(e2){return!(!e2||typeof e2!="object"||typeof e2.constructor!="function")&&(e2.isBigNumber===!0&&typeof e2.constructor.prototype=="object"&&e2.constructor.prototype.isBigNumber===!0||typeof e2.constructor.isDecimal=="function"&&e2.constructor.isDecimal(e2)===!0)}function R(e2){return typeof e2=="bigint"}function te(e2){return e2&&typeof e2=="object"&&Object.getPrototypeOf(e2).isComplex===!0||!1}function re(e2){return e2&&typeof e2=="object"&&Object.getPrototypeOf(e2).isFraction===!0||!1}function L(e2){return e2&&e2.constructor.prototype.isUnit===!0||!1}function j(e2){return typeof e2=="string"}let b=Array.isArray;function _(e2){return e2&&e2.constructor.prototype.isMatrix===!0||!1}function $(e2){return Array.isArray(e2)||_(e2)}function H(e2){return e2&&e2.isDenseMatrix&&e2.constructor.prototype.isMatrix===!0||!1}function G(e2){return e2&&e2.isSparseMatrix&&e2.constructor.prototype.isMatrix===!0||!1}function V(e2){return e2&&e2.constructor.prototype.isRange===!0||!1}function Z(e2){return e2&&e2.constructor.prototype.isIndex===!0||!1}function W(e2){return typeof e2=="boolean"}function Y(e2){return e2&&e2.constructor.prototype.isResultSet===!0||!1}function J(e2){return e2&&e2.constructor.prototype.isHelp===!0||!1}function X(e2){return typeof e2=="function"}function ne(e2){return e2 instanceof Date}function ie(e2){return e2 instanceof RegExp}function ce(e2){return!(!e2||typeof e2!="object"||e2.constructor!==Object||te(e2)||re(e2))}function fe(e2){return!!e2&&(e2 instanceof Map||e2 instanceof I||typeof e2.set=="function"&&typeof e2.get=="function"&&typeof e2.keys=="function"&&typeof e2.has=="function")}function pe(e2){return fe(e2)&&fe(e2.a)&&fe(e2.b)}function me(e2){return fe(e2)&&ce(e2.wrappedObject)}function he(e2){return e2===null}function de(e2){return e2===void 0}function ge(e2){return e2&&e2.isAccessorNode===!0&&e2.constructor.prototype.isNode===!0||!1}function ye(e2){return e2&&e2.isArrayNode===!0&&e2.constructor.prototype.isNode===!0||!1}function xe(e2){return e2&&e2.isAssignmentNode===!0&&e2.constructor.prototype.isNode===!0||!1}function be(e2){return e2&&e2.isBlockNode===!0&&e2.constructor.prototype.isNode===!0||!1}function ve(e2){return e2&&e2.isConditionalNode===!0&&e2.constructor.prototype.isNode===!0||!1}function ae(e2){return e2&&e2.isConstantNode===!0&&e2.constructor.prototype.isNode===!0||!1}function we(e2){return ae(e2)||oe(e2)&&e2.args.length===1&&ae(e2.args[0])&&"-+~".includes(e2.op)}function Ne(e2){return e2&&e2.isFunctionAssignmentNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Ae(e2){return e2&&e2.isFunctionNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Ee(e2){return e2&&e2.isIndexNode===!0&&e2.constructor.prototype.isNode===!0||!1}function O(e2){return e2&&e2.isNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Se(e2){return e2&&e2.isObjectNode===!0&&e2.constructor.prototype.isNode===!0||!1}function oe(e2){return e2&&e2.isOperatorNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Me(e2){return e2&&e2.isParenthesisNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Ce(e2){return e2&&e2.isRangeNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Te(e2){return e2&&e2.isRelationalNode===!0&&e2.constructor.prototype.isNode===!0||!1}function se(e2){return e2&&e2.isSymbolNode===!0&&e2.constructor.prototype.isNode===!0||!1}function Be(e2){return e2&&e2.constructor.prototype.isChain===!0||!1}function K(e2){var t2=typeof e2;return t2=="object"?e2===null?"null":Q(e2)?"BigNumber":e2.constructor&&e2.constructor.name?e2.constructor.name:"Object":t2}function ee(e2){var t2=typeof e2;if(t2=="number"||t2=="bigint"||t2=="string"||t2=="boolean"||e2==null)return e2;if(typeof e2.clone=="function")return e2.clone();if(Array.isArray(e2))return e2.map(ee);if(e2 instanceof Date)return new Date(e2.valueOf());if(Q(e2))return e2;if(ce(e2)){var r3=e2,n3=ee;let i2={};for(let a2 in r3)ue(r3,a2)&&(i2[a2]=n3(r3[a2]));return i2}if(t2=="function")return e2;throw new TypeError(`Cannot clone: unknown type of value (value: ${e2})`)}function Fe(e2,t2){for(let r3 in t2)ue(t2,r3)&&(e2[r3]=t2[r3]);return e2}function De(e2,t2){let r3,n3,i2;if(Array.isArray(e2)){if(!Array.isArray(t2)||e2.length!==t2.length)return!1;for(n3=0,i2=e2.length;n3!(e4&&e4[0]==="?")).every(e4=>i2[e4]!==void 0))return u2(t3);{let a2=n3.filter(e4=>i2[e4]===void 0);throw new Error(`Cannot create function "${r3}", some dependencies are missing: ${a2.map(e4=>`"${e4}"`).join(", ")}.`)}}return t2.isFactory=!0,t2.fn=o2,t2.dependencies=s2.slice().sort(),e2&&(t2.meta=e2),t2}function ze(e2){return typeof e2=="function"&&typeof e2.fn=="string"&&Array.isArray(e2.dependencies)}function qe(e2){return e2&&e2[0]==="?"?e2.slice(1):e2}function v(e2){return typeof e2=="boolean"||!!isFinite(e2)&&e2===Math.round(e2)}function Ie(e2,t2){if(t2.number==="bigint")try{BigInt(e2)}catch{return t2.numberFallback}return t2.number}let ke=Math.sign||function(e2){return 0l2.length||u2-c2+1>l2.length;)l2.push(0);else{let a3=Math.abs(u2-c2)-(l2.length-1);for(let e4=0;e4=i3)return We(e3,t3);{let e4=o3.coefficients,r5=o3.exponent,n5=(e4=(e4=e4.length{throw new Error('Option "precision" must be a number or BigNumber')})),e2.wordSize!==void 0&&(r3=it(e2.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e2.notation&&(n3=e2.notation)}return{notation:n3,precision:t2,wordSize:r3}}function Ve(e2){var t2=String(e2).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t2)throw new SyntaxError("Invalid number "+e2);let r3=t2[1],n3=t2[2],i2=parseFloat(t2[4]||"0");e2=n3.indexOf("."),i2+=e2!==-1?e2-1:n3.length-1;let a2=n3.replace(".","").replace(/^0*/,function(e3){return i2-=e3.length,""}).replace(/0*$/,"").split("").map(function(e3){return parseInt(e3)});return a2.length===0&&(a2.push(0),i2++),{sign:r3,coefficients:a2,exponent:i2}}function Ze(e2,t2){if(isNaN(e2)||!isFinite(e2))return String(e2);e2=Ve(e2),e2=typeof t2=="number"?Ye(e2,e2.exponent+1+t2):e2;let r3=e2.coefficients,n3=e2.exponent+1;return t2=n3+(t2||0),r3.lengtht2&&5<=n3.splice(t2,n3.length-t2)[0]){let e3=t2-1;for(n3[e3]++;n3[e3]===10;)n3.pop(),e3===0&&(n3.unshift(0),r3.exponent++,e3++),e3--,n3[e3]++}return r3}function Je(t2){let r3=[];for(let e2=0;e2/^[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11BC0}-\u{11BE0}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E4D0}-\u{1E4EB}\u{1E5D0}-\u{1E5ED}\u{1E5F0}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E900}-\u{1E943}\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}][0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC\u{10000}-\u{1000B}\u{1000D}-\u{10026}\u{10028}-\u{1003A}\u{1003C}\u{1003D}\u{1003F}-\u{1004D}\u{10050}-\u{1005D}\u{10080}-\u{100FA}\u{10280}-\u{1029C}\u{102A0}-\u{102D0}\u{10300}-\u{1031F}\u{1032D}-\u{10340}\u{10342}-\u{10349}\u{10350}-\u{10375}\u{10380}-\u{1039D}\u{103A0}-\u{103C3}\u{103C8}-\u{103CF}\u{10400}-\u{1049D}\u{104B0}-\u{104D3}\u{104D8}-\u{104FB}\u{10500}-\u{10527}\u{10530}-\u{10563}\u{10570}-\u{1057A}\u{1057C}-\u{1058A}\u{1058C}-\u{10592}\u{10594}\u{10595}\u{10597}-\u{105A1}\u{105A3}-\u{105B1}\u{105B3}-\u{105B9}\u{105BB}\u{105BC}\u{105C0}-\u{105F3}\u{10600}-\u{10736}\u{10740}-\u{10755}\u{10760}-\u{10767}\u{10780}-\u{10785}\u{10787}-\u{107B0}\u{107B2}-\u{107BA}\u{10800}-\u{10805}\u{10808}\u{1080A}-\u{10835}\u{10837}\u{10838}\u{1083C}\u{1083F}-\u{10855}\u{10860}-\u{10876}\u{10880}-\u{1089E}\u{108E0}-\u{108F2}\u{108F4}\u{108F5}\u{10900}-\u{10915}\u{10920}-\u{10939}\u{10980}-\u{109B7}\u{109BE}\u{109BF}\u{10A00}\u{10A10}-\u{10A13}\u{10A15}-\u{10A17}\u{10A19}-\u{10A35}\u{10A60}-\u{10A7C}\u{10A80}-\u{10A9C}\u{10AC0}-\u{10AC7}\u{10AC9}-\u{10AE4}\u{10B00}-\u{10B35}\u{10B40}-\u{10B55}\u{10B60}-\u{10B72}\u{10B80}-\u{10B91}\u{10C00}-\u{10C48}\u{10C80}-\u{10CB2}\u{10CC0}-\u{10CF2}\u{10D00}-\u{10D23}\u{10D4A}-\u{10D65}\u{10D6F}-\u{10D85}\u{10E80}-\u{10EA9}\u{10EB0}\u{10EB1}\u{10EC2}-\u{10EC4}\u{10F00}-\u{10F1C}\u{10F27}\u{10F30}-\u{10F45}\u{10F70}-\u{10F81}\u{10FB0}-\u{10FC4}\u{10FE0}-\u{10FF6}\u{11003}-\u{11037}\u{11071}\u{11072}\u{11075}\u{11083}-\u{110AF}\u{110D0}-\u{110E8}\u{11103}-\u{11126}\u{11144}\u{11147}\u{11150}-\u{11172}\u{11176}\u{11183}-\u{111B2}\u{111C1}-\u{111C4}\u{111DA}\u{111DC}\u{11200}-\u{11211}\u{11213}-\u{1122B}\u{1123F}\u{11240}\u{11280}-\u{11286}\u{11288}\u{1128A}-\u{1128D}\u{1128F}-\u{1129D}\u{1129F}-\u{112A8}\u{112B0}-\u{112DE}\u{11305}-\u{1130C}\u{1130F}\u{11310}\u{11313}-\u{11328}\u{1132A}-\u{11330}\u{11332}\u{11333}\u{11335}-\u{11339}\u{1133D}\u{11350}\u{1135D}-\u{11361}\u{11380}-\u{11389}\u{1138B}\u{1138E}\u{11390}-\u{113B5}\u{113B7}\u{113D1}\u{113D3}\u{11400}-\u{11434}\u{11447}-\u{1144A}\u{1145F}-\u{11461}\u{11480}-\u{114AF}\u{114C4}\u{114C5}\u{114C7}\u{11580}-\u{115AE}\u{115D8}-\u{115DB}\u{11600}-\u{1162F}\u{11644}\u{11680}-\u{116AA}\u{116B8}\u{11700}-\u{1171A}\u{11740}-\u{11746}\u{11800}-\u{1182B}\u{118A0}-\u{118DF}\u{118FF}-\u{11906}\u{11909}\u{1190C}-\u{11913}\u{11915}\u{11916}\u{11918}-\u{1192F}\u{1193F}\u{11941}\u{119A0}-\u{119A7}\u{119AA}-\u{119D0}\u{119E1}\u{119E3}\u{11A00}\u{11A0B}-\u{11A32}\u{11A3A}\u{11A50}\u{11A5C}-\u{11A89}\u{11A9D}\u{11AB0}-\u{11AF8}\u{11BC0}-\u{11BE0}\u{11C00}-\u{11C08}\u{11C0A}-\u{11C2E}\u{11C40}\u{11C72}-\u{11C8F}\u{11D00}-\u{11D06}\u{11D08}\u{11D09}\u{11D0B}-\u{11D30}\u{11D46}\u{11D60}-\u{11D65}\u{11D67}\u{11D68}\u{11D6A}-\u{11D89}\u{11D98}\u{11EE0}-\u{11EF2}\u{11F02}\u{11F04}-\u{11F10}\u{11F12}-\u{11F33}\u{11FB0}\u{12000}-\u{12399}\u{12480}-\u{12543}\u{12F90}-\u{12FF0}\u{13000}-\u{1342F}\u{13441}-\u{13446}\u{13460}-\u{143FA}\u{14400}-\u{14646}\u{16100}-\u{1611D}\u{16800}-\u{16A38}\u{16A40}-\u{16A5E}\u{16A70}-\u{16ABE}\u{16AD0}-\u{16AED}\u{16B00}-\u{16B2F}\u{16B40}-\u{16B43}\u{16B63}-\u{16B77}\u{16B7D}-\u{16B8F}\u{16D40}-\u{16D6C}\u{16E40}-\u{16E7F}\u{16F00}-\u{16F4A}\u{16F50}\u{16F93}-\u{16F9F}\u{16FE0}\u{16FE1}\u{16FE3}\u{17000}-\u{187F7}\u{18800}-\u{18CD5}\u{18CFF}-\u{18D08}\u{1AFF0}-\u{1AFF3}\u{1AFF5}-\u{1AFFB}\u{1AFFD}\u{1AFFE}\u{1B000}-\u{1B122}\u{1B132}\u{1B150}-\u{1B152}\u{1B155}\u{1B164}-\u{1B167}\u{1B170}-\u{1B2FB}\u{1BC00}-\u{1BC6A}\u{1BC70}-\u{1BC7C}\u{1BC80}-\u{1BC88}\u{1BC90}-\u{1BC99}\u{1D400}-\u{1D454}\u{1D456}-\u{1D49C}\u{1D49E}\u{1D49F}\u{1D4A2}\u{1D4A5}\u{1D4A6}\u{1D4A9}-\u{1D4AC}\u{1D4AE}-\u{1D4B9}\u{1D4BB}\u{1D4BD}-\u{1D4C3}\u{1D4C5}-\u{1D505}\u{1D507}-\u{1D50A}\u{1D50D}-\u{1D514}\u{1D516}-\u{1D51C}\u{1D51E}-\u{1D539}\u{1D53B}-\u{1D53E}\u{1D540}-\u{1D544}\u{1D546}\u{1D54A}-\u{1D550}\u{1D552}-\u{1D6A5}\u{1D6A8}-\u{1D6C0}\u{1D6C2}-\u{1D6DA}\u{1D6DC}-\u{1D6FA}\u{1D6FC}-\u{1D714}\u{1D716}-\u{1D734}\u{1D736}-\u{1D74E}\u{1D750}-\u{1D76E}\u{1D770}-\u{1D788}\u{1D78A}-\u{1D7A8}\u{1D7AA}-\u{1D7C2}\u{1D7C4}-\u{1D7CB}\u{1DF00}-\u{1DF1E}\u{1DF25}-\u{1DF2A}\u{1E030}-\u{1E06D}\u{1E100}-\u{1E12C}\u{1E137}-\u{1E13D}\u{1E14E}\u{1E290}-\u{1E2AD}\u{1E2C0}-\u{1E2EB}\u{1E4D0}-\u{1E4EB}\u{1E5D0}-\u{1E5ED}\u{1E5F0}\u{1E7E0}-\u{1E7E6}\u{1E7E8}-\u{1E7EB}\u{1E7ED}\u{1E7EE}\u{1E7F0}-\u{1E7FE}\u{1E800}-\u{1E8C4}\u{1E900}-\u{1E943}\u{1E94B}\u{1EE00}-\u{1EE03}\u{1EE05}-\u{1EE1F}\u{1EE21}\u{1EE22}\u{1EE24}\u{1EE27}\u{1EE29}-\u{1EE32}\u{1EE34}-\u{1EE37}\u{1EE39}\u{1EE3B}\u{1EE42}\u{1EE47}\u{1EE49}\u{1EE4B}\u{1EE4D}-\u{1EE4F}\u{1EE51}\u{1EE52}\u{1EE54}\u{1EE57}\u{1EE59}\u{1EE5B}\u{1EE5D}\u{1EE5F}\u{1EE61}\u{1EE62}\u{1EE64}\u{1EE67}-\u{1EE6A}\u{1EE6C}-\u{1EE72}\u{1EE74}-\u{1EE77}\u{1EE79}-\u{1EE7C}\u{1EE7E}\u{1EE80}-\u{1EE89}\u{1EE8B}-\u{1EE9B}\u{1EEA1}-\u{1EEA3}\u{1EEA5}-\u{1EEA9}\u{1EEAB}-\u{1EEBB}\u{20000}-\u{2A6DF}\u{2A700}-\u{2B739}\u{2B740}-\u{2B81D}\u{2B820}-\u{2CEA1}\u{2CEB0}-\u{2EBE0}\u{2EBF0}-\u{2EE5D}\u{2F800}-\u{2FA1D}\u{30000}-\u{3134A}\u{31350}-\u{323AF}]*$/u.test(e3)},{name:"string",test:j},{name:"Chain",test:Be},{name:"Array",test:b},{name:"Matrix",test:_},{name:"DenseMatrix",test:H},{name:"SparseMatrix",test:G},{name:"Range",test:V},{name:"Index",test:Z},{name:"boolean",test:W},{name:"ResultSet",test:Y},{name:"Help",test:J},{name:"function",test:X},{name:"Date",test:ne},{name:"RegExp",test:ie},{name:"null",test:he},{name:"undefined",test:de},{name:"AccessorNode",test:ge},{name:"ArrayNode",test:ye},{name:"AssignmentNode",test:xe},{name:"BlockNode",test:be},{name:"ConditionalNode",test:ve},{name:"ConstantNode",test:ae},{name:"FunctionNode",test:Ae},{name:"FunctionAssignmentNode",test:Ne},{name:"IndexNode",test:Ee},{name:"Node",test:O},{name:"ObjectNode",test:Se},{name:"OperatorNode",test:oe},{name:"ParenthesisNode",test:Me},{name:"RangeNode",test:Ce},{name:"RelationalNode",test:Te},{name:"SymbolNode",test:se},{name:"Map",test:fe},{name:"Object",test:ce}]),a2.addConversions([{from:"number",to:"BigNumber",convert:function(e3){if(r3||ut(e3),1515 significant digits to BigNumber (value: "+e3+"). Use function bignumber(x) to convert to BigNumber.");return new r3(e3)}},{from:"number",to:"Complex",convert:function(e3){return n3||lt(e3),new n3(e3,0)}},{from:"BigNumber",to:"Complex",convert:function(e3){return n3||lt(e3),new n3(e3.toNumber(),0)}},{from:"bigint",to:"number",convert:function(e3){if(e3>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+e3+")");return Number(e3)}},{from:"bigint",to:"BigNumber",convert:function(e3){return r3||ut(e3),new r3(e3.toString())}},{from:"bigint",to:"Fraction",convert:function(e3){return i2||ct(e3),new i2(e3)}},{from:"Fraction",to:"BigNumber",convert:function(e3){throw new TypeError("Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.")}},{from:"Fraction",to:"Complex",convert:function(e3){return n3||lt(e3),new n3(e3.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e3){i2||ct(e3);let t3=new i2(e3);if(t3.valueOf()!==e3)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+e3+"). Use function fraction(x) to convert to Fraction.");return t3}},{from:"string",to:"number",convert:function(e3){var t3=Number(e3);if(isNaN(t3))throw new Error('Cannot convert "'+e3+'" to a number');return t3}},{from:"string",to:"BigNumber",convert:function(t3){r3||ut(t3);try{return new r3(t3)}catch{throw new Error('Cannot convert "'+t3+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(t3){try{return BigInt(t3)}catch{throw new Error('Cannot convert "'+t3+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(t3){i2||ct(t3);try{return new i2(t3)}catch{throw new Error('Cannot convert "'+t3+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t3){n3||lt(t3);try{return new n3(t3)}catch{throw new Error('Cannot convert "'+t3+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e3){return+e3}},{from:"boolean",to:"BigNumber",convert:function(e3){return r3||ut(e3),new r3(+e3)}},{from:"boolean",to:"bigint",convert:function(e3){return BigInt(+e3)}},{from:"boolean",to:"Fraction",convert:function(e3){return i2||ct(e3),new i2(+e3)}},{from:"boolean",to:"string",convert:function(e3){return String(e3)}},{from:"Array",to:"Matrix",convert:function(e3){if(t2)return new t2(e3);throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}},{from:"Matrix",to:"Array",convert:function(e3){return e3.valueOf()}}]),a2.onMismatch=(e3,t3,r4)=>{var n4=a2.createError(e3,t3,r4);if(["wrongType","mismatch"].includes(n4.data.category)&&t3.length===1&&$(t3[0])&&r4.some(e4=>!e4.params.includes(","))){let t4=new TypeError(`Function '${e3}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e3})'.`);throw t4.data=n4.data,t4}throw n4},a2.onMismatch=(e3,t3,r4)=>{var n4=a2.createError(e3,t3,r4);if(["wrongType","mismatch"].includes(n4.data.category)&&t3.length===1&&$(t3[0])&&r4.some(e4=>!e4.params.includes(","))){let t4=new TypeError(`Function '${e3}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e3})'.`);throw t4.data=n4.data,t4}throw n4},a2});function ut(e2){throw new Error(`Cannot convert value ${e2} into a BigNumber: no class 'BigNumber' provided`)}function lt(e2){throw new Error(`Cannot convert value ${e2} into a Complex number: no class 'Complex' provided`)}function ct(e2){throw new Error(`Cannot convert value ${e2} into a Fraction, no class 'Fraction' provided.`)}let ft=s("ResultSet",[],()=>{function t2(e2){if(!(this instanceof t2))throw new SyntaxError("Constructor must be called with the new operator");this.entries=e2||[]}return t2.prototype.type="ResultSet",t2.prototype.isResultSet=!0,t2.prototype.valueOf=function(){return this.entries},t2.prototype.toString=function(){return"["+this.entries.map(String).join(", ")+"]"},t2.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},t2.fromJSON=function(e2){return new t2(e2.entries)},t2},{isClass:!0});var pt,mt,ht=9e15,dt=1e9,gt="0123456789abcdef",yt="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",xt="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",bt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ht,maxE:ht,crypto:!1},w=!0,vt="[DecimalError] ",wt=vt+"Invalid argument: ",Nt=vt+"Precision limit exceeded",At=vt+"crypto unavailable",Et="[object Decimal]",St=Math.floor,d=Math.pow,Mt=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Ct=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Tt=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Bt=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ft=1e7,Dt=yt.length-1,Ot=xt.length-1,o={toStringTag:Et};function _t(e2){var t2,r3,n3,i2=e2.length-1,a2="",o2=e2[0];if(0r3-1&&(a2[n3+1]===void 0&&(a2[n3+1]=0),a2[n3+1]+=a2[n3]/r3|0,a2[n3]%=r3)}return a2.reverse()}o.absoluteValue=o.abs=function(){var e2=new this.constructor(this);return e2.s<0&&(e2.s=1),B(e2)},o.ceil=function(){return B(new this.constructor(this),this.e+1,2)},o.clampedTo=o.clamp=function(e2,t2){var r3=this.constructor;if(e2=new r3(e2),t2=new r3(t2),!e2.s||!t2.s)return new r3(NaN);if(e2.gt(t2))throw Error(wt+t2);return this.cmp(e2)<0?e2:0e2.e^o2<0?1:-1;for(t2=0,r3=(s2=i2.length)<(n3=a2.length)?s2:n3;t2a2[t2]^o2<0?1:-1;return s2===n3?0:n3this.d.length-2},o.isNaN=function(){return!this.s},o.isNegative=o.isNeg=function(){return this.s<0},o.isPositive=o.isPos=function(){return 0(n3=Math.max(Math.ceil(s2/7),o2)+2)&&(a2=n3,t2.length=1),t2.reverse(),n3=a2;n3--;)t2.push(0);t2.reverse()}else{for((c2=(n3=l2.length)<(o2=f2.length))&&(o2=n3),n3=0;n3(i2=(c2=Math.ceil(a2/7))>i2?c2+1:i2+1)&&(n3=i2,r3.length=1),r3.reverse();n3--;)r3.push(0);r3.reverse()}for((i2=s2.length)-(n3=u2.length)<0&&(n3=i2,r3=u2,u2=s2,s2=r3),t2=0;n3;)t2=(s2[--n3]=s2[n3]+u2[n3]+t2)/Ft|0,s2[n3]%=Ft;for(t2&&(s2.unshift(t2),++l2),i2=s2.length;s2[--i2]==0;)s2.pop();return e2.d=s2,e2.e=jt(s2,l2),w?B(e2,a2,o2):e2},o.precision=o.sd=function(e2){var t2;if(e2!==void 0&&e2!==!!e2&&e2!==1&&e2!==0)throw Error(wt+e2);return this.d?(t2=Ht(this.d),e2&&this.e+1>t2&&(t2=this.e+1)):t2=NaN,t2},o.round=function(){var e2=this.constructor;return B(new e2(this),this.e+1,e2.rounding)},o.sine=o.sin=function(){var e2,t2,r3=this,n3=r3.constructor;return r3.isFinite()?r3.isZero()?new n3(r3):(e2=n3.precision,t2=n3.rounding,n3.precision=e2+Math.max(r3.e,r3.sd())+7,n3.rounding=1,r3=(function(e3,t3){var r4,n4=t3.d.length;if(n4<3)return t3.isZero()?t3:Kt(e3,2,t3,t3);r4=16<(r4=1.4*Math.sqrt(n4))?16:0|r4,t3=Kt(e3,2,t3=t3.times(1/er(5,r4)),t3);for(var i2,a2=new e3(5),o2=new e3(16),s2=new e3(20);r4--;)i2=t3.times(t3),t3=t3.times(a2.plus(i2.times(o2.times(i2).minus(s2))));return t3})(n3,tr(n3,r3)),n3.precision=e2,n3.rounding=t2,B(2=e2.d.length-1&&(r3=l2<0?-l2:l2)<=9007199254740991)return i2=Vt(u2,s2,r3,n3),e2.s<0?new u2(1).div(i2):B(i2,n3,a2);if((o2=s2.s)<0){if(t2u2.maxE+1||t2=n3.toExpPos):(zt(e2,1,dt),t2===void 0?t2=n3.rounding:zt(t2,0,8),Ut(r3=B(new n3(r3),e2,t2),e2<=r3.e||r3.e<=n3.toExpNeg,e2));return r3.isNeg()&&!r3.isZero()?"-"+t2:t2},o.toSignificantDigits=o.toSD=function(e2,t2){var r3=this.constructor;return e2===void 0?(e2=r3.precision,t2=r3.rounding):(zt(e2,1,dt),t2===void 0?t2=r3.rounding:zt(t2,0,8)),B(new r3(this),e2,t2)},o.toString=function(){var e2=this,t2=e2.constructor,t2=Ut(e2,e2.e<=t2.toExpNeg||e2.e>=t2.toExpPos);return e2.isNeg()&&!e2.isZero()?"-"+t2:t2},o.truncated=o.trunc=function(){return B(new this.constructor(this),this.e+1,1)},o.valueOf=o.toJSON=function(){var e2=this,t2=e2.constructor,t2=Ut(e2,e2.e<=t2.toExpNeg||e2.e>=t2.toExpPos);return e2.isNeg()?"-"+t2:t2};var N=function(e2,t2,r3,n3,i2,a2){var o2,s2,u2,l2,c2,f2,p2,m2,h2,d2,g2,y2,x2,b2,v2,w2,N2,A2,E2,S2=e2.constructor,M2=e2.s==t2.s?1:-1,C2=e2.d,T2=t2.d;if(!(C2&&C2[0]&&T2&&T2[0]))return new S2(e2.s&&t2.s&&(C2?!T2||C2[0]!=T2[0]:T2)?C2&&C2[0]==0||!T2?0*M2:M2/0:NaN);for(s2=a2?(c2=1,e2.e-t2.e):(a2=Ft,St(e2.e/(c2=7))-St(t2.e/c2)),A2=T2.length,w2=C2.length,h2=(M2=new S2(M2)).d=[],u2=0;T2[u2]==(C2[u2]||0);u2++);if(T2[u2]>(C2[u2]||0)&&s2--,r3==null?(x2=r3=S2.precision,n3=S2.rounding):x2=i2?r3+(e2.e-t2.e)+1:r3,x2<0)h2.push(1),f2=!0;else{if(x2=x2/c2+2|0,u2=0,A2==1){for(T2=T2[l2=0],x2++;(u2=a2/2&&++N2;l2=0,(o2=Rt(T2,d2,A2,g2))<0?(y2=d2[0],1<(l2=(y2=A2!=g2?y2*a2+(d2[1]||0):y2)/N2|0)?(o2=Rt(p2=kt(T2,l2=a2<=l2?a2-1:l2,a2),d2,m2=p2.length,g2=d2.length))==1&&(l2--,Pt(p2,A2t2[i2]?1:-1;break}return a2}function Pt(e2,t2,r3,n3){for(var i2=0;r3--;)e2[r3]-=i2,i2=e2[r3]=(s2=c2.length)){if(!n3)break e;for(;s2++<=f2;)c2.push(0);l2=u2=0,o2=(a2%=7)-7+(i2=1)}else{for(l2=s2=c2[f2],i2=1;10<=s2;s2/=10)i2++;u2=(o2=(a2%=7)-7+i2)<0?0:l2/d(10,i2-o2-1)%10|0}if(n3=n3||t2<0||c2[f2+1]!==void 0||(o2<0?l2:l2%d(10,i2-o2-1)),u2=r3<4?(u2||n3)&&(r3==0||r3==(e2.s<0?3:2)):5p2.maxE?(e2.d=null,e2.e=NaN):e2.ee2.constructor.maxE?(e2.d=null,e2.e=NaN):e2.ei2-1;)c2[r3]=0,r3||(++a2,c2.unshift(1));for(s2=c2.length;!c2[s2-1];--s2);for(o2=0,l2="";o2s2)for(a2-=s2;a2--;)l2+="0";else a2t2&&(e2.length=t2,1)}function ir(e2){return new this(e2).abs()}function ar(e2){return new this(e2).acos()}function or(e2){return new this(e2).acosh()}function sr(e2,t2){return new this(e2).plus(t2)}function ur(e2){return new this(e2).asin()}function lr(e2){return new this(e2).asinh()}function cr(e2){return new this(e2).atan()}function fr(e2){return new this(e2).atanh()}function pr(e2,t2){e2=new this(e2),t2=new this(t2);var r3,n3=this.precision,i2=this.rounding,a2=n3+4;return e2.s&&t2.s?e2.d||t2.d?!t2.d||e2.isZero()?(r3=t2.s<0?$t(this,n3,i2):new this(0)).s=e2.s:!e2.d||t2.isZero()?(r3=$t(this,a2,1).times(.5)).s=e2.s:r3=t2.s<0?(this.precision=a2,this.rounding=1,r3=this.atan(N(e2,t2,a2,1)),t2=$t(this,a2,1),this.precision=n3,this.rounding=i2,e2.s<0?r3.minus(t2):r3.plus(t2)):this.atan(N(e2,t2,a2,1)):(r3=$t(this,a2,1).times(0"u"||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(At);this[t2]=!0}else this[t2]=!1}return this}function yr(e2){return new this(e2).cos()}function xr(e2){return new this(e2).cosh()}function br(e2,t2){return new this(e2).div(t2)}function vr(e2){return new this(e2).exp()}function wr(e2){return B(e2=new this(e2),e2.e+1,3)}function Nr(){var e2,t2,r3=new this(0);for(w=!1,e2=0;e2a2.maxE?(i3.e=NaN,i3.d=null):e3.e{let{on:t2,config:r3}=e2,n3=Vr.clone({precision:r3.precision,modulo:Vr.EUCLID});return n3.prototype=Object.create(n3.prototype),n3.prototype.type="BigNumber",n3.prototype.isBigNumber=!0,n3.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n3.fromJSON=function(e3){return new n3(e3.value)},t2&&t2("config",function(e3,t3){e3.precision!==t3.precision&&n3.config({precision:e3.precision})}),n3},{isClass:!0}),Wr=Math.cosh||function(e2){return Math.abs(e2)<1e-9?1-e2:.5*(Math.exp(e2)+Math.exp(-e2))},Yr=Math.sinh||function(e2){return Math.abs(e2)<1e-9?e2:.5*(Math.exp(e2)-Math.exp(-e2))},Jr=function(){throw SyntaxError("Invalid Param")};function Xr(e2,t2){var r3=Math.abs(e2),n3=Math.abs(t2);return e2===0?Math.log(n3):t2===0?Math.log(r3):r3<3e3&&n3<3e3?.5*Math.log(e2*e2+t2*t2):(e2*=.5,t2*=.5,.5*Math.log(e2*e2+t2*t2)+Math.LN2)}function Qr(e2,n3){let i2=Kr;if(e2==null)i2.re=i2.im=0;else if(n3!==void 0)i2.re=e2,i2.im=n3;else switch(typeof e2){case"object":if("im"in e2&&"re"in e2)i2.re=e2.re,i2.im=e2.im;else if("abs"in e2&&"arg"in e2){if(!isFinite(e2.abs)&&isFinite(e2.arg))return u.INFINITY;i2.re=e2.abs*Math.cos(e2.arg),i2.im=e2.abs*Math.sin(e2.arg)}else if("r"in e2&&"phi"in e2){if(!isFinite(e2.r)&&isFinite(e2.phi))return u.INFINITY;i2.re=e2.r*Math.cos(e2.phi),i2.im=e2.r*Math.sin(e2.phi)}else e2.length===2?(i2.re=e2[0],i2.im=e2[1]):Jr();break;case"string":i2.im=i2.re=0;let n4=e2.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),t2=1,r3=0;n4===null&&Jr();for(let e3=0;e3(Object.defineProperty(u,"name",{value:"Complex"}),(u.prototype.constructor=u).prototype.type="Complex",u.prototype.isComplex=!0,u.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},u.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},u.prototype.format=function(e2){let t2=this.im,r3=this.re,n3=He(this.re,e2),i2=He(this.im,e2),a2=A(e2)?e2:e2?e2.precision:null;if(a2!==null){let e3=Math.pow(10,-a2);Math.abs(r3/t2)t2.re?1:e2.ret2.im?1:e2.im"u"?function(e2){if(isNaN(e2))throw new Error("");return e2}:BigInt)(0),f=BigInt(1),tn=BigInt(2),rn=BigInt(5),nn=BigInt(10),m={s:f,n:p,d:f};function an(e2,t2){try{e2=BigInt(e2)}catch{throw fn()}return e2*t2}function on(e2){return typeof e2=="bigint"?e2:Math.floor(e2)}function g(e2,t2){if(t2===p)throw cn();let r3=Object.create(ln.prototype);r3.s=e2r3?(u2=n3,i2):(u2=t2,r3);break}a2m.s*m.n*this.d},gte:function(e2,t2){return y(e2,t2),this.s*this.n*m.d>=m.s*m.n*this.d},compare:function(e2,t2){return y(e2,t2),e2=this.s*this.n*m.d-m.s*m.n*this.d,(pp&&this.s>=p?f:p),e2)},floor:function(e2){return e2=nn**BigInt(e2||0),g(on(this.s*e2*this.n/this.d)-(e2*this.n%this.d>p&&this.s=p?f:p)+tn*(e2*this.n%this.d)>this.d?f:p),e2)},roundTo:function(e2,t2){y(e2,t2);var e2=this.n*m.d,t2=this.d*m.n,r3=e2%t2;let n3=on(e2/t2);return t2<=r3+r3&&n3++,g(this.s*n3*m.n,m.d)},divisible:function(e2,t2){return y(e2,t2),!(!(m.n*this.d)||this.n*m.d%(m.n*this.d))},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(t2){let r3=this.n,n3=this.d,i2=(t2=t2||15,(function(e2){for(;e2%tn===p;e2/=tn);for(;e2%rn===p;e2/=rn);if(e2===f)return p;let t3=nn%e2,r4=1;for(;t3!==f;r4++)if(t3=t3*nn%e2,2e3p;e3=e3*e3%r5,t4>>=f)t4&f&&(n5=n5*e3%r5);return n5})(nn,e2,t3);for(let e3=0;e3<300;e3++){if(r4===n4)return BigInt(e3);r4=r4*nn%t3,n4=n4*nn%t3}return 0})(n3,i2),o2=this.sp&&(n3=n3+i2+" ",t2%=r3),n3=(n3+=t2)+"/"+r3),n3},toLatex:function(e2){let t2=this.n,r3=this.d,n3=this.sp&&(n3+=i2,t2%=r3),n3=(n3=(n3+="\\frac{")+t2+"}{")+r3+"}"),n3},toContinued:function(){let e2=this.n,t2=this.d,r3=[];do{r3.push(on(e2/t2));var n3=e2%t2;e2=t2,t2=n3}while(e2!==f);return r3},simplify:function(e2){let n3=BigInt(1/(e2||.001)|0),i2=this.abs(),a2=i2.toContinued();for(let r3=1;r3(Object.defineProperty(ln,"name",{value:"Fraction"}),(ln.prototype.constructor=ln).prototype.type="Fraction",ln.prototype.isFraction=!0,ln.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},ln.fromJSON=function(e2){return new ln(e2)},ln),{isClass:!0}),hn=s("Range",[],()=>{function o2(e2,t2,r3){if(!(this instanceof o2))throw new SyntaxError("Constructor must be called with the new operator");var n3=e2!=null,i2=t2!=null,a2=r3!=null;if(n3){if(Q(e2))e2=e2.toNumber();else if(typeof e2!="number"&&!R(e2))throw new TypeError("Parameter start must be a number or bigint")}if(i2){if(Q(t2))t2=t2.toNumber();else if(typeof t2!="number"&&!R(t2))throw new TypeError("Parameter end must be a number or bigint")}if(a2){if(Q(r3))r3=r3.toNumber();else if(typeof r3!="number"&&!R(r3))throw new TypeError("Parameter step must be a number or bigint")}this.start=n3?parseFloat(e2):0,this.end=i2?parseFloat(t2):0,this.step=a2?parseFloat(r3):1}return o2.prototype.type="Range",o2.prototype.isRange=!0,o2.parse=function(e2){if(typeof e2!="string")return null;let t2=e2.split(":").map(function(e3){return parseFloat(e3)});if(t2.some(function(e3){return isNaN(e3)}))return null;switch(t2.length){case 2:return new o2(t2[0],t2[1]);case 3:return new o2(t2[0],t2[2],t2[1]);default:return null}},o2.prototype.clone=function(){return new o2(this.start,this.end,this.step)},o2.prototype.size=function(){let e2=0;var t2=this.start,r3=this.step,t2=this.end-t2;return ke(r3)===ke(t2)?e2=Math.ceil(t2/r3):t2==0&&(e2=0),[e2=isNaN(e2)?0:e2]},o2.prototype.min=function(){var e2=this.size()[0];return 0n3;)e2(t2,[i2],this),t2+=r3,i2++},o2.prototype.map=function(n3){let i2=[];return this.forEach(function(e2,t2,r3){i2[t2[0]]=n3(e2,t2,r3)}),i2},o2.prototype.toArray=function(){let r3=[];return this.forEach(function(e2,t2){r3[t2[0]]=e2}),r3},o2.prototype.valueOf=function(){return this.toArray()},o2.prototype.format=function(e2){let t2=He(this.start,e2);return this.step!==1&&(t2+=":"+He(this.step,e2)),t2+=":"+He(this.end,e2)},o2.prototype.toString=function(){return this.format()},o2.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},o2.fromJSON=function(e2){return new o2(e2.start,e2.end,e2.step)},o2},{isClass:!0}),dn=s("Matrix",[],()=>{function e2(){if(!(this instanceof e2))throw new SyntaxError("Constructor must be called with the new operator")}return e2.prototype.type="Matrix",e2.prototype.isMatrix=!0,e2.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e2.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e2.prototype.create=function(e3,t2){throw new Error("Cannot invoke create on a Matrix interface")},e2.prototype.subset=function(e3,t2,r3){throw new Error("Cannot invoke subset on a Matrix interface")},e2.prototype.get=function(e3){throw new Error("Cannot invoke get on a Matrix interface")},e2.prototype.set=function(e3,t2,r3){throw new Error("Cannot invoke set on a Matrix interface")},e2.prototype.resize=function(e3,t2){throw new Error("Cannot invoke resize on a Matrix interface")},e2.prototype.reshape=function(e3,t2){throw new Error("Cannot invoke reshape on a Matrix interface")},e2.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e2.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e2.prototype.map=function(e3,t2){throw new Error("Cannot invoke map on a Matrix interface")},e2.prototype.forEach=function(e3){throw new Error("Cannot invoke forEach on a Matrix interface")},e2.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e2.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e2.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e2.prototype.format=function(e3){throw new Error("Cannot invoke format on a Matrix interface")},e2.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e2},{isClass:!0});function gn(){return(gn=Object.assign?Object.assign.bind():function(e2){for(var t2=1;t2vn(e3)+": "+S(t3[e3],r4)).join(", ")+"}":String(t3);{var n3=t3,i2=r4;if(typeof i2=="function")return i2(n3);if(!n3.isFinite())return n3.isNaN()?"NaN":n3.gt(0)?"Infinity":"-Infinity";let{notation:s2,precision:u2,wordSize:l2}=Ge(i2);switch(s2){case"fixed":return n3.toFixed(u2);case"exponential":return xn(n3,u2);case"engineering":{var a2=n3,o2=u2;let c2=a2.e,f2=c2%3==0?c2:c2<0?c2-3-c2%3:c2-c2%3,e3=a2.mul(Math.pow(10,-f2)).toPrecision(o2);return(e3=e3.includes("e")?new a2.constructor(e3).toFixed():e3)+"e"+(0<=c2?"+":"")+f2.toString()}case"bin":return yn(n3,2,l2);case"oct":return yn(n3,8,l2);case"hex":return yn(n3,16,l2);case"auto":{let s3=bn(i2?.lowerExp,-3),l3=bn(i2?.upperExp,5);if(n3.isZero())return"0";let e3,p2=n3.toSignificantDigits(u2),m2=p2.e;return(e3=m2>=s3&&m2t2.truncate?r3.substring(0,t2.truncate-3)+"...":r3}function vn(e2){let t2=String(e2),r3="",n3=0;for(;n3/g,">")}function An(e2,t2){if(!j(e2))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+K(e2)+", index: 0)");if(j(t2))return e2===t2?0:t2=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}function T(e2){let t2=[];for(;Array.isArray(e2);)t2.push(e2.length),e2=e2[0];return t2}function Sn(e2,t2){if(t2.length===0){if(Array.isArray(e2))throw new z(e2.length,0)}else(function e3(t3,r3,n3){let i2;var a2=t3.length;if(a2!==r3[n3])throw new z(a2,r3[n3]);if(n3")})(e2,t2,0)}function Mn(e2,t2){let r3=e2.isMatrix?e2._size:T(e2);t2._sourceSize.forEach((e3,t3)=>{if(e3!==null&&e3!==r3[t3])throw new z(e3,r3[t3])})}function M(e2,t2){if(e2!==void 0){if(!A(e2)||!v(e2))throw new TypeError("Index must be an integer (value: "+e2+")");if(e2<0||typeof t2=="number"&&t2<=e2)throw new En(e2,t2)}}function Cn(t2){for(let e2=0;e2e3*t2,1)}function On(e2,t2){let r3=t2||T(e2);for(;Array.isArray(e2)&&e2.length===1;)e2=e2[0],r3.shift();let n3=r3.length;for(;r3[n3-1]===1;)n3--;return n3t2.test(e3))}function Rn(e2,t2){return Array.prototype.join.call(e2,t2)}function Pn(t2){if(!Array.isArray(t2))throw new TypeError("Array input expected");if(t2.length===0)return t2;let r3=[],n3=0;r3[0]={value:t2[0],identifier:0};for(let e2=1;e2e3.length),i2=Math.max(...n3),a2=new Array(i2).fill(null);for(let e3=0;e3a2[t3]&&(a2[t3]=r4[e4])}}for(let e3=0;e3r3[a2])throw new Error(`shape mismatch: mismatch is found in arg with shape (${t2}) not possible to broadcast dimension ${i2} with size ${t2[e2]} to size `+r3[a2])}}function Gn(e2,t2){let r3=T(e2);if(De(r3,t2))return e2;Hn(r3,t2);var n3,i2,a2,o2=$n(r3,t2),s2=o2.length,t2=[...Array(s2-r3.length).fill(1),...r3];let u2=gn([],e2);r3.lengthe3[t3],e2)}function Zn(i2,a2,e2){if(i2.length===0)return[];if(20),t3=o2.isMatrix?o2.get(s3):Vn(o2,s3);n3=(function(t4,e3,r3){let n4=[e3,r3,o2];for(let e4=3;0{let[t3,r3]=e4;t3.split(",").length===n4&&i3.push(r3)}),i3.length===1)return i3[0]})(a2,n3);i2=l2!==void 0?l2:a2}else i2=a2;return 1<=n3&&n3<=3?{isUnary:n3===1,fn:function(){for(var e3=arguments.length,t3=new Array(e3),r3=0;r3{let t2=e2.Matrix;function g2(e3,t3){if(!(this instanceof g2))throw new SyntaxError("Constructor must be called with the new operator");if(t3&&!j(t3))throw new Error("Invalid datatype: "+t3);if(_(e3))e3.type==="DenseMatrix"?(this._data=ee(e3._data),this._size=ee(e3._size)):(this._data=e3.toArray(),this._size=e3.size()),this._datatype=t3||e3._datatype;else if(e3&&b(e3.data)&&b(e3.size))this._data=e3.data,this._size=e3.size,Sn(this._data,this._size),this._datatype=t3||e3.datatype;else if(b(e3))this._data=r3(e3),this._size=T(this._data),Sn(this._data,this._size),this._datatype=t3;else{if(e3)throw new TypeError("Unsupported type of data ("+K(e3)+")");this._data=[],this._size=[0],this._datatype=t3}}function a2(t3,e3,r4){if(e3.length!==0)return t3._size=e3.slice(0),t3._data=Tn(t3._data,t3._size,r4),t3;{let e4=t3._data;for(;b(e4);)e4=e4[0];return e4}}function y2(e3,r4,t3){let n3=e3._size.slice(0),i2=!1;for(;n3.lengthn3[e4]&&(n3[e4]=r4[e4],i2=!0);i2&&a2(e3,n3,t3)}function r3(e3){return _(e3)?r3(e3.valueOf()):b(e3)?e3.map(r3):e3}return(g2.prototype=new t2).createDenseMatrix=function(e3,t3){return new g2(e3,t3)},Object.defineProperty(g2,"name",{value:"DenseMatrix"}),(g2.prototype.constructor=g2).prototype.type="DenseMatrix",g2.prototype.isDenseMatrix=!0,g2.prototype.getDataType=function(){return jn(this._data,K)},g2.prototype.storage=function(){return"dense"},g2.prototype.datatype=function(){return this._datatype},g2.prototype.create=function(e3,t3){return new g2(e3,t3)},g2.prototype.subset=function(e3,t3,n3){switch(arguments.length){case 1:var r4=this,i2=e3;if(!Z(i2))throw new TypeError("Invalid index");if(i2.isScalar())return r4.get(i2.min());{var a3=i2.size();if(a3.length!==r4._size.length)throw new z(a3.length,r4._size.length);var o2=i2.min(),s2=i2.max();for(let e4=0,t4=r4._size.length;e4(M(e6,r5.length),t4(r5[e6],n4+1))):e5.map(e6=>(M(e6,r5.length),r5[e6]))).valueOf()})(e4),size:o3}})(r4._data,i2);return m2._size=h2.size,m2._datatype=r4._datatype,m2._data=h2.data,m2}case 2:case 3:{var u2=this;a3=e3,i2=t3;var l2=n3;if(!a3||a3.isIndex!==!0)throw new TypeError("Invalid index");var c2=a3.size(),f2=a3.isScalar();let r5;if(_(i2)?(r5=i2.size(),i2=i2.valueOf()):r5=T(i2),f2){if(r5.length!==0)throw new TypeError("Scalar expected");u2.set(a3.min(),i2,l2)}else{if(!De(r5,c2))try{r5=T(i2=r5.length===0?Gn([i2],c2):Gn(i2,c2))}catch{}if(c2.length");y2(u2,a3.max().map(function(e4){return e4+1}),l2);{f2=u2._data;var p2=a3;l2=i2;let d2=p2.size().length-1;(function r6(n4,i3){let a4=2{M(e5,n4.length),r6(n4[e5],i3[t4[0]],a4+1)}):e4.forEach((e5,t4)=>{M(e5,n4.length),n4[e5]=i3[t4[0]]})})(f2,l2)}}return u2}default:throw new SyntaxError("Wrong number of arguments")}},g2.prototype.get=function(e3){return Vn(this._data,e3)},g2.prototype.set=function(e3,t3,r4){if(!b(e3))throw new TypeError("Array expected");if(e3.lengthArray.isArray(e4)&&e4.length===1?e4[0]:e4),a2(r4?this.clone():this,e3,t3)},g2.prototype.reshape=function(e3,t3){let r4=t3?this.clone():this;return r4._data=Bn(r4._data,e3),t3=r4._size.reduce((e4,t4)=>e4*t4),r4._size=Fn(e3,t3),r4},g2.prototype.clone=function(){return new g2({data:ee(this._data),size:ee(this._size),datatype:this._datatype})},g2.prototype.size=function(){return this._size.slice(0)},g2.prototype.map=function(t3){let r4=2e3*t4,1);for(let e3=0;e3[e4[t3]]);e3.push(new g2(r5,this._datatype))}return e3},g2.prototype.toArray=function(){return ee(this._data)},g2.prototype.valueOf=function(){return this._data},g2.prototype.format=function(e3){return S(this._data,e3)},g2.prototype.toString=function(){return S(this._data)},g2.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},g2.prototype.diagonal=function(e3){if(e3){if(!A(e3=Q(e3)?e3.toNumber():e3)||!v(e3))throw new TypeError("The parameter k must be an integer number")}else e3=0;let t3=0{let t2=e2.typed;return t2("clone",{any:ee})});function Kn(e2){let t2=e2.length,r3=e2[0].length,n3,i2,a2=[];for(i2=0;i2t2(e3),!1,!0):Wn(e2,t2,!0)}function le(e2,t2,r3){if(!r3)return _(e2)?e2.map(e3=>t2(e3),!1,!0):Zn(e2,t2,!0);let n3=e3=>e3===0?e3:t2(e3);return _(e2)?e2.map(e3=>n3(e3),!1,!0):Zn(e2,n3,!0)}function ri(e2,t2,r3){var n3=Array.isArray(e2)?T(e2):e2.size();if(t2<0||t2>=n3.length)throw new En(t2,n3.length);return _(e2)?e2.create(ni(e2.valueOf(),t2,r3),e2.datatype()):ni(e2,t2,r3)}function ni(e2,t2,r3){let n3,i2,a2,o2;if(t2<=0){if(Array.isArray(e2[0])){for(o2=Kn(e2),i2=[],n3=0;n3{let t2=e2.typed;return t2(ai,{number:v,BigNumber:function(e3){return e3.isInt()},bigint:function(e3){return!0},Fraction:function(e3){return e3.d===1n},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),si="number";function ui(e2){return Number.isNaN(e2)}function li(e2,t2,r3,n3){if(r3=2{let{typed:r3,config:t2}=e2;return r3(ci,{number:e3=>!Xe(e3,0,t2.relTol,t2.absTol)&&e3<0,BigNumber:e3=>!li(e3,new e3.constructor(0),t2.relTol,t2.absTol)&&e3.isNeg()&&!e3.isZero()&&!e3.isNaN(),bigint:e3=>e3<0n,Fraction:e3=>e3.s<0n,Unit:r3.referToSelf(t3=>e3=>r3.find(t3,e3.valueType())(e3.value)),"Array | Matrix":r3.referToSelf(t3=>e3=>le(e3,t3))})}),pi="isNumeric",mi=s(pi,["typed"],e2=>{let t2=e2.typed;return t2(pi,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),hi="hasNumericValue",di=s(hi,["typed","isNumeric"],e2=>{let{typed:t2,isNumeric:r3}=e2;return t2(hi,{boolean:()=>!0,string:function(e3){return 0{let{typed:r3,config:t2}=e2;return r3(gi,{number:e3=>!Xe(e3,0,t2.relTol,t2.absTol)&&0!(li(e3,new e3.constructor(0),t2.relTol,t2.absTol)||e3.isNeg()||e3.isZero()||e3.isNaN()),bigint:e3=>0n0ne3=>r3.find(t3,e3.valueType())(e3.value)),"Array | Matrix":r3.referToSelf(t3=>e3=>le(e3,t3))})}),xi=s("isZero",["typed","equalScalar"],e2=>{let{typed:r3,equalScalar:t2}=e2;return r3("isZero",{"number | BigNumber | Complex | Fraction":e3=>t2(e3,0),bigint:e3=>e3===0n,Unit:r3.referToSelf(t3=>e3=>r3.find(t3,e3.valueType())(e3.value)),"Array | Matrix":r3.referToSelf(t3=>e3=>le(e3,t3))})}),bi=s("isNaN",["typed"],e2=>{let t2=e2.typed;return t2("isNaN",{number:ui,BigNumber:function(e3){return e3.isNaN()},bigint:function(e3){return!1},Fraction:function(e3){return!1},Complex:function(e3){return e3.isNaN()},Unit:function(e3){return Number.isNaN(e3.value)},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),vi=s("typeOf",["typed"],e2=>{let t2=e2.typed;return t2("typeOf",{any:K})}),wi=s("compareUnits",["typed"],e2=>{let n3=e2.typed;return{"Unit, Unit":n3.referToSelf(r3=>(e3,t2)=>{if(e3.equalBase(t2))return n3.find(r3,[e3.valueType(),t2.valueType()])(e3.value,t2.value);throw new Error("Cannot compare units with different base")})}}),Ni="equalScalar",Ai=s(Ni,["typed","config"],e2=>{let{typed:t2,config:i2}=e2;return e2=wi({typed:t2}),t2(Ni,{"boolean, boolean":function(e3,t3){return e3===t3},"number, number":function(e3,t3){return Xe(e3,t3,i2.relTol,i2.absTol)},"BigNumber, BigNumber":function(e3,t3){return e3.eq(t3)||li(e3,t3,i2.relTol,i2.absTol)},"bigint, bigint":function(e3,t3){return e3===t3},"Fraction, Fraction":function(e3,t3){return e3.equals(t3)},"Complex, Complex":function(e3,t3){return e3=e3,t3=t3,r3=i2.relTol,n3=i2.absTol,Xe(e3.re,t3.re,r3,n3)&&Xe(e3.im,t3.im,r3,n3);var r3,n3}},e2)}),Ei=(s(Ni,["typed","config"],e2=>{let{typed:t2,config:r3}=e2;return t2(Ni,{"number, number":function(e3,t3){return Xe(e3,t3,r3.relTol,r3.absTol)}})}),s("SparseMatrix",["typed","equalScalar","Matrix"],e2=>{let{typed:y2,equalScalar:x2,Matrix:t2}=e2;function E2(e3,t3){if(!(this instanceof E2))throw new SyntaxError("Constructor must be called with the new operator");if(t3&&!j(t3))throw new Error("Invalid datatype: "+t3);if(_(e3))r4=this,i2=t3,(n3=e3).type==="SparseMatrix"?(r4._values=n3._values?ee(n3._values):void 0,r4._index=ee(n3._index),r4._ptr=ee(n3._ptr),r4._size=ee(n3._size),r4._datatype=i2||n3._datatype):a2(r4,n3.valueOf(),i2||n3._datatype);else if(e3&&b(e3.index)&&b(e3.ptr)&&b(e3.size))this._values=e3.values,this._index=e3.index,this._ptr=e3.ptr,this._size=e3.size,this._datatype=t3||e3.datatype;else if(b(e3))a2(this,e3,t3);else{if(e3)throw new TypeError("Unsupported type of data ("+K(e3)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t3}var r4,n3,i2}function a2(r4,n3,i2){r4._values=[],r4._index=[],r4._ptr=[],r4._datatype=i2;var a3=n3.length;let o2=0,s2=x2,u2=0;if(j(i2)&&(s2=y2.find(x2,[i2,i2])||x2,u2=y2.convert(0,i2)),0p2){for(c2=p2;c2n3-1&&(r4._values.splice(f2,1),r4._index.splice(f2,1),e4++)}r4._ptr[c2]=r4._values.length}return r4._size[0]=n3,r4._size[1]=t3,r4}function r3(t3,r4,e3,n3,i2){let a3=n3[0],o2=n3[1],s2=[],u2,l2;for(u2=0;u2");if(n3.length===1)o2.dimension(0).forEach(function(e4,t4){M(e4),c2.set([e4,0],f2[t4[0]],p2)});else{let n4=o2.dimension(0),A3=o2.dimension(1);n4.forEach(function(r5,n5){M(r5),A3.forEach(function(e4,t4){M(e4),c2.set([r5,e4],f2[n5[0]][t4[0]],p2)})})}}return c2}default:throw new SyntaxError("Wrong number of arguments")}},E2.prototype.get=function(e3){if(!b(e3))throw new TypeError("Array expected");if(e3.length!==this._size.length)throw new z(e3.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t3=e3[0],e3=e3[1],r4=(M(t3,this._size[0]),M(e3,this._size[1]),m2(t3,this._ptr[e3],this._ptr[e3+1],this._index));return r4i2-1||e3>a3-1)&&(d2(this,Math.max(n3+1,i2),Math.max(e3+1,a3),r4),i2=this._size[0],a3=this._size[1]),M(n3,i2),M(e3,a3),r4=m2(n3,this._ptr[e3],this._ptr[e3+1],this._index),r4Array.isArray(e4)&&e4.length===1?e4[0]:e4);if(n3.length!==2)throw new Error("Only two dimensions matrix are supported");return n3.forEach(function(e4){if(!A(e4)||!v(e4)||e4<0)throw new TypeError("Invalid size, must contain positive integers (size: "+S(n3)+")")}),d2(r4?this.clone():this,n3[0],n3[1],t3)},E2.prototype.reshape=function(t3,r4){if(!b(t3))throw new TypeError("Array expected");if(t3.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");t3.forEach(function(e3){if(!A(e3)||!v(e3)||e3<=-2||e3===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+S(t3)+")")});let n3=this._size[0]*this._size[1];if(n3!==(t3=Fn(t3,n3))[0]*t3[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");let i2=r4?this.clone():this;if(this._size[0]===t3[0]&&this._size[1]===t3[1])return i2;let a3=[];for(let t4=0;t4 "+(this._values?S(this._values[e4],r4):"X")}return a3},E2.prototype.toString=function(){return S(this.toArray())},E2.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},E2.prototype.diagonal=function(e3){if(e3){if(!A(e3=Q(e3)?e3.toNumber():e3)||!v(e3))throw new TypeError("The parameter k must be an integer number")}else e3=0;let r4=0{let t2=e2.typed,r3=t2("number",{"":function(){return 0},number:function(e3){return e3},string:function(r4){if(r4==="NaN")return NaN;var n3=(e3=(n3=r4).match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/))?{input:n3,radix:{"0b":2,"0o":8,"0x":16}[e3[1]],integerPart:e3[2],fractionalPart:e3[3]}:null;if(n3){var i2=n3,e3=parseInt(i2.integerPart,i2.radix);let t3=0;for(let e4=0;e42**e4-1)throw new SyntaxError(`String "${r4}" is out of range`);t3>=2**(e4-1)&&(t3-=2**e4)}return t3}},BigNumber:function(e3){return e3.toNumber()},bigint:function(e3){return Number(e3)},Fraction:function(e3){return e3.valueOf()},Unit:t2.referToSelf(r4=>e3=>{let t3=e3.clone();return t3.value=r4(e3.value),t3}),null:function(e3){return 0},"Unit, string | Unit":function(e3,t3){return e3.toNumber(t3)},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))});return r3.fromJSON=function(e3){return parseFloat(e3.value)},r3}),Mi=s("bigint",["typed"],e2=>{let t2=e2.typed,r3=t2("bigint",{"":function(){return 0n},bigint:function(e3){return e3},number:function(e3){return BigInt(e3.toFixed())},BigNumber:function(e3){return BigInt(e3.round().toString())},Fraction:function(e3){return BigInt(e3.valueOf().toFixed())},"string | boolean":function(e3){return BigInt(e3)},null:function(e3){return 0n},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))});return r3.fromJSON=function(e3){return BigInt(e3.value)},r3}),Ci=s("string",["typed"],e2=>{let t2=e2.typed;return t2("string",{"":function(){return""},number:He,null:function(e3){return"null"},boolean:function(e3){return e3+""},string:function(e3){return e3},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3)),any:function(e3){return String(e3)}})}),Ti="boolean",Bi=s(Ti,["typed"],e2=>{let t2=e2.typed;return t2(Ti,{"":function(){return!1},boolean:function(e3){return e3},number:function(e3){return!!e3},null:function(e3){return!1},BigNumber:function(e3){return!e3.isZero()},string:function(e3){var t3=e3.toLowerCase();if(t3==="true")return!0;if(t3==="false")return!1;if(t3=Number(e3),e3===""||isNaN(t3))throw new Error('Cannot convert "'+e3+'" to a boolean');return!!t3},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),Fi=s("bignumber",["typed","BigNumber"],e2=>{let{typed:t2,BigNumber:a2}=e2;return t2("bignumber",{"":function(){return new a2(0)},number:function(e3){return new a2(e3+"")},string:function(e3){var t3=e3.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t3){let r3=t3[2],n3=a2(t3[1]),i2=new a2(2).pow(Number(r3));if(n3.gt(i2.sub(1)))throw new SyntaxError(`String "${e3}" is out of range`);return t3=new a2(2).pow(Number(r3)-1),n3.gte(t3)?n3.sub(i2):n3}return new a2(e3)},BigNumber:function(e3){return e3},bigint:function(e3){return new a2(e3.toString())},Unit:t2.referToSelf(r3=>e3=>{let t3=e3.clone();return t3.value=r3(e3.value),t3}),Fraction:function(e3){return new a2(String(e3.n)).div(String(e3.d)).times(String(e3.s))},null:function(e3){return new a2(0)},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),Di=s("complex",["typed","Complex"],e2=>{let{typed:t2,Complex:r3}=e2;return t2("complex",{"":function(){return r3.ZERO},number:function(e3){return new r3(e3,0)},"number, number":function(e3,t3){return new r3(e3,t3)},"BigNumber, BigNumber":function(e3,t3){return new r3(e3.toNumber(),t3.toNumber())},Fraction:function(e3){return new r3(e3.valueOf(),0)},Complex:function(e3){return e3.clone()},string:function(e3){return r3(e3)},null:function(e3){return r3(0)},Object:function(e3){if("re"in e3&&"im"in e3)return new r3(e3.re,e3.im);if("r"in e3&&"phi"in e3||"abs"in e3&&"arg"in e3)return new r3(e3);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),Oi=s("fraction",["typed","Fraction"],e2=>{let{typed:t2,Fraction:r3}=e2;return t2("fraction",{number:function(e3){if(!isFinite(e3)||isNaN(e3))throw new Error(e3+" cannot be represented as a fraction");return new r3(e3)},string:function(e3){return new r3(e3)},"number, number":function(e3,t3){return new r3(e3,t3)},"bigint, bigint":function(e3,t3){return new r3(e3,t3)},null:function(e3){return new r3(0)},BigNumber:function(e3){return new r3(e3.toString())},bigint:function(e3){return new r3(e3.toString())},Fraction:function(e3){return e3},Unit:t2.referToSelf(r4=>e3=>{let t3=e3.clone();return t3.value=r4(e3.value),t3}),Object:function(e3){return new r3(e3)},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),_i=s("matrix",["typed","Matrix","DenseMatrix","SparseMatrix"],e2=>{let{typed:t2,DenseMatrix:n3,SparseMatrix:i2}=e2;return t2("matrix",{"":function(){return r3([])},string:function(e3){return r3([],e3)},"string, string":function(e3,t3){return r3([],e3,t3)},Array:function(e3){return r3(e3)},Matrix:function(e3){return r3(e3,e3.storage())},"Array | Matrix, string":r3,"Array | Matrix, string, string":r3});function r3(e3,t3,r4){if(t3==="dense"||t3==="default"||t3===void 0)return new n3(e3,r4);if(t3==="sparse")return new i2(e3,r4);throw new TypeError("Unknown matrix type "+JSON.stringify(t3)+".")}}),zi="matrixFromFunction",qi=s(zi,["typed","matrix","isZero"],e2=>{let{typed:t2,matrix:a2,isZero:o2}=e2;return t2(zi,{"Array | Matrix, function, string, string":i2,"Array | Matrix, function, string":function(e3,t3,r3){return i2(e3,t3,r3)},"Matrix, function":function(e3,t3){return i2(e3,t3,"dense")},"Array, function":function(e3,t3){return i2(e3,t3,"dense").toArray()},"Array | Matrix, string, function":function(e3,t3,r3){return i2(e3,r3,t3)},"Array | Matrix, string, string, function":function(e3,t3,r3,n3){return i2(e3,n3,t3,r3)}});function i2(e3,n3,t3,r3){let i3;return(i3=r3!==void 0?a2(t3,r3):a2(t3)).resize(e3),i3.forEach(function(e4,t4){var r4=n3(t4);o2(r4)||i3.set(t4,r4)}),i3}}),Ii="matrixFromRows",ki=s(Ii,["typed","matrix","flatten","size"],e2=>{let{typed:t2,matrix:r3,flatten:i2,size:n3}=e2;return t2(Ii,{"...Array":a2,"...Matrix":function(e3){return r3(a2(e3.map(e4=>e4.toArray())))}});function a2(e3){if(e3.length===0)throw new TypeError("At least one row is needed to construct a matrix.");let t3=o2(e3[0]),r4=[];for(let n4 of e3){let e4=o2(n4);if(e4!==t3)throw new TypeError("The vectors had different length: "+(0|t3)+" \u2260 "+(0|e4));r4.push(i2(n4))}return r4}function o2(e3){if(e3=n3(e3),e3.length===1)return e3[0];if(e3.length!==2)throw new TypeError("Only one- or two-dimensional vectors are supported.");if(e3[0]===1)return e3[1];if(e3[1]===1)return e3[0];throw new TypeError("At least one of the arguments is not a vector.")}}),Ri="matrixFromColumns",Pi=s(Ri,["typed","matrix","flatten","size"],e2=>{let{typed:t2,matrix:r3,flatten:a2,size:n3}=e2;return t2(Ri,{"...Array":i2,"...Matrix":function(e3){return r3(i2(e3.map(e4=>e4.toArray())))}});function i2(e3){if(e3.length===0)throw new TypeError("At least one column is needed to construct a matrix.");let t3=o2(e3[0]),r4=[];for(let e4=0;e4{let t2=e2.typed;return t2(Ui,{"Unit, Array":function(e3,t3){return e3.splitUnit(t3)}})}),Li="number",$i="number, number";function Hi(e2){return Math.abs(e2)}function Gi(e2,t2){return e2+t2}function Vi(e2,t2){return e2-t2}function Zi(e2,t2){return e2*t2}function Wi(e2){return-e2}function Yi(e2){return e2}function Ji(e2){return je(e2)}function Xi(e2){return e2*e2*e2}function Qi(e2){return Math.exp(e2)}function Ki(e2){return Le(e2)}function ea(e2,t2){if(!v(e2)||!v(t2))throw new Error("Parameters in function lcm must be integer numbers");if(e2===0||t2===0)return 0;for(var r3,n3=e2*t2;t2!==0;)t2=e2%(r3=t2),e2=r3;return Math.abs(n3/e2)}function ta(e2,t2){return t2?Math.log(e2)/Math.log(t2):Math.log(e2)}function ra(e2){return Pe(e2)}function na(e2){return Re(e2)}function ia(e2){let t2=1{let n3=e2.typed;return n3(ca,{number:Wi,"Complex | BigNumber | Fraction":e3=>e3.neg(),bigint:e3=>-e3,Unit:n3.referToSelf(r3=>e3=>{let t2=e3.clone();return t2.value=n3.find(r3,t2.valueType())(e3.value),t2}),"Array | Matrix":n3.referToSelf(t2=>e3=>le(e3,t2,!0))})}),pa="unaryPlus",ma=s(pa,["typed","config","numeric"],e2=>{let{typed:t2,config:r3,numeric:n3}=e2;return t2(pa,{number:Yi,Complex:function(e3){return e3},BigNumber:function(e3){return e3},bigint:function(e3){return e3},Fraction:function(e3){return e3},Unit:function(e3){return e3.clone()},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3,!0)),boolean:function(e3){return n3(e3?1:0,r3.number)},string:function(e3){return n3(e3,Ie(e3,r3))}})}),ha=s("abs",["typed"],e2=>{let t2=e2.typed;return t2("abs",{number:Hi,"Complex | BigNumber | Fraction | Unit":e3=>e3.abs(),bigint:e3=>e3<0n?-e3:e3,"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3,!0))})}),da="mapSlices",ga=s(da,["typed","isInteger"],e2=>{let{typed:t2,isInteger:i2}=e2;return t2(da,{"Array | Matrix, number | BigNumber, function":function(e3,t3,r3){if(!i2(t3))throw new TypeError("Integer number expected for dimension");var n3=Array.isArray(e3)?T(e3):e3.size();if(t3<0||t3>=n3.length)throw new En(t3,n3.length);return _(e3)?e3.create(ya(e3.valueOf(),t3,r3),e3.datatype()):ya(e3,t3,r3)}})},{formerly:"apply"});function ya(e2,t2,r3){let n3,i2,a2;if(t2<=0){if(Array.isArray(e2[0])){for(a2=(function(e3){let t3=e3.length,r4=e3[0].length,n4,i3,a3=[];for(i3=0;i3{let i2=e2.typed;return i2(xa,{"number, number":Gi,"Complex, Complex":function(e3,t2){return e3.add(t2)},"BigNumber, BigNumber":function(e3,t2){return e3.plus(t2)},"bigint, bigint":function(e3,t2){return e3+t2},"Fraction, Fraction":function(e3,t2){return e3.add(t2)},"Unit, Unit":i2.referToSelf(n3=>(e3,t2)=>{if(e3.value===null||e3.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(t2.value===null||t2.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!e3.equalBase(t2))throw new Error("Units do not match");let r3=e3.clone();return r3.value=i2.find(n3,[r3.valueType(),t2.valueType()])(r3.value,t2.value),r3.fixPrefix=!1,r3})})}),va="subtractScalar",wa=s(va,["typed"],e2=>{let i2=e2.typed;return i2(va,{"number, number":Vi,"Complex, Complex":function(e3,t2){return e3.sub(t2)},"BigNumber, BigNumber":function(e3,t2){return e3.minus(t2)},"bigint, bigint":function(e3,t2){return e3-t2},"Fraction, Fraction":function(e3,t2){return e3.sub(t2)},"Unit, Unit":i2.referToSelf(n3=>(e3,t2)=>{if(e3.value===null||e3.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(t2.value===null||t2.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!e3.equalBase(t2))throw new Error("Units do not match");let r3=e3.clone();return r3.value=i2.find(n3,[r3.valueType(),t2.valueType()])(r3.value,t2.value),r3.fixPrefix=!1,r3})})}),Na=s("cbrt",["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],e2=>{let{config:a2,typed:t2,isNegative:i2,unaryMinus:o2,matrix:s2,Complex:u2,BigNumber:l2,Fraction:c2}=e2;return t2("cbrt",{number:Ji,Complex:f2,"Complex, boolean":f2,BigNumber:function(e3){return e3.cbrt()},Unit:function(t3){if(t3.value&&te(t3.value)){let e4=t3.clone();return e4.value=1,(e4=e4.pow(1/3)).value=f2(t3.value),e4}{var e3,r3=i2(t3.value);r3&&(t3.value=o2(t3.value)),e3=Q(t3.value)?new l2(1).div(3):re(t3.value)?new c2(1,3):1/3;let n3=t3.pow(e3);return r3&&(n3.value=o2(n3.value)),n3}}});function f2(e3,t3){var r3=e3.arg()/3,n3=e3.abs(),i3=new u2(Ji(n3),0).mul(new u2(0,r3).exp());if(t3){let e4=[i3,new u2(Ji(n3),0).mul(new u2(0,r3+2*Math.PI/3).exp()),new u2(Ji(n3),0).mul(new u2(0,r3-2*Math.PI/3).exp())];return a2.matrix==="Array"?e4:s2(e4)}return i3}}),Aa=s("matAlgo11xS0s",["typed","equalScalar"],e2=>{let{typed:x2,equalScalar:b2}=e2;return function(i2,a2,e3,o2){var s2=i2._values,u2=i2._index,l2=i2._ptr,t2=i2._size,r3=i2._datatype;if(!s2)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var n3=t2[0],c2=t2[1];let f2,p2=b2,m2=0,h2=e3;typeof r3=="string"&&(f2=r3,p2=x2.find(b2,[f2,f2]),m2=x2.convert(0,f2),a2=x2.convert(a2,f2),h2=x2.find(e3,[f2,f2]));let d2=[],g2=[],y2=[];for(let n4=0;n4{let{typed:d2,DenseMatrix:g2}=e2;return function(i2,t2,e3,r3){var a2=i2._values,o2=i2._index,s2=i2._ptr,n3=i2._size,i2=i2._datatype;if(!a2)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var u2=n3[0],l2=n3[1];let c2,f2=e3;typeof i2=="string"&&(c2=i2,t2=d2.convert(t2,c2),f2=d2.find(e3,[c2,c2]));let p2=[],m2=[],h2=[];for(let n4=0;n4{let l2=e2.typed;return function(e3,t2,r3,n3){var i2=e3._data,a2=e3._size,o2=e3._datatype;let s2,u2=r3;return typeof o2=="string"&&(s2=o2,t2=l2.convert(t2,s2),u2=l2.find(r3,[s2,s2])),o2=0{let{typed:t2,config:n3,round:i2}=e2;function r3(e3){var t3=Math.ceil(e3),r4=i2(e3);return t3!==r4&&Xe(e3,r4,n3.relTol,n3.absTol)&&!Xe(e3,t3,n3.relTol,n3.absTol)?r4:t3}return t2(Sa,{number:r3,"number, number":function(e3,t3){if(!v(t3))throw new RangeError("number of decimals in function ceil must be an integer");if(t3<0||15{let{typed:t2,config:i2,round:a2,matrix:n3,equalScalar:o2,zeros:s2,DenseMatrix:r3}=e2,u2=Aa({typed:t2,equalScalar:o2}),l2=x({typed:t2,DenseMatrix:r3}),c2=Ea({typed:t2}),f2=Ca({typed:t2,config:i2,round:a2});function p2(e3){let t3=(e4,t4)=>li(e4,t4,i2.relTol,i2.absTol),r4=e3.ceil(),n4=a2(e3);return!r4.eq(n4)&&t3(e3,n4)&&!t3(e3,r4)?n4:r4}return t2("ceil",{number:f2.signatures.number,"number,number":f2.signatures["number,number"],Complex:function(e3){return e3.ceil()},"Complex, number":function(e3,t3){return e3.ceil(t3)},"Complex, BigNumber":function(e3,t3){return e3.ceil(t3.toNumber())},BigNumber:p2,"BigNumber, BigNumber":function(e3,t3){return t3=Ma.pow(t3),p2(e3.mul(t3)).div(t3)},bigint:e3=>e3,"bigint, number":(e3,t3)=>e3,"bigint, BigNumber":(e3,t3)=>e3,Fraction:function(e3){return e3.ceil()},"Fraction, number":function(e3,t3){return e3.ceil(t3)},"Fraction, BigNumber":function(e3,t3){return e3.ceil(t3.toNumber())},"Unit, number, Unit":t2.referToSelf(n4=>function(e3,t3,r4){return e3=e3.toNumeric(r4),r4.multiply(n4(e3,t3))}),"Unit, BigNumber, Unit":t2.referToSelf(n4=>(e3,t3,r4)=>n4(e3,t3.toNumber(),r4)),"Array | Matrix, number | BigNumber, Unit":t2.referToSelf(n4=>(e3,t3,r4)=>le(e3,e4=>n4(e4,t3,r4),!0)),"Array | Matrix | Unit, Unit":t2.referToSelf(r4=>(e3,t3)=>r4(e3,0,t3)),"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3,!0)),"Array, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>le(e3,e4=>r4(e4,t3),!0)),"SparseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>u2(e3,t3,r4,!1)),"DenseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>c2(e3,t3,r4,!1)),"number | Complex | Fraction | BigNumber, Array":t2.referToSelf(r4=>(e3,t3)=>c2(n3(t3),e3,r4,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t2.referToSelf(r4=>(e3,t3)=>o2(e3,0)?s2(t3.size(),t3.storage()):(t3.storage()==="dense"?c2:l2)(t3,e3,r4,!0))})}),Ba=s("cube",["typed"],e2=>{let t2=e2.typed;return t2("cube",{number:Xi,Complex:function(e3){return e3.mul(e3).mul(e3)},BigNumber:function(e3){return e3.times(e3).times(e3)},bigint:function(e3){return e3*e3*e3},Fraction:function(e3){return e3.pow(3)},Unit:function(e3){return e3.pow(3)}})}),Fa=s("exp",["typed"],e2=>{let t2=e2.typed;return t2("exp",{number:Qi,Complex:function(e3){return e3.exp()},BigNumber:function(e3){return e3.exp()}})}),Da=s("expm1",["typed","Complex"],e2=>{let{typed:t2,Complex:r3}=e2;return t2("expm1",{number:Ki,Complex:function(e3){var t3=Math.exp(e3.re);return new r3(t3*Math.cos(e3.im)-1,t3*Math.sin(e3.im))},BigNumber:function(e3){return e3.exp().minus(1)}})}),Oa=s("fix",["typed","ceil","floor"],e2=>{let{typed:t2,ceil:r3,floor:n3}=e2;return t2("fix",{number:function(e3){return(0{let{typed:t2,Complex:r3,matrix:n3,ceil:i2,floor:a2,equalScalar:o2,zeros:s2,DenseMatrix:u2}=e2,l2=x({typed:t2,DenseMatrix:u2}),c2=Ea({typed:t2}),f2=Oa({typed:t2,ceil:i2,floor:a2});return t2("fix",{number:f2.signatures.number,"number, number | BigNumber":f2.signatures["number,number"],Complex:function(e3){return new r3(0e3,"bigint, number":(e3,t3)=>e3,"bigint, BigNumber":(e3,t3)=>e3,Fraction:function(e3){return e3.s<0n?e3.ceil():e3.floor()},"Fraction, number | BigNumber":function(e3,t3){return(e3.s<0n?i2:a2)(e3,t3)},"Unit, number, Unit":t2.referToSelf(n4=>function(e3,t3,r4){return e3=e3.toNumeric(r4),r4.multiply(n4(e3,t3))}),"Unit, BigNumber, Unit":t2.referToSelf(n4=>(e3,t3,r4)=>n4(e3,t3.toNumber(),r4)),"Array | Matrix, number | BigNumber, Unit":t2.referToSelf(n4=>(e3,t3,r4)=>le(e3,e4=>n4(e4,t3,r4),!0)),"Array | Matrix | Unit, Unit":t2.referToSelf(r4=>(e3,t3)=>r4(e3,0,t3)),"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3,!0)),"Array | Matrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>le(e3,e4=>r4(e4,t3),!0)),"number | Complex | Fraction | BigNumber, Array":t2.referToSelf(r4=>(e3,t3)=>c2(n3(t3),e3,r4,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t2.referToSelf(r4=>(e3,t3)=>o2(e3,0)?s2(t3.size(),t3.storage()):(t3.storage()==="dense"?c2:l2)(t3,e3,r4,!0))})}),za="floor",qa=new Vr(10),Ia=s(za,["typed","config","round"],e2=>{let{typed:t2,config:n3,round:i2}=e2;function r3(e3){var t3=Math.floor(e3),r4=i2(e3);return t3!==r4&&Xe(e3,r4,n3.relTol,n3.absTol)&&!Xe(e3,t3,n3.relTol,n3.absTol)?r4:t3}return t2(za,{number:r3,"number, number":function(e3,t3){if(!v(t3))throw new RangeError("number of decimals in function floor must be an integer");if(t3<0||15{let{typed:t2,config:i2,round:a2,matrix:n3,equalScalar:o2,zeros:s2,DenseMatrix:r3}=e2,u2=Aa({typed:t2,equalScalar:o2}),l2=x({typed:t2,DenseMatrix:r3}),c2=Ea({typed:t2}),f2=Ia({typed:t2,config:i2,round:a2});function p2(e3){let t3=(e4,t4)=>li(e4,t4,i2.relTol,i2.absTol),r4=e3.floor(),n4=a2(e3);return!r4.eq(n4)&&t3(e3,n4)&&!t3(e3,r4)?n4:r4}return t2("floor",{number:f2.signatures.number,"number,number":f2.signatures["number,number"],Complex:function(e3){return e3.floor()},"Complex, number":function(e3,t3){return e3.floor(t3)},"Complex, BigNumber":function(e3,t3){return e3.floor(t3.toNumber())},BigNumber:p2,"BigNumber, BigNumber":function(e3,t3){return t3=qa.pow(t3),p2(e3.mul(t3)).div(t3)},bigint:e3=>e3,"bigint, number":(e3,t3)=>e3,"bigint, BigNumber":(e3,t3)=>e3,Fraction:function(e3){return e3.floor()},"Fraction, number":function(e3,t3){return e3.floor(t3)},"Fraction, BigNumber":function(e3,t3){return e3.floor(t3.toNumber())},"Unit, number, Unit":t2.referToSelf(n4=>function(e3,t3,r4){return e3=e3.toNumeric(r4),r4.multiply(n4(e3,t3))}),"Unit, BigNumber, Unit":t2.referToSelf(n4=>(e3,t3,r4)=>n4(e3,t3.toNumber(),r4)),"Array | Matrix, number | BigNumber, Unit":t2.referToSelf(n4=>(e3,t3,r4)=>le(e3,e4=>n4(e4,t3,r4),!0)),"Array | Matrix | Unit, Unit":t2.referToSelf(r4=>(e3,t3)=>r4(e3,0,t3)),"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3,!0)),"Array, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>le(e3,e4=>r4(e4,t3),!0)),"SparseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>u2(e3,t3,r4,!1)),"DenseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>c2(e3,t3,r4,!1)),"number | Complex | Fraction | BigNumber, Array":t2.referToSelf(r4=>(e3,t3)=>c2(n3(t3),e3,r4,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t2.referToSelf(r4=>(e3,t3)=>o2(e3,0)?s2(t3.size(),t3.storage()):(t3.storage()==="dense"?c2:l2)(t3,e3,r4,!0))})}),Ra=s("matAlgo02xDS0",["typed","equalScalar"],e2=>{let{typed:v2,equalScalar:w2}=e2;return function(e3,t2,r3,i2){var a2=e3._data,n3=e3._size,o2=e3._datatype||e3.getDataType(),s2=t2._values,u2=t2._index,l2=t2._ptr,c2=t2._size,f2=t2._datatype||t2._data===void 0?t2._datatype:t2.getDataType();if(n3.length!==c2.length)throw new z(n3.length,c2.length);if(n3[0]!==c2[0]||n3[1]!==c2[1])throw new RangeError("Dimension mismatch. Matrix A ("+n3+") must match Matrix B ("+c2+")");if(!s2)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var c2=n3[0],p2=n3[1];let m2,h2=w2,d2=0,g2=r3;typeof o2=="string"&&o2===f2&&o2!=="mixed"&&(m2=o2,h2=v2.find(w2,[m2,m2]),d2=v2.convert(0,m2),g2=v2.find(r3,[m2,m2]));let y2=[],x2=[],b2=[];for(let n4=0;n4{let v2=e2.typed;return function(e3,i2,t2,a2){var o2=e3._data,r3=e3._size,n3=e3._datatype||e3.getDataType(),s2=i2._values,u2=i2._index,l2=i2._ptr,c2=i2._size,f2=i2._datatype||i2._data===void 0?i2._datatype:i2.getDataType();if(r3.length!==c2.length)throw new z(r3.length,c2.length);if(r3[0]!==c2[0]||r3[1]!==c2[1])throw new RangeError("Dimension mismatch. Matrix A ("+r3+") must match Matrix B ("+c2+")");if(!s2)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var p2=r3[0],m2=r3[1];let h2,d2=0,g2=t2;typeof n3=="string"&&n3===f2&&n3!=="mixed"&&(h2=n3,d2=v2.convert(0,h2),g2=v2.find(t2,[h2,h2]));let y2=[];for(let e4=0;e4{let{typed:B2,equalScalar:F2}=e2;return function(e3,t2,r3){var n3=e3._values,i2=e3._index,a2=e3._ptr,o2=e3._size,s2=e3._datatype||e3._data===void 0?e3._datatype:e3.getDataType(),u2=t2._values,l2=t2._index,c2=t2._ptr,f2=t2._size,p2=t2._datatype||t2._data===void 0?t2._datatype:t2.getDataType();if(o2.length!==f2.length)throw new z(o2.length,f2.length);if(o2[0]!==f2[0]||o2[1]!==f2[1])throw new RangeError("Dimension mismatch. Matrix A ("+o2+") must match Matrix B ("+f2+")");var f2=o2[0],m2=o2[1];let h2,d2=F2,g2=0,y2=r3;typeof s2=="string"&&s2===p2&&s2!=="mixed"&&(h2=s2,d2=B2.find(F2,[h2,h2]),g2=B2.convert(0,h2),y2=B2.find(r3,[h2,h2]));let x2=n3&&u2?[]:void 0,b2=[],v2=[],w2=x2?[]:void 0,N2=x2?[]:void 0,A2=[],E2=[],S2,M2,C2,T2;for(M2=0;M2{let p2=e2.typed;return function(e3,t2,r3){let n3=e3._data,i2=e3._size,a2=e3._datatype,o2=t2._data,s2=t2._size,u2=t2._datatype,l2=[];if(i2.length!==s2.length)throw new z(i2.length,s2.length);for(let e4=0;e4{var t3=r3;return De(e3.size(),t3)?e3:e3.create(Gn(e3.valueOf(),t3),e3.datatype())})}let C=s("matrixAlgorithmSuite",["typed","matrix"],e2=>{let{typed:o2,matrix:s2}=e2,u2=ja({typed:o2}),l2=Ea({typed:o2});return function(n3){let r3=n3.elop,i2=n3.SD||n3.DS,e3;r3?(e3={"DenseMatrix, DenseMatrix":(e4,t3)=>u2(...La(e4,t3),r3),"Array, Array":(e4,t3)=>u2(...La(s2(e4),s2(t3)),r3).valueOf(),"Array, DenseMatrix":(e4,t3)=>u2(...La(s2(e4),t3),r3),"DenseMatrix, Array":(e4,t3)=>u2(...La(e4,s2(t3)),r3)},n3.SS&&(e3["SparseMatrix, SparseMatrix"]=(e4,t3)=>n3.SS(...La(e4,t3),r3,!1)),n3.DS&&(e3["DenseMatrix, SparseMatrix"]=(e4,t3)=>n3.DS(...La(e4,t3),r3,!1),e3["Array, SparseMatrix"]=(e4,t3)=>n3.DS(...La(s2(e4),t3),r3,!1)),i2&&(e3["SparseMatrix, DenseMatrix"]=(e4,t3)=>i2(...La(t3,e4),r3,!0),e3["SparseMatrix, Array"]=(e4,t3)=>i2(...La(s2(t3),e4),r3,!0))):(e3={"DenseMatrix, DenseMatrix":o2.referToSelf(r4=>(e4,t3)=>u2(...La(e4,t3),r4)),"Array, Array":o2.referToSelf(r4=>(e4,t3)=>u2(...La(s2(e4),s2(t3)),r4).valueOf()),"Array, DenseMatrix":o2.referToSelf(r4=>(e4,t3)=>u2(...La(s2(e4),t3),r4)),"DenseMatrix, Array":o2.referToSelf(r4=>(e4,t3)=>u2(...La(e4,s2(t3)),r4))},n3.SS&&(e3["SparseMatrix, SparseMatrix"]=o2.referToSelf(r4=>(e4,t3)=>n3.SS(...La(e4,t3),r4,!1))),n3.DS&&(e3["DenseMatrix, SparseMatrix"]=o2.referToSelf(r4=>(e4,t3)=>n3.DS(...La(e4,t3),r4,!1)),e3["Array, SparseMatrix"]=o2.referToSelf(r4=>(e4,t3)=>n3.DS(...La(s2(e4),t3),r4,!1))),i2&&(e3["SparseMatrix, DenseMatrix"]=o2.referToSelf(r4=>(e4,t3)=>i2(...La(t3,e4),r4,!0)),e3["SparseMatrix, Array"]=o2.referToSelf(r4=>(e4,t3)=>i2(...La(s2(t3),e4),r4,!0))));var t2=n3.scalar||"any";(n3.Ds||n3.Ss)&&(r3?(e3["DenseMatrix,"+t2]=(e4,t3)=>l2(e4,t3,r3,!1),e3[t2+", DenseMatrix"]=(e4,t3)=>l2(t3,e4,r3,!0),e3["Array,"+t2]=(e4,t3)=>l2(s2(e4),t3,r3,!1).valueOf(),e3[t2+", Array"]=(e4,t3)=>l2(s2(t3),e4,r3,!0).valueOf()):(e3["DenseMatrix,"+t2]=o2.referToSelf(r4=>(e4,t3)=>l2(e4,t3,r4,!1)),e3[t2+", DenseMatrix"]=o2.referToSelf(r4=>(e4,t3)=>l2(t3,e4,r4,!0)),e3["Array,"+t2]=o2.referToSelf(r4=>(e4,t3)=>l2(s2(e4),t3,r4,!1).valueOf()),e3[t2+", Array"]=o2.referToSelf(r4=>(e4,t3)=>l2(s2(t3),e4,r4,!0).valueOf())));let a2=n3.sS!==void 0?n3.sS:n3.Ss;return r3?(n3.Ss&&(e3["SparseMatrix,"+t2]=(e4,t3)=>n3.Ss(e4,t3,r3,!1)),a2&&(e3[t2+", SparseMatrix"]=(e4,t3)=>a2(t3,e4,r3,!0))):(n3.Ss&&(e3["SparseMatrix,"+t2]=o2.referToSelf(r4=>(e4,t3)=>n3.Ss(e4,t3,r4,!1))),a2&&(e3[t2+", SparseMatrix"]=o2.referToSelf(r4=>(e4,t3)=>a2(t3,e4,r4,!0)))),r3&&r3.signatures&&Fe(e3,r3.signatures),e3}}),$a=s("mod",["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],e2=>{let{typed:t2,config:r3,round:n3,matrix:i2,equalScalar:a2,zeros:o2,DenseMatrix:s2,concat:u2}=e2,l2=ka({typed:t2,config:r3,round:n3,matrix:i2,equalScalar:a2,zeros:o2,DenseMatrix:s2}),c2=Ra({typed:t2,equalScalar:a2}),f2=Pa({typed:t2}),p2=Ua({typed:t2,equalScalar:a2}),m2=Aa({typed:t2,equalScalar:a2}),h2=x({typed:t2,DenseMatrix:s2});return t2("mod",{"number, number":function(e3,t3){return t3===0?e3:e3-t3*l2(e3/t3)},"BigNumber, BigNumber":function(e3,t3){return t3.isZero()?e3:e3.sub(t3.mul(l2(e3.div(t3))))},"bigint, bigint":function(e3,t3){return t3===0n?e3:e3<0?(r4=e3%t3)===0n?r4:r4+t3:e3%t3;var r4},"Fraction, Fraction":function(e3,t3){return t3.equals(0)?e3:e3.sub(t3.mul(l2(e3.div(t3))))}},C({typed:t2,matrix:i2,concat:u2})({SS:p2,DS:f2,SD:c2,Ss:m2,sS:h2}))}),Ha=s("matAlgo01xDSid",["typed"],e2=>{let w2=e2.typed;return function(n3,e3,t2,i2){var a2=n3._data,r3=n3._size,o2=n3._datatype||n3.getDataType(),s2=e3._values,u2=e3._index,l2=e3._ptr,c2=e3._size,f2=e3._datatype||e3._data===void 0?e3._datatype:e3.getDataType();if(r3.length!==c2.length)throw new z(r3.length,c2.length);if(r3[0]!==c2[0]||r3[1]!==c2[1])throw new RangeError("Dimension mismatch. Matrix A ("+r3+") must match Matrix B ("+c2+")");if(!s2)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");let p2=r3[0],m2=r3[1],h2=typeof o2=="string"&&o2!=="mixed"&&o2===f2?o2:void 0,d2=h2?w2.find(t2,[h2,h2]):t2,g2,y2,x2=[];for(g2=0;g2{let{typed:F2,equalScalar:D2}=e2;return function(e3,t2,r3){var n3=e3._values,i2=e3._index,a2=e3._ptr,o2=e3._size,s2=e3._datatype||e3._data===void 0?e3._datatype:e3.getDataType(),u2=t2._values,l2=t2._index,c2=t2._ptr,f2=t2._size,p2=t2._datatype||t2._data===void 0?t2._datatype:t2.getDataType();if(o2.length!==f2.length)throw new z(o2.length,f2.length);if(o2[0]!==f2[0]||o2[1]!==f2[1])throw new RangeError("Dimension mismatch. Matrix A ("+o2+") must match Matrix B ("+f2+")");var f2=o2[0],m2=o2[1];let h2,d2=D2,g2=0,y2=r3;typeof s2=="string"&&s2===p2&&s2!=="mixed"&&(h2=s2,d2=F2.find(D2,[h2,h2]),g2=F2.convert(0,h2),y2=F2.find(r3,[h2,h2]));let x2=n3&&u2?[]:void 0,b2=[],v2=[],w2=n3&&u2?[]:void 0,N2=n3&&u2?[]:void 0,A2=[],E2=[],S2,M2,C2,T2,B2;for(M2=0;M2{let{typed:d2,DenseMatrix:g2}=e2;return function(i2,t2,e3,r3){var a2=i2._values,o2=i2._index,s2=i2._ptr,n3=i2._size,i2=i2._datatype;if(!a2)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var u2=n3[0],l2=n3[1];let c2,f2=e3;typeof i2=="string"&&(c2=i2,t2=d2.convert(t2,c2),f2=d2.find(e3,[c2,c2]));let p2=[],m2=[],h2=[];for(let n4=0;n4Array.isArray(e3))}let Ya=s("gcd",["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],e2=>{let{typed:t2,matrix:r3,config:n3,round:i2,equalScalar:a2,zeros:o2,BigNumber:s2,DenseMatrix:u2,concat:l2}=e2,c2=$a({typed:t2,config:n3,round:i2,matrix:r3,equalScalar:a2,zeros:o2,DenseMatrix:u2,concat:l2}),f2=Ha({typed:t2}),p2=Ga({typed:t2,equalScalar:a2}),m2=Va({typed:t2,DenseMatrix:u2});return t2("gcd",{"number, number":function(e3,t3){if(!v(e3)||!v(t3))throw new Error("Parameters in function gcd must be integer numbers");for(var r4;t3!==0;)r4=c2(e3,t3),e3=t3,t3=r4;return e3<0?-e3:e3},"BigNumber, BigNumber":function(e3,t3){if(!e3.isInt()||!t3.isInt())throw new Error("Parameters in function gcd must be integer numbers");let r4=new s2(0);for(;!t3.isZero();){let r5=c2(e3,t3);e3=t3,t3=r5}return e3.lt(r4)?e3.neg():e3},"Fraction, Fraction":(e3,t3)=>e3.gcd(t3)},C({typed:t2,matrix:r3,concat:l2})({SS:p2,DS:f2,Ss:m2}),{"number | BigNumber | Fraction | Matrix | Array, number | BigNumber | Fraction | Matrix | Array, ...number | BigNumber | Fraction | Matrix | Array":t2.referToSelf(i3=>(e3,t3,r4)=>{let n4=i3(e3,t3);for(let e4=0;e4e3=>{if(e3.length===1&&Array.isArray(e3[0])&&Wa(e3[0]))return t3(...e3[0]);if(Wa(e3))return t3(...e3);throw new Za("gcd() supports only 1d matrices!")}),Matrix:t2.referToSelf(t3=>e3=>t3(e3.toArray()))})}),Ja=s("matAlgo06xS0S0",["typed","equalScalar"],e2=>{let{typed:v2,equalScalar:w2}=e2;return function(e3,r3,t2){var n3=e3._values,i2=e3._size,a2=e3._datatype||e3._data===void 0?e3._datatype:e3.getDataType(),o2=r3._values,s2=r3._size,u2=r3._datatype||r3._data===void 0?r3._datatype:r3.getDataType();if(i2.length!==s2.length)throw new z(i2.length,s2.length);if(i2[0]!==s2[0]||i2[1]!==s2[1])throw new RangeError("Dimension mismatch. Matrix A ("+i2+") must match Matrix B ("+s2+")");var s2=i2[0],l2=i2[1];let c2,f2=w2,p2=0,m2=t2;typeof a2=="string"&&a2===u2&&a2!=="mixed"&&(c2=a2,f2=v2.find(w2,[c2,c2]),p2=v2.convert(0,c2),m2=v2.find(t2,[c2,c2]));let h2=n3&&o2?[]:void 0,d2=[],g2=[],y2=h2?[]:void 0,x2=[],b2=[];for(let t3=0;t3{let{typed:t2,matrix:r3,equalScalar:n3,concat:i2}=e2,a2=Ra({typed:t2,equalScalar:n3}),o2=Ja({typed:t2,equalScalar:n3}),s2=Aa({typed:t2,equalScalar:n3}),u2=C({typed:t2,matrix:r3,concat:i2}),l2="number | BigNumber | Fraction | Matrix | Array",c2={};return c2[l2+`, ${l2}, ...`+l2]=t2.referToSelf(i3=>(e3,t3,r4)=>{let n4=i3(e3,t3);for(let e4=0;e4e3.lcm(t3)},u2({SS:o2,DS:a2,Ss:s2}),c2)});function Qa(t2,r3,n3,i2){return function(e2){if(0{let{typed:t2,config:r3,Complex:n3}=e2;function i2(e3){return e3.log().div(Math.LN10)}function a2(e3){return i2(new n3(e3,0))}return t2("log10",{number:function(e3){return(0<=e3||r3.predictable?ra:a2)(e3)},bigint:Qa(Ka,ra,r3,a2),Complex:i2,BigNumber:function(e3){return!e3.isNegative()||r3.predictable?e3.log():a2(e3.toNumber())},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),to=s("log2",["typed","config","Complex"],e2=>{let{typed:t2,config:r3,Complex:n3}=e2;function i2(e3){return a2(new n3(e3,0))}return t2("log2",{number:function(e3){return(0<=e3||r3.predictable?na:i2)(e3)},bigint:Qa(4,na,r3,i2),Complex:a2,BigNumber:function(e3){return!e3.isNegative()||r3.predictable?e3.log(2):i2(e3.toNumber())},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))});function a2(e3){var t3=Math.sqrt(e3.re*e3.re+e3.im*e3.im);return new n3(Math.log2?Math.log2(t3):Math.log(t3)/Math.LN2,Math.atan2(e3.im,e3.re)/Math.LN2)}}),ro=s("multiplyScalar",["typed"],e2=>{let t2=e2.typed;return t2("multiplyScalar",{"number, number":Zi,"Complex, Complex":function(e3,t3){return e3.mul(t3)},"BigNumber, BigNumber":function(e3,t3){return e3.times(t3)},"bigint, bigint":function(e3,t3){return e3*t3},"Fraction, Fraction":function(e3,t3){return e3.mul(t3)},"number | Fraction | BigNumber | Complex, Unit":(e3,t3)=>t3.multiply(e3),"Unit, number | Fraction | BigNumber | Complex | Unit":(e3,t3)=>e3.multiply(t3)})}),no="multiply",io=s(no,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],e2=>{let{typed:F2,matrix:i2,addScalar:D2,multiplyScalar:O2,equalScalar:N2,dot:a2}=e2,r3=Aa({typed:F2,equalScalar:N2}),n3=Ea({typed:F2});function o2(e3,t2){switch(e3.length){case 1:switch(t2.length){case 1:if(e3[0]!==t2[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e3[0]!==t2[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e3[0]+") must match Matrix rows ("+t2[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t2.length+" dimensions)")}break;case 2:switch(t2.length){case 1:if(e3[1]!==t2[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e3[1]+") must match Vector length ("+t2[0]+")");break;case 2:if(e3[1]!==t2[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e3[1]+") must match Matrix B rows ("+t2[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t2.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e3.length+" dimensions)")}}let s2=F2("_multiplyMatrixVector",{"DenseMatrix, any":function(e3,t2){var r4=e3._data,n4=e3._size,i3=e3._datatype||e3.getDataType(),a3=t2._data,o3=t2._datatype||t2.getDataType(),s3=n4[0],u3=n4[1];let l2,c2=D2,f2=O2;i3&&o3&&i3===o3&&typeof i3=="string"&&i3!=="mixed"&&(l2=i3,c2=F2.find(D2,[l2,l2]),f2=F2.find(O2,[l2,l2]));let p2=[];for(let e4=0;e4F3){let n5=0;for(let r5=0;r5(e3,t2)=>{o2(T(e3),T(t2));let r4=n4(i2(e3),i2(t2));return _(r4)?r4.valueOf():r4}),"Matrix, Matrix":function(e3,t2){var r4=e3.size(),n4=t2.size();return o2(r4,n4),(r4.length===1?n4.length===1?function(e4,t3){if(r4[0]===0)throw new Error("Cannot multiply two empty vectors");return a2(e4,t3)}:function(t3,r5){if(r5.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");{var a3=t3._data,o3=t3._size,s3=t3._datatype||t3.getDataType(),u3=r5._data,l2=r5._size,c2=r5._datatype||r5.getDataType(),f2=o3[0],p2=l2[1];let e4,n5=D2,i3=O2;s3&&c2&&s3===c2&&typeof s3=="string"&&s3!=="mixed"&&(e4=s3,n5=F2.find(D2,[e4,e4]),i3=F2.find(O2,[e4,e4]));let m2=[];for(let r6=0;r6(e3,t2)=>r4(e3,i2(t2))),"Array, Matrix":F2.referToSelf(r4=>(e3,t2)=>r4(i2(e3,t2.storage()),t2)),"SparseMatrix, any":function(e3,t2){return r3(e3,t2,O2,!1)},"DenseMatrix, any":function(e3,t2){return n3(e3,t2,O2,!1)},"any, SparseMatrix":function(e3,t2){return r3(t2,e3,O2,!0)},"any, DenseMatrix":function(e3,t2){return n3(t2,e3,O2,!0)},"Array, any":function(e3,t2){return n3(i2(e3),t2,O2,!1).valueOf()},"any, Array":function(e3,t2){return n3(i2(t2),e3,O2,!0).valueOf()},"any, any":O2,"any, any, ...any":F2.referToSelf(i3=>(e3,t2,r4)=>{let n4=i3(e3,t2);for(let e4=0;e4{let{typed:t2,matrix:n3,equalScalar:r3,BigNumber:u2,concat:i2}=e2,a2=Ha({typed:t2}),o2=Ra({typed:t2,equalScalar:r3}),s2=Ja({typed:t2,equalScalar:r3}),l2=Aa({typed:t2,equalScalar:r3}),c2=C({typed:t2,matrix:n3,concat:i2});function f2(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return t2(ao,{number:ia,"number, number":ia,BigNumber:e3=>p2(e3,new u2(2)),"BigNumber, BigNumber":p2,Complex:f2,"Complex, number":f2,Array:t2.referTo("DenseMatrix,number",t3=>e3=>t3(n3(e3),2).valueOf()),DenseMatrix:t2.referTo("DenseMatrix,number",t3=>e3=>t3(e3,2)),SparseMatrix:t2.referTo("SparseMatrix,number",t3=>e3=>t3(e3,2)),"SparseMatrix, SparseMatrix":t2.referToSelf(r4=>(e3,t3)=>{if(t3.density()===1)return s2(e3,t3,r4);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":t2.referToSelf(r4=>(e3,t3)=>{if(t3.density()===1)return a2(e3,t3,r4,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":t2.referTo("DenseMatrix,SparseMatrix",r4=>(e3,t3)=>r4(n3(e3),t3)),"number | BigNumber, SparseMatrix":t2.referToSelf(r4=>(e3,t3)=>{if(t3.density()===1)return l2(t3,e3,r4,!0);throw new Error("Root must be non-zero")})},c2({scalar:"number | BigNumber",SD:o2,Ss:l2,sS:!1}));function p2(e3,t3){let r4=u2.precision,n4=u2.clone({precision:r4+2}),i3=new u2(0),a3=new n4(1),o3=t3.isNegative();if((t3=o3?t3.neg():t3).isZero())throw new Error("Root must be non-zero");if(e3.isNegative()&&!t3.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(e3.isZero())return o3?new n4(1/0):0;if(!e3.isFinite())return o3?i3:e3;let s3=e3.abs().pow(a3.div(t3));return s3=e3.isNeg()?s3.neg():s3,new u2((o3?a3.div(s3):s3).toPrecision(r4))}}),so=s("sign",["typed","BigNumber","Fraction","complex"],e2=>{let{typed:r3,BigNumber:t2,complex:n3,Fraction:i2}=e2;return r3("sign",{number:aa,Complex:function(e3){return e3.im===0?n3(aa(e3.re)):e3.sign()},BigNumber:function(e3){return new t2(e3.cmp(0))},bigint:function(e3){return 0ne3=>le(e3,t3,!0)),Unit:r3.referToSelf(t3=>e3=>{if(e3._isDerived()||e3.units[0].unit.offset===0)return r3.find(t3,e3.valueType())(e3.value);throw new TypeError("sign is ambiguous for units with offset")})})}),uo=s("sqrt",["config","typed","Complex"],e2=>{let{config:t2,typed:r3,Complex:n3}=e2;return r3("sqrt",{number:i2,Complex:function(e3){return e3.sqrt()},BigNumber:function(e3){return!e3.isNegative()||t2.predictable?e3.sqrt():i2(e3.toNumber())},Unit:function(e3){return e3.pow(.5)}});function i2(e3){return isNaN(e3)?NaN:0<=e3||t2.predictable?Math.sqrt(e3):new n3(e3,0).sqrt()}}),lo=s("square",["typed"],e2=>{let t2=e2.typed;return t2("square",{number:oa,Complex:function(e3){return e3.mul(e3)},BigNumber:function(e3){return e3.times(e3)},bigint:function(e3){return e3*e3},Fraction:function(e3){return e3.mul(e3)},Unit:function(e3){return e3.pow(2)}})}),co="subtract",fo=s(co,["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],e2=>{let{typed:t2,matrix:r3,equalScalar:n3,subtractScalar:i2,DenseMatrix:a2,concat:o2}=e2,s2=Ha({typed:t2}),u2=Pa({typed:t2}),l2=Ua({typed:t2,equalScalar:n3}),c2=Va({typed:t2,DenseMatrix:a2}),f2=x({typed:t2,DenseMatrix:a2}),p2=C({typed:t2,matrix:r3,concat:o2});return t2(co,{"any, any":i2},p2({elop:i2,SS:l2,DS:s2,SD:u2,Ss:f2,sS:c2}))}),po=s("xgcd",["typed","config","matrix","BigNumber"],e2=>{let{typed:t2,config:p2,matrix:m2,BigNumber:h2}=e2;return t2("xgcd",{"number, number":function(e3,t3){return e3=sa(e3,t3),p2.matrix==="Array"?e3:m2(e3)},"BigNumber, BigNumber":function(e3,t3){let r3,n3,i2;var a2=new h2(0),o2=new h2(1);let s2,u2=a2,l2=o2,c2=o2,f2=a2;if(!e3.isInt()||!t3.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!t3.isZero();)n3=e3.div(t3).floor(),i2=e3.mod(t3),r3=u2,u2=l2.minus(n3.times(u2)),l2=r3,r3=c2,c2=f2.minus(n3.times(c2)),f2=r3,e3=t3,t3=i2;return s2=e3.lt(a2)?[e3.neg(),l2.neg(),f2.neg()]:[e3,e3.isZero()?0:l2,f2],p2.matrix==="Array"?s2:m2(s2)}})}),mo=s("invmod",["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],e2=>{let{typed:t2,BigNumber:a2,xgcd:o2,equal:s2,smaller:u2,mod:l2,add:c2,isInteger:f2}=e2;return t2("invmod",{"number, number":r3,"BigNumber, BigNumber":r3});function r3(e3,t3){if(!f2(e3)||!f2(t3))throw new Error("Parameters in function invmod must be integer numbers");if(e3=l2(e3,t3),s2(t3,0))throw new Error("Divisor must be non zero");let r4=o2(e3,t3),[n3,i2]=r4=r4.valueOf();return s2(n3,a2(1))?(i2=l2(i2,t3),i2=u2(i2,a2(0))?c2(i2,t3):i2):NaN}}),ho=s("matAlgo09xS0Sf",["typed","equalScalar"],e2=>{let{typed:T2,equalScalar:B2}=e2;return function(e3,t2,r3){var n3=e3._values,i2=e3._index,a2=e3._ptr,o2=e3._size,s2=e3._datatype||e3._data===void 0?e3._datatype:e3.getDataType(),u2=t2._values,l2=t2._index,c2=t2._ptr,f2=t2._size,p2=t2._datatype||t2._data===void 0?t2._datatype:t2.getDataType();if(o2.length!==f2.length)throw new z(o2.length,f2.length);if(o2[0]!==f2[0]||o2[1]!==f2[1])throw new RangeError("Dimension mismatch. Matrix A ("+o2+") must match Matrix B ("+f2+")");var f2=o2[0],m2=o2[1];let h2,d2=B2,g2=0,y2=r3;typeof s2=="string"&&s2===p2&&s2!=="mixed"&&(h2=s2,d2=T2.find(B2,[h2,h2]),g2=T2.convert(0,h2),y2=T2.find(r3,[h2,h2]));let x2=n3&&u2?[]:void 0,b2=[],v2=[],w2=x2?[]:void 0,N2=[],A2,E2,S2,M2,C2;for(E2=0;E2{let{typed:t2,matrix:r3,equalScalar:n3,multiplyScalar:i2,concat:a2}=e2,o2=Ra({typed:t2,equalScalar:n3}),s2=ho({typed:t2,equalScalar:n3}),u2=Aa({typed:t2,equalScalar:n3}),l2=C({typed:t2,matrix:r3,concat:a2});return t2(go,l2({elop:i2,SS:s2,DS:o2,Ss:u2}))});function xo(e2,t2){if(e2.isFinite()&&!e2.isInteger()||t2.isFinite()&&!t2.isInteger())throw new Error("Integers expected in function bitAnd");let r3=e2.constructor;if(e2.isNaN()||t2.isNaN())return new r3(NaN);if(e2.isZero()||t2.eq(-1)||e2.eq(t2))return e2;if(t2.isZero()||e2.eq(-1))return t2;if(!e2.isFinite()||!t2.isFinite()){if(!e2.isFinite()&&!t2.isFinite())return e2.isNegative()===t2.isNegative()?e2:new r3(0);if(!e2.isFinite())return t2.isNegative()?e2:e2.isNegative()?new r3(0):t2;if(!t2.isFinite())return e2.isNegative()?t2:t2.isNegative()?new r3(0):e2}return wo(e2,t2,function(e3,t3){return e3&t3})}function bo(e2){if(e2.isFinite()&&!e2.isInteger())throw new Error("Integer expected in function bitNot");let t2=e2.constructor,r3=t2.precision,n3=(t2.config({precision:1e9}),e2.plus(new t2(1)));return n3.s=-n3.s||null,t2.config({precision:r3}),n3}function vo(e2,t2){if(e2.isFinite()&&!e2.isInteger()||t2.isFinite()&&!t2.isInteger())throw new Error("Integers expected in function bitOr");let r3=e2.constructor;if(e2.isNaN()||t2.isNaN())return new r3(NaN);var n3=new r3(-1);return e2.isZero()||t2.eq(n3)||e2.eq(t2)?t2:t2.isZero()||e2.eq(n3)?e2:e2.isFinite()&&t2.isFinite()?wo(e2,t2,function(e3,t3){return e3|t3}):!e2.isFinite()&&!e2.isNegative()&&t2.isNegative()||e2.isNegative()&&!t2.isNegative()&&!t2.isFinite()?n3:e2.isNegative()&&t2.isNegative()?e2.isFinite()?e2:t2:e2.isFinite()?t2:e2}function wo(e2,t2,r3){let n3=e2.constructor,i2,a2;var o2=+(e2.s<0),s2=+(t2.s<0);if(o2){i2=No(bo(e2));for(let e3=0;e3e2)for(i2-=e2;i2--;)a2+="0";else i2>1,o2[e4]&=1)}return o2.reverse()}function Ao(e2,t2){if(e2.isFinite()&&!e2.isInteger()||t2.isFinite()&&!t2.isInteger())throw new Error("Integers expected in function bitXor");let r3=e2.constructor;if(e2.isNaN()||t2.isNaN())return new r3(NaN);if(e2.isZero())return t2;if(t2.isZero())return e2;if(e2.eq(t2))return new r3(0);var n3=new r3(-1);return e2.eq(n3)?bo(t2):t2.eq(n3)?bo(e2):e2.isFinite()&&t2.isFinite()?wo(e2,t2,function(e3,t3){return e3^t3}):e2.isFinite()||t2.isFinite()?new r3(e2.isNegative()===t2.isNegative()?1/0:-1/0):n3}function Eo(e2,t2){if(e2.isFinite()&&!e2.isInteger()||t2.isFinite()&&!t2.isInteger())throw new Error("Integers expected in function leftShift");let r3=e2.constructor;return e2.isNaN()||t2.isNaN()||t2.isNegative()&&!t2.isZero()?new r3(NaN):e2.isZero()||t2.isZero()?e2:e2.isFinite()||t2.isFinite()?t2.lt(55)?e2.times(Math.pow(2,t2.toNumber())+""):e2.times(new r3(2).pow(t2)):new r3(NaN)}function So(e2,t2){if(e2.isFinite()&&!e2.isInteger()||t2.isFinite()&&!t2.isInteger())throw new Error("Integers expected in function rightArithShift");let r3=e2.constructor;return e2.isNaN()||t2.isNaN()||t2.isNegative()&&!t2.isZero()?new r3(NaN):e2.isZero()||t2.isZero()?e2:t2.isFinite()?(t2.lt(55)?e2.div(Math.pow(2,t2.toNumber())+""):e2.div(new r3(2).pow(t2))).floor():e2.isNegative()?new r3(-1):e2.isFinite()?new r3(0):new r3(NaN)}var Mo="number, number";function Co(e2,t2){if(v(e2)&&v(t2))return e2&t2;throw new Error("Integers expected in function bitAnd")}function To(e2){if(v(e2))return~e2;throw new Error("Integer expected in function bitNot")}function Bo(e2,t2){if(v(e2)&&v(t2))return e2|t2;throw new Error("Integers expected in function bitOr")}function Fo(e2,t2){if(v(e2)&&v(t2))return e2^t2;throw new Error("Integers expected in function bitXor")}function Do(e2,t2){if(v(e2)&&v(t2))return e2<>t2;throw new Error("Integers expected in function rightArithShift")}function _o(e2,t2){if(v(e2)&&v(t2))return e2>>>t2;throw new Error("Integers expected in function rightLogShift")}Co.signature=Mo,To.signature="number",_o.signature=Oo.signature=Do.signature=Fo.signature=Bo.signature=Mo;let zo=s("bitAnd",["typed","matrix","equalScalar","concat"],e2=>{let{typed:t2,matrix:r3,equalScalar:n3,concat:i2}=e2,a2=Ra({typed:t2,equalScalar:n3}),o2=Ja({typed:t2,equalScalar:n3}),s2=Aa({typed:t2,equalScalar:n3}),u2=C({typed:t2,matrix:r3,concat:i2});return t2("bitAnd",{"number, number":Co,"BigNumber, BigNumber":xo,"bigint, bigint":(e3,t3)=>e3&t3},u2({SS:o2,DS:a2,Ss:s2}))}),qo=s("bitNot",["typed"],e2=>{let t2=e2.typed;return t2("bitNot",{number:To,BigNumber:bo,bigint:e3=>~e3,"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),Io=s("bitOr",["typed","matrix","equalScalar","DenseMatrix","concat"],e2=>{let{typed:t2,matrix:r3,equalScalar:n3,DenseMatrix:i2,concat:a2}=e2,o2=Ha({typed:t2}),s2=Ga({typed:t2,equalScalar:n3}),u2=Va({typed:t2,DenseMatrix:i2}),l2=C({typed:t2,matrix:r3,concat:a2});return t2("bitOr",{"number, number":Bo,"BigNumber, BigNumber":vo,"bigint, bigint":(e3,t3)=>e3|t3},l2({SS:s2,DS:o2,Ss:u2}))}),ko=s("matAlgo07xSSf",["typed","SparseMatrix"],e2=>{let{typed:b2,SparseMatrix:v2}=e2;return function(r3,n3,e3){var t2=r3._size,i2=r3._datatype||r3._data===void 0?r3._datatype:r3.getDataType(),a2=n3._size,o2=n3._datatype||n3._data===void 0?n3._datatype:n3.getDataType();if(t2.length!==a2.length)throw new z(t2.length,a2.length);if(t2[0]!==a2[0]||t2[1]!==a2[1])throw new RangeError("Dimension mismatch. Matrix A ("+t2+") must match Matrix B ("+a2+")");var s2=t2[0],u2=t2[1];let l2,c2=0,f2=e3;typeof i2=="string"&&i2===o2&&i2!=="mixed"&&(l2=i2,c2=b2.convert(0,l2),f2=b2.find(e3,[l2,l2]));let p2=[],m2=[],h2=new Array(u2+1).fill(0),d2=[],g2=[],y2=[],x2=[];for(let e4=0;e4{let{typed:t2,matrix:r3,DenseMatrix:n3,concat:i2,SparseMatrix:a2}=e2,o2=Pa({typed:t2}),s2=ko({typed:t2,SparseMatrix:a2}),u2=x({typed:t2,DenseMatrix:n3}),l2=C({typed:t2,matrix:r3,concat:i2});return t2("bitXor",{"number, number":Fo,"BigNumber, BigNumber":Ao,"bigint, bigint":(e3,t3)=>e3^t3},l2({SS:s2,DS:o2,Ss:u2}))}),Po=s("arg",["typed"],e2=>{let t2=e2.typed;return t2("arg",{number:function(e3){return Math.atan2(0,e3)},BigNumber:function(e3){return e3.constructor.atan2(0,e3)},Complex:function(e3){return e3.arg()},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),Uo=s("conj",["typed"],e2=>{let t2=e2.typed;return t2("conj",{"number | BigNumber | Fraction":e3=>e3,Complex:e3=>e3.conjugate(),Unit:t2.referToSelf(t3=>e3=>new e3.constructor(t3(e3.toNumeric()),e3.formatUnits())),"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),jo=s("im",["typed"],e2=>{let t2=e2.typed;return t2("im",{number:()=>0,"BigNumber | Fraction":e3=>e3.mul(0),Complex:e3=>e3.im,"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),Lo=s("re",["typed"],e2=>{let t2=e2.typed;return t2("re",{"number | BigNumber | Fraction":e3=>e3,Complex:e3=>e3.re,"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),$o="number, number";function Ho(e2){return!e2}function Go(e2,t2){return!(!e2&&!t2)}function Vo(e2,t2){return!!e2!=!!t2}function Zo(e2,t2){return!(!e2||!t2)}Ho.signature="number",Zo.signature=Vo.signature=Go.signature=$o;let Wo=s("not",["typed"],e2=>{let r3=e2.typed;return r3("not",{"null | undefined":()=>!0,number:Ho,Complex:function(e3){return e3.re===0&&e3.im===0},BigNumber:function(e3){return e3.isZero()||e3.isNaN()},bigint:e3=>!e3,Unit:r3.referToSelf(t2=>e3=>r3.find(t2,e3.valueType())(e3.value)),"Array | Matrix":r3.referToSelf(t2=>e3=>le(e3,t2))})}),Yo="nullish",Jo=s(Yo,["typed","matrix","size","flatten","deepEqual"],e2=>{let{typed:t2,matrix:n3,size:i2,flatten:a2,deepEqual:o2}=e2,s2=Pa({typed:t2}),u2=Ea({typed:t2}),l2=ja({typed:t2});return t2(Yo,{"number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any":(e3,t3)=>e3,"null, any":(e3,t3)=>t3,"undefined, any":(e3,t3)=>t3,"SparseMatrix, Array | Matrix":(e3,t3)=>{var r3=a2(i2(e3).valueOf()),t3=a2(i2(t3).valueOf());if(o2(r3,t3))return e3;throw new z(r3,t3)},"DenseMatrix, DenseMatrix":t2.referToSelf(r3=>(e3,t3)=>l2(e3,t3,r3)),"DenseMatrix, SparseMatrix":t2.referToSelf(r3=>(e3,t3)=>s2(e3,t3,r3,!1)),"DenseMatrix, Array":t2.referToSelf(r3=>(e3,t3)=>l2(e3,n3(t3),r3)),"DenseMatrix, any":t2.referToSelf(r3=>(e3,t3)=>u2(e3,t3,r3,!1)),"Array, Array":t2.referToSelf(r3=>(e3,t3)=>l2(n3(e3),n3(t3),r3).valueOf()),"Array, DenseMatrix":t2.referToSelf(r3=>(e3,t3)=>l2(n3(e3),t3,r3)),"Array, SparseMatrix":t2.referToSelf(r3=>(e3,t3)=>s2(n3(e3),t3,r3,!1)),"Array, any":t2.referToSelf(r3=>(e3,t3)=>u2(n3(e3),t3,r3,!1).valueOf())})}),Xo=s("or",["typed","matrix","equalScalar","DenseMatrix","concat"],e2=>{let{typed:t2,matrix:r3,equalScalar:n3,DenseMatrix:i2,concat:a2}=e2,o2=Pa({typed:t2}),s2=Ua({typed:t2,equalScalar:n3}),u2=x({typed:t2,DenseMatrix:i2}),l2=C({typed:t2,matrix:r3,concat:a2});return t2("or",{"number, number":Go,"Complex, Complex":function(e3,t3){return e3.re!==0||e3.im!==0||t3.re!==0||t3.im!==0},"BigNumber, BigNumber":function(e3,t3){return!e3.isZero()&&!e3.isNaN()||!t3.isZero()&&!t3.isNaN()},"bigint, bigint":Go,"Unit, Unit":t2.referToSelf(r4=>(e3,t3)=>r4(e3.value||0,t3.value||0))},l2({SS:s2,DS:o2,Ss:u2}))}),Qo=s("xor",["typed","matrix","DenseMatrix","concat","SparseMatrix"],e2=>{let{typed:t2,matrix:r3,DenseMatrix:n3,concat:i2,SparseMatrix:a2}=e2,o2=Pa({typed:t2}),s2=ko({typed:t2,SparseMatrix:a2}),u2=x({typed:t2,DenseMatrix:n3}),l2=C({typed:t2,matrix:r3,concat:i2});return t2("xor",{"number, number":Vo,"Complex, Complex":function(e3,t3){return(e3.re!==0||e3.im!==0)!=(t3.re!==0||t3.im!==0)},"bigint, bigint":Vo,"BigNumber, BigNumber":function(e3,t3){return(!e3.isZero()&&!e3.isNaN())!=(!t3.isZero()&&!t3.isNaN())},"Unit, Unit":t2.referToSelf(r4=>(e3,t3)=>r4(e3.value||0,t3.value||0))},l2({SS:s2,DS:o2,Ss:u2}))}),Ko=s("concat",["typed","matrix","isInteger"],e2=>{let{typed:t2,matrix:u2,isInteger:l2}=e2;return t2("concat",{"...Array | Matrix | number | BigNumber":function(e3){let t3;var r3=e3.length;let n3,i2=-1,a2=!1,o2=[];for(t3=0;t3n3)throw new En(i2,n3+1)}else{let e4=ee(u3).valueOf(),l3=T(e4);if(o2[t3]=e4,n3=i2,i2=l3.length-1,0{let{typed:t2,Index:n3,matrix:i2,range:a2}=e2;return t2("column",{"Matrix, number":r3,"Array, number":function(e3,t3){return r3(i2(ee(e3)),t3).valueOf()}});function r3(e3,t3){if(e3.size().length!==2)throw new Error("Only two dimensional matrix is supported");M(t3,e3.size()[1]);var r4=a2(0,e3.size()[0]),r4=new n3(r4,t3),t3=e3.subset(r4);return _(t3)?t3:i2([[t3]])}}),ts=s("count",["typed","size","prod"],e2=>{let{typed:t2,size:r3,prod:n3}=e2;return t2("count",{string:function(e3){return e3.length},"Matrix | Array":function(e3){return n3(r3(e3))}})}),rs=s("cross",["typed","matrix","subtract","multiply"],e2=>{let{typed:t2,matrix:r3,subtract:a2,multiply:o2}=e2;return t2("cross",{"Matrix, Matrix":function(e3,t3){return r3(n3(e3.toArray(),t3.toArray()))},"Matrix, Array":function(e3,t3){return r3(n3(e3.toArray(),t3))},"Array, Matrix":function(e3,t3){return r3(n3(e3,t3.toArray()))},"Array, Array":n3});function n3(e3,t3){var r4=Math.max(T(e3).length,T(t3).length);e3=On(e3),t3=On(t3);let n4=T(e3),i2=T(t3);if(n4.length!==1||i2.length!==1||n4[0]!==3||i2[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+n4.join(", ")+"], B = ["+i2.join(", ")+"])");return e3=[a2(o2(e3[1],t3[2]),o2(e3[2],t3[1])),a2(o2(e3[2],t3[0]),o2(e3[0],t3[2])),a2(o2(e3[0],t3[1]),o2(e3[1],t3[0]))],1{let{typed:t2,matrix:y2,DenseMatrix:x2,SparseMatrix:b2}=e2;return t2("diag",{Array:function(e3){return n3(e3,0,T(e3),null)},"Array, number":function(e3,t3){return n3(e3,t3,T(e3),null)},"Array, BigNumber":function(e3,t3){return n3(e3,t3.toNumber(),T(e3),null)},"Array, string":function(e3,t3){return n3(e3,0,T(e3),t3)},"Array, number, string":function(e3,t3,r3){return n3(e3,t3,T(e3),r3)},"Array, BigNumber, string":function(e3,t3,r3){return n3(e3,t3.toNumber(),T(e3),r3)},Matrix:function(e3){return n3(e3,0,e3.size(),e3.storage())},"Matrix, number":function(e3,t3){return n3(e3,t3,e3.size(),e3.storage())},"Matrix, BigNumber":function(e3,t3){return n3(e3,t3.toNumber(),e3.size(),e3.storage())},"Matrix, string":function(e3,t3){return n3(e3,0,e3.size(),t3)},"Matrix, number, string":function(e3,t3,r3){return n3(e3,t3,e3.size(),r3)},"Matrix, BigNumber, string":function(e3,t3,r3){return n3(e3,t3.toNumber(),e3.size(),r3)}});function n3(e3,t3,r3,n4){if(!v(t3))throw new TypeError("Second parameter in function diag must be an integer");var i2=0{let t2=e2.typed;return t2("filter",{"Array, function":as,"Matrix, function":function(e3,t3){return e3.create(as(e3.valueOf(),t3),e3.datatype())},"Array, RegExp":kn,"Matrix, RegExp":function(e3,t3){return e3.create(kn(e3.valueOf(),t3),e3.datatype())}})});function as(e2,t2){let n3=Yn(t2,e2,"filter");return n3.isUnary?In(e2,n3.fn):In(e2,function(e3,t3,r3){return n3.fn(e3,[t3],r3)})}let os="flatten",ss=s(os,["typed"],e2=>{let t2=e2.typed;return t2(os,{Array:function(e3){return E(e3)},Matrix:function(e3){return e3.create(E(e3.valueOf(),!0),e3.datatype())}})}),us="forEach",ls=s(us,["typed"],e2=>{let t2=e2.typed;return t2(us,{"Array, function":cs,"Matrix, function":function(e3,t3){e3.forEach(t3)}})});function cs(e2,t2){t2=Yn(t2,e2,us),Wn(e2,t2.fn,t2.isUnary)}let fs="getMatrixDataType",ps=s(fs,["typed"],e2=>{let t2=e2.typed;return t2(fs,{Array:function(e3){return jn(e3,K)},Matrix:function(e3){return e3.getDataType()}})}),ms="identity",hs=s(ms,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],e2=>{let{typed:t2,config:r3,matrix:n3,BigNumber:l2,DenseMatrix:c2,SparseMatrix:f2}=e2;return t2(ms,{"":function(){return r3.matrix==="Matrix"?n3([]):[]},string:function(e3){return n3(e3)},"number | BigNumber":function(e3){return a2(e3,e3,r3.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(e3,t3){return a2(e3,e3,t3)},"number | BigNumber, number | BigNumber":function(e3,t3){return a2(e3,t3,r3.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":a2,Array:function(e3){return i2(e3)},"Array, string":i2,Matrix:function(e3){return i2(e3.valueOf(),e3.storage())},"Matrix, string":function(e3,t3){return i2(e3.valueOf(),t3)}});function i2(e3,t3){switch(e3.length){case 0:return t3?n3(t3):[];case 1:return a2(e3[0],e3[0],t3);case 2:return a2(e3[0],e3[1],t3);default:throw new Error("Vector containing two values expected")}}function a2(e3,t3,r4){let n4=Q(e3)||Q(t3)?l2:null;if(Q(e3)&&(e3=e3.toNumber()),Q(t3)&&(t3=t3.toNumber()),!v(e3)||e3<1)throw new Error("Parameters in function identity must be positive integers");if(!v(t3)||t3<1)throw new Error("Parameters in function identity must be positive integers");var i3=n4?new l2(1):1,a3=n4?new n4(0):0,o2=[e3,t3];if(r4){if(r4==="sparse")return f2.diagonal(o2,i3,0,a3);if(r4==="dense")return c2.diagonal(o2,i3,0,a3);throw new TypeError(`Unknown matrix type "${r4}"`)}let s2=Tn([],o2,a3),u2=e3{let{typed:t2,matrix:r3,multiplyScalar:a2}=e2;return t2("kron",{"Matrix, Matrix":function(e3,t3){return r3(n3(e3.toArray(),t3.toArray()))},"Matrix, Array":function(e3,t3){return r3(n3(e3.toArray(),t3))},"Array, Matrix":function(e3,t3){return r3(n3(e3,t3.toArray()))},"Array, Array":n3});function n3(e3,r4){if(T(e3).length===1&&(e3=[e3]),T(r4).length===1&&(r4=[r4]),2{let h2=e2.typed;return h2("map",{"Array, function":d2,"Matrix, function":function(e3,t2){return e3.map(t2)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(e3,t2,n3)=>{{let l2=function(e4){switch(e4){case 0:return e5=>a2(...e5);case 1:return(e5,t3)=>a2(...e5,t3);case 2:return(e5,t3)=>a2(...e5,t3,...m2)}};var i2=[e3,t2,...n3.slice(0,n3.length-1)],a2=n3[n3.length-1];if(typeof a2!="function")throw new Error("Last argument must be a callback function");let c2=i2[0].isMatrix,f2=$n(...i2.map(e4=>e4.isMatrix?e4.size():T(e4))),p2=c2?(e4,t3)=>e4.get(t3):Vn,m2=c2?i2.map(e4=>e4.isMatrix?e4.create(Gn(e4.toArray(),f2),e4.datatype()):i2[0].create(Gn(e4.valueOf(),f2))):i2.map(e4=>e4.isMatrix?Gn(e4.toArray(),f2):Gn(e4,f2)),r3;if(h2.isTypedFunction(a2)){let i3=f2.map(()=>0),d3=m2.map(e4=>p2(e4,i3)),c3=(u2=a2,e3=d3,o2=i3,s2=m2,h2.resolve(u2,[...e3,o2,...s2])!==null?2:h2.resolve(u2,[...e3,o2])!==null?1:(h2.resolve(u2,e3),0));r3=l2(c3)}else{let h3=i2.length,d3=(s2=h3,(o2=a2).length>s2+1?2:o2.length===s2+1?1:0);r3=l2(d3)}var o2,s2,u2=(e4,t3)=>r3([e4,...m2.slice(1).map(e5=>p2(e5,t3))],t3);return c2?m2[0].map(u2):d2(m2[0],u2)}}});function d2(e3,t2){return t2=Yn(t2,e3,"map"),Zn(e3,t2.fn,t2.isUnary)}}),ys=s("diff",["typed","matrix","subtract","number"],e2=>{let{typed:t2,matrix:r3,subtract:i2,number:n3}=e2;return t2("diff",{"Array | Matrix":function(e3){return _(e3)?r3(o2(e3.toArray())):o2(e3)},"Array | Matrix, number":function(e3,t3){if(v(t3))return _(e3)?r3(a2(e3.toArray(),t3)):a2(e3,t3);throw new RangeError("Dimension must be a whole number")},"Array, BigNumber":t2.referTo("Array,number",r4=>(e3,t3)=>r4(e3,n3(t3))),"Matrix, BigNumber":t2.referTo("Matrix,number",r4=>(e3,t3)=>r4(e3,n3(t3)))});function a2(e3,t3){if(_(e3)&&(e3=e3.toArray()),!Array.isArray(e3))throw RangeError("Array/Matrix does not have that many dimensions");if(0{r4.push(a2(e4,t3-1))}),r4}if(t3===0)return o2(e3);throw RangeError("Cannot have negative dimension")}function o2(t3){let r4=[],n4=t3.length;for(let e3=1;e3{let{typed:t2,config:r3,matrix:i2,BigNumber:a2}=e2;return t2("ones",{"":function(){return r3.matrix==="Array"?n3([]):n3([],"default")},"...number | BigNumber | string":function(e3){var t3;return typeof e3[e3.length-1]=="string"?(t3=e3.pop(),n3(e3,t3)):r3.matrix==="Array"?n3(e3):n3(e3,"default")},Array:n3,Matrix:function(e3){var t3=e3.storage();return n3(e3.valueOf(),t3)},"Array | Matrix, string":function(e3,t3){return n3(e3.valueOf(),t3)}});function n3(e3,t3){let r4=(function(){let n5=!1;return e3.forEach(function(e4,t4,r5){Q(e4)&&(n5=!0,r5[t4]=e4.toNumber())}),n5})(),n4=r4?new a2(1):1;if(e3.forEach(function(e4){if(typeof e4!="number"||!v(e4)||e4<0)throw new Error("Parameters in function ones must be positive integers")}),t3){let r5=i2(t3);return 0{let{typed:t2,config:n3,matrix:r3,bignumber:i2,smaller:s2,smallerEq:u2,larger:l2,largerEq:c2,add:f2,isPositive:p2}=e2;return t2("range",{string:o2,"string, boolean":o2,number:function(e3){throw new TypeError("Too few arguments to function range(): "+e3)},boolean:function(e3){throw new TypeError(`Unexpected type of argument 1 to function range(): ${e3}, number|bigint|BigNumber|Fraction`)},"number, number":function(e3,t3){return a2(m2(e3,t3,1,!1))},"number, number, number":function(e3,t3,r4){return a2(m2(e3,t3,r4,!1))},"number, number, boolean":function(e3,t3,r4){return a2(m2(e3,t3,1,r4))},"number, number, number, boolean":function(e3,t3,r4,n4){return a2(m2(e3,t3,r4,n4))},"bigint, bigint|number":function(e3,t3){return a2(m2(e3,t3,1n,!1))},"number, bigint":function(e3,t3){return a2(m2(BigInt(e3),t3,1n,!1))},"bigint, bigint|number, bigint|number":function(e3,t3,r4){return a2(m2(e3,t3,BigInt(r4),!1))},"number, bigint, bigint|number":function(e3,t3,r4){return a2(m2(BigInt(e3),t3,BigInt(r4),!1))},"bigint, bigint|number, boolean":function(e3,t3,r4){return a2(m2(e3,t3,1n,r4))},"number, bigint, boolean":function(e3,t3,r4){return a2(m2(BigInt(e3),t3,1n,r4))},"bigint, bigint|number, bigint|number, boolean":function(e3,t3,r4,n4){return a2(m2(e3,t3,BigInt(r4),n4))},"number, bigint, bigint|number, boolean":function(e3,t3,r4,n4){return a2(m2(BigInt(e3),t3,BigInt(r4),n4))},"BigNumber, BigNumber":function(e3,t3){return a2(m2(e3,t3,new e3.constructor(1),!1))},"BigNumber, BigNumber, BigNumber":function(e3,t3,r4){return a2(m2(e3,t3,r4,!1))},"BigNumber, BigNumber, boolean":function(e3,t3,r4){return a2(m2(e3,t3,new e3.constructor(1),r4))},"BigNumber, BigNumber, BigNumber, boolean":function(e3,t3,r4,n4){return a2(m2(e3,t3,r4,n4))},"Fraction, Fraction":function(e3,t3){return a2(m2(e3,t3,1,!1))},"Fraction, Fraction, Fraction":function(e3,t3,r4){return a2(m2(e3,t3,r4,!1))},"Fraction, Fraction, boolean":function(e3,t3,r4){return a2(m2(e3,t3,1,r4))},"Fraction, Fraction, Fraction, boolean":function(e3,t3,r4,n4){return a2(m2(e3,t3,r4,n4))},"Unit, Unit, Unit":function(e3,t3,r4){return a2(m2(e3,t3,r4,!1))},"Unit, Unit, Unit, boolean":function(e3,t3,r4,n4){return a2(m2(e3,t3,r4,n4))}});function a2(e3){return n3.matrix==="Matrix"?r3?r3(e3):ws():e3}function o2(t3,e3){var r4=(function(){let e4=t3.split(":").map(function(e5){return Number(e5)});if(e4.some(function(e5){return isNaN(e5)}))return null;switch(e4.length){case 2:return{start:e4[0],end:e4[1],step:1};case 3:return{start:e4[0],end:e4[2],step:e4[1]};default:return null}})();if(r4)return n3.number==="BigNumber"?(i2===void 0&&bs(),a2(m2(i2(r4.start),i2(r4.end),i2(r4.step)))):a2(m2(r4.start,r4.end,r4.step,e3));throw new SyntaxError('String "'+t3+'" is no valid range')}function m2(e3,t3,r4,n4){let i3=[],a3=p2(r4)?n4?u2:s2:n4?c2:l2,o3=e3;for(;a3(o3,t3);)i3.push(o3),o3=f2(o3,r4);return i3}}),As="reshape",Es=s(As,["typed","isInteger","matrix"],e2=>{let{typed:t2,isInteger:r3}=e2;return t2(As,{"Matrix, Array":function(e3,t3){return e3.reshape(t3,!0)},"Array, Array":function(e3,t3){return t3.forEach(function(e4){if(!r3(e4))throw new TypeError("Invalid size for dimension: "+e4)}),Bn(e3,t3)}})}),Ss=s("resize",["config","matrix"],e2=>{let{config:s2,matrix:u2}=e2;return function(e3,t2,r3){if(arguments.length!==2&&arguments.length!==3)throw new Za("resize",arguments.length,2,3);if(Q((t2=_(t2)?t2.valueOf():t2)[0])&&(t2=t2.map(function(e4){return Q(e4)?e4.toNumber():e4})),_(e3))return e3.resize(t2,r3,!0);if(typeof e3=="string"){var n3=e3,i2=t2,a2=r3;if(a2!==void 0){if(typeof a2!="string"||a2.length!==1)throw new TypeError("Single character expected as defaultValue")}else a2=" ";if(i2.length!==1)throw new z(i2.length,1);var o2=i2[0];if(typeof o2!="number"||!v(o2))throw new TypeError("Invalid size, must contain positive integers (size: "+S(i2)+")");if(n3.length>o2)return n3.substring(0,o2);if(n3.length{let{typed:t2,multiply:n3,rotationMatrix:i2}=e2;return t2("rotate",{"Array , number | BigNumber | Complex | Unit":function(e3,t3){return a2(e3,2),n3(i2(t3),e3).toArray()},"Matrix , number | BigNumber | Complex | Unit":function(e3,t3){return a2(e3,2),n3(i2(t3),e3)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(e3,t3,r3){return a2(e3,3),n3(i2(t3,r3),e3)},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(e3,t3,r3){return a2(e3,3),n3(i2(t3,r3),e3)}});function a2(e3,t3){if(e3=Array.isArray(e3)?T(e3):e3.size(),2{let{typed:t2,config:n3,multiplyScalar:i2,addScalar:m2,unaryMinus:h2,norm:d2,BigNumber:g2,matrix:a2,DenseMatrix:r3,SparseMatrix:o2,cos:y2,sin:x2}=e2;return t2(Cs,{"":function(){return n3.matrix==="Matrix"?a2([]):[]},string:function(e3){return a2(e3)},"number | BigNumber | Complex | Unit":function(e3){return s2(e3,n3.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":s2,"number | BigNumber | Complex | Unit, Array":function(e3,t3){return t3=a2(t3),u2(t3),l2(e3,t3,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(e3,t3){u2(t3);var r4=t3.storage()||(n3.matrix==="Matrix"?"dense":void 0);return l2(e3,t3,r4)},"number | BigNumber | Complex | Unit, Array, string":function(e3,t3,r4){return t3=a2(t3),u2(t3),l2(e3,t3,r4)},"number | BigNumber | Complex | Unit, Matrix, string":function(e3,t3,r4){return u2(t3),l2(e3,t3,r4)}});function s2(e3,t3){var r4=Q(e3)?new g2(-1):-1,n4=y2(e3),e3=x2(e3);return v2([[n4,i2(r4,e3)],[e3,n4]],t3)}function u2(e3){if(e3=e3.size(),e3.length<1||e3[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function b2(e3){return e3.reduce((e4,t3)=>i2(e4,t3))}function v2(e3,t3){if(t3){if(t3==="sparse")return new o2(e3);if(t3==="dense")return new r3(e3);throw new TypeError(`Unknown matrix type "${t3}"`)}return e3}function l2(e3,t3,r4){var n4=d2(t3);if(n4===0)throw new RangeError("Rotation around zero vector");let i3=Q(e3)?g2:null,a3=i3?new i3(1):1,o3=i3?new i3(-1):-1,s3=i3?new i3(t3.get([0])/n4):t3.get([0])/n4,u3=i3?new i3(t3.get([1])/n4):t3.get([1])/n4,l3=i3?new i3(t3.get([2])/n4):t3.get([2])/n4,c2=y2(e3),f2=m2(a3,h2(c2)),p2=x2(e3);return v2([[m2(c2,b2([s3,s3,f2])),m2(b2([s3,u3,f2]),b2([o3,l3,p2])),m2(b2([s3,l3,f2]),b2([u3,p2]))],[m2(b2([s3,u3,f2]),b2([l3,p2])),m2(c2,b2([u3,u3,f2])),m2(b2([u3,l3,f2]),b2([o3,s3,p2]))],[m2(b2([s3,l3,f2]),b2([o3,u3,p2])),m2(b2([u3,l3,f2]),b2([s3,p2])),m2(c2,b2([l3,l3,f2]))]],r4)}}),Bs=s("row",["typed","Index","matrix","range"],e2=>{let{typed:t2,Index:n3,matrix:i2,range:a2}=e2;return t2("row",{"Matrix, number":r3,"Array, number":function(e3,t3){return r3(i2(ee(e3)),t3).valueOf()}});function r3(e3,t3){if(e3.size().length!==2)throw new Error("Only two dimensional matrix is supported");M(t3,e3.size()[0]);var r4=a2(0,e3.size()[1]),t3=new n3(t3,r4),r4=e3.subset(t3);return _(r4)?r4:i2([[r4]])}}),Fs=s("size",["typed","config","?matrix"],e2=>{let{typed:t2,config:r3,matrix:n3}=e2;return t2("size",{Matrix:function(e3){return e3.create(e3.size(),"number")},Array:T,string:function(e3){return r3.matrix==="Array"?[e3.length]:n3([e3.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(e3){return r3.matrix==="Array"?[]:n3?n3([],"dense","number"):ws()}})}),Ds="squeeze",Os=s(Ds,["typed"],e2=>{let t2=e2.typed;return t2(Ds,{Array:function(e3){return On(ee(e3))},Matrix:function(e3){var t3=On(e3.toArray());return Array.isArray(t3)?e3.create(t3,e3.datatype()):t3},any:ee})}),_s=s("subset",["typed","matrix","zeros","add"],e2=>{let{typed:t2,matrix:o2,zeros:i2,add:a2}=e2;return t2("subset",{"Matrix, Index":function(e3,t3){return Cn(t3)?o2():(Mn(e3,t3),e3.subset(t3))},"Array, Index":t2.referTo("Matrix, Index",function(n3){return function(e3,t3){let r3=n3(o2(e3),t3);return t3.isScalar()?r3:r3.valueOf()}}),"Object, Index":Is,"string, Index":zs,"Matrix, Index, any, any":function(e3,t3,r3,n3){return Cn(t3)?e3:(Mn(e3,t3),e3.clone().subset(t3,(function(e4,t4){if(typeof e4=="string")throw new Error("can't boradcast a string");if(t4._isScalar)return e4;let r4=t4.size();if(!r4.every(e5=>0a2)for(let e3=a2-1,t3=o2.length;e3{let{typed:t2,matrix:r3}=e2;return t2(Rs,{Array:e3=>n3(r3(e3)).valueOf(),Matrix:n3,any:ee});function n3(e3){var t3=e3.size();let r4;switch(t3.length){case 1:r4=e3.clone();break;case 2:var n4=t3[0],i2=t3[1];if(i2===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+S(t3)+")");switch(e3.storage()){case"dense":r4=(function(e4,r5,n5){let i3=e4._data,a2=[],o2;for(let t4=0;t4{let{typed:t2,transpose:r3,conj:n3}=e2;return t2(Us,{any:function(e3){return n3(r3(e3))}})}),Ls=s("zeros",["typed","config","matrix","BigNumber"],e2=>{let{typed:t2,config:r3,matrix:i2,BigNumber:a2}=e2;return t2("zeros",{"":function(){return r3.matrix==="Array"?n3([]):n3([],"default")},"...number | BigNumber | string":function(e3){var t3;return typeof e3[e3.length-1]=="string"?(t3=e3.pop(),n3(e3,t3)):r3.matrix==="Array"?n3(e3):n3(e3,"default")},Array:n3,Matrix:function(e3){var t3=e3.storage();return n3(e3.valueOf(),t3)},"Array | Matrix, string":function(e3,t3){return n3(e3.valueOf(),t3)}});function n3(e3,t3){let r4=(function(){let n5=!1;return e3.forEach(function(e4,t4,r5){Q(e4)&&(n5=!0,r5[t4]=e4.toNumber())}),n5})(),n4=r4?new a2(0):0;if(e3.forEach(function(e4){if(typeof e4!="number"||!v(e4)||e4<0)throw new Error("Parameters in function zeros must be positive integers")}),t3){let r5=i2(t3);return 0{let{typed:t2,addScalar:d2,multiplyScalar:g2,divideScalar:y2,exp:x2,tau:b2,i:v2,dotDivide:w2,conj:N2,pow:A2,ceil:E2,log2:S2}=e2;return t2("fft",{Array:M2,Matrix:function(e3){return e3.create(M2(e3.valueOf()),e3.datatype())}});function M2(e3){let t3=T(e3);return t3.length===1?C2(e3,t3[0]):(function r3(n3,i2){let e4=T(n3);if(i2!==0)return new Array(e4[0]).fill(0).map((e5,t5)=>r3(n3[t5],i2-1));if(e4.length===1)return C2(n3);function t4(n4){let t5=T(n4);return new Array(t5[1]).fill(0).map((e5,r4)=>new Array(t5[0]).fill(0).map((e6,t6)=>n4[t6][r4]))}return t4(r3(t4(n3),1))})(e3.map(e4=>M2(e4,t3.slice(1))),0)}function C2(e3){var t3=e3.length;if(t3===1)return[e3[0]];if(t3%2!=0){var r3=e3;let n3=r3.length,i2=x2(y2(g2(-1,g2(v2,b2)),n3)),a2=[];for(let e4=1-n3;e4g2(r3[t4],a2[n3-1+t4])),...new Array(o2-n3).fill(0)],u2=[...new Array(n3+n3-1).fill(0).map((e4,t4)=>y2(1,a2[t4])),...new Array(o2-(n3+n3-1)).fill(0)],l2=C2(s2),c2=C2(u2),f2=new Array(o2).fill(0).map((e4,t4)=>g2(l2[t4],c2[t4])),p2=w2(N2(M2(N2(f2))),o2),m2=[];for(let e4=n3-1;e4t4%2==0)),...C2(e3.filter((e4,t4)=>t4%2==1))];for(let e4=0;e4{let{typed:t2,fft:r3,dotDivide:n3,conj:i2}=e2;return t2("ifft",{"Array | Matrix":function(e3){let t3=_(e3)?e3.size():T(e3);return n3(i2(r3(i2(e3))),t3.reduce((e4,t4)=>e4*t4,1))}})}),Gs=s("solveODE",["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],e2=>{let{typed:t2,add:T2,subtract:B2,multiply:F2,divide:D2,max:O2,map:_2,abs:z2,isPositive:q2,isNegative:I2,larger:k2,smaller:R2,matrix:a2,bignumber:P2,unaryMinus:U2}=e2;function i2(C2){return function(t3,e3,r3,n4){if(e3.length!==2||!e3.every(j2)&&!e3.every(L))throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');let i3=e3[0],a3=e3[1],o3=k2(a3,i3),s3=n4.firstStep;if(s3!==void 0&&!q2(s3))throw new Error('"firstStep" must be positive');let u3=n4.maxStep;if(u3!==void 0&&!q2(u3))throw new Error('"maxStep" must be positive');let l2=n4.minStep;if(l2&&I2(l2))throw new Error('"minStep" must be positive or zero');let c2=[i3,a3,s3,l2,u3].filter(e4=>e4!==void 0);if(!c2.every(j2)&&!c2.every(L))throw new Error('Inconsistent type of "t" dependant variables');var f2=n4.tol||1e-4,p2=n4.minDelta||.2,m2=n4.maxDelta||5,h2=n4.maxIter||1e4,d2=[i3,a3,...r3,u3,l2].some(Q),[g2,y2,x2,e3]=d2?[P2(C2.a),P2(C2.c),P2(C2.b),P2(C2.bp)]:[C2.a,C2.c,C2.b,C2.bp];let b2=s3?o3?s3:U2(s3):D2(B2(a3,i3),1),v2=[i3],w2=[r3],N2=B2(x2,e3),A2=0,E2=0,S2=o3?R2:k2,M2=(function(){let i4=o3?k2:R2;return function(e4,t4,r4){var n5=T2(e4,r4);return i4(n5,t4)?B2(t4,e4):r4}})();for(;S2(v2[A2],a3);){let C3=[];b2=M2(v2[A2],a3,b2),C3.push(t3(v2[A2],w2[A2]));for(let e5=1;e5L(e5)?e5.value:e5)));B3h2)throw new Error("Maximum number of iterations reached, try changing options")}return{t:v2,y:w2}}}function s2(e3,t3,r3,n4){return i2({a:[[],[.5],[0,.75],[2/9,1/3,4/9]],c:[null,.5,.75,1],b:[2/9,1/3,4/9,0],bp:[7/24,.25,1/3,1/8]})(e3,t3,r3,n4)}function u2(e3,t3,r3,n4){return i2({a:[[],[.2],[.075,.225],[44/45,-56/15,32/9],[19372/6561,-25360/2187,64448/6561,-212/729],[9017/3168,-355/33,46732/5247,49/176,-5103/18656],[35/384,0,500/1113,125/192,-2187/6784,11/84]],c:[null,.2,.3,.8,8/9,1,1],b:[35/384,0,500/1113,125/192,-2187/6784,11/84,0],bp:[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,.025]})(e3,t3,r3,n4)}function o2(e3,t3,r3,n4){let i3=n4.method||"RK45",a3={RK23:s2,RK45:u2};if(i3.toUpperCase()in a3){let o3={...n4};return delete o3.method,a3[i3.toUpperCase()](e3,t3,r3,o3)}{let e4=Object.keys(a3).map(e5=>`"${e5}"`),t4=e4.slice(0,-1).join(", ")+" and "+e4.slice(-1);throw new Error(`Unavailable method "${i3}". Available methods are `+t4)}}function j2(e3){return Q(e3)||A(e3)}function n3(e3,t3,r3,n4){return e3=o2(e3,t3.toArray(),r3.toArray(),n4),{t:a2(e3.t),y:a2(e3.y)}}return t2("solveODE",{"function, Array, Array, Object":o2,"function, Matrix, Matrix, Object":n3,"function, Array, Array":(e3,t3,r3)=>o2(e3,t3,r3,{}),"function, Matrix, Matrix":(e3,t3,r3)=>n3(e3,t3,r3,{}),"function, Array, number | BigNumber | Unit":(e3,t3,r3)=>{let n4=o2(e3,t3,[r3],{});return{t:n4.t,y:n4.y.map(e4=>e4[0])}},"function, Matrix, number | BigNumber | Unit":(e3,t3,r3)=>{let n4=o2(e3,t3.toArray(),[r3],{});return{t:a2(n4.t),y:a2(n4.y.map(e4=>e4[0]))}},"function, Array, number | BigNumber | Unit, Object":(e3,t3,r3,n4)=>{let i3=o2(e3,t3,[r3],n4);return{t:i3.t,y:i3.y.map(e4=>e4[0])}},"function, Matrix, number | BigNumber | Unit, Object":(e3,t3,r3,n4)=>{let i3=o2(e3,t3.toArray(),[r3],n4);return{t:a2(i3.t),y:a2(i3.y.map(e4=>e4[0]))}}})}),Vs=s("erf",["typed"],e2=>{let t2=e2.typed;return t2("name",{number:function(e3){var t3=Math.abs(e3);return t3>=Xs?ke(e3):t3<=Zs?ke(e3)*(function(e4){var t4=e4*e4;let r3,n3=Ys[0][4]*t4,i2=t4;for(r3=0;r3<3;r3+=1)n3=(n3+Ys[0][r3])*t4,i2=(i2+Js[0][r3])*t4;return e4*(n3+Ys[0][3])/(i2+Js[0][3])})(t3):t3<=4?ke(e3)*(1-(function(e4){let t4,r3=Ys[1][8]*e4,n3=e4;for(t4=0;t4<7;t4+=1)r3=(r3+Ys[1][t4])*e4,n3=(n3+Js[1][t4])*e4;var i2=(r3+Ys[1][7])/(n3+Js[1][7]),a2=parseInt(16*e4)/16,o2=(e4-a2)*(e4+a2);return Math.exp(-a2*a2)*Math.exp(-o2)*i2})(t3)):ke(e3)*(1-(function(e4){let t4,r3=1/(e4*e4),n3=Ys[2][5]*r3,i2=r3;for(t4=0;t4<4;t4+=1)n3=(n3+Ys[2][t4])*r3,i2=(i2+Js[2][t4])*r3;var a2=r3*(n3+Ys[2][4])/(i2+Js[2][4]),a2=(Ws-a2)/e4,e4=(e4-(r3=parseInt(16*e4)/16))*(e4+r3);return Math.exp(-r3*r3)*Math.exp(-e4)*a2})(t3))},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),Zs=.46875,Ws=.5641895835477563,Ys=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Js=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],Xs=Math.pow(2,53),Qs=s("zeta",["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],e2=>{let{typed:t2,config:r3,multiply:u2,pow:l2,divide:c2,factorial:i2,equal:n3,smallerEq:f2,isNegative:a2,gamma:p2,sin:m2,subtract:h2,add:d2,Complex:o2,BigNumber:s2,pi:g2}=e2;return t2("zeta",{number:e3=>y2(e3,e4=>e4,()=>20),BigNumber:e3=>y2(e3,e4=>new s2(e4),()=>Math.abs(Math.log10(r3.relTol))),Complex:function(e3){return e3.re===0&&e3.im===0?new o2(-.5):e3.re===1?new o2(NaN,NaN):e3.re===1/0&&e3.im===0?new o2(1):e3.im===1/0||e3.re===-1/0?new o2(NaN,NaN):x2(e3,e4=>e4,e4=>Math.round(19.5+.9*Math.abs(e4.im)),e4=>e4.re)}});function y2(e3,t3,r4){return n3(e3,0)?t3(-.5):n3(e3,1)?t3(NaN):isFinite(e3)?x2(e3,t3,r4,e4=>e4):a2(e3)?t3(NaN):t3(1)}function x2(e3,r4,t3,n4){var i3=t3(e3);{if(n4(e3)>-(i3-1)/2){var a3=e3,o3=r4(i3),i3=r4,s3=c2(1,u2(b2(i3(0),o3),h2(1,l2(2,h2(1,a3)))));let t4=i3(0);for(let e4=i3(1);f2(e4,o3);e4=d2(e4,1))t4=d2(t4,c2(u2((-1)**(e4-1),b2(e4,o3)),l2(e4,a3)));return u2(s3,t4)}return i3=u2(l2(2,e3),l2(r4(g2),h2(e3,1))),i3=u2(i3,m2(u2(c2(r4(g2),2),e3))),i3=u2(i3,p2(h2(1,e3))),u2(i3,x2(h2(1,e3),r4,t3,n4))}}function b2(t3,r4){let n4=t3;for(let e3=t3;f2(e3,r4);e3=d2(e3,1)){let t4=c2(u2(i2(d2(r4,h2(e3,1))),l2(4,e3)),u2(i2(h2(r4,e3)),i2(u2(2,e3))));n4=d2(n4,t4)}return u2(r4,n4)}}),Ks=s("mode",["typed","isNaN","isNumeric"],e2=>{let{typed:t2,isNaN:o2,isNumeric:s2}=e2;return t2("mode",{"Array | Matrix":r3,"...":r3});function r3(t3){if((t3=E(t3.valueOf())).length===0)throw new Error("Cannot calculate mode of an empty array");let r4={},n3=[],i2=0;for(let e3=0;e3i2&&(i2=r4[a2],n3=[a2])}return n3}});function eu(e2,t2,r3){let n3;return String(e2).includes("Unexpected type")?(n3=2{let{typed:t2,config:n3,multiplyScalar:i2,numeric:a2}=e2;return t2("prod",{"Array | Matrix":r3,"Array | Matrix, number | BigNumber":function(e3,t3){throw new Error("prod(A, dim) is not yet supported")},"...":r3});function r3(e3){let r4;if(ti(e3,function(t3){try{r4=r4===void 0?t3:i2(r4,t3)}catch(e4){throw eu(e4,"prod",t3)}}),(r4=typeof r4=="string"?a2(r4,Ie(r4,n3)):r4)===void 0)throw new Error("Cannot calculate prod of an empty array");return r4}}),ru=s("format",["typed"],e2=>{let t2=e2.typed;return t2("format",{any:S,"any, Object | function | number | BigNumber":S})}),nu=s("bin",["typed","format"],e2=>{let{typed:t2,format:r3}=e2;return t2("bin",{"number | BigNumber":function(e3){return r3(e3,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(e3,t3){return r3(e3,{notation:"bin",wordSize:t3})}})}),iu=s("oct",["typed","format"],e2=>{let{typed:t2,format:r3}=e2;return t2("oct",{"number | BigNumber":function(e3){return r3(e3,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(e3,t3){return r3(e3,{notation:"oct",wordSize:t3})}})}),au=s("hex",["typed","format"],e2=>{let{typed:t2,format:r3}=e2;return t2("hex",{"number | BigNumber":function(e3){return r3(e3,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(e3,t3){return r3(e3,{notation:"hex",wordSize:t3})}})}),ou=/\$([\w.]+)/g,su=s("print",["typed"],e2=>{let t2=e2.typed;return t2("print",{"string, Object | Array":uu,"string, Object | Array, number | Object":uu})});function uu(e2,i2,a2){return e2.replace(ou,function(e3,t2){let r3=t2.split("."),n3=i2[r3.shift()];for(n3!==void 0&&n3.isMatrix&&(n3=n3.toArray());r3.length&&n3!==void 0;){let e4=r3.shift();n3=e4?n3[e4]:n3+"."}return n3!==void 0?j(n3)?n3:S(n3,a2):e3})}let lu=s("to",["typed","matrix","concat"],e2=>{let{typed:t2,matrix:r3,concat:n3}=e2;return t2("to",{"Unit, Unit | string":(e3,t3)=>e3.to(t3)},C({typed:t2,matrix:r3,concat:n3})({Ds:!0}))}),cu=s("toBest",["typed"],e2=>{let t2=e2.typed;return t2("toBest",{Unit:e3=>e3.toBest(),"Unit, string":(e3,t3)=>e3.toBest(t3.split(",")),"Unit, string, Object":(e3,t3,r3)=>e3.toBest(t3.split(","),r3),"Unit, Array":(e3,t3)=>e3.toBest(t3),"Unit, Array, Object":(e3,t3,r3)=>e3.toBest(t3,r3)})}),fu="isPrime",pu=s(fu,["typed"],e2=>{let t2=e2.typed;return t2(fu,{number:function(t3){if(t3<=3)return 1e4e3=>le(e3,t3))})}),mu=s("numeric",["number","?bignumber","?fraction"],e2=>{let{number:t2,bignumber:r3,fraction:n3}=e2,i2={string:!0,number:!0,BigNumber:!0,Fraction:!0},a2={number:e3=>t2(e3),BigNumber:r3?e3=>r3(e3):bs,bigint:e3=>BigInt(e3),Fraction:n3?e3=>n3(e3):vs};return function(e3){var t3=1{let t2=e2.typed;return t2(hu,{"number, number":function(e3,t3){return e3/t3},"Complex, Complex":function(e3,t3){return e3.div(t3)},"BigNumber, BigNumber":function(e3,t3){return e3.div(t3)},"bigint, bigint":function(e3,t3){return e3/t3},"Fraction, Fraction":function(e3,t3){return e3.div(t3)},"Unit, number | Complex | Fraction | BigNumber | Unit":(e3,t3)=>e3.divide(t3),"number | Fraction | Complex | BigNumber, Unit":(e3,t3)=>t3.divideInto(e3)})}),gu=s("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],e2=>{let{typed:t2,config:n3,identity:a2,multiply:o2,matrix:r3,inv:s2,number:i2,fraction:u2,Complex:l2}=e2;return t2("pow",{"number, number":c2,"Complex, Complex":function(e3,t3){return e3.pow(t3)},"BigNumber, BigNumber":function(e3,t3){return t3.isInteger()||0<=e3||n3.predictable?e3.pow(t3):new l2(e3.toNumber(),0).pow(t3.toNumber(),0)},"bigint, bigint":(e3,t3)=>e3**t3,"Fraction, Fraction":function(e3,t3){var r4=e3.pow(t3);if(r4!=null)return r4;if(n3.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c2(e3.valueOf(),t3.valueOf())},"Array, number":f2,"Array, BigNumber":function(e3,t3){return f2(e3,t3.toNumber())},"Matrix, number":p2,"Matrix, BigNumber":function(e3,t3){return p2(e3,t3.toNumber())},"Unit, number | BigNumber":function(e3,t3){return e3.pow(t3)}});function c2(e3,t3){if(n3.predictable&&!v(t3)&&e3<0)try{let n4=u2(t3),r4=i2(n4);if((t3===r4||Math.abs((t3-r4)/t3)<1e-14)&&n4.d%2n===1n)return(n4.n%2n===0n?1:-1)*Math.pow(-e3,t3)}catch{}return n3.predictable&&(e3<-1&&t3===1/0||-1>=1,i3=o2(i3,i3);return n4}function p2(e3,t3){return r3(f2(e3.valueOf(),t3))}}),yu="Number of decimals in function round must be an integer",xu=s("round",["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],e2=>{let{typed:t2,config:i2,matrix:n3,equalScalar:a2,zeros:o2,BigNumber:r3,DenseMatrix:s2}=e2,u2=Aa({typed:t2,equalScalar:a2}),l2=x({typed:t2,DenseMatrix:s2}),c2=Ea({typed:t2});function f2(e3){return Math.abs(Ve(e3).exponent)}return t2("round",{number:function(e3){var t3=la(e3,f2(i2.relTol));return la(Xe(e3,t3,i2.relTol,i2.absTol)?t3:e3)},"number, number":function(e3,t3){var r4=f2(i2.relTol);return r4<=t3?la(e3,t3):(r4=la(e3,r4),la(Xe(e3,r4,i2.relTol,i2.absTol)?r4:e3,t3))},"number, BigNumber":function(e3,t3){if(t3.isInteger())return new r3(e3).toDecimalPlaces(t3.toNumber());throw new TypeError(yu)},Complex:function(e3){return e3.round()},"Complex, number":function(e3,t3){if(t3%1)throw new TypeError(yu);return e3.round(t3)},"Complex, BigNumber":function(e3,t3){if(!t3.isInteger())throw new TypeError(yu);return t3=t3.toNumber(),e3.round(t3)},BigNumber:function(e3){let t3=new r3(e3).toDecimalPlaces(f2(i2.relTol));return(li(e3,t3,i2.relTol,i2.absTol)?t3:e3).toDecimalPlaces(0)},"BigNumber, BigNumber":function(e3,t3){if(!t3.isInteger())throw new TypeError(yu);var r4=f2(i2.relTol);if(r4<=t3)return e3.toDecimalPlaces(t3.toNumber());let n4=e3.toDecimalPlaces(r4);return(li(e3,n4,i2.relTol,i2.absTol)?n4:e3).toDecimalPlaces(t3.toNumber())},bigint:e3=>e3,"bigint, number":(e3,t3)=>e3,"bigint, BigNumber":(e3,t3)=>e3,Fraction:function(e3){return e3.round()},"Fraction, number":function(e3,t3){if(t3%1)throw new TypeError(yu);return e3.round(t3)},"Fraction, BigNumber":function(e3,t3){if(t3.isInteger())return e3.round(t3.toNumber());throw new TypeError(yu)},"Unit, number, Unit":t2.referToSelf(n4=>function(e3,t3,r4){return e3=e3.toNumeric(r4),r4.multiply(n4(e3,t3))}),"Unit, BigNumber, Unit":t2.referToSelf(n4=>(e3,t3,r4)=>n4(e3,t3.toNumber(),r4)),"Array | Matrix, number | BigNumber, Unit":t2.referToSelf(n4=>(e3,t3,r4)=>le(e3,e4=>n4(e4,t3,r4),!0)),"Array | Matrix | Unit, Unit":t2.referToSelf(r4=>(e3,t3)=>r4(e3,0,t3)),"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3,!0)),"SparseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>u2(e3,t3,r4,!1)),"DenseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>c2(e3,t3,r4,!1)),"Array, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>c2(n3(e3),t3,r4,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t2.referToSelf(r4=>(e3,t3)=>a2(e3,0)?o2(t3.size(),t3.storage()):l2(t3,e3,r4,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t2.referToSelf(r4=>(e3,t3)=>a2(e3,0)?o2(t3.size(),t3.storage()):c2(t3,e3,r4,!0)),"number | Complex | BigNumber | Fraction, Array":t2.referToSelf(r4=>(e3,t3)=>c2(n3(t3),e3,r4,!0).valueOf())})}),bu=Math.log(16),vu=s("log",["config","typed","typeOf","divideScalar","Complex"],e2=>{let{typed:t2,typeOf:n3,config:r3,divideScalar:i2,Complex:a2}=e2;function o2(e3){return e3.log()}function s2(e3){return o2(new a2(e3,0))}return t2("log",{number:function(e3){return(0<=e3||r3.predictable?ta:s2)(e3)},bigint:Qa(bu,ta,r3,s2),Complex:o2,BigNumber:function(e3){return!e3.isNegative()||r3.predictable?e3.ln():s2(e3.toNumber())},"any, any":t2.referToSelf(r4=>(e3,t3)=>{if(n3(e3)==="Fraction"&&n3(t3)==="Fraction"){let r5=e3.log(t3);if(r5!==null)return r5}return i2(r4(e3),r4(t3))})})}),wu=s("log1p",["typed","config","divideScalar","log","Complex"],e2=>{let{typed:t2,config:r3,divideScalar:n3,log:i2,Complex:a2}=e2;return t2("log1p",{number:function(e3){return-1<=e3||r3.predictable?Ue(e3):o2(new a2(e3,0))},Complex:o2,BigNumber:function(e3){let t3=e3.plus(1);return!t3.isNegative()||r3.predictable?t3.ln():o2(new a2(e3.toNumber(),0))},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3)),"any, any":t2.referToSelf(r4=>(e3,t3)=>n3(r4(e3),i2(t3)))});function o2(e3){var t3=e3.re+1;return new a2(Math.log(Math.sqrt(t3*t3+e3.im*e3.im)),Math.atan2(e3.im,t3))}}),Nu="nthRoots",Au=s(Nu,["config","typed","divideScalar","Complex"],e2=>{let{typed:t2,Complex:u2}=e2,l2=[function(e3){return new u2(e3,0)},function(e3){return new u2(0,e3)},function(e3){return new u2(-e3,0)},function(e3){return new u2(0,-e3)}];function r3(e3,t3){if(t3<0)throw new Error("Root must be greater than zero");if(t3===0)throw new Error("Root must be non-zero");if(t3%1!=0)throw new Error("Root must be an integer");if(e3===0||e3.abs()===0)return[new u2(0,0)];let r4=typeof e3=="number",n3;!r4&&e3.re!==0&&e3.im!==0||(n3=r4?2*(e3<0):e3.im===0?2*(e3.re<0):2*(e3.im<0)+1);let i2=e3.arg(),a2=e3.abs(),o2=[],s2=Math.pow(a2,1/t3);for(let e4=0;e4{let{typed:t2,equalScalar:r3,matrix:n3,pow:i2,DenseMatrix:a2,concat:o2,SparseMatrix:s2}=e2,u2=Pa({typed:t2}),l2=ko({typed:t2,SparseMatrix:s2}),c2=Aa({typed:t2,equalScalar:r3}),f2=x({typed:t2,DenseMatrix:a2}),p2=C({typed:t2,matrix:n3,concat:o2}),m2={};for(let e3 in i2.signatures)!Object.prototype.hasOwnProperty.call(i2.signatures,e3)||e3.includes("Matrix")||e3.includes("Array")||(m2[e3]=i2.signatures[e3]);return e2=t2(m2),t2("dotPow",p2({elop:e2,SS:l2,DS:u2,Ss:c2,sS:f2}))}),Su="dotDivide",Mu=s(Su,["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat","SparseMatrix"],e2=>{let{typed:t2,matrix:r3,equalScalar:n3,divideScalar:i2,DenseMatrix:a2,concat:o2,SparseMatrix:s2}=e2,u2=Ra({typed:t2,equalScalar:n3}),l2=Pa({typed:t2}),c2=ko({typed:t2,SparseMatrix:s2}),f2=Aa({typed:t2,equalScalar:n3}),p2=x({typed:t2,DenseMatrix:a2}),m2=C({typed:t2,matrix:r3,concat:o2});return t2(Su,m2({elop:i2,SS:c2,DS:l2,SD:u2,Ss:f2,sS:p2}))});function Cu(e2){let s2=e2.DenseMatrix;return function(r3,t2,n3){let i2=r3.size();if(i2.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+S(i2)+")");var a2=i2[0];if(a2!==i2[1])throw new RangeError("Matrix must be square (size: "+S(i2)+")");let o2=[];if(_(t2)){let r4=t2.size(),i3=t2._data;if(r4.length===1){if(r4[0]!==a2)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(let e3=0;e3{let{typed:t2,matrix:r3,divideScalar:m2,multiplyScalar:h2,subtractScalar:d2,equalScalar:g2,DenseMatrix:y2}=e2,x2=Cu({DenseMatrix:y2});return t2("lsolve",{"SparseMatrix, Array | Matrix":function(e3,t3){{var n4=t3;let a2=(n4=x2(e3,n4,!0))._data,o2=e3._size[0],s2=e3._size[1],u2=e3._values,l2=e3._index,c2=e3._ptr,f2=[];for(let r4=0;r4r4&&(x3.push(u2[e4]),o3.push(a3))}if(g2(t4,0))throw new Error("Linear system cannot be solved since matrix is singular");var i2=m2(n5,t4);for(let e4=0,t5=o3.length;e4{let{typed:t2,matrix:r3,divideScalar:p2,multiplyScalar:m2,subtractScalar:h2,equalScalar:d2,DenseMatrix:g2}=e2,y2=Cu({DenseMatrix:g2});return t2("usolve",{"SparseMatrix, Array | Matrix":function(e3,t3){{var n4=t3;let a2=(n4=y2(e3,n4,!0))._data,o2=e3._size[0],s2=e3._size[1],u2=e3._values,l2=e3._index,c2=e3._ptr,f2=[];for(let r4=s2-1;0<=r4;r4--){let n5=a2[r4][0]||0;if(d2(n5,0))f2[r4]=[0];else{let t4=0,y3=[],o3=[],s3=c2[r4];for(let e4=c2[r4+1]-1;e4>=s3;e4--){let a3=l2[e4];a3===r4?t4=u2[e4]:a3{let{typed:t2,matrix:r3,divideScalar:m2,multiplyScalar:h2,subtractScalar:d2,equalScalar:g2,DenseMatrix:y2}=e2,x2=Cu({DenseMatrix:y2});return t2(Fu,{"SparseMatrix, Array | Matrix":function(e3,t3){{var i2=t3;let a2=[x2(e3,i2,!0)._data.map(e4=>e4[0])],o2=e3._size[0],s2=e3._size[1],u2=e3._values,l2=e3._index,c2=e3._ptr;for(let n4=0;n4n4&&(o3.push(u2[e5]),s3.push(a3))}if(g2(t4,0))if(g2(x3[n4],0)){if(e4===0){let i3=[...x3];i3[n4]=1;for(let e5=0,t5=s3.length;e5new y2({data:e4.map(e5=>[e5]),size:[o2,1]}))}},"DenseMatrix, Array | Matrix":n3,"Array, Array | Matrix":function(e3,t3){return n3(r3(e3),t3).map(e4=>e4.valueOf())}});function n3(e3,n4){let i2=[x2(e3,n4,!0)._data.map(e4=>e4[0])],a2=e3._data,t3=e3._size[0],o2=e3._size[1];for(let r4=0;r4new y2({data:e4.map(e5=>[e5]),size:[t3,1]}))}}),Ou="usolveAll",_u=s(Ou,["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],e2=>{let{typed:t2,matrix:r3,divideScalar:p2,multiplyScalar:m2,subtractScalar:h2,equalScalar:d2,DenseMatrix:g2}=e2,y2=Cu({DenseMatrix:g2});return t2(Ou,{"SparseMatrix, Array | Matrix":function(e3,t3){{var i2=t3;let a2=[y2(e3,i2,!0)._data.map(e4=>e4[0])],o2=e3._size[0],s2=e3._size[1],u2=e3._values,l2=e3._index,c2=e3._ptr;for(let n4=s2-1;0<=n4;n4--){let r4=a2.length;for(let e4=0;e4=f2;e5--){let a3=l2[e5];a3===n4?t4=u2[e5]:a3new g2({data:e4.map(e5=>[e5]),size:[o2,1]}))}},"DenseMatrix, Array | Matrix":n3,"Array, Array | Matrix":function(e3,t3){return n3(r3(e3),t3).map(e4=>e4.valueOf())}});function n3(n4,e3){let i2=[y2(n4,e3,!0)._data.map(e4=>e4[0])],a2=n4._data,t3=n4._size[0];for(let r4=n4._size[1]-1;0<=r4;r4--){let t4=i2.length;for(let e4=0;e4new g2({data:e4.map(e5=>[e5]),size:[t3,1]}))}}),zu=s("matAlgo08xS0Sid",["typed","equalScalar"],e2=>{let{typed:C2,equalScalar:T2}=e2;return function(t2,e3,r3){var n3=t2._values,i2=t2._index,a2=t2._ptr,o2=t2._size,s2=t2._datatype||t2._data===void 0?t2._datatype:t2.getDataType(),u2=e3._values,l2=e3._index,c2=e3._ptr,f2=e3._size,p2=e3._datatype||e3._data===void 0?e3._datatype:e3.getDataType();if(o2.length!==f2.length)throw new z(o2.length,f2.length);if(o2[0]!==f2[0]||o2[1]!==f2[1])throw new RangeError("Dimension mismatch. Matrix A ("+o2+") must match Matrix B ("+f2+")");if(!n3||!u2)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var f2=o2[0],m2=o2[1];let h2,d2=T2,g2=0,y2=r3;typeof s2=="string"&&s2===p2&&s2!=="mixed"&&(h2=s2,d2=C2.find(T2,[h2,h2]),g2=C2.convert(0,h2),y2=C2.find(r3,[h2,h2]));let x2=[],b2=[],v2=[],w2=[],N2=[],A2,E2,S2,M2;for(let e4=0;e4{let{typed:t2,matrix:n3}=e2;return{"Array, number":t2.referTo("DenseMatrix, number",r3=>(e3,t3)=>r3(n3(e3),t3).valueOf()),"Array, BigNumber":t2.referTo("DenseMatrix, BigNumber",r3=>(e3,t3)=>r3(n3(e3),t3).valueOf()),"number, Array":t2.referTo("number, DenseMatrix",r3=>(e3,t3)=>r3(e3,n3(t3)).valueOf()),"BigNumber, Array":t2.referTo("BigNumber, DenseMatrix",r3=>(e3,t3)=>r3(e3,n3(t3)).valueOf())}}),Iu="leftShift",ku=s(Iu,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],e2=>{let{typed:t2,matrix:r3,equalScalar:n3,zeros:i2,DenseMatrix:a2,concat:o2}=e2,s2=Ha({typed:t2}),u2=Ra({typed:t2,equalScalar:n3}),l2=zu({typed:t2,equalScalar:n3}),c2=Va({typed:t2,DenseMatrix:a2}),f2=Aa({typed:t2,equalScalar:n3}),p2=Ea({typed:t2}),m2=C({typed:t2,matrix:r3,concat:o2}),h2=qu({typed:t2,matrix:r3});return t2(Iu,{"number, number":Do,"BigNumber, BigNumber":Eo,"bigint, bigint":(e3,t3)=>e3<(e3,t3)=>n3(t3,0)?e3.clone():f2(e3,t3,r4,!1)),"DenseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>n3(t3,0)?e3.clone():p2(e3,t3,r4,!1)),"number | BigNumber, SparseMatrix":t2.referToSelf(r4=>(e3,t3)=>n3(e3,0)?i2(t3.size(),t3.storage()):c2(t3,e3,r4,!0)),"number | BigNumber, DenseMatrix":t2.referToSelf(r4=>(e3,t3)=>n3(e3,0)?i2(t3.size(),t3.storage()):p2(t3,e3,r4,!0))},h2,m2({SS:l2,DS:s2,SD:u2}))}),Ru="rightArithShift",Pu=s(Ru,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],e2=>{let{typed:t2,matrix:r3,equalScalar:n3,zeros:i2,DenseMatrix:a2,concat:o2}=e2,s2=Ha({typed:t2}),u2=Ra({typed:t2,equalScalar:n3}),l2=zu({typed:t2,equalScalar:n3}),c2=Va({typed:t2,DenseMatrix:a2}),f2=Aa({typed:t2,equalScalar:n3}),p2=Ea({typed:t2}),m2=C({typed:t2,matrix:r3,concat:o2}),h2=qu({typed:t2,matrix:r3});return t2(Ru,{"number, number":Oo,"BigNumber, BigNumber":So,"bigint, bigint":(e3,t3)=>e3>>t3,"SparseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>n3(t3,0)?e3.clone():f2(e3,t3,r4,!1)),"DenseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>n3(t3,0)?e3.clone():p2(e3,t3,r4,!1)),"number | BigNumber, SparseMatrix":t2.referToSelf(r4=>(e3,t3)=>n3(e3,0)?i2(t3.size(),t3.storage()):c2(t3,e3,r4,!0)),"number | BigNumber, DenseMatrix":t2.referToSelf(r4=>(e3,t3)=>n3(e3,0)?i2(t3.size(),t3.storage()):p2(t3,e3,r4,!0))},h2,m2({SS:l2,DS:s2,SD:u2}))}),Uu="rightLogShift",ju=s(Uu,["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],e2=>{let{typed:t2,matrix:r3,equalScalar:n3,zeros:i2,DenseMatrix:a2,concat:o2}=e2,s2=Ha({typed:t2}),u2=Ra({typed:t2,equalScalar:n3}),l2=zu({typed:t2,equalScalar:n3}),c2=Va({typed:t2,DenseMatrix:a2}),f2=Aa({typed:t2,equalScalar:n3}),p2=Ea({typed:t2}),m2=C({typed:t2,matrix:r3,concat:o2}),h2=qu({typed:t2,matrix:r3});return t2(Uu,{"number, number":_o,"SparseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>n3(t3,0)?e3.clone():f2(e3,t3,r4,!1)),"DenseMatrix, number | BigNumber":t2.referToSelf(r4=>(e3,t3)=>n3(t3,0)?e3.clone():p2(e3,t3,r4,!1)),"number | BigNumber, SparseMatrix":t2.referToSelf(r4=>(e3,t3)=>n3(e3,0)?i2(t3.size(),t3.storage()):c2(t3,e3,r4,!0)),"number | BigNumber, DenseMatrix":t2.referToSelf(r4=>(e3,t3)=>n3(e3,0)?i2(t3.size(),t3.storage()):p2(t3,e3,r4,!0))},h2,m2({SS:l2,DS:s2,SD:u2}))}),Lu=s("and",["typed","matrix","equalScalar","zeros","not","concat"],e2=>{let{typed:t2,matrix:n3,equalScalar:r3,zeros:i2,not:a2,concat:o2}=e2,s2=Ra({typed:t2,equalScalar:r3}),u2=Ja({typed:t2,equalScalar:r3}),l2=Aa({typed:t2,equalScalar:r3}),c2=Ea({typed:t2}),f2=C({typed:t2,matrix:n3,concat:o2});return t2("and",{"number, number":Zo,"Complex, Complex":function(e3,t3){return!(e3.re===0&&e3.im===0||t3.re===0&&t3.im===0)},"BigNumber, BigNumber":function(e3,t3){return!(e3.isZero()||t3.isZero()||e3.isNaN()||t3.isNaN())},"bigint, bigint":Zo,"Unit, Unit":t2.referToSelf(r4=>(e3,t3)=>r4(e3.value||0,t3.value||0)),"SparseMatrix, any":t2.referToSelf(r4=>(e3,t3)=>a2(t3)?i2(e3.size(),e3.storage()):l2(e3,t3,r4,!1)),"DenseMatrix, any":t2.referToSelf(r4=>(e3,t3)=>a2(t3)?i2(e3.size(),e3.storage()):c2(e3,t3,r4,!1)),"any, SparseMatrix":t2.referToSelf(r4=>(e3,t3)=>a2(e3)?i2(e3.size(),e3.storage()):l2(t3,e3,r4,!0)),"any, DenseMatrix":t2.referToSelf(r4=>(e3,t3)=>a2(e3)?i2(e3.size(),e3.storage()):c2(t3,e3,r4,!0)),"Array, any":t2.referToSelf(r4=>(e3,t3)=>r4(n3(e3),t3).valueOf()),"any, Array":t2.referToSelf(r4=>(e3,t3)=>r4(e3,n3(t3)).valueOf())},f2({SS:u2,DS:s2}))}),$u="compare",Hu=s($u,["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],e2=>{let{typed:t2,config:r3,equalScalar:n3,matrix:i2,BigNumber:a2,Fraction:o2,DenseMatrix:s2,concat:u2}=e2,l2=Pa({typed:t2}),c2=Ua({typed:t2,equalScalar:n3}),f2=x({typed:t2,DenseMatrix:s2}),p2=C({typed:t2,matrix:i2,concat:u2}),m2=wi({typed:t2});return t2($u,Gu({typed:t2,config:r3}),{"boolean, boolean":function(e3,t3){return e3===t3?0:t3{let{typed:t2,config:r3}=e2;return t2($u,{"number, number":function(e3,t3){return Xe(e3,t3,r3.relTol,r3.absTol)?0:t3{let{typed:t2,compare:m2}=e2,h2=m2.signatures["boolean,boolean"];return t2(Zu,{"any, any":function e3(t3,r3){var n3=K(t3),i2=K(r3);let a2;if(!(n3!=="number"&&n3!=="BigNumber"&&n3!=="Fraction"||i2!=="number"&&i2!=="BigNumber"&&i2!=="Fraction"))return(a2=m2(t3,r3)).toString()!=="0"?0r3.re?1:t3.rer3.im?1:t3.imi2.length?1:n3.length{let{typed:t2,matrix:r3,concat:n3}=e2,i2=C({typed:t2,matrix:r3,concat:n3});return t2(Yu,An,i2({elop:An,Ds:!0}))})),Xu="equal",Qu=s(Xu,["typed","matrix","equalScalar","DenseMatrix","concat","SparseMatrix"],e2=>{let{typed:t2,matrix:r3,equalScalar:n3,DenseMatrix:i2,concat:a2,SparseMatrix:o2}=e2,s2=Pa({typed:t2}),u2=ko({typed:t2,SparseMatrix:o2}),l2=x({typed:t2,DenseMatrix:i2}),c2=C({typed:t2,matrix:r3,concat:a2});return t2(Xu,Ku({typed:t2,equalScalar:n3}),c2({elop:n3,SS:u2,DS:s2,Ss:l2}))}),Ku=s(Xu,["typed","equalScalar"],e2=>{let{typed:t2,equalScalar:r3}=e2;return t2(Xu,{"any, any":function(e3,t3){return e3===null?t3===null:t3===null?e3===null:e3===void 0?t3===void 0:t3===void 0?e3===void 0:r3(e3,t3)}})}),el="equalText",tl=s(el,["typed","compareText","isZero"],e2=>{let{typed:t2,compareText:r3,isZero:n3}=e2;return t2(el,{"any, any":function(e3,t3){return n3(r3(e3,t3))}})}),rl="smaller",nl=s(rl,["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],e2=>{let{typed:t2,config:r3,bignumber:n3,matrix:i2,DenseMatrix:a2,concat:o2,SparseMatrix:s2}=e2,u2=Pa({typed:t2}),l2=ko({typed:t2,SparseMatrix:s2}),c2=x({typed:t2,DenseMatrix:a2}),f2=C({typed:t2,matrix:i2,concat:o2}),p2=wi({typed:t2});function m2(e3,t3){return e3.lt(t3)&&!li(e3,t3,r3.relTol,r3.absTol)}return t2(rl,il({typed:t2,config:r3}),{"boolean, boolean":(e3,t3)=>e3e3e3.compare(t3)===-1,"Fraction, BigNumber":function(e3,t3){return m2(n3(e3),t3)},"BigNumber, Fraction":function(e3,t3){return m2(e3,n3(t3))},"Complex, Complex":function(e3,t3){throw new TypeError("No ordering relation is defined for complex numbers")}},p2,f2({SS:l2,DS:u2,Ss:c2}))}),il=s(rl,["typed","config"],e2=>{let{typed:t2,config:r3}=e2;return t2(rl,{"number, number":function(e3,t3){return e3{let{typed:t2,config:r3,matrix:n3,DenseMatrix:i2,concat:a2,SparseMatrix:o2}=e2,s2=Pa({typed:t2}),u2=ko({typed:t2,SparseMatrix:o2}),l2=x({typed:t2,DenseMatrix:i2}),c2=C({typed:t2,matrix:n3,concat:a2}),f2=wi({typed:t2});return t2(al,sl({typed:t2,config:r3}),{"boolean, boolean":(e3,t3)=>e3<=t3,"BigNumber, BigNumber":function(e3,t3){return e3.lte(t3)||li(e3,t3,r3.relTol,r3.absTol)},"bigint, bigint":(e3,t3)=>e3<=t3,"Fraction, Fraction":(e3,t3)=>e3.compare(t3)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f2,c2({SS:u2,DS:s2,Ss:l2}))}),sl=s(al,["typed","config"],e2=>{let{typed:t2,config:r3}=e2;return t2(al,{"number, number":function(e3,t3){return e3<=t3||Xe(e3,t3,r3.relTol,r3.absTol)}})}),ul="larger",ll=s(ul,["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],e2=>{let{typed:t2,config:r3,bignumber:n3,matrix:i2,DenseMatrix:a2,concat:o2,SparseMatrix:s2}=e2,u2=Pa({typed:t2}),l2=ko({typed:t2,SparseMatrix:s2}),c2=x({typed:t2,DenseMatrix:a2}),f2=C({typed:t2,matrix:i2,concat:o2}),p2=wi({typed:t2});function m2(e3,t3){return e3.gt(t3)&&!li(e3,t3,r3.relTol,r3.absTol)}return t2(ul,cl({typed:t2,config:r3}),{"boolean, boolean":(e3,t3)=>t3t3e3.compare(t3)===1,"Fraction, BigNumber":function(e3,t3){return m2(n3(e3),t3)},"BigNumber, Fraction":function(e3,t3){return m2(e3,n3(t3))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},p2,f2({SS:l2,DS:u2,Ss:c2}))}),cl=s(ul,["typed","config"],e2=>{let{typed:t2,config:r3}=e2;return t2(ul,{"number, number":function(e3,t3){return t3{let{typed:t2,config:r3,matrix:n3,DenseMatrix:i2,concat:a2,SparseMatrix:o2}=e2,s2=Pa({typed:t2}),u2=ko({typed:t2,SparseMatrix:o2}),l2=x({typed:t2,DenseMatrix:i2}),c2=C({typed:t2,matrix:n3,concat:a2}),f2=wi({typed:t2});return t2(fl,ml({typed:t2,config:r3}),{"boolean, boolean":(e3,t3)=>t3<=e3,"BigNumber, BigNumber":function(e3,t3){return e3.gte(t3)||li(e3,t3,r3.relTol,r3.absTol)},"bigint, bigint":function(e3,t3){return t3<=e3},"Fraction, Fraction":(e3,t3)=>e3.compare(t3)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f2,c2({SS:u2,DS:s2,Ss:l2}))}),ml=s(fl,["typed","config"],e2=>{let{typed:t2,config:r3}=e2;return t2(fl,{"number, number":function(e3,t3){return t3<=e3||Xe(e3,t3,r3.relTol,r3.absTol)}})}),hl="deepEqual",dl=s(hl,["typed","equal"],e2=>{let{typed:t2,equal:i2}=e2;return t2(hl,{"any, any":function(e3,t3){return(function t4(r3,n3){if(Array.isArray(r3)){if(Array.isArray(n3)){let i3=r3.length;if(i3!==n3.length)return!1;for(let e4=0;e4{let{typed:t2,equalScalar:r3,matrix:n3,DenseMatrix:i2,concat:a2,SparseMatrix:o2}=e2,s2=Pa({typed:t2}),u2=ko({typed:t2,SparseMatrix:o2}),l2=x({typed:t2,DenseMatrix:i2}),c2=C({typed:t2,matrix:n3,concat:a2});return t2(gl,xl({typed:t2,equalScalar:r3}),c2({elop:function(e3,t3){return!r3(e3,t3)},SS:u2,DS:s2,Ss:l2}))}),xl=s(gl,["typed","equalScalar"],e2=>{let{typed:t2,equalScalar:r3}=e2;return t2(gl,{"any, any":function(e3,t3){return e3===null?t3!==null:t3===null?e3!==null:e3===void 0?t3!==void 0:t3===void 0?e3!==void 0:!r3(e3,t3)}})}),bl="partitionSelect",vl=s(bl,["typed","isNumeric","isNaN","compare"],e2=>{let{typed:t2,isNumeric:u2,isNaN:l2,compare:r3}=e2,n3=r3,i2=(e3,t3)=>-r3(e3,t3);return t2(bl,{"Array | Matrix, number":function(e3,t3){return a2(e3,t3,n3)},"Array | Matrix, number, string":function(e3,t3,r4){if(r4==="asc")return a2(e3,t3,n3);if(r4==="desc")return a2(e3,t3,i2);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":a2});function a2(e3,t3,r4){if(!v(t3)||t3<0)throw new Error("k must be a non-negative integer");if(_(e3)){if(1=r4.length)throw new Error("k out of bounds");for(let e3=0;e3{let{typed:t2,matrix:r3,compare:n3,compareNatural:i2}=e2,a2=n3,o2=(e3,t3)=>-n3(e3,t3);return t2("sort",{Array:function(e3){return u2(e3),e3.sort(a2)},Matrix:function(e3){return l2(e3),r3(e3.toArray().sort(a2),e3.storage())},"Array, function":function(e3,t3){return u2(e3),e3.sort(t3)},"Matrix, function":function(e3,t3){return l2(e3),r3(e3.toArray().sort(t3),e3.storage())},"Array, string":function(e3,t3){return u2(e3),e3.sort(s2(t3))},"Matrix, string":function(e3,t3){return l2(e3),r3(e3.toArray().sort(s2(t3)),e3.storage())}});function s2(e3){if(e3==="asc")return a2;if(e3==="desc")return o2;if(e3==="natural")return i2;throw new Error('String "asc", "desc", or "natural" expected')}function u2(e3){if(T(e3).length!==1)throw new Error("One dimensional array expected")}function l2(e3){if(e3.size().length!==1)throw new Error("One dimensional matrix expected")}}),Nl=s("max",["typed","config","numeric","larger","isNaN"],e2=>{let{typed:t2,config:n3,numeric:i2,larger:a2,isNaN:o2}=e2;return t2("max",{"Array | Matrix":s2,"Array | Matrix, number | BigNumber":function(e3,t3){return ri(e3,t3.valueOf(),r3)},"...":function(e3){if(ei(e3))throw new TypeError("Scalar values expected in function max");return s2(e3)}});function r3(e3,t3){try{return a2(e3,t3)?e3:t3}catch(e4){throw eu(e4,"max",t3)}}function s2(e3){let r4;if(ti(e3,function(t3){try{(o2(t3)||r4===void 0||a2(t3,r4))&&(r4=t3)}catch(e4){throw eu(e4,"max",t3)}}),r4===void 0)throw new Error("Cannot calculate max of an empty array");return r4=typeof r4=="string"?i2(r4,Ie(r4,n3)):r4}}),Al=s("min",["typed","config","numeric","smaller","isNaN"],e2=>{let{typed:t2,config:n3,numeric:i2,smaller:a2,isNaN:o2}=e2;return t2("min",{"Array | Matrix":s2,"Array | Matrix, number | BigNumber":function(e3,t3){return ri(e3,t3.valueOf(),r3)},"...":function(e3){if(ei(e3))throw new TypeError("Scalar values expected in function min");return s2(e3)}});function r3(e3,t3){try{return a2(e3,t3)?e3:t3}catch(e4){throw eu(e4,"min",t3)}}function s2(e3){let r4;if(ti(e3,function(t3){try{(o2(t3)||r4===void 0||a2(t3,r4))&&(r4=t3)}catch(e4){throw eu(e4,"min",t3)}}),r4===void 0)throw new Error("Cannot calculate min of an empty array");return r4=typeof r4=="string"?i2(r4,Ie(r4,n3)):r4}}),El=s("ImmutableDenseMatrix",["smaller","DenseMatrix"],e2=>{let{smaller:r3,DenseMatrix:n3}=e2;function i2(e3,t2){if(!(this instanceof i2))throw new SyntaxError("Constructor must be called with the new operator");if(t2&&!j(t2))throw new Error("Invalid datatype: "+t2);if(_(e3)||b(e3)){let i3=new n3(e3,t2);this._data=i3._data,this._size=i3._size,this._datatype=i3._datatype,this._min=null,this._max=null}else if(e3&&b(e3.data)&&b(e3.size))this._data=e3.data,this._size=e3.size,this._datatype=e3.datatype,this._min=e3.min!==void 0?e3.min:null,this._max=e3.max!==void 0?e3.max:null;else{if(e3)throw new TypeError("Unsupported type of data ("+K(e3)+")");this._data=[],this._size=[0],this._datatype=t2,this._min=null,this._max=null}}return i2.prototype=new n3,i2.prototype.type="ImmutableDenseMatrix",i2.prototype.isImmutableDenseMatrix=!0,i2.prototype.subset=function(e3){switch(arguments.length){case 1:var t2=n3.prototype.subset.call(this,e3);return _(t2)?new i2({data:t2._data,size:t2._size,datatype:t2._datatype}):t2;case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},i2.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},i2.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},i2.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},i2.prototype.clone=function(){return new i2({data:ee(this._data),size:ee(this._size),datatype:this._datatype})},i2.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},i2.fromJSON=function(e3){return new i2(e3)},i2.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},i2.prototype.min=function(){if(this._min===null){let t2=null;this.forEach(function(e3){t2!==null&&!r3(e3,t2)||(t2=e3)}),this._min=t2!==null?t2:void 0}return this._min},i2.prototype.max=function(){if(this._max===null){let t2=null;this.forEach(function(e3){t2!==null&&!r3(t2,e3)||(t2=e3)}),this._max=t2!==null?t2:void 0}return this._max},i2},{isClass:!0}),Sl=s("Index",["ImmutableDenseMatrix","getMatrixDataType"],e2=>{let{ImmutableDenseMatrix:t2,getMatrixDataType:o2}=e2;function s2(e3){if(!(this instanceof s2))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(let e4=0,t3=arguments.length;e4{e3&&r3.push(t2)}),r3}let Cl=s("FibonacciHeap",["smaller","larger"],e2=>{let{smaller:s2,larger:u2}=e2,l2=1/Math.log((1+Math.sqrt(5))/2);function t2(){if(!(this instanceof t2))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}function i2(e3,t3,r3){t3.left.right=t3.right,t3.right.left=t3.left,r3.degree--,r3.child===t3&&(r3.child=t3.right),r3.degree===0&&(r3.child=null),t3.left=e3,t3.right=e3.right,((e3.right=t3).right.left=t3).parent=null,t3.mark=!1}t2.prototype.type="FibonacciHeap",t2.prototype.isFibonacciHeap=!0,t2.prototype.insert=function(e3,t3){let r3={key:e3,value:t3,degree:0};if(this._minimum){let t4=this._minimum;r3.left=t4,r3.right=t4.right,(t4.right=r3).right.left=r3,s2(e3,t4.key)&&(this._minimum=r3)}else(r3.left=r3).right=r3,this._minimum=r3;return this._size++,r3},t2.prototype.size=function(){return this._size},t2.prototype.clear=function(){this._minimum=null,this._size=0},t2.prototype.isEmpty=function(){return this._size===0},t2.prototype.extractMinimum=function(){let e3=this._minimum;if(e3===null)return e3;let t3=this._minimum,r3=e3.degree,n3=e3.child;for(;0{let{addScalar:n3,equalScalar:s2,FibonacciHeap:t2}=e2;function r3(){if(!(this instanceof r3))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new t2}return r3.prototype.type="Spa",r3.prototype.isSpa=!0,r3.prototype.set=function(e3,t3){this._values[e3]?this._values[e3].value=t3:(t3=this._heap.insert(e3,t3),this._values[e3]=t3)},r3.prototype.get=function(e3){return e3=this._values[e3],e3?e3.value:0},r3.prototype.accumulate=function(e3,t3){let r4=this._values[e3];r4?r4.value=n3(r4.value,t3):(r4=this._heap.insert(e3,t3),this._values[e3]=r4)},r3.prototype.forEach=function(e3,t3,r4){let n4=this._heap,i2=this._values,a2=[],o2=n4.extractMinimum();for(o2&&a2.push(o2);o2&&o2.key<=t3;)o2.key>=e3&&(s2(o2.value,0)||r4(o2.key,o2.value,this)),(o2=n4.extractMinimum())&&a2.push(o2);for(let e4=0;e4{let{on:t2,config:c2,addScalar:l2,subtractScalar:f2,multiplyScalar:p2,divideScalar:o2,pow:s2,abs:u2,fix:m2,round:I2,equal:h2,isNumeric:k2,format:R2,number:r3,Complex:P2,BigNumber:d2,Fraction:g2}=e2,U2=r3;function y2(e3,t3){if(!(this instanceof y2))throw new Error("Constructor must be called with the new operator");if(e3!=null&&!k2(e3)&&!te(e3))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,t3===void 0)this.units=[],this.dimensions=B2.map(e4=>0);else if(typeof t3=="string"){let e4=y2.parse(t3);this.units=e4.units,this.dimensions=e4.dimensions}else{if(!L(t3)||t3.value!==null)throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.fixPrefix=t3.fixPrefix,this.skipAutomaticSimplification=t3.skipAutomaticSimplification,this.dimensions=t3.dimensions.slice(0),this.units=t3.units.map(e4=>gn({},e4))}this.value=this._normalize(e3)}let x2,b2,v2;function w2(){for(;v2===" "||v2===" ";)A2()}function N2(e3){return"0"<=e3&&e3<="9"}function A2(){b2++,v2=x2.charAt(b2)}function n3(e3){b2=e3,v2=x2.charAt(b2)}function E2(){let t3="";var e3=b2;if(v2==="+"?A2():v2==="-"&&(t3+=v2,A2()),!("0"<=(r4=v2)&&r4<="9"||r4==="."))return n3(e3),null;if(v2==="."){if(t3+=v2,A2(),!N2(v2))return n3(e3),null}else{for(;N2(v2);)t3+=v2,A2();v2==="."&&(t3+=v2,A2())}for(;N2(v2);)t3+=v2,A2();if(v2==="E"||v2==="e"){let e4="";var r4=b2;if(e4+=v2,A2(),v2!=="+"&&v2!=="-"||(e4+=v2,A2()),!N2(v2))return n3(r4),t3;for(t3+=e4;N2(v2);)t3+=v2,A2()}return t3}function S2(e3){return v2===e3&&(A2(),e3)}Object.defineProperty(y2,"name",{value:"Unit"}),(y2.prototype.constructor=y2).prototype.type="Unit",y2.prototype.isUnit=!0,y2.parse=function(e3,r4){if(r4=r4||{},x2=e3,b2=-1,v2="",typeof x2!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");let n4=new y2,i3=1,a3=!(n4.units=[]);A2(),w2();var o3,t3=E2();let s3=null;if(t3){if(c2.number==="BigNumber")s3=new d2(t3);else if(c2.number==="Fraction")try{s3=new g2(t3)}catch{s3=parseFloat(t3)}else s3=parseFloat(t3);w2(),S2("*")?(i3=1,a3=!0):S2("/")&&(i3=-1,a3=!0)}let u3=[],l3=1;for(;;){for(w2();v2==="(";)u3.push(i3),l3*=i3,i3=1,A2(),w2();if(!v2)break;{let e4=v2;if((o3=(function(){let e5="";for(;N2(v2)||y2.isValidAlpha(v2);)e5+=v2,A2();var t5=e5.charAt(0);return y2.isValidAlpha(t5)?e5:null})())===null)throw new SyntaxError('Unexpected "'+e4+'" in "'+x2+'" at index '+b2.toString())}let c3=M2(o3);if(c3===null)throw new SyntaxError('Unit "'+o3+'" not found.');let t4=i3*l3;if(w2(),S2("^")){w2();let r5=E2();if(r5===null)throw new SyntaxError('In "'+e3+'", "^" must be followed by a floating-point number');t4*=r5}n4.units.push({unit:c3.unit,prefix:c3.prefix,power:t4});for(let e4=0;e4{var t3;if(ue(D2,e3))return{unit:t3=D2[e3],prefix:t3.prefixes[""]};for(let o3 in D2)if(ue(D2,o3)&&(r4=e3,a3=o3,n4=void 0,i3=void 0,n4=r4.length-a3.length,i3=r4.length,r4.substring(n4,i3)===a3)){var r4=D2[o3],n4=e3.length-o3.length,i3=e3.substring(0,n4),a3=ue(r4.prefixes,i3)?r4.prefixes[i3]:void 0;if(a3!==void 0)return{unit:r4,prefix:a3}}return null},{hasher:e3=>e3[0],limit:100});function a2(e3){return e3.equalBase(F2.NONE)&&e3.value!==null&&!c2.predictable?e3.value:e3}function C2(e3){return y2._getNumberConverter(K(e3))(1)}function i2(e3,t3){t3=1{let t5=null;if(typeof e4=="string"){if(!(t5=y2.parse(e4)))throw new Error("Invalid unit type. Expected compatible string or Unit.")}else if(!L(e4))throw new Error("Invalid unit type. Expected compatible string or Unit.");t5===null&&(t5=e4.clone());try{return this.to(t5.formatUnits()),t5}catch{throw new Error("Invalid unit type. Expected compatible string or Unit.")}}).map(e4=>e4.units[0].prefix);this.units[0].unit.prefixes=t4.reduce((e4,t5)=>(e4[t5.name]=t5,e4),{}),this.units[0].prefix=t4[0]}let n4=i2(this,t3).simp;return this.units[0].unit.prefixes=r4,n4.fixPrefix=!0,n4},y2.prototype.format=function(e3){var{simp:e3,valueStr:t3,unitStr:r4}=i2(this,e3);let n4=t3;return e3.value&&te(e3.value)&&(n4="("+n4+")"),00)},D2={meter:{name:"meter",base:F2.LENGTH,prefixes:T2.LONG,value:1,offset:0},inch:{name:"inch",base:F2.LENGTH,prefixes:T2.NONE,value:.0254,offset:0},foot:{name:"foot",base:F2.LENGTH,prefixes:T2.NONE,value:.3048,offset:0},yard:{name:"yard",base:F2.LENGTH,prefixes:T2.NONE,value:.9144,offset:0},mile:{name:"mile",base:F2.LENGTH,prefixes:T2.NONE,value:1609.344,offset:0},link:{name:"link",base:F2.LENGTH,prefixes:T2.NONE,value:.201168,offset:0},rod:{name:"rod",base:F2.LENGTH,prefixes:T2.NONE,value:5.0292,offset:0},chain:{name:"chain",base:F2.LENGTH,prefixes:T2.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:F2.LENGTH,prefixes:T2.NONE,value:1e-10,offset:0},m:{name:"m",base:F2.LENGTH,prefixes:T2.SHORT,value:1,offset:0},in:{name:"in",base:F2.LENGTH,prefixes:T2.NONE,value:.0254,offset:0},ft:{name:"ft",base:F2.LENGTH,prefixes:T2.NONE,value:.3048,offset:0},yd:{name:"yd",base:F2.LENGTH,prefixes:T2.NONE,value:.9144,offset:0},mi:{name:"mi",base:F2.LENGTH,prefixes:T2.NONE,value:1609.344,offset:0},li:{name:"li",base:F2.LENGTH,prefixes:T2.NONE,value:.201168,offset:0},rd:{name:"rd",base:F2.LENGTH,prefixes:T2.NONE,value:5.02921,offset:0},ch:{name:"ch",base:F2.LENGTH,prefixes:T2.NONE,value:20.1168,offset:0},mil:{name:"mil",base:F2.LENGTH,prefixes:T2.NONE,value:254e-7,offset:0},m2:{name:"m2",base:F2.SURFACE,prefixes:T2.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:F2.SURFACE,prefixes:T2.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:F2.SURFACE,prefixes:T2.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:F2.SURFACE,prefixes:T2.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:F2.SURFACE,prefixes:T2.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:F2.SURFACE,prefixes:T2.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:F2.SURFACE,prefixes:T2.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:F2.SURFACE,prefixes:T2.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:F2.SURFACE,prefixes:T2.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:F2.SURFACE,prefixes:T2.NONE,value:1e4,offset:0},m3:{name:"m3",base:F2.VOLUME,prefixes:T2.CUBIC,value:1,offset:0},L:{name:"L",base:F2.VOLUME,prefixes:T2.SHORT,value:.001,offset:0},l:{name:"l",base:F2.VOLUME,prefixes:T2.SHORT,value:.001,offset:0},litre:{name:"litre",base:F2.VOLUME,prefixes:T2.LONG,value:.001,offset:0},cuin:{name:"cuin",base:F2.VOLUME,prefixes:T2.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:F2.VOLUME,prefixes:T2.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:F2.VOLUME,prefixes:T2.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:F2.VOLUME,prefixes:T2.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:F2.VOLUME,prefixes:T2.NONE,value:15e-6,offset:0},drop:{name:"drop",base:F2.VOLUME,prefixes:T2.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:F2.VOLUME,prefixes:T2.NONE,value:5e-8,offset:0},minim:{name:"minim",base:F2.VOLUME,prefixes:T2.NONE,value:61611519921875e-21,offset:0},fluiddram:{name:"fluiddram",base:F2.VOLUME,prefixes:T2.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:F2.VOLUME,prefixes:T2.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:F2.VOLUME,prefixes:T2.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:F2.VOLUME,prefixes:T2.NONE,value:1e-6,offset:0},cup:{name:"cup",base:F2.VOLUME,prefixes:T2.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:F2.VOLUME,prefixes:T2.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:F2.VOLUME,prefixes:T2.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:F2.VOLUME,prefixes:T2.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:F2.VOLUME,prefixes:T2.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:F2.VOLUME,prefixes:T2.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:F2.VOLUME,prefixes:T2.NONE,value:.238480942392,offset:0},g:{name:"g",base:F2.MASS,prefixes:T2.SHORT,value:.001,offset:0},gram:{name:"gram",base:F2.MASS,prefixes:T2.LONG,value:.001,offset:0},ton:{name:"ton",base:F2.MASS,prefixes:T2.SHORT,value:907.18474,offset:0},t:{name:"t",base:F2.MASS,prefixes:T2.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:F2.MASS,prefixes:T2.LONG,value:1e3,offset:0},grain:{name:"grain",base:F2.MASS,prefixes:T2.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:F2.MASS,prefixes:T2.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:F2.MASS,prefixes:T2.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:F2.MASS,prefixes:T2.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:F2.MASS,prefixes:T2.NONE,value:45.359237,offset:0},stick:{name:"stick",base:F2.MASS,prefixes:T2.NONE,value:.115,offset:0},stone:{name:"stone",base:F2.MASS,prefixes:T2.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:F2.MASS,prefixes:T2.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:F2.MASS,prefixes:T2.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:F2.MASS,prefixes:T2.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:F2.MASS,prefixes:T2.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:F2.MASS,prefixes:T2.NONE,value:45.359237,offset:0},s:{name:"s",base:F2.TIME,prefixes:T2.SHORT,value:1,offset:0},min:{name:"min",base:F2.TIME,prefixes:T2.NONE,value:60,offset:0},h:{name:"h",base:F2.TIME,prefixes:T2.NONE,value:3600,offset:0},second:{name:"second",base:F2.TIME,prefixes:T2.LONG,value:1,offset:0},sec:{name:"sec",base:F2.TIME,prefixes:T2.LONG,value:1,offset:0},minute:{name:"minute",base:F2.TIME,prefixes:T2.NONE,value:60,offset:0},hour:{name:"hour",base:F2.TIME,prefixes:T2.NONE,value:3600,offset:0},day:{name:"day",base:F2.TIME,prefixes:T2.NONE,value:86400,offset:0},week:{name:"week",base:F2.TIME,prefixes:T2.NONE,value:604800,offset:0},month:{name:"month",base:F2.TIME,prefixes:T2.NONE,value:2629800,offset:0},year:{name:"year",base:F2.TIME,prefixes:T2.NONE,value:31557600,offset:0},decade:{name:"decade",base:F2.TIME,prefixes:T2.NONE,value:315576e3,offset:0},century:{name:"century",base:F2.TIME,prefixes:T2.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:F2.TIME,prefixes:T2.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:F2.FREQUENCY,prefixes:T2.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:F2.FREQUENCY,prefixes:T2.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:F2.ANGLE,prefixes:T2.SHORT,value:1,offset:0},radian:{name:"radian",base:F2.ANGLE,prefixes:T2.LONG,value:1,offset:0},deg:{name:"deg",base:F2.ANGLE,prefixes:T2.SHORT,value:null,offset:0},degree:{name:"degree",base:F2.ANGLE,prefixes:T2.LONG,value:null,offset:0},grad:{name:"grad",base:F2.ANGLE,prefixes:T2.SHORT,value:null,offset:0},gradian:{name:"gradian",base:F2.ANGLE,prefixes:T2.LONG,value:null,offset:0},cycle:{name:"cycle",base:F2.ANGLE,prefixes:T2.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:F2.ANGLE,prefixes:T2.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:F2.ANGLE,prefixes:T2.NONE,value:null,offset:0},A:{name:"A",base:F2.CURRENT,prefixes:T2.SHORT,value:1,offset:0},ampere:{name:"ampere",base:F2.CURRENT,prefixes:T2.LONG,value:1,offset:0},K:{name:"K",base:F2.TEMPERATURE,prefixes:T2.SHORT,value:1,offset:0},degC:{name:"degC",base:F2.TEMPERATURE,prefixes:T2.SHORT,value:1,offset:273.15},degF:{name:"degF",base:F2.TEMPERATURE,prefixes:T2.SHORT,value:new g2(5,9),offset:459.67},degR:{name:"degR",base:F2.TEMPERATURE,prefixes:T2.SHORT,value:new g2(5,9),offset:0},kelvin:{name:"kelvin",base:F2.TEMPERATURE,prefixes:T2.LONG,value:1,offset:0},celsius:{name:"celsius",base:F2.TEMPERATURE,prefixes:T2.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:F2.TEMPERATURE,prefixes:T2.LONG,value:new g2(5,9),offset:459.67},rankine:{name:"rankine",base:F2.TEMPERATURE,prefixes:T2.LONG,value:new g2(5,9),offset:0},mol:{name:"mol",base:F2.AMOUNT_OF_SUBSTANCE,prefixes:T2.SHORT,value:1,offset:0},mole:{name:"mole",base:F2.AMOUNT_OF_SUBSTANCE,prefixes:T2.LONG,value:1,offset:0},cd:{name:"cd",base:F2.LUMINOUS_INTENSITY,prefixes:T2.SHORT,value:1,offset:0},candela:{name:"candela",base:F2.LUMINOUS_INTENSITY,prefixes:T2.LONG,value:1,offset:0},N:{name:"N",base:F2.FORCE,prefixes:T2.SHORT,value:1,offset:0},newton:{name:"newton",base:F2.FORCE,prefixes:T2.LONG,value:1,offset:0},dyn:{name:"dyn",base:F2.FORCE,prefixes:T2.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:F2.FORCE,prefixes:T2.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:F2.FORCE,prefixes:T2.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:F2.FORCE,prefixes:T2.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:F2.FORCE,prefixes:T2.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:F2.FORCE,prefixes:T2.NONE,value:9.80665,offset:0},J:{name:"J",base:F2.ENERGY,prefixes:T2.SHORT,value:1,offset:0},joule:{name:"joule",base:F2.ENERGY,prefixes:T2.LONG,value:1,offset:0},erg:{name:"erg",base:F2.ENERGY,prefixes:T2.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:F2.ENERGY,prefixes:T2.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:F2.ENERGY,prefixes:T2.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:F2.ENERGY,prefixes:T2.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:F2.ENERGY,prefixes:T2.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:F2.POWER,prefixes:T2.SHORT,value:1,offset:0},watt:{name:"watt",base:F2.POWER,prefixes:T2.LONG,value:1,offset:0},hp:{name:"hp",base:F2.POWER,prefixes:T2.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:F2.POWER,prefixes:T2.SHORT,value:P2.I,offset:0},VA:{name:"VA",base:F2.POWER,prefixes:T2.SHORT,value:1,offset:0},Pa:{name:"Pa",base:F2.PRESSURE,prefixes:T2.SHORT,value:1,offset:0},psi:{name:"psi",base:F2.PRESSURE,prefixes:T2.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:F2.PRESSURE,prefixes:T2.NONE,value:101325,offset:0},bar:{name:"bar",base:F2.PRESSURE,prefixes:T2.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:F2.PRESSURE,prefixes:T2.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:F2.PRESSURE,prefixes:T2.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:F2.PRESSURE,prefixes:T2.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:F2.PRESSURE,prefixes:T2.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:F2.ELECTRIC_CHARGE,prefixes:T2.LONG,value:1,offset:0},C:{name:"C",base:F2.ELECTRIC_CHARGE,prefixes:T2.SHORT,value:1,offset:0},farad:{name:"farad",base:F2.ELECTRIC_CAPACITANCE,prefixes:T2.LONG,value:1,offset:0},F:{name:"F",base:F2.ELECTRIC_CAPACITANCE,prefixes:T2.SHORT,value:1,offset:0},volt:{name:"volt",base:F2.ELECTRIC_POTENTIAL,prefixes:T2.LONG,value:1,offset:0},V:{name:"V",base:F2.ELECTRIC_POTENTIAL,prefixes:T2.SHORT,value:1,offset:0},ohm:{name:"ohm",base:F2.ELECTRIC_RESISTANCE,prefixes:T2.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:F2.ELECTRIC_INDUCTANCE,prefixes:T2.LONG,value:1,offset:0},H:{name:"H",base:F2.ELECTRIC_INDUCTANCE,prefixes:T2.SHORT,value:1,offset:0},siemens:{name:"siemens",base:F2.ELECTRIC_CONDUCTANCE,prefixes:T2.LONG,value:1,offset:0},S:{name:"S",base:F2.ELECTRIC_CONDUCTANCE,prefixes:T2.SHORT,value:1,offset:0},weber:{name:"weber",base:F2.MAGNETIC_FLUX,prefixes:T2.LONG,value:1,offset:0},Wb:{name:"Wb",base:F2.MAGNETIC_FLUX,prefixes:T2.SHORT,value:1,offset:0},tesla:{name:"tesla",base:F2.MAGNETIC_FLUX_DENSITY,prefixes:T2.LONG,value:1,offset:0},T:{name:"T",base:F2.MAGNETIC_FLUX_DENSITY,prefixes:T2.SHORT,value:1,offset:0},b:{name:"b",base:F2.BIT,prefixes:T2.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:F2.BIT,prefixes:T2.BINARY_LONG,value:1,offset:0},B:{name:"B",base:F2.BIT,prefixes:T2.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:F2.BIT,prefixes:T2.BINARY_LONG,value:8,offset:0}},O2={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fldr:"fluiddram",fluiddrams:"fluiddram",floz:"fluidounce",fluidounces:"fluidounce",gi:"gill",gills:"gill",cp:"cup",cups:"cup",pt:"pint",pints:"pint",qt:"quart",quarts:"quart",gal:"gallon",gallons:"gallon",bbl:"beerbarrel",beerbarrels:"beerbarrel",obl:"oilbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function _2(e3){if(e3.number==="BigNumber"){let e4=_l(d2);D2.rad.value=new d2(1),D2.deg.value=e4.div(180),D2.grad.value=e4.div(200),D2.cycle.value=e4.times(2),D2.arcsec.value=e4.div(648e3),D2.arcmin.value=e4.div(10800)}else D2.rad.value=1,D2.deg.value=Math.PI/180,D2.grad.value=Math.PI/200,D2.cycle.value=2*Math.PI,D2.arcsec.value=Math.PI/648e3,D2.arcmin.value=Math.PI/10800;D2.radian.value=D2.rad.value,D2.degree.value=D2.deg.value,D2.gradian.value=D2.grad.value}_2(c2),t2&&t2("config",function(e3,t3){e3.number!==t3.number&&_2(e3)});let z2={si:{NONE:{unit:j2,prefix:T2.NONE[""]},LENGTH:{unit:D2.m,prefix:T2.SHORT[""]},MASS:{unit:D2.g,prefix:T2.SHORT.k},TIME:{unit:D2.s,prefix:T2.SHORT[""]},CURRENT:{unit:D2.A,prefix:T2.SHORT[""]},TEMPERATURE:{unit:D2.K,prefix:T2.SHORT[""]},LUMINOUS_INTENSITY:{unit:D2.cd,prefix:T2.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:D2.mol,prefix:T2.SHORT[""]},ANGLE:{unit:D2.rad,prefix:T2.SHORT[""]},BIT:{unit:D2.bits,prefix:T2.SHORT[""]},FORCE:{unit:D2.N,prefix:T2.SHORT[""]},ENERGY:{unit:D2.J,prefix:T2.SHORT[""]},POWER:{unit:D2.W,prefix:T2.SHORT[""]},PRESSURE:{unit:D2.Pa,prefix:T2.SHORT[""]},ELECTRIC_CHARGE:{unit:D2.C,prefix:T2.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:D2.F,prefix:T2.SHORT[""]},ELECTRIC_POTENTIAL:{unit:D2.V,prefix:T2.SHORT[""]},ELECTRIC_RESISTANCE:{unit:D2.ohm,prefix:T2.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:D2.H,prefix:T2.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:D2.S,prefix:T2.SHORT[""]},MAGNETIC_FLUX:{unit:D2.Wb,prefix:T2.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:D2.T,prefix:T2.SHORT[""]},FREQUENCY:{unit:D2.Hz,prefix:T2.SHORT[""]}}};z2.cgs=JSON.parse(JSON.stringify(z2.si)),z2.cgs.LENGTH={unit:D2.m,prefix:T2.SHORT.c},z2.cgs.MASS={unit:D2.g,prefix:T2.SHORT[""]},z2.cgs.FORCE={unit:D2.dyn,prefix:T2.SHORT[""]},z2.cgs.ENERGY={unit:D2.erg,prefix:T2.NONE[""]},z2.us=JSON.parse(JSON.stringify(z2.si)),z2.us.LENGTH={unit:D2.ft,prefix:T2.NONE[""]},z2.us.MASS={unit:D2.lbm,prefix:T2.NONE[""]},z2.us.TEMPERATURE={unit:D2.degF,prefix:T2.NONE[""]},z2.us.FORCE={unit:D2.lbf,prefix:T2.NONE[""]},z2.us.ENERGY={unit:D2.BTU,prefix:T2.BTU[""]},z2.us.POWER={unit:D2.hp,prefix:T2.NONE[""]},z2.us.PRESSURE={unit:D2.psi,prefix:T2.NONE[""]},z2.auto=JSON.parse(JSON.stringify(z2.si));let q2=z2.auto;y2.setUnitSystem=function(e3){if(!ue(z2,e3))throw new Error("Unit system "+e3+" does not exist. Choices are: "+Object.keys(z2).join(", "));q2=z2[e3]},y2.getUnitSystem=function(){for(let e3 in z2)if(ue(z2,e3)&&z2[e3]===q2)return e3},y2.typeConverters={BigNumber:function(e3){return e3!=null&&e3.isFraction?new d2(String(e3.n)).div(String(e3.d)).times(String(e3.s)):new d2(e3+"")},Fraction:function(e3){return new g2(e3)},Complex:function(e3){return e3},number:function(e3){return e3!=null&&e3.isFraction?r3(e3):e3}},y2.prototype._numberConverter=function(){var e3=y2.typeConverters[this.valueType()];if(e3)return e3;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},y2._getNumberConverter=function(e3){if(y2.typeConverters[e3])return y2.typeConverters[e3];throw new TypeError('Unsupported type "'+e3+'"')};for(let e3 in D2)if(ue(D2,e3)){let t3=D2[e3];t3.dimensions=t3.base.dimensions}for(let e3 in O2)if(ue(O2,e3)){let t3=D2[O2[e3]],c3={};for(let e4 in t3)ue(t3,e4)&&(c3[e4]=t3[e4]);c3.name=e3,D2[e3]=c3}return y2.isValidAlpha=function(e3){return/^[a-zA-Z]$/.test(e3)},y2.createUnit=function(t3,r4){if(typeof t3!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(r4&&r4.override){for(let r5 in t3)if(ue(t3,r5)&&y2.deleteUnit(r5),t3[r5].aliases)for(let e4=0;e4{let{typed:t2,Unit:r3}=e2;return t2("unit",{Unit:function(e3){return e3.clone()},string:function(e3){return r3.isValuelessUnit(e3)?new r3(null,e3):r3.parse(e3,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(e3,t3){return new r3(e3,t3)},"number | BigNumber | Fraction":function(e3){return new r3(e3)},"Array | Matrix":t2.referToSelf(t3=>e3=>le(e3,t3))})}),Rl=s("sparse",["typed","SparseMatrix"],e2=>{let{typed:t2,SparseMatrix:r3}=e2;return t2("sparse",{"":function(){return new r3([])},string:function(e3){return new r3([],e3)},"Array | Matrix":function(e3){return new r3(e3)},"Array | Matrix, string":function(e3,t3){return new r3(e3,t3)}})}),Pl="createUnit",Ul=s(Pl,["typed","Unit"],e2=>{let{typed:t2,Unit:i2}=e2;return t2(Pl,{"Object, Object":function(e3,t3){return i2.createUnit(e3,t3)},Object:function(e3){return i2.createUnit(e3,{})},"string, Unit | string | Object, Object":function(e3,t3,r3){let n3={};return n3[e3]=t3,i2.createUnit(n3,r3)},"string, Unit | string | Object":function(e3,t3){let r3={};return r3[e3]=t3,i2.createUnit(r3,{})},string:function(e3){let t3={};return t3[e3]={},i2.createUnit(t3,{})}})}),jl=s("acos",["typed","config","Complex"],e2=>{let{typed:t2,config:r3,Complex:n3}=e2;return t2("acos",{number:function(e3){return-1<=e3&&e3<=1||r3.predictable?Math.acos(e3):new n3(e3,0).acos()},Complex:function(e3){return e3.acos()},BigNumber:function(e3){return e3.acos()}})}),Ll="number";function $l(e2){return Qe(e2)}function Hl(e2){return Math.atan(1/e2)}function Gl(e2){return isFinite(e2)?(Math.log((e2+1)/e2)+Math.log(e2/(e2-1)))/2:0}function Vl(e2){return Math.asin(1/e2)}function Zl(e2){return e2=1/e2,Math.log(e2+Math.sqrt(e2*e2+1))}function Wl(e2){return Math.acos(1/e2)}function Yl(e2){var e2=1/e2,t2=Math.sqrt(e2*e2-1);return Math.log(t2+e2)}function Jl(e2){return Ke(e2)}function Xl(e2){return et(e2)}function Ql(e2){return 1/Math.tan(e2)}function Kl(e2){return e2=Math.exp(2*e2),(e2+1)/(e2-1)}function ec(e2){return 1/Math.sin(e2)}function tc(e2){return e2===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e2)-Math.exp(-e2)))*ke(e2)}function rc(e2){return 1/Math.cos(e2)}function nc(e2){return 2/(Math.exp(e2)+Math.exp(-e2))}function ic(e2){return rt(e2)}ic.signature=nc.signature=rc.signature=tc.signature=ec.signature=Kl.signature=Ql.signature=Xl.signature=Jl.signature=Yl.signature=Wl.signature=Zl.signature=Vl.signature=Gl.signature=Hl.signature=$l.signature=Ll;let ac=s("acosh",["typed","config","Complex"],e2=>{let{typed:t2,config:r3,Complex:n3}=e2;return t2("acosh",{number:function(e3){return 1<=e3||r3.predictable?$l(e3):e3<=-1?new n3(Math.log(Math.sqrt(e3*e3-1)-e3),Math.PI):new n3(e3,0).acosh()},Complex:function(e3){return e3.acosh()},BigNumber:function(e3){return e3.acosh()}})}),oc=s("acot",["typed","BigNumber"],e2=>{let{typed:t2,BigNumber:r3}=e2;return t2("acot",{number:Hl,Complex:function(e3){return e3.acot()},BigNumber:function(e3){return new r3(1).div(e3).atan()}})}),sc=s("acoth",["typed","config","Complex","BigNumber"],e2=>{let{typed:t2,config:r3,Complex:n3,BigNumber:i2}=e2;return t2("acoth",{number:function(e3){return 1<=e3||e3<=-1||r3.predictable?Gl(e3):new n3(e3,0).acoth()},Complex:function(e3){return e3.acoth()},BigNumber:function(e3){return new i2(1).div(e3).atanh()}})}),uc=s("acsc",["typed","config","Complex","BigNumber"],e2=>{let{typed:t2,config:r3,Complex:n3,BigNumber:i2}=e2;return t2("acsc",{number:function(e3){return e3<=-1||1<=e3||r3.predictable?Vl(e3):new n3(e3,0).acsc()},Complex:function(e3){return e3.acsc()},BigNumber:function(e3){return new i2(1).div(e3).asin()}})}),lc=s("acsch",["typed","BigNumber"],e2=>{let{typed:t2,BigNumber:r3}=e2;return t2("acsch",{number:Zl,Complex:function(e3){return e3.acsch()},BigNumber:function(e3){return new r3(1).div(e3).asinh()}})}),cc=s("asec",["typed","config","Complex","BigNumber"],e2=>{let{typed:t2,config:r3,Complex:n3,BigNumber:i2}=e2;return t2("asec",{number:function(e3){return e3<=-1||1<=e3||r3.predictable?Wl(e3):new n3(e3,0).asec()},Complex:function(e3){return e3.asec()},BigNumber:function(e3){return new i2(1).div(e3).acos()}})}),fc=s("asech",["typed","config","Complex","BigNumber"],e2=>{let{typed:t2,config:n3,Complex:i2,BigNumber:r3}=e2;return t2("asech",{number:function(e3){if(e3<=1&&-1<=e3||n3.predictable){var t3=1/e3;if(0{let{typed:t2,config:r3,Complex:n3}=e2;return t2("asin",{number:function(e3){return-1<=e3&&e3<=1||r3.predictable?Math.asin(e3):new n3(e3,0).asin()},Complex:function(e3){return e3.asin()},BigNumber:function(e3){return e3.asin()}})}),mc=s("asinh",["typed"],e2=>{let t2=e2.typed;return t2("asinh",{number:Jl,Complex:function(e3){return e3.asinh()},BigNumber:function(e3){return e3.asinh()}})}),hc=s("atan",["typed"],e2=>{let t2=e2.typed;return t2("atan",{number:function(e3){return Math.atan(e3)},Complex:function(e3){return e3.atan()},BigNumber:function(e3){return e3.atan()}})}),dc=s("atan2",["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],e2=>{let{typed:t2,matrix:r3,equalScalar:n3,BigNumber:i2,DenseMatrix:a2,concat:o2}=e2,s2=Ra({typed:t2,equalScalar:n3}),u2=Pa({typed:t2}),l2=ho({typed:t2,equalScalar:n3}),c2=Aa({typed:t2,equalScalar:n3}),f2=x({typed:t2,DenseMatrix:a2}),p2=C({typed:t2,matrix:r3,concat:o2});return t2("atan2",{"number, number":Math.atan2,"BigNumber, BigNumber":(e3,t3)=>i2.atan2(e3,t3)},p2({scalar:"number | BigNumber",SS:l2,DS:u2,SD:s2,Ss:c2,sS:f2}))}),gc=s("atanh",["typed","config","Complex"],e2=>{let{typed:t2,config:r3,Complex:n3}=e2;return t2("atanh",{number:function(e3){return e3<=1&&-1<=e3||r3.predictable?Xl(e3):new n3(e3,0).atanh()},Complex:function(e3){return e3.atanh()},BigNumber:function(e3){return e3.atanh()}})}),yc=s("trigUnit",["typed"],e2=>{let r3=e2.typed;return{Unit:r3.referToSelf(t2=>e3=>{if(e3.hasBase(e3.constructor.BASE_UNITS.ANGLE))return r3.find(t2,e3.valueType())(e3.value);throw new TypeError("Unit in function cot is no angle")})}}),xc=s("cos",["typed"],e2=>{let t2=e2.typed;return e2=yc({typed:t2}),t2("cos",{number:Math.cos,"Complex | BigNumber":e3=>e3.cos()},e2)}),bc=s("cosh",["typed"],e2=>{let t2=e2.typed;return t2("cosh",{number:tt,"Complex | BigNumber":e3=>e3.cosh()})}),vc=s("cot",["typed","BigNumber"],e2=>{let{typed:t2,BigNumber:r3}=e2;return t2("cot",{number:Ql,Complex:e3=>e3.cot(),BigNumber:e3=>new r3(1).div(e3.tan())},yc({typed:t2}))}),wc=s("coth",["typed","BigNumber"],e2=>{let{typed:t2,BigNumber:r3}=e2;return t2("coth",{number:Kl,Complex:e3=>e3.coth(),BigNumber:e3=>new r3(1).div(e3.tanh())})}),Nc=s("csc",["typed","BigNumber"],e2=>{let{typed:t2,BigNumber:r3}=e2;return t2("csc",{number:ec,Complex:e3=>e3.csc(),BigNumber:e3=>new r3(1).div(e3.sin())},yc({typed:t2}))}),Ac=s("csch",["typed","BigNumber"],e2=>{let{typed:t2,BigNumber:r3}=e2;return t2("csch",{number:tc,Complex:e3=>e3.csch(),BigNumber:e3=>new r3(1).div(e3.sinh())})}),Ec=s("sec",["typed","BigNumber"],e2=>{let{typed:t2,BigNumber:r3}=e2;return t2("sec",{number:rc,Complex:e3=>e3.sec(),BigNumber:e3=>new r3(1).div(e3.cos())},yc({typed:t2}))}),Sc=s("sech",["typed","BigNumber"],e2=>{let{typed:t2,BigNumber:r3}=e2;return t2("sech",{number:nc,Complex:e3=>e3.sech(),BigNumber:e3=>new r3(1).div(e3.cosh())})}),Mc=s("sin",["typed"],e2=>{let t2=e2.typed;return e2=yc({typed:t2}),t2("sin",{number:Math.sin,"Complex | BigNumber":e3=>e3.sin()},e2)}),Cc=s("sinh",["typed"],e2=>{let t2=e2.typed;return t2("sinh",{number:ic,"Complex | BigNumber":e3=>e3.sinh()})}),Tc=s("tan",["typed"],e2=>{let t2=e2.typed;return e2=yc({typed:t2}),t2("tan",{number:Math.tan,"Complex | BigNumber":e3=>e3.tan()},e2)}),Bc=s("tanh",["typed"],e2=>{let t2=e2.typed;return t2("tanh",{number:nt,"Complex | BigNumber":e3=>e3.tanh()})}),Fc="setCartesian",Dc=s(Fc,["typed","size","subset","compareNatural","Index","DenseMatrix"],e2=>{let{typed:t2,size:n3,subset:i2,compareNatural:a2,Index:o2,DenseMatrix:s2}=e2;return t2(Fc,{"Array | Matrix, Array | Matrix":function(e3,t3){let r3=[];if(i2(n3(e3),new o2(0))!==0&&i2(n3(t3),new o2(0))!==0){let n4=E(Array.isArray(e3)?e3:e3.toArray()).sort(a2),i3=E(Array.isArray(t3)?t3:t3.toArray()).sort(a2);r3=[];for(let t4=0;t4{let{typed:t2,size:i2,subset:a2,compareNatural:o2,Index:r3,DenseMatrix:s2}=e2;return t2(Oc,{"Array | Matrix, Array | Matrix":function(e3,t3){let n3;if(a2(i2(e3),new r3(0))===0)n3=[];else{if(a2(i2(t3),new r3(0))===0)return E(e3.toArray());{let i3=Pn(E(Array.isArray(e3)?e3:e3.toArray()).sort(o2)),a3=Pn(E(Array.isArray(t3)?t3:t3.toArray()).sort(o2)),r4;n3=[];for(let t4=0;t4{let{typed:t2,size:r3,subset:n3,compareNatural:i2,Index:a2,DenseMatrix:o2}=e2;return t2(zc,{"Array | Matrix":function(e3){let t3;if(n3(r3(e3),new a2(0))===0)t3=[];else{let r4=E(Array.isArray(e3)?e3:e3.toArray()).sort(i2);(t3=[]).push(r4[0]);for(let e4=1;e4{let{typed:t2,size:n3,subset:i2,compareNatural:a2,Index:o2,DenseMatrix:s2}=e2;return t2(Ic,{"Array | Matrix, Array | Matrix":function(e3,t3){let r3;if(i2(n3(e3),new o2(0))===0||i2(n3(t3),new o2(0))===0)r3=[];else{let n4=Pn(E(Array.isArray(e3)?e3:e3.toArray()).sort(a2)),i3=Pn(E(Array.isArray(t3)?t3:t3.toArray()).sort(a2));r3=[];for(let t4=0;t4{let{typed:t2,size:a2,subset:o2,compareNatural:s2,Index:u2}=e2;return t2(Rc,{"Array | Matrix, Array | Matrix":function(e3,t3){if(o2(a2(e3),new u2(0))===0)return!0;if(o2(a2(t3),new u2(0))===0)return!1;var r3=Pn(E(Array.isArray(e3)?e3:e3.toArray()).sort(s2)),n3=Pn(E(Array.isArray(t3)?t3:t3.toArray()).sort(s2));let i2;for(let t4=0;t4{let{typed:t2,size:i2,subset:a2,compareNatural:o2,Index:s2}=e2;return t2(Uc,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(t3,e3){if(a2(i2(e3),new s2(0))===0)return 0;var r3=E(Array.isArray(e3)?e3:e3.toArray());let n3=0;for(let e4=0;e4{let{typed:t2,size:o2,subset:s2,compareNatural:u2,Index:l2}=e2;return t2(Lc,{"Array | Matrix":function(e3){if(s2(o2(e3),new l2(0))===0)return[];let t3=E(Array.isArray(e3)?e3:e3.toArray()).sort(u2),r3=[],n3=0;for(;n3.toString(2).length<=t3.length;)r3.push((function(t4,r4){let n4=[];for(let e4=0;e4a2[e4+1].length&&(i2=a2[e4],a2[e4]=a2[e4+1],a2[e4+1]=i2);return a2}})}),Hc="setSize",Gc=s(Hc,["typed","compareNatural"],e2=>{let{typed:t2,compareNatural:n3}=e2;return t2(Hc,{"Array | Matrix":function(e3){return(Array.isArray(e3)?E(e3):E(e3.toArray())).length},"Array | Matrix, boolean":function(e3,r3){if(r3===!1||e3.length===0)return(Array.isArray(e3)?E(e3):E(e3.toArray())).length;{let r4=E(Array.isArray(e3)?e3:e3.toArray()).sort(n3),t3=1;for(let e4=1;e4{let{typed:t2,size:r3,concat:n3,subset:i2,setDifference:a2,Index:o2}=e2;return t2(Vc,{"Array | Matrix, Array | Matrix":function(e3,t3){return i2(r3(e3),new o2(0))===0?E(t3):i2(r3(t3),new o2(0))===0?E(e3):(e3=E(e3),t3=E(t3),n3(a2(e3,t3),a2(t3,e3)))}})}),Wc="setUnion",Yc=s(Wc,["typed","size","concat","subset","setIntersect","setSymDifference","Index"],e2=>{let{typed:t2,size:r3,concat:n3,subset:i2,setIntersect:a2,setSymDifference:o2,Index:s2}=e2;return t2(Wc,{"Array | Matrix, Array | Matrix":function(e3,t3){return i2(r3(e3),new s2(0))===0?E(t3):i2(r3(t3),new s2(0))===0?E(e3):(e3=E(e3),t3=E(t3),n3(o2(e3,t3),a2(e3,t3)))}})}),Jc=s("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],e2=>{let{typed:t2,matrix:r3,addScalar:n3,equalScalar:i2,DenseMatrix:a2,concat:o2}=e2,s2=Ha({typed:t2}),u2=Ga({typed:t2,equalScalar:i2}),l2=Va({typed:t2,DenseMatrix:a2}),c2=C({typed:t2,matrix:r3,concat:o2});return t2("add",{"any, any":n3,"any, any, ...any":t2.referToSelf(i3=>(e3,t3,r4)=>{let n4=i3(e3,t3);for(let e4=0;e4{let{typed:t2,abs:a2,addScalar:o2,divideScalar:s2,multiplyScalar:u2,sqrt:l2,smaller:c2,isPositive:f2}=e2;return t2("hypot",{"... number | BigNumber":r3,Array:r3,Matrix:e3=>r3(E(e3.toArray(),!0))});function r3(t3){let r4=0,n3=0;for(let e3=0;e3{let{typed:t2,abs:s2,add:u2,pow:l2,conj:c2,sqrt:f2,multiply:p2,equalScalar:m2,larger:h2,smaller:d2,matrix:r3,ctranspose:g2,eigs:y2}=e2;return t2("norm",{number:Math.abs,Complex:function(e3){return e3.abs()},BigNumber:function(e3){return e3.abs()},boolean:function(e3){return Math.abs(e3)},Array:function(e3){return x2(r3(e3),2)},Matrix:function(e3){return x2(e3,2)},"Array, number | BigNumber | string":function(e3,t3){return x2(r3(e3),t3)},"Matrix, number | BigNumber | string":x2});function x2(e3,t3){var r4=e3.size();if(r4.length===1){var n3=e3,i2=t3;if(i2===Number.POSITIVE_INFINITY||i2==="inf"){let t4=0;return n3.forEach(function(e4){e4=s2(e4),h2(e4,t4)&&(t4=e4)},!0),t4}if(i2===Number.NEGATIVE_INFINITY||i2==="-inf"){let t4;return n3.forEach(function(e4){e4=s2(e4),t4&&!d2(e4,t4)||(t4=e4)},!0),t4||0}if(i2==="fro")return x2(n3,2);if(typeof i2!="number"||isNaN(i2))throw new Error("Unsupported parameter value");if(m2(i2,0))return Number.POSITIVE_INFINITY;{let t4=0;return n3.forEach(function(e4){t4=u2(l2(s2(e4),i2),t4)},!0),l2(t4,1/i2)}}if(r4.length===2){if(r4[0]&&r4[1]){if(n3=e3,r4=t3,r4===1){let a2=[],r5=0;return n3.forEach(function(e4,t4){t4=t4[1],e4=u2(a2[t4]||0,s2(e4)),h2(e4,r5)&&(r5=e4),a2[t4]=e4},!0),r5}if(r4===Number.POSITIVE_INFINITY||r4==="inf"){let o2=[],r5=0;return n3.forEach(function(e4,t4){t4=t4[0],e4=u2(o2[t4]||0,s2(e4)),h2(e4,r5)&&(r5=e4),o2[t4]=e4},!0),r5}if(r4==="fro"){let r5=0;return n3.forEach(function(e4,t4){r5=u2(r5,p2(e4,c2(e4)))}),s2(f2(r5))}if(r4!==2)throw new Error("Unsupported parameter value "+r4);if((n3=(r4=n3).size())[0]!==n3[1])throw new RangeError("Invalid matrix dimensions");return n3=g2(r4),n3=p2(n3,r4),r4=y2(n3).values.toArray(),n3=r4[r4.length-1],s2(f2(n3))}throw new RangeError("Invalid matrix dimensions")}}}),Kc=s("dot",["typed","addScalar","multiplyScalar","conj","size"],e2=>{let{typed:l2,addScalar:f2,multiplyScalar:p2,conj:c2,size:t2}=e2;return l2("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e3,t3){var r3=m2(e3,t3),n3=_(e3)?e3._data:e3,i2=_(e3)?e3._datatype||e3.getDataType():void 0,a2=_(t3)?t3._data:t3,o2=_(t3)?t3._datatype||t3.getDataType():void 0,e3=h2(e3).length===2,t3=h2(t3).length===2;let s2=f2,u2=p2;if(i2&&o2&&i2===o2&&typeof i2=="string"&&i2!=="mixed"){let e4=i2;s2=l2.find(f2,[e4,e4]),u2=l2.find(p2,[e4,e4])}if(!e3&&!t3){let t4=u2(c2(n3[0]),a2[0]);for(let e4=1;e4t4?c3++:e4===t4&&(o2=s2(o2,u2(n3[l3],a2[c3])),l3++,c3++)}return o2}});function m2(e3,t3){let r3=h2(e3),n3=h2(t3),i2,a2;if(r3.length===1)i2=r3[0];else{if(r3.length!==2||r3[1]!==1)throw new RangeError("Expected a column vector, instead got a matrix of size ("+r3.join(", ")+")");i2=r3[0]}if(n3.length===1)a2=n3[0];else{if(n3.length!==2||n3[1]!==1)throw new RangeError("Expected a column vector, instead got a matrix of size ("+n3.join(", ")+")");a2=n3[0]}if(i2!==a2)throw new RangeError("Vectors must have equal length ("+i2+" != "+a2+")");if(i2===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return i2}function h2(e3){return _(e3)?e3.size():t2(e3)}}),ef=s("trace",["typed","matrix","add"],e2=>{let{typed:t2,matrix:r3,add:u2}=e2;return t2("trace",{Array:function(e3){return n3(r3(e3))},SparseMatrix:function(e3){let n4=e3._values,i2=e3._index,a2=e3._ptr,t3=e3._size,o2=t3[0],s2=t3[1];if(o2!==s2)throw new RangeError("Matrix must be square (size: "+S(t3)+")");{let r4=0;if(0t4)break}}return r4}},DenseMatrix:n3,any:ee});function n3(r4){var e3=r4._size,n4=r4._data;switch(e3.length){case 1:if(e3[0]===1)return ee(n4[0]);throw new RangeError("Matrix must be square (size: "+S(e3)+")");case 2:{let r5=e3[0];if(r5!==e3[1])throw new RangeError("Matrix must be square (size: "+S(e3)+")");{let t3=0;for(let e4=0;e4{let{typed:t2,Index:r3}=e2;return t2("index",{"...number | string | BigNumber | Range | Array | Matrix":function(e3){var e3=e3.map(function(e4){return Q(e4)?e4.toNumber():b(e4)||_(e4)?e4.map(function(e5){return Q(e5)?e5.toNumber():e5}):e4}),t3=new r3;return r3.apply(t3,e3),t3}})}),rf=new Set(["end"]),nf=s("Node",["mathWithTransform"],e2=>{let t2=e2.mathWithTransform;return class{get type(){return"Node"}get isNode(){return!0}evaluate(e3){return this.compile().evaluate(e3)}compile(){let n3=this._compile(t2,{}),i2={};return{evaluate:function(e3){var e3=U(e3),t3=e3;for(let r3 of[...rf])if(t3.has(r3))throw new Error('Scope contains an illegal symbol, "'+r3+'" is a reserved keyword');return n3(e3,i2,null)}}}_compile(e3,t3){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(e3){throw new Error("Cannot run forEach on a Node interface")}map(e3){throw new Error("Cannot run map on a Node interface")}_ifNode(e3){if(O(e3))return e3;throw new TypeError("Callback function must return a Node")}traverse(e3){e3(this,null,null),(function n3(e4,i2){e4.forEach(function(e5,t3,r3){i2(e5,t3,r3),n3(e5,i2)})})(this,e3)}transform(i2){return(function e3(t3,r3,n3){return r3=i2(t3,r3,n3),r3!==t3?r3:t3.map(e3)})(this,null,null)}filter(n3){let i2=[];return this.traverse(function(e3,t3,r3){n3(e3,t3,r3)&&i2.push(e3)}),i2}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(e3){return e3.cloneDeep()})}equals(e3){return!!e3&&this.type===e3.type&&De(this,e3)}toString(e3){var t3=this._getCustomString(e3);return t3!==void 0?t3:this._toString(e3)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(e3){var t3=this._getCustomString(e3);return t3!==void 0?t3:this._toHTML(e3)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(e3){var t3=this._getCustomString(e3);return t3!==void 0?t3:this._toTex(e3)}_toTex(e3){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(e3){if(e3&&typeof e3=="object")switch(typeof e3.handler){case"object":case"undefined":return;case"function":return e3.handler(this,e3);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}},{isClass:!0,isNode:!0});function af(e2){return(af=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e3){return typeof e3}:function(e3){return e3&&typeof Symbol=="function"&&e3.constructor===Symbol&&e3!==Symbol.prototype?"symbol":typeof e3})(e2)}function of(e2,t2,r3){var n3;n3=(function(e3){if(af(e3)!="object"||!e3)return e3;var t3=e3[Symbol.toPrimitive];if(t3===void 0)return String(e3);if(t3=t3.call(e3,"string"),af(t3)!="object")return t3;throw new TypeError("@@toPrimitive must return a primitive value.")})(t2),(t2=af(n3)=="symbol"?n3:n3+"")in e2?Object.defineProperty(e2,t2,{value:r3,enumerable:!0,configurable:!0,writable:!0}):e2[t2]=r3}function sf(e2){return e2&&e2.isIndexError?new En(e2.index+1,e2.min+1,e2.max!==void 0?e2.max+1:void 0):e2}function uf(e2){let r3=e2.subset;return function(e3,t2){try{if(Array.isArray(e3))return r3(e3,t2);if(e3&&typeof e3.subset=="function")return e3.subset(t2);if(typeof e3=="string")return r3(e3,t2);if(typeof e3!="object")throw new TypeError("Cannot apply index: unsupported type of object");if(t2.isObjectProperty())return h(e3,t2.getObjectProperty());throw new TypeError("Cannot apply a numeric index as object property")}catch(e4){throw sf(e4)}}}let lf="AccessorNode",cf=s(lf,["subset","Node"],e2=>{var{subset:e2,Node:t2}=e2;let o2=uf({subset:e2});function r3(e3){return!(ge(e3)||ye(e3)||ae(e3)||Ae(e3)||Se(e3)||Me(e3)||se(e3))}class n3 extends t2{constructor(e3,t3){if(super(),!O(e3))throw new TypeError('Node expected for parameter "object"');if(!Ee(t3))throw new TypeError('IndexNode expected for parameter "index"');this.object=e3,this.index=t3}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return lf}get isAccessorNode(){return!0}_compile(n4,e3){let i2=this.object._compile(n4,e3),a2=this.index._compile(n4,e3);if(this.index.isObjectProperty()){let n5=this.index.getObjectProperty();return function(e4,t3,r4){return h(i2(e4,t3,r4),n5)}}return function(e4,t3,r4){return r4=i2(e4,t3,r4),e4=a2(e4,t3,r4),o2(r4,e4)}}forEach(e3){e3(this.object,"object",this),e3(this.index,"index",this)}map(e3){return new n3(this._ifNode(e3(this.object,"object",this)),this._ifNode(e3(this.index,"index",this)))}clone(){return new n3(this.object,this.index)}_toString(e3){let t3=this.object.toString(e3);return(t3=r3(this.object)?"("+t3+")":t3)+this.index.toString(e3)}_toHTML(e3){let t3=this.object.toHTML(e3);return(t3=r3(this.object)?'('+t3+')':t3)+this.index.toHTML(e3)}_toTex(e3){let t3=this.object.toTex(e3);return(t3=r3(this.object)?"\\left(' + object + '\\right)":t3)+this.index.toTex(e3)}toJSON(){return{mathjs:lf,object:this.object,index:this.index}}static fromJSON(e3){return new n3(e3.object,e3.index)}}return of(n3,"name",lf),n3},{isClass:!0,isNode:!0}),ff="ArrayNode",pf=s(ff,["Node"],e2=>{e2=e2.Node;class n3 extends e2{constructor(e3){if(super(),this.items=e3||[],!Array.isArray(this.items)||!this.items.every(O))throw new TypeError("Array containing Nodes expected")}get type(){return ff}get isArrayNode(){return!0}_compile(t2,i2){let e3=zn(this.items,function(e4){return e4._compile(t2,i2)});if(t2.config.matrix==="Array")return function(t3,r3,n4){return zn(e3,function(e4){return e4(t3,r3,n4)})};{let i3=t2.matrix;return function(t3,r3,n4){return i3(zn(e3,function(e4){return e4(t3,r3,n4)}))}}}forEach(t2){for(let e3=0;e3['+this.items.map(function(e3){return e3.toHTML(t2)}).join(',')+']'}_toTex(o2){return(function t2(e3,r3){var n4=e3.some(ye)&&!e3.every(ye),i2=r3||n4,a2=i2?"&":"\\\\",e3=e3.map(function(e4){return e4.items?t2(e4.items,!r3):e4.toTex(o2)}).join(a2);return n4||!i2||i2&&!r3?"\\begin{bmatrix}"+e3+"\\end{bmatrix}":e3})(this.items,!1)}}return of(n3,"name",ff),n3},{isClass:!0,isNode:!0}),mf=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]},"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:nullish":{op:"??",associativity:"left",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function hf(e2,t2){if(!t2||t2!=="auto")return e2;let r3=e2;for(;Me(r3);)r3=r3.content;return r3}function F(e2,t2,r3,n3){let i2=e2;var a2=(i2=t2!=="keep"?e2.getContent():i2).getIdentifier();let o2=null;for(let e3=0;e3{var{subset:t2,matrix:r3,Node:e2}=e2;let c2=uf({subset:t2}),f2=(function(){let{subset:n4,matrix:i3}={subset:t2,matrix:r3};return function(r4,e3,t3){try{if(Array.isArray(r4))return i3(r4).subset(e3,t3).valueOf().forEach((e4,t4)=>{r4[t4]=e4}),r4;if(r4&&typeof r4.subset=="function")return r4.subset(e3,t3);if(typeof r4=="string")return n4(r4,e3,t3);if(typeof r4!="object")throw new TypeError("Cannot apply index: unsupported type of object");if(e3.isObjectProperty())return D(r4,e3.getObjectProperty(),t3),r4;throw TypeError("Cannot apply a numeric index as object property")}catch(r5){throw sf(r5)}}})();function i2(e3,t3,r4){var n4=F(e3,t3=t3||"keep",r4),e3=F(e3.value,t3,r4);return t3==="all"||e3!==null&&e3<=n4}class n3 extends e2{constructor(e3,t3,r4){if(super(),this.object=e3,this.index=r4?t3:null,this.value=r4||t3,!se(e3)&&!ge(e3))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(se(e3)&&e3.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!Ee(this.index))throw new TypeError('IndexNode expected as "index"');if(!O(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return yf}get isAssignmentNode(){return!0}_compile(o2,e3){let s2=this.object._compile(o2,e3),u2=this.index?this.index._compile(o2,e3):null,l2=this.value._compile(o2,e3),i3=this.object.name;if(this.index){if(this.index.isObjectProperty()){let o3=this.index.getObjectProperty();return function(e4,t3,r4){var n4=s2(e4,t3,r4),e4=l2(e4,t3,r4);return D(n4,o3,e4),e4}}if(se(this.object))return function(e4,t3,r4){var n4=s2(e4,t3,r4),r4=l2(e4,t3,r4),t3=u2(e4,t3,n4);return e4.set(i3,f2(n4,t3,r4)),r4};{let s3=this.object.object._compile(o2,e3);if(this.object.index.isObjectProperty()){let o3=this.object.index.getObjectProperty();return function(e4,t3,r4){var n4=s3(e4,t3,r4),i4=h(n4,o3),a2=u2(e4,t3,i4),e4=l2(e4,t3,r4);return D(n4,o3,f2(i4,a2,e4)),e4}}{let h2=this.object.index._compile(o2,e3);return function(e4,t3,r4){var n4=s3(e4,t3,r4),i4=h2(e4,t3,n4),a2=c2(n4,i4),o3=u2(e4,t3,a2),e4=l2(e4,t3,r4);return f2(n4,i4,f2(a2,o3,e4)),e4}}}}if(se(this.object))return function(e4,t3,r4){return t3=l2(e4,t3,r4),e4.set(i3,t3),t3};throw new TypeError("SymbolNode expected as object")}forEach(e3){e3(this.object,"object",this),this.index&&e3(this.index,"index",this),e3(this.value,"value",this)}map(e3){var t3=this._ifNode(e3(this.object,"object",this)),r4=this.index?this._ifNode(e3(this.index,"index",this)):null,e3=this._ifNode(e3(this.value,"value",this));return new n3(t3,r4,e3)}clone(){return new n3(this.object,this.index,this.value)}_toString(e3){var t3=this.object.toString(e3),r4=this.index?this.index.toString(e3):"";let n4=this.value.toString(e3);return t3+r4+" = "+(n4=i2(this,e3&&e3.parenthesis,e3&&e3.implicit)?"("+n4+")":n4)}toJSON(){return{mathjs:yf,object:this.object,index:this.index,value:this.value}}static fromJSON(e3){return new n3(e3.object,e3.index,e3.value)}_toHTML(e3){var t3=this.object.toHTML(e3),r4=this.index?this.index.toHTML(e3):"";let n4=this.value.toHTML(e3);return t3+r4+'='+(n4=i2(this,e3&&e3.parenthesis,e3&&e3.implicit)?'('+n4+')':n4)}_toTex(e3){var t3=this.object.toTex(e3),r4=this.index?this.index.toTex(e3):"";let n4=this.value.toTex(e3);return t3+r4+"="+(n4=i2(this,e3&&e3.parenthesis,e3&&e3.implicit)?`\\left(${n4}\\right)`:n4)}}return of(n3,"name",yf),n3},{isClass:!0,isNode:!0}),bf="BlockNode",vf=s(bf,["ResultSet","Node"],e2=>{let{ResultSet:o2,Node:t2}=e2;class i2 extends t2{constructor(e3){if(super(),!Array.isArray(e3))throw new Error("Array expected");this.blocks=e3.map(function(e4){var t3=e4&&e4.node,e4=!e4||e4.visible===void 0||e4.visible;if(!O(t3))throw new TypeError('Property "node" must be a Node');if(typeof e4!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:t3,visible:e4}})}get type(){return bf}get isBlockNode(){return!0}_compile(t3,r3){let e3=zn(this.blocks,function(e4){return{evaluate:e4.node._compile(t3,r3),visible:e4.visible}});return function(r4,n3,i3){let a2=[];return qn(e3,function(e4){var t4=e4.evaluate(r4,n3,i3);e4.visible&&a2.push(t4)}),new o2(a2)}}forEach(t3){for(let e3=0;e3{if(typeof t2?.render!="function")throw TypeError('[@mdit/plugin-tex]: "render" option should be a function');let{allowInlineWithSpace:n2=!1,mathFence:r2=!1,delimiters:i2="dollars",render:u}=t2;if(r2){let t3=e2.renderer.rules.fence;e2.renderer.rules.fence=(e3,n3,r3,i3,a2)=>{let o2=e3[n3];return o2.info.trim()==="math"?u(o2.content,!0,i3):t3(e3,n3,r3,i3,a2)}}(i2==="dollars"||i2==="all")&&(e2.inline.ruler.after("escape","math_inline_dollar",a(n2)),e2.block.ruler.after("blockquote","math_block_dollar",s,l)),(i2==="brackets"||i2==="all")&&(e2.inline.ruler.before("escape","math_inline_bracket",o()),e2.block.ruler.after("blockquote","math_block_bracket",c,l)),e2.renderer.rules.math_inline=(e3,t3,n3,r3)=>u(e3[t3].content,!1,r3),e2.renderer.rules.math_block=(e3,t3,n3,r3)=>u(e3[t3].content,!0,r3)}})}});var import_mathjs_min=__toESM(require_mathjs_min()),allowed={functions:new Set(["sin","cos","tan","asin","acos","atan","sqrt","log","log10","exp","abs","floor","celing","round","mod","gcd","lcm","factorial","combinations","permutations","min","max","sum","prod","mean","median","mode","variance","std"]),operators:new Set(["add","subtract","multiply","divide","pow","unaryMinus","unaryPlus","factorial","mod"]),nodetypes:new Set(["ConstantNode","ParenthesisNode","ArrayNode","OperatorNode","FunctionNode","SymbolNode"])};function calculation(text,blockCollector){return blockCollector&&(blockCollector.isHTML=!1,blockCollector.blocks=[]),text.replace(/\{@([^\n]+?)@\}/g,(match,raw)=>{let rendered;try{let node=import_mathjs_min.default.parse(raw);validate(node,allowed),rendered=String(node.evaluate())}catch{rendered=raw}return blockCollector&&blockCollector.blocks.push({type:"calculation",raw,rendered}),rendered})}function validate(node,allowed2){node.traverse(n=>{switch(n.type){case"ParenthesisNode":break;case"SymbolNode":break;case"FunctionNode":if(!allowed2.functions.has(n.fn.name))throw new Error(`Function not allowed: ${n.fn.name}`);break;case"OperatorNode":if(!allowed2.operators.has(n.fn))throw new Error(`Operator not allowed: ${n.fn}`);break;default:if(!allowed2.nodetypes.has(n.type))throw new Error(`Node type not allowed: ${n.type}`)}})}var import_mathjs_min2=__toESM(require_mathjs_min());function cas(text,blockCollector){return blockCollector&&(blockCollector.isHTML=!1,blockCollector.blocks=[]),text.replace(/\{@([^\n]+?)@\}/g,(match,raw)=>{let rendered;try{rendered=String(import_mathjs_min2.default.evaluate(raw))}catch{rendered=raw}return blockCollector&&blockCollector.blocks.push({type:"calculation",raw,rendered}),rendered})}var import_markdownit=__toESM(require_markdownit()),import_asciimathblock=__toESM(require_asciimathblock());function markdownitrules(mdit,options){"use strict";let state2=options.state,originalCodeRule=mdit.renderer.rules.code_inline;mdit.core.ruler.push("reset_collector",()=>{state2.collector&&(state2.collector.isHTML=!0,state2.collector.blocks=[])}),mdit.renderer.rules.code_inline=function(tokens,idx,options2,env,self2){let code=tokens[idx].content,rendered="";return state2.transforms.length===0?rendered=originalCodeRule(tokens,idx,options2,env,self2):rendered=applyTransforms(code,"code_inline"),state2.collector&&state2.collector.blocks.push({type:"code_inline",raw:code,rendered}),rendered},mdit.renderer.rules.asciimath_block=function(tokens,idx){let code=tokens[idx].content,rendered="";return state2.transforms.length===0?rendered="`"+mdit.render(code)+"`":rendered=applyTransforms(code,"asciimath_block"),state2.collector&&state2.collector.blocks.push({type:"asciimath_block",raw:code,rendered}),rendered},mdit.renderer.rules.math_inline=function(tokens,idx){let code=tokens[idx].content,rendered="";return state2.transforms.length===0?rendered="\\("+mdit.renderInline(code)+"\\)":rendered=applyTransforms(code,"math_inline"),state2.collector&&state2.collector.blocks.push({type:"math_inline",raw:code,rendered}),rendered},mdit.renderer.rules.math_block=function(tokens,idx){let code=tokens[idx].content,rendered="";return state2.transforms.length===0?rendered="\\["+mdit.render(code)+"\\]":rendered=applyTransforms(code,"math_block"),state2.collector&&state2.collector.blocks.push({type:"math_block",raw:code,rendered}),rendered};function splitBlock(code){return code.split(/\r?\n/).map(line=>line.trim()).filter(line=>line!=="")}function applyTransforms(code,rule){let lines=splitBlock(code);for(let transform of state2.transforms){if(!state2.transformLib[transform])throw new Error(`markdownitrules: unknown transform "${transform}"`);lines=state2.transformLib[transform](lines,rule)}return lines.join(` `)+` -`}}var mdItPluginTex=__toESM(require_tex());function asciimath(lines,rule){switch(rule){case"asciimath_block":case"code_inline":return isLaTeX(lines)?lines:lines.map(line=>window.AMparseMath(line,!0));default:return lines}}function isLaTeX(lines){let code=lines.join();return["^{","_{","\\left","\\right","\\begin"].some(s=>code.includes(s))?!0:/\\[a-zA-Z]+/.test(code)}function findtextindex(str,needle,without=[],strend=!1){let braceDepth=0;for(let i=0;istr.startsWith(token,i));if(isIncluded==null)continue;if(!without.some(token=>str.startsWith(token,i)))return strend?isIncluded.slice(isIncluded.length-1,isIncluded.length)=="{"?i+isIncluded.length-1:i+isIncluded.length:i}}return!1}function aligneq(lines,rule){switch(rule){case"asciimath_block":case"math_block":break;case"code_inline":case"math_inline":return lines;default:return lines}let skipenv=["align","flalign","alignat","xalignat","xxalignat","gather","multline","equation","split","subequations"].flatMap(token=>[`\\begin{${token}}`,`\\begin{${token}*}`]);var skip=!1;for(let str of lines)findtextindex(str,skipenv)!==!1&&(skip=!0);if(skip)return lines;let output=["\\begin{align*}"];for(let str of lines){str=str.replace(/^\s*(?:\\displaystyle\s*)?/,""),str=str.trim();let matchimp=["Rightarrow","Leftarrow","Leftrightarrow","therefore","because","checkmark","models","vdash"].flatMap(token=>[`\\${token}`,`\\${token}`,`\\${token}`]).find(token=>str.startsWith(token));var connector="";matchimp!==void 0&&(connector=str.slice(0,matchimp.length),str=str.slice(matchimp.length));let matchtxt=findtextindex(str,["\\text{"],["\\text{or}","\\text{and}","\\text{if}"]);matchtxt&&(str=str.slice(0,matchtxt)+" & & "+str.slice(matchtxt));let relst=["in","notin","subset","subseteq","supset","supseteq","leq","lt","le","geq","gt","ge","preq","preqeq","succ","succeq","ne","neq","approx","equiv","propto","cong"],relations=["=",">","<"].concat(relst.flatMap(token=>[`\\${token}{`,`\\${token} `])),matcheqed=findtextindex(str,relations,[],!0);matcheqed!==!1?str=str.slice(0,matcheqed)+" &\\, "+str.slice(matcheqed):str=" &\\, "+str,str=connector+" & & "+str.trim()+"\\\\",str=str.trim(),output.push(str)}return output.push("\\end{align*}"),output}function boldfilter(lines,rule){let rowBreak="\\\\";return lines.map((line,i)=>i===0||i===lines.length-1?line:splitTopLevelAmpersands(line).map(col=>{let trimmed=col.trim();if(trimmed==="")return col;let trailingBreak="";if(trimmed.endsWith(rowBreak)&&(trailingBreak=rowBreak,trimmed=trimmed.slice(0,-rowBreak.length).trim()),trimmed==="")return col;let displayPrefix="\\displaystyle",bold;if(trimmed.startsWith(displayPrefix)){let rest=trimmed.slice(displayPrefix.length).trim();bold=rest?`${displayPrefix}\\boldsymbol{${rest}}`:displayPrefix}else bold=`\\boldsymbol{${trimmed}}`;return bold+trailingBreak}).join("&"))}function splitTopLevelAmpersands(line){let cols=[],start=0,depth=0,envStack=[];for(let i=0;i0?line[i-1]:"";if(ch==="{"&&prev!=="\\"){depth++;continue}if(ch==="}"&&prev!=="\\"){depth=Math.max(0,depth-1);continue}ch==="&"&&prev!=="\\"&&depth===0&&envStack.length===0&&(cols.push(line.slice(start,i)),start=i+1)}return cols.push(line.slice(start)),cols}function minwrap(lines,rule){if(lines&&lines.length===0)return[""];switch(rule){case"asciimath_block":case"math_block":return wraplatex(lines);case"code_inline":case"math_inline":return[`\\(${lines[0]}\\)`];default:return lines}}function wraplatex(lines){let skipenv=["align","flalign","alignat","xalignat","xxalignat","gather","multline","equation","split","subequations"].flatMap(token=>[`\\begin{${token}}`,`\\begin{${token}*}`]);var skip=!1;for(let str of lines)findtextindex(str,skipenv)!==!1&&(skip=!0);return skip||(lines.push("\\]"),lines.unshift("\\[")),lines}var transformLib={asciimath,boldfilter,aligneq,minwrap},state={transforms:[],transformLib,collector:null},converter=(0,import_markdownit.default)({html:!0}).use(mdItPluginTex.tex,{render:content=>content,delimiters:"brackets"}).use(import_asciimathblock.default).use(markdownitrules,{state});function markdown(text,blockCollector,op){return state.transforms=(op.transforms||"").split(",").map(s=>s.trim()).filter(Boolean),state.collector=blockCollector||null,converter.render(text)}function cas2(text,blockCollector){return blockCollector&&(blockCollector.isHTML=!1,blockCollector.blocks=[]),text}function lastblock(raw,blocks){if(blocks&&blocks.length>0){for(let i=blocks.length-1;i>=0;i--){let block=blocks[i];if(block.type==="code_inline"||block.type==="asciimath_block")return block.raw}return"ERROR"}let lines=raw.split(/\r?\n/);for(let i=lines.length-1;i>=0;i--)if(lines[i].trim()!=="")return lines[i];return"ERROR"}function lastcalc(raw,blocks){if(blocks){for(let i=blocks.length-1;i>=0;i--)if(blocks[i].type==="calculation")return blocks[i].rendered.trim()}return"ERROR"}function lastexpr(raw,blocks){if(blocks&&blocks.length>0)for(let i=blocks.length-1;i>=0;i--){let block=blocks[i];if(block.type==="code_inline")return block.raw.trim();if(block.type==="asciimath_block"){let lines2=block.raw.split(/\r?\n/);for(let j=lines2.length-1;j>=0;j--){let trimmed=lines2[j].trim();if(trimmed!=="")return trimmed}}}let lines=raw.split(/\r?\n/);for(let i=lines.length-1;i>=0;i--){let trimmed=lines[i].trim();if(trimmed!=="")return trimmed}return"ERROR"}function laststringremainder(raw,blocks,operation){if(!operation||!operation.string)return"ERROR";let lines=raw.split(` -`);lines.reverse();for(let line of lines){let trimmed=line.replace(/^[\s`]+|[\s`]+$/g,"");if(trimmed.includes(operation.string))return trimmed=trimmed.replace(operation.string,""),trimmed.replace(/^[\s`]+|[\s`]+$/g,"")}return"ERROR"}function laststringremainderwhitespace(raw,blocks,operation){if(!operation||!operation.search)return"ERROR";var match=escaperegex(operation.search);match="^"+match+"\\s*`?([^`]+)`?";let pattern=new RegExp(match),lines=raw.split(` -`);lines.reverse();for(let line of lines){var trimmed=line.trim();trimmed.endsWith(".")&&(trimmed=trimmed.slice(0,-1),trimmed=trimmed.trim()),trimmed.startsWith("`")&&trimmed.endsWith("`")&&(trimmed=trimmed.slice(1,-1),trimmed=trimmed.trim());let matched=trimmed.match(pattern);if(matched)return matched[1].trim()}return"ERROR"}function escaperegex(str){return str.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s*")}function lastregexmatch(raw,blocks,operation){if(!operation||!operation.regex)return"ERROR";let pattern=new RegExp(operation.regex),lines=raw.split(` -`);lines.reverse();for(let line of lines){let trimmed=line.trim();if(pattern.test(trimmed))return trimmed}return"ERROR"}function lastregexremainder(raw,blocks,operation){if(!operation||!operation.regex)return"ERROR";let pattern=new RegExp(operation.regex),lines=raw.split(` -`);lines.reverse();for(let line of lines){let trimmed=line.trim();if(pattern.test(trimmed))return trimmed.replace(pattern,"")}return"ERROR"}function allregexmatch(raw,blocks,operation){if(!operation||!operation.regex)return"ERROR";let pattern=new RegExp(operation.regex),matches=[];for(let line of raw.split(` -`)){let trimmed=line.trim();trimmed&&pattern.test(trimmed)&&matches.push(trimmed)}return matches.length===0?"ERROR":JSON.stringify({matches})}function allregexremainder(raw,blocks,operation){if(!operation||!operation.regex)return"ERROR";let pattern=new RegExp(operation.regex),matches=[];for(let line of raw.split(` -`)){let trimmed=line.trim();trimmed&&pattern.test(trimmed)&&matches.push(trimmed.replace(pattern,""))}return matches.length===0?"ERROR":JSON.stringify({matches})}var filterlib={calculation,cas,markdown,plain:cas2},extractorlib={lastblock,lastcalc,lastexpr,laststringremainder,laststringremainderwhitespace,lastregexmatch,lastregexremainder,allregexmatch,allregexremainder};function init(inputIds,operations){let markdownContainerId=inputIds.length?inputIds[0]:null,suppliedText=document.getElementById("asciiSuppliedText").innerHTML,output=document.getElementById("asciiContainerRow"),syncScrollPosition=createScrollSyncHandler(markdownContainerId,typeof FRAME_ID<"u"?FRAME_ID:null,output),alloperations=operations,blockCollector={blocks:[],isHTML:!1};function renderMath(){let raw="";markdownContainerId?raw=document.getElementById(markdownContainerId).value:raw=suppliedText;let processedOutput=raw,isHTML=!1,displayfixed=!1,answerIndex=1;alloperations&&alloperations.forEach((currentop,i)=>{if(currentop.operation==="filter"){let filter=filterlib[currentop.type];if(filter){let filterInput=processedOutput;currentop.reset==="true"&&(filterInput=raw);let filterOutput=filter(filterInput,blockCollector,currentop);displayfixed||(processedOutput=filterOutput,isHTML=blockCollector.isHTML),currentop.display==="true"&&(displayfixed=!0)}}else if(currentop.operation==="extractor"){let extractor=extractorlib[currentop.type]?extractorlib[currentop.type]:extractorlib.lastexpr,answerEl=document.getElementById(inputIds[answerIndex]);if(answerIndex++,extractor&&answerEl){let value=extractor(raw,blockCollector.blocks,currentop),oldValue=answerEl.value;value==="ERROR"?answerEl.value="":answerEl.value=value,answerEl.value!==oldValue&&answerEl.dispatchEvent(new Event("change"))}}}),isHTML||output.classList.add("plaintext"),output.innerHTML=processedOutput,syncScrollPosition(),typeof MathJax.typesetPromise=="function"?MathJax.typesetPromise([output]).then(()=>{syncScrollPosition()}):MathJax.Hub&&typeof MathJax.Hub.Queue=="function"&&(MathJax.Hub.Queue(["Typeset",MathJax.Hub,"asciiContainerRow"]),MathJax.Hub.Queue(()=>{syncScrollPosition()}))}if(markdownContainerId){let debounceTimer;document.getElementById(markdownContainerId).addEventListener("change",()=>{clearTimeout(debounceTimer),debounceTimer=setTimeout(renderMath,100)})}renderMath()}function setScrollPosition(element,position){let maxScroll=element.scrollHeight-element.clientHeight,previousScrollBehavior=element.style.scrollBehavior;element.style.scrollBehavior="auto",element.scrollTop=maxScroll>0?position*maxScroll:0,element.style.scrollBehavior=previousScrollBehavior}function createScrollSyncHandler(markdownContainerId,frameId,output){if(!markdownContainerId||!frameId)return()=>{};let syncedScrollPosition=0,syncScrollPosition=()=>{setScrollPosition(output,syncedScrollPosition)};window.addEventListener("message",event=>{let message=JSON.parse(event.data);message.tgt!==frameId||message.type!=="input-scroll-position"||message.name!==markdownContainerId||(syncedScrollPosition=message.position,syncScrollPosition())});let registration={version:"STACK-JS:1.6.0",type:"track-input-scroll",name:markdownContainerId,"limit-to-question":!0,src:frameId};return window.parent.postMessage(JSON.stringify(registration),"*"),syncScrollPosition}export{init as default}; +`}}var mdItPluginTex=__toESM(require_tex());function asciimath(lines,rule){switch(rule){case"asciimath_block":case"code_inline":return isLaTeX(lines)?lines:lines.map(line=>window.AMparseMath(line,!0));default:return lines}}function isLaTeX(lines){let code=lines.join();return["^{","_{","\\left","\\right","\\begin"].some(s=>code.includes(s))?!0:/\\[a-zA-Z]+/.test(code)}function findtextindex(str,needle,without=[],strend=!1){let braceDepth=0;for(let i=0;istr.startsWith(token,i));if(isIncluded==null)continue;if(!without.some(token=>str.startsWith(token,i)))return strend?isIncluded.slice(isIncluded.length-1,isIncluded.length)=="{"?i+isIncluded.length-1:i+isIncluded.length:i}}return!1}function aligneq(lines,rule){switch(rule){case"asciimath_block":case"math_block":break;case"code_inline":case"math_inline":return lines;default:return lines}let skipenv=["align","flalign","alignat","xalignat","xxalignat","gather","multline","equation","split","subequations"].flatMap(token=>[`\\begin{${token}}`,`\\begin{${token}*}`]);var skip=!1;for(let str of lines)findtextindex(str,skipenv)!==!1&&(skip=!0);if(skip)return lines;let output=["\\begin{align*}"];for(let str of lines){str=str.replace(/^\s*(?:\\displaystyle\s*)?/,""),str=str.trim();let matchimp=["Rightarrow","Leftarrow","Leftrightarrow","therefore","because","checkmark","models","vdash"].flatMap(token=>[`\\${token}`,`\\${token}`,`\\${token}`]).find(token=>str.startsWith(token));var connector="";matchimp!==void 0&&(connector=str.slice(0,matchimp.length),str=str.slice(matchimp.length));let matchtxt=findtextindex(str,["\\text{"],["\\text{or}","\\text{and}","\\text{if}"]);matchtxt&&(str=str.slice(0,matchtxt)+" & & "+str.slice(matchtxt));let relst=["in","notin","subset","subseteq","supset","supseteq","leq","lt","le","geq","gt","ge","preq","preqeq","succ","succeq","ne","neq","approx","equiv","propto","cong"],relations=["=",">","<"].concat(relst.flatMap(token=>[`\\${token}{`,`\\${token} `])),matcheqed=findtextindex(str,relations,[],!0);matcheqed!==!1?str=str.slice(0,matcheqed)+" &\\, "+str.slice(matcheqed):str=" &\\, "+str,str=connector+" & & "+str.trim()+"\\\\",str=str.trim(),output.push(str)}return output.push("\\end{align*}"),output}function boldfilter(lines,rule){let rowBreak="\\\\";return lines.map((line,i)=>i===0||i===lines.length-1?line:splitTopLevelAmpersands(line).map(col=>{let trimmed=col.trim();if(trimmed==="")return col;let trailingBreak="";if(trimmed.endsWith(rowBreak)&&(trailingBreak=rowBreak,trimmed=trimmed.slice(0,-rowBreak.length).trim()),trimmed==="")return col;let displayPrefix="\\displaystyle",bold;if(trimmed.startsWith(displayPrefix)){let rest=trimmed.slice(displayPrefix.length).trim();bold=rest?`${displayPrefix}\\boldsymbol{${rest}}`:displayPrefix}else bold=`\\boldsymbol{${trimmed}}`;return bold+trailingBreak}).join("&"))}function splitTopLevelAmpersands(line){let cols=[],start=0,depth=0,envStack=[];for(let i=0;i0?line[i-1]:"";if(ch==="{"&&prev!=="\\"){depth++;continue}if(ch==="}"&&prev!=="\\"){depth=Math.max(0,depth-1);continue}ch==="&"&&prev!=="\\"&&depth===0&&envStack.length===0&&(cols.push(line.slice(start,i)),start=i+1)}return cols.push(line.slice(start)),cols}function minwrap(lines,rule){if(lines&&lines.length===0)return[""];switch(rule){case"asciimath_block":case"math_block":return wraplatex(lines);case"code_inline":case"math_inline":return[`\\(${lines[0]}\\)`];default:return lines}}function wraplatex(lines){let skipenv=["align","flalign","alignat","xalignat","xxalignat","gather","multline","equation","split","subequations"].flatMap(token=>[`\\begin{${token}}`,`\\begin{${token}*}`]);var skip=!1;for(let str of lines)findtextindex(str,skipenv)!==!1&&(skip=!0);return skip||(lines.push("\\]"),lines.unshift("\\[")),lines}var transformLib={asciimath,boldfilter,aligneq,minwrap},state={transforms:[],transformLib,collector:null},converter=(0,import_markdownit.default)({html:!0}).use(mdItPluginTex.tex,{render:content=>content,delimiters:"brackets"}).use(import_asciimathblock.default).use(markdownitrules,{state});function markdown(text,blockCollector,op){return state.transforms=(op.transforms||"").split(",").map(s=>s.trim()).filter(Boolean),state.collector=blockCollector||null,converter.render(text)}function cas2(text,blockCollector){return blockCollector&&(blockCollector.isHTML=!1,blockCollector.blocks=[]),text}var extractorStrings={};function setExtractorStrings(strings={}){extractorStrings={...strings}}function extractorResult(result){return{result}}function extractorError(key,detail=""){let message=extractorStrings[key]||key;return detail!==""&&(message=message+" "+String(detail)),{error:message}}function lastblock(raw,blocks){if(blocks&&blocks.length>0){for(let i=blocks.length-1;i>=0;i--){let block=blocks[i];if(block.type==="code_inline")return extractorResult(block.raw);if(block.type==="asciimath_block")return extractorResult(block.raw)}return extractorError("asciistringextractorlastblocknotfound")}let lines=raw.split(/\r?\n/);for(let i=lines.length-1;i>=0;i--)if(lines[i].trim()!=="")return extractorResult(lines[i]);return extractorError("asciistringextractorlastblocknotfound")}function lastcalc(raw,blocks){if(blocks){for(let i=blocks.length-1;i>=0;i--)if(blocks[i].type==="calculation")return extractorResult(blocks[i].rendered.trim())}return extractorError("asciistringextractorlastcalcnotfound")}function lastexpr(raw,blocks){if(blocks&&blocks.length>0)for(let i=blocks.length-1;i>=0;i--){let block=blocks[i];if(block.type==="code_inline")return extractorResult(block.raw.trim());if(block.type==="asciimath_block"){let lines2=block.raw.split(/\r?\n/);for(let j=lines2.length-1;j>=0;j--){let trimmed=lines2[j].trim();if(trimmed!=="")return extractorResult(trimmed)}}}let lines=raw.split(/\r?\n/);for(let i=lines.length-1;i>=0;i--){let trimmed=lines[i].trim();if(trimmed!=="")return extractorResult(trimmed)}return extractorError("asciistringextractorlastexprnotfound")}function laststringremainder(raw,blocks,operation){if(!operation||!operation.string)return extractorError("asciistringextractorsearchrequired");let lines=raw.split(` +`);lines.reverse();for(let line of lines){let trimmed=line.replace(/^[\s`]+|[\s`]+$/g,"");if(trimmed.includes(operation.string))return trimmed=trimmed.replace(operation.string,""),extractorResult(trimmed.replace(/^[\s`]+|[\s`]+$/g,""))}return extractorError("asciistringextractorsearchnotfound")}function laststringremainderwhitespace(raw,blocks,operation){if(!operation||!operation.search)return extractorError("asciistringextractorsearchrequired");var match=escaperegex(operation.search);match="^"+match+"\\s*`?([^`]+)`?";let pattern=new RegExp(match),lines=raw.split(` +`);lines.reverse();for(let line of lines){var trimmed=line.trim();trimmed.endsWith(".")&&(trimmed=trimmed.slice(0,-1),trimmed=trimmed.trim()),trimmed.startsWith("`")&&trimmed.endsWith("`")&&(trimmed=trimmed.slice(1,-1),trimmed=trimmed.trim());let matched=trimmed.match(pattern);if(matched){let retmatch=matched[1];return extractorResult(retmatch.trim())}}return extractorError("asciistringextractorsearchnotfound")}function escaperegex(str){return str.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s*")}function lastregexmatch(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),lines=raw.split(` +`);lines.reverse();for(let line of lines){let trimmed=line.trim();if(pattern.test(trimmed))return extractorResult(trimmed)}return extractorError("asciistringextractorregexnotfound")}function lastregexremainder(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),lines=raw.split(` +`);lines.reverse();for(let line of lines){let trimmed=line.trim();if(pattern.test(trimmed))return extractorResult(trimmed.replace(pattern,""))}return extractorError("asciistringextractorregexnotfound")}function allregexmatch(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),matches=[];for(let line of raw.split(` +`)){let trimmed=line.trim();trimmed&&pattern.test(trimmed)&&matches.push(trimmed)}return matches.length===0?extractorError("asciistringextractorregexnotfound"):extractorResult(JSON.stringify({matches}))}function allregexremainder(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),matches=[];for(let line of raw.split(` +`)){let trimmed=line.trim();trimmed&&pattern.test(trimmed)&&matches.push(trimmed.replace(pattern,""))}return matches.length===0?extractorError("asciistringextractorregexnotfound"):extractorResult(JSON.stringify({matches}))}var filterlib={calculation,cas,markdown,plain:cas2},extractorlib={lastblock,lastcalc,lastexpr,laststringremainder,laststringremainderwhitespace,lastregexmatch,lastregexremainder,allregexmatch,allregexremainder};function init(inputIds,operations,options={}){setExtractorStrings(options.asciistrings||{});let markdownContainerId=inputIds.length?inputIds[0]:null,suppliedText=document.getElementById("asciiSuppliedText").innerHTML,shell=document.getElementById("asciiShell"),output=document.getElementById("asciiContainerRow"),renderedOutput=document.getElementById("asciiRenderedContent"),errorOutput=document.getElementById("asciiErrorRow"),syncScrollPosition=createScrollSyncHandler(markdownContainerId,typeof FRAME_ID<"u"?FRAME_ID:null,output),alloperations=operations,blockCollector={blocks:[],isHTML:!1};function renderMath(){let raw="";markdownContainerId?raw=document.getElementById(markdownContainerId).value:raw=suppliedText;let processedOutput=raw,isHTML=!1,displayfixed=!1,answerIndex=1,extractorErrors=[];if(alloperations&&alloperations.forEach((currentop,i)=>{if(currentop.operation==="filter"){let filter=filterlib[currentop.type];if(filter){let filterInput=processedOutput;currentop.reset==="true"&&(filterInput=raw);let filterOutput=filter(filterInput,blockCollector,currentop);displayfixed||(processedOutput=filterOutput,isHTML=blockCollector.isHTML),currentop.display==="true"&&(displayfixed=!0)}}else if(currentop.operation==="extractor"){let extractor=extractorlib[currentop.type]?extractorlib[currentop.type]:extractorlib.lastexpr,answerEl=document.getElementById(inputIds[answerIndex]);if(answerIndex++,extractor&&answerEl){let value=extractor(raw,blockCollector.blocks,currentop),oldValue=answerEl.value;value.error?(answerEl.value="",currentop.errors==="true"&&extractorErrors.push(value.error)):value.result?answerEl.value=value.result:answerEl.value=value,answerEl.value!==oldValue&&answerEl.dispatchEvent(new Event("change"))}}}),isHTML||output.classList.add("plaintext"),renderedOutput.innerHTML=processedOutput,extractorErrors.length>0){errorOutput.innerHTML=extractorErrors.map(message=>'

'+message+"

").join(""),shell.classList.add("stackascii-has-errors");let errorHeight=Number(errorOutput.offsetHeight)||0;renderedOutput.style.paddingBottom=`${errorHeight+5}px`}else shell.classList.remove("stackascii-has-errors"),renderedOutput.style.paddingBottom="";syncScrollPosition(),typeof MathJax.typesetPromise=="function"?MathJax.typesetPromise([output]).then(()=>{syncScrollPosition()}):MathJax.Hub&&typeof MathJax.Hub.Queue=="function"&&(MathJax.Hub.Queue(["Typeset",MathJax.Hub,"asciiContainerRow"]),MathJax.Hub.Queue(()=>{syncScrollPosition()}))}if(markdownContainerId){let debounceTimer;document.getElementById(markdownContainerId).addEventListener("change",()=>{clearTimeout(debounceTimer),debounceTimer=setTimeout(renderMath,100)})}renderMath()}function setScrollPosition(element,position){let maxScroll=element.scrollHeight-element.clientHeight,previousScrollBehavior=element.style.scrollBehavior;element.style.scrollBehavior="auto",element.scrollTop=maxScroll>0?position*maxScroll:0,element.style.scrollBehavior=previousScrollBehavior}function createScrollSyncHandler(markdownContainerId,frameId,output){if(!markdownContainerId||!frameId)return()=>{};let syncedScrollPosition=0,syncScrollPosition=()=>{setScrollPosition(output,syncedScrollPosition)};window.addEventListener("message",event=>{let message=JSON.parse(event.data);message.tgt!==frameId||message.type!=="input-scroll-position"||message.name!==markdownContainerId||(syncedScrollPosition=message.position,syncScrollPosition())});let registration={version:"STACK-JS:1.6.0",type:"track-input-scroll",name:markdownContainerId,"limit-to-question":!0,src:frameId};return window.parent.postMessage(JSON.stringify(registration),"*"),syncScrollPosition}export{init as default}; /*! For license information please see math.js.LICENSE.txt Licensed under Apache License 2.0 */ /*! markdown-it 14.1.1 https://github.com/markdown-it/markdown-it @license MIT */ /** diff --git a/corsscripts/ascii/stackascii.bundle.js.map b/corsscripts/ascii/stackascii.bundle.js.map index e81a1e8c580..b6bdbe96e3a 100644 --- a/corsscripts/ascii/stackascii.bundle.js.map +++ b/corsscripts/ascii/stackascii.bundle.js.map @@ -1,8 +1,8 @@ { "version": 3, - "sources": ["mathjs.min.js", "markdownit.js", "markdownitextensions/asciimathblock.js", "markdownitextensions/tex.js", "filters/calculation.js", "filters/cas.js", "filters/markdown.js", "filters/markdownitrules.js", "markdownittransforms/100_asciimath.js", "markdownittransforms/findtextindex.js", "markdownittransforms/200_aligneq.js", "markdownittransforms/250_boldfilter.js", "markdownittransforms/900_minwrap.js", "filters/plain.js", "extractors/lastblock.js", "extractors/lastcalc.js", "extractors/lastexpr.js", "extractors/laststringremainder.js", "extractors/laststringremainderwhitespace.js", "extractors/lastregexmatch.js", "extractors/lastregexremainder.js", "extractors/allregexmatch.js", "extractors/allregexremainder.js", "stackascii.js"], + "sources": ["mathjs.min.js", "markdownit.js", "markdownitextensions/asciimathblock.js", "markdownitextensions/tex.js", "filters/calculation.js", "filters/cas.js", "filters/markdown.js", "filters/markdownitrules.js", "markdownittransforms/100_asciimath.js", "markdownittransforms/findtextindex.js", "markdownittransforms/200_aligneq.js", "markdownittransforms/250_boldfilter.js", "markdownittransforms/900_minwrap.js", "filters/plain.js", "extractors/extractorresult.js", "extractors/lastblock.js", "extractors/lastcalc.js", "extractors/lastexpr.js", "extractors/laststringremainder.js", "extractors/laststringremainderwhitespace.js", "extractors/lastregexmatch.js", "extractors/lastregexremainder.js", "extractors/allregexmatch.js", "extractors/allregexremainder.js", "stackascii.js"], "sourceRoot": "cors.php?name=ascii/", - "sourcesContent": ["/*! For license information please see math.js.LICENSE.txt Licensed under Apache License 2.0 */\n!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.math=t():e.math=t()}(this,()=>{var r={31:function(e,r,n){var o;!function(e){function i(e){var t=this,r=\"\";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,e===((t.v=0)|e)?t.x=e:r+=e;for(var n=0;n>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function t(e,t){function r(){return(n.next()>>>0)/4294967296}var n=new i(e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(\"object\"==typeof e&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.xorwow=t}(e=n.nmd(e),n.amdD)},67:function(e,r,n){var o;!function(e){function i(e){var t,i=this,r=(i.next=function(){var e=i.x,t=i.i,r=e[t],n=(r^=r>>>7)^r<<24;return n=(n=(n^=(r=e[t+1&7])^r>>>10)^((r=e[t+3&7])^r>>>3))^((r=e[t+4&7])^r<<7),r=e[t+7&7],n^=(r^=r<<13)^r<<9,e[t]=n,i.i=t+1&7,n},i),n=e,a=[];if(n===(0|n))a[0]=n;else for(n=\"\"+n,t=0;t>>0)/4294967296}var n=new i(e=null==e?+new Date:e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(e.x&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.xorshift7=t}(e=n.nmd(e),n.amdD)},144:e=>{\"use strict\";function s(e,t){return u({},e,t)}var u=Object.assign||function(e){for(var t=1;t=e.length&&n.slice(0,e.length)===e&&(i+=a[o[t]],n=n.slice(e.length,n.length),r=!0)}),r||(i+=n.slice(0,1),n=n.slice(1,n.length))}();return i}},180:function(e,r,n){var o;!function(e){function i(e){var n,t=this,r=(n=4022871197,function(e){e=String(e);for(var t=0;t>>0)*n)>>>0,n+=4294967296*(r-=n)}return 2.3283064365386963e-10*(n>>>0)});t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=r(\" \"),t.s1=r(\" \"),t.s2=r(\" \"),t.s0-=r(e),t.s0<0&&(t.s0+=1),t.s1-=r(e),t.s1<0&&(t.s1+=1),t.s2-=r(e),t.s2<0&&(t.s2+=1)}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function t(e,t){var r=new i(e),e=t&&t.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,e&&(\"object\"==typeof e&&a(e,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.alea=t}(e=n.nmd(e),n.amdD)},181:function(e,r,n){var o;!function(e){function i(e){var t=this,r=\"\";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n>>0)/4294967296}var n=new i(e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(\"object\"==typeof e&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.xor128=t}(e=n.nmd(e),n.amdD)},234:()=>{},369:function(e){e.exports=function(){\"use strict\";function T(){return!0}function ce(){return!1}function fe(){}const B=\"Argument is not a typed-function.\";return function e(){function c(e){return\"object\"==typeof e&&null!==e&&e.constructor===Object}const t=[{name:\"number\",test:function(e){return\"number\"==typeof e}},{name:\"string\",test:function(e){return\"string\"==typeof e}},{name:\"boolean\",test:function(e){return\"boolean\"==typeof e}},{name:\"Function\",test:function(e){return\"function\"==typeof e}},{name:\"Array\",test:Array.isArray},{name:\"Date\",test:function(e){return e instanceof Date}},{name:\"RegExp\",test:function(e){return e instanceof RegExp}},{name:\"Object\",test:c},{name:\"null\",test:function(e){return null===e}},{name:\"undefined\",test:function(e){return void 0===e}}],r={name:\"any\",test:T,isAny:!0};let a,o,i=0,J={createCount:0};function s(e){var t=a.get(e);if(t)return t;let r='Unknown type \"'+e+'\"';var n=e.toLowerCase();let i;for(i of o)if(i.toLowerCase()===n){r+='. Did you mean \"'+i+'\" ?';break}throw new TypeError(r)}function n(t){var e=1{const t=a.get(e);return!t.isAny&&t.test(r)});return e.length?e:[\"any\"]}function f(e){return e&&\"function\"==typeof e&&\"_typedFunctionData\"in e}function p(r,n,i){if(!f(r))throw new TypeError(B);const a=i&&i.exact,o=Q(Array.isArray(n)?n.join(\",\"):n),e=X(o);if(!a||e in r.signatures){const n=r._typedFunctionData.signatureMap.get(e);if(n)return n}var s=o.length;let u,t;if(a){let e;for(e in u=[],r.signatures)u.push(r._typedFunctionData.signatureMap.get(e))}else u=r._typedFunctionData.signatures;for(let t=0;t!r.has(e.name)))continue}i.push(e)}}if(0===(u=i).length)break}for(t of u)if(t.params.length<=s)return t;throw new TypeError(\"Signature not found (signature: \"+(r.name||\"unnamed\")+\"(\"+X(o,\", \")+\"))\")}function X(e,t){t=1e.name).join(t)}function oe(e){const t=function(e){if(0===e.length)return[];const r=e.map(s);1e.index-t.index);let n=r[0].conversionsTo;if(1===e.length)return n;n=n.concat([]);const i=new Set(e);for(let t=1;te.name));let r=e.hasAny,n=e.name;var i=t.map(function(e){var t=s(e.from);return r=t.isAny||r,n+=\"|\"+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}});return{types:e.types.concat(i),name:n,hasAny:r,hasConversion:0t.typeSet.add(e.name))),t.typeSet}function Q(e){const t=[];if(\"string\"!=typeof e)throw new TypeError(\"Signatures must be strings\");const r=e.trim();if(\"\"===r)return t;const n=r.split(\",\");for(let e=0;es(e.trim()));let n=!1,i=t?\"...\":\"\";return{types:r.map(function(e){return n=e.isAny||n,i+=e.name+\"|\",{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}}),name:i.slice(0,-1),hasAny:n,hasConversion:!1,restParam:t}}(n[e].trim());if(r.restParam&&e!==n.length-1)throw new SyntaxError('Unexpected rest parameter \"'+n[e]+'\": only allowed for the last parameter');if(0===r.types.length)return null;t.push(r)}return t}function K(e){e=ie(e);return!!e&&e.restParam}function ee(e){if(e&&0!==e.types.length){if(1===e.types.length)return s(e.types[0].name).test;if(2===e.types.length){const T=s(e.types[0].name).test,t=s(e.types[1].name).test;return function(e){return T(e)||t(e)}}{const T=e.types.map(function(e){return s(e.name).test});return function(t){for(let e=0;e{let t;for(t of te(e.params,r))n.add(t)}),n.has(\"any\")?[\"any\"]:Array.from(n)}function g(r,n,e){let t,i;var a=r||\"unnamed\";let o,s=e;for(o=0;o{const t=ee(h(e.params,o));(oe)return(t=new TypeError(\"Too many arguments in function \"+a+\" (expected: \"+e+\", actual: \"+n.length+\")\")).data={category:\"tooManyArgs\",fn:a,index:n.length,expectedLength:e},t;const u=[];for(let e=0;eA(e)?w(e.referToSelf.callback):N(e)?v(e.referTo.references,e.referTo.callback):e),a=new Array(i.length).fill(!1);let o=!0;for(;o;){let t=!(o=!1);for(let e=0;e{const t=n[e];if(q.test(t.toString()))throw new SyntaxError(\"Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.\")})}const i=[],a=[],o={},s=[];let u;for(u in r)if(Object.prototype.hasOwnProperty.call(r,u)){const t=Q(u);if(t){i.forEach(function(e){if(function(n,i){const a=Math.max(n.length,i.length);for(let r=0;r=e:r?e>=o:e===o}(e,t))throw new TypeError('Conflicting signatures \"'+X(e)+'\" and \"'+X(t)+'\".')}),i.push(t);const ce=a.length,fe=(a.push(r[u]),t.map(oe));let e;for(e of function t(r,n,i){if(ne.name).join(\"|\"),hasAny:t.some(e=>e.isAny),hasConversion:!1,restParam:!0}),e.push(o)}else e=o.types.map(function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}});return a=e,Array.prototype.concat.apply([],a.map(function(e){return t(r,n+1,i.concat([e]))}))}var a;return[i]}(fe,0,[])){const t=X(e);s.push({params:e,name:t,fn:ce}),e.every(e=>!e.hasConversion)&&(o[t]=ce)}}}s.sort(se);var e=le(a,o,z);let l;for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&(o[l]=e[o[l]]);const c=[],f=new Map;for(l of s)f.has(l.name)||(l.fn=e[l.fn],c.push(l),f.set(l.name,l));var p=c[0]&&c[0].params.length<=2&&!K(c[0].params),m=c[1]&&c[1].params.length<=2&&!K(c[1].params),h=c[2]&&c[2].params.length<=2&&!K(c[2].params),d=c[3]&&c[3].params.length<=2&&!K(c[3].params),g=c[4]&&c[4].params.length<=2&&!K(c[4].params),y=c[5]&&c[5].params.length<=2&&!K(c[5].params),x=p&&m&&h&&d&&g&&y;for(let e=0;e=n+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=ee(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=ee(e[0]),i=ee(e[1]),function(e){return n(e[0])&&i(e[1])&&2===e.length}):(r=e.map(ee),function(t){for(let e=0;ee.hasConversion)){const i=K(e),a=e.map(ue);t=function(){const t=[],r=i?arguments.length-1:arguments.length;for(let e=0;ee.test),W=c.map(e=>e.implementation),Y=function(){for(let e=G;eX(Q(e))),t=ie(arguments);if(\"function\"!=typeof t)throw new TypeError(\"Callback function expected as last argument\");return v(e,t)},J.referToSelf=w,J.convert=function(t,e){const r=s(e);if(r.test(t))return t;const n=r.conversionsTo;if(0===n.length)throw new Error(\"There are no conversions to \"+e+\" defined.\");for(let e=0;ee.from===t.from);if(n){if(!e||!e.override)throw new Error('There is already a conversion from \"'+t.from+'\" to \"'+r.name+'\"');J.removeConversion({from:n.from,to:t.to,convert:n.convert})}r.conversionsTo.push({from:t.from,convert:t.convert,index:i++})},J.addConversions=function(e,t){e.forEach(e=>J.addConversion(e,t))},J.removeConversion=function(r){S(r);const e=s(r.to),t=function(t){for(let e=0;e{var n=r(180),i=r(181),a=r(31),o=r(67),s=r(833),u=r(717),r=r(801);r.alea=n,r.xor128=i,r.xorwow=a,r.xorshift7=o,r.xor4096=s,r.tychei=u,e.exports=r},504:e=>{function t(){}t.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n>>7^(t=i.c),t=t-(r=i.d)|0,r=r<<24^r>>>8^(n=i.a),n=n-e|0;return i.b=e=e<<20^e>>>12^t,i.c=t=t-r|0,i.d=r<<16^t>>>16^n,i.a=n-e|0},i.a=0,i.b=0,i.c=-1640531527,i.d=1367130551,e===Math.floor(e)?(i.a=e/4294967296|0,i.b=0|e):t+=e;for(var r=0;r>>0)/4294967296}var n=new i(e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(\"object\"==typeof e&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.tychei=t}(e=n.nmd(e),n.amdD)},801:function(e,t,r){var o,s=\"undefined\"!=typeof self?self:this,u=[],l=Math,c=256,f=l.pow(c,6),p=l.pow(2,52),m=2*p,h=255;function n(e,t,r){function n(){for(var e=a.g(6),t=f,r=0;e>>=1;return(e+r)/t}var i=[],e=y(function e(t,r){var n,i=[],a=typeof t;if(r&&\"object\"==a)for(n in t)try{i.push(e(t[n],r-1))}catch(t){}return i.length?i:\"string\"==a?t:t+\"\\0\"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,x(u)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(c):(e=new Uint8Array(c),(s.crypto||s.msCrypto).getRandomValues(e)),x(e)}catch(e){var t=s.navigator,t=t&&t.plugins;return[+new Date,s,t,s.screen,x(u)]}}():e,3),i),a=new d(i);return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,y(x(a.S),u),(t.pass||r||function(e,t,r,n){return n&&(n.S&&g(n,a),e.state=function(){return g(a,{})}),r?(l.random=e,t):e})(n,e,\"global\"in t?t.global:this==l,t.state)}function d(e){var t,r=e.length,o=this,n=0,i=o.i=o.j=0,a=o.S=[];for(r||(e=[r++]);n>>15^((e^=e<<17)^e>>>12),o.i=i,t+(r^r>>>16)|0},o),u=e,l=[],c=128;for(u===(0|u)?(r=u,u=null):(u+=\"\\0\",r=0,c=Math.max(c,u.length)),n=0,i=-32;i>>15)^r<<4)^r>>>13,0<=i&&(n=0==(t=l[127&i]^=r+(a=a+1640531527|0))?n+1:0);for(128<=n&&(l[127&(u&&u.length||0)]=-1),n=127,i=512;0>>15)^(t=(t^=t<<17)^t>>>12);s.w=a,s.X=l,s.i=n}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function t(e,t){function r(){return(n.next()>>>0)/4294967296}var n=new i(e=null==e?+new Date:e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(e.X&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.xor4096=t}(e=n.nmd(e),n.amdD)},880:e=>{e.exports=function t(e,r){\"use strict\";function n(e){return t.insensitive&&(\"\"+e).toLowerCase()||\"\"+e}var i,a,o=/(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,s=/(^[ ]*|[ ]*$)/g,u=/(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,e=n(e).replace(s,\"\")||\"\",r=n(r).replace(s,\"\")||\"\",f=e.replace(o,\"\\0$1\\0\").replace(/\\0$/,\"\").replace(/^\\0/,\"\").split(\"\\0\"),p=r.replace(o,\"\\0$1\\0\").replace(/\\0$/,\"\").replace(/^\\0/,\"\").split(\"\\0\"),s=parseInt(e.match(l),16)||1!==f.length&&e.match(u)&&Date.parse(e),o=parseInt(r.match(l),16)||s&&r.match(u)&&Date.parse(r)||null;if(o){if(s{for(var r in t)fd.o(t,r)&&!fd.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},fd.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),fd.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},fd.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var pd={};return(()=>{\"use strict\";fd.d(pd,{default:()=>cd});var t={},l=(fd.r(t),fd.d(t,{createAbs:()=>ha,createAccessorNode:()=>cf,createAcos:()=>jl,createAcosh:()=>ac,createAcot:()=>oc,createAcoth:()=>sc,createAcsc:()=>uc,createAcsch:()=>lc,createAdd:()=>Jc,createAddScalar:()=>ba,createAnd:()=>Lu,createAndTransform:()=>Kh,createArg:()=>Po,createArrayNode:()=>pf,createAsec:()=>cc,createAsech:()=>fc,createAsin:()=>pc,createAsinh:()=>mc,createAssignmentNode:()=>xf,createAtan:()=>hc,createAtan2:()=>dc,createAtanh:()=>gc,createAtomicMass:()=>ah,createAvogadro:()=>oh,createBellNumbers:()=>qm,createBigNumberClass:()=>Zr,createBigint:()=>Mi,createBignumber:()=>Fi,createBin:()=>nu,createBitAnd:()=>zo,createBitAndTransform:()=>rd,createBitNot:()=>qo,createBitOr:()=>Io,createBitOrTransform:()=>nd,createBitXor:()=>Ro,createBlockNode:()=>vf,createBohrMagneton:()=>P0,createBohrRadius:()=>G0,createBoltzmann:()=>sh,createBoolean:()=>Bi,createCatalan:()=>km,createCbrt:()=>Na,createCeil:()=>Ta,createChain:()=>Ep,createChainClass:()=>bp,createClassicalElectronRadius:()=>V0,createClone:()=>Qn,createColumn:()=>es,createColumnTransform:()=>Th,createCombinations:()=>tm,createCombinationsWithRep:()=>im,createCompare:()=>Hu,createCompareNatural:()=>Wu,createCompareText:()=>Ju,createCompile:()=>Xf,createComplex:()=>Di,createComplexClass:()=>en,createComposition:()=>Pm,createConcat:()=>Ko,createConcatTransform:()=>Hh,createConditionalNode:()=>Nf,createConductanceQuantum:()=>U0,createConj:()=>Uo,createConstantNode:()=>Ff,createCorr:()=>Xp,createCos:()=>xc,createCosh:()=>bc,createCot:()=>vc,createCoth:()=>wc,createCoulomb:()=>I0,createCoulombConstant:()=>k0,createCount:()=>ts,createCreateUnit:()=>Ul,createCross:()=>rs,createCsc:()=>Nc,createCsch:()=>Ac,createCtranspose:()=>js,createCube:()=>Ba,createCumSum:()=>jp,createCumSumTransform:()=>Yh,createDeepEqual:()=>dl,createDenseMatrixClass:()=>Xn,createDerivative:()=>Km,createDet:()=>Sp,createDeuteronMass:()=>Q0,createDiag:()=>ns,createDiff:()=>ys,createDiffTransform:()=>Gh,createDistance:()=>kp,createDivide:()=>qp,createDivideScalar:()=>du,createDot:()=>Kc,createDotDivide:()=>Mu,createDotMultiply:()=>yo,createDotPow:()=>Eu,createE:()=>g0,createEfimovFactor:()=>ih,createEigs:()=>Tp,createElectricConstant:()=>z0,createElectronMass:()=>Z0,createElementaryCharge:()=>R0,createEqual:()=>Qu,createEqualScalar:()=>Ai,createEqualText:()=>tl,createErf:()=>Vs,createEvaluate:()=>Kf,createExp:()=>Fa,createExpm:()=>Bp,createExpm1:()=>Da,createFactorial:()=>dm,createFalse:()=>c0,createFaraday:()=>uh,createFermiCoupling:()=>W0,createFft:()=>$s,createFibonacciHeapClass:()=>Cl,createFilter:()=>is,createFilterTransform:()=>_h,createFineStructure:()=>Y0,createFirstRadiation:()=>lh,createFix:()=>_a,createFlatten:()=>ss,createFloor:()=>ka,createForEach:()=>ls,createForEachTransform:()=>zh,createFormat:()=>ru,createFraction:()=>Oi,createFractionClass:()=>mn,createFreqz:()=>n0,createFunctionAssignmentNode:()=>Of,createFunctionNode:()=>Wf,createGamma:()=>pm,createGasConstant:()=>fh,createGcd:()=>Ya,createGetMatrixDataType:()=>ps,createGravitationConstant:()=>F0,createGravity:()=>vh,createHartreeEnergy:()=>J0,createHasNumericValue:()=>di,createHelp:()=>Ap,createHelpClass:()=>xp,createHex:()=>au,createHypot:()=>Xc,createI:()=>E0,createIdentity:()=>hs,createIfft:()=>Hs,createIm:()=>jo,createImmutableDenseMatrixClass:()=>El,createIndex:()=>tf,createIndexClass:()=>Sl,createIndexNode:()=>zf,createIndexTransform:()=>qh,createInfinity:()=>p0,createIntersect:()=>Rp,createInv:()=>Mp,createInverseConductanceQuantum:()=>j0,createInvmod:()=>mo,createIsInteger:()=>oi,createIsNaN:()=>bi,createIsNegative:()=>fi,createIsNumeric:()=>mi,createIsPositive:()=>yi,createIsPrime:()=>pu,createIsZero:()=>xi,createKldivergence:()=>ym,createKlitzing:()=>H0,createKron:()=>ds,createLN10:()=>b0,createLN2:()=>x0,createLOG10E:()=>w0,createLOG2E:()=>v0,createLarger:()=>ll,createLargerEq:()=>pl,createLcm:()=>Xa,createLeafCount:()=>jm,createLeftShift:()=>ku,createLgamma:()=>mm,createLog:()=>vu,createLog10:()=>eo,createLog1p:()=>wu,createLog2:()=>to,createLoschmidt:()=>ch,createLsolve:()=>Tu,createLsolveAll:()=>Du,createLup:()=>rp,createLusolve:()=>dp,createLyap:()=>zp,createMad:()=>Hp,createMagneticConstant:()=>_0,createMagneticFluxQuantum:()=>L0,createMap:()=>gs,createMapSlices:()=>ga,createMapSlicesTransform:()=>Ch,createMapTransform:()=>Ih,createMatrix:()=>_i,createMatrixClass:()=>dn,createMatrixFromColumns:()=>Pi,createMatrixFromFunction:()=>qi,createMatrixFromRows:()=>ki,createMax:()=>Nl,createMaxTransform:()=>Rh,createMean:()=>Lp,createMeanTransform:()=>Ph,createMedian:()=>$p,createMin:()=>Al,createMinTransform:()=>Uh,createMod:()=>$a,createMode:()=>Ks,createMolarMass:()=>xh,createMolarMassC12:()=>bh,createMolarPlanckConstant:()=>ph,createMolarVolume:()=>mh,createMultinomial:()=>bm,createMultiply:()=>io,createMultiplyScalar:()=>ro,createNaN:()=>m0,createNeutronMass:()=>K0,createNode:()=>nf,createNorm:()=>Qc,createNot:()=>Wo,createNthRoot:()=>oo,createNthRoots:()=>Au,createNuclearMagneton:()=>$0,createNull:()=>f0,createNullish:()=>Jo,createNullishTransform:()=>td,createNumber:()=>Si,createNumeric:()=>mu,createObjectNode:()=>If,createOct:()=>iu,createOnes:()=>xs,createOperatorNode:()=>Pf,createOr:()=>Xo,createOrTransform:()=>ed,createParenthesisNode:()=>jf,createParse:()=>Yf,createParser:()=>tp,createParserClass:()=>ep,createPartitionSelect:()=>vl,createPermutations:()=>wm,createPhi:()=>y0,createPi:()=>h0,createPickRandom:()=>Cm,createPinv:()=>Cp,createPlanckCharge:()=>Eh,createPlanckConstant:()=>D0,createPlanckLength:()=>wh,createPlanckMass:()=>Nh,createPlanckTemperature:()=>Sh,createPlanckTime:()=>Ah,createPolynomialRoot:()=>yp,createPow:()=>gu,createPrint:()=>su,createPrintTransform:()=>Qh,createProd:()=>tu,createProtonMass:()=>X0,createQr:()=>np,createQuantileSeq:()=>Yp,createQuantileSeqTransform:()=>Wh,createQuantumOfCirculation:()=>eh,createRandom:()=>Bm,createRandomInt:()=>Dm,createRange:()=>Ns,createRangeClass:()=>hn,createRangeNode:()=>$f,createRangeTransform:()=>jh,createRationalize:()=>t0,createRe:()=>Lo,createReducedPlanckConstant:()=>O0,createRelationalNode:()=>Gf,createReplacer:()=>a0,createReshape:()=>Es,createResize:()=>Ss,createResolve:()=>Ym,createResultSet:()=>ft,createReviver:()=>i0,createRightArithShift:()=>Pu,createRightLogShift:()=>ju,createRotate:()=>Ms,createRotationMatrix:()=>Ts,createRound:()=>xu,createRow:()=>Bs,createRowTransform:()=>Lh,createRydberg:()=>th,createSQRT1_2:()=>N0,createSQRT2:()=>A0,createSackurTetrode:()=>hh,createSchur:()=>_p,createSec:()=>Ec,createSech:()=>Sc,createSecondRadiation:()=>dh,createSetCartesian:()=>Dc,createSetDifference:()=>_c,createSetDistinct:()=>qc,createSetIntersect:()=>kc,createSetIsSubset:()=>Pc,createSetMultiplicity:()=>jc,createSetPowerset:()=>$c,createSetSize:()=>Gc,createSetSymDifference:()=>Zc,createSetUnion:()=>Yc,createSign:()=>so,createSimplify:()=>Gm,createSimplifyConstant:()=>Vm,createSimplifyCore:()=>Wm,createSin:()=>Mc,createSinh:()=>Cc,createSize:()=>Fs,createSlu:()=>pp,createSmaller:()=>nl,createSmallerEq:()=>ol,createSolveODE:()=>Gs,createSort:()=>wl,createSpaClass:()=>Tl,createSparse:()=>Rl,createSparseMatrixClass:()=>Ei,createSpeedOfLight:()=>B0,createSplitUnit:()=>ji,createSqrt:()=>uo,createSqrtm:()=>Fp,createSquare:()=>lo,createSqueeze:()=>Os,createStd:()=>Jp,createStdTransform:()=>Vh,createStefanBoltzmann:()=>gh,createStirlingS2:()=>_m,createString:()=>Ci,createSubset:()=>_s,createSubsetTransform:()=>$h,createSubtract:()=>fo,createSubtractScalar:()=>wa,createSum:()=>Pp,createSumTransform:()=>Zh,createSylvester:()=>Op,createSymbolNode:()=>Vf,createSymbolicEqual:()=>Xm,createTan:()=>Tc,createTanh:()=>Bc,createTau:()=>d0,createThomsonCrossSection:()=>rh,createTo:()=>lu,createToBest:()=>cu,createTrace:()=>ef,createTranspose:()=>Ps,createTrue:()=>l0,createTypeOf:()=>vi,createTyped:()=>st,createUnaryMinus:()=>fa,createUnaryPlus:()=>ma,createUnequal:()=>yl,createUnitClass:()=>Il,createUnitFunction:()=>kl,createUppercaseE:()=>M0,createUppercasePi:()=>S0,createUsolve:()=>Bu,createUsolveAll:()=>_u,createVacuumImpedance:()=>q0,createVariance:()=>Zp,createVarianceTransform:()=>Xh,createVersion:()=>C0,createWeakMixingAngle:()=>nh,createWienDisplacement:()=>yh,createXgcd:()=>po,createXor:()=>Qo,createZeros:()=>Ls,createZeta:()=>Qs,createZpk2tf:()=>r0}),fd(369));function h(e,t){if(n(e,t))return e[t];if(\"function\"==typeof e[t]&&q(e,t))throw new Error('Cannot access method \"'+t+'\" as a property');throw new Error('No access to property \"'+t+'\"')}function D(e,t,r){if(n(e,t))return e[t]=r;throw new Error('No access to property \"'+t+'\"')}function n(e,t){return!((\"object\"!=typeof e||!e||e.constructor!==Object)&&!Array.isArray(e)||!ue(r,t)&&(t in Object.prototype||t in Function.prototype))}function q(e,t){return!(null==e||\"function\"!=typeof e[t]||ue(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)||!ue(i,t)&&(t in Object.prototype||t in Function.prototype))}const r={length:!0,name:!0},i={toString:!0,valueOf:!0,toLocaleString:!0};class I{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return h(this.wrappedObject,e)}set(e,t){return D(this.wrappedObject,e,t),this}has(e){return n(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return a(this.keys(),e=>[e,this.get(e)])}forEach(e){for(const t of this.keys())e(this.get(t),t,this)}delete(e){n(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(const e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}class k{constructor(e,t,r){this.a=e,this.b=t,this.bKeys=r,this[Symbol.iterator]=this.entries}get(e){return(this.bKeys.has(e)?this.b:this.a).get(e)}set(e,t){return(this.bKeys.has(e)?this.b:this.a).set(e,t),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return a(this.keys(),e=>[e,this.get(e)])}forEach(e){for(const t of this.keys())e(this.get(t),t,this)}delete(e){return(this.bKeys.has(e)?this.b:this.a).delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function a(t,r){return{next:()=>{var e=t.next();return e.done?e:{value:r(e.value),done:!1}}}}function P(){return new Map}function U(e){if(!e)return P();if(fe(e))return e;if(ce(e))return new I(e);throw new Error(\"createMap can create maps from objects or Maps\")}function A(e){return\"number\"==typeof e}function Q(e){return!(!e||\"object\"!=typeof e||\"function\"!=typeof e.constructor)&&(!0===e.isBigNumber&&\"object\"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||\"function\"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function R(e){return\"bigint\"==typeof e}function te(e){return e&&\"object\"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function re(e){return e&&\"object\"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function L(e){return e&&!0===e.constructor.prototype.isUnit||!1}function j(e){return\"string\"==typeof e}const b=Array.isArray;function _(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function $(e){return Array.isArray(e)||_(e)}function H(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function G(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function V(e){return e&&!0===e.constructor.prototype.isRange||!1}function Z(e){return e&&!0===e.constructor.prototype.isIndex||!1}function W(e){return\"boolean\"==typeof e}function Y(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function J(e){return e&&!0===e.constructor.prototype.isHelp||!1}function X(e){return\"function\"==typeof e}function ne(e){return e instanceof Date}function ie(e){return e instanceof RegExp}function ce(e){return!(!e||\"object\"!=typeof e||e.constructor!==Object||te(e)||re(e))}function fe(e){return!!e&&(e instanceof Map||e instanceof I||\"function\"==typeof e.set&&\"function\"==typeof e.get&&\"function\"==typeof e.keys&&\"function\"==typeof e.has)}function pe(e){return fe(e)&&fe(e.a)&&fe(e.b)}function me(e){return fe(e)&&ce(e.wrappedObject)}function he(e){return null===e}function de(e){return void 0===e}function ge(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function ye(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function xe(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function be(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function ve(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function ae(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function we(e){return ae(e)||oe(e)&&1===e.args.length&&ae(e.args[0])&&\"-+~\".includes(e.op)}function Ne(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function Ae(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function Ee(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function O(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function Se(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function oe(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function Me(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function Ce(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function Te(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function se(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function Be(e){return e&&!0===e.constructor.prototype.isChain||!1}function K(e){var t=typeof e;return\"object\"==t?null===e?\"null\":Q(e)?\"BigNumber\":e.constructor&&e.constructor.name?e.constructor.name:\"Object\":t}function ee(e){var t=typeof e;if(\"number\"==t||\"bigint\"==t||\"string\"==t||\"boolean\"==t||null==e)return e;if(\"function\"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map(ee);if(e instanceof Date)return new Date(e.valueOf());if(Q(e))return e;if(ce(e)){var r=e,n=ee;const i={};for(const a in r)ue(r,a)&&(i[a]=n(r[a]));return i}if(\"function\"==t)return e;throw new TypeError(`Cannot clone: unknown type of value (value: ${e})`)}function Fe(e,t){for(const r in t)ue(t,r)&&(e[r]=t[r]);return e}function De(e,t){let r,n,i;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(n=0,i=e.length;n!(e&&\"?\"===e[0])).every(e=>void 0!==i[e]))return u(t);{const a=n.filter(e=>void 0===i[e]);throw new Error(`Cannot create function \"${r}\", some dependencies are missing: ${a.map(e=>`\"${e}\"`).join(\", \")}.`)}}return t.isFactory=!0,t.fn=o,t.dependencies=s.slice().sort(),e&&(t.meta=e),t}function ze(e){return\"function\"==typeof e&&\"string\"==typeof e.fn&&Array.isArray(e.dependencies)}function qe(e){return e&&\"?\"===e[0]?e.slice(1):e}function v(e){return\"boolean\"==typeof e||!!isFinite(e)&&e===Math.round(e)}function Ie(e,t){if(\"bigint\"===t.number)try{BigInt(e)}catch(e){return t.numberFallback}return t.number}const ke=Math.sign||function(e){return 0l.length||u-c+1>l.length;)l.push(0);else{const a=Math.abs(u-c)-(l.length-1);for(let e=0;e=i)return We(e,t);{let e=o.coefficients;const r=o.exponent,n=(e=(e=e.length{throw new Error('Option \"precision\" must be a number or BigNumber')})),void 0!==e.wordSize&&(r=it(e.wordSize,()=>{throw new Error('Option \"wordSize\" must be a number or BigNumber')})),e.notation&&(n=e.notation)}return{notation:n,precision:t,wordSize:r}}function Ve(e){var t=String(e).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);if(!t)throw new SyntaxError(\"Invalid number \"+e);const r=t[1],n=t[2];let i=parseFloat(t[4]||\"0\");e=n.indexOf(\".\");i+=-1!==e?e-1:n.length-1;const a=n.replace(\".\",\"\").replace(/^0*/,function(e){return i-=e.length,\"\"}).replace(/0*$/,\"\").split(\"\").map(function(e){return parseInt(e)});return 0===a.length&&(a.push(0),i++),{sign:r,coefficients:a,exponent:i}}function Ze(e,t){if(isNaN(e)||!isFinite(e))return String(e);e=Ve(e),e=\"number\"==typeof t?Ye(e,e.exponent+1+t):e;let r=e.coefficients,n=e.exponent+1;t=n+(t||0);return r.lengtht&&5<=n.splice(t,n.length-t)[0]){let e=t-1;for(n[e]++;10===n[e];)n.pop(),0===e&&(n.unshift(0),r.exponent++,e++),e--,n[e]++}return r}function Je(t){const r=[];for(let e=0;e/^[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CD\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7DC\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u{10000}-\\u{1000B}\\u{1000D}-\\u{10026}\\u{10028}-\\u{1003A}\\u{1003C}\\u{1003D}\\u{1003F}-\\u{1004D}\\u{10050}-\\u{1005D}\\u{10080}-\\u{100FA}\\u{10280}-\\u{1029C}\\u{102A0}-\\u{102D0}\\u{10300}-\\u{1031F}\\u{1032D}-\\u{10340}\\u{10342}-\\u{10349}\\u{10350}-\\u{10375}\\u{10380}-\\u{1039D}\\u{103A0}-\\u{103C3}\\u{103C8}-\\u{103CF}\\u{10400}-\\u{1049D}\\u{104B0}-\\u{104D3}\\u{104D8}-\\u{104FB}\\u{10500}-\\u{10527}\\u{10530}-\\u{10563}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}\\u{10595}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}\\u{105BC}\\u{105C0}-\\u{105F3}\\u{10600}-\\u{10736}\\u{10740}-\\u{10755}\\u{10760}-\\u{10767}\\u{10780}-\\u{10785}\\u{10787}-\\u{107B0}\\u{107B2}-\\u{107BA}\\u{10800}-\\u{10805}\\u{10808}\\u{1080A}-\\u{10835}\\u{10837}\\u{10838}\\u{1083C}\\u{1083F}-\\u{10855}\\u{10860}-\\u{10876}\\u{10880}-\\u{1089E}\\u{108E0}-\\u{108F2}\\u{108F4}\\u{108F5}\\u{10900}-\\u{10915}\\u{10920}-\\u{10939}\\u{10980}-\\u{109B7}\\u{109BE}\\u{109BF}\\u{10A00}\\u{10A10}-\\u{10A13}\\u{10A15}-\\u{10A17}\\u{10A19}-\\u{10A35}\\u{10A60}-\\u{10A7C}\\u{10A80}-\\u{10A9C}\\u{10AC0}-\\u{10AC7}\\u{10AC9}-\\u{10AE4}\\u{10B00}-\\u{10B35}\\u{10B40}-\\u{10B55}\\u{10B60}-\\u{10B72}\\u{10B80}-\\u{10B91}\\u{10C00}-\\u{10C48}\\u{10C80}-\\u{10CB2}\\u{10CC0}-\\u{10CF2}\\u{10D00}-\\u{10D23}\\u{10D4A}-\\u{10D65}\\u{10D6F}-\\u{10D85}\\u{10E80}-\\u{10EA9}\\u{10EB0}\\u{10EB1}\\u{10EC2}-\\u{10EC4}\\u{10F00}-\\u{10F1C}\\u{10F27}\\u{10F30}-\\u{10F45}\\u{10F70}-\\u{10F81}\\u{10FB0}-\\u{10FC4}\\u{10FE0}-\\u{10FF6}\\u{11003}-\\u{11037}\\u{11071}\\u{11072}\\u{11075}\\u{11083}-\\u{110AF}\\u{110D0}-\\u{110E8}\\u{11103}-\\u{11126}\\u{11144}\\u{11147}\\u{11150}-\\u{11172}\\u{11176}\\u{11183}-\\u{111B2}\\u{111C1}-\\u{111C4}\\u{111DA}\\u{111DC}\\u{11200}-\\u{11211}\\u{11213}-\\u{1122B}\\u{1123F}\\u{11240}\\u{11280}-\\u{11286}\\u{11288}\\u{1128A}-\\u{1128D}\\u{1128F}-\\u{1129D}\\u{1129F}-\\u{112A8}\\u{112B0}-\\u{112DE}\\u{11305}-\\u{1130C}\\u{1130F}\\u{11310}\\u{11313}-\\u{11328}\\u{1132A}-\\u{11330}\\u{11332}\\u{11333}\\u{11335}-\\u{11339}\\u{1133D}\\u{11350}\\u{1135D}-\\u{11361}\\u{11380}-\\u{11389}\\u{1138B}\\u{1138E}\\u{11390}-\\u{113B5}\\u{113B7}\\u{113D1}\\u{113D3}\\u{11400}-\\u{11434}\\u{11447}-\\u{1144A}\\u{1145F}-\\u{11461}\\u{11480}-\\u{114AF}\\u{114C4}\\u{114C5}\\u{114C7}\\u{11580}-\\u{115AE}\\u{115D8}-\\u{115DB}\\u{11600}-\\u{1162F}\\u{11644}\\u{11680}-\\u{116AA}\\u{116B8}\\u{11700}-\\u{1171A}\\u{11740}-\\u{11746}\\u{11800}-\\u{1182B}\\u{118A0}-\\u{118DF}\\u{118FF}-\\u{11906}\\u{11909}\\u{1190C}-\\u{11913}\\u{11915}\\u{11916}\\u{11918}-\\u{1192F}\\u{1193F}\\u{11941}\\u{119A0}-\\u{119A7}\\u{119AA}-\\u{119D0}\\u{119E1}\\u{119E3}\\u{11A00}\\u{11A0B}-\\u{11A32}\\u{11A3A}\\u{11A50}\\u{11A5C}-\\u{11A89}\\u{11A9D}\\u{11AB0}-\\u{11AF8}\\u{11BC0}-\\u{11BE0}\\u{11C00}-\\u{11C08}\\u{11C0A}-\\u{11C2E}\\u{11C40}\\u{11C72}-\\u{11C8F}\\u{11D00}-\\u{11D06}\\u{11D08}\\u{11D09}\\u{11D0B}-\\u{11D30}\\u{11D46}\\u{11D60}-\\u{11D65}\\u{11D67}\\u{11D68}\\u{11D6A}-\\u{11D89}\\u{11D98}\\u{11EE0}-\\u{11EF2}\\u{11F02}\\u{11F04}-\\u{11F10}\\u{11F12}-\\u{11F33}\\u{11FB0}\\u{12000}-\\u{12399}\\u{12480}-\\u{12543}\\u{12F90}-\\u{12FF0}\\u{13000}-\\u{1342F}\\u{13441}-\\u{13446}\\u{13460}-\\u{143FA}\\u{14400}-\\u{14646}\\u{16100}-\\u{1611D}\\u{16800}-\\u{16A38}\\u{16A40}-\\u{16A5E}\\u{16A70}-\\u{16ABE}\\u{16AD0}-\\u{16AED}\\u{16B00}-\\u{16B2F}\\u{16B40}-\\u{16B43}\\u{16B63}-\\u{16B77}\\u{16B7D}-\\u{16B8F}\\u{16D40}-\\u{16D6C}\\u{16E40}-\\u{16E7F}\\u{16F00}-\\u{16F4A}\\u{16F50}\\u{16F93}-\\u{16F9F}\\u{16FE0}\\u{16FE1}\\u{16FE3}\\u{17000}-\\u{187F7}\\u{18800}-\\u{18CD5}\\u{18CFF}-\\u{18D08}\\u{1AFF0}-\\u{1AFF3}\\u{1AFF5}-\\u{1AFFB}\\u{1AFFD}\\u{1AFFE}\\u{1B000}-\\u{1B122}\\u{1B132}\\u{1B150}-\\u{1B152}\\u{1B155}\\u{1B164}-\\u{1B167}\\u{1B170}-\\u{1B2FB}\\u{1BC00}-\\u{1BC6A}\\u{1BC70}-\\u{1BC7C}\\u{1BC80}-\\u{1BC88}\\u{1BC90}-\\u{1BC99}\\u{1D400}-\\u{1D454}\\u{1D456}-\\u{1D49C}\\u{1D49E}\\u{1D49F}\\u{1D4A2}\\u{1D4A5}\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D51E}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D552}-\\u{1D6A5}\\u{1D6A8}-\\u{1D6C0}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6FA}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D734}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D76E}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D7A8}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7CB}\\u{1DF00}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E030}-\\u{1E06D}\\u{1E100}-\\u{1E12C}\\u{1E137}-\\u{1E13D}\\u{1E14E}\\u{1E290}-\\u{1E2AD}\\u{1E2C0}-\\u{1E2EB}\\u{1E4D0}-\\u{1E4EB}\\u{1E5D0}-\\u{1E5ED}\\u{1E5F0}\\u{1E7E0}-\\u{1E7E6}\\u{1E7E8}-\\u{1E7EB}\\u{1E7ED}\\u{1E7EE}\\u{1E7F0}-\\u{1E7FE}\\u{1E800}-\\u{1E8C4}\\u{1E900}-\\u{1E943}\\u{1E94B}\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u{20000}-\\u{2A6DF}\\u{2A700}-\\u{2B739}\\u{2B740}-\\u{2B81D}\\u{2B820}-\\u{2CEA1}\\u{2CEB0}-\\u{2EBE0}\\u{2EBF0}-\\u{2EE5D}\\u{2F800}-\\u{2FA1D}\\u{30000}-\\u{3134A}\\u{31350}-\\u{323AF}][0-9A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CD\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7DC\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u{10000}-\\u{1000B}\\u{1000D}-\\u{10026}\\u{10028}-\\u{1003A}\\u{1003C}\\u{1003D}\\u{1003F}-\\u{1004D}\\u{10050}-\\u{1005D}\\u{10080}-\\u{100FA}\\u{10280}-\\u{1029C}\\u{102A0}-\\u{102D0}\\u{10300}-\\u{1031F}\\u{1032D}-\\u{10340}\\u{10342}-\\u{10349}\\u{10350}-\\u{10375}\\u{10380}-\\u{1039D}\\u{103A0}-\\u{103C3}\\u{103C8}-\\u{103CF}\\u{10400}-\\u{1049D}\\u{104B0}-\\u{104D3}\\u{104D8}-\\u{104FB}\\u{10500}-\\u{10527}\\u{10530}-\\u{10563}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}\\u{10595}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}\\u{105BC}\\u{105C0}-\\u{105F3}\\u{10600}-\\u{10736}\\u{10740}-\\u{10755}\\u{10760}-\\u{10767}\\u{10780}-\\u{10785}\\u{10787}-\\u{107B0}\\u{107B2}-\\u{107BA}\\u{10800}-\\u{10805}\\u{10808}\\u{1080A}-\\u{10835}\\u{10837}\\u{10838}\\u{1083C}\\u{1083F}-\\u{10855}\\u{10860}-\\u{10876}\\u{10880}-\\u{1089E}\\u{108E0}-\\u{108F2}\\u{108F4}\\u{108F5}\\u{10900}-\\u{10915}\\u{10920}-\\u{10939}\\u{10980}-\\u{109B7}\\u{109BE}\\u{109BF}\\u{10A00}\\u{10A10}-\\u{10A13}\\u{10A15}-\\u{10A17}\\u{10A19}-\\u{10A35}\\u{10A60}-\\u{10A7C}\\u{10A80}-\\u{10A9C}\\u{10AC0}-\\u{10AC7}\\u{10AC9}-\\u{10AE4}\\u{10B00}-\\u{10B35}\\u{10B40}-\\u{10B55}\\u{10B60}-\\u{10B72}\\u{10B80}-\\u{10B91}\\u{10C00}-\\u{10C48}\\u{10C80}-\\u{10CB2}\\u{10CC0}-\\u{10CF2}\\u{10D00}-\\u{10D23}\\u{10D4A}-\\u{10D65}\\u{10D6F}-\\u{10D85}\\u{10E80}-\\u{10EA9}\\u{10EB0}\\u{10EB1}\\u{10EC2}-\\u{10EC4}\\u{10F00}-\\u{10F1C}\\u{10F27}\\u{10F30}-\\u{10F45}\\u{10F70}-\\u{10F81}\\u{10FB0}-\\u{10FC4}\\u{10FE0}-\\u{10FF6}\\u{11003}-\\u{11037}\\u{11071}\\u{11072}\\u{11075}\\u{11083}-\\u{110AF}\\u{110D0}-\\u{110E8}\\u{11103}-\\u{11126}\\u{11144}\\u{11147}\\u{11150}-\\u{11172}\\u{11176}\\u{11183}-\\u{111B2}\\u{111C1}-\\u{111C4}\\u{111DA}\\u{111DC}\\u{11200}-\\u{11211}\\u{11213}-\\u{1122B}\\u{1123F}\\u{11240}\\u{11280}-\\u{11286}\\u{11288}\\u{1128A}-\\u{1128D}\\u{1128F}-\\u{1129D}\\u{1129F}-\\u{112A8}\\u{112B0}-\\u{112DE}\\u{11305}-\\u{1130C}\\u{1130F}\\u{11310}\\u{11313}-\\u{11328}\\u{1132A}-\\u{11330}\\u{11332}\\u{11333}\\u{11335}-\\u{11339}\\u{1133D}\\u{11350}\\u{1135D}-\\u{11361}\\u{11380}-\\u{11389}\\u{1138B}\\u{1138E}\\u{11390}-\\u{113B5}\\u{113B7}\\u{113D1}\\u{113D3}\\u{11400}-\\u{11434}\\u{11447}-\\u{1144A}\\u{1145F}-\\u{11461}\\u{11480}-\\u{114AF}\\u{114C4}\\u{114C5}\\u{114C7}\\u{11580}-\\u{115AE}\\u{115D8}-\\u{115DB}\\u{11600}-\\u{1162F}\\u{11644}\\u{11680}-\\u{116AA}\\u{116B8}\\u{11700}-\\u{1171A}\\u{11740}-\\u{11746}\\u{11800}-\\u{1182B}\\u{118A0}-\\u{118DF}\\u{118FF}-\\u{11906}\\u{11909}\\u{1190C}-\\u{11913}\\u{11915}\\u{11916}\\u{11918}-\\u{1192F}\\u{1193F}\\u{11941}\\u{119A0}-\\u{119A7}\\u{119AA}-\\u{119D0}\\u{119E1}\\u{119E3}\\u{11A00}\\u{11A0B}-\\u{11A32}\\u{11A3A}\\u{11A50}\\u{11A5C}-\\u{11A89}\\u{11A9D}\\u{11AB0}-\\u{11AF8}\\u{11BC0}-\\u{11BE0}\\u{11C00}-\\u{11C08}\\u{11C0A}-\\u{11C2E}\\u{11C40}\\u{11C72}-\\u{11C8F}\\u{11D00}-\\u{11D06}\\u{11D08}\\u{11D09}\\u{11D0B}-\\u{11D30}\\u{11D46}\\u{11D60}-\\u{11D65}\\u{11D67}\\u{11D68}\\u{11D6A}-\\u{11D89}\\u{11D98}\\u{11EE0}-\\u{11EF2}\\u{11F02}\\u{11F04}-\\u{11F10}\\u{11F12}-\\u{11F33}\\u{11FB0}\\u{12000}-\\u{12399}\\u{12480}-\\u{12543}\\u{12F90}-\\u{12FF0}\\u{13000}-\\u{1342F}\\u{13441}-\\u{13446}\\u{13460}-\\u{143FA}\\u{14400}-\\u{14646}\\u{16100}-\\u{1611D}\\u{16800}-\\u{16A38}\\u{16A40}-\\u{16A5E}\\u{16A70}-\\u{16ABE}\\u{16AD0}-\\u{16AED}\\u{16B00}-\\u{16B2F}\\u{16B40}-\\u{16B43}\\u{16B63}-\\u{16B77}\\u{16B7D}-\\u{16B8F}\\u{16D40}-\\u{16D6C}\\u{16E40}-\\u{16E7F}\\u{16F00}-\\u{16F4A}\\u{16F50}\\u{16F93}-\\u{16F9F}\\u{16FE0}\\u{16FE1}\\u{16FE3}\\u{17000}-\\u{187F7}\\u{18800}-\\u{18CD5}\\u{18CFF}-\\u{18D08}\\u{1AFF0}-\\u{1AFF3}\\u{1AFF5}-\\u{1AFFB}\\u{1AFFD}\\u{1AFFE}\\u{1B000}-\\u{1B122}\\u{1B132}\\u{1B150}-\\u{1B152}\\u{1B155}\\u{1B164}-\\u{1B167}\\u{1B170}-\\u{1B2FB}\\u{1BC00}-\\u{1BC6A}\\u{1BC70}-\\u{1BC7C}\\u{1BC80}-\\u{1BC88}\\u{1BC90}-\\u{1BC99}\\u{1D400}-\\u{1D454}\\u{1D456}-\\u{1D49C}\\u{1D49E}\\u{1D49F}\\u{1D4A2}\\u{1D4A5}\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D51E}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D552}-\\u{1D6A5}\\u{1D6A8}-\\u{1D6C0}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6FA}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D734}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D76E}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D7A8}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7CB}\\u{1DF00}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E030}-\\u{1E06D}\\u{1E100}-\\u{1E12C}\\u{1E137}-\\u{1E13D}\\u{1E14E}\\u{1E290}-\\u{1E2AD}\\u{1E2C0}-\\u{1E2EB}\\u{1E4D0}-\\u{1E4EB}\\u{1E5D0}-\\u{1E5ED}\\u{1E5F0}\\u{1E7E0}-\\u{1E7E6}\\u{1E7E8}-\\u{1E7EB}\\u{1E7ED}\\u{1E7EE}\\u{1E7F0}-\\u{1E7FE}\\u{1E800}-\\u{1E8C4}\\u{1E900}-\\u{1E943}\\u{1E94B}\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u{20000}-\\u{2A6DF}\\u{2A700}-\\u{2B739}\\u{2B740}-\\u{2B81D}\\u{2B820}-\\u{2CEA1}\\u{2CEB0}-\\u{2EBE0}\\u{2EBF0}-\\u{2EE5D}\\u{2F800}-\\u{2FA1D}\\u{30000}-\\u{3134A}\\u{31350}-\\u{323AF}]*$/u.test(e)},{name:\"string\",test:j},{name:\"Chain\",test:Be},{name:\"Array\",test:b},{name:\"Matrix\",test:_},{name:\"DenseMatrix\",test:H},{name:\"SparseMatrix\",test:G},{name:\"Range\",test:V},{name:\"Index\",test:Z},{name:\"boolean\",test:W},{name:\"ResultSet\",test:Y},{name:\"Help\",test:J},{name:\"function\",test:X},{name:\"Date\",test:ne},{name:\"RegExp\",test:ie},{name:\"null\",test:he},{name:\"undefined\",test:de},{name:\"AccessorNode\",test:ge},{name:\"ArrayNode\",test:ye},{name:\"AssignmentNode\",test:xe},{name:\"BlockNode\",test:be},{name:\"ConditionalNode\",test:ve},{name:\"ConstantNode\",test:ae},{name:\"FunctionNode\",test:Ae},{name:\"FunctionAssignmentNode\",test:Ne},{name:\"IndexNode\",test:Ee},{name:\"Node\",test:O},{name:\"ObjectNode\",test:Se},{name:\"OperatorNode\",test:oe},{name:\"ParenthesisNode\",test:Me},{name:\"RangeNode\",test:Ce},{name:\"RelationalNode\",test:Te},{name:\"SymbolNode\",test:se},{name:\"Map\",test:fe},{name:\"Object\",test:ce}]),a.addConversions([{from:\"number\",to:\"BigNumber\",convert:function(e){if(r||ut(e),1515 significant digits to BigNumber (value: \"+e+\"). Use function bignumber(x) to convert to BigNumber.\");return new r(e)}},{from:\"number\",to:\"Complex\",convert:function(e){return n||lt(e),new n(e,0)}},{from:\"BigNumber\",to:\"Complex\",convert:function(e){return n||lt(e),new n(e.toNumber(),0)}},{from:\"bigint\",to:\"number\",convert:function(e){if(e>Number.MAX_SAFE_INTEGER)throw new TypeError(\"Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: \"+e+\")\");return Number(e)}},{from:\"bigint\",to:\"BigNumber\",convert:function(e){return r||ut(e),new r(e.toString())}},{from:\"bigint\",to:\"Fraction\",convert:function(e){return i||ct(e),new i(e)}},{from:\"Fraction\",to:\"BigNumber\",convert:function(e){throw new TypeError(\"Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.\")}},{from:\"Fraction\",to:\"Complex\",convert:function(e){return n||lt(e),new n(e.valueOf(),0)}},{from:\"number\",to:\"Fraction\",convert:function(e){i||ct(e);const t=new i(e);if(t.valueOf()!==e)throw new TypeError(\"Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: \"+e+\"). Use function fraction(x) to convert to Fraction.\");return t}},{from:\"string\",to:\"number\",convert:function(e){var t=Number(e);if(isNaN(t))throw new Error('Cannot convert \"'+e+'\" to a number');return t}},{from:\"string\",to:\"BigNumber\",convert:function(t){r||ut(t);try{return new r(t)}catch(e){throw new Error('Cannot convert \"'+t+'\" to BigNumber')}}},{from:\"string\",to:\"bigint\",convert:function(t){try{return BigInt(t)}catch(e){throw new Error('Cannot convert \"'+t+'\" to BigInt')}}},{from:\"string\",to:\"Fraction\",convert:function(t){i||ct(t);try{return new i(t)}catch(e){throw new Error('Cannot convert \"'+t+'\" to Fraction')}}},{from:\"string\",to:\"Complex\",convert:function(t){n||lt(t);try{return new n(t)}catch(e){throw new Error('Cannot convert \"'+t+'\" to Complex')}}},{from:\"boolean\",to:\"number\",convert:function(e){return+e}},{from:\"boolean\",to:\"BigNumber\",convert:function(e){return r||ut(e),new r(+e)}},{from:\"boolean\",to:\"bigint\",convert:function(e){return BigInt(+e)}},{from:\"boolean\",to:\"Fraction\",convert:function(e){return i||ct(e),new i(+e)}},{from:\"boolean\",to:\"string\",convert:function(e){return String(e)}},{from:\"Array\",to:\"Matrix\",convert:function(e){if(t)return new t(e);throw new Error(\"Cannot convert array into a Matrix: no class 'DenseMatrix' provided\")}},{from:\"Matrix\",to:\"Array\",convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,r)=>{var n=a.createError(e,t,r);if([\"wrongType\",\"mismatch\"].includes(n.data.category)&&1===t.length&&$(t[0])&&r.some(e=>!e.params.includes(\",\"))){const t=new TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw t.data=n.data,t}throw n},a.onMismatch=(e,t,r)=>{var n=a.createError(e,t,r);if([\"wrongType\",\"mismatch\"].includes(n.data.category)&&1===t.length&&$(t[0])&&r.some(e=>!e.params.includes(\",\"))){const t=new TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw t.data=n.data,t}throw n},a});function ut(e){throw new Error(`Cannot convert value ${e} into a BigNumber: no class 'BigNumber' provided`)}function lt(e){throw new Error(`Cannot convert value ${e} into a Complex number: no class 'Complex' provided`)}function ct(e){throw new Error(`Cannot convert value ${e} into a Fraction, no class 'Fraction' provided.`)}const ft=s(\"ResultSet\",[],()=>{function t(e){if(!(this instanceof t))throw new SyntaxError(\"Constructor must be called with the new operator\");this.entries=e||[]}return t.prototype.type=\"ResultSet\",t.prototype.isResultSet=!0,t.prototype.valueOf=function(){return this.entries},t.prototype.toString=function(){return\"[\"+this.entries.map(String).join(\", \")+\"]\"},t.prototype.toJSON=function(){return{mathjs:\"ResultSet\",entries:this.entries}},t.fromJSON=function(e){return new t(e.entries)},t},{isClass:!0});var pt,mt,ht=9e15,dt=1e9,gt=\"0123456789abcdef\",yt=\"2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058\",xt=\"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789\",bt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ht,maxE:ht,crypto:!1},w=!0,vt=\"[DecimalError] \",wt=vt+\"Invalid argument: \",Nt=vt+\"Precision limit exceeded\",At=vt+\"crypto unavailable\",Et=\"[object Decimal]\",St=Math.floor,d=Math.pow,Mt=/^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,Ct=/^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,Tt=/^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,Bt=/^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,Ft=1e7,Dt=yt.length-1,Ot=xt.length-1,o={toStringTag:Et};function _t(e){var t,r,n,i=e.length-1,a=\"\",o=e[0];if(0r-1&&(void 0===a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}o.absoluteValue=o.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),B(e)},o.ceil=function(){return B(new this.constructor(this),this.e+1,2)},o.clampedTo=o.clamp=function(e,t){var r=this.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(wt+t);return this.cmp(e)<0?e:0e.e^o<0?1:-1;for(t=0,r=(s=i.length)<(n=a.length)?s:n;ta[t]^o<0?1:-1;return s===n?0:nthis.d.length-2},o.isNaN=function(){return!this.s},o.isNegative=o.isNeg=function(){return this.s<0},o.isPositive=o.isPos=function(){return 0(n=Math.max(Math.ceil(s/7),o)+2)&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for((c=(n=l.length)<(o=f.length))&&(o=n),n=0;n(i=(c=Math.ceil(a/7))>i?c+1:i+1)&&(n=i,r.length=1),r.reverse();n--;)r.push(0);r.reverse()}for((i=s.length)-(n=u.length)<0&&(n=i,r=u,u=s,s=r),t=0;n;)t=(s[--n]=s[n]+u[n]+t)/Ft|0,s[n]%=Ft;for(t&&(s.unshift(t),++l),i=s.length;0==s[--i];)s.pop();return e.d=s,e.e=jt(s,l),w?B(e,a,o):e},o.precision=o.sd=function(e){var t;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(wt+e);return this.d?(t=Ht(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},o.round=function(){var e=this.constructor;return B(new e(this),this.e+1,e.rounding)},o.sine=o.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Kt(e,2,t,t);r=16<(r=1.4*Math.sqrt(n))?16:0|r,t=Kt(e,2,t=t.times(1/er(5,r)),t);for(var i,a=new e(5),o=new e(16),s=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}(n,tr(n,r)),n.precision=e,n.rounding=t,B(2=e.d.length-1&&(r=l<0?-l:l)<=9007199254740991)return i=Vt(u,s,r,n),e.s<0?new u(1).div(i):B(i,n,a);if((o=s.s)<0){if(tu.maxE+1||t=n.toExpPos):(zt(e,1,dt),void 0===t?t=n.rounding:zt(t,0,8),Ut(r=B(new n(r),e,t),e<=r.e||r.e<=n.toExpNeg,e));return r.isNeg()&&!r.isZero()?\"-\"+t:t},o.toSignificantDigits=o.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(zt(e,1,dt),void 0===t?t=r.rounding:zt(t,0,8)),B(new r(this),e,t)},o.toString=function(){var e=this,t=e.constructor,t=Ut(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?\"-\"+t:t},o.truncated=o.trunc=function(){return B(new this.constructor(this),this.e+1,1)},o.valueOf=o.toJSON=function(){var e=this,t=e.constructor,t=Ut(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?\"-\"+t:t};var N=function(e,t,r,n,i,a){var o,s,u,l,c,f,p,m,h,d,g,y,x,b,v,w,N,A,E,S=e.constructor,M=e.s==t.s?1:-1,C=e.d,T=t.d;if(!(C&&C[0]&&T&&T[0]))return new S(e.s&&t.s&&(C?!T||C[0]!=T[0]:T)?C&&0==C[0]||!T?0*M:M/0:NaN);for(s=a?(c=1,e.e-t.e):(a=Ft,St(e.e/(c=7))-St(t.e/c)),A=T.length,w=C.length,h=(M=new S(M)).d=[],u=0;T[u]==(C[u]||0);u++);if(T[u]>(C[u]||0)&&s--,null==r?(x=r=S.precision,n=S.rounding):x=i?r+(e.e-t.e)+1:r,x<0)h.push(1),f=!0;else{if(x=x/c+2|0,u=0,1==A){for(T=T[l=0],x++;(u=a/2&&++N;l=0,(o=Rt(T,d,A,g))<0?(y=d[0],1<(l=(y=A!=g?y*a+(d[1]||0):y)/N|0)?1==(o=Rt(p=kt(T,l=a<=l?a-1:l,a),d,m=p.length,g=d.length))&&(l--,Pt(p,At[i]?1:-1;break}return a}function Pt(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]=(s=c.length)){if(!n)break e;for(;s++<=f;)c.push(0);l=u=0,o=(a%=7)-7+(i=1)}else{for(l=s=c[f],i=1;10<=s;s/=10)i++;u=(o=(a%=7)-7+i)<0?0:l/d(10,i-o-1)%10|0}if(n=n||t<0||void 0!==c[f+1]||(o<0?l:l%d(10,i-o-1)),u=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):5p.maxE?(e.d=null,e.e=NaN):e.ee.constructor.maxE?(e.d=null,e.e=NaN):e.ei-1;)c[r]=0,r||(++a,c.unshift(1));for(s=c.length;!c[s-1];--s);for(o=0,l=\"\";os)for(a-=s;a--;)l+=\"0\";else at&&(e.length=t,1)}function ir(e){return new this(e).abs()}function ar(e){return new this(e).acos()}function or(e){return new this(e).acosh()}function sr(e,t){return new this(e).plus(t)}function ur(e){return new this(e).asin()}function lr(e){return new this(e).asinh()}function cr(e){return new this(e).atan()}function fr(e){return new this(e).atanh()}function pr(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?$t(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=$t(this,a,1).times(.5)).s=e.s:r=t.s<0?(this.precision=a,this.rounding=1,r=this.atan(N(e,t,a,1)),t=$t(this,a,1),this.precision=n,this.rounding=i,e.s<0?r.minus(t):r.plus(t)):this.atan(N(e,t,a,1)):(r=$t(this,a,1).times(0a.maxE?(i.e=NaN,i.d=null):e.e{let{on:t,config:r}=e;const n=Vr.clone({precision:r.precision,modulo:Vr.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type=\"BigNumber\",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:\"BigNumber\",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},t&&t(\"config\",function(e,t){e.precision!==t.precision&&n.config({precision:e.precision})}),n},{isClass:!0}),Wr=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},Yr=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},Jr=function(){throw SyntaxError(\"Invalid Param\")};function Xr(e,t){var r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}function Qr(e,n){const i=Kr;if(null==e)i.re=i.im=0;else if(void 0!==n)i.re=e,i.im=n;else switch(typeof e){case\"object\":if(\"im\"in e&&\"re\"in e)i.re=e.re,i.im=e.im;else if(\"abs\"in e&&\"arg\"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return u.INFINITY;i.re=e.abs*Math.cos(e.arg),i.im=e.abs*Math.sin(e.arg)}else if(\"r\"in e&&\"phi\"in e){if(!isFinite(e.r)&&isFinite(e.phi))return u.INFINITY;i.re=e.r*Math.cos(e.phi),i.im=e.r*Math.sin(e.phi)}else 2===e.length?(i.re=e[0],i.im=e[1]):Jr();break;case\"string\":i.im=i.re=0;const n=e.replace(/_/g,\"\").match(/\\d+\\.?\\d*e[+-]?\\d+|\\d+\\.?\\d*|\\.\\d+|./g);let t=1,r=0;null===n&&Jr();for(let e=0;e(Object.defineProperty(u,\"name\",{value:\"Complex\"}),(u.prototype.constructor=u).prototype.type=\"Complex\",u.prototype.isComplex=!0,u.prototype.toJSON=function(){return{mathjs:\"Complex\",re:this.re,im:this.im}},u.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},u.prototype.format=function(e){let t=this.im,r=this.re;const n=He(this.re,e),i=He(this.im,e),a=A(e)?e:e?e.precision:null;if(null!==a){const e=Math.pow(10,-a);Math.abs(r/t)t.re?1:e.ret.im?1:e.imr?(u=n,i):(u=t,r);break}am.s*m.n*this.d},gte:function(e,t){return y(e,t),this.s*this.n*m.d>=m.s*m.n*this.d},compare:function(e,t){y(e,t);e=this.s*this.n*m.d-m.s*m.n*this.d;return(pp&&this.s>=p?f:p),e)},floor:function(e){return e=nn**BigInt(e||0),g(on(this.s*e*this.n/this.d)-(e*this.n%this.d>p&&this.s=p?f:p)+tn*(e*this.n%this.d)>this.d?f:p),e)},roundTo:function(e,t){y(e,t);var e=this.n*m.d,t=this.d*m.n,r=e%t;let n=on(e/t);return t<=r+r&&n++,g(this.s*n*m.n,m.d)},divisible:function(e,t){return y(e,t),!(!(m.n*this.d)||this.n*m.d%(m.n*this.d))},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(t){let r=this.n,n=this.d,i=(t=t||15,function(e){for(;e%tn===p;e/=tn);for(;e%rn===p;e/=rn);if(e===f)return p;let t=nn%e,r=1;for(;t!==f;r++)if(t=t*nn%e,2e3p;e=e*e%r,t>>=f)t&f&&(n=n*e%r);return n}(nn,e,t);for(let e=0;e<300;e++){if(r===n)return BigInt(e);r=r*nn%t,n=n*nn%t}return 0}(n,i),o=this.sp&&(n=n+i+\" \",t%=r),n=(n+=t)+\"/\"+r),n},toLatex:function(e){let t=this.n,r=this.d,n=this.sp&&(n+=i,t%=r),n=(n=(n+=\"\\\\frac{\")+t+\"}{\")+r+\"}\"),n},toContinued:function(){let e=this.n,t=this.d,r=[];do{r.push(on(e/t));var n=e%t;e=t,t=n}while(e!==f);return r},simplify:function(e){const n=BigInt(1/(e||.001)|0),i=this.abs(),a=i.toContinued();for(let r=1;r(Object.defineProperty(ln,\"name\",{value:\"Fraction\"}),(ln.prototype.constructor=ln).prototype.type=\"Fraction\",ln.prototype.isFraction=!0,ln.prototype.toJSON=function(){return{mathjs:\"Fraction\",n:String(this.s*this.n),d:String(this.d)}},ln.fromJSON=function(e){return new ln(e)},ln),{isClass:!0}),hn=s(\"Range\",[],()=>{function o(e,t,r){if(!(this instanceof o))throw new SyntaxError(\"Constructor must be called with the new operator\");var n=null!=e,i=null!=t,a=null!=r;if(n)if(Q(e))e=e.toNumber();else if(\"number\"!=typeof e&&!R(e))throw new TypeError(\"Parameter start must be a number or bigint\");if(i)if(Q(t))t=t.toNumber();else if(\"number\"!=typeof t&&!R(t))throw new TypeError(\"Parameter end must be a number or bigint\");if(a)if(Q(r))r=r.toNumber();else if(\"number\"!=typeof r&&!R(r))throw new TypeError(\"Parameter step must be a number or bigint\");this.start=n?parseFloat(e):0,this.end=i?parseFloat(t):0,this.step=a?parseFloat(r):1}return o.prototype.type=\"Range\",o.prototype.isRange=!0,o.parse=function(e){if(\"string\"!=typeof e)return null;const t=e.split(\":\").map(function(e){return parseFloat(e)});if(t.some(function(e){return isNaN(e)}))return null;switch(t.length){case 2:return new o(t[0],t[1]);case 3:return new o(t[0],t[2],t[1]);default:return null}},o.prototype.clone=function(){return new o(this.start,this.end,this.step)},o.prototype.size=function(){let e=0;var t=this.start,r=this.step,t=this.end-t;return ke(r)===ke(t)?e=Math.ceil(t/r):0==t&&(e=0),[e=isNaN(e)?0:e]},o.prototype.min=function(){var e=this.size()[0];return 0n;)e(t,[i],this),t+=r,i++},o.prototype.map=function(n){const i=[];return this.forEach(function(e,t,r){i[t[0]]=n(e,t,r)}),i},o.prototype.toArray=function(){const r=[];return this.forEach(function(e,t){r[t[0]]=e}),r},o.prototype.valueOf=function(){return this.toArray()},o.prototype.format=function(e){let t=He(this.start,e);return 1!==this.step&&(t+=\":\"+He(this.step,e)),t+=\":\"+He(this.end,e)},o.prototype.toString=function(){return this.format()},o.prototype.toJSON=function(){return{mathjs:\"Range\",start:this.start,end:this.end,step:this.step}},o.fromJSON=function(e){return new o(e.start,e.end,e.step)},o},{isClass:!0}),dn=s(\"Matrix\",[],()=>{function e(){if(!(this instanceof e))throw new SyntaxError(\"Constructor must be called with the new operator\")}return e.prototype.type=\"Matrix\",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error(\"Cannot invoke storage on a Matrix interface\")},e.prototype.datatype=function(){throw new Error(\"Cannot invoke datatype on a Matrix interface\")},e.prototype.create=function(e,t){throw new Error(\"Cannot invoke create on a Matrix interface\")},e.prototype.subset=function(e,t,r){throw new Error(\"Cannot invoke subset on a Matrix interface\")},e.prototype.get=function(e){throw new Error(\"Cannot invoke get on a Matrix interface\")},e.prototype.set=function(e,t,r){throw new Error(\"Cannot invoke set on a Matrix interface\")},e.prototype.resize=function(e,t){throw new Error(\"Cannot invoke resize on a Matrix interface\")},e.prototype.reshape=function(e,t){throw new Error(\"Cannot invoke reshape on a Matrix interface\")},e.prototype.clone=function(){throw new Error(\"Cannot invoke clone on a Matrix interface\")},e.prototype.size=function(){throw new Error(\"Cannot invoke size on a Matrix interface\")},e.prototype.map=function(e,t){throw new Error(\"Cannot invoke map on a Matrix interface\")},e.prototype.forEach=function(e){throw new Error(\"Cannot invoke forEach on a Matrix interface\")},e.prototype[Symbol.iterator]=function(){throw new Error(\"Cannot iterate a Matrix interface\")},e.prototype.toArray=function(){throw new Error(\"Cannot invoke toArray on a Matrix interface\")},e.prototype.valueOf=function(){throw new Error(\"Cannot invoke valueOf on a Matrix interface\")},e.prototype.format=function(e){throw new Error(\"Cannot invoke format on a Matrix interface\")},e.prototype.toString=function(){throw new Error(\"Cannot invoke toString on a Matrix interface\")},e},{isClass:!0});function gn(){return(gn=Object.assign?Object.assign.bind():function(e){for(var t=1;tvn(e)+\": \"+S(t[e],r)).join(\", \")+\"}\":String(t);{var n=t,i=r;if(\"function\"==typeof i)return i(n);if(!n.isFinite())return n.isNaN()?\"NaN\":n.gt(0)?\"Infinity\":\"-Infinity\";const{notation:s,precision:u,wordSize:l}=Ge(i);switch(s){case\"fixed\":return n.toFixed(u);case\"exponential\":return xn(n,u);case\"engineering\":{var a=n;var o=u;const c=a.e,f=c%3==0?c:c<0?c-3-c%3:c-c%3;let e=a.mul(Math.pow(10,-f)).toPrecision(o);return(e=e.includes(\"e\")?new a.constructor(e).toFixed():e)+\"e\"+(0<=c?\"+\":\"\")+f.toString();return}case\"bin\":return yn(n,2,l);case\"oct\":return yn(n,8,l);case\"hex\":return yn(n,16,l);case\"auto\":{const s=bn(null==i?void 0:i.lowerExp,-3),l=bn(null==i?void 0:i.upperExp,5);if(n.isZero())return\"0\";let e;const p=n.toSignificantDigits(u),m=p.e;return(e=m>=s&&mt.truncate?r.substring(0,t.truncate-3)+\"...\":r}function vn(e){const t=String(e);let r=\"\",n=0;for(;n/g,\">\")}function An(e,t){if(!j(e))throw new TypeError(\"Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: \"+K(e)+\", index: 0)\");if(j(t))return e===t?0:t=this.max?this.message=\"Index out of range (\"+this.index+\" > \"+(this.max-1)+\")\":this.message=\"Index out of range (\"+this.index+\")\",this.stack=(new Error).stack}function T(e){const t=[];for(;Array.isArray(e);)t.push(e.length),e=e[0];return t}function Sn(e,t){if(0===t.length){if(Array.isArray(e))throw new z(e.length,0)}else!function e(t,r,n){let i;var a=t.length;if(a!==r[n])throw new z(a,r[n]);if(n\")}(e,t,0)}function Mn(e,t){const r=e.isMatrix?e._size:T(e);t._sourceSize.forEach((e,t)=>{if(null!==e&&e!==r[t])throw new z(e,r[t])})}function M(e,t){if(void 0!==e){if(!A(e)||!v(e))throw new TypeError(\"Index must be an integer (value: \"+e+\")\");if(e<0||\"number\"==typeof t&&t<=e)throw new En(e,t)}}function Cn(t){for(let e=0;ee*t,1)}function On(e,t){const r=t||T(e);for(;Array.isArray(e)&&1===e.length;)e=e[0],r.shift();let n=r.length;for(;1===r[n-1];)n--;return nt.test(e))}function Rn(e,t){return Array.prototype.join.call(e,t)}function Pn(t){if(!Array.isArray(t))throw new TypeError(\"Array input expected\");if(0===t.length)return t;const r=[];let n=0;r[0]={value:t[0],identifier:0};for(let e=1;ee.length),i=Math.max(...n),a=new Array(i).fill(null);for(let e=0;ea[t]&&(a[t]=r[e])}}for(let e=0;er[a])throw new Error(`shape mismatch: mismatch is found in arg with shape (${t}) not possible to broadcast dimension ${i} with size ${t[e]} to size `+r[a])}}function Gn(e,t){let r=T(e);if(De(r,t))return e;Hn(r,t);var n,i,a,o=$n(r,t),s=o.length,t=[...Array(s-r.length).fill(1),...r];let u=gn([],e);r.lengthe[t],e)}function Zn(i,a,e){if(0===i.length)return[];if(20),t=o.isMatrix?o.get(s):Vn(o,s);n=function(t,e,r){const n=[e,r,o];for(let e=3;0{let[t,r]=e;t.split(\",\").length===n&&i.push(r)}),1===i.length)return i[0]}(a,n);i=void 0!==l?l:a}else i=a;return 1<=n&&n<=3?{isUnary:1===n,fn:function(){for(var e=arguments.length,t=new Array(e),r=0;r{let t=e[\"Matrix\"];function g(e,t){if(!(this instanceof g))throw new SyntaxError(\"Constructor must be called with the new operator\");if(t&&!j(t))throw new Error(\"Invalid datatype: \"+t);if(_(e))\"DenseMatrix\"===e.type?(this._data=ee(e._data),this._size=ee(e._size)):(this._data=e.toArray(),this._size=e.size()),this._datatype=t||e._datatype;else if(e&&b(e.data)&&b(e.size))this._data=e.data,this._size=e.size,Sn(this._data,this._size),this._datatype=t||e.datatype;else if(b(e))this._data=r(e),this._size=T(this._data),Sn(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError(\"Unsupported type of data (\"+K(e)+\")\");this._data=[],this._size=[0],this._datatype=t}}function a(t,e,r){if(0!==e.length)return t._size=e.slice(0),t._data=Tn(t._data,t._size,r),t;{let e=t._data;for(;b(e);)e=e[0];return e}}function y(e,r,t){const n=e._size.slice(0);let i=!1;for(;n.lengthn[e]&&(n[e]=r[e],i=!0);i&&a(e,n,t)}function r(e){return _(e)?r(e.valueOf()):b(e)?e.map(r):e}return(g.prototype=new t).createDenseMatrix=function(e,t){return new g(e,t)},Object.defineProperty(g,\"name\",{value:\"DenseMatrix\"}),(g.prototype.constructor=g).prototype.type=\"DenseMatrix\",g.prototype.isDenseMatrix=!0,g.prototype.getDataType=function(){return jn(this._data,K)},g.prototype.storage=function(){return\"dense\"},g.prototype.datatype=function(){return this._datatype},g.prototype.create=function(e,t){return new g(e,t)},g.prototype.subset=function(e,t,n){switch(arguments.length){case 1:var r=this,i=e;if(!Z(i))throw new TypeError(\"Invalid index\");if(i.isScalar())return r.get(i.min());{var a=i.size();if(a.length!==r._size.length)throw new z(a.length,r._size.length);var o=i.min(),s=i.max();for(let e=0,t=r._size.length;e(M(e,r.length),t(r[e],n+1))):e.map(e=>(M(e,r.length),r[e]))).valueOf()}(e),size:o}}(r._data,i);return m._size=h.size,m._datatype=r._datatype,m._data=h.data,m}case 2:case 3:{var u=this;a=e;i=t;var l=n;if(!a||!0!==a.isIndex)throw new TypeError(\"Invalid index\");var c=a.size(),f=a.isScalar();let r;if(_(i)?(r=i.size(),i=i.valueOf()):r=T(i),f){if(0!==r.length)throw new TypeError(\"Scalar expected\");u.set(a.min(),i,l)}else{if(!De(r,c))try{r=T(i=0===r.length?Gn([i],c):Gn(i,c))}catch(u){}if(c.length\");y(u,a.max().map(function(e){return e+1}),l);{f=u._data;var p=a;l=i;const d=p.size().length-1;!function r(n,i){let a=2{M(e,n.length),r(n[e],i[t[0]],a+1)}):e.forEach((e,t)=>{M(e,n.length),n[e]=i[t[0]]})}(f,l)}}return u;return}default:throw new SyntaxError(\"Wrong number of arguments\")}},g.prototype.get=function(e){return Vn(this._data,e)},g.prototype.set=function(e,t,r){if(!b(e))throw new TypeError(\"Array expected\");if(e.lengthArray.isArray(e)&&1===e.length?e[0]:e);return a(r?this.clone():this,e,t)},g.prototype.reshape=function(e,t){const r=t?this.clone():this;r._data=Bn(r._data,e);t=r._size.reduce((e,t)=>e*t);return r._size=Fn(e,t),r},g.prototype.clone=function(){return new g({data:ee(this._data),size:ee(this._size),datatype:this._datatype})},g.prototype.size=function(){return this._size.slice(0)},g.prototype.map=function(t){let r=2e*t,1);for(let e=0;e[e[t]]);e.push(new g(r,this._datatype))}return e},g.prototype.toArray=function(){return ee(this._data)},g.prototype.valueOf=function(){return this._data},g.prototype.format=function(e){return S(this._data,e)},g.prototype.toString=function(){return S(this._data)},g.prototype.toJSON=function(){return{mathjs:\"DenseMatrix\",data:this._data,size:this._size,datatype:this._datatype}},g.prototype.diagonal=function(e){if(e){if(!A(e=Q(e)?e.toNumber():e)||!v(e))throw new TypeError(\"The parameter k must be an integer number\")}else e=0;const t=0{let t=e[\"typed\"];return t(\"clone\",{any:ee})});function Kn(e){const t=e.length,r=e[0].length;let n,i;const a=[];for(i=0;it(e),!1,!0):Wn(e,t,!0)}function le(e,t,r){if(!r)return _(e)?e.map(e=>t(e),!1,!0):Zn(e,t,!0);const n=e=>0===e?e:t(e);return _(e)?e.map(e=>n(e),!1,!0):Zn(e,n,!0)}function ri(e,t,r){var n=Array.isArray(e)?T(e):e.size();if(t<0||t>=n.length)throw new En(t,n.length);return _(e)?e.create(ni(e.valueOf(),t,r),e.datatype()):ni(e,t,r)}function ni(e,t,r){let n,i,a,o;if(t<=0){if(Array.isArray(e[0])){for(o=Kn(e),i=[],n=0;n{let t=e[\"typed\"];return t(ai,{number:v,BigNumber:function(e){return e.isInt()},bigint:function(e){return!0},Fraction:function(e){return 1n===e.d},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),si=\"number\";function ui(e){return Number.isNaN(e)}function li(e,t,r,n){r=2{let{typed:r,config:t}=e;return r(ci,{number:e=>!Xe(e,0,t.relTol,t.absTol)&&e<0,BigNumber:e=>!li(e,new e.constructor(0),t.relTol,t.absTol)&&e.isNeg()&&!e.isZero()&&!e.isNaN(),bigint:e=>e<0n,Fraction:e=>e.s<0n,Unit:r.referToSelf(t=>e=>r.find(t,e.valueType())(e.value)),\"Array | Matrix\":r.referToSelf(t=>e=>le(e,t))})}),pi=\"isNumeric\",mi=s(pi,[\"typed\"],e=>{let t=e[\"typed\"];return t(pi,{\"number | BigNumber | bigint | Fraction | boolean\":()=>!0,\"Complex | Unit | string | null | undefined | Node\":()=>!1,\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),hi=\"hasNumericValue\",di=s(hi,[\"typed\",\"isNumeric\"],e=>{let{typed:t,isNumeric:r}=e;return t(hi,{boolean:()=>!0,string:function(e){return 0{let{typed:r,config:t}=e;return r(gi,{number:e=>!Xe(e,0,t.relTol,t.absTol)&&0!(li(e,new e.constructor(0),t.relTol,t.absTol)||e.isNeg()||e.isZero()||e.isNaN()),bigint:e=>0n0ne=>r.find(t,e.valueType())(e.value)),\"Array | Matrix\":r.referToSelf(t=>e=>le(e,t))})}),xi=s(\"isZero\",[\"typed\",\"equalScalar\"],e=>{let{typed:r,equalScalar:t}=e;return r(\"isZero\",{\"number | BigNumber | Complex | Fraction\":e=>t(e,0),bigint:e=>0n===e,Unit:r.referToSelf(t=>e=>r.find(t,e.valueType())(e.value)),\"Array | Matrix\":r.referToSelf(t=>e=>le(e,t))})}),bi=s(\"isNaN\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"isNaN\",{number:ui,BigNumber:function(e){return e.isNaN()},bigint:function(e){return!1},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),vi=s(\"typeOf\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"typeOf\",{any:K})}),wi=s(\"compareUnits\",[\"typed\"],e=>{let n=e[\"typed\"];return{\"Unit, Unit\":n.referToSelf(r=>(e,t)=>{if(e.equalBase(t))return n.find(r,[e.valueType(),t.valueType()])(e.value,t.value);throw new Error(\"Cannot compare units with different base\")})}}),Ni=\"equalScalar\",Ai=s(Ni,[\"typed\",\"config\"],e=>{let{typed:t,config:i}=e;e=wi({typed:t});return t(Ni,{\"boolean, boolean\":function(e,t){return e===t},\"number, number\":function(e,t){return Xe(e,t,i.relTol,i.absTol)},\"BigNumber, BigNumber\":function(e,t){return e.eq(t)||li(e,t,i.relTol,i.absTol)},\"bigint, bigint\":function(e,t){return e===t},\"Fraction, Fraction\":function(e,t){return e.equals(t)},\"Complex, Complex\":function(e,t){return e=e,t=t,r=i.relTol,n=i.absTol,Xe(e.re,t.re,r,n)&&Xe(e.im,t.im,r,n);var r,n}},e)}),Ei=(s(Ni,[\"typed\",\"config\"],e=>{let{typed:t,config:r}=e;return t(Ni,{\"number, number\":function(e,t){return Xe(e,t,r.relTol,r.absTol)}})}),s(\"SparseMatrix\",[\"typed\",\"equalScalar\",\"Matrix\"],e=>{let{typed:y,equalScalar:x,Matrix:t}=e;function E(e,t){if(!(this instanceof E))throw new SyntaxError(\"Constructor must be called with the new operator\");if(t&&!j(t))throw new Error(\"Invalid datatype: \"+t);if(_(e))r=this,i=t,\"SparseMatrix\"===(n=e).type?(r._values=n._values?ee(n._values):void 0,r._index=ee(n._index),r._ptr=ee(n._ptr),r._size=ee(n._size),r._datatype=i||n._datatype):a(r,n.valueOf(),i||n._datatype);else if(e&&b(e.index)&&b(e.ptr)&&b(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(b(e))a(this,e,t);else{if(e)throw new TypeError(\"Unsupported type of data (\"+K(e)+\")\");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}var r,n,i}function a(r,n,i){r._values=[],r._index=[],r._ptr=[],r._datatype=i;var a=n.length;let o=0,s=x,u=0;if(j(i)&&(s=y.find(x,[i,i])||x,u=y.convert(0,i)),0p){for(c=p;cn-1&&(r._values.splice(f,1),r._index.splice(f,1),e++)}r._ptr[c]=r._values.length}return r._size[0]=n,r._size[1]=t,r}function r(t,r,e,n,i){const a=n[0],o=n[1],s=[];let u,l;for(u=0;u\");if(1===n.length)o.dimension(0).forEach(function(e,t){M(e),c.set([e,0],f[t[0]],p)});else{const n=o.dimension(0),A=o.dimension(1);n.forEach(function(r,n){M(r),A.forEach(function(e,t){M(e),c.set([r,e],f[n[0]][t[0]],p)})})}}return c;return}default:throw new SyntaxError(\"Wrong number of arguments\")}},E.prototype.get=function(e){if(!b(e))throw new TypeError(\"Array expected\");if(e.length!==this._size.length)throw new z(e.length,this._size.length);if(!this._values)throw new Error(\"Cannot invoke get on a Pattern only matrix\");var t=e[0],e=e[1],r=(M(t,this._size[0]),M(e,this._size[1]),m(t,this._ptr[e],this._ptr[e+1],this._index));return ri-1||e>a-1)&&(d(this,Math.max(n+1,i),Math.max(e+1,a),r),i=this._size[0],a=this._size[1]),M(n,i),M(e,a);r=m(n,this._ptr[e],this._ptr[e+1],this._index);if(rArray.isArray(e)&&1===e.length?e[0]:e);if(2!==n.length)throw new Error(\"Only two dimensions matrix are supported\");return n.forEach(function(e){if(!A(e)||!v(e)||e<0)throw new TypeError(\"Invalid size, must contain positive integers (size: \"+S(n)+\")\")}),d(r?this.clone():this,n[0],n[1],t)},E.prototype.reshape=function(t,r){if(!b(t))throw new TypeError(\"Array expected\");if(2!==t.length)throw new Error(\"Sparse matrices can only be reshaped in two dimensions\");t.forEach(function(e){if(!A(e)||!v(e)||e<=-2||0===e)throw new TypeError(\"Invalid size, must contain positive integers or -1 (size: \"+S(t)+\")\")});const n=this._size[0]*this._size[1];if(n!==(t=Fn(t,n))[0]*t[1])throw new Error(\"Reshaping sparse matrix will result in the wrong number of elements\");const i=r?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return i;const a=[];for(let t=0;t \"+(this._values?S(this._values[e],r):\"X\")}return a},E.prototype.toString=function(){return S(this.toArray())},E.prototype.toJSON=function(){return{mathjs:\"SparseMatrix\",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},E.prototype.diagonal=function(e){if(e){if(!A(e=Q(e)?e.toNumber():e)||!v(e))throw new TypeError(\"The parameter k must be an integer number\")}else e=0;const r=0{let t=e[\"typed\"];const r=t(\"number\",{\"\":function(){return 0},number:function(e){return e},string:function(r){if(\"NaN\"===r)return NaN;var n=(e=(n=r).match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/))?{input:n,radix:{\"0b\":2,\"0o\":8,\"0x\":16}[e[1]],integerPart:e[2],fractionalPart:e[3]}:null;if(n){var i=n,e=parseInt(i.integerPart,i.radix);let t=0;for(let e=0;e2**e-1)throw new SyntaxError(`String \"${r}\" is out of range`);t>=2**(e-1)&&(t-=2**e)}return t}},BigNumber:function(e){return e.toNumber()},bigint:function(e){return Number(e)},Fraction:function(e){return e.valueOf()},Unit:t.referToSelf(r=>e=>{const t=e.clone();return t.value=r(e.value),t}),null:function(e){return 0},\"Unit, string | Unit\":function(e,t){return e.toNumber(t)},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))});return r.fromJSON=function(e){return parseFloat(e.value)},r}),Mi=s(\"bigint\",[\"typed\"],e=>{let t=e[\"typed\"];const r=t(\"bigint\",{\"\":function(){return 0n},bigint:function(e){return e},number:function(e){return BigInt(e.toFixed())},BigNumber:function(e){return BigInt(e.round().toString())},Fraction:function(e){return BigInt(e.valueOf().toFixed())},\"string | boolean\":function(e){return BigInt(e)},null:function(e){return 0n},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))});return r.fromJSON=function(e){return BigInt(e.value)},r}),Ci=s(\"string\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"string\",{\"\":function(){return\"\"},number:He,null:function(e){return\"null\"},boolean:function(e){return e+\"\"},string:function(e){return e},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t)),any:function(e){return String(e)}})}),Ti=\"boolean\",Bi=s(Ti,[\"typed\"],e=>{let t=e[\"typed\"];return t(Ti,{\"\":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){var t=e.toLowerCase();if(\"true\"===t)return!0;if(\"false\"===t)return!1;t=Number(e);if(\"\"===e||isNaN(t))throw new Error('Cannot convert \"'+e+'\" to a boolean');return!!t},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Fi=s(\"bignumber\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:a}=e;return t(\"bignumber\",{\"\":function(){return new a(0)},number:function(e){return new a(e+\"\")},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){const r=t[2],n=a(t[1]),i=new a(2).pow(Number(r));if(n.gt(i.sub(1)))throw new SyntaxError(`String \"${e}\" is out of range`);t=new a(2).pow(Number(r)-1);return n.gte(t)?n.sub(i):n}return new a(e)},BigNumber:function(e){return e},bigint:function(e){return new a(e.toString())},Unit:t.referToSelf(r=>e=>{const t=e.clone();return t.value=r(e.value),t}),Fraction:function(e){return new a(String(e.n)).div(String(e.d)).times(String(e.s))},null:function(e){return new a(0)},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Di=s(\"complex\",[\"typed\",\"Complex\"],e=>{let{typed:t,Complex:r}=e;return t(\"complex\",{\"\":function(){return r.ZERO},number:function(e){return new r(e,0)},\"number, number\":function(e,t){return new r(e,t)},\"BigNumber, BigNumber\":function(e,t){return new r(e.toNumber(),t.toNumber())},Fraction:function(e){return new r(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return r(e)},null:function(e){return r(0)},Object:function(e){if(\"re\"in e&&\"im\"in e)return new r(e.re,e.im);if(\"r\"in e&&\"phi\"in e||\"abs\"in e&&\"arg\"in e)return new r(e);throw new Error(\"Expected object with properties (re and im) or (r and phi) or (abs and arg)\")},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Oi=s(\"fraction\",[\"typed\",\"Fraction\"],e=>{let{typed:t,Fraction:r}=e;return t(\"fraction\",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+\" cannot be represented as a fraction\");return new r(e)},string:function(e){return new r(e)},\"number, number\":function(e,t){return new r(e,t)},\"bigint, bigint\":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},bigint:function(e){return new r(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf(r=>e=>{const t=e.clone();return t.value=r(e.value),t}),Object:function(e){return new r(e)},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),_i=s(\"matrix\",[\"typed\",\"Matrix\",\"DenseMatrix\",\"SparseMatrix\"],e=>{let{typed:t,DenseMatrix:n,SparseMatrix:i}=e;return t(\"matrix\",{\"\":function(){return r([])},string:function(e){return r([],e)},\"string, string\":function(e,t){return r([],e,t)},Array:function(e){return r(e)},Matrix:function(e){return r(e,e.storage())},\"Array | Matrix, string\":r,\"Array | Matrix, string, string\":r});function r(e,t,r){if(\"dense\"===t||\"default\"===t||void 0===t)return new n(e,r);if(\"sparse\"===t)return new i(e,r);throw new TypeError(\"Unknown matrix type \"+JSON.stringify(t)+\".\")}}),zi=\"matrixFromFunction\",qi=s(zi,[\"typed\",\"matrix\",\"isZero\"],e=>{let{typed:t,matrix:a,isZero:o}=e;return t(zi,{\"Array | Matrix, function, string, string\":i,\"Array | Matrix, function, string\":function(e,t,r){return i(e,t,r)},\"Matrix, function\":function(e,t){return i(e,t,\"dense\")},\"Array, function\":function(e,t){return i(e,t,\"dense\").toArray()},\"Array | Matrix, string, function\":function(e,t,r){return i(e,r,t)},\"Array | Matrix, string, string, function\":function(e,t,r,n){return i(e,n,t,r)}});function i(e,n,t,r){let i;return(i=void 0!==r?a(t,r):a(t)).resize(e),i.forEach(function(e,t){var r=n(t);o(r)||i.set(t,r)}),i}}),Ii=\"matrixFromRows\",ki=s(Ii,[\"typed\",\"matrix\",\"flatten\",\"size\"],e=>{let{typed:t,matrix:r,flatten:i,size:n}=e;return t(Ii,{\"...Array\":a,\"...Matrix\":function(e){return r(a(e.map(e=>e.toArray())))}});function a(e){if(0===e.length)throw new TypeError(\"At least one row is needed to construct a matrix.\");const t=o(e[0]),r=[];for(const n of e){const e=o(n);if(e!==t)throw new TypeError(\"The vectors had different length: \"+(0|t)+\" \u2260 \"+(0|e));r.push(i(n))}return r}function o(e){e=n(e);if(1===e.length)return e[0];if(2!==e.length)throw new TypeError(\"Only one- or two-dimensional vectors are supported.\");if(1===e[0])return e[1];if(1===e[1])return e[0];throw new TypeError(\"At least one of the arguments is not a vector.\")}}),Ri=\"matrixFromColumns\",Pi=s(Ri,[\"typed\",\"matrix\",\"flatten\",\"size\"],e=>{let{typed:t,matrix:r,flatten:a,size:n}=e;return t(Ri,{\"...Array\":i,\"...Matrix\":function(e){return r(i(e.map(e=>e.toArray())))}});function i(e){if(0===e.length)throw new TypeError(\"At least one column is needed to construct a matrix.\");const t=o(e[0]),r=[];for(let e=0;e{let t=e[\"typed\"];return t(Ui,{\"Unit, Array\":function(e,t){return e.splitUnit(t)}})}),Li=\"number\",$i=\"number, number\";function Hi(e){return Math.abs(e)}function Gi(e,t){return e+t}function Vi(e,t){return e-t}function Zi(e,t){return e*t}function Wi(e){return-e}function Yi(e){return e}function Ji(e){return je(e)}function Xi(e){return e*e*e}function Qi(e){return Math.exp(e)}function Ki(e){return Le(e)}function ea(e,t){if(!v(e)||!v(t))throw new Error(\"Parameters in function lcm must be integer numbers\");if(0===e||0===t)return 0;for(var r,n=e*t;0!==t;)t=e%(r=t),e=r;return Math.abs(n/e)}function ta(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function ra(e){return Pe(e)}function na(e){return Re(e)}function ia(e){let t=1{let n=e[\"typed\"];return n(ca,{number:Wi,\"Complex | BigNumber | Fraction\":e=>e.neg(),bigint:e=>-e,Unit:n.referToSelf(r=>e=>{const t=e.clone();return t.value=n.find(r,t.valueType())(e.value),t}),\"Array | Matrix\":n.referToSelf(t=>e=>le(e,t,!0))})}),pa=\"unaryPlus\",ma=s(pa,[\"typed\",\"config\",\"numeric\"],e=>{let{typed:t,config:r,numeric:n}=e;return t(pa,{number:Yi,Complex:function(e){return e},BigNumber:function(e){return e},bigint:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0)),boolean:function(e){return n(e?1:0,r.number)},string:function(e){return n(e,Ie(e,r))}})}),ha=s(\"abs\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"abs\",{number:Hi,\"Complex | BigNumber | Fraction | Unit\":e=>e.abs(),bigint:e=>e<0n?-e:e,\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0))})}),da=\"mapSlices\",ga=s(da,[\"typed\",\"isInteger\"],e=>{let{typed:t,isInteger:i}=e;return t(da,{\"Array | Matrix, number | BigNumber, function\":function(e,t,r){if(!i(t))throw new TypeError(\"Integer number expected for dimension\");var n=Array.isArray(e)?T(e):e.size();if(t<0||t>=n.length)throw new En(t,n.length);return _(e)?e.create(ya(e.valueOf(),t,r),e.datatype()):ya(e,t,r)}})},{formerly:\"apply\"});function ya(e,t,r){let n,i,a;if(t<=0){if(Array.isArray(e[0])){for(a=function(e){const t=e.length,r=e[0].length;let n,i;const a=[];for(i=0;i{let i=e[\"typed\"];return i(xa,{\"number, number\":Gi,\"Complex, Complex\":function(e,t){return e.add(t)},\"BigNumber, BigNumber\":function(e,t){return e.plus(t)},\"bigint, bigint\":function(e,t){return e+t},\"Fraction, Fraction\":function(e,t){return e.add(t)},\"Unit, Unit\":i.referToSelf(n=>(e,t)=>{if(null===e.value||void 0===e.value)throw new Error(\"Parameter x contains a unit with undefined value\");if(null===t.value||void 0===t.value)throw new Error(\"Parameter y contains a unit with undefined value\");if(!e.equalBase(t))throw new Error(\"Units do not match\");const r=e.clone();return r.value=i.find(n,[r.valueType(),t.valueType()])(r.value,t.value),r.fixPrefix=!1,r})})}),va=\"subtractScalar\",wa=s(va,[\"typed\"],e=>{let i=e[\"typed\"];return i(va,{\"number, number\":Vi,\"Complex, Complex\":function(e,t){return e.sub(t)},\"BigNumber, BigNumber\":function(e,t){return e.minus(t)},\"bigint, bigint\":function(e,t){return e-t},\"Fraction, Fraction\":function(e,t){return e.sub(t)},\"Unit, Unit\":i.referToSelf(n=>(e,t)=>{if(null===e.value||void 0===e.value)throw new Error(\"Parameter x contains a unit with undefined value\");if(null===t.value||void 0===t.value)throw new Error(\"Parameter y contains a unit with undefined value\");if(!e.equalBase(t))throw new Error(\"Units do not match\");const r=e.clone();return r.value=i.find(n,[r.valueType(),t.valueType()])(r.value,t.value),r.fixPrefix=!1,r})})}),Na=s(\"cbrt\",[\"config\",\"typed\",\"isNegative\",\"unaryMinus\",\"matrix\",\"Complex\",\"BigNumber\",\"Fraction\"],e=>{let{config:a,typed:t,isNegative:i,unaryMinus:o,matrix:s,Complex:u,BigNumber:l,Fraction:c}=e;return t(\"cbrt\",{number:Ji,Complex:f,\"Complex, boolean\":f,BigNumber:function(e){return e.cbrt()},Unit:function(t){if(t.value&&te(t.value)){let e=t.clone();return e.value=1,(e=e.pow(1/3)).value=f(t.value),e}{var e,r=i(t.value);r&&(t.value=o(t.value)),e=Q(t.value)?new l(1).div(3):re(t.value)?new c(1,3):1/3;const n=t.pow(e);return r&&(n.value=o(n.value)),n}}});function f(e,t){var r=e.arg()/3,n=e.abs(),i=new u(Ji(n),0).mul(new u(0,r).exp());if(t){const e=[i,new u(Ji(n),0).mul(new u(0,r+2*Math.PI/3).exp()),new u(Ji(n),0).mul(new u(0,r-2*Math.PI/3).exp())];return\"Array\"===a.matrix?e:s(e)}return i}}),Aa=s(\"matAlgo11xS0s\",[\"typed\",\"equalScalar\"],e=>{let{typed:x,equalScalar:b}=e;return function(i,a,e,o){var s=i._values,u=i._index,l=i._ptr,t=i._size,r=i._datatype;if(!s)throw new Error(\"Cannot perform operation on Pattern Sparse Matrix and Scalar value\");var n=t[0],c=t[1];let f,p=b,m=0,h=e;\"string\"==typeof r&&(f=r,p=x.find(b,[f,f]),m=x.convert(0,f),a=x.convert(a,f),h=x.find(e,[f,f]));const d=[],g=[],y=[];for(let n=0;n{let{typed:d,DenseMatrix:g}=e;return function(i,t,e,r){var a=i._values,o=i._index,s=i._ptr,n=i._size,i=i._datatype;if(!a)throw new Error(\"Cannot perform operation on Pattern Sparse Matrix and Scalar value\");var u=n[0],l=n[1];let c,f=e;\"string\"==typeof i&&(c=i,t=d.convert(t,c),f=d.find(e,[c,c]));const p=[],m=[],h=[];for(let n=0;n{let l=e[\"typed\"];return function(e,t,r,n){var i=e._data,a=e._size,o=e._datatype;let s,u=r;\"string\"==typeof o&&(s=o,t=l.convert(t,s),u=l.find(r,[s,s]));o=0{let{typed:t,config:n,round:i}=e;function r(e){var t=Math.ceil(e),r=i(e);return t!==r&&Xe(e,r,n.relTol,n.absTol)&&!Xe(e,t,n.relTol,n.absTol)?r:t}return t(Sa,{number:r,\"number, number\":function(e,t){if(!v(t))throw new RangeError(\"number of decimals in function ceil must be an integer\");if(t<0||15{let{typed:t,config:i,round:a,matrix:n,equalScalar:o,zeros:s,DenseMatrix:r}=e;const u=Aa({typed:t,equalScalar:o}),l=x({typed:t,DenseMatrix:r}),c=Ea({typed:t}),f=Ca({typed:t,config:i,round:a});function p(e){const t=(e,t)=>li(e,t,i.relTol,i.absTol),r=e.ceil(),n=a(e);return!r.eq(n)&&t(e,n)&&!t(e,r)?n:r}return t(\"ceil\",{number:f.signatures.number,\"number,number\":f.signatures[\"number,number\"],Complex:function(e){return e.ceil()},\"Complex, number\":function(e,t){return e.ceil(t)},\"Complex, BigNumber\":function(e,t){return e.ceil(t.toNumber())},BigNumber:p,\"BigNumber, BigNumber\":function(e,t){t=Ma.pow(t);return p(e.mul(t)).div(t)},bigint:e=>e,\"bigint, number\":(e,t)=>e,\"bigint, BigNumber\":(e,t)=>e,Fraction:function(e){return e.ceil()},\"Fraction, number\":function(e,t){return e.ceil(t)},\"Fraction, BigNumber\":function(e,t){return e.ceil(t.toNumber())},\"Unit, number, Unit\":t.referToSelf(n=>function(e,t,r){e=e.toNumeric(r);return r.multiply(n(e,t))}),\"Unit, BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>n(e,t.toNumber(),r)),\"Array | Matrix, number | BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>le(e,e=>n(e,t,r),!0)),\"Array | Matrix | Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e,0,t)),\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0)),\"Array, number | BigNumber\":t.referToSelf(r=>(e,t)=>le(e,e=>r(e,t),!0)),\"SparseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>u(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>c(e,t,r,!1)),\"number | Complex | Fraction | BigNumber, Array\":t.referToSelf(r=>(e,t)=>c(n(t),e,r,!0).valueOf()),\"number | Complex | Fraction | BigNumber, Matrix\":t.referToSelf(r=>(e,t)=>o(e,0)?s(t.size(),t.storage()):(\"dense\"===t.storage()?c:l)(t,e,r,!0))})}),Ba=s(\"cube\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"cube\",{number:Xi,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},bigint:function(e){return e*e*e},Fraction:function(e){return e.pow(3)},Unit:function(e){return e.pow(3)}})}),Fa=s(\"exp\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"exp\",{number:Qi,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})}),Da=s(\"expm1\",[\"typed\",\"Complex\"],e=>{let{typed:t,Complex:r}=e;return t(\"expm1\",{number:Ki,Complex:function(e){var t=Math.exp(e.re);return new r(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})}),Oa=s(\"fix\",[\"typed\",\"ceil\",\"floor\"],e=>{let{typed:t,ceil:r,floor:n}=e;return t(\"fix\",{number:function(e){return(0{let{typed:t,Complex:r,matrix:n,ceil:i,floor:a,equalScalar:o,zeros:s,DenseMatrix:u}=e;const l=x({typed:t,DenseMatrix:u}),c=Ea({typed:t}),f=Oa({typed:t,ceil:i,floor:a});return t(\"fix\",{number:f.signatures.number,\"number, number | BigNumber\":f.signatures[\"number,number\"],Complex:function(e){return new r(0e,\"bigint, number\":(e,t)=>e,\"bigint, BigNumber\":(e,t)=>e,Fraction:function(e){return e.s<0n?e.ceil():e.floor()},\"Fraction, number | BigNumber\":function(e,t){return(e.s<0n?i:a)(e,t)},\"Unit, number, Unit\":t.referToSelf(n=>function(e,t,r){e=e.toNumeric(r);return r.multiply(n(e,t))}),\"Unit, BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>n(e,t.toNumber(),r)),\"Array | Matrix, number | BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>le(e,e=>n(e,t,r),!0)),\"Array | Matrix | Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e,0,t)),\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0)),\"Array | Matrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>le(e,e=>r(e,t),!0)),\"number | Complex | Fraction | BigNumber, Array\":t.referToSelf(r=>(e,t)=>c(n(t),e,r,!0).valueOf()),\"number | Complex | Fraction | BigNumber, Matrix\":t.referToSelf(r=>(e,t)=>o(e,0)?s(t.size(),t.storage()):(\"dense\"===t.storage()?c:l)(t,e,r,!0))})}),za=\"floor\",qa=new Vr(10),Ia=s(za,[\"typed\",\"config\",\"round\"],e=>{let{typed:t,config:n,round:i}=e;function r(e){var t=Math.floor(e),r=i(e);return t!==r&&Xe(e,r,n.relTol,n.absTol)&&!Xe(e,t,n.relTol,n.absTol)?r:t}return t(za,{number:r,\"number, number\":function(e,t){if(!v(t))throw new RangeError(\"number of decimals in function floor must be an integer\");if(t<0||15{let{typed:t,config:i,round:a,matrix:n,equalScalar:o,zeros:s,DenseMatrix:r}=e;const u=Aa({typed:t,equalScalar:o}),l=x({typed:t,DenseMatrix:r}),c=Ea({typed:t}),f=Ia({typed:t,config:i,round:a});function p(e){const t=(e,t)=>li(e,t,i.relTol,i.absTol),r=e.floor(),n=a(e);return!r.eq(n)&&t(e,n)&&!t(e,r)?n:r}return t(\"floor\",{number:f.signatures.number,\"number,number\":f.signatures[\"number,number\"],Complex:function(e){return e.floor()},\"Complex, number\":function(e,t){return e.floor(t)},\"Complex, BigNumber\":function(e,t){return e.floor(t.toNumber())},BigNumber:p,\"BigNumber, BigNumber\":function(e,t){t=qa.pow(t);return p(e.mul(t)).div(t)},bigint:e=>e,\"bigint, number\":(e,t)=>e,\"bigint, BigNumber\":(e,t)=>e,Fraction:function(e){return e.floor()},\"Fraction, number\":function(e,t){return e.floor(t)},\"Fraction, BigNumber\":function(e,t){return e.floor(t.toNumber())},\"Unit, number, Unit\":t.referToSelf(n=>function(e,t,r){e=e.toNumeric(r);return r.multiply(n(e,t))}),\"Unit, BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>n(e,t.toNumber(),r)),\"Array | Matrix, number | BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>le(e,e=>n(e,t,r),!0)),\"Array | Matrix | Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e,0,t)),\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0)),\"Array, number | BigNumber\":t.referToSelf(r=>(e,t)=>le(e,e=>r(e,t),!0)),\"SparseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>u(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>c(e,t,r,!1)),\"number | Complex | Fraction | BigNumber, Array\":t.referToSelf(r=>(e,t)=>c(n(t),e,r,!0).valueOf()),\"number | Complex | Fraction | BigNumber, Matrix\":t.referToSelf(r=>(e,t)=>o(e,0)?s(t.size(),t.storage()):(\"dense\"===t.storage()?c:l)(t,e,r,!0))})}),Ra=s(\"matAlgo02xDS0\",[\"typed\",\"equalScalar\"],e=>{let{typed:v,equalScalar:w}=e;return function(e,t,r,i){var a=e._data,n=e._size,o=e._datatype||e.getDataType(),s=t._values,u=t._index,l=t._ptr,c=t._size,f=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(n.length!==c.length)throw new z(n.length,c.length);if(n[0]!==c[0]||n[1]!==c[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+n+\") must match Matrix B (\"+c+\")\");if(!s)throw new Error(\"Cannot perform operation on Dense Matrix and Pattern Sparse Matrix\");var c=n[0],p=n[1];let m,h=w,d=0,g=r;\"string\"==typeof o&&o===f&&\"mixed\"!==o&&(m=o,h=v.find(w,[m,m]),d=v.convert(0,m),g=v.find(r,[m,m]));const y=[],x=[],b=[];for(let n=0;n{let v=e[\"typed\"];return function(e,i,t,a){var o=e._data,r=e._size,n=e._datatype||e.getDataType(),s=i._values,u=i._index,l=i._ptr,c=i._size,f=i._datatype||void 0===i._data?i._datatype:i.getDataType();if(r.length!==c.length)throw new z(r.length,c.length);if(r[0]!==c[0]||r[1]!==c[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+r+\") must match Matrix B (\"+c+\")\");if(!s)throw new Error(\"Cannot perform operation on Dense Matrix and Pattern Sparse Matrix\");var p=r[0],m=r[1];let h,d=0,g=t;\"string\"==typeof n&&n===f&&\"mixed\"!==n&&(h=n,d=v.convert(0,h),g=v.find(t,[h,h]));const y=[];for(let e=0;e{let{typed:B,equalScalar:F}=e;return function(e,t,r){var n=e._values,i=e._index,a=e._ptr,o=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=t._values,l=t._index,c=t._ptr,f=t._size,p=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(o.length!==f.length)throw new z(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+o+\") must match Matrix B (\"+f+\")\");var f=o[0],m=o[1];let h,d=F,g=0,y=r;\"string\"==typeof s&&s===p&&\"mixed\"!==s&&(h=s,d=B.find(F,[h,h]),g=B.convert(0,h),y=B.find(r,[h,h]));const x=n&&u?[]:void 0,b=[],v=[],w=x?[]:void 0,N=x?[]:void 0,A=[],E=[];let S,M,C,T;for(M=0;M{let p=e[\"typed\"];return function(e,t,r){const n=e._data,i=e._size,a=e._datatype,o=t._data,s=t._size,u=t._datatype,l=[];if(i.length!==s.length)throw new z(i.length,s.length);for(let e=0;e{var t=r;return De(e.size(),t)?e:e.create(Gn(e.valueOf(),t),e.datatype())})}const C=s(\"matrixAlgorithmSuite\",[\"typed\",\"matrix\"],e=>{let{typed:o,matrix:s}=e;const u=ja({typed:o}),l=Ea({typed:o});return function(n){const r=n.elop,i=n.SD||n.DS;let e;r?(e={\"DenseMatrix, DenseMatrix\":(e,t)=>u(...La(e,t),r),\"Array, Array\":(e,t)=>u(...La(s(e),s(t)),r).valueOf(),\"Array, DenseMatrix\":(e,t)=>u(...La(s(e),t),r),\"DenseMatrix, Array\":(e,t)=>u(...La(e,s(t)),r)},n.SS&&(e[\"SparseMatrix, SparseMatrix\"]=(e,t)=>n.SS(...La(e,t),r,!1)),n.DS&&(e[\"DenseMatrix, SparseMatrix\"]=(e,t)=>n.DS(...La(e,t),r,!1),e[\"Array, SparseMatrix\"]=(e,t)=>n.DS(...La(s(e),t),r,!1)),i&&(e[\"SparseMatrix, DenseMatrix\"]=(e,t)=>i(...La(t,e),r,!0),e[\"SparseMatrix, Array\"]=(e,t)=>i(...La(s(t),e),r,!0))):(e={\"DenseMatrix, DenseMatrix\":o.referToSelf(r=>(e,t)=>u(...La(e,t),r)),\"Array, Array\":o.referToSelf(r=>(e,t)=>u(...La(s(e),s(t)),r).valueOf()),\"Array, DenseMatrix\":o.referToSelf(r=>(e,t)=>u(...La(s(e),t),r)),\"DenseMatrix, Array\":o.referToSelf(r=>(e,t)=>u(...La(e,s(t)),r))},n.SS&&(e[\"SparseMatrix, SparseMatrix\"]=o.referToSelf(r=>(e,t)=>n.SS(...La(e,t),r,!1))),n.DS&&(e[\"DenseMatrix, SparseMatrix\"]=o.referToSelf(r=>(e,t)=>n.DS(...La(e,t),r,!1)),e[\"Array, SparseMatrix\"]=o.referToSelf(r=>(e,t)=>n.DS(...La(s(e),t),r,!1))),i&&(e[\"SparseMatrix, DenseMatrix\"]=o.referToSelf(r=>(e,t)=>i(...La(t,e),r,!0)),e[\"SparseMatrix, Array\"]=o.referToSelf(r=>(e,t)=>i(...La(s(t),e),r,!0))));var t=n.scalar||\"any\";(n.Ds||n.Ss)&&(r?(e[\"DenseMatrix,\"+t]=(e,t)=>l(e,t,r,!1),e[t+\", DenseMatrix\"]=(e,t)=>l(t,e,r,!0),e[\"Array,\"+t]=(e,t)=>l(s(e),t,r,!1).valueOf(),e[t+\", Array\"]=(e,t)=>l(s(t),e,r,!0).valueOf()):(e[\"DenseMatrix,\"+t]=o.referToSelf(r=>(e,t)=>l(e,t,r,!1)),e[t+\", DenseMatrix\"]=o.referToSelf(r=>(e,t)=>l(t,e,r,!0)),e[\"Array,\"+t]=o.referToSelf(r=>(e,t)=>l(s(e),t,r,!1).valueOf()),e[t+\", Array\"]=o.referToSelf(r=>(e,t)=>l(s(t),e,r,!0).valueOf())));const a=void 0!==n.sS?n.sS:n.Ss;return r?(n.Ss&&(e[\"SparseMatrix,\"+t]=(e,t)=>n.Ss(e,t,r,!1)),a&&(e[t+\", SparseMatrix\"]=(e,t)=>a(t,e,r,!0))):(n.Ss&&(e[\"SparseMatrix,\"+t]=o.referToSelf(r=>(e,t)=>n.Ss(e,t,r,!1))),a&&(e[t+\", SparseMatrix\"]=o.referToSelf(r=>(e,t)=>a(t,e,r,!0)))),r&&r.signatures&&Fe(e,r.signatures),e}}),$a=s(\"mod\",[\"typed\",\"config\",\"round\",\"matrix\",\"equalScalar\",\"zeros\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s,concat:u}=e;const l=ka({typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}),c=Ra({typed:t,equalScalar:a}),f=Pa({typed:t}),p=Ua({typed:t,equalScalar:a}),m=Aa({typed:t,equalScalar:a}),h=x({typed:t,DenseMatrix:s});return t(\"mod\",{\"number, number\":function(e,t){return 0===t?e:e-t*l(e/t)},\"BigNumber, BigNumber\":function(e,t){return t.isZero()?e:e.sub(t.mul(l(e.div(t))))},\"bigint, bigint\":function(e,t){return 0n===t?e:e<0?0n===(r=e%t)?r:r+t:e%t;var r},\"Fraction, Fraction\":function(e,t){return t.equals(0)?e:e.sub(t.mul(l(e.div(t))))}},C({typed:t,matrix:i,concat:u})({SS:p,DS:f,SD:c,Ss:m,sS:h}))}),Ha=s(\"matAlgo01xDSid\",[\"typed\"],e=>{let w=e[\"typed\"];return function(n,e,t,i){var a=n._data,r=n._size,o=n._datatype||n.getDataType(),s=e._values,u=e._index,l=e._ptr,c=e._size,f=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(r.length!==c.length)throw new z(r.length,c.length);if(r[0]!==c[0]||r[1]!==c[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+r+\") must match Matrix B (\"+c+\")\");if(!s)throw new Error(\"Cannot perform operation on Dense Matrix and Pattern Sparse Matrix\");const p=r[0],m=r[1],h=\"string\"==typeof o&&\"mixed\"!==o&&o===f?o:void 0,d=h?w.find(t,[h,h]):t;let g,y;const x=[];for(g=0;g{let{typed:F,equalScalar:D}=e;return function(e,t,r){var n=e._values,i=e._index,a=e._ptr,o=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=t._values,l=t._index,c=t._ptr,f=t._size,p=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(o.length!==f.length)throw new z(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+o+\") must match Matrix B (\"+f+\")\");var f=o[0],m=o[1];let h,d=D,g=0,y=r;\"string\"==typeof s&&s===p&&\"mixed\"!==s&&(h=s,d=F.find(D,[h,h]),g=F.convert(0,h),y=F.find(r,[h,h]));const x=n&&u?[]:void 0,b=[],v=[],w=n&&u?[]:void 0,N=n&&u?[]:void 0,A=[],E=[];let S,M,C,T,B;for(M=0;M{let{typed:d,DenseMatrix:g}=e;return function(i,t,e,r){var a=i._values,o=i._index,s=i._ptr,n=i._size,i=i._datatype;if(!a)throw new Error(\"Cannot perform operation on Pattern Sparse Matrix and Scalar value\");var u=n[0],l=n[1];let c,f=e;\"string\"==typeof i&&(c=i,t=d.convert(t,c),f=d.find(e,[c,c]));const p=[],m=[],h=[];for(let n=0;nArray.isArray(e))}const Ya=s(\"gcd\",[\"typed\",\"config\",\"round\",\"matrix\",\"equalScalar\",\"zeros\",\"BigNumber\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,config:n,round:i,equalScalar:a,zeros:o,BigNumber:s,DenseMatrix:u,concat:l}=e;const c=$a({typed:t,config:n,round:i,matrix:r,equalScalar:a,zeros:o,DenseMatrix:u,concat:l}),f=Ha({typed:t}),p=Ga({typed:t,equalScalar:a}),m=Va({typed:t,DenseMatrix:u});return t(\"gcd\",{\"number, number\":function(e,t){if(!v(e)||!v(t))throw new Error(\"Parameters in function gcd must be integer numbers\");for(var r;0!==t;)r=c(e,t),e=t,t=r;return e<0?-e:e},\"BigNumber, BigNumber\":function(e,t){if(!e.isInt()||!t.isInt())throw new Error(\"Parameters in function gcd must be integer numbers\");const r=new s(0);for(;!t.isZero();){const r=c(e,t);e=t,t=r}return e.lt(r)?e.neg():e},\"Fraction, Fraction\":(e,t)=>e.gcd(t)},C({typed:t,matrix:r,concat:l})({SS:p,DS:f,Ss:m}),{\"number | BigNumber | Fraction | Matrix | Array, number | BigNumber | Fraction | Matrix | Array, ...number | BigNumber | Fraction | Matrix | Array\":t.referToSelf(i=>(e,t,r)=>{let n=i(e,t);for(let e=0;ee=>{if(1===e.length&&Array.isArray(e[0])&&Wa(e[0]))return t(...e[0]);if(Wa(e))return t(...e);throw new Za(\"gcd() supports only 1d matrices!\")}),Matrix:t.referToSelf(t=>e=>t(e.toArray()))})}),Ja=s(\"matAlgo06xS0S0\",[\"typed\",\"equalScalar\"],e=>{let{typed:v,equalScalar:w}=e;return function(e,r,t){var n=e._values,i=e._size,a=e._datatype||void 0===e._data?e._datatype:e.getDataType(),o=r._values,s=r._size,u=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(i.length!==s.length)throw new z(i.length,s.length);if(i[0]!==s[0]||i[1]!==s[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+i+\") must match Matrix B (\"+s+\")\");var s=i[0],l=i[1];let c,f=w,p=0,m=t;\"string\"==typeof a&&a===u&&\"mixed\"!==a&&(c=a,f=v.find(w,[c,c]),p=v.convert(0,c),m=v.find(t,[c,c]));const h=n&&o?[]:void 0,d=[],g=[],y=h?[]:void 0,x=[],b=[];for(let t=0;t{let{typed:t,matrix:r,equalScalar:n,concat:i}=e;const a=Ra({typed:t,equalScalar:n}),o=Ja({typed:t,equalScalar:n}),s=Aa({typed:t,equalScalar:n}),u=C({typed:t,matrix:r,concat:i}),l=\"number | BigNumber | Fraction | Matrix | Array\",c={};return c[l+`, ${l}, ...`+l]=t.referToSelf(i=>(e,t,r)=>{let n=i(e,t);for(let e=0;ee.lcm(t)},u({SS:o,DS:a,Ss:s}),c)});function Qa(t,r,n,i){return function(e){if(0{let{typed:t,config:r,Complex:n}=e;function i(e){return e.log().div(Math.LN10)}function a(e){return i(new n(e,0))}return t(\"log10\",{number:function(e){return(0<=e||r.predictable?ra:a)(e)},bigint:Qa(Ka,ra,r,a),Complex:i,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():a(e.toNumber())},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),to=s(\"log2\",[\"typed\",\"config\",\"Complex\"],e=>{let{typed:t,config:r,Complex:n}=e;function i(e){return a(new n(e,0))}return t(\"log2\",{number:function(e){return(0<=e||r.predictable?na:i)(e)},bigint:Qa(4,na,r,i),Complex:a,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log(2):i(e.toNumber())},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))});function a(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}}),ro=s(\"multiplyScalar\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"multiplyScalar\",{\"number, number\":Zi,\"Complex, Complex\":function(e,t){return e.mul(t)},\"BigNumber, BigNumber\":function(e,t){return e.times(t)},\"bigint, bigint\":function(e,t){return e*t},\"Fraction, Fraction\":function(e,t){return e.mul(t)},\"number | Fraction | BigNumber | Complex, Unit\":(e,t)=>t.multiply(e),\"Unit, number | Fraction | BigNumber | Complex | Unit\":(e,t)=>e.multiply(t)})}),no=\"multiply\",io=s(no,[\"typed\",\"matrix\",\"addScalar\",\"multiplyScalar\",\"equalScalar\",\"dot\"],e=>{let{typed:F,matrix:i,addScalar:D,multiplyScalar:O,equalScalar:N,dot:a}=e;const r=Aa({typed:F,equalScalar:N}),n=Ea({typed:F});function o(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError(\"Dimension mismatch in multiplication. Vectors must have the same length\");break;case 2:if(e[0]!==t[0])throw new RangeError(\"Dimension mismatch in multiplication. Vector length (\"+e[0]+\") must match Matrix rows (\"+t[0]+\")\");break;default:throw new Error(\"Can only multiply a 1 or 2 dimensional matrix (Matrix B has \"+t.length+\" dimensions)\")}break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw new RangeError(\"Dimension mismatch in multiplication. Matrix columns (\"+e[1]+\") must match Vector length (\"+t[0]+\")\");break;case 2:if(e[1]!==t[0])throw new RangeError(\"Dimension mismatch in multiplication. Matrix A columns (\"+e[1]+\") must match Matrix B rows (\"+t[0]+\")\");break;default:throw new Error(\"Can only multiply a 1 or 2 dimensional matrix (Matrix B has \"+t.length+\" dimensions)\")}break;default:throw new Error(\"Can only multiply a 1 or 2 dimensional matrix (Matrix A has \"+e.length+\" dimensions)\")}}const s=F(\"_multiplyMatrixVector\",{\"DenseMatrix, any\":function(e,t){var r=e._data,n=e._size,i=e._datatype||e.getDataType(),a=t._data,o=t._datatype||t.getDataType(),s=n[0],u=n[1];let l,c=D,f=O;i&&o&&i===o&&\"string\"==typeof i&&\"mixed\"!==i&&(l=i,c=F.find(D,[l,l]),f=F.find(O,[l,l]));const p=[];for(let e=0;eF){let n=0;for(let r=0;r(e,t)=>{o(T(e),T(t));const r=n(i(e),i(t));return _(r)?r.valueOf():r}),\"Matrix, Matrix\":function(e,t){var r=e.size(),n=t.size();return o(r,n),(1===r.length?1===n.length?function(e,t){if(0===r[0])throw new Error(\"Cannot multiply two empty vectors\");return a(e,t)}:function(t,r){if(\"dense\"!==r.storage())throw new Error(\"Support for SparseMatrix not implemented\");{var a=t._data,o=t._size,s=t._datatype||t.getDataType(),u=r._data,l=r._size,c=r._datatype||r.getDataType(),f=o[0],p=l[1];let e,n=D,i=O;s&&c&&s===c&&\"string\"==typeof s&&\"mixed\"!==s&&(e=s,n=F.find(D,[e,e]),i=F.find(O,[e,e]));const m=[];for(let r=0;r(e,t)=>r(e,i(t))),\"Array, Matrix\":F.referToSelf(r=>(e,t)=>r(i(e,t.storage()),t)),\"SparseMatrix, any\":function(e,t){return r(e,t,O,!1)},\"DenseMatrix, any\":function(e,t){return n(e,t,O,!1)},\"any, SparseMatrix\":function(e,t){return r(t,e,O,!0)},\"any, DenseMatrix\":function(e,t){return n(t,e,O,!0)},\"Array, any\":function(e,t){return n(i(e),t,O,!1).valueOf()},\"any, Array\":function(e,t){return n(i(t),e,O,!0).valueOf()},\"any, any\":O,\"any, any, ...any\":F.referToSelf(i=>(e,t,r)=>{let n=i(e,t);for(let e=0;e{let{typed:t,matrix:n,equalScalar:r,BigNumber:u,concat:i}=e;const a=Ha({typed:t}),o=Ra({typed:t,equalScalar:r}),s=Ja({typed:t,equalScalar:r}),l=Aa({typed:t,equalScalar:r}),c=C({typed:t,matrix:n,concat:i});function f(){throw new Error(\"Complex number not supported in function nthRoot. Use nthRoots instead.\")}return t(ao,{number:ia,\"number, number\":ia,BigNumber:e=>p(e,new u(2)),\"BigNumber, BigNumber\":p,Complex:f,\"Complex, number\":f,Array:t.referTo(\"DenseMatrix,number\",t=>e=>t(n(e),2).valueOf()),DenseMatrix:t.referTo(\"DenseMatrix,number\",t=>e=>t(e,2)),SparseMatrix:t.referTo(\"SparseMatrix,number\",t=>e=>t(e,2)),\"SparseMatrix, SparseMatrix\":t.referToSelf(r=>(e,t)=>{if(1===t.density())return s(e,t,r);throw new Error(\"Root must be non-zero\")}),\"DenseMatrix, SparseMatrix\":t.referToSelf(r=>(e,t)=>{if(1===t.density())return a(e,t,r,!1);throw new Error(\"Root must be non-zero\")}),\"Array, SparseMatrix\":t.referTo(\"DenseMatrix,SparseMatrix\",r=>(e,t)=>r(n(e),t)),\"number | BigNumber, SparseMatrix\":t.referToSelf(r=>(e,t)=>{if(1===t.density())return l(t,e,r,!0);throw new Error(\"Root must be non-zero\")})},c({scalar:\"number | BigNumber\",SD:o,Ss:l,sS:!1}));function p(e,t){const r=u.precision,n=u.clone({precision:r+2}),i=new u(0),a=new n(1),o=t.isNegative();if((t=o?t.neg():t).isZero())throw new Error(\"Root must be non-zero\");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error(\"Root must be odd when a is negative.\");if(e.isZero())return o?new n(1/0):0;if(!e.isFinite())return o?i:e;let s=e.abs().pow(a.div(t));return s=e.isNeg()?s.neg():s,new u((o?a.div(s):s).toPrecision(r))}}),so=s(\"sign\",[\"typed\",\"BigNumber\",\"Fraction\",\"complex\"],e=>{let{typed:r,BigNumber:t,complex:n,Fraction:i}=e;return r(\"sign\",{number:aa,Complex:function(e){return 0===e.im?n(aa(e.re)):e.sign()},BigNumber:function(e){return new t(e.cmp(0))},bigint:function(e){return 0ne=>le(e,t,!0)),Unit:r.referToSelf(t=>e=>{if(e._isDerived()||0===e.units[0].unit.offset)return r.find(t,e.valueType())(e.value);throw new TypeError(\"sign is ambiguous for units with offset\")})})}),uo=s(\"sqrt\",[\"config\",\"typed\",\"Complex\"],e=>{let{config:t,typed:r,Complex:n}=e;return r(\"sqrt\",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:0<=e||t.predictable?Math.sqrt(e):new n(e,0).sqrt()}}),lo=s(\"square\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"square\",{number:oa,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},bigint:function(e){return e*e},Fraction:function(e){return e.mul(e)},Unit:function(e){return e.pow(2)}})}),co=\"subtract\",fo=s(co,[\"typed\",\"matrix\",\"equalScalar\",\"subtractScalar\",\"unaryMinus\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,subtractScalar:i,DenseMatrix:a,concat:o}=e;const s=Ha({typed:t}),u=Pa({typed:t}),l=Ua({typed:t,equalScalar:n}),c=Va({typed:t,DenseMatrix:a}),f=x({typed:t,DenseMatrix:a}),p=C({typed:t,matrix:r,concat:o});return t(co,{\"any, any\":i},p({elop:i,SS:l,DS:s,SD:u,Ss:f,sS:c}))}),po=s(\"xgcd\",[\"typed\",\"config\",\"matrix\",\"BigNumber\"],e=>{let{typed:t,config:p,matrix:m,BigNumber:h}=e;return t(\"xgcd\",{\"number, number\":function(e,t){e=sa(e,t);return\"Array\"===p.matrix?e:m(e)},\"BigNumber, BigNumber\":function(e,t){let r,n,i;var a=new h(0),o=new h(1);let s,u=a,l=o,c=o,f=a;if(!e.isInt()||!t.isInt())throw new Error(\"Parameters in function xgcd must be integer numbers\");for(;!t.isZero();)n=e.div(t).floor(),i=e.mod(t),r=u,u=l.minus(n.times(u)),l=r,r=c,c=f.minus(n.times(c)),f=r,e=t,t=i;return s=e.lt(a)?[e.neg(),l.neg(),f.neg()]:[e,e.isZero()?0:l,f],\"Array\"===p.matrix?s:m(s)}})}),mo=s(\"invmod\",[\"typed\",\"config\",\"BigNumber\",\"xgcd\",\"equal\",\"smaller\",\"mod\",\"add\",\"isInteger\"],e=>{let{typed:t,BigNumber:a,xgcd:o,equal:s,smaller:u,mod:l,add:c,isInteger:f}=e;return t(\"invmod\",{\"number, number\":r,\"BigNumber, BigNumber\":r});function r(e,t){if(!f(e)||!f(t))throw new Error(\"Parameters in function invmod must be integer numbers\");if(e=l(e,t),s(t,0))throw new Error(\"Divisor must be non zero\");let r=o(e,t),[n,i]=r=r.valueOf();return s(n,a(1))?(i=l(i,t),i=u(i,a(0))?c(i,t):i):NaN}}),ho=s(\"matAlgo09xS0Sf\",[\"typed\",\"equalScalar\"],e=>{let{typed:T,equalScalar:B}=e;return function(e,t,r){var n=e._values,i=e._index,a=e._ptr,o=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=t._values,l=t._index,c=t._ptr,f=t._size,p=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(o.length!==f.length)throw new z(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+o+\") must match Matrix B (\"+f+\")\");var f=o[0],m=o[1];let h,d=B,g=0,y=r;\"string\"==typeof s&&s===p&&\"mixed\"!==s&&(h=s,d=T.find(B,[h,h]),g=T.convert(0,h),y=T.find(r,[h,h]));const x=n&&u?[]:void 0,b=[],v=[],w=x?[]:void 0,N=[];let A,E,S,M,C;for(E=0;E{let{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:a}=e;const o=Ra({typed:t,equalScalar:n}),s=ho({typed:t,equalScalar:n}),u=Aa({typed:t,equalScalar:n}),l=C({typed:t,matrix:r,concat:a});return t(go,l({elop:i,SS:s,DS:o,Ss:u}))});function xo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error(\"Integers expected in function bitAnd\");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return wo(e,t,function(e,t){return e&t})}function bo(e){if(e.isFinite()&&!e.isInteger())throw new Error(\"Integer expected in function bitNot\");const t=e.constructor,r=t.precision,n=(t.config({precision:1e9}),e.plus(new t(1)));return n.s=-n.s||null,t.config({precision:r}),n}function vo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error(\"Integers expected in function bitOr\");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:e.isFinite()&&t.isFinite()?wo(e,t,function(e,t){return e|t}):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function wo(e,t,r){const n=e.constructor;let i,a;var o=+(e.s<0),s=+(t.s<0);if(o){i=No(bo(e));for(let e=0;ee)for(i-=e;i--;)a+=\"0\";else i>1,o[e]&=1)}return o.reverse()}function Ao(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error(\"Integers expected in function bitXor\");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?bo(t):t.eq(n)?bo(e):e.isFinite()&&t.isFinite()?wo(e,t,function(e,t){return e^t}):e.isFinite()||t.isFinite()?new r(e.isNegative()===t.isNegative()?1/0:-1/0):n}function Eo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error(\"Integers expected in function leftShift\");const r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+\"\"):e.times(new r(2).pow(t)):new r(NaN)}function So(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error(\"Integers expected in function rightArithShift\");const r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?(t.lt(55)?e.div(Math.pow(2,t.toNumber())+\"\"):e.div(new r(2).pow(t))).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var Mo=\"number, number\";function Co(e,t){if(v(e)&&v(t))return e&t;throw new Error(\"Integers expected in function bitAnd\")}function To(e){if(v(e))return~e;throw new Error(\"Integer expected in function bitNot\")}function Bo(e,t){if(v(e)&&v(t))return e|t;throw new Error(\"Integers expected in function bitOr\")}function Fo(e,t){if(v(e)&&v(t))return e^t;throw new Error(\"Integers expected in function bitXor\")}function Do(e,t){if(v(e)&&v(t))return e<>t;throw new Error(\"Integers expected in function rightArithShift\")}function _o(e,t){if(v(e)&&v(t))return e>>>t;throw new Error(\"Integers expected in function rightLogShift\")}Co.signature=Mo,To.signature=\"number\",_o.signature=Oo.signature=Do.signature=Fo.signature=Bo.signature=Mo;const zo=s(\"bitAnd\",[\"typed\",\"matrix\",\"equalScalar\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,concat:i}=e;const a=Ra({typed:t,equalScalar:n}),o=Ja({typed:t,equalScalar:n}),s=Aa({typed:t,equalScalar:n}),u=C({typed:t,matrix:r,concat:i});return t(\"bitAnd\",{\"number, number\":Co,\"BigNumber, BigNumber\":xo,\"bigint, bigint\":(e,t)=>e&t},u({SS:o,DS:a,Ss:s}))}),qo=s(\"bitNot\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"bitNot\",{number:To,BigNumber:bo,bigint:e=>~e,\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Io=s(\"bitOr\",[\"typed\",\"matrix\",\"equalScalar\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e;const o=Ha({typed:t}),s=Ga({typed:t,equalScalar:n}),u=Va({typed:t,DenseMatrix:i}),l=C({typed:t,matrix:r,concat:a});return t(\"bitOr\",{\"number, number\":Bo,\"BigNumber, BigNumber\":vo,\"bigint, bigint\":(e,t)=>e|t},l({SS:s,DS:o,Ss:u}))}),ko=s(\"matAlgo07xSSf\",[\"typed\",\"SparseMatrix\"],e=>{let{typed:b,SparseMatrix:v}=e;return function(r,n,e){var t=r._size,i=r._datatype||void 0===r._data?r._datatype:r.getDataType(),a=n._size,o=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(t.length!==a.length)throw new z(t.length,a.length);if(t[0]!==a[0]||t[1]!==a[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+t+\") must match Matrix B (\"+a+\")\");var s=t[0],u=t[1];let l,c=0,f=e;\"string\"==typeof i&&i===o&&\"mixed\"!==i&&(l=i,c=b.convert(0,l),f=b.find(e,[l,l]));const p=[],m=[],h=new Array(u+1).fill(0),d=[],g=[],y=[],x=[];for(let e=0;e{let{typed:t,matrix:r,DenseMatrix:n,concat:i,SparseMatrix:a}=e;const o=Pa({typed:t}),s=ko({typed:t,SparseMatrix:a}),u=x({typed:t,DenseMatrix:n}),l=C({typed:t,matrix:r,concat:i});return t(\"bitXor\",{\"number, number\":Fo,\"BigNumber, BigNumber\":Ao,\"bigint, bigint\":(e,t)=>e^t},l({SS:s,DS:o,Ss:u}))}),Po=s(\"arg\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"arg\",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Uo=s(\"conj\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"conj\",{\"number | BigNumber | Fraction\":e=>e,Complex:e=>e.conjugate(),Unit:t.referToSelf(t=>e=>new e.constructor(t(e.toNumeric()),e.formatUnits())),\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),jo=s(\"im\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"im\",{number:()=>0,\"BigNumber | Fraction\":e=>e.mul(0),Complex:e=>e.im,\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Lo=s(\"re\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"re\",{\"number | BigNumber | Fraction\":e=>e,Complex:e=>e.re,\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),$o=\"number, number\";function Ho(e){return!e}function Go(e,t){return!(!e&&!t)}function Vo(e,t){return!!e!=!!t}function Zo(e,t){return!(!e||!t)}Ho.signature=\"number\",Zo.signature=Vo.signature=Go.signature=$o;const Wo=s(\"not\",[\"typed\"],e=>{let r=e[\"typed\"];return r(\"not\",{\"null | undefined\":()=>!0,number:Ho,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},bigint:e=>!e,Unit:r.referToSelf(t=>e=>r.find(t,e.valueType())(e.value)),\"Array | Matrix\":r.referToSelf(t=>e=>le(e,t))})}),Yo=\"nullish\",Jo=s(Yo,[\"typed\",\"matrix\",\"size\",\"flatten\",\"deepEqual\"],e=>{let{typed:t,matrix:n,size:i,flatten:a,deepEqual:o}=e;const s=Pa({typed:t}),u=Ea({typed:t}),l=ja({typed:t});return t(Yo,{\"number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any\":(e,t)=>e,\"null, any\":(e,t)=>t,\"undefined, any\":(e,t)=>t,\"SparseMatrix, Array | Matrix\":(e,t)=>{var r=a(i(e).valueOf()),t=a(i(t).valueOf());if(o(r,t))return e;throw new z(r,t)},\"DenseMatrix, DenseMatrix\":t.referToSelf(r=>(e,t)=>l(e,t,r)),\"DenseMatrix, SparseMatrix\":t.referToSelf(r=>(e,t)=>s(e,t,r,!1)),\"DenseMatrix, Array\":t.referToSelf(r=>(e,t)=>l(e,n(t),r)),\"DenseMatrix, any\":t.referToSelf(r=>(e,t)=>u(e,t,r,!1)),\"Array, Array\":t.referToSelf(r=>(e,t)=>l(n(e),n(t),r).valueOf()),\"Array, DenseMatrix\":t.referToSelf(r=>(e,t)=>l(n(e),t,r)),\"Array, SparseMatrix\":t.referToSelf(r=>(e,t)=>s(n(e),t,r,!1)),\"Array, any\":t.referToSelf(r=>(e,t)=>u(n(e),t,r,!1).valueOf())})}),Xo=s(\"or\",[\"typed\",\"matrix\",\"equalScalar\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e;const o=Pa({typed:t}),s=Ua({typed:t,equalScalar:n}),u=x({typed:t,DenseMatrix:i}),l=C({typed:t,matrix:r,concat:a});return t(\"or\",{\"number, number\":Go,\"Complex, Complex\":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},\"BigNumber, BigNumber\":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},\"bigint, bigint\":Go,\"Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e.value||0,t.value||0))},l({SS:s,DS:o,Ss:u}))}),Qo=s(\"xor\",[\"typed\",\"matrix\",\"DenseMatrix\",\"concat\",\"SparseMatrix\"],e=>{let{typed:t,matrix:r,DenseMatrix:n,concat:i,SparseMatrix:a}=e;const o=Pa({typed:t}),s=ko({typed:t,SparseMatrix:a}),u=x({typed:t,DenseMatrix:n}),l=C({typed:t,matrix:r,concat:i});return t(\"xor\",{\"number, number\":Vo,\"Complex, Complex\":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},\"bigint, bigint\":Vo,\"BigNumber, BigNumber\":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},\"Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e.value||0,t.value||0))},l({SS:s,DS:o,Ss:u}))}),Ko=s(\"concat\",[\"typed\",\"matrix\",\"isInteger\"],e=>{let{typed:t,matrix:u,isInteger:l}=e;return t(\"concat\",{\"...Array | Matrix | number | BigNumber\":function(e){let t;var r=e.length;let n,i=-1,a=!1;const o=[];for(t=0;tn)throw new En(i,n+1)}else{const e=ee(u).valueOf(),l=T(e);if(o[t]=e,n=i,i=l.length-1,0{let{typed:t,Index:n,matrix:i,range:a}=e;return t(\"column\",{\"Matrix, number\":r,\"Array, number\":function(e,t){return r(i(ee(e)),t).valueOf()}});function r(e,t){if(2!==e.size().length)throw new Error(\"Only two dimensional matrix is supported\");M(t,e.size()[1]);var r=a(0,e.size()[0]),r=new n(r,t),t=e.subset(r);return _(t)?t:i([[t]])}}),ts=s(\"count\",[\"typed\",\"size\",\"prod\"],e=>{let{typed:t,size:r,prod:n}=e;return t(\"count\",{string:function(e){return e.length},\"Matrix | Array\":function(e){return n(r(e))}})}),rs=s(\"cross\",[\"typed\",\"matrix\",\"subtract\",\"multiply\"],e=>{let{typed:t,matrix:r,subtract:a,multiply:o}=e;return t(\"cross\",{\"Matrix, Matrix\":function(e,t){return r(n(e.toArray(),t.toArray()))},\"Matrix, Array\":function(e,t){return r(n(e.toArray(),t))},\"Array, Matrix\":function(e,t){return r(n(e,t.toArray()))},\"Array, Array\":n});function n(e,t){var r=Math.max(T(e).length,T(t).length);e=On(e),t=On(t);const n=T(e),i=T(t);if(1!==n.length||1!==i.length||3!==n[0]||3!==i[0])throw new RangeError(\"Vectors with length 3 expected (Size A = [\"+n.join(\", \")+\"], B = [\"+i.join(\", \")+\"])\");e=[a(o(e[1],t[2]),o(e[2],t[1])),a(o(e[2],t[0]),o(e[0],t[2])),a(o(e[0],t[1]),o(e[1],t[0]))];return 1{let{typed:t,matrix:y,DenseMatrix:x,SparseMatrix:b}=e;return t(\"diag\",{Array:function(e){return n(e,0,T(e),null)},\"Array, number\":function(e,t){return n(e,t,T(e),null)},\"Array, BigNumber\":function(e,t){return n(e,t.toNumber(),T(e),null)},\"Array, string\":function(e,t){return n(e,0,T(e),t)},\"Array, number, string\":function(e,t,r){return n(e,t,T(e),r)},\"Array, BigNumber, string\":function(e,t,r){return n(e,t.toNumber(),T(e),r)},Matrix:function(e){return n(e,0,e.size(),e.storage())},\"Matrix, number\":function(e,t){return n(e,t,e.size(),e.storage())},\"Matrix, BigNumber\":function(e,t){return n(e,t.toNumber(),e.size(),e.storage())},\"Matrix, string\":function(e,t){return n(e,0,e.size(),t)},\"Matrix, number, string\":function(e,t,r){return n(e,t,e.size(),r)},\"Matrix, BigNumber, string\":function(e,t,r){return n(e,t.toNumber(),e.size(),r)}});function n(e,t,r,n){if(!v(t))throw new TypeError(\"Second parameter in function diag must be an integer\");var i=0{let t=e[\"typed\"];return t(\"filter\",{\"Array, function\":as,\"Matrix, function\":function(e,t){return e.create(as(e.valueOf(),t),e.datatype())},\"Array, RegExp\":kn,\"Matrix, RegExp\":function(e,t){return e.create(kn(e.valueOf(),t),e.datatype())}})});function as(e,t){const n=Yn(t,e,\"filter\");return n.isUnary?In(e,n.fn):In(e,function(e,t,r){return n.fn(e,[t],r)})}const os=\"flatten\",ss=s(os,[\"typed\"],e=>{let t=e[\"typed\"];return t(os,{Array:function(e){return E(e)},Matrix:function(e){return e.create(E(e.valueOf(),!0),e.datatype())}})}),us=\"forEach\",ls=s(us,[\"typed\"],e=>{let t=e[\"typed\"];return t(us,{\"Array, function\":cs,\"Matrix, function\":function(e,t){e.forEach(t)}})});function cs(e,t){t=Yn(t,e,us);Wn(e,t.fn,t.isUnary)}const fs=\"getMatrixDataType\",ps=s(fs,[\"typed\"],e=>{let t=e[\"typed\"];return t(fs,{Array:function(e){return jn(e,K)},Matrix:function(e){return e.getDataType()}})}),ms=\"identity\",hs=s(ms,[\"typed\",\"config\",\"matrix\",\"BigNumber\",\"DenseMatrix\",\"SparseMatrix\"],e=>{let{typed:t,config:r,matrix:n,BigNumber:l,DenseMatrix:c,SparseMatrix:f}=e;return t(ms,{\"\":function(){return\"Matrix\"===r.matrix?n([]):[]},string:function(e){return n(e)},\"number | BigNumber\":function(e){return a(e,e,\"Matrix\"===r.matrix?\"dense\":void 0)},\"number | BigNumber, string\":function(e,t){return a(e,e,t)},\"number | BigNumber, number | BigNumber\":function(e,t){return a(e,t,\"Matrix\"===r.matrix?\"dense\":void 0)},\"number | BigNumber, number | BigNumber, string\":a,Array:function(e){return i(e)},\"Array, string\":i,Matrix:function(e){return i(e.valueOf(),e.storage())},\"Matrix, string\":function(e,t){return i(e.valueOf(),t)}});function i(e,t){switch(e.length){case 0:return t?n(t):[];case 1:return a(e[0],e[0],t);case 2:return a(e[0],e[1],t);default:throw new Error(\"Vector containing two values expected\")}}function a(e,t,r){const n=Q(e)||Q(t)?l:null;if(Q(e)&&(e=e.toNumber()),Q(t)&&(t=t.toNumber()),!v(e)||e<1)throw new Error(\"Parameters in function identity must be positive integers\");if(!v(t)||t<1)throw new Error(\"Parameters in function identity must be positive integers\");var i=n?new l(1):1,a=n?new n(0):0,o=[e,t];if(r){if(\"sparse\"===r)return f.diagonal(o,i,0,a);if(\"dense\"===r)return c.diagonal(o,i,0,a);throw new TypeError(`Unknown matrix type \"${r}\"`)}const s=Tn([],o,a),u=e{let{typed:t,matrix:r,multiplyScalar:a}=e;return t(\"kron\",{\"Matrix, Matrix\":function(e,t){return r(n(e.toArray(),t.toArray()))},\"Matrix, Array\":function(e,t){return r(n(e.toArray(),t))},\"Array, Matrix\":function(e,t){return r(n(e,t.toArray()))},\"Array, Array\":n});function n(e,r){if(1===T(e).length&&(e=[e]),1===T(r).length&&(r=[r]),2{let h=e[\"typed\"];return h(\"map\",{\"Array, function\":d,\"Matrix, function\":function(e,t){return e.map(t)},\"Array|Matrix, Array|Matrix, ...Array|Matrix|function\":(e,t,n)=>{{var i=[e,t,...n.slice(0,n.length-1)],a=n[n.length-1];if(\"function\"!=typeof a)throw new Error(\"Last argument must be a callback function\");const c=i[0].isMatrix,f=$n(...i.map(e=>e.isMatrix?e.size():T(e))),p=c?(e,t)=>e.get(t):Vn,m=c?i.map(e=>e.isMatrix?e.create(Gn(e.toArray(),f),e.datatype()):i[0].create(Gn(e.valueOf(),f))):i.map(e=>e.isMatrix?Gn(e.toArray(),f):Gn(e,f));let r;if(h.isTypedFunction(a)){const i=f.map(()=>0),d=m.map(e=>p(e,i)),c=(u=a,e=d,o=i,s=m,null!==h.resolve(u,[...e,o,...s])?2:null!==h.resolve(u,[...e,o])?1:(h.resolve(u,e),0));r=l(c)}else{const h=i.length,d=(s=h,(o=a).length>s+1?2:o.length===s+1?1:0);r=l(d)}var o,s,u=(e,t)=>r([e,...m.slice(1).map(e=>p(e,t))],t);return c?m[0].map(u):d(m[0],u);function l(e){switch(e){case 0:return e=>a(...e);case 1:return(e,t)=>a(...e,t);case 2:return(e,t)=>a(...e,t,...m)}}}}});function d(e,t){t=Yn(t,e,\"map\");return Zn(e,t.fn,t.isUnary)}}),ys=s(\"diff\",[\"typed\",\"matrix\",\"subtract\",\"number\"],e=>{let{typed:t,matrix:r,subtract:i,number:n}=e;return t(\"diff\",{\"Array | Matrix\":function(e){return _(e)?r(o(e.toArray())):o(e)},\"Array | Matrix, number\":function(e,t){if(v(t))return _(e)?r(a(e.toArray(),t)):a(e,t);throw new RangeError(\"Dimension must be a whole number\")},\"Array, BigNumber\":t.referTo(\"Array,number\",r=>(e,t)=>r(e,n(t))),\"Matrix, BigNumber\":t.referTo(\"Matrix,number\",r=>(e,t)=>r(e,n(t)))});function a(e,t){if(_(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError(\"Array/Matrix does not have that many dimensions\");if(0{r.push(a(e,t-1))}),r}if(0===t)return o(e);throw RangeError(\"Cannot have negative dimension\")}function o(t){const r=[],n=t.length;for(let e=1;e{let{typed:t,config:r,matrix:i,BigNumber:a}=e;return t(\"ones\",{\"\":function(){return\"Array\"===r.matrix?n([]):n([],\"default\")},\"...number | BigNumber | string\":function(e){var t;return\"string\"==typeof e[e.length-1]?(t=e.pop(),n(e,t)):\"Array\"===r.matrix?n(e):n(e,\"default\")},Array:n,Matrix:function(e){var t=e.storage();return n(e.valueOf(),t)},\"Array | Matrix, string\":function(e,t){return n(e.valueOf(),t)}});function n(e,t){const r=function(){let n=!1;return e.forEach(function(e,t,r){Q(e)&&(n=!0,r[t]=e.toNumber())}),n}(),n=r?new a(1):1;if(e.forEach(function(e){if(\"number\"!=typeof e||!v(e)||e<0)throw new Error(\"Parameters in function ones must be positive integers\")}),t){const r=i(t);return 0{let{typed:t,config:n,matrix:r,bignumber:i,smaller:s,smallerEq:u,larger:l,largerEq:c,add:f,isPositive:p}=e;return t(\"range\",{string:o,\"string, boolean\":o,number:function(e){throw new TypeError(\"Too few arguments to function range(): \"+e)},boolean:function(e){throw new TypeError(`Unexpected type of argument 1 to function range(): ${e}, number|bigint|BigNumber|Fraction`)},\"number, number\":function(e,t){return a(m(e,t,1,!1))},\"number, number, number\":function(e,t,r){return a(m(e,t,r,!1))},\"number, number, boolean\":function(e,t,r){return a(m(e,t,1,r))},\"number, number, number, boolean\":function(e,t,r,n){return a(m(e,t,r,n))},\"bigint, bigint|number\":function(e,t){return a(m(e,t,1n,!1))},\"number, bigint\":function(e,t){return a(m(BigInt(e),t,1n,!1))},\"bigint, bigint|number, bigint|number\":function(e,t,r){return a(m(e,t,BigInt(r),!1))},\"number, bigint, bigint|number\":function(e,t,r){return a(m(BigInt(e),t,BigInt(r),!1))},\"bigint, bigint|number, boolean\":function(e,t,r){return a(m(e,t,1n,r))},\"number, bigint, boolean\":function(e,t,r){return a(m(BigInt(e),t,1n,r))},\"bigint, bigint|number, bigint|number, boolean\":function(e,t,r,n){return a(m(e,t,BigInt(r),n))},\"number, bigint, bigint|number, boolean\":function(e,t,r,n){return a(m(BigInt(e),t,BigInt(r),n))},\"BigNumber, BigNumber\":function(e,t){return a(m(e,t,new e.constructor(1),!1))},\"BigNumber, BigNumber, BigNumber\":function(e,t,r){return a(m(e,t,r,!1))},\"BigNumber, BigNumber, boolean\":function(e,t,r){return a(m(e,t,new e.constructor(1),r))},\"BigNumber, BigNumber, BigNumber, boolean\":function(e,t,r,n){return a(m(e,t,r,n))},\"Fraction, Fraction\":function(e,t){return a(m(e,t,1,!1))},\"Fraction, Fraction, Fraction\":function(e,t,r){return a(m(e,t,r,!1))},\"Fraction, Fraction, boolean\":function(e,t,r){return a(m(e,t,1,r))},\"Fraction, Fraction, Fraction, boolean\":function(e,t,r,n){return a(m(e,t,r,n))},\"Unit, Unit, Unit\":function(e,t,r){return a(m(e,t,r,!1))},\"Unit, Unit, Unit, boolean\":function(e,t,r,n){return a(m(e,t,r,n))}});function a(e){return\"Matrix\"===n.matrix?r?r(e):ws():e}function o(t,e){var r=function(){const e=t.split(\":\").map(function(e){return Number(e)});if(e.some(function(e){return isNaN(e)}))return null;switch(e.length){case 2:return{start:e[0],end:e[1],step:1};case 3:return{start:e[0],end:e[2],step:e[1]};default:return null}}();if(r)return\"BigNumber\"===n.number?(void 0===i&&bs(),a(m(i(r.start),i(r.end),i(r.step)))):a(m(r.start,r.end,r.step,e));throw new SyntaxError('String \"'+t+'\" is no valid range')}function m(e,t,r,n){const i=[],a=p(r)?n?u:s:n?c:l;let o=e;for(;a(o,t);)i.push(o),o=f(o,r);return i}}),As=\"reshape\",Es=s(As,[\"typed\",\"isInteger\",\"matrix\"],e=>{let{typed:t,isInteger:r}=e;return t(As,{\"Matrix, Array\":function(e,t){return e.reshape(t,!0)},\"Array, Array\":function(e,t){return t.forEach(function(e){if(!r(e))throw new TypeError(\"Invalid size for dimension: \"+e)}),Bn(e,t)}})}),Ss=s(\"resize\",[\"config\",\"matrix\"],e=>{let{config:s,matrix:u}=e;return function(e,t,r){if(2!==arguments.length&&3!==arguments.length)throw new Za(\"resize\",arguments.length,2,3);if(Q((t=_(t)?t.valueOf():t)[0])&&(t=t.map(function(e){return Q(e)?e.toNumber():e})),_(e))return e.resize(t,r,!0);if(\"string\"==typeof e){var n=e,i=t,a=r;if(void 0!==a){if(\"string\"!=typeof a||1!==a.length)throw new TypeError(\"Single character expected as defaultValue\")}else a=\" \";if(1!==i.length)throw new z(i.length,1);var o=i[0];if(\"number\"!=typeof o||!v(o))throw new TypeError(\"Invalid size, must contain positive integers (size: \"+S(i)+\")\");if(n.length>o)return n.substring(0,o);if(n.length{let{typed:t,multiply:n,rotationMatrix:i}=e;return t(\"rotate\",{\"Array , number | BigNumber | Complex | Unit\":function(e,t){return a(e,2),n(i(t),e).toArray()},\"Matrix , number | BigNumber | Complex | Unit\":function(e,t){return a(e,2),n(i(t),e)},\"Array, number | BigNumber | Complex | Unit, Array | Matrix\":function(e,t,r){return a(e,3),n(i(t,r),e)},\"Matrix, number | BigNumber | Complex | Unit, Array | Matrix\":function(e,t,r){return a(e,3),n(i(t,r),e)}});function a(e,t){e=Array.isArray(e)?T(e):e.size();if(2{let{typed:t,config:n,multiplyScalar:i,addScalar:m,unaryMinus:h,norm:d,BigNumber:g,matrix:a,DenseMatrix:r,SparseMatrix:o,cos:y,sin:x}=e;return t(Cs,{\"\":function(){return\"Matrix\"===n.matrix?a([]):[]},string:function(e){return a(e)},\"number | BigNumber | Complex | Unit\":function(e){return s(e,\"Matrix\"===n.matrix?\"dense\":void 0)},\"number | BigNumber | Complex | Unit, string\":s,\"number | BigNumber | Complex | Unit, Array\":function(e,t){t=a(t);return u(t),l(e,t,void 0)},\"number | BigNumber | Complex | Unit, Matrix\":function(e,t){u(t);var r=t.storage()||(\"Matrix\"===n.matrix?\"dense\":void 0);return l(e,t,r)},\"number | BigNumber | Complex | Unit, Array, string\":function(e,t,r){t=a(t);return u(t),l(e,t,r)},\"number | BigNumber | Complex | Unit, Matrix, string\":function(e,t,r){return u(t),l(e,t,r)}});function s(e,t){var r=Q(e)?new g(-1):-1,n=y(e),e=x(e);return v([[n,i(r,e)],[e,n]],t)}function u(e){e=e.size();if(e.length<1||3!==e[0])throw new RangeError(\"Vector must be of dimensions 1x3\")}function b(e){return e.reduce((e,t)=>i(e,t))}function v(e,t){if(t){if(\"sparse\"===t)return new o(e);if(\"dense\"===t)return new r(e);throw new TypeError(`Unknown matrix type \"${t}\"`)}return e}function l(e,t,r){var n=d(t);if(0===n)throw new RangeError(\"Rotation around zero vector\");const i=Q(e)?g:null,a=i?new i(1):1,o=i?new i(-1):-1,s=i?new i(t.get([0])/n):t.get([0])/n,u=i?new i(t.get([1])/n):t.get([1])/n,l=i?new i(t.get([2])/n):t.get([2])/n,c=y(e),f=m(a,h(c)),p=x(e);return v([[m(c,b([s,s,f])),m(b([s,u,f]),b([o,l,p])),m(b([s,l,f]),b([u,p]))],[m(b([s,u,f]),b([l,p])),m(c,b([u,u,f])),m(b([u,l,f]),b([o,s,p]))],[m(b([s,l,f]),b([o,u,p])),m(b([u,l,f]),b([s,p])),m(c,b([l,l,f]))]],r)}}),Bs=s(\"row\",[\"typed\",\"Index\",\"matrix\",\"range\"],e=>{let{typed:t,Index:n,matrix:i,range:a}=e;return t(\"row\",{\"Matrix, number\":r,\"Array, number\":function(e,t){return r(i(ee(e)),t).valueOf()}});function r(e,t){if(2!==e.size().length)throw new Error(\"Only two dimensional matrix is supported\");M(t,e.size()[0]);var r=a(0,e.size()[1]),t=new n(t,r),r=e.subset(t);return _(r)?r:i([[r]])}}),Fs=s(\"size\",[\"typed\",\"config\",\"?matrix\"],e=>{let{typed:t,config:r,matrix:n}=e;return t(\"size\",{Matrix:function(e){return e.create(e.size(),\"number\")},Array:T,string:function(e){return\"Array\"===r.matrix?[e.length]:n([e.length],\"dense\",\"number\")},\"number | Complex | BigNumber | Unit | boolean | null\":function(e){return\"Array\"===r.matrix?[]:n?n([],\"dense\",\"number\"):ws()}})}),Ds=\"squeeze\",Os=s(Ds,[\"typed\"],e=>{let t=e[\"typed\"];return t(Ds,{Array:function(e){return On(ee(e))},Matrix:function(e){var t=On(e.toArray());return Array.isArray(t)?e.create(t,e.datatype()):t},any:ee})}),_s=s(\"subset\",[\"typed\",\"matrix\",\"zeros\",\"add\"],e=>{let{typed:t,matrix:o,zeros:i,add:a}=e;return t(\"subset\",{\"Matrix, Index\":function(e,t){return Cn(t)?o():(Mn(e,t),e.subset(t))},\"Array, Index\":t.referTo(\"Matrix, Index\",function(n){return function(e,t){const r=n(o(e),t);return t.isScalar()?r:r.valueOf()}}),\"Object, Index\":Is,\"string, Index\":zs,\"Matrix, Index, any, any\":function(e,t,r,n){return Cn(t)?e:(Mn(e,t),e.clone().subset(t,function(e,t){if(\"string\"==typeof e)throw new Error(\"can't boradcast a string\");if(t._isScalar)return e;const r=t.size();if(!r.every(e=>0a)for(let e=a-1,t=o.length;e{let{typed:t,matrix:r}=e;return t(Rs,{Array:e=>n(r(e)).valueOf(),Matrix:n,any:ee});function n(e){var t=e.size();let r;switch(t.length){case 1:r=e.clone();break;case 2:var n=t[0],i=t[1];if(0===i)throw new RangeError(\"Cannot transpose a 2D matrix with no columns (size: \"+S(t)+\")\");switch(e.storage()){case\"dense\":r=function(e,r,n){const i=e._data,a=[];let o;for(let t=0;t{let{typed:t,transpose:r,conj:n}=e;return t(Us,{any:function(e){return n(r(e))}})}),Ls=s(\"zeros\",[\"typed\",\"config\",\"matrix\",\"BigNumber\"],e=>{let{typed:t,config:r,matrix:i,BigNumber:a}=e;return t(\"zeros\",{\"\":function(){return\"Array\"===r.matrix?n([]):n([],\"default\")},\"...number | BigNumber | string\":function(e){var t;return\"string\"==typeof e[e.length-1]?(t=e.pop(),n(e,t)):\"Array\"===r.matrix?n(e):n(e,\"default\")},Array:n,Matrix:function(e){var t=e.storage();return n(e.valueOf(),t)},\"Array | Matrix, string\":function(e,t){return n(e.valueOf(),t)}});function n(e,t){const r=function(){let n=!1;return e.forEach(function(e,t,r){Q(e)&&(n=!0,r[t]=e.toNumber())}),n}(),n=r?new a(0):0;if(e.forEach(function(e){if(\"number\"!=typeof e||!v(e)||e<0)throw new Error(\"Parameters in function zeros must be positive integers\")}),t){const r=i(t);return 0{let{typed:t,addScalar:d,multiplyScalar:g,divideScalar:y,exp:x,tau:b,i:v,dotDivide:w,conj:N,pow:A,ceil:E,log2:S}=e;return t(\"fft\",{Array:M,Matrix:function(e){return e.create(M(e.valueOf()),e.datatype())}});function M(e){const t=T(e);return 1===t.length?C(e,t[0]):function r(n,i){const e=T(n);if(0!==i)return new Array(e[0]).fill(0).map((e,t)=>r(n[t],i-1));if(1===e.length)return C(n);function t(n){const t=T(n);return new Array(t[1]).fill(0).map((e,r)=>new Array(t[0]).fill(0).map((e,t)=>n[t][r]))}return t(r(t(n),1))}(e.map(e=>M(e,t.slice(1))),0)}function C(e){var t=e.length;if(1===t)return[e[0]];if(t%2!=0){var r=e;const n=r.length,i=x(y(g(-1,g(v,b)),n)),a=[];for(let e=1-n;eg(r[t],a[n-1+t])),...new Array(o-n).fill(0)],u=[...new Array(n+n-1).fill(0).map((e,t)=>y(1,a[t])),...new Array(o-(n+n-1)).fill(0)],l=C(s),c=C(u),f=new Array(o).fill(0).map((e,t)=>g(l[t],c[t])),p=w(N(M(N(f))),o),m=[];for(let e=n-1;et%2==0)),...C(e.filter((e,t)=>t%2==1))];for(let e=0;e{let{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(\"ifft\",{\"Array | Matrix\":function(e){const t=_(e)?e.size():T(e);return n(i(r(i(e))),t.reduce((e,t)=>e*t,1))}})}),Gs=s(\"solveODE\",[\"typed\",\"add\",\"subtract\",\"multiply\",\"divide\",\"max\",\"map\",\"abs\",\"isPositive\",\"isNegative\",\"larger\",\"smaller\",\"matrix\",\"bignumber\",\"unaryMinus\"],e=>{let{typed:t,add:T,subtract:B,multiply:F,divide:D,max:O,map:_,abs:z,isPositive:q,isNegative:I,larger:k,smaller:R,matrix:a,bignumber:P,unaryMinus:U}=e;function i(C){return function(t,e,r,n){if(2!==e.length||!e.every(j)&&!e.every(L))throw new Error('\"tspan\" must be an Array of two numeric values or two units [tStart, tEnd]');const i=e[0],a=e[1],o=k(a,i),s=n.firstStep;if(void 0!==s&&!q(s))throw new Error('\"firstStep\" must be positive');const u=n.maxStep;if(void 0!==u&&!q(u))throw new Error('\"maxStep\" must be positive');const l=n.minStep;if(l&&I(l))throw new Error('\"minStep\" must be positive or zero');const c=[i,a,s,l,u].filter(e=>void 0!==e);if(!c.every(j)&&!c.every(L))throw new Error('Inconsistent type of \"t\" dependant variables');var f=n.tol||1e-4,p=n.minDelta||.2,m=n.maxDelta||5,h=n.maxIter||1e4,d=[i,a,...r,u,l].some(Q),[g,y,x,e]=d?[P(C.a),P(C.c),P(C.b),P(C.bp)]:[C.a,C.c,C.b,C.bp];let b=s?o?s:U(s):D(B(a,i),1);const v=[i],w=[r],N=B(x,e);let A=0,E=0;const S=o?R:k,M=function(){const i=o?k:R;return function(e,t,r){var n=T(e,r);return i(n,t)?B(t,e):r}}();for(;S(v[A],a);){const C=[];b=M(v[A],a,b),C.push(t(v[A],w[A]));for(let e=1;eL(e)?e.value:e)));Bh)throw new Error(\"Maximum number of iterations reached, try changing options\")}return{t:v,y:w}}}function s(e,t,r,n){return i({a:[[],[.5],[0,.75],[2/9,1/3,4/9]],c:[null,.5,.75,1],b:[2/9,1/3,4/9,0],bp:[7/24,.25,1/3,1/8]})(e,t,r,n)}function u(e,t,r,n){return i({a:[[],[.2],[.075,.225],[44/45,-56/15,32/9],[19372/6561,-25360/2187,64448/6561,-212/729],[9017/3168,-355/33,46732/5247,49/176,-5103/18656],[35/384,0,500/1113,125/192,-2187/6784,11/84]],c:[null,.2,.3,.8,8/9,1,1],b:[35/384,0,500/1113,125/192,-2187/6784,11/84,0],bp:[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,.025]})(e,t,r,n)}function o(e,t,r,n){const i=n.method||\"RK45\",a={RK23:s,RK45:u};if(i.toUpperCase()in a){const o={...n};return delete o.method,a[i.toUpperCase()](e,t,r,o)}{const e=Object.keys(a).map(e=>`\"${e}\"`),t=e.slice(0,-1).join(\", \")+\" and \"+e.slice(-1);throw new Error(`Unavailable method \"${i}\". Available methods are `+t)}}function j(e){return Q(e)||A(e)}function n(e,t,r,n){e=o(e,t.toArray(),r.toArray(),n);return{t:a(e.t),y:a(e.y)}}return t(\"solveODE\",{\"function, Array, Array, Object\":o,\"function, Matrix, Matrix, Object\":n,\"function, Array, Array\":(e,t,r)=>o(e,t,r,{}),\"function, Matrix, Matrix\":(e,t,r)=>n(e,t,r,{}),\"function, Array, number | BigNumber | Unit\":(e,t,r)=>{const n=o(e,t,[r],{});return{t:n.t,y:n.y.map(e=>e[0])}},\"function, Matrix, number | BigNumber | Unit\":(e,t,r)=>{const n=o(e,t.toArray(),[r],{});return{t:a(n.t),y:a(n.y.map(e=>e[0]))}},\"function, Array, number | BigNumber | Unit, Object\":(e,t,r,n)=>{const i=o(e,t,[r],n);return{t:i.t,y:i.y.map(e=>e[0])}},\"function, Matrix, number | BigNumber | Unit, Object\":(e,t,r,n)=>{const i=o(e,t.toArray(),[r],n);return{t:a(i.t),y:a(i.y.map(e=>e[0]))}}})}),Vs=s(\"erf\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"name\",{number:function(e){var t=Math.abs(e);return t>=Xs?ke(e):t<=Zs?ke(e)*function(e){var t=e*e;let r,n=Ys[0][4]*t,i=t;for(r=0;r<3;r+=1)n=(n+Ys[0][r])*t,i=(i+Js[0][r])*t;return e*(n+Ys[0][3])/(i+Js[0][3])}(t):t<=4?ke(e)*(1-function(e){let t,r=Ys[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+Ys[1][t])*e,n=(n+Js[1][t])*e;var i=(r+Ys[1][7])/(n+Js[1][7]),a=parseInt(16*e)/16,o=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-o)*i}(t)):ke(e)*(1-function(e){let t,r=1/(e*e),n=Ys[2][5]*r,i=r;for(t=0;t<4;t+=1)n=(n+Ys[2][t])*r,i=(i+Js[2][t])*r;var a=r*(n+Ys[2][4])/(i+Js[2][4]),a=(Ws-a)/e,e=(e-(r=parseInt(16*e)/16))*(e+r);return Math.exp(-r*r)*Math.exp(-e)*a}(t))},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Zs=.46875,Ws=.5641895835477563,Ys=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Js=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],Xs=Math.pow(2,53),Qs=s(\"zeta\",[\"typed\",\"config\",\"multiply\",\"pow\",\"divide\",\"factorial\",\"equal\",\"smallerEq\",\"isNegative\",\"gamma\",\"sin\",\"subtract\",\"add\",\"?Complex\",\"?BigNumber\",\"pi\"],e=>{let{typed:t,config:r,multiply:u,pow:l,divide:c,factorial:i,equal:n,smallerEq:f,isNegative:a,gamma:p,sin:m,subtract:h,add:d,Complex:o,BigNumber:s,pi:g}=e;return t(\"zeta\",{number:e=>y(e,e=>e,()=>20),BigNumber:e=>y(e,e=>new s(e),()=>Math.abs(Math.log10(r.relTol))),Complex:function(e){return 0===e.re&&0===e.im?new o(-.5):1===e.re?new o(NaN,NaN):e.re===1/0&&0===e.im?new o(1):e.im===1/0||e.re===-1/0?new o(NaN,NaN):x(e,e=>e,e=>Math.round(19.5+.9*Math.abs(e.im)),e=>e.re)}});function y(e,t,r){return n(e,0)?t(-.5):n(e,1)?t(NaN):isFinite(e)?x(e,t,r,e=>e):a(e)?t(NaN):t(1)}function x(e,r,t,n){var i=t(e);{if(n(e)>-(i-1)/2){var a=e,o=r(i),i=r,s=c(1,u(b(i(0),o),h(1,l(2,h(1,a)))));let t=i(0);for(let e=i(1);f(e,o);e=d(e,1))t=d(t,c(u((-1)**(e-1),b(e,o)),l(e,a)));return u(s,t)}return i=u(l(2,e),l(r(g),h(e,1))),i=u(i,m(u(c(r(g),2),e))),i=u(i,p(h(1,e))),u(i,x(h(1,e),r,t,n))}}function b(t,r){let n=t;for(let e=t;f(e,r);e=d(e,1)){const t=c(u(i(d(r,h(e,1))),l(4,e)),u(i(h(r,e)),i(u(2,e))));n=d(n,t)}return u(r,n)}}),Ks=s(\"mode\",[\"typed\",\"isNaN\",\"isNumeric\"],e=>{let{typed:t,isNaN:o,isNumeric:s}=e;return t(\"mode\",{\"Array | Matrix\":r,\"...\":r});function r(t){if(0===(t=E(t.valueOf())).length)throw new Error(\"Cannot calculate mode of an empty array\");const r={};let n=[],i=0;for(let e=0;ei&&(i=r[a],n=[a])}return n}});function eu(e,t,r){let n;return String(e).includes(\"Unexpected type\")?(n=2{let{typed:t,config:n,multiplyScalar:i,numeric:a}=e;return t(\"prod\",{\"Array | Matrix\":r,\"Array | Matrix, number | BigNumber\":function(e,t){throw new Error(\"prod(A, dim) is not yet supported\")},\"...\":r});function r(e){let r;if(ti(e,function(t){try{r=void 0===r?t:i(r,t)}catch(e){throw eu(e,\"prod\",t)}}),void 0===(r=\"string\"==typeof r?a(r,Ie(r,n)):r))throw new Error(\"Cannot calculate prod of an empty array\");return r}}),ru=s(\"format\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"format\",{any:S,\"any, Object | function | number | BigNumber\":S})}),nu=s(\"bin\",[\"typed\",\"format\"],e=>{let{typed:t,format:r}=e;return t(\"bin\",{\"number | BigNumber\":function(e){return r(e,{notation:\"bin\"})},\"number | BigNumber, number | BigNumber\":function(e,t){return r(e,{notation:\"bin\",wordSize:t})}})}),iu=s(\"oct\",[\"typed\",\"format\"],e=>{let{typed:t,format:r}=e;return t(\"oct\",{\"number | BigNumber\":function(e){return r(e,{notation:\"oct\"})},\"number | BigNumber, number | BigNumber\":function(e,t){return r(e,{notation:\"oct\",wordSize:t})}})}),au=s(\"hex\",[\"typed\",\"format\"],e=>{let{typed:t,format:r}=e;return t(\"hex\",{\"number | BigNumber\":function(e){return r(e,{notation:\"hex\"})},\"number | BigNumber, number | BigNumber\":function(e,t){return r(e,{notation:\"hex\",wordSize:t})}})}),ou=/\\$([\\w.]+)/g,su=s(\"print\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"print\",{\"string, Object | Array\":uu,\"string, Object | Array, number | Object\":uu})});function uu(e,i,a){return e.replace(ou,function(e,t){const r=t.split(\".\");let n=i[r.shift()];for(void 0!==n&&n.isMatrix&&(n=n.toArray());r.length&&void 0!==n;){const e=r.shift();n=e?n[e]:n+\".\"}return void 0!==n?j(n)?n:S(n,a):e})}const lu=s(\"to\",[\"typed\",\"matrix\",\"concat\"],e=>{let{typed:t,matrix:r,concat:n}=e;return t(\"to\",{\"Unit, Unit | string\":(e,t)=>e.to(t)},C({typed:t,matrix:r,concat:n})({Ds:!0}))}),cu=s(\"toBest\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"toBest\",{Unit:e=>e.toBest(),\"Unit, string\":(e,t)=>e.toBest(t.split(\",\")),\"Unit, string, Object\":(e,t,r)=>e.toBest(t.split(\",\"),r),\"Unit, Array\":(e,t)=>e.toBest(t),\"Unit, Array, Object\":(e,t,r)=>e.toBest(t,r)})}),fu=\"isPrime\",pu=s(fu,[\"typed\"],e=>{let t=e[\"typed\"];return t(fu,{number:function(t){if(t<=3)return 1ee=>le(e,t))})}),mu=s(\"numeric\",[\"number\",\"?bignumber\",\"?fraction\"],e=>{let{number:t,bignumber:r,fraction:n}=e;const i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:e=>t(e),BigNumber:r?e=>r(e):bs,bigint:e=>BigInt(e),Fraction:n?e=>n(e):vs};return function(e){var t=1{let t=e[\"typed\"];return t(hu,{\"number, number\":function(e,t){return e/t},\"Complex, Complex\":function(e,t){return e.div(t)},\"BigNumber, BigNumber\":function(e,t){return e.div(t)},\"bigint, bigint\":function(e,t){return e/t},\"Fraction, Fraction\":function(e,t){return e.div(t)},\"Unit, number | Complex | Fraction | BigNumber | Unit\":(e,t)=>e.divide(t),\"number | Fraction | Complex | BigNumber, Unit\":(e,t)=>t.divideInto(e)})}),gu=s(\"pow\",[\"typed\",\"config\",\"identity\",\"multiply\",\"matrix\",\"inv\",\"fraction\",\"number\",\"Complex\"],e=>{let{typed:t,config:n,identity:a,multiply:o,matrix:r,inv:s,number:i,fraction:u,Complex:l}=e;return t(\"pow\",{\"number, number\":c,\"Complex, Complex\":function(e,t){return e.pow(t)},\"BigNumber, BigNumber\":function(e,t){return t.isInteger()||0<=e||n.predictable?e.pow(t):new l(e.toNumber(),0).pow(t.toNumber(),0)},\"bigint, bigint\":(e,t)=>e**t,\"Fraction, Fraction\":function(e,t){var r=e.pow(t);if(null!=r)return r;if(n.predictable)throw new Error(\"Result of pow is non-rational and cannot be expressed as a fraction\");return c(e.valueOf(),t.valueOf())},\"Array, number\":f,\"Array, BigNumber\":function(e,t){return f(e,t.toNumber())},\"Matrix, number\":p,\"Matrix, BigNumber\":function(e,t){return p(e,t.toNumber())},\"Unit, number | BigNumber\":function(e,t){return e.pow(t)}});function c(e,t){if(n.predictable&&!v(t)&&e<0)try{const n=u(t),r=i(n);if((t===r||Math.abs((t-r)/t)<1e-14)&&n.d%2n===1n)return(n.n%2n===0n?1:-1)*Math.pow(-e,t)}catch(e){}return n.predictable&&(e<-1&&t===1/0||-1>=1,i=o(i,i);return n}function p(e,t){return r(f(e.valueOf(),t))}}),yu=\"Number of decimals in function round must be an integer\",xu=s(\"round\",[\"typed\",\"config\",\"matrix\",\"equalScalar\",\"zeros\",\"BigNumber\",\"DenseMatrix\"],e=>{let{typed:t,config:i,matrix:n,equalScalar:a,zeros:o,BigNumber:r,DenseMatrix:s}=e;const u=Aa({typed:t,equalScalar:a}),l=x({typed:t,DenseMatrix:s}),c=Ea({typed:t});function f(e){return Math.abs(Ve(e).exponent)}return t(\"round\",{number:function(e){var t=la(e,f(i.relTol));return la(Xe(e,t,i.relTol,i.absTol)?t:e)},\"number, number\":function(e,t){var r=f(i.relTol);if(r<=t)return la(e,t);r=la(e,r);return la(Xe(e,r,i.relTol,i.absTol)?r:e,t)},\"number, BigNumber\":function(e,t){if(t.isInteger())return new r(e).toDecimalPlaces(t.toNumber());throw new TypeError(yu)},Complex:function(e){return e.round()},\"Complex, number\":function(e,t){if(t%1)throw new TypeError(yu);return e.round(t)},\"Complex, BigNumber\":function(e,t){if(!t.isInteger())throw new TypeError(yu);t=t.toNumber();return e.round(t)},BigNumber:function(e){const t=new r(e).toDecimalPlaces(f(i.relTol));return(li(e,t,i.relTol,i.absTol)?t:e).toDecimalPlaces(0)},\"BigNumber, BigNumber\":function(e,t){if(!t.isInteger())throw new TypeError(yu);var r=f(i.relTol);if(r<=t)return e.toDecimalPlaces(t.toNumber());const n=e.toDecimalPlaces(r);return(li(e,n,i.relTol,i.absTol)?n:e).toDecimalPlaces(t.toNumber())},bigint:e=>e,\"bigint, number\":(e,t)=>e,\"bigint, BigNumber\":(e,t)=>e,Fraction:function(e){return e.round()},\"Fraction, number\":function(e,t){if(t%1)throw new TypeError(yu);return e.round(t)},\"Fraction, BigNumber\":function(e,t){if(t.isInteger())return e.round(t.toNumber());throw new TypeError(yu)},\"Unit, number, Unit\":t.referToSelf(n=>function(e,t,r){e=e.toNumeric(r);return r.multiply(n(e,t))}),\"Unit, BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>n(e,t.toNumber(),r)),\"Array | Matrix, number | BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>le(e,e=>n(e,t,r),!0)),\"Array | Matrix | Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e,0,t)),\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0)),\"SparseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>u(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>c(e,t,r,!1)),\"Array, number | BigNumber\":t.referToSelf(r=>(e,t)=>c(n(e),t,r,!1).valueOf()),\"number | Complex | BigNumber | Fraction, SparseMatrix\":t.referToSelf(r=>(e,t)=>a(e,0)?o(t.size(),t.storage()):l(t,e,r,!0)),\"number | Complex | BigNumber | Fraction, DenseMatrix\":t.referToSelf(r=>(e,t)=>a(e,0)?o(t.size(),t.storage()):c(t,e,r,!0)),\"number | Complex | BigNumber | Fraction, Array\":t.referToSelf(r=>(e,t)=>c(n(t),e,r,!0).valueOf())})}),bu=Math.log(16),vu=s(\"log\",[\"config\",\"typed\",\"typeOf\",\"divideScalar\",\"Complex\"],e=>{let{typed:t,typeOf:n,config:r,divideScalar:i,Complex:a}=e;function o(e){return e.log()}function s(e){return o(new a(e,0))}return t(\"log\",{number:function(e){return(0<=e||r.predictable?ta:s)(e)},bigint:Qa(bu,ta,r,s),Complex:o,BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():s(e.toNumber())},\"any, any\":t.referToSelf(r=>(e,t)=>{if(\"Fraction\"===n(e)&&\"Fraction\"===n(t)){const r=e.log(t);if(null!==r)return r}return i(r(e),r(t))})})}),wu=s(\"log1p\",[\"typed\",\"config\",\"divideScalar\",\"log\",\"Complex\"],e=>{let{typed:t,config:r,divideScalar:n,log:i,Complex:a}=e;return t(\"log1p\",{number:function(e){return-1<=e||r.predictable?Ue(e):o(new a(e,0))},Complex:o,BigNumber:function(e){const t=e.plus(1);return!t.isNegative()||r.predictable?t.ln():o(new a(e.toNumber(),0))},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t)),\"any, any\":t.referToSelf(r=>(e,t)=>n(r(e),i(t)))});function o(e){var t=e.re+1;return new a(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}}),Nu=\"nthRoots\",Au=s(Nu,[\"config\",\"typed\",\"divideScalar\",\"Complex\"],e=>{let{typed:t,Complex:u}=e;const l=[function(e){return new u(e,0)},function(e){return new u(0,e)},function(e){return new u(-e,0)},function(e){return new u(0,-e)}];function r(e,t){if(t<0)throw new Error(\"Root must be greater than zero\");if(0===t)throw new Error(\"Root must be non-zero\");if(t%1!=0)throw new Error(\"Root must be an integer\");if(0===e||0===e.abs())return[new u(0,0)];const r=\"number\"==typeof e;let n;!r&&0!==e.re&&0!==e.im||(n=r?2*(e<0):0===e.im?2*(e.re<0):2*(e.im<0)+1);const i=e.arg(),a=e.abs(),o=[],s=Math.pow(a,1/t);for(let e=0;e{let{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e;const u=Pa({typed:t}),l=ko({typed:t,SparseMatrix:s}),c=Aa({typed:t,equalScalar:r}),f=x({typed:t,DenseMatrix:a}),p=C({typed:t,matrix:n,concat:o}),m={};for(const e in i.signatures)!Object.prototype.hasOwnProperty.call(i.signatures,e)||e.includes(\"Matrix\")||e.includes(\"Array\")||(m[e]=i.signatures[e]);e=t(m);return t(\"dotPow\",p({elop:e,SS:l,DS:u,Ss:c,sS:f}))}),Su=\"dotDivide\",Mu=s(Su,[\"typed\",\"matrix\",\"equalScalar\",\"divideScalar\",\"DenseMatrix\",\"concat\",\"SparseMatrix\"],e=>{let{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e;const u=Ra({typed:t,equalScalar:n}),l=Pa({typed:t}),c=ko({typed:t,SparseMatrix:s}),f=Aa({typed:t,equalScalar:n}),p=x({typed:t,DenseMatrix:a}),m=C({typed:t,matrix:r,concat:o});return t(Su,m({elop:i,SS:c,DS:l,SD:u,Ss:f,sS:p}))});function Cu(e){let s=e[\"DenseMatrix\"];return function(r,t,n){const i=r.size();if(2!==i.length)throw new RangeError(\"Matrix must be two dimensional (size: \"+S(i)+\")\");var a=i[0];if(a!==i[1])throw new RangeError(\"Matrix must be square (size: \"+S(i)+\")\");let o=[];if(_(t)){const r=t.size(),i=t._data;if(1===r.length){if(r[0]!==a)throw new RangeError(\"Dimension mismatch. Matrix columns must match vector length.\");for(let e=0;e{let{typed:t,matrix:r,divideScalar:m,multiplyScalar:h,subtractScalar:d,equalScalar:g,DenseMatrix:y}=e;const x=Cu({DenseMatrix:y});return t(\"lsolve\",{\"SparseMatrix, Array | Matrix\":function(e,t){{var n=t;const a=(n=x(e,n,!0))._data,o=e._size[0],s=e._size[1],u=e._values,l=e._index,c=e._ptr,f=[];for(let r=0;rr&&(x.push(u[e]),o.push(a))}if(g(t,0))throw new Error(\"Linear system cannot be solved since matrix is singular\");var i=m(n,t);for(let e=0,t=o.length;e{let{typed:t,matrix:r,divideScalar:p,multiplyScalar:m,subtractScalar:h,equalScalar:d,DenseMatrix:g}=e;const y=Cu({DenseMatrix:g});return t(\"usolve\",{\"SparseMatrix, Array | Matrix\":function(e,t){{var n=t;const a=(n=y(e,n,!0))._data,o=e._size[0],s=e._size[1],u=e._values,l=e._index,c=e._ptr,f=[];for(let r=s-1;0<=r;r--){const n=a[r][0]||0;if(d(n,0))f[r]=[0];else{let t=0;const y=[],o=[],s=c[r];for(let e=c[r+1]-1;e>=s;e--){const a=l[e];a===r?t=u[e]:a{let{typed:t,matrix:r,divideScalar:m,multiplyScalar:h,subtractScalar:d,equalScalar:g,DenseMatrix:y}=e;const x=Cu({DenseMatrix:y});return t(Fu,{\"SparseMatrix, Array | Matrix\":function(e,t){{var i=t;const a=[x(e,i,!0)._data.map(e=>e[0])],o=e._size[0],s=e._size[1],u=e._values,l=e._index,c=e._ptr;for(let n=0;nn&&(o.push(u[e]),s.push(a))}if(g(t,0))if(g(x[n],0)){if(0===e){const i=[...x];i[n]=1;for(let e=0,t=s.length;enew y({data:e.map(e=>[e]),size:[o,1]}))}},\"DenseMatrix, Array | Matrix\":n,\"Array, Array | Matrix\":function(e,t){return n(r(e),t).map(e=>e.valueOf())}});function n(e,n){const i=[x(e,n,!0)._data.map(e=>e[0])],a=e._data,t=e._size[0],o=e._size[1];for(let r=0;rnew y({data:e.map(e=>[e]),size:[t,1]}))}}),Ou=\"usolveAll\",_u=s(Ou,[\"typed\",\"matrix\",\"divideScalar\",\"multiplyScalar\",\"subtractScalar\",\"equalScalar\",\"DenseMatrix\"],e=>{let{typed:t,matrix:r,divideScalar:p,multiplyScalar:m,subtractScalar:h,equalScalar:d,DenseMatrix:g}=e;const y=Cu({DenseMatrix:g});return t(Ou,{\"SparseMatrix, Array | Matrix\":function(e,t){{var i=t;const a=[y(e,i,!0)._data.map(e=>e[0])],o=e._size[0],s=e._size[1],u=e._values,l=e._index,c=e._ptr;for(let n=s-1;0<=n;n--){let r=a.length;for(let e=0;e=f;e--){const a=l[e];a===n?t=u[e]:anew g({data:e.map(e=>[e]),size:[o,1]}))}},\"DenseMatrix, Array | Matrix\":n,\"Array, Array | Matrix\":function(e,t){return n(r(e),t).map(e=>e.valueOf())}});function n(n,e){const i=[y(n,e,!0)._data.map(e=>e[0])],a=n._data,t=n._size[0];for(let r=n._size[1]-1;0<=r;r--){let t=i.length;for(let e=0;enew g({data:e.map(e=>[e]),size:[t,1]}))}}),zu=s(\"matAlgo08xS0Sid\",[\"typed\",\"equalScalar\"],e=>{let{typed:C,equalScalar:T}=e;return function(t,e,r){var n=t._values,i=t._index,a=t._ptr,o=t._size,s=t._datatype||void 0===t._data?t._datatype:t.getDataType(),u=e._values,l=e._index,c=e._ptr,f=e._size,p=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(o.length!==f.length)throw new z(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+o+\") must match Matrix B (\"+f+\")\");if(!n||!u)throw new Error(\"Cannot perform operation on Pattern Sparse Matrices\");var f=o[0],m=o[1];let h,d=T,g=0,y=r;\"string\"==typeof s&&s===p&&\"mixed\"!==s&&(h=s,d=C.find(T,[h,h]),g=C.convert(0,h),y=C.find(r,[h,h]));const x=[],b=[],v=[],w=[],N=[];let A,E,S,M;for(let e=0;e{let{typed:t,matrix:n}=e;return{\"Array, number\":t.referTo(\"DenseMatrix, number\",r=>(e,t)=>r(n(e),t).valueOf()),\"Array, BigNumber\":t.referTo(\"DenseMatrix, BigNumber\",r=>(e,t)=>r(n(e),t).valueOf()),\"number, Array\":t.referTo(\"number, DenseMatrix\",r=>(e,t)=>r(e,n(t)).valueOf()),\"BigNumber, Array\":t.referTo(\"BigNumber, DenseMatrix\",r=>(e,t)=>r(e,n(t)).valueOf())}}),Iu=\"leftShift\",ku=s(Iu,[\"typed\",\"matrix\",\"equalScalar\",\"zeros\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e;const s=Ha({typed:t}),u=Ra({typed:t,equalScalar:n}),l=zu({typed:t,equalScalar:n}),c=Va({typed:t,DenseMatrix:a}),f=Aa({typed:t,equalScalar:n}),p=Ea({typed:t}),m=C({typed:t,matrix:r,concat:o}),h=qu({typed:t,matrix:r});return t(Iu,{\"number, number\":Do,\"BigNumber, BigNumber\":Eo,\"bigint, bigint\":(e,t)=>e<(e,t)=>n(t,0)?e.clone():f(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>n(t,0)?e.clone():p(e,t,r,!1)),\"number | BigNumber, SparseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):c(t,e,r,!0)),\"number | BigNumber, DenseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):p(t,e,r,!0))},h,m({SS:l,DS:s,SD:u}))}),Ru=\"rightArithShift\",Pu=s(Ru,[\"typed\",\"matrix\",\"equalScalar\",\"zeros\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e;const s=Ha({typed:t}),u=Ra({typed:t,equalScalar:n}),l=zu({typed:t,equalScalar:n}),c=Va({typed:t,DenseMatrix:a}),f=Aa({typed:t,equalScalar:n}),p=Ea({typed:t}),m=C({typed:t,matrix:r,concat:o}),h=qu({typed:t,matrix:r});return t(Ru,{\"number, number\":Oo,\"BigNumber, BigNumber\":So,\"bigint, bigint\":(e,t)=>e>>t,\"SparseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>n(t,0)?e.clone():f(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>n(t,0)?e.clone():p(e,t,r,!1)),\"number | BigNumber, SparseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):c(t,e,r,!0)),\"number | BigNumber, DenseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):p(t,e,r,!0))},h,m({SS:l,DS:s,SD:u}))}),Uu=\"rightLogShift\",ju=s(Uu,[\"typed\",\"matrix\",\"equalScalar\",\"zeros\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e;const s=Ha({typed:t}),u=Ra({typed:t,equalScalar:n}),l=zu({typed:t,equalScalar:n}),c=Va({typed:t,DenseMatrix:a}),f=Aa({typed:t,equalScalar:n}),p=Ea({typed:t}),m=C({typed:t,matrix:r,concat:o}),h=qu({typed:t,matrix:r});return t(Uu,{\"number, number\":_o,\"SparseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>n(t,0)?e.clone():f(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>n(t,0)?e.clone():p(e,t,r,!1)),\"number | BigNumber, SparseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):c(t,e,r,!0)),\"number | BigNumber, DenseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):p(t,e,r,!0))},h,m({SS:l,DS:s,SD:u}))}),Lu=s(\"and\",[\"typed\",\"matrix\",\"equalScalar\",\"zeros\",\"not\",\"concat\"],e=>{let{typed:t,matrix:n,equalScalar:r,zeros:i,not:a,concat:o}=e;const s=Ra({typed:t,equalScalar:r}),u=Ja({typed:t,equalScalar:r}),l=Aa({typed:t,equalScalar:r}),c=Ea({typed:t}),f=C({typed:t,matrix:n,concat:o});return t(\"and\",{\"number, number\":Zo,\"Complex, Complex\":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},\"BigNumber, BigNumber\":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},\"bigint, bigint\":Zo,\"Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e.value||0,t.value||0)),\"SparseMatrix, any\":t.referToSelf(r=>(e,t)=>a(t)?i(e.size(),e.storage()):l(e,t,r,!1)),\"DenseMatrix, any\":t.referToSelf(r=>(e,t)=>a(t)?i(e.size(),e.storage()):c(e,t,r,!1)),\"any, SparseMatrix\":t.referToSelf(r=>(e,t)=>a(e)?i(e.size(),e.storage()):l(t,e,r,!0)),\"any, DenseMatrix\":t.referToSelf(r=>(e,t)=>a(e)?i(e.size(),e.storage()):c(t,e,r,!0)),\"Array, any\":t.referToSelf(r=>(e,t)=>r(n(e),t).valueOf()),\"any, Array\":t.referToSelf(r=>(e,t)=>r(e,n(t)).valueOf())},f({SS:u,DS:s}))}),$u=\"compare\",Hu=s($u,[\"typed\",\"config\",\"matrix\",\"equalScalar\",\"BigNumber\",\"Fraction\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:a,Fraction:o,DenseMatrix:s,concat:u}=e;const l=Pa({typed:t}),c=Ua({typed:t,equalScalar:n}),f=x({typed:t,DenseMatrix:s}),p=C({typed:t,matrix:i,concat:u}),m=wi({typed:t});return t($u,Gu({typed:t,config:r}),{\"boolean, boolean\":function(e,t){return e===t?0:t{let{typed:t,config:r}=e;return t($u,{\"number, number\":function(e,t){return Xe(e,t,r.relTol,r.absTol)?0:t{let{typed:t,compare:m}=e;const h=m.signatures[\"boolean,boolean\"];return t(Zu,{\"any, any\":function e(t,r){var n=K(t),i=K(r);let a;if(!(\"number\"!==n&&\"BigNumber\"!==n&&\"Fraction\"!==n||\"number\"!==i&&\"BigNumber\"!==i&&\"Fraction\"!==i))return\"0\"!==(a=m(t,r)).toString()?0r.re?1:t.rer.im?1:t.imi.length?1:n.length{let{typed:t,matrix:r,concat:n}=e;const i=C({typed:t,matrix:r,concat:n});return t(Yu,An,i({elop:An,Ds:!0}))})),Xu=\"equal\",Qu=s(Xu,[\"typed\",\"matrix\",\"equalScalar\",\"DenseMatrix\",\"concat\",\"SparseMatrix\"],e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e;const s=Pa({typed:t}),u=ko({typed:t,SparseMatrix:o}),l=x({typed:t,DenseMatrix:i}),c=C({typed:t,matrix:r,concat:a});return t(Xu,Ku({typed:t,equalScalar:n}),c({elop:n,SS:u,DS:s,Ss:l}))}),Ku=s(Xu,[\"typed\",\"equalScalar\"],e=>{let{typed:t,equalScalar:r}=e;return t(Xu,{\"any, any\":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)}})}),el=\"equalText\",tl=s(el,[\"typed\",\"compareText\",\"isZero\"],e=>{let{typed:t,compareText:r,isZero:n}=e;return t(el,{\"any, any\":function(e,t){return n(r(e,t))}})}),rl=\"smaller\",nl=s(rl,[\"typed\",\"config\",\"bignumber\",\"matrix\",\"DenseMatrix\",\"concat\",\"SparseMatrix\"],e=>{let{typed:t,config:r,bignumber:n,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e;const u=Pa({typed:t}),l=ko({typed:t,SparseMatrix:s}),c=x({typed:t,DenseMatrix:a}),f=C({typed:t,matrix:i,concat:o}),p=wi({typed:t});function m(e,t){return e.lt(t)&&!li(e,t,r.relTol,r.absTol)}return t(rl,il({typed:t,config:r}),{\"boolean, boolean\":(e,t)=>ee-1===e.compare(t),\"Fraction, BigNumber\":function(e,t){return m(n(e),t)},\"BigNumber, Fraction\":function(e,t){return m(e,n(t))},\"Complex, Complex\":function(e,t){throw new TypeError(\"No ordering relation is defined for complex numbers\")}},p,f({SS:l,DS:u,Ss:c}))}),il=s(rl,[\"typed\",\"config\"],e=>{let{typed:t,config:r}=e;return t(rl,{\"number, number\":function(e,t){return e{let{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e;const s=Pa({typed:t}),u=ko({typed:t,SparseMatrix:o}),l=x({typed:t,DenseMatrix:i}),c=C({typed:t,matrix:n,concat:a}),f=wi({typed:t});return t(al,sl({typed:t,config:r}),{\"boolean, boolean\":(e,t)=>e<=t,\"BigNumber, BigNumber\":function(e,t){return e.lte(t)||li(e,t,r.relTol,r.absTol)},\"bigint, bigint\":(e,t)=>e<=t,\"Fraction, Fraction\":(e,t)=>1!==e.compare(t),\"Complex, Complex\":function(){throw new TypeError(\"No ordering relation is defined for complex numbers\")}},f,c({SS:u,DS:s,Ss:l}))}),sl=s(al,[\"typed\",\"config\"],e=>{let{typed:t,config:r}=e;return t(al,{\"number, number\":function(e,t){return e<=t||Xe(e,t,r.relTol,r.absTol)}})}),ul=\"larger\",ll=s(ul,[\"typed\",\"config\",\"bignumber\",\"matrix\",\"DenseMatrix\",\"concat\",\"SparseMatrix\"],e=>{let{typed:t,config:r,bignumber:n,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e;const u=Pa({typed:t}),l=ko({typed:t,SparseMatrix:s}),c=x({typed:t,DenseMatrix:a}),f=C({typed:t,matrix:i,concat:o}),p=wi({typed:t});function m(e,t){return e.gt(t)&&!li(e,t,r.relTol,r.absTol)}return t(ul,cl({typed:t,config:r}),{\"boolean, boolean\":(e,t)=>tt1===e.compare(t),\"Fraction, BigNumber\":function(e,t){return m(n(e),t)},\"BigNumber, Fraction\":function(e,t){return m(e,n(t))},\"Complex, Complex\":function(){throw new TypeError(\"No ordering relation is defined for complex numbers\")}},p,f({SS:l,DS:u,Ss:c}))}),cl=s(ul,[\"typed\",\"config\"],e=>{let{typed:t,config:r}=e;return t(ul,{\"number, number\":function(e,t){return t{let{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e;const s=Pa({typed:t}),u=ko({typed:t,SparseMatrix:o}),l=x({typed:t,DenseMatrix:i}),c=C({typed:t,matrix:n,concat:a}),f=wi({typed:t});return t(fl,ml({typed:t,config:r}),{\"boolean, boolean\":(e,t)=>t<=e,\"BigNumber, BigNumber\":function(e,t){return e.gte(t)||li(e,t,r.relTol,r.absTol)},\"bigint, bigint\":function(e,t){return t<=e},\"Fraction, Fraction\":(e,t)=>-1!==e.compare(t),\"Complex, Complex\":function(){throw new TypeError(\"No ordering relation is defined for complex numbers\")}},f,c({SS:u,DS:s,Ss:l}))}),ml=s(fl,[\"typed\",\"config\"],e=>{let{typed:t,config:r}=e;return t(fl,{\"number, number\":function(e,t){return t<=e||Xe(e,t,r.relTol,r.absTol)}})}),hl=\"deepEqual\",dl=s(hl,[\"typed\",\"equal\"],e=>{let{typed:t,equal:i}=e;return t(hl,{\"any, any\":function(e,t){return function t(r,n){if(Array.isArray(r)){if(Array.isArray(n)){const i=r.length;if(i!==n.length)return!1;for(let e=0;e{let{typed:t,equalScalar:r,matrix:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e;const s=Pa({typed:t}),u=ko({typed:t,SparseMatrix:o}),l=x({typed:t,DenseMatrix:i}),c=C({typed:t,matrix:n,concat:a});return t(gl,xl({typed:t,equalScalar:r}),c({elop:function(e,t){return!r(e,t)},SS:u,DS:s,Ss:l}))}),xl=s(gl,[\"typed\",\"equalScalar\"],e=>{let{typed:t,equalScalar:r}=e;return t(gl,{\"any, any\":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:!r(e,t)}})}),bl=\"partitionSelect\",vl=s(bl,[\"typed\",\"isNumeric\",\"isNaN\",\"compare\"],e=>{let{typed:t,isNumeric:u,isNaN:l,compare:r}=e;const n=r,i=(e,t)=>-r(e,t);return t(bl,{\"Array | Matrix, number\":function(e,t){return a(e,t,n)},\"Array | Matrix, number, string\":function(e,t,r){if(\"asc\"===r)return a(e,t,n);if(\"desc\"===r)return a(e,t,i);throw new Error('Compare string must be \"asc\" or \"desc\"')},\"Array | Matrix, number, function\":a});function a(e,t,r){if(!v(t)||t<0)throw new Error(\"k must be a non-negative integer\");if(_(e)){if(1=r.length)throw new Error(\"k out of bounds\");for(let e=0;e{let{typed:t,matrix:r,compare:n,compareNatural:i}=e;const a=n,o=(e,t)=>-n(e,t);return t(\"sort\",{Array:function(e){return u(e),e.sort(a)},Matrix:function(e){return l(e),r(e.toArray().sort(a),e.storage())},\"Array, function\":function(e,t){return u(e),e.sort(t)},\"Matrix, function\":function(e,t){return l(e),r(e.toArray().sort(t),e.storage())},\"Array, string\":function(e,t){return u(e),e.sort(s(t))},\"Matrix, string\":function(e,t){return l(e),r(e.toArray().sort(s(t)),e.storage())}});function s(e){if(\"asc\"===e)return a;if(\"desc\"===e)return o;if(\"natural\"===e)return i;throw new Error('String \"asc\", \"desc\", or \"natural\" expected')}function u(e){if(1!==T(e).length)throw new Error(\"One dimensional array expected\")}function l(e){if(1!==e.size().length)throw new Error(\"One dimensional matrix expected\")}}),Nl=s(\"max\",[\"typed\",\"config\",\"numeric\",\"larger\",\"isNaN\"],e=>{let{typed:t,config:n,numeric:i,larger:a,isNaN:o}=e;return t(\"max\",{\"Array | Matrix\":s,\"Array | Matrix, number | BigNumber\":function(e,t){return ri(e,t.valueOf(),r)},\"...\":function(e){if(ei(e))throw new TypeError(\"Scalar values expected in function max\");return s(e)}});function r(e,t){try{return a(e,t)?e:t}catch(e){throw eu(e,\"max\",t)}}function s(e){let r;if(ti(e,function(t){try{(o(t)||void 0===r||a(t,r))&&(r=t)}catch(e){throw eu(e,\"max\",t)}}),void 0===r)throw new Error(\"Cannot calculate max of an empty array\");return r=\"string\"==typeof r?i(r,Ie(r,n)):r}}),Al=s(\"min\",[\"typed\",\"config\",\"numeric\",\"smaller\",\"isNaN\"],e=>{let{typed:t,config:n,numeric:i,smaller:a,isNaN:o}=e;return t(\"min\",{\"Array | Matrix\":s,\"Array | Matrix, number | BigNumber\":function(e,t){return ri(e,t.valueOf(),r)},\"...\":function(e){if(ei(e))throw new TypeError(\"Scalar values expected in function min\");return s(e)}});function r(e,t){try{return a(e,t)?e:t}catch(e){throw eu(e,\"min\",t)}}function s(e){let r;if(ti(e,function(t){try{(o(t)||void 0===r||a(t,r))&&(r=t)}catch(e){throw eu(e,\"min\",t)}}),void 0===r)throw new Error(\"Cannot calculate min of an empty array\");return r=\"string\"==typeof r?i(r,Ie(r,n)):r}}),El=s(\"ImmutableDenseMatrix\",[\"smaller\",\"DenseMatrix\"],e=>{let{smaller:r,DenseMatrix:n}=e;function i(e,t){if(!(this instanceof i))throw new SyntaxError(\"Constructor must be called with the new operator\");if(t&&!j(t))throw new Error(\"Invalid datatype: \"+t);if(_(e)||b(e)){const i=new n(e,t);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(e&&b(e.data)&&b(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError(\"Unsupported type of data (\"+K(e)+\")\");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return i.prototype=new n,i.prototype.type=\"ImmutableDenseMatrix\",i.prototype.isImmutableDenseMatrix=!0,i.prototype.subset=function(e){switch(arguments.length){case 1:var t=n.prototype.subset.call(this,e);return _(t)?new i({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error(\"Cannot invoke set subset on an Immutable Matrix instance\");default:throw new SyntaxError(\"Wrong number of arguments\")}},i.prototype.set=function(){throw new Error(\"Cannot invoke set on an Immutable Matrix instance\")},i.prototype.resize=function(){throw new Error(\"Cannot invoke resize on an Immutable Matrix instance\")},i.prototype.reshape=function(){throw new Error(\"Cannot invoke reshape on an Immutable Matrix instance\")},i.prototype.clone=function(){return new i({data:ee(this._data),size:ee(this._size),datatype:this._datatype})},i.prototype.toJSON=function(){return{mathjs:\"ImmutableDenseMatrix\",data:this._data,size:this._size,datatype:this._datatype}},i.fromJSON=function(e){return new i(e)},i.prototype.swapRows=function(){throw new Error(\"Cannot invoke swapRows on an Immutable Matrix instance\")},i.prototype.min=function(){if(null===this._min){let t=null;this.forEach(function(e){null!==t&&!r(e,t)||(t=e)}),this._min=null!==t?t:void 0}return this._min},i.prototype.max=function(){if(null===this._max){let t=null;this.forEach(function(e){null!==t&&!r(t,e)||(t=e)}),this._max=null!==t?t:void 0}return this._max},i},{isClass:!0}),Sl=s(\"Index\",[\"ImmutableDenseMatrix\",\"getMatrixDataType\"],e=>{let{ImmutableDenseMatrix:t,getMatrixDataType:o}=e;function s(e){if(!(this instanceof s))throw new SyntaxError(\"Constructor must be called with the new operator\");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(let e=0,t=arguments.length;e{e&&r.push(t)}),r}const Cl=s(\"FibonacciHeap\",[\"smaller\",\"larger\"],e=>{let{smaller:s,larger:u}=e;const l=1/Math.log((1+Math.sqrt(5))/2);function t(){if(!(this instanceof t))throw new SyntaxError(\"Constructor must be called with the new operator\");this._minimum=null,this._size=0}function i(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,((e.right=t).right.left=t).parent=null,t.mark=!1}t.prototype.type=\"FibonacciHeap\",t.prototype.isFibonacciHeap=!0,t.prototype.insert=function(e,t){const r={key:e,value:t,degree:0};if(this._minimum){const t=this._minimum;r.left=t,r.right=t.right,(t.right=r).right.left=r,s(e,t.key)&&(this._minimum=r)}else(r.left=r).right=r,this._minimum=r;return this._size++,r},t.prototype.size=function(){return this._size},t.prototype.clear=function(){this._minimum=null,this._size=0},t.prototype.isEmpty=function(){return 0===this._size},t.prototype.extractMinimum=function(){const e=this._minimum;if(null===e)return e;let t=this._minimum,r=e.degree,n=e.child;for(;0{let{addScalar:n,equalScalar:s,FibonacciHeap:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError(\"Constructor must be called with the new operator\");this._values=[],this._heap=new t}return r.prototype.type=\"Spa\",r.prototype.isSpa=!0,r.prototype.set=function(e,t){this._values[e]?this._values[e].value=t:(t=this._heap.insert(e,t),this._values[e]=t)},r.prototype.get=function(e){e=this._values[e];return e?e.value:0},r.prototype.accumulate=function(e,t){let r=this._values[e];r?r.value=n(r.value,t):(r=this._heap.insert(e,t),this._values[e]=r)},r.prototype.forEach=function(e,t,r){const n=this._heap,i=this._values,a=[];let o=n.extractMinimum();for(o&&a.push(o);o&&o.key<=t;)o.key>=e&&(s(o.value,0)||r(o.key,o.value,this)),(o=n.extractMinimum())&&a.push(o);for(let e=0;e{let{on:t,config:c,addScalar:l,subtractScalar:f,multiplyScalar:p,divideScalar:o,pow:s,abs:u,fix:m,round:I,equal:h,isNumeric:k,format:R,number:r,Complex:P,BigNumber:d,Fraction:g}=e;const U=r;function y(e,t){if(!(this instanceof y))throw new Error(\"Constructor must be called with the new operator\");if(null!=e&&!k(e)&&!te(e))throw new TypeError(\"First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined\");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,void 0===t)this.units=[],this.dimensions=B.map(e=>0);else if(\"string\"==typeof t){const e=y.parse(t);this.units=e.units,this.dimensions=e.dimensions}else{if(!L(t)||null!==t.value)throw new TypeError(\"Second parameter in Unit constructor must be a string or valueless Unit\");this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map(e=>gn({},e))}this.value=this._normalize(e)}let x,b,v;function w(){for(;\" \"===v||\"\\t\"===v;)A()}function N(e){return\"0\"<=e&&e<=\"9\"}function A(){b++,v=x.charAt(b)}function n(e){b=e,v=x.charAt(b)}function E(){let t=\"\";var e=b;if(\"+\"===v?A():\"-\"===v&&(t+=v,A()),!(\"0\"<=(r=v)&&r<=\"9\"||\".\"===r))return n(e),null;if(\".\"===v){if(t+=v,A(),!N(v))return n(e),null}else{for(;N(v);)t+=v,A();\".\"===v&&(t+=v,A())}for(;N(v);)t+=v,A();if(\"E\"===v||\"e\"===v){let e=\"\";var r=b;if(e+=v,A(),\"+\"!==v&&\"-\"!==v||(e+=v,A()),!N(v))return n(r),t;for(t+=e;N(v);)t+=v,A()}return t}function S(e){return v===e&&(A(),e)}Object.defineProperty(y,\"name\",{value:\"Unit\"}),(y.prototype.constructor=y).prototype.type=\"Unit\",y.prototype.isUnit=!0,y.parse=function(e,r){if(r=r||{},x=e,b=-1,v=\"\",\"string\"!=typeof x)throw new TypeError(\"Invalid argument in Unit.parse, string expected\");const n=new y;let i=1,a=!(n.units=[]);A(),w();var o,t=E();let s=null;if(t){if(\"BigNumber\"===c.number)s=new d(t);else if(\"Fraction\"===c.number)try{s=new g(t)}catch(e){s=parseFloat(t)}else s=parseFloat(t);w(),S(\"*\")?(i=1,a=!0):S(\"/\")&&(i=-1,a=!0)}const u=[];let l=1;for(;;){for(w();\"(\"===v;)u.push(i),l*=i,i=1,A(),w();if(!v)break;{const e=v;if(null===(o=function(){let e=\"\";for(;N(v)||y.isValidAlpha(v);)e+=v,A();var t=e.charAt(0);return y.isValidAlpha(t)?e:null}()))throw new SyntaxError('Unexpected \"'+e+'\" in \"'+x+'\" at index '+b.toString())}const c=M(o);if(null===c)throw new SyntaxError('Unit \"'+o+'\" not found.');let t=i*l;if(w(),S(\"^\")){w();const r=E();if(null===r)throw new SyntaxError('In \"'+e+'\", \"^\" must be followed by a floating-point number');t*=r}n.units.push({unit:c.unit,prefix:c.prefix,power:t});for(let e=0;e{var t;if(ue(D,e))return{unit:t=D[e],prefix:t.prefixes[\"\"]};for(const o in D)if(ue(D,o)&&(r=e,a=o,n=void 0,i=void 0,n=r.length-a.length,i=r.length,r.substring(n,i)===a)){var r=D[o],n=e.length-o.length,i=e.substring(0,n),a=ue(r.prefixes,i)?r.prefixes[i]:void 0;if(void 0!==a)return{unit:r,prefix:a}}return null},{hasher:e=>e[0],limit:100});function a(e){return e.equalBase(F.NONE)&&null!==e.value&&!c.predictable?e.value:e}function C(e){return y._getNumberConverter(K(e))(1)}function i(e,t){t=1{let t=null;if(\"string\"==typeof e){if(!(t=y.parse(e)))throw new Error(\"Invalid unit type. Expected compatible string or Unit.\")}else if(!L(e))throw new Error(\"Invalid unit type. Expected compatible string or Unit.\");null===t&&(t=e.clone());try{return this.to(t.formatUnits()),t}catch(e){throw new Error(\"Invalid unit type. Expected compatible string or Unit.\")}}).map(e=>e.units[0].prefix);this.units[0].unit.prefixes=t.reduce((e,t)=>(e[t.name]=t,e),{}),this.units[0].prefix=t[0]}const n=i(this,t).simp;return this.units[0].unit.prefixes=r,n.fixPrefix=!0,n},y.prototype.format=function(e){var{simp:e,valueStr:t,unitStr:r}=i(this,e);let n=t;return e.value&&te(e.value)&&(n=\"(\"+n+\")\"),00)},D={meter:{name:\"meter\",base:F.LENGTH,prefixes:T.LONG,value:1,offset:0},inch:{name:\"inch\",base:F.LENGTH,prefixes:T.NONE,value:.0254,offset:0},foot:{name:\"foot\",base:F.LENGTH,prefixes:T.NONE,value:.3048,offset:0},yard:{name:\"yard\",base:F.LENGTH,prefixes:T.NONE,value:.9144,offset:0},mile:{name:\"mile\",base:F.LENGTH,prefixes:T.NONE,value:1609.344,offset:0},link:{name:\"link\",base:F.LENGTH,prefixes:T.NONE,value:.201168,offset:0},rod:{name:\"rod\",base:F.LENGTH,prefixes:T.NONE,value:5.0292,offset:0},chain:{name:\"chain\",base:F.LENGTH,prefixes:T.NONE,value:20.1168,offset:0},angstrom:{name:\"angstrom\",base:F.LENGTH,prefixes:T.NONE,value:1e-10,offset:0},m:{name:\"m\",base:F.LENGTH,prefixes:T.SHORT,value:1,offset:0},in:{name:\"in\",base:F.LENGTH,prefixes:T.NONE,value:.0254,offset:0},ft:{name:\"ft\",base:F.LENGTH,prefixes:T.NONE,value:.3048,offset:0},yd:{name:\"yd\",base:F.LENGTH,prefixes:T.NONE,value:.9144,offset:0},mi:{name:\"mi\",base:F.LENGTH,prefixes:T.NONE,value:1609.344,offset:0},li:{name:\"li\",base:F.LENGTH,prefixes:T.NONE,value:.201168,offset:0},rd:{name:\"rd\",base:F.LENGTH,prefixes:T.NONE,value:5.02921,offset:0},ch:{name:\"ch\",base:F.LENGTH,prefixes:T.NONE,value:20.1168,offset:0},mil:{name:\"mil\",base:F.LENGTH,prefixes:T.NONE,value:254e-7,offset:0},m2:{name:\"m2\",base:F.SURFACE,prefixes:T.SQUARED,value:1,offset:0},sqin:{name:\"sqin\",base:F.SURFACE,prefixes:T.NONE,value:64516e-8,offset:0},sqft:{name:\"sqft\",base:F.SURFACE,prefixes:T.NONE,value:.09290304,offset:0},sqyd:{name:\"sqyd\",base:F.SURFACE,prefixes:T.NONE,value:.83612736,offset:0},sqmi:{name:\"sqmi\",base:F.SURFACE,prefixes:T.NONE,value:2589988.110336,offset:0},sqrd:{name:\"sqrd\",base:F.SURFACE,prefixes:T.NONE,value:25.29295,offset:0},sqch:{name:\"sqch\",base:F.SURFACE,prefixes:T.NONE,value:404.6873,offset:0},sqmil:{name:\"sqmil\",base:F.SURFACE,prefixes:T.NONE,value:6.4516e-10,offset:0},acre:{name:\"acre\",base:F.SURFACE,prefixes:T.NONE,value:4046.86,offset:0},hectare:{name:\"hectare\",base:F.SURFACE,prefixes:T.NONE,value:1e4,offset:0},m3:{name:\"m3\",base:F.VOLUME,prefixes:T.CUBIC,value:1,offset:0},L:{name:\"L\",base:F.VOLUME,prefixes:T.SHORT,value:.001,offset:0},l:{name:\"l\",base:F.VOLUME,prefixes:T.SHORT,value:.001,offset:0},litre:{name:\"litre\",base:F.VOLUME,prefixes:T.LONG,value:.001,offset:0},cuin:{name:\"cuin\",base:F.VOLUME,prefixes:T.NONE,value:16387064e-12,offset:0},cuft:{name:\"cuft\",base:F.VOLUME,prefixes:T.NONE,value:.028316846592,offset:0},cuyd:{name:\"cuyd\",base:F.VOLUME,prefixes:T.NONE,value:.764554857984,offset:0},teaspoon:{name:\"teaspoon\",base:F.VOLUME,prefixes:T.NONE,value:5e-6,offset:0},tablespoon:{name:\"tablespoon\",base:F.VOLUME,prefixes:T.NONE,value:15e-6,offset:0},drop:{name:\"drop\",base:F.VOLUME,prefixes:T.NONE,value:5e-8,offset:0},gtt:{name:\"gtt\",base:F.VOLUME,prefixes:T.NONE,value:5e-8,offset:0},minim:{name:\"minim\",base:F.VOLUME,prefixes:T.NONE,value:6.1611519921875e-8,offset:0},fluiddram:{name:\"fluiddram\",base:F.VOLUME,prefixes:T.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:\"fluidounce\",base:F.VOLUME,prefixes:T.NONE,value:295735295625e-16,offset:0},gill:{name:\"gill\",base:F.VOLUME,prefixes:T.NONE,value:.00011829411825,offset:0},cc:{name:\"cc\",base:F.VOLUME,prefixes:T.NONE,value:1e-6,offset:0},cup:{name:\"cup\",base:F.VOLUME,prefixes:T.NONE,value:.0002365882365,offset:0},pint:{name:\"pint\",base:F.VOLUME,prefixes:T.NONE,value:.000473176473,offset:0},quart:{name:\"quart\",base:F.VOLUME,prefixes:T.NONE,value:.000946352946,offset:0},gallon:{name:\"gallon\",base:F.VOLUME,prefixes:T.NONE,value:.003785411784,offset:0},beerbarrel:{name:\"beerbarrel\",base:F.VOLUME,prefixes:T.NONE,value:.117347765304,offset:0},oilbarrel:{name:\"oilbarrel\",base:F.VOLUME,prefixes:T.NONE,value:.158987294928,offset:0},hogshead:{name:\"hogshead\",base:F.VOLUME,prefixes:T.NONE,value:.238480942392,offset:0},g:{name:\"g\",base:F.MASS,prefixes:T.SHORT,value:.001,offset:0},gram:{name:\"gram\",base:F.MASS,prefixes:T.LONG,value:.001,offset:0},ton:{name:\"ton\",base:F.MASS,prefixes:T.SHORT,value:907.18474,offset:0},t:{name:\"t\",base:F.MASS,prefixes:T.SHORT,value:1e3,offset:0},tonne:{name:\"tonne\",base:F.MASS,prefixes:T.LONG,value:1e3,offset:0},grain:{name:\"grain\",base:F.MASS,prefixes:T.NONE,value:6479891e-11,offset:0},dram:{name:\"dram\",base:F.MASS,prefixes:T.NONE,value:.0017718451953125,offset:0},ounce:{name:\"ounce\",base:F.MASS,prefixes:T.NONE,value:.028349523125,offset:0},poundmass:{name:\"poundmass\",base:F.MASS,prefixes:T.NONE,value:.45359237,offset:0},hundredweight:{name:\"hundredweight\",base:F.MASS,prefixes:T.NONE,value:45.359237,offset:0},stick:{name:\"stick\",base:F.MASS,prefixes:T.NONE,value:.115,offset:0},stone:{name:\"stone\",base:F.MASS,prefixes:T.NONE,value:6.35029318,offset:0},gr:{name:\"gr\",base:F.MASS,prefixes:T.NONE,value:6479891e-11,offset:0},dr:{name:\"dr\",base:F.MASS,prefixes:T.NONE,value:.0017718451953125,offset:0},oz:{name:\"oz\",base:F.MASS,prefixes:T.NONE,value:.028349523125,offset:0},lbm:{name:\"lbm\",base:F.MASS,prefixes:T.NONE,value:.45359237,offset:0},cwt:{name:\"cwt\",base:F.MASS,prefixes:T.NONE,value:45.359237,offset:0},s:{name:\"s\",base:F.TIME,prefixes:T.SHORT,value:1,offset:0},min:{name:\"min\",base:F.TIME,prefixes:T.NONE,value:60,offset:0},h:{name:\"h\",base:F.TIME,prefixes:T.NONE,value:3600,offset:0},second:{name:\"second\",base:F.TIME,prefixes:T.LONG,value:1,offset:0},sec:{name:\"sec\",base:F.TIME,prefixes:T.LONG,value:1,offset:0},minute:{name:\"minute\",base:F.TIME,prefixes:T.NONE,value:60,offset:0},hour:{name:\"hour\",base:F.TIME,prefixes:T.NONE,value:3600,offset:0},day:{name:\"day\",base:F.TIME,prefixes:T.NONE,value:86400,offset:0},week:{name:\"week\",base:F.TIME,prefixes:T.NONE,value:604800,offset:0},month:{name:\"month\",base:F.TIME,prefixes:T.NONE,value:2629800,offset:0},year:{name:\"year\",base:F.TIME,prefixes:T.NONE,value:31557600,offset:0},decade:{name:\"decade\",base:F.TIME,prefixes:T.NONE,value:315576e3,offset:0},century:{name:\"century\",base:F.TIME,prefixes:T.NONE,value:315576e4,offset:0},millennium:{name:\"millennium\",base:F.TIME,prefixes:T.NONE,value:315576e5,offset:0},hertz:{name:\"Hertz\",base:F.FREQUENCY,prefixes:T.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:\"Hz\",base:F.FREQUENCY,prefixes:T.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:\"rad\",base:F.ANGLE,prefixes:T.SHORT,value:1,offset:0},radian:{name:\"radian\",base:F.ANGLE,prefixes:T.LONG,value:1,offset:0},deg:{name:\"deg\",base:F.ANGLE,prefixes:T.SHORT,value:null,offset:0},degree:{name:\"degree\",base:F.ANGLE,prefixes:T.LONG,value:null,offset:0},grad:{name:\"grad\",base:F.ANGLE,prefixes:T.SHORT,value:null,offset:0},gradian:{name:\"gradian\",base:F.ANGLE,prefixes:T.LONG,value:null,offset:0},cycle:{name:\"cycle\",base:F.ANGLE,prefixes:T.NONE,value:null,offset:0},arcsec:{name:\"arcsec\",base:F.ANGLE,prefixes:T.NONE,value:null,offset:0},arcmin:{name:\"arcmin\",base:F.ANGLE,prefixes:T.NONE,value:null,offset:0},A:{name:\"A\",base:F.CURRENT,prefixes:T.SHORT,value:1,offset:0},ampere:{name:\"ampere\",base:F.CURRENT,prefixes:T.LONG,value:1,offset:0},K:{name:\"K\",base:F.TEMPERATURE,prefixes:T.SHORT,value:1,offset:0},degC:{name:\"degC\",base:F.TEMPERATURE,prefixes:T.SHORT,value:1,offset:273.15},degF:{name:\"degF\",base:F.TEMPERATURE,prefixes:T.SHORT,value:new g(5,9),offset:459.67},degR:{name:\"degR\",base:F.TEMPERATURE,prefixes:T.SHORT,value:new g(5,9),offset:0},kelvin:{name:\"kelvin\",base:F.TEMPERATURE,prefixes:T.LONG,value:1,offset:0},celsius:{name:\"celsius\",base:F.TEMPERATURE,prefixes:T.LONG,value:1,offset:273.15},fahrenheit:{name:\"fahrenheit\",base:F.TEMPERATURE,prefixes:T.LONG,value:new g(5,9),offset:459.67},rankine:{name:\"rankine\",base:F.TEMPERATURE,prefixes:T.LONG,value:new g(5,9),offset:0},mol:{name:\"mol\",base:F.AMOUNT_OF_SUBSTANCE,prefixes:T.SHORT,value:1,offset:0},mole:{name:\"mole\",base:F.AMOUNT_OF_SUBSTANCE,prefixes:T.LONG,value:1,offset:0},cd:{name:\"cd\",base:F.LUMINOUS_INTENSITY,prefixes:T.SHORT,value:1,offset:0},candela:{name:\"candela\",base:F.LUMINOUS_INTENSITY,prefixes:T.LONG,value:1,offset:0},N:{name:\"N\",base:F.FORCE,prefixes:T.SHORT,value:1,offset:0},newton:{name:\"newton\",base:F.FORCE,prefixes:T.LONG,value:1,offset:0},dyn:{name:\"dyn\",base:F.FORCE,prefixes:T.SHORT,value:1e-5,offset:0},dyne:{name:\"dyne\",base:F.FORCE,prefixes:T.LONG,value:1e-5,offset:0},lbf:{name:\"lbf\",base:F.FORCE,prefixes:T.NONE,value:4.4482216152605,offset:0},poundforce:{name:\"poundforce\",base:F.FORCE,prefixes:T.NONE,value:4.4482216152605,offset:0},kip:{name:\"kip\",base:F.FORCE,prefixes:T.LONG,value:4448.2216,offset:0},kilogramforce:{name:\"kilogramforce\",base:F.FORCE,prefixes:T.NONE,value:9.80665,offset:0},J:{name:\"J\",base:F.ENERGY,prefixes:T.SHORT,value:1,offset:0},joule:{name:\"joule\",base:F.ENERGY,prefixes:T.LONG,value:1,offset:0},erg:{name:\"erg\",base:F.ENERGY,prefixes:T.SHORTLONG,value:1e-7,offset:0},Wh:{name:\"Wh\",base:F.ENERGY,prefixes:T.SHORT,value:3600,offset:0},BTU:{name:\"BTU\",base:F.ENERGY,prefixes:T.BTU,value:1055.05585262,offset:0},eV:{name:\"eV\",base:F.ENERGY,prefixes:T.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:\"electronvolt\",base:F.ENERGY,prefixes:T.LONG,value:1602176565e-28,offset:0},W:{name:\"W\",base:F.POWER,prefixes:T.SHORT,value:1,offset:0},watt:{name:\"watt\",base:F.POWER,prefixes:T.LONG,value:1,offset:0},hp:{name:\"hp\",base:F.POWER,prefixes:T.NONE,value:745.6998715386,offset:0},VAR:{name:\"VAR\",base:F.POWER,prefixes:T.SHORT,value:P.I,offset:0},VA:{name:\"VA\",base:F.POWER,prefixes:T.SHORT,value:1,offset:0},Pa:{name:\"Pa\",base:F.PRESSURE,prefixes:T.SHORT,value:1,offset:0},psi:{name:\"psi\",base:F.PRESSURE,prefixes:T.NONE,value:6894.75729276459,offset:0},atm:{name:\"atm\",base:F.PRESSURE,prefixes:T.NONE,value:101325,offset:0},bar:{name:\"bar\",base:F.PRESSURE,prefixes:T.SHORTLONG,value:1e5,offset:0},torr:{name:\"torr\",base:F.PRESSURE,prefixes:T.NONE,value:133.322,offset:0},mmHg:{name:\"mmHg\",base:F.PRESSURE,prefixes:T.NONE,value:133.322,offset:0},mmH2O:{name:\"mmH2O\",base:F.PRESSURE,prefixes:T.NONE,value:9.80665,offset:0},cmH2O:{name:\"cmH2O\",base:F.PRESSURE,prefixes:T.NONE,value:98.0665,offset:0},coulomb:{name:\"coulomb\",base:F.ELECTRIC_CHARGE,prefixes:T.LONG,value:1,offset:0},C:{name:\"C\",base:F.ELECTRIC_CHARGE,prefixes:T.SHORT,value:1,offset:0},farad:{name:\"farad\",base:F.ELECTRIC_CAPACITANCE,prefixes:T.LONG,value:1,offset:0},F:{name:\"F\",base:F.ELECTRIC_CAPACITANCE,prefixes:T.SHORT,value:1,offset:0},volt:{name:\"volt\",base:F.ELECTRIC_POTENTIAL,prefixes:T.LONG,value:1,offset:0},V:{name:\"V\",base:F.ELECTRIC_POTENTIAL,prefixes:T.SHORT,value:1,offset:0},ohm:{name:\"ohm\",base:F.ELECTRIC_RESISTANCE,prefixes:T.SHORTLONG,value:1,offset:0},henry:{name:\"henry\",base:F.ELECTRIC_INDUCTANCE,prefixes:T.LONG,value:1,offset:0},H:{name:\"H\",base:F.ELECTRIC_INDUCTANCE,prefixes:T.SHORT,value:1,offset:0},siemens:{name:\"siemens\",base:F.ELECTRIC_CONDUCTANCE,prefixes:T.LONG,value:1,offset:0},S:{name:\"S\",base:F.ELECTRIC_CONDUCTANCE,prefixes:T.SHORT,value:1,offset:0},weber:{name:\"weber\",base:F.MAGNETIC_FLUX,prefixes:T.LONG,value:1,offset:0},Wb:{name:\"Wb\",base:F.MAGNETIC_FLUX,prefixes:T.SHORT,value:1,offset:0},tesla:{name:\"tesla\",base:F.MAGNETIC_FLUX_DENSITY,prefixes:T.LONG,value:1,offset:0},T:{name:\"T\",base:F.MAGNETIC_FLUX_DENSITY,prefixes:T.SHORT,value:1,offset:0},b:{name:\"b\",base:F.BIT,prefixes:T.BINARY_SHORT,value:1,offset:0},bits:{name:\"bits\",base:F.BIT,prefixes:T.BINARY_LONG,value:1,offset:0},B:{name:\"B\",base:F.BIT,prefixes:T.BINARY_SHORT,value:8,offset:0},bytes:{name:\"bytes\",base:F.BIT,prefixes:T.BINARY_LONG,value:8,offset:0}},O={meters:\"meter\",inches:\"inch\",feet:\"foot\",yards:\"yard\",miles:\"mile\",links:\"link\",rods:\"rod\",chains:\"chain\",angstroms:\"angstrom\",lt:\"l\",litres:\"litre\",liter:\"litre\",liters:\"litre\",teaspoons:\"teaspoon\",tablespoons:\"tablespoon\",minims:\"minim\",fldr:\"fluiddram\",fluiddrams:\"fluiddram\",floz:\"fluidounce\",fluidounces:\"fluidounce\",gi:\"gill\",gills:\"gill\",cp:\"cup\",cups:\"cup\",pt:\"pint\",pints:\"pint\",qt:\"quart\",quarts:\"quart\",gal:\"gallon\",gallons:\"gallon\",bbl:\"beerbarrel\",beerbarrels:\"beerbarrel\",obl:\"oilbarrel\",oilbarrels:\"oilbarrel\",hogsheads:\"hogshead\",gtts:\"gtt\",grams:\"gram\",tons:\"ton\",tonnes:\"tonne\",grains:\"grain\",drams:\"dram\",ounces:\"ounce\",poundmasses:\"poundmass\",hundredweights:\"hundredweight\",sticks:\"stick\",lb:\"lbm\",lbs:\"lbm\",kips:\"kip\",kgf:\"kilogramforce\",acres:\"acre\",hectares:\"hectare\",sqfeet:\"sqft\",sqyard:\"sqyd\",sqmile:\"sqmi\",sqmiles:\"sqmi\",mmhg:\"mmHg\",mmh2o:\"mmH2O\",cmh2o:\"cmH2O\",seconds:\"second\",secs:\"second\",minutes:\"minute\",mins:\"minute\",hours:\"hour\",hr:\"hour\",hrs:\"hour\",days:\"day\",weeks:\"week\",months:\"month\",years:\"year\",decades:\"decade\",centuries:\"century\",millennia:\"millennium\",hertz:\"hertz\",radians:\"radian\",degrees:\"degree\",gradians:\"gradian\",cycles:\"cycle\",arcsecond:\"arcsec\",arcseconds:\"arcsec\",arcminute:\"arcmin\",arcminutes:\"arcmin\",BTUs:\"BTU\",watts:\"watt\",joules:\"joule\",amperes:\"ampere\",amps:\"ampere\",amp:\"ampere\",coulombs:\"coulomb\",volts:\"volt\",ohms:\"ohm\",farads:\"farad\",webers:\"weber\",teslas:\"tesla\",electronvolts:\"electronvolt\",moles:\"mole\",bit:\"bits\",byte:\"bytes\"};function _(e){if(\"BigNumber\"===e.number){const e=_l(d);D.rad.value=new d(1),D.deg.value=e.div(180),D.grad.value=e.div(200),D.cycle.value=e.times(2),D.arcsec.value=e.div(648e3),D.arcmin.value=e.div(10800)}else D.rad.value=1,D.deg.value=Math.PI/180,D.grad.value=Math.PI/200,D.cycle.value=2*Math.PI,D.arcsec.value=Math.PI/648e3,D.arcmin.value=Math.PI/10800;D.radian.value=D.rad.value,D.degree.value=D.deg.value,D.gradian.value=D.grad.value}_(c),t&&t(\"config\",function(e,t){e.number!==t.number&&_(e)});const z={si:{NONE:{unit:j,prefix:T.NONE[\"\"]},LENGTH:{unit:D.m,prefix:T.SHORT[\"\"]},MASS:{unit:D.g,prefix:T.SHORT.k},TIME:{unit:D.s,prefix:T.SHORT[\"\"]},CURRENT:{unit:D.A,prefix:T.SHORT[\"\"]},TEMPERATURE:{unit:D.K,prefix:T.SHORT[\"\"]},LUMINOUS_INTENSITY:{unit:D.cd,prefix:T.SHORT[\"\"]},AMOUNT_OF_SUBSTANCE:{unit:D.mol,prefix:T.SHORT[\"\"]},ANGLE:{unit:D.rad,prefix:T.SHORT[\"\"]},BIT:{unit:D.bits,prefix:T.SHORT[\"\"]},FORCE:{unit:D.N,prefix:T.SHORT[\"\"]},ENERGY:{unit:D.J,prefix:T.SHORT[\"\"]},POWER:{unit:D.W,prefix:T.SHORT[\"\"]},PRESSURE:{unit:D.Pa,prefix:T.SHORT[\"\"]},ELECTRIC_CHARGE:{unit:D.C,prefix:T.SHORT[\"\"]},ELECTRIC_CAPACITANCE:{unit:D.F,prefix:T.SHORT[\"\"]},ELECTRIC_POTENTIAL:{unit:D.V,prefix:T.SHORT[\"\"]},ELECTRIC_RESISTANCE:{unit:D.ohm,prefix:T.SHORT[\"\"]},ELECTRIC_INDUCTANCE:{unit:D.H,prefix:T.SHORT[\"\"]},ELECTRIC_CONDUCTANCE:{unit:D.S,prefix:T.SHORT[\"\"]},MAGNETIC_FLUX:{unit:D.Wb,prefix:T.SHORT[\"\"]},MAGNETIC_FLUX_DENSITY:{unit:D.T,prefix:T.SHORT[\"\"]},FREQUENCY:{unit:D.Hz,prefix:T.SHORT[\"\"]}}};z.cgs=JSON.parse(JSON.stringify(z.si)),z.cgs.LENGTH={unit:D.m,prefix:T.SHORT.c},z.cgs.MASS={unit:D.g,prefix:T.SHORT[\"\"]},z.cgs.FORCE={unit:D.dyn,prefix:T.SHORT[\"\"]},z.cgs.ENERGY={unit:D.erg,prefix:T.NONE[\"\"]},z.us=JSON.parse(JSON.stringify(z.si)),z.us.LENGTH={unit:D.ft,prefix:T.NONE[\"\"]},z.us.MASS={unit:D.lbm,prefix:T.NONE[\"\"]},z.us.TEMPERATURE={unit:D.degF,prefix:T.NONE[\"\"]},z.us.FORCE={unit:D.lbf,prefix:T.NONE[\"\"]},z.us.ENERGY={unit:D.BTU,prefix:T.BTU[\"\"]},z.us.POWER={unit:D.hp,prefix:T.NONE[\"\"]},z.us.PRESSURE={unit:D.psi,prefix:T.NONE[\"\"]},z.auto=JSON.parse(JSON.stringify(z.si));let q=z.auto;y.setUnitSystem=function(e){if(!ue(z,e))throw new Error(\"Unit system \"+e+\" does not exist. Choices are: \"+Object.keys(z).join(\", \"));q=z[e]},y.getUnitSystem=function(){for(const e in z)if(ue(z,e)&&z[e]===q)return e},y.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new d(String(e.n)).div(String(e.d)).times(String(e.s)):new d(e+\"\")},Fraction:function(e){return new g(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?r(e):e}},y.prototype._numberConverter=function(){var e=y.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type \"'+this.valueType()+'\"')},y._getNumberConverter=function(e){if(y.typeConverters[e])return y.typeConverters[e];throw new TypeError('Unsupported type \"'+e+'\"')};for(const e in D)if(ue(D,e)){const t=D[e];t.dimensions=t.base.dimensions}for(const e in O)if(ue(O,e)){const t=D[O[e]],c={};for(const e in t)ue(t,e)&&(c[e]=t[e]);c.name=e,D[e]=c}return y.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},y.createUnit=function(t,r){if(\"object\"!=typeof t)throw new TypeError(\"createUnit expects first parameter to be of type 'Object'\");if(r&&r.override)for(const r in t)if(ue(t,r)&&y.deleteUnit(r),t[r].aliases)for(let e=0;e{let{typed:t,Unit:r}=e;return t(\"unit\",{Unit:function(e){return e.clone()},string:function(e){return r.isValuelessUnit(e)?new r(null,e):r.parse(e,{allowNoUnits:!0})},\"number | BigNumber | Fraction | Complex, string | Unit\":function(e,t){return new r(e,t)},\"number | BigNumber | Fraction\":function(e){return new r(e)},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Rl=s(\"sparse\",[\"typed\",\"SparseMatrix\"],e=>{let{typed:t,SparseMatrix:r}=e;return t(\"sparse\",{\"\":function(){return new r([])},string:function(e){return new r([],e)},\"Array | Matrix\":function(e){return new r(e)},\"Array | Matrix, string\":function(e,t){return new r(e,t)}})}),Pl=\"createUnit\",Ul=s(Pl,[\"typed\",\"Unit\"],e=>{let{typed:t,Unit:i}=e;return t(Pl,{\"Object, Object\":function(e,t){return i.createUnit(e,t)},Object:function(e){return i.createUnit(e,{})},\"string, Unit | string | Object, Object\":function(e,t,r){const n={};return n[e]=t,i.createUnit(n,r)},\"string, Unit | string | Object\":function(e,t){const r={};return r[e]=t,i.createUnit(r,{})},string:function(e){const t={};return t[e]={},i.createUnit(t,{})}})}),jl=s(\"acos\",[\"typed\",\"config\",\"Complex\"],e=>{let{typed:t,config:r,Complex:n}=e;return t(\"acos\",{number:function(e){return-1<=e&&e<=1||r.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})}),Ll=\"number\";function $l(e){return Qe(e)}function Hl(e){return Math.atan(1/e)}function Gl(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function Vl(e){return Math.asin(1/e)}function Zl(e){e=1/e;return Math.log(e+Math.sqrt(e*e+1))}function Wl(e){return Math.acos(1/e)}function Yl(e){var e=1/e,t=Math.sqrt(e*e-1);return Math.log(t+e)}function Jl(e){return Ke(e)}function Xl(e){return et(e)}function Ql(e){return 1/Math.tan(e)}function Kl(e){e=Math.exp(2*e);return(e+1)/(e-1)}function ec(e){return 1/Math.sin(e)}function tc(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*ke(e)}function rc(e){return 1/Math.cos(e)}function nc(e){return 2/(Math.exp(e)+Math.exp(-e))}function ic(e){return rt(e)}ic.signature=nc.signature=rc.signature=tc.signature=ec.signature=Kl.signature=Ql.signature=Xl.signature=Jl.signature=Yl.signature=Wl.signature=Zl.signature=Vl.signature=Gl.signature=Hl.signature=$l.signature=Ll;const ac=s(\"acosh\",[\"typed\",\"config\",\"Complex\"],e=>{let{typed:t,config:r,Complex:n}=e;return t(\"acosh\",{number:function(e){return 1<=e||r.predictable?$l(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})}),oc=s(\"acot\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"acot\",{number:Hl,Complex:function(e){return e.acot()},BigNumber:function(e){return new r(1).div(e).atan()}})}),sc=s(\"acoth\",[\"typed\",\"config\",\"Complex\",\"BigNumber\"],e=>{let{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(\"acoth\",{number:function(e){return 1<=e||e<=-1||r.predictable?Gl(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()}})}),uc=s(\"acsc\",[\"typed\",\"config\",\"Complex\",\"BigNumber\"],e=>{let{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(\"acsc\",{number:function(e){return e<=-1||1<=e||r.predictable?Vl(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()}})}),lc=s(\"acsch\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"acsch\",{number:Zl,Complex:function(e){return e.acsch()},BigNumber:function(e){return new r(1).div(e).asinh()}})}),cc=s(\"asec\",[\"typed\",\"config\",\"Complex\",\"BigNumber\"],e=>{let{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(\"asec\",{number:function(e){return e<=-1||1<=e||r.predictable?Wl(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()}})}),fc=s(\"asech\",[\"typed\",\"config\",\"Complex\",\"BigNumber\"],e=>{let{typed:t,config:n,Complex:i,BigNumber:r}=e;return t(\"asech\",{number:function(e){if(e<=1&&-1<=e||n.predictable){var t=1/e;if(0{let{typed:t,config:r,Complex:n}=e;return t(\"asin\",{number:function(e){return-1<=e&&e<=1||r.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})}),mc=s(\"asinh\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"asinh\",{number:Jl,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})}),hc=s(\"atan\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"atan\",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()}})}),dc=s(\"atan2\",[\"typed\",\"matrix\",\"equalScalar\",\"BigNumber\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:o}=e;const s=Ra({typed:t,equalScalar:n}),u=Pa({typed:t}),l=ho({typed:t,equalScalar:n}),c=Aa({typed:t,equalScalar:n}),f=x({typed:t,DenseMatrix:a}),p=C({typed:t,matrix:r,concat:o});return t(\"atan2\",{\"number, number\":Math.atan2,\"BigNumber, BigNumber\":(e,t)=>i.atan2(e,t)},p({scalar:\"number | BigNumber\",SS:l,DS:u,SD:s,Ss:c,sS:f}))}),gc=s(\"atanh\",[\"typed\",\"config\",\"Complex\"],e=>{let{typed:t,config:r,Complex:n}=e;return t(\"atanh\",{number:function(e){return e<=1&&-1<=e||r.predictable?Xl(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})}),yc=s(\"trigUnit\",[\"typed\"],e=>{let r=e[\"typed\"];return{Unit:r.referToSelf(t=>e=>{if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return r.find(t,e.valueType())(e.value);throw new TypeError(\"Unit in function cot is no angle\")})}}),xc=s(\"cos\",[\"typed\"],e=>{let t=e[\"typed\"];e=yc({typed:t});return t(\"cos\",{number:Math.cos,\"Complex | BigNumber\":e=>e.cos()},e)}),bc=s(\"cosh\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"cosh\",{number:tt,\"Complex | BigNumber\":e=>e.cosh()})}),vc=s(\"cot\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"cot\",{number:Ql,Complex:e=>e.cot(),BigNumber:e=>new r(1).div(e.tan())},yc({typed:t}))}),wc=s(\"coth\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"coth\",{number:Kl,Complex:e=>e.coth(),BigNumber:e=>new r(1).div(e.tanh())})}),Nc=s(\"csc\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"csc\",{number:ec,Complex:e=>e.csc(),BigNumber:e=>new r(1).div(e.sin())},yc({typed:t}))}),Ac=s(\"csch\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"csch\",{number:tc,Complex:e=>e.csch(),BigNumber:e=>new r(1).div(e.sinh())})}),Ec=s(\"sec\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"sec\",{number:rc,Complex:e=>e.sec(),BigNumber:e=>new r(1).div(e.cos())},yc({typed:t}))}),Sc=s(\"sech\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"sech\",{number:nc,Complex:e=>e.sech(),BigNumber:e=>new r(1).div(e.cosh())})}),Mc=s(\"sin\",[\"typed\"],e=>{let t=e[\"typed\"];e=yc({typed:t});return t(\"sin\",{number:Math.sin,\"Complex | BigNumber\":e=>e.sin()},e)}),Cc=s(\"sinh\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"sinh\",{number:ic,\"Complex | BigNumber\":e=>e.sinh()})}),Tc=s(\"tan\",[\"typed\"],e=>{let t=e[\"typed\"];e=yc({typed:t});return t(\"tan\",{number:Math.tan,\"Complex | BigNumber\":e=>e.tan()},e)}),Bc=s(\"tanh\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"tanh\",{number:nt,\"Complex | BigNumber\":e=>e.tanh()})}),Fc=\"setCartesian\",Dc=s(Fc,[\"typed\",\"size\",\"subset\",\"compareNatural\",\"Index\",\"DenseMatrix\"],e=>{let{typed:t,size:n,subset:i,compareNatural:a,Index:o,DenseMatrix:s}=e;return t(Fc,{\"Array | Matrix, Array | Matrix\":function(e,t){let r=[];if(0!==i(n(e),new o(0))&&0!==i(n(t),new o(0))){const n=E(Array.isArray(e)?e:e.toArray()).sort(a),i=E(Array.isArray(t)?t:t.toArray()).sort(a);r=[];for(let t=0;t{let{typed:t,size:i,subset:a,compareNatural:o,Index:r,DenseMatrix:s}=e;return t(Oc,{\"Array | Matrix, Array | Matrix\":function(e,t){let n;if(0===a(i(e),new r(0)))n=[];else{if(0===a(i(t),new r(0)))return E(e.toArray());{const i=Pn(E(Array.isArray(e)?e:e.toArray()).sort(o)),a=Pn(E(Array.isArray(t)?t:t.toArray()).sort(o));let r;n=[];for(let t=0;t{let{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(zc,{\"Array | Matrix\":function(e){let t;if(0===n(r(e),new a(0)))t=[];else{const r=E(Array.isArray(e)?e:e.toArray()).sort(i);(t=[]).push(r[0]);for(let e=1;e{let{typed:t,size:n,subset:i,compareNatural:a,Index:o,DenseMatrix:s}=e;return t(Ic,{\"Array | Matrix, Array | Matrix\":function(e,t){let r;if(0===i(n(e),new o(0))||0===i(n(t),new o(0)))r=[];else{const n=Pn(E(Array.isArray(e)?e:e.toArray()).sort(a)),i=Pn(E(Array.isArray(t)?t:t.toArray()).sort(a));r=[];for(let t=0;t{let{typed:t,size:a,subset:o,compareNatural:s,Index:u}=e;return t(Rc,{\"Array | Matrix, Array | Matrix\":function(e,t){if(0===o(a(e),new u(0)))return!0;if(0===o(a(t),new u(0)))return!1;var r=Pn(E(Array.isArray(e)?e:e.toArray()).sort(s)),n=Pn(E(Array.isArray(t)?t:t.toArray()).sort(s));let i;for(let t=0;t{let{typed:t,size:i,subset:a,compareNatural:o,Index:s}=e;return t(Uc,{\"number | BigNumber | Fraction | Complex, Array | Matrix\":function(t,e){if(0===a(i(e),new s(0)))return 0;var r=E(Array.isArray(e)?e:e.toArray());let n=0;for(let e=0;e{let{typed:t,size:o,subset:s,compareNatural:u,Index:l}=e;return t(Lc,{\"Array | Matrix\":function(e){if(0===s(o(e),new l(0)))return[];const t=E(Array.isArray(e)?e:e.toArray()).sort(u),r=[];let n=0;for(;n.toString(2).length<=t.length;)r.push(function(t,r){const n=[];for(let e=0;ea[e+1].length&&(i=a[e],a[e]=a[e+1],a[e+1]=i);return a}})}),Hc=\"setSize\",Gc=s(Hc,[\"typed\",\"compareNatural\"],e=>{let{typed:t,compareNatural:n}=e;return t(Hc,{\"Array | Matrix\":function(e){return(Array.isArray(e)?E(e):E(e.toArray())).length},\"Array | Matrix, boolean\":function(e,r){if(!1===r||0===e.length)return(Array.isArray(e)?E(e):E(e.toArray())).length;{const r=E(Array.isArray(e)?e:e.toArray()).sort(n);let t=1;for(let e=1;e{let{typed:t,size:r,concat:n,subset:i,setDifference:a,Index:o}=e;return t(Vc,{\"Array | Matrix, Array | Matrix\":function(e,t){if(0===i(r(e),new o(0)))return E(t);if(0===i(r(t),new o(0)))return E(e);e=E(e),t=E(t);return n(a(e,t),a(t,e))}})}),Wc=\"setUnion\",Yc=s(Wc,[\"typed\",\"size\",\"concat\",\"subset\",\"setIntersect\",\"setSymDifference\",\"Index\"],e=>{let{typed:t,size:r,concat:n,subset:i,setIntersect:a,setSymDifference:o,Index:s}=e;return t(Wc,{\"Array | Matrix, Array | Matrix\":function(e,t){if(0===i(r(e),new s(0)))return E(t);if(0===i(r(t),new s(0)))return E(e);e=E(e),t=E(t);return n(o(e,t),a(e,t))}})}),Jc=s(\"add\",[\"typed\",\"matrix\",\"addScalar\",\"equalScalar\",\"DenseMatrix\",\"SparseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:a,concat:o}=e;const s=Ha({typed:t}),u=Ga({typed:t,equalScalar:i}),l=Va({typed:t,DenseMatrix:a}),c=C({typed:t,matrix:r,concat:o});return t(\"add\",{\"any, any\":n,\"any, any, ...any\":t.referToSelf(i=>(e,t,r)=>{let n=i(e,t);for(let e=0;e{let{typed:t,abs:a,addScalar:o,divideScalar:s,multiplyScalar:u,sqrt:l,smaller:c,isPositive:f}=e;return t(\"hypot\",{\"... number | BigNumber\":r,Array:r,Matrix:e=>r(E(e.toArray(),!0))});function r(t){let r=0,n=0;for(let e=0;e{let{typed:t,abs:s,add:u,pow:l,conj:c,sqrt:f,multiply:p,equalScalar:m,larger:h,smaller:d,matrix:r,ctranspose:g,eigs:y}=e;return t(\"norm\",{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return x(r(e),2)},Matrix:function(e){return x(e,2)},\"Array, number | BigNumber | string\":function(e,t){return x(r(e),t)},\"Matrix, number | BigNumber | string\":x});function x(e,t){var r=e.size();if(1===r.length){var n=e,i=t;if(i===Number.POSITIVE_INFINITY||\"inf\"===i){let t=0;return n.forEach(function(e){e=s(e);h(e,t)&&(t=e)},!0),t}if(i===Number.NEGATIVE_INFINITY||\"-inf\"===i){let t;return n.forEach(function(e){e=s(e);t&&!d(e,t)||(t=e)},!0),t||0}if(\"fro\"===i)return x(n,2);if(\"number\"!=typeof i||isNaN(i))throw new Error(\"Unsupported parameter value\");if(m(i,0))return Number.POSITIVE_INFINITY;{let t=0;return n.forEach(function(e){t=u(l(s(e),i),t)},!0),l(t,1/i)}}if(2===r.length){if(r[0]&&r[1]){n=e,r=t;if(1===r){const a=[];let r=0;return n.forEach(function(e,t){t=t[1],e=u(a[t]||0,s(e));h(e,r)&&(r=e),a[t]=e},!0),r}if(r===Number.POSITIVE_INFINITY||\"inf\"===r){const o=[];let r=0;return n.forEach(function(e,t){t=t[0],e=u(o[t]||0,s(e));h(e,r)&&(r=e),o[t]=e},!0),r}if(\"fro\"===r){let r=0;return n.forEach(function(e,t){r=u(r,p(e,c(e)))}),s(f(r))}if(2!==r)throw new Error(\"Unsupported parameter value \"+r);if((n=(r=n).size())[0]!==n[1])throw new RangeError(\"Invalid matrix dimensions\");return n=g(r),n=p(n,r),r=y(n).values.toArray(),n=r[r.length-1],s(f(n))}throw new RangeError(\"Invalid matrix dimensions\")}}}),Kc=s(\"dot\",[\"typed\",\"addScalar\",\"multiplyScalar\",\"conj\",\"size\"],e=>{let{typed:l,addScalar:f,multiplyScalar:p,conj:c,size:t}=e;return l(\"dot\",{\"Array | DenseMatrix, Array | DenseMatrix\":function(e,t){var r=m(e,t),n=_(e)?e._data:e,i=_(e)?e._datatype||e.getDataType():void 0,a=_(t)?t._data:t,o=_(t)?t._datatype||t.getDataType():void 0,e=2===h(e).length,t=2===h(t).length;let s=f,u=p;if(i&&o&&i===o&&\"string\"==typeof i&&\"mixed\"!==i){const e=i;s=l.find(f,[e,e]),u=l.find(p,[e,e])}if(!e&&!t){let t=u(c(n[0]),a[0]);for(let e=1;et?c++:e===t&&(o=s(o,u(n[l],a[c])),l++,c++)}return o}});function m(e,t){const r=h(e),n=h(t);let i,a;if(1===r.length)i=r[0];else{if(2!==r.length||1!==r[1])throw new RangeError(\"Expected a column vector, instead got a matrix of size (\"+r.join(\", \")+\")\");i=r[0]}if(1===n.length)a=n[0];else{if(2!==n.length||1!==n[1])throw new RangeError(\"Expected a column vector, instead got a matrix of size (\"+n.join(\", \")+\")\");a=n[0]}if(i!==a)throw new RangeError(\"Vectors must have equal length (\"+i+\" != \"+a+\")\");if(0===i)throw new RangeError(\"Cannot calculate the dot product of empty vectors\");return i}function h(e){return _(e)?e.size():t(e)}}),ef=s(\"trace\",[\"typed\",\"matrix\",\"add\"],e=>{let{typed:t,matrix:r,add:u}=e;return t(\"trace\",{Array:function(e){return n(r(e))},SparseMatrix:function(e){const n=e._values,i=e._index,a=e._ptr,t=e._size,o=t[0],s=t[1];if(o!==s)throw new RangeError(\"Matrix must be square (size: \"+S(t)+\")\");{let r=0;if(0t)break}}return r}},DenseMatrix:n,any:ee});function n(r){var e=r._size,n=r._data;switch(e.length){case 1:if(1===e[0])return ee(n[0]);throw new RangeError(\"Matrix must be square (size: \"+S(e)+\")\");case 2:{const r=e[0];if(r!==e[1])throw new RangeError(\"Matrix must be square (size: \"+S(e)+\")\");{let t=0;for(let e=0;e{let{typed:t,Index:r}=e;return t(\"index\",{\"...number | string | BigNumber | Range | Array | Matrix\":function(e){var e=e.map(function(e){return Q(e)?e.toNumber():b(e)||_(e)?e.map(function(e){return Q(e)?e.toNumber():e}):e}),t=new r;return r.apply(t,e),t}})}),rf=new Set([\"end\"]),nf=s(\"Node\",[\"mathWithTransform\"],e=>{let t=e[\"mathWithTransform\"];return class{get type(){return\"Node\"}get isNode(){return!0}evaluate(e){return this.compile().evaluate(e)}compile(){const n=this._compile(t,{}),i={};return{evaluate:function(e){var e=U(e),t=e;for(const r of[...rf])if(t.has(r))throw new Error('Scope contains an illegal symbol, \"'+r+'\" is a reserved keyword');return n(e,i,null)}}}_compile(e,t){throw new Error(\"Method _compile must be implemented by type \"+this.type)}forEach(e){throw new Error(\"Cannot run forEach on a Node interface\")}map(e){throw new Error(\"Cannot run map on a Node interface\")}_ifNode(e){if(O(e))return e;throw new TypeError(\"Callback function must return a Node\")}traverse(e){e(this,null,null),function n(e,i){e.forEach(function(e,t,r){i(e,t,r),n(e,i)})}(this,e)}transform(i){return function e(t,r,n){r=i(t,r,n);return r!==t?r:t.map(e)}(this,null,null)}filter(n){const i=[];return this.traverse(function(e,t,r){n(e,t,r)&&i.push(e)}),i}clone(){throw new Error(\"Cannot clone a Node interface\")}cloneDeep(){return this.map(function(e){return e.cloneDeep()})}equals(e){return!!e&&this.type===e.type&&De(this,e)}toString(e){var t=this._getCustomString(e);return void 0!==t?t:this._toString(e)}_toString(){throw new Error(\"_toString not implemented for \"+this.type)}toJSON(){throw new Error(\"Cannot serialize object: toJSON not implemented by \"+this.type)}toHTML(e){var t=this._getCustomString(e);return void 0!==t?t:this._toHTML(e)}_toHTML(){throw new Error(\"_toHTML not implemented for \"+this.type)}toTex(e){var t=this._getCustomString(e);return void 0!==t?t:this._toTex(e)}_toTex(e){throw new Error(\"_toTex not implemented for \"+this.type)}_getCustomString(e){if(e&&\"object\"==typeof e)switch(typeof e.handler){case\"object\":case\"undefined\":return;case\"function\":return e.handler(this,e);default:throw new TypeError(\"Object or function expected as callback\")}}getIdentifier(){return this.type}getContent(){return this}}},{isClass:!0,isNode:!0});function af(e){return(af=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}function of(e,t,r){var n;n=function(e){if(\"object\"!=af(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,\"string\");if(\"object\"!=af(t))return t;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}(t),(t=\"symbol\"==af(n)?n:n+\"\")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}function sf(e){return e&&e.isIndexError?new En(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function uf(e){let r=e[\"subset\"];return function(e,t){try{if(Array.isArray(e))return r(e,t);if(e&&\"function\"==typeof e.subset)return e.subset(t);if(\"string\"==typeof e)return r(e,t);if(\"object\"!=typeof e)throw new TypeError(\"Cannot apply index: unsupported type of object\");if(t.isObjectProperty())return h(e,t.getObjectProperty());throw new TypeError(\"Cannot apply a numeric index as object property\")}catch(e){throw sf(e)}}}const lf=\"AccessorNode\",cf=s(lf,[\"subset\",\"Node\"],e=>{var{subset:e,Node:t}=e;const o=uf({subset:e});function r(e){return!(ge(e)||ye(e)||ae(e)||Ae(e)||Se(e)||Me(e)||se(e))}class n extends t{constructor(e,t){if(super(),!O(e))throw new TypeError('Node expected for parameter \"object\"');if(!Ee(t))throw new TypeError('IndexNode expected for parameter \"index\"');this.object=e,this.index=t}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():\"\":this.object.name||\"\"}get type(){return lf}get isAccessorNode(){return!0}_compile(n,e){const i=this.object._compile(n,e),a=this.index._compile(n,e);if(this.index.isObjectProperty()){const n=this.index.getObjectProperty();return function(e,t,r){return h(i(e,t,r),n)}}return function(e,t,r){r=i(e,t,r),e=a(e,t,r);return o(r,e)}}forEach(e){e(this.object,\"object\",this),e(this.index,\"index\",this)}map(e){return new n(this._ifNode(e(this.object,\"object\",this)),this._ifNode(e(this.index,\"index\",this)))}clone(){return new n(this.object,this.index)}_toString(e){let t=this.object.toString(e);return(t=r(this.object)?\"(\"+t+\")\":t)+this.index.toString(e)}_toHTML(e){let t=this.object.toHTML(e);return(t=r(this.object)?'('+t+')':t)+this.index.toHTML(e)}_toTex(e){let t=this.object.toTex(e);return(t=r(this.object)?\"\\\\left(' + object + '\\\\right)\":t)+this.index.toTex(e)}toJSON(){return{mathjs:lf,object:this.object,index:this.index}}static fromJSON(e){return new n(e.object,e.index)}}return of(n,\"name\",lf),n},{isClass:!0,isNode:!0}),ff=\"ArrayNode\",pf=s(ff,[\"Node\"],e=>{e=e.Node;class n extends e{constructor(e){if(super(),this.items=e||[],!Array.isArray(this.items)||!this.items.every(O))throw new TypeError(\"Array containing Nodes expected\")}get type(){return ff}get isArrayNode(){return!0}_compile(t,i){const e=zn(this.items,function(e){return e._compile(t,i)});if(\"Array\"===t.config.matrix)return function(t,r,n){return zn(e,function(e){return e(t,r,n)})};{const i=t.matrix;return function(t,r,n){return i(zn(e,function(e){return e(t,r,n)}))}}}forEach(t){for(let e=0;e['+this.items.map(function(e){return e.toHTML(t)}).join(',')+']'}_toTex(o){return function t(e,r){var n=e.some(ye)&&!e.every(ye),i=r||n,a=i?\"&\":\"\\\\\\\\\",e=e.map(function(e){return e.items?t(e.items,!r):e.toTex(o)}).join(a);return n||!i||i&&!r?\"\\\\begin{bmatrix}\"+e+\"\\\\end{bmatrix}\":e}(this.items,!1)}}return of(n,\"name\",ff),n},{isClass:!0,isNode:!0}),mf=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{\"OperatorNode:or\":{op:\"or\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:xor\":{op:\"xor\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:and\":{op:\"and\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:bitOr\":{op:\"|\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:bitXor\":{op:\"^|\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:bitAnd\":{op:\"&\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:equal\":{op:\"==\",associativity:\"left\",associativeWith:[]},\"OperatorNode:unequal\":{op:\"!=\",associativity:\"left\",associativeWith:[]},\"OperatorNode:smaller\":{op:\"<\",associativity:\"left\",associativeWith:[]},\"OperatorNode:larger\":{op:\">\",associativity:\"left\",associativeWith:[]},\"OperatorNode:smallerEq\":{op:\"<=\",associativity:\"left\",associativeWith:[]},\"OperatorNode:largerEq\":{op:\">=\",associativity:\"left\",associativeWith:[]},RelationalNode:{associativity:\"left\",associativeWith:[]}},{\"OperatorNode:leftShift\":{op:\"<<\",associativity:\"left\",associativeWith:[]},\"OperatorNode:rightArithShift\":{op:\">>\",associativity:\"left\",associativeWith:[]},\"OperatorNode:rightLogShift\":{op:\">>>\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:to\":{op:\"to\",associativity:\"left\",associativeWith:[]}},{RangeNode:{}},{\"OperatorNode:add\":{op:\"+\",associativity:\"left\",associativeWith:[\"OperatorNode:add\",\"OperatorNode:subtract\"]},\"OperatorNode:subtract\":{op:\"-\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:multiply\":{op:\"*\",associativity:\"left\",associativeWith:[\"OperatorNode:multiply\",\"OperatorNode:divide\",\"Operator:dotMultiply\",\"Operator:dotDivide\"]},\"OperatorNode:divide\":{op:\"/\",associativity:\"left\",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},\"OperatorNode:dotMultiply\":{op:\".*\",associativity:\"left\",associativeWith:[\"OperatorNode:multiply\",\"OperatorNode:divide\",\"OperatorNode:dotMultiply\",\"OperatorNode:doDivide\"]},\"OperatorNode:dotDivide\":{op:\"./\",associativity:\"left\",associativeWith:[]},\"OperatorNode:mod\":{op:\"mod\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:multiply\":{associativity:\"left\",associativeWith:[\"OperatorNode:multiply\",\"OperatorNode:divide\",\"Operator:dotMultiply\",\"Operator:dotDivide\"]}},{\"OperatorNode:unaryPlus\":{op:\"+\",associativity:\"right\"},\"OperatorNode:unaryMinus\":{op:\"-\",associativity:\"right\"},\"OperatorNode:bitNot\":{op:\"~\",associativity:\"right\"},\"OperatorNode:not\":{op:\"not\",associativity:\"right\"}},{\"OperatorNode:pow\":{op:\"^\",associativity:\"right\",associativeWith:[],latexRightParens:!1},\"OperatorNode:dotPow\":{op:\".^\",associativity:\"right\",associativeWith:[]}},{\"OperatorNode:nullish\":{op:\"??\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:factorial\":{op:\"!\",associativity:\"left\"}},{\"OperatorNode:ctranspose\":{op:\"'\",associativity:\"left\"}}];function hf(e,t){if(!t||\"auto\"!==t)return e;let r=e;for(;Me(r);)r=r.content;return r}function F(e,t,r,n){let i=e;var a=(i=\"keep\"!==t?e.getContent():i).getIdentifier();let o=null;for(let e=0;e{var{subset:t,matrix:r,Node:e}=e;const c=uf({subset:t}),f=function(){let{subset:n,matrix:i}={subset:t,matrix:r};return function(r,e,t){try{if(Array.isArray(r))return i(r).subset(e,t).valueOf().forEach((e,t)=>{r[t]=e}),r;if(r&&\"function\"==typeof r.subset)return r.subset(e,t);if(\"string\"==typeof r)return n(r,e,t);if(\"object\"!=typeof r)throw new TypeError(\"Cannot apply index: unsupported type of object\");if(e.isObjectProperty())return D(r,e.getObjectProperty(),t),r;throw TypeError(\"Cannot apply a numeric index as object property\")}catch(r){throw sf(r)}}}();function i(e,t,r){var n=F(e,t=t||\"keep\",r),e=F(e.value,t,r);return\"all\"===t||null!==e&&e<=n}class n extends e{constructor(e,t,r){if(super(),this.object=e,this.index=r?t:null,this.value=r||t,!se(e)&&!ge(e))throw new TypeError('SymbolNode or AccessorNode expected as \"object\"');if(se(e)&&\"end\"===e.name)throw new Error('Cannot assign to symbol \"end\"');if(this.index&&!Ee(this.index))throw new TypeError('IndexNode expected as \"index\"');if(!O(this.value))throw new TypeError('Node expected as \"value\"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():\"\":this.object.name||\"\"}get type(){return yf}get isAssignmentNode(){return!0}_compile(o,e){const s=this.object._compile(o,e),u=this.index?this.index._compile(o,e):null,l=this.value._compile(o,e),i=this.object.name;if(this.index){if(this.index.isObjectProperty()){const o=this.index.getObjectProperty();return function(e,t,r){var n=s(e,t,r),e=l(e,t,r);return D(n,o,e),e}}if(se(this.object))return function(e,t,r){var n=s(e,t,r),r=l(e,t,r),t=u(e,t,n);return e.set(i,f(n,t,r)),r};{const s=this.object.object._compile(o,e);if(this.object.index.isObjectProperty()){const o=this.object.index.getObjectProperty();return function(e,t,r){var n=s(e,t,r),i=h(n,o),a=u(e,t,i),e=l(e,t,r);return D(n,o,f(i,a,e)),e}}{const h=this.object.index._compile(o,e);return function(e,t,r){var n=s(e,t,r),i=h(e,t,n),a=c(n,i),o=u(e,t,a),e=l(e,t,r);return f(n,i,f(a,o,e)),e}}}}if(se(this.object))return function(e,t,r){t=l(e,t,r);return e.set(i,t),t};throw new TypeError(\"SymbolNode expected as object\")}forEach(e){e(this.object,\"object\",this),this.index&&e(this.index,\"index\",this),e(this.value,\"value\",this)}map(e){var t=this._ifNode(e(this.object,\"object\",this)),r=this.index?this._ifNode(e(this.index,\"index\",this)):null,e=this._ifNode(e(this.value,\"value\",this));return new n(t,r,e)}clone(){return new n(this.object,this.index,this.value)}_toString(e){var t=this.object.toString(e),r=this.index?this.index.toString(e):\"\";let n=this.value.toString(e);return t+r+\" = \"+(n=i(this,e&&e.parenthesis,e&&e.implicit)?\"(\"+n+\")\":n)}toJSON(){return{mathjs:yf,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new n(e.object,e.index,e.value)}_toHTML(e){var t=this.object.toHTML(e),r=this.index?this.index.toHTML(e):\"\";let n=this.value.toHTML(e);return t+r+'='+(n=i(this,e&&e.parenthesis,e&&e.implicit)?'('+n+')':n)}_toTex(e){var t=this.object.toTex(e),r=this.index?this.index.toTex(e):\"\";let n=this.value.toTex(e);return t+r+\"=\"+(n=i(this,e&&e.parenthesis,e&&e.implicit)?`\\\\left(${n}\\\\right)`:n)}}return of(n,\"name\",yf),n},{isClass:!0,isNode:!0}),bf=\"BlockNode\",vf=s(bf,[\"ResultSet\",\"Node\"],e=>{let{ResultSet:o,Node:t}=e;class i extends t{constructor(e){if(super(),!Array.isArray(e))throw new Error(\"Array expected\");this.blocks=e.map(function(e){var t=e&&e.node,e=!e||void 0===e.visible||e.visible;if(!O(t))throw new TypeError('Property \"node\" must be a Node');if(\"boolean\"!=typeof e)throw new TypeError('Property \"visible\" must be a boolean');return{node:t,visible:e}})}get type(){return bf}get isBlockNode(){return!0}_compile(t,r){const e=zn(this.blocks,function(e){return{evaluate:e.node._compile(t,r),visible:e.visible}});return function(r,n,i){const a=[];return qn(e,function(e){var t=e.evaluate(r,n,i);e.visible&&a.push(t)}),new o(a)}}forEach(t){for(let e=0;e;')}).join('
')}_toTex(t){return this.blocks.map(function(e){return e.node.toTex(t)+(e.visible?\"\":\";\")}).join(\"\\\\;\\\\;\\n\")}}return of(i,\"name\",bf),i},{isClass:!0,isNode:!0}),wf=\"ConditionalNode\",Nf=s(wf,[\"Node\"],e=>{e=e.Node;class t extends e{constructor(e,t,r){if(super(),!O(e))throw new TypeError(\"Parameter condition must be a Node\");if(!O(t))throw new TypeError(\"Parameter trueExpr must be a Node\");if(!O(r))throw new TypeError(\"Parameter falseExpr must be a Node\");this.condition=e,this.trueExpr=t,this.falseExpr=r}get type(){return wf}get isConditionalNode(){return!0}_compile(e,t){const n=this.condition._compile(e,t),i=this.trueExpr._compile(e,t),a=this.falseExpr._compile(e,t);return function(e,t,r){return(function(e){if(\"number\"==typeof e||\"boolean\"==typeof e||\"string\"==typeof e)return e;if(e){if(Q(e))return!e.isZero();if(te(e))return e.re||e.im;if(L(e))return e.value}if(null!=e)throw new TypeError('Unsupported type of condition \"'+K(e)+'\"')}(n(e,t,r))?i:a)(e,t,r)}}forEach(e){e(this.condition,\"condition\",this),e(this.trueExpr,\"trueExpr\",this),e(this.falseExpr,\"falseExpr\",this)}map(e){return new t(this._ifNode(e(this.condition,\"condition\",this)),this._ifNode(e(this.trueExpr,\"trueExpr\",this)),this._ifNode(e(this.falseExpr,\"falseExpr\",this)))}clone(){return new t(this.condition,this.trueExpr,this.falseExpr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:\"keep\",r=F(this,t,e&&e.implicit);let n=this.condition.toString(e);var i=F(this.condition,t,e&&e.implicit);(\"all\"===t||\"OperatorNode\"===this.condition.type||null!==i&&i<=r)&&(n=\"(\"+n+\")\");let a=this.trueExpr.toString(e);i=F(this.trueExpr,t,e&&e.implicit);(\"all\"===t||\"OperatorNode\"===this.trueExpr.type||null!==i&&i<=r)&&(a=\"(\"+a+\")\");let o=this.falseExpr.toString(e);i=F(this.falseExpr,t,e&&e.implicit);return(\"all\"===t||\"OperatorNode\"===this.falseExpr.type||null!==i&&i<=r)&&(o=\"(\"+o+\")\"),n+\" ? \"+a+\" : \"+o}toJSON(){return{mathjs:wf,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new t(e.condition,e.trueExpr,e.falseExpr)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:\"keep\",r=F(this,t,e&&e.implicit);let n=this.condition.toHTML(e);var i=F(this.condition,t,e&&e.implicit);(\"all\"===t||\"OperatorNode\"===this.condition.type||null!==i&&i<=r)&&(n='('+n+')');let a=this.trueExpr.toHTML(e);i=F(this.trueExpr,t,e&&e.implicit);(\"all\"===t||\"OperatorNode\"===this.trueExpr.type||null!==i&&i<=r)&&(a='('+a+')');let o=this.falseExpr.toHTML(e);i=F(this.falseExpr,t,e&&e.implicit);return(\"all\"===t||\"OperatorNode\"===this.falseExpr.type||null!==i&&i<=r)&&(o='('+o+')'),n+'?'+a+':'+o}_toTex(e){return\"\\\\begin{cases} {\"+this.trueExpr.toTex(e)+\"}, &\\\\quad{\\\\text{if }\\\\;\"+this.condition.toTex(e)+\"}\\\\\\\\{\"+this.falseExpr.toTex(e)+\"}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}\"}}return of(t,\"name\",wf),t},{isClass:!0,isNode:!0});var Af=fd(144);const Ef={Alpha:\"A\",alpha:\"\\\\alpha\",Beta:\"B\",beta:\"\\\\beta\",Gamma:\"\\\\Gamma\",gamma:\"\\\\gamma\",Delta:\"\\\\Delta\",delta:\"\\\\delta\",Epsilon:\"E\",epsilon:\"\\\\epsilon\",varepsilon:\"\\\\varepsilon\",Zeta:\"Z\",zeta:\"\\\\zeta\",Eta:\"H\",eta:\"\\\\eta\",Theta:\"\\\\Theta\",theta:\"\\\\theta\",vartheta:\"\\\\vartheta\",Iota:\"I\",iota:\"\\\\iota\",Kappa:\"K\",kappa:\"\\\\kappa\",varkappa:\"\\\\varkappa\",Lambda:\"\\\\Lambda\",lambda:\"\\\\lambda\",Mu:\"M\",mu:\"\\\\mu\",Nu:\"N\",nu:\"\\\\nu\",Xi:\"\\\\Xi\",xi:\"\\\\xi\",Omicron:\"O\",omicron:\"o\",Pi:\"\\\\Pi\",pi:\"\\\\pi\",varpi:\"\\\\varpi\",Rho:\"P\",rho:\"\\\\rho\",varrho:\"\\\\varrho\",Sigma:\"\\\\Sigma\",sigma:\"\\\\sigma\",varsigma:\"\\\\varsigma\",Tau:\"T\",tau:\"\\\\tau\",Upsilon:\"\\\\Upsilon\",upsilon:\"\\\\upsilon\",Phi:\"\\\\Phi\",phi:\"\\\\phi\",varphi:\"\\\\varphi\",Chi:\"X\",chi:\"\\\\chi\",Psi:\"\\\\Psi\",psi:\"\\\\psi\",Omega:\"\\\\Omega\",omega:\"\\\\omega\",true:\"\\\\mathrm{True}\",false:\"\\\\mathrm{False}\",i:\"i\",inf:\"\\\\infty\",Inf:\"\\\\infty\",infinity:\"\\\\infty\",Infinity:\"\\\\infty\",oo:\"\\\\infty\",lim:\"\\\\lim\",undefined:\"\\\\mathbf{?}\"},c={transpose:\"^\\\\top\",ctranspose:\"^H\",factorial:\"!\",pow:\"^\",dotPow:\".^\\\\wedge\",unaryPlus:\"+\",unaryMinus:\"-\",bitNot:\"\\\\~\",not:\"\\\\neg\",multiply:\"\\\\cdot\",divide:\"\\\\frac\",dotMultiply:\".\\\\cdot\",dotDivide:\".:\",mod:\"\\\\mod\",add:\"+\",subtract:\"-\",to:\"\\\\rightarrow\",leftShift:\"<<\",rightArithShift:\">>\",rightLogShift:\">>>\",equal:\"=\",unequal:\"\\\\neq\",smaller:\"<\",larger:\">\",smallerEq:\"\\\\leq\",largerEq:\"\\\\geq\",bitAnd:\"\\\\&\",bitXor:\"\\\\underline{|}\",bitOr:\"|\",and:\"\\\\wedge\",xor:\"\\\\veebar\",or:\"\\\\vee\"},Sf={abs:{1:\"\\\\left|${args[0]}\\\\right|\"},add:{2:`\\\\left(\\${args[0]}${c.add}\\${args[1]}\\\\right)`},cbrt:{1:\"\\\\sqrt[3]{${args[0]}}\"},ceil:{1:\"\\\\left\\\\lceil${args[0]}\\\\right\\\\rceil\"},cube:{1:\"\\\\left(${args[0]}\\\\right)^3\"},divide:{2:\"\\\\frac{${args[0]}}{${args[1]}}\"},dotDivide:{2:`\\\\left(\\${args[0]}${c.dotDivide}\\${args[1]}\\\\right)`},dotMultiply:{2:`\\\\left(\\${args[0]}${c.dotMultiply}\\${args[1]}\\\\right)`},dotPow:{2:`\\\\left(\\${args[0]}${c.dotPow}\\${args[1]}\\\\right)`},exp:{1:\"\\\\exp\\\\left(${args[0]}\\\\right)\"},expm1:`\\\\left(e${c.pow}{\\${args[0]}}-1\\\\right)`,fix:{1:\"\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)\"},floor:{1:\"\\\\left\\\\lfloor${args[0]}\\\\right\\\\rfloor\"},fraction:{2:\"\\\\frac{${args[0]}}{${args[1]}}\"},gcd:\"\\\\gcd\\\\left(${args}\\\\right)\",hypot:\"\\\\hypot\\\\left(${args}\\\\right)\",log:{1:\"\\\\ln\\\\left(${args[0]}\\\\right)\",2:\"\\\\log_{${args[1]}}\\\\left(${args[0]}\\\\right)\"},log10:{1:\"\\\\log_{10}\\\\left(${args[0]}\\\\right)\"},log1p:{1:\"\\\\ln\\\\left(${args[0]}+1\\\\right)\",2:\"\\\\log_{${args[1]}}\\\\left(${args[0]}+1\\\\right)\"},log2:\"\\\\log_{2}\\\\left(${args[0]}\\\\right)\",mod:{2:`\\\\left(\\${args[0]}${c.mod}\\${args[1]}\\\\right)`},multiply:{2:`\\\\left(\\${args[0]}${c.multiply}\\${args[1]}\\\\right)`},norm:{1:\"\\\\left\\\\|${args[0]}\\\\right\\\\|\",2:void 0},nthRoot:{2:\"\\\\sqrt[${args[1]}]{${args[0]}}\"},nthRoots:{2:\"\\\\{y : y^${args[1]} = {${args[0]}}\\\\}\"},pow:{2:`\\\\left(\\${args[0]}\\\\right)${c.pow}{\\${args[1]}}`},round:{1:\"\\\\left\\\\lfloor${args[0]}\\\\right\\\\rceil\",2:void 0},sign:{1:\"\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)\"},sqrt:{1:\"\\\\sqrt{${args[0]}}\"},square:{1:\"\\\\left(${args[0]}\\\\right)^2\"},subtract:{2:`\\\\left(\\${args[0]}${c.subtract}\\${args[1]}\\\\right)`},unaryMinus:{1:c.unaryMinus+\"\\\\left(${args[0]}\\\\right)\"},unaryPlus:{1:c.unaryPlus+\"\\\\left(${args[0]}\\\\right)\"},bitAnd:{2:`\\\\left(\\${args[0]}${c.bitAnd}\\${args[1]}\\\\right)`},bitNot:{1:c.bitNot+\"\\\\left(${args[0]}\\\\right)\"},bitOr:{2:`\\\\left(\\${args[0]}${c.bitOr}\\${args[1]}\\\\right)`},bitXor:{2:`\\\\left(\\${args[0]}${c.bitXor}\\${args[1]}\\\\right)`},leftShift:{2:`\\\\left(\\${args[0]}${c.leftShift}\\${args[1]}\\\\right)`},rightArithShift:{2:`\\\\left(\\${args[0]}${c.rightArithShift}\\${args[1]}\\\\right)`},rightLogShift:{2:`\\\\left(\\${args[0]}${c.rightLogShift}\\${args[1]}\\\\right)`},bellNumbers:{1:\"\\\\mathrm{B}_{${args[0]}}\"},catalan:{1:\"\\\\mathrm{C}_{${args[0]}}\"},stirlingS2:{2:\"\\\\mathrm{S}\\\\left(${args}\\\\right)\"},arg:{1:\"\\\\arg\\\\left(${args[0]}\\\\right)\"},conj:{1:\"\\\\left(${args[0]}\\\\right)^*\"},im:{1:\"\\\\Im\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace\"},re:{1:\"\\\\Re\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace\"},and:{2:`\\\\left(\\${args[0]}${c.and}\\${args[1]}\\\\right)`},not:{1:c.not+\"\\\\left(${args[0]}\\\\right)\"},or:{2:`\\\\left(\\${args[0]}${c.or}\\${args[1]}\\\\right)`},xor:{2:`\\\\left(\\${args[0]}${c.xor}\\${args[1]}\\\\right)`},cross:{2:\"\\\\left(${args[0]}\\\\right)\\\\times\\\\left(${args[1]}\\\\right)\"},ctranspose:{1:\"\\\\left(${args[0]}\\\\right)\"+c.ctranspose},det:{1:\"\\\\det\\\\left(${args[0]}\\\\right)\"},dot:{2:\"\\\\left(${args[0]}\\\\cdot${args[1]}\\\\right)\"},expm:{1:\"\\\\exp\\\\left(${args[0]}\\\\right)\"},inv:{1:\"\\\\left(${args[0]}\\\\right)^{-1}\"},pinv:{1:\"\\\\left(${args[0]}\\\\right)^{+}\"},sqrtm:{1:`{\\${args[0]}}${c.pow}{\\\\frac{1}{2}}`},trace:{1:\"\\\\mathrm{tr}\\\\left(${args[0]}\\\\right)\"},transpose:{1:\"\\\\left(${args[0]}\\\\right)\"+c.transpose},combinations:{2:\"\\\\binom{${args[0]}}{${args[1]}}\"},combinationsWithRep:{2:\"\\\\left(\\\\!\\\\!{\\\\binom{${args[0]}}{${args[1]}}}\\\\!\\\\!\\\\right)\"},factorial:{1:\"\\\\left(${args[0]}\\\\right)\"+c.factorial},gamma:{1:\"\\\\Gamma\\\\left(${args[0]}\\\\right)\"},lgamma:{1:\"\\\\ln\\\\Gamma\\\\left(${args[0]}\\\\right)\"},equal:{2:`\\\\left(\\${args[0]}${c.equal}\\${args[1]}\\\\right)`},larger:{2:`\\\\left(\\${args[0]}${c.larger}\\${args[1]}\\\\right)`},largerEq:{2:`\\\\left(\\${args[0]}${c.largerEq}\\${args[1]}\\\\right)`},smaller:{2:`\\\\left(\\${args[0]}${c.smaller}\\${args[1]}\\\\right)`},smallerEq:{2:`\\\\left(\\${args[0]}${c.smallerEq}\\${args[1]}\\\\right)`},unequal:{2:`\\\\left(\\${args[0]}${c.unequal}\\${args[1]}\\\\right)`},erf:{1:\"erf\\\\left(${args[0]}\\\\right)\"},max:\"\\\\max\\\\left(${args}\\\\right)\",min:\"\\\\min\\\\left(${args}\\\\right)\",variance:\"\\\\mathrm{Var}\\\\left(${args}\\\\right)\",acos:{1:\"\\\\cos^{-1}\\\\left(${args[0]}\\\\right)\"},acosh:{1:\"\\\\cosh^{-1}\\\\left(${args[0]}\\\\right)\"},acot:{1:\"\\\\cot^{-1}\\\\left(${args[0]}\\\\right)\"},acoth:{1:\"\\\\coth^{-1}\\\\left(${args[0]}\\\\right)\"},acsc:{1:\"\\\\csc^{-1}\\\\left(${args[0]}\\\\right)\"},acsch:{1:\"\\\\mathrm{csch}^{-1}\\\\left(${args[0]}\\\\right)\"},asec:{1:\"\\\\sec^{-1}\\\\left(${args[0]}\\\\right)\"},asech:{1:\"\\\\mathrm{sech}^{-1}\\\\left(${args[0]}\\\\right)\"},asin:{1:\"\\\\sin^{-1}\\\\left(${args[0]}\\\\right)\"},asinh:{1:\"\\\\sinh^{-1}\\\\left(${args[0]}\\\\right)\"},atan:{1:\"\\\\tan^{-1}\\\\left(${args[0]}\\\\right)\"},atan2:{2:\"\\\\mathrm{atan2}\\\\left(${args}\\\\right)\"},atanh:{1:\"\\\\tanh^{-1}\\\\left(${args[0]}\\\\right)\"},cos:{1:\"\\\\cos\\\\left(${args[0]}\\\\right)\"},cosh:{1:\"\\\\cosh\\\\left(${args[0]}\\\\right)\"},cot:{1:\"\\\\cot\\\\left(${args[0]}\\\\right)\"},coth:{1:\"\\\\coth\\\\left(${args[0]}\\\\right)\"},csc:{1:\"\\\\csc\\\\left(${args[0]}\\\\right)\"},csch:{1:\"\\\\mathrm{csch}\\\\left(${args[0]}\\\\right)\"},sec:{1:\"\\\\sec\\\\left(${args[0]}\\\\right)\"},sech:{1:\"\\\\mathrm{sech}\\\\left(${args[0]}\\\\right)\"},sin:{1:\"\\\\sin\\\\left(${args[0]}\\\\right)\"},sinh:{1:\"\\\\sinh\\\\left(${args[0]}\\\\right)\"},tan:{1:\"\\\\tan\\\\left(${args[0]}\\\\right)\"},tanh:{1:\"\\\\tanh\\\\left(${args[0]}\\\\right)\"},to:{2:`\\\\left(\\${args[0]}${c.to}\\${args[1]}\\\\right)`},numeric:function(e,t){return e.args[0].toTex()},number:{0:\"0\",1:\"\\\\left(${args[0]}\\\\right)\",2:\"\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)\"},string:{0:'\\\\mathtt{\"\"}',1:\"\\\\mathrm{string}\\\\left(${args[0]}\\\\right)\"},bignumber:{0:\"0\",1:\"\\\\left(${args[0]}\\\\right)\"},bigint:{0:\"0\",1:\"\\\\left(${args[0]}\\\\right)\"},complex:{0:\"0\",1:\"\\\\left(${args[0]}\\\\right)\",2:`\\\\left(\\\\left(\\${args[0]}\\\\right)+${Ef.i}\\\\cdot\\\\left(\\${args[1]}\\\\right)\\\\right)`},matrix:{0:\"\\\\begin{bmatrix}\\\\end{bmatrix}\",1:\"\\\\left(${args[0]}\\\\right)\",2:\"\\\\left(${args[0]}\\\\right)\"},sparse:{0:\"\\\\begin{bsparse}\\\\end{bsparse}\",1:\"\\\\left(${args[0]}\\\\right)\"},unit:{1:\"\\\\left(${args[0]}\\\\right)\",2:\"\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)\"}},Mf={deg:\"^\\\\circ\"};function Cf(e){return Af(e,{preserveFormatting:!0})}function Tf(e,t){return(t=void 0!==t&&t)?ue(Mf,e)?Mf[e]:\"\\\\mathrm{\"+Cf(e)+\"}\":ue(Ef,e)?Ef[e]:Cf(e)}const Bf=\"ConstantNode\",Ff=s(Bf,[\"Node\"],e=>{e=e.Node;class t extends e{constructor(e){super(),this.value=e}get type(){return Bf}get isConstantNode(){return!0}_compile(e,t){const r=this.value;return function(){return r}}forEach(e){}map(e){return this.clone()}clone(){return new t(this.value)}_toString(e){return S(this.value,e)}_toHTML(e){var t=this._toString(e);switch(K(this.value)){case\"number\":case\"bigint\":case\"BigNumber\":case\"Fraction\":return''+t+\"\";case\"string\":return''+t+\"\";case\"boolean\":return''+t+\"\";case\"null\":return''+t+\"\";case\"undefined\":return''+t+\"\";default:return''+t+\"\"}}toJSON(){return{mathjs:Bf,value:this.value}}static fromJSON(e){return new t(e.value)}_toTex(e){const t=this._toString(e),r=K(this.value);switch(r){case\"string\":return\"\\\\mathtt{\"+Cf(t)+\"}\";case\"number\":case\"BigNumber\":{if(!(\"BigNumber\"===r?this.value.isFinite():isFinite(this.value)))return this.value.valueOf()<0?\"-\\\\infty\":\"\\\\infty\";const e=t.toLowerCase().indexOf(\"e\");return-1!==e?t.substring(0,e)+\"\\\\cdot10^{\"+t.substring(e+1)+\"}\":t}case\"bigint\":return t.toString();case\"Fraction\":return this.value.toLatex();default:return t}}}return of(t,\"name\",Bf),t},{isClass:!0,isNode:!0}),Df=\"FunctionAssignmentNode\",Of=s(Df,[\"typed\",\"Node\"],e=>{let{typed:f,Node:t}=e;function i(e,t,r){var n=F(e,t,r),e=F(e.expr,t,r);return\"all\"===t||null!==e&&e<=n}class r extends t{constructor(e,t,r){if(super(),\"string\"!=typeof e)throw new TypeError('String expected for parameter \"name\"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter \"params\"');if(!O(r))throw new TypeError('Node expected for parameter \"expr\"');if(rf.has(e))throw new Error('Illegal function name, \"'+e+'\" is a reserved keyword');const n=new Set;for(const e of t){const t=\"string\"==typeof e?e:e.name;if(n.has(t))throw new Error(`Duplicate parameter name \"${t}\"`);n.add(t)}this.name=e,this.params=t.map(function(e){return e&&e.name||e}),this.types=t.map(function(e){return e&&e.type||\"any\"}),this.expr=r}get type(){return Df}get isFunctionAssignmentNode(){return!0}_compile(e,t){const r=Object.create(t),a=(qn(this.params,function(e){r[e]=!0}),this.expr),o=a._compile(e,r),s=this.name,u=this.params,l=Rn(this.types,\",\"),c=s+\"(\"+Rn(this.params,\", \")+\")\";return function(e,r,n){const t={},i=(t[l]=function(){const t=Object.create(r);for(let e=0;e'+Nn(this.params[e])+\"\");let n=this.expr.toHTML(e);return i(this,t,e&&e.implicit)&&(n='('+n+')'),''+Nn(this.name)+'('+r.join(',')+')='+n}_toTex(e){var t=e&&e.parenthesis?e.parenthesis:\"keep\";let r=this.expr.toTex(e);return i(this,t,e&&e.implicit)&&(r=`\\\\left(${r}\\\\right)`),\"\\\\mathrm{\"+this.name+\"}\\\\left(\"+this.params.map(Tf).join(\",\")+\"\\\\right)=\"+r}}return of(r,\"name\",Df),r},{isClass:!0,isNode:!0}),_f=\"IndexNode\",zf=s(_f,[\"Node\",\"size\"],e=>{let{Node:t,size:s}=e;class n extends t{constructor(e,t){if(super(),this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(O))throw new TypeError('Array containing Nodes expected for parameter \"dimensions\"');if(this.dotNotation&&!this.isObjectProperty())throw new Error(\"dotNotation only applicable for object properties\")}get type(){return _f}get isIndexNode(){return!0}_compile(r,n){const i=zn(this.dimensions,function(e,a){if(0e.isSymbolNode&&\"end\"===e.name).length){const t=Object.create(n),o=(t.end=!0,e._compile(r,t));return function(e,t,r){if(!_(r)&&!b(r)&&!j(r))throw new TypeError('Cannot resolve \"end\": context must be a Matrix, Array, or string but is '+K(r));const n=s(r).valueOf(),i=Object.create(t);return i.end=n[a],o(e,i,r)}}return e._compile(r,n)}),a=h(r,\"index\");return function(t,r,n){var e=zn(i,function(e){return e(t,r,n)});return a(...e)}}forEach(t){for(let e=0;e.'+Nn(this.getObjectProperty())+\"\":'['+t.join(',')+']'}_toTex(t){const e=this.dimensions.map(function(e){return e.toTex(t)});return this.dotNotation?\".\"+this.getObjectProperty():\"_{\"+e.join(\",\")+\"}\"}}return of(n,\"name\",_f),n},{isClass:!0,isNode:!0}),qf=\"ObjectNode\",If=s(qf,[\"Node\"],e=>{e=e.Node;class r extends e{constructor(t){if(super(),this.properties=t||{},t&&(\"object\"!=typeof t||!Object.keys(t).every(function(e){return O(t[e])})))throw new TypeError(\"Object containing Nodes expected\")}get type(){return qf}get isObjectNode(){return!0}_compile(e,t){const a={};for(const r in this.properties)if(ue(this.properties,r)){const n=vn(r),i=JSON.parse(n),o=h(this.properties,r);a[i]=o._compile(e,t)}return function(e,t,r){const n={};for(const i in a)ue(a,i)&&(n[i]=a[i](e,t,r));return n}}forEach(e){for(const t in this.properties)ue(this.properties,t)&&e(this.properties[t],\"properties[\"+vn(t)+\"]\",this)}map(e){const t={};for(const r in this.properties)ue(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],\"properties[\"+vn(r)+\"]\",this)));return new r(t)}clone(){const e={};for(const t in this.properties)ue(this.properties,t)&&(e[t]=this.properties[t]);return new r(e)}_toString(e){const t=[];for(const r in this.properties)ue(this.properties,r)&&t.push(vn(r)+\": \"+this.properties[r].toString(e));return\"{\"+t.join(\", \")+\"}\"}toJSON(){return{mathjs:qf,properties:this.properties}}static fromJSON(e){return new r(e.properties)}_toHTML(e){const t=[];for(const r in this.properties)ue(this.properties,r)&&t.push(''+Nn(r)+':'+this.properties[r].toHTML(e));return'{'+t.join(',')+'}'}_toTex(e){const t=[];for(const r in this.properties)ue(this.properties,r)&&t.push(\"\\\\mathbf{\"+r+\":} & \"+this.properties[r].toTex(e)+\"\\\\\\\\\");return\"\\\\left\\\\{\\\\begin{array}{ll}\"+t.join(\"\\n\")+\"\\\\end{array}\\\\right\\\\}\"}}return of(r,\"name\",qf),r},{isClass:!0,isNode:!0});function kf(e,t){return new k(e,new I(t),new Set(Object.keys(t)))}const Rf=\"OperatorNode\",Pf=s(Rf,[\"Node\"],e=>{e=e.Node;function l(a,o,s,r,e){const u=F(a,o,s),l=df(a,o);if(\"all\"===o||2)'),\"right\"===n?''+Nn(this.op)+\"\"+e:e+''+Nn(this.op)+\"\"}if(2===i.length){let e=i[0].toHTML(r),t=i[1].toHTML(r);return a[0]&&(e='('+e+')'),a[1]&&(t='('+t+')'),this.implicit&&\"OperatorNode:multiply\"===this.getIdentifier()&&\"hide\"===n?e+''+t:e+''+Nn(this.op)+\"\"+t}{const t=i.map(function(e,t){return e=e.toHTML(r),e=a[t]?'('+e+')':e});return 2'):t.join(''+Nn(this.op)+\"\"):''+Nn(this.fn)+'('+t.join(',')+')'}}_toTex(n){const i=n&&n.parenthesis?n.parenthesis:\"keep\",a=n&&n.implicit?n.implicit:\"hide\",o=this.args,s=l(this,i,a,o,!0);let u=c[this.fn];if(u=void 0===u?this.op:u,1===o.length){const a=df(this,i);let e=o[0].toTex(n);return s[0]&&(e=`\\\\left(${e}\\\\right)`),\"right\"===a?u+e:e+u}if(2===o.length){const l=o[0];let e=l.toTex(n);s[0]&&(e=`\\\\left(${e}\\\\right)`);let t,r=o[1].toTex(n);switch(s[1]&&(r=`\\\\left(${r}\\\\right)`),t=(\"keep\"===i?l:l.getContent()).getIdentifier(),this.getIdentifier()){case\"OperatorNode:divide\":return u+\"{\"+e+\"}{\"+r+\"}\";case\"OperatorNode:pow\":switch(e=\"{\"+e+\"}\",r=\"{\"+r+\"}\",t){case\"ConditionalNode\":case\"OperatorNode:divide\":e=`\\\\left(${e}\\\\right)`}break;case\"OperatorNode:multiply\":if(this.implicit&&\"hide\"===a)return e+\"~\"+r}return e+u+r}if(2{e=e.Node;class t extends e{constructor(e){if(super(),!O(e))throw new TypeError('Node expected for parameter \"content\"');this.content=e}get type(){return Uf}get isParenthesisNode(){return!0}_compile(e,t){return this.content._compile(e,t)}getContent(){return this.content.getContent()}forEach(e){e(this.content,\"content\",this)}map(e){e=e(this.content,\"content\",this);return new t(e)}clone(){return new t(this.content)}_toString(e){return!e||!e.parenthesis||e&&\"keep\"===e.parenthesis?\"(\"+this.content.toString(e)+\")\":this.content.toString(e)}toJSON(){return{mathjs:Uf,content:this.content}}static fromJSON(e){return new t(e.content)}_toHTML(e){return!e||!e.parenthesis||e&&\"keep\"===e.parenthesis?'('+this.content.toHTML(e)+')':this.content.toHTML(e)}_toTex(e){return!e||!e.parenthesis||e&&\"keep\"===e.parenthesis?`\\\\left(${this.content.toTex(e)}\\\\right)`:this.content.toTex(e)}}return of(t,\"name\",Uf),t},{isClass:!0,isNode:!0}),Lf=\"RangeNode\",$f=s(Lf,[\"Node\"],e=>{e=e.Node;function a(e,t,r){const n=F(e,t,r),i={},a=F(e.start,t,r);if(i.start=null!==a&&a<=n||\"all\"===t,e.step){const a=F(e.step,t,r);i.step=null!==a&&a<=n||\"all\"===t}e=F(e.end,t,r);return i.end=null!==e&&e<=n||\"all\"===t,i}class t extends e{constructor(e,t,r){if(super(),!O(e))throw new TypeError(\"Node expected\");if(!O(t))throw new TypeError(\"Node expected\");if(r&&!O(r))throw new TypeError(\"Node expected\");if(3('+e+')'),n=e,this.step){let e=this.step.toHTML(t);r.step&&(e='('+e+')'),n+=':'+e}let i=this.end.toHTML(t);return r.end&&(i='('+i+')'),n+=':'+i}_toTex(t){var r=a(this,t&&t.parenthesis?t.parenthesis:\"keep\",t&&t.implicit);let n=this.start.toTex(t);if(r.start&&(n=`\\\\left(${n}\\\\right)`),this.step){let e=this.step.toTex(t);r.step&&(e=`\\\\left(${e}\\\\right)`),n+=\":\"+e}let e=this.end.toTex(t);return r.end&&(e=`\\\\left(${e}\\\\right)`),n+=\":\"+e}}return of(t,\"name\",Lf),t},{isClass:!0,isNode:!0}),Hf=\"RelationalNode\",Gf=s(Hf,[\"Node\"],e=>{e=e.Node;const o={equal:\"==\",unequal:\"!=\",smaller:\"<\",larger:\">\",smallerEq:\"<=\",largerEq:\">=\"};class t extends e{constructor(e,t){if(super(),!Array.isArray(e))throw new TypeError(\"Parameter conditionals must be an array\");if(!Array.isArray(t))throw new TypeError(\"Parameter params must be an array\");if(e.length!==t.length-1)throw new TypeError(\"Parameter params must contain exactly one more element than parameter conditionals\");this.conditionals=e,this.params=t}get type(){return Hf}get isRelationalNode(){return!0}_compile(o,t){const s=this,u=this.params.map(e=>e._compile(o,t));return function(t,r,n){let i,a=u[0](t,r,n);for(let e=0;er(e,\"params[\"+t+\"]\",this),this)}map(r){return new t(this.conditionals.slice(),this.params.map((e,t)=>this._ifNode(r(e,\"params[\"+t+\"]\",this)),this))}clone(){return new t(this.conditionals,this.params)}_toString(n){const i=n&&n.parenthesis?n.parenthesis:\"keep\",a=F(this,i,n&&n.implicit),t=this.params.map(function(e,t){var r=F(e,i,n&&n.implicit);return\"all\"===i||null!==r&&r<=a?\"(\"+e.toString(n)+\")\":e.toString(n)});let r=t[0];for(let e=0;e('+e.toHTML(n)+')':e.toHTML(n)});let r=t[0];for(let e=0;e'+Nn(o[this.conditionals[e]])+\"\"+t[e+1];return r}_toTex(n){const i=n&&n.parenthesis?n.parenthesis:\"keep\",a=F(this,i,n&&n.implicit),t=this.params.map(function(e,t){var r=F(e,i,n&&n.implicit);return\"all\"===i||null!==r&&r<=a?\"\\\\left(\"+e.toTex(n)+\"\\right)\":e.toTex(n)});let r=t[0];for(let e=0;e{let{math:n,Unit:a,Node:t}=e;function o(e){return!!a&&a.isValuelessUnit(e)}class s extends t{constructor(e){if(super(),\"string\"!=typeof e)throw new TypeError('String expected for parameter \"name\"');this.name=e}get type(){return\"SymbolNode\"}get isSymbolNode(){return!0}_compile(n,e){const i=this.name;if(!0===e[i])return function(e,t,r){return h(t,i)};if(i in n)return function(e,t,r){return e.has(i)?e.get(i):h(n,i)};{const n=o(i);return function(e,t,r){return e.has(i)?e.get(i):n?new a(null,i):s.onUndefinedSymbol(i)}}}forEach(e){}map(e){return this.clone()}static onUndefinedSymbol(e){throw new Error(\"Undefined symbol \"+e)}clone(){return new s(this.name)}_toString(e){return this.name}_toHTML(e){var t=Nn(this.name);return\"true\"===t||\"false\"===t?''+t+\"\":\"i\"===t?''+t+\"\":\"Infinity\"===t?''+t+\"\":\"NaN\"===t?''+t+\"\":\"null\"===t?''+t+\"\":\"undefined\"===t?''+t+\"\":''+t+\"\"}toJSON(){return{mathjs:\"SymbolNode\",name:this.name}}static fromJSON(e){return new s(e.name)}_toTex(e){let t=!1;void 0===n[this.name]&&o(this.name)&&(t=!0);var r=Tf(this.name,t);return\"\\\\\"===r[0]?r:\" \"+r}}return s},{isClass:!0,isNode:!0}),Zf=\"FunctionNode\",Wf=s(Zf,[\"math\",\"Node\",\"SymbolNode\"],e=>{var t;let{math:i,Node:r,SymbolNode:n}=e;const p=e=>S(e,{truncate:78});function a(e,t,r){let n=\"\";const i=/\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi;let a,o=0;for(;null!==(a=i.exec(e));)if(n+=e.substring(o,a.index),o=a.index,\"$$\"===a[0])n+=\"$\",o++;else{o+=a[0].length;const e=t[a[1]];if(!e)throw new ReferenceError(\"Template: Property \"+a[1]+\" does not exist.\");if(void 0===a[2])switch(typeof e){case\"string\":n+=e;break;case\"object\":if(O(e))n+=e.toTex(r);else{if(!Array.isArray(e))throw new TypeError(\"Template: \"+a[1]+\" has to be a Node, String or array of Nodes\");n+=e.map(function(e,t){if(O(e))return e.toTex(r);throw new TypeError(\"Template: \"+a[1]+\"[\"+t+\"] is not a Node.\")}).join(\",\")}break;default:throw new TypeError(\"Template: \"+a[1]+\" has to be a Node, String or array of Nodes\")}else{if(!O(e[a[2]]&&e[a[2]]))throw new TypeError(\"Template: \"+a[1]+\"[\"+a[2]+\"] is not a Node.\");n+=e[a[2]].toTex(r)}}return n+=e.slice(o)}class m extends r{constructor(e,t){if(super(),!O(e=\"string\"==typeof e?new n(e):e))throw new TypeError('Node expected as parameter \"fn\"');if(!Array.isArray(t)||!t.every(O))throw new TypeError('Array containing Nodes expected for parameter \"args\"');this.fn=e,this.args=t||[]}get name(){return this.fn.name||\"\"}get type(){return Zf}get isFunctionNode(){return!0}_compile(a,i){const o=this.args.map(e=>e._compile(a,i));if(!se(this.fn)){if(ge(this.fn)&&Ee(this.fn.index)&&this.fn.index.isObjectProperty()){const s=this.fn.object._compile(a,i),h=this.fn.index.getObjectProperty(),u=this.args;return function(t,r,n){const e=s(t,r,n),i=function(e,t){if(q(e,t))return e[t];throw new Error('No access to method \"'+t+'\"')}(e,h);if(null!=i&&i.rawArgs)return i(u,a,kf(t,r));{const a=o.map(e=>e(t,r,n));return i.apply(e,a)}}}{const l=this.fn.toString(),h=this.fn._compile(a,i),c=this.args;return function(t,r,n){const e=h(t,r,n);if(\"function\"!=typeof e)throw new TypeError(`Expression '${l}' did not evaluate to a function; value is:\n `+p(e));if(e.rawArgs)return e(c,a,kf(t,r));{const a=o.map(e=>e(t,r,n));return e.apply(e,a)}}}}{const f=this.fn.name;if(i[f]){const i=this.args;return function(t,r,n){const e=h(r,f);if(\"function\"!=typeof e)throw new TypeError(`Argument '${f}' was not a function; received: `+p(e));if(e.rawArgs)return e(i,a,kf(t,r));{const a=o.map(e=>e(t,r,n));return e.apply(e,a)}}}{const i=f in a?h(a,f):void 0,e=\"function\"==typeof i&&!0===i.rawArgs,q=e=>{let t;if(e.has(f))t=e.get(f);else{if(!(f in a))return m.onUndefinedFunction(f);t=h(a,f)}if(\"function\"==typeof t)return t;throw new TypeError(`'${f}' is not a function; its value is:\n `+p(t))};if(e){const i=this.args;return function(t,r,n){const e=q(t);return!0===e.rawArgs?e(i,a,kf(t,r)):e(...o.map(e=>e(t,r,n)))}}switch(o.length){case 0:return function(e,t,r){return q(e)()};case 1:return function(e,t,r){return q(e)((0,o[0])(e,t,r))};case 2:return function(e,t,r){const n=q(e),i=o[0],a=o[1];return n(i(e,t,r),a(e,t,r))};default:return function(t,r,n){return q(t)(...o.map(e=>e(t,r,n)))}}}}}forEach(t){t(this.fn,\"fn\",this);for(let e=0;e'+Nn(this.fn)+'('+e.join(',')+')'}toTex(e){let t;return void 0!==(t=e&&\"object\"==typeof e.handler&&ue(e.handler,this.name)?e.handler[this.name](this,e):t)?t:super.toTex(e)}_toTex(t){var e=this.args.map(function(e){return e.toTex(t)});let r,n;switch(Sf[this.name]&&(r=Sf[this.name]),typeof(r=!i[this.name]||\"function\"!=typeof i[this.name].toTex&&\"object\"!=typeof i[this.name].toTex&&\"string\"!=typeof i[this.name].toTex?r:i[this.name].toTex)){case\"function\":n=r(this,t);break;case\"string\":n=a(r,this,t);break;case\"object\":switch(typeof r[e.length]){case\"function\":n=r[e.length](this,t);break;case\"string\":n=a(r[e.length],this,t)}}return void 0!==n?n:a(\"\\\\mathrm{${name}}\\\\left(${args}\\\\right)\",this,t)}getIdentifier(){return this.type+\":\"+this.name}}return of(t=m,\"name\",Zf),of(m,\"onUndefinedFunction\",function(e){throw new Error(\"Undefined function \"+e)}),of(m,\"fromJSON\",function(e){return new t(e.fn,e.args)}),m},{isClass:!0,isNode:!0}),Yf=s(\"parse\",[\"typed\",\"numeric\",\"config\",\"AccessorNode\",\"ArrayNode\",\"AssignmentNode\",\"BlockNode\",\"ConditionalNode\",\"ConstantNode\",\"FunctionAssignmentNode\",\"FunctionNode\",\"IndexNode\",\"ObjectNode\",\"OperatorNode\",\"ParenthesisNode\",\"RangeNode\",\"RelationalNode\",\"SymbolNode\"],I=>{let{typed:e,numeric:c,config:k,AccessorNode:i,ArrayNode:f,AssignmentNode:o,BlockNode:R,ConditionalNode:P,ConstantNode:p,FunctionAssignmentNode:U,FunctionNode:j,IndexNode:a,ObjectNode:L,OperatorNode:s,ParenthesisNode:$,RangeNode:n,RelationalNode:H,SymbolNode:m}=I;const u=e(\"parse\",{string:function(e){return M(e,{})},\"Array | Matrix\":function(e){return t(e,{})},\"string, Object\":function(e,t){return M(e,void 0!==t.nodes?t.nodes:{})},\"Array | Matrix, Object\":t});function t(e){var t=1\":!0,\"<=\":!0,\">=\":!0,\"<<\":!0,\">>\":!0,\">>>\":!0},d={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},g={true:!0,false:!1,null:null,undefined:void 0},G=[\"NaN\",\"Infinity\"],V={'\"':'\"',\"'\":\"'\",\"\\\\\":\"\\\\\",\"/\":\"/\",b:\"\\b\",f:\"\\f\",n:\"\\n\",r:\"\\r\",t:\"\\t\"};function y(e,t){return e.expression.substr(e.index,t)}function x(e){return y(e,1)}function b(e){e.index++}function v(e){return e.expression.charAt(e.index-1)}function w(e){return e.expression.charAt(e.index+1)}function N(e){for(e.tokenType=h.NULL,e.token=\"\",e.comment=\"\";;){if(\"#\"===x(e))for(;\"\\n\"!==x(e)&&\"\"!==x(e);)e.comment+=x(e),b(e);if(!u.isWhitespace(x(e),e.nestingLevel))break;b(e)}if(\"\"===x(e))return e.tokenType=h.DELIMITER;if(\"\\n\"===x(e)&&!e.nestingLevel)return e.tokenType=h.DELIMITER,e.token=x(e),b(e);const t=x(e),r=y(e,2),n=y(e,3);if(3===n.length&&l[n])return e.tokenType=h.DELIMITER,e.token=n,b(e),b(e),b(e);if(2===r.length&&l[r])return e.tokenType=h.DELIMITER,e.token=r,b(e),b(e);if(l[t])return e.tokenType=h.DELIMITER,e.token=t,b(e);if(u.isDigitDot(t)){e.tokenType=h.NUMBER;const t=y(e,2);if(\"0b\"===t||\"0o\"===t||\"0x\"===t){for(e.token+=x(e),b(e),e.token+=x(e),b(e);u.isHexDigit(x(e));)e.token+=x(e),b(e);if(\".\"===x(e))for(e.token+=\".\",b(e);u.isHexDigit(x(e));)e.token+=x(e),b(e);else if(\"i\"===x(e))for(e.token+=\"i\",b(e);u.isDigit(x(e));)e.token+=x(e),b(e)}else{if(\".\"===x(e)){if(e.token+=x(e),b(e),!u.isDigit(x(e)))return e.tokenType=h.DELIMITER}else{for(;u.isDigit(x(e));)e.token+=x(e),b(e);u.isDecimalMark(x(e),w(e))&&(e.token+=x(e),b(e))}for(;u.isDigit(x(e));)e.token+=x(e),b(e);if(\"E\"===x(e)||\"e\"===x(e))if(u.isDigit(w(e))||\"-\"===w(e)||\"+\"===w(e)){if(e.token+=x(e),b(e),\"+\"!==x(e)&&\"-\"!==x(e)||(e.token+=x(e),b(e)),!u.isDigit(x(e)))throw q(e,'Digit expected, got \"'+x(e)+'\"');for(;u.isDigit(x(e));)e.token+=x(e),b(e);if(u.isDecimalMark(x(e),w(e)))throw q(e,'Digit expected, got \"'+x(e)+'\"')}else if(u.isDecimalMark(w(e),e.expression.charAt(e.index+2)))throw b(e),q(e,'Digit expected, got \"'+x(e)+'\"')}}else{if(!u.isAlpha(x(e),v(e),w(e))){for(e.tokenType=h.UNKNOWN;\"\"!==x(e);)e.token+=x(e),b(e);throw q(e,'Syntax error in part \"'+e.token+'\"')}for(;u.isAlpha(x(e),v(e),w(e))||u.isDigit(x(e));)e.token+=x(e),b(e);ue(d,e.token)?e.tokenType=h.DELIMITER:e.tokenType=h.SYMBOL}}function A(e){for(;N(e),\"\\n\"===e.token;);}function E(e){e.nestingLevel++}function S(e){e.nestingLevel--}function M(e,t){var r={extraNodes:{},expression:\"\",comment:\"\",index:0,token:\"\",tokenType:h.NULL,nestingLevel:0,conditionalLevel:null},e=(gn(r,{expression:e,extraNodes:t}),N(r),function(e){let t;const r=[];let n;for(\"\"!==e.token&&\"\\n\"!==e.token&&\";\"!==e.token&&(t=C(e),e.comment&&(t.comment=e.comment));\"\\n\"===e.token||\";\"===e.token;)0===r.length&&t&&(n=\";\"!==e.token,r.push({node:t,visible:n})),N(e),\"\\n\"!==e.token&&\";\"!==e.token&&\"\"!==e.token&&(t=C(e),e.comment&&(t.comment=e.comment),n=\";\"!==e.token,r.push({node:t,visible:n}));return 0\":\"larger\",\"<=\":\"smallerEq\",\">=\":\"largerEq\"};for(;ue(n,e.token);){var i={name:e.token,fn:n[e.token]};r.push(i),A(e),t.push(W(e))}return 1===t.length?t[0]:2===t.length?new s(r[0].name,r[0].fn,t):new H(r.map(e=>e.fn),t)}function W(e){let t,r,n,i;t=Y(e);for(var a={\"<<\":\"leftShift\",\">>\":\"rightArithShift\",\">>>\":\"rightLogShift\"};ue(a,e.token);)n=a[r=e.token],A(e),i=[t,Y(e)],t=new s(r,n,i);return t}function Y(e){let t,r,n,i;t=J(e);for(var a={to:\"to\",in:\"to\"};ue(a,e.token);)n=a[r=e.token],A(e),t=\"in\"===r&&\"])},;\".includes(e.token)?new s(\"*\",\"multiply\",[t,new m(\"in\")],!0):(i=[t,J(e)],new s(r,n,i));return t}function J(e){let t;const r=[];if(t=\":\"===e.token?new p(1):X(e),\":\"===e.token&&e.conditionalLevel!==e.nestingLevel){for(r.push(t);\":\"===e.token&&r.length<3;)A(e),\")\"===e.token||\"]\"===e.token||\",\"===e.token||\"\"===e.token?r.push(new m(\"end\")):r.push(X(e));t=3===r.length?new n(r[0],r[2],r[1]):new n(r[0],r[1])}return t}function X(e){let t,r,n,i;t=Q(e);for(var a={\"+\":\"add\",\"-\":\"subtract\"};ue(a,e.token);){n=a[r=e.token],A(e);var o=Q(e);i=o.isPercentage?[t,new s(\"*\",\"multiply\",[t,o])]:[t,o],t=new s(r,n,i)}return t}function Q(e){let t,r,n,i;t=O(e),r=t;for(var a,o={\"*\":\"multiply\",\".*\":\"dotMultiply\",\"/\":\"divide\",\"./\":\"dotDivide\",\"%\":\"mod\",mod:\"mod\"};ue(o,e.token);)n=e.token,i=o[n],A(e),t=\"%\"===n&&e.tokenType===h.DELIMITER&&\"(\"!==e.token?\"\"!==e.token&&o[e.token]?(a=new s(\"/\",\"divide\",[t,new p(100)],!1,!0),n=e.token,i=o[n],A(e),r=O(e),new s(n,i,[a,r])):new s(\"/\",\"divide\",[t,new p(100)],!1,!0):(r=O(e),new s(n,i,[t,r]));return t}function O(e){let t,r;for(t=K(e),r=t;e.tokenType===h.SYMBOL||\"in\"===e.token&&ae(t)||\"in\"===e.token&&oe(t)&&\"unaryMinus\"===t.fn&&ae(t.args[0])||!(e.tokenType!==h.NUMBER||ae(r)||oe(r)&&\"!\"!==r.op)||\"(\"===e.token;)r=K(e),t=new s(\"*\",\"multiply\",[t,r],!0);return t}function K(e){let t=_(e),r=t;const n=[];for(;\"/\"===e.token&&we(r);){if(n.push(gn({},e)),A(e),e.tokenType!==h.NUMBER){gn(e,n.pop());break}if(n.push(gn({},e)),A(e),e.tokenType!==h.SYMBOL&&\"(\"!==e.token&&\"in\"!==e.token){n.pop(),gn(e,n.pop());break}gn(e,n.pop()),n.pop(),r=_(e),t=new s(\"/\",\"divide\",[t,r])}return t}function _(i){var e,t={\"-\":\"unaryMinus\",\"+\":\"unaryPlus\",\"~\":\"bitNot\",not:\"not\"};if(ue(t,i.token))return t=t[i.token],a=i.token,A(i),e=[_(i)],new s(a,t,e);{var a=i;let e,t,r,n;return e=function(e){let t=ee(e);for(;\"??\"===e.token;)A(e),t=new s(\"??\",\"nullish\",[t,ee(e)]);return t}(a),\"^\"!==a.token&&\".^\"!==a.token||(r=\"^\"===(t=a.token)?\"pow\":\"dotPow\",A(a),n=[e,_(a)],e=new s(t,r,n)),e}}function ee(e){let t,r,n,i;t=function(e){let t=[];if(e.tokenType===h.SYMBOL&&ue(e.extraNodes,e.token)){const c=e.extraNodes[e.token];if(N(e),\"(\"===e.token){if(t=[],E(e),N(e),\")\"!==e.token)for(t.push(C(e));\",\"===e.token;)N(e),t.push(C(e));if(\")\"!==e.token)throw q(e,\"Parenthesis ) expected\");S(e),N(e)}return new c(t)}var r=e;if(r.tokenType===h.SYMBOL||r.tokenType===h.DELIMITER&&r.token in d)return i=r.token,N(r),z(r,ue(g,i)?new p(g[i]):G.includes(i)?new p(c(i,\"number\")):new m(i));var i=r;if('\"'===i.token||\"'\"===i.token)return u=te(i,i.token),z(i,new p(u));{var a=i;let e,t,r,n;if(\"[\"!==a.token){var o=a;if(\"{\"!==o.token){var s,u=o;if(u.tokenType===h.NUMBER)return i=u.token,N(u),l=Ie(i,k),i=c(i,l),new p(i);var l=u;if(\"(\"!==l.token)throw\"\"===(s=l).token?q(s,\"Unexpected end of expression\"):q(s,\"Value expected\");if(E(l),N(l),s=C(l),\")\"!==l.token)throw q(l,\"Parenthesis ) expected\");return S(l),N(l),z(l,new $(s))}{let e;E(o);const c={};do{if(N(o),\"}\"!==o.token){if('\"'===o.token||\"'\"===o.token)e=te(o,o.token);else{if(!(o.tokenType===h.SYMBOL||o.tokenType===h.DELIMITER&&o.token in d))throw q(o,\"Symbol or string expected as object key\");e=o.token,N(o)}if(\":\"!==o.token)throw q(o,\"Colon : expected after object key\");N(o),c[e]=C(o)}}while(\",\"===o.token);if(\"}\"!==o.token)throw q(o,\"Comma , or bracket } expected after object value\");return S(o),N(o),z(o,new L(c))}}if(E(a),N(a),\"]\"!==a.token){const c=re(a);if(\";\"===a.token){for(r=1,t=[c];\";\"===a.token;)N(a),\"]\"!==a.token&&(t[r]=re(a),r++);if(\"]\"!==a.token)throw q(a,\"End of matrix ] expected\");S(a),N(a),n=t[0].items.length;for(let e=1;e{let{typed:t,parse:r}=e;return t(Jf,{string:function(e){return r(e).compile()},\"Array | Matrix\":function(e){return le(e,function(e){return r(e).compile()})}})}),Qf=\"evaluate\",Kf=s(Qf,[\"typed\",\"parse\"],e=>{let{typed:t,parse:r}=e;return t(Qf,{string:function(e){var t=P();return r(e).compile().evaluate(t)},\"string, Map | Object\":function(e,t){return r(e).compile().evaluate(t)},\"Array | Matrix\":function(e){const t=P();return le(e,function(e){return r(e).compile().evaluate(t)})},\"Array | Matrix, Map | Object\":function(e,t){return le(e,function(e){return r(e).compile().evaluate(t)})}})}),ep=s(\"Parser\",[\"evaluate\",\"parse\"],e=>{let{evaluate:t,parse:a}=e;function n(){if(!(this instanceof n))throw new SyntaxError(\"Constructor must be called with the new operator\");Object.defineProperty(this,\"scope\",{value:P(),writable:!1})}return n.prototype.type=\"Parser\",n.prototype.isParser=!0,n.prototype.evaluate=function(e){return t(e,this.scope)},n.prototype.get=function(e){if(this.scope.has(e))return this.scope.get(e)},n.prototype.getAll=function(){var e=this.scope;if(e instanceof I)return e.wrappedObject;var t={};for(const r of e.keys())D(t,r,e.get(r));return t},n.prototype.getAllAsMap=function(){return this.scope},n.prototype.set=function(e,t){if(function(t){if(0!==t.length){for(let e=0;e{var[e,t]=e;return r.set(e,t)}),Object.entries(e.functions).forEach(e=>{var[,e]=e;return r.evaluate(e)}),r},n},{isClass:!0});const tp=s(\"parser\",[\"typed\",\"Parser\"],e=>{let{typed:t,Parser:r}=e;return t(\"parser\",{\"\":function(){return new r}})}),rp=s(\"lup\",[\"typed\",\"matrix\",\"abs\",\"addScalar\",\"divideScalar\",\"multiplyScalar\",\"subtractScalar\",\"larger\",\"equalScalar\",\"unaryMinus\",\"DenseMatrix\",\"SparseMatrix\",\"Spa\"],e=>{let{typed:t,matrix:r,abs:C,addScalar:g,divideScalar:T,multiplyScalar:B,subtractScalar:y,larger:F,equalScalar:D,unaryMinus:O,DenseMatrix:x,SparseMatrix:_,Spa:z}=e;return t(\"lup\",{DenseMatrix:n,SparseMatrix:function(n){{var o=n,s,u,l,c;const f=o._size[0],p=o._size[1],m=Math.min(f,p),h=o._values,d=o._index,g=o._ptr,y=[],x=[],b=[],v=[f,m],w=[],N=[],A=[],E=[m,p];let e,r,t;const S=[],M=[];for(e=0;e{let{typed:t,matrix:r,zeros:f,identity:p,isZero:m,equal:h,sign:d,sqrt:g,conj:y,unaryMinus:x,addScalar:b,divideScalar:v,multiplyScalar:w,subtractScalar:N,complex:i}=e;return gn(t(\"qr\",{DenseMatrix:n,SparseMatrix:function(e){throw new Error(\"qr not implemented for sparse matrices yet\")},Array:function(e){const t=n(r(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:a});function a(t){const r=t._size[0],n=t._size[1],e=p([r],\"dense\"),i=e._data,a=t.clone(),o=a._data;let s,u,l;const c=f([r],\"\");for(l=0;l{let{add:H,multiply:G,transpose:V}=e;return function(i,e){if(!e||i<=0||3a))for(const i=H[t+1];ei?(N=v,j=r,l[0+v]-i):(N=s[r++],j=u[N],l[0+N]),U=1;U<=A;U++)x=s[j++],(E=l[c+x])<=0||(t+=E,l[c+x]=-E,s[n++]=x,-1!==l[f+x]&&(y[l[f+x]]=y[x]),-1!==y[x]?l[f+y[x]]=l[f+x]:l[p+l[h+x]]=l[f+x]);N!==v&&(u[N]=-v-2,l[d+N]=0)}for(0!==i&&(P=n),l[h+v]=t,u[v]=W,l[0+v]=n-W,l[m+v]=-2,D=Z(D,o,l,d,a),S=W;S=D?l[d+N]-=E:0!==l[d+N]&&(l[d+N]=l[h+N]+i)}for(S=W;S{let S=e[\"transpose\"];return function(e,t,r,n){if(!e||!t||!r)return null;var i=e._size,a=i[0],o=i[1];let s,u,l,c,f,p,m;const h=4*o+(n?o+a+1:0),d=[],g=o,y=2*o,x=3*o,b=4*o,v=5*o+1;for(l=0;l{var{add:e,multiply:t,transpose:r}=e;const s=ap({add:e,multiply:t,transpose:r}),u=op({transpose:r});return function(e,t,r){const n=t._ptr,i=t._size[1];let a;const o={};if(o.q=s(e,t),e&&!o.q)return null;if(r){const r=e?function(n,t){n._values;const i=n._index,a=n._ptr,e=n._size,r=n._datatype,o=e[0],s=e[1],u=[],l=[];let c=0;for(let e=0;e{let{divideScalar:x,multiply:b,subtract:v}=e;return function(t,r,p,n,i,a,o){var s=t._values,u=t._index,l=t._ptr,c=t._size[1],e=r._values,f=r._index,m=r._ptr;let h,d,g,y;t=function(e,t,r,n){var i=e._ptr,a=e._size,o=t._index,t=t._ptr,s=a[1];let u,l,c,f=s;for(l=t[p],c=t[p+1],u=l;u{let{abs:A,divideScalar:E,multiply:S,subtract:t,larger:M,largerEq:C,SparseMatrix:T}=e;const B=cp({divideScalar:E,multiply:S,subtract:t});return function(n,e,i){if(!n)return null;var a=n._size[1];let o,s=100,u=100;e&&(o=e.q,s=e.lnz||s,u=e.unz||u);const l=[],c=[],f=[],p=new T({values:l,index:c,ptr:f,size:[a,a]}),m=[],h=[],d=[],g=new T({values:m,index:h,ptr:d,size:[a,a]}),y=[];let x,b;const v=[],w=[];for(x=0;x{let{typed:t,abs:r,add:n,multiply:i,transpose:a,divideScalar:o,subtract:s,larger:u,largerEq:l,SparseMatrix:c}=e;const f=sp({add:n,multiply:i,transpose:a}),p=fp({abs:r,divideScalar:o,multiply:i,subtract:s,larger:u,largerEq:l,SparseMatrix:c});return t(\"slu\",{\"SparseMatrix, number, number\":function(e,t,r){if(!v(t)||t<0||3{let{typed:t,matrix:r,lup:n,slu:i,usolve:s,lsolve:u,DenseMatrix:a}=e;const l=Cu({DenseMatrix:a});return t(hp,{\"Array, Array | Matrix\":function(e,t){e=r(e);e=n(e);return o(e.L,e.U,e.p,null,t).valueOf()},\"DenseMatrix, Array | Matrix\":function(e,t){e=n(e);return o(e.L,e.U,e.p,null,t)},\"SparseMatrix, Array | Matrix\":function(e,t){e=n(e);return o(e.L,e.U,e.p,null,t)},\"SparseMatrix, Array | Matrix, number, number\":function(e,t,r,n){e=i(e,r,n);return o(e.L,e.U,e.p,e.q,t)},\"Object, Array | Matrix\":function(e,t){return o(e.L,e.U,e.p,e.q,t)}});function c(e){if(_(e))return e;if(b(e))return r(e);throw new TypeError(\"Invalid Matrix LU decomposition\")}function o(e,t,r,n,i){e=c(e),t=c(t),r&&((i=l(e,i,!0))._data=mp(r,i._data));const a=u(e,i),o=s(t,a);return n&&(o._data=mp(n,o._data)),o}}),gp=\"polynomialRoot\",yp=s(gp,[\"typed\",\"isZero\",\"equalScalar\",\"add\",\"subtract\",\"multiply\",\"divide\",\"sqrt\",\"unaryMinus\",\"cbrt\",\"typeOf\",\"im\",\"re\"],e=>{let{typed:t,isZero:h,equalScalar:d,add:g,subtract:y,multiply:x,divide:b,sqrt:v,unaryMinus:w,cbrt:N,typeOf:A,im:E,re:S}=e;return t(gp,{\"number|Complex, ...number|Complex\":(e,t)=>{const r=[e,...t];for(;0b(g(h,e,b(c,e)),a)).map(e=>\"Complex\"===A(e)&&d(S(e),S(e)+E(e))?S(e):e));var n}default:throw new RangeError(\"only implemented for cubic or lower-order polynomials, not \"+r)}}})}),xp=s(\"Help\",[\"evaluate\"],e=>{let o=e[\"evaluate\"];function n(e){if(!(this instanceof n))throw new SyntaxError(\"Constructor must be called with the new operator\");if(!e)throw new Error('Argument \"doc\" missing');this.doc=e}return n.prototype.type=\"Help\",n.prototype.isHelp=!0,n.prototype.toString=function(){const r=this.doc||{};let n=\"\\n\";if(r.name&&(n+=\"Name: \"+r.name+\"\\n\\n\"),r.category&&(n+=\"Category: \"+r.category+\"\\n\\n\"),r.description&&(n+=\"Description:\\n \"+r.description+\"\\n\\n\"),r.syntax&&(n+=\"Syntax:\\n \"+r.syntax.join(\"\\n \")+\"\\n\\n\"),r.examples){n+=\"Examples:\\n\";let t=!1;var e=o(\"config()\"),i={config:e=>(t=!0,o(\"config(newConfig)\",{newConfig:e}))};for(let t=0;t\"mathjs\"!==e).forEach(e=>{r[e]=t[e]}),new n(r)},n.prototype.valueOf=n.prototype.toString,n},{isClass:!0}),bp=s(\"Chain\",[\"?on\",\"math\",\"typed\"],e=>{let{on:t,math:r,typed:n}=e;function i(e){if(!(this instanceof i))throw new SyntaxError(\"Constructor must be called with the new operator\");Be(e)?this.value=e.value:this.value=e}function a(e,t){_e(i.prototype,e,function(){var e=t();if(\"function\"==typeof e)return o(e)})}function o(r){return function(){if(0===arguments.length)return new i(r(this.value));const t=[this.value];for(let e=0;ee[t])})(r),t&&t(\"import\",function(e,t,r){r||a(e,t)}),i},{isClass:!0}),vp={name:\"e\",category:\"Constants\",syntax:[\"e\"],description:\"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828\",examples:[\"e\",\"e ^ 2\",\"exp(2)\",\"log(e)\"],seealso:[\"exp\"]},wp={name:\"pi\",category:\"Constants\",syntax:[\"pi\"],description:\"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159\",examples:[\"pi\",\"sin(pi/2)\"],seealso:[\"tau\"]},Np={bignumber:{name:\"bignumber\",category:\"Construction\",syntax:[\"bignumber(x)\"],description:\"Create a big number from a number or string.\",examples:[\"0.1 + 0.2\",\"bignumber(0.1) + bignumber(0.2)\",'bignumber(\"7.2\")','bignumber(\"7.2e500\")',\"bignumber([0.1, 0.2, 0.3])\"],seealso:[\"boolean\",\"bigint\",\"complex\",\"fraction\",\"index\",\"matrix\",\"string\",\"unit\"]},bigint:{name:\"bigint\",category:\"Construction\",syntax:[\"bigint(x)\"],description:\"Create a bigint, an integer with an arbitrary number of digits, from a number or string.\",examples:[\"123123123123123123 # a large number will lose digits\",'bigint(\"123123123123123123\")','bignumber([\"1\", \"3\", \"5\"])'],seealso:[\"boolean\",\"bignumber\",\"number\",\"complex\",\"fraction\",\"index\",\"matrix\",\"string\",\"unit\"]},boolean:{name:\"boolean\",category:\"Construction\",syntax:[\"x\",\"boolean(x)\"],description:\"Convert a string or number into a boolean.\",examples:[\"boolean(0)\",\"boolean(1)\",\"boolean(3)\",'boolean(\"true\")','boolean(\"false\")',\"boolean([1, 0, 1, 1])\"],seealso:[\"bignumber\",\"complex\",\"index\",\"matrix\",\"number\",\"string\",\"unit\"]},complex:{name:\"complex\",category:\"Construction\",syntax:[\"complex()\",\"complex(re, im)\",\"complex(string)\"],description:\"Create a complex number.\",examples:[\"complex()\",\"complex(2, 3)\",'complex(\"7 - 2i\")'],seealso:[\"bignumber\",\"boolean\",\"index\",\"matrix\",\"number\",\"string\",\"unit\"]},createUnit:{name:\"createUnit\",category:\"Construction\",syntax:[\"createUnit(definitions)\",\"createUnit(name, definition)\"],description:\"Create a user-defined unit and register it with the Unit type.\",examples:['createUnit(\"foo\")','createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})','createUnit(\"mph\", \"1 mile/hour\")'],seealso:[\"unit\",\"splitUnit\"]},fraction:{name:\"fraction\",category:\"Construction\",syntax:[\"fraction(num)\",\"fraction(matrix)\",\"fraction(num,den)\",\"fraction({n: num, d: den})\"],description:\"Create a fraction from a number or from integer numerator and denominator.\",examples:[\"fraction(0.125)\",\"fraction(1, 3) + fraction(2, 5)\",\"fraction({n: 333, d: 53})\",\"fraction([sqrt(9), sqrt(10), sqrt(11)])\"],seealso:[\"bignumber\",\"boolean\",\"complex\",\"index\",\"matrix\",\"string\",\"unit\"]},index:{name:\"index\",category:\"Construction\",syntax:[\"[start]\",\"[start:end]\",\"[start:step:end]\",\"[start1, start 2, ...]\",\"[start1:end1, start2:end2, ...]\",\"[start1:step1:end1, start2:step2:end2, ...]\"],description:\"Create an index to get or replace a subset of a matrix\",examples:[\"A = [1, 2, 3; 4, 5, 6]\",\"A[1, :]\",\"A[1, 2] = 50\",\"A[1:2, 1:2] = 1\",\"B = [1, 2, 3]\",\"B[B>1 and B<3]\"],seealso:[\"bignumber\",\"boolean\",\"complex\",\"matrix\",\"number\",\"range\",\"string\",\"unit\"]},matrix:{name:\"matrix\",category:\"Construction\",syntax:[\"[]\",\"[a1, b1, ...; a2, b2, ...]\",\"matrix()\",'matrix(\"dense\")',\"matrix([...])\"],description:\"Create a matrix.\",examples:[\"[]\",\"[1, 2, 3]\",\"[1, 2, 3; 4, 5, 6]\",\"matrix()\",\"matrix([3, 4])\",'matrix([3, 4; 5, 6], \"sparse\")','matrix([3, 4; 5, 6], \"sparse\", \"number\")'],seealso:[\"bignumber\",\"boolean\",\"complex\",\"index\",\"number\",\"string\",\"unit\",\"sparse\"]},number:{name:\"number\",category:\"Construction\",syntax:[\"x\",\"number(x)\",\"number(unit, valuelessUnit)\"],description:\"Create a number or convert a string or boolean into a number.\",examples:[\"2\",\"2e3\",\"4.05\",\"number(2)\",'number(\"7.2\")',\"number(true)\",\"number([true, false, true, true])\",'number(unit(\"52cm\"), \"m\")'],seealso:[\"bignumber\",\"bigint\",\"boolean\",\"complex\",\"fraction\",\"index\",\"matrix\",\"string\",\"unit\"]},sparse:{name:\"sparse\",category:\"Construction\",syntax:[\"sparse()\",\"sparse([a1, b1, ...; a1, b2, ...])\",'sparse([a1, b1, ...; a1, b2, ...], \"number\")'],description:\"Create a sparse matrix.\",examples:[\"sparse()\",\"sparse([3, 4; 5, 6])\",'sparse([3, 0; 5, 0], \"number\")'],seealso:[\"bignumber\",\"boolean\",\"complex\",\"index\",\"number\",\"string\",\"unit\",\"matrix\"]},splitUnit:{name:\"splitUnit\",category:\"Construction\",syntax:[\"splitUnit(unit: Unit, parts: Unit[])\"],description:\"Split a unit in an array of units whose sum is equal to the original unit.\",examples:['splitUnit(1 m, [\"feet\", \"inch\"])'],seealso:[\"unit\",\"createUnit\"]},string:{name:\"string\",category:\"Construction\",syntax:['\"text\"',\"string(x)\"],description:\"Create a string or convert a value to a string\",examples:['\"Hello World!\"',\"string(4.2)\",\"string(3 + 2i)\"],seealso:[\"bignumber\",\"boolean\",\"complex\",\"index\",\"matrix\",\"number\",\"unit\"]},unit:{name:\"unit\",category:\"Construction\",syntax:[\"value unit\",\"unit(value, unit)\",\"unit(string)\"],description:\"Create a unit.\",examples:[\"5.5 mm\",\"3 inch\",'unit(7.1, \"kilogram\")','unit(\"23 deg\")'],seealso:[\"bignumber\",\"boolean\",\"complex\",\"index\",\"matrix\",\"number\",\"string\"]},e:vp,E:vp,false:{name:\"false\",category:\"Constants\",syntax:[\"false\"],description:\"Boolean value false\",examples:[\"false\"],seealso:[\"true\"]},i:{name:\"i\",category:\"Constants\",syntax:[\"i\"],description:\"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.\",examples:[\"i\",\"i * i\",\"sqrt(-1)\"],seealso:[]},Infinity:{name:\"Infinity\",category:\"Constants\",syntax:[\"Infinity\"],description:\"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.\",examples:[\"Infinity\",\"1 / 0\"],seealso:[]},LN2:{name:\"LN2\",category:\"Constants\",syntax:[\"LN2\"],description:\"Returns the natural logarithm of 2, approximately equal to 0.693\",examples:[\"LN2\",\"log(2)\"],seealso:[]},LN10:{name:\"LN10\",category:\"Constants\",syntax:[\"LN10\"],description:\"Returns the natural logarithm of 10, approximately equal to 2.302\",examples:[\"LN10\",\"log(10)\"],seealso:[]},LOG2E:{name:\"LOG2E\",category:\"Constants\",syntax:[\"LOG2E\"],description:\"Returns the base-2 logarithm of E, approximately equal to 1.442\",examples:[\"LOG2E\",\"log(e, 2)\"],seealso:[]},LOG10E:{name:\"LOG10E\",category:\"Constants\",syntax:[\"LOG10E\"],description:\"Returns the base-10 logarithm of E, approximately equal to 0.434\",examples:[\"LOG10E\",\"log(e, 10)\"],seealso:[]},NaN:{name:\"NaN\",category:\"Constants\",syntax:[\"NaN\"],description:\"Not a number\",examples:[\"NaN\",\"0 / 0\"],seealso:[]},null:{name:\"null\",category:\"Constants\",syntax:[\"null\"],description:\"Value null\",examples:[\"null\"],seealso:[\"true\",\"false\"]},pi:wp,PI:wp,phi:{name:\"phi\",category:\"Constants\",syntax:[\"phi\"],description:\"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...\",examples:[\"phi\"],seealso:[]},SQRT1_2:{name:\"SQRT1_2\",category:\"Constants\",syntax:[\"SQRT1_2\"],description:\"Returns the square root of 1/2, approximately equal to 0.707\",examples:[\"SQRT1_2\",\"sqrt(1/2)\"],seealso:[]},SQRT2:{name:\"SQRT2\",category:\"Constants\",syntax:[\"SQRT2\"],description:\"Returns the square root of 2, approximately equal to 1.414\",examples:[\"SQRT2\",\"sqrt(2)\"],seealso:[]},tau:{name:\"tau\",category:\"Constants\",syntax:[\"tau\"],description:\"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.\",examples:[\"tau\",\"2 * pi\"],seealso:[\"pi\"]},true:{name:\"true\",category:\"Constants\",syntax:[\"true\"],description:\"Boolean value true\",examples:[\"true\"],seealso:[\"false\"]},version:{name:\"version\",category:\"Constants\",syntax:[\"version\"],description:\"A string with the version number of math.js\",examples:[\"version\"],seealso:[]},speedOfLight:{description:\"Speed of light in vacuum\",examples:[\"speedOfLight\"]},gravitationConstant:{description:\"Newtonian constant of gravitation\",examples:[\"gravitationConstant\"]},planckConstant:{description:\"Planck constant\",examples:[\"planckConstant\"]},reducedPlanckConstant:{description:\"Reduced Planck constant\",examples:[\"reducedPlanckConstant\"]},magneticConstant:{description:\"Magnetic constant (vacuum permeability)\",examples:[\"magneticConstant\"]},electricConstant:{description:\"Electric constant (vacuum permeability)\",examples:[\"electricConstant\"]},vacuumImpedance:{description:\"Characteristic impedance of vacuum\",examples:[\"vacuumImpedance\"]},coulomb:{description:\"Coulomb's constant. Deprecated in favor of coulombConstant\",examples:[\"coulombConstant\"]},coulombConstant:{description:\"Coulomb's constant\",examples:[\"coulombConstant\"]},elementaryCharge:{description:\"Elementary charge\",examples:[\"elementaryCharge\"]},bohrMagneton:{description:\"Bohr magneton\",examples:[\"bohrMagneton\"]},conductanceQuantum:{description:\"Conductance quantum\",examples:[\"conductanceQuantum\"]},inverseConductanceQuantum:{description:\"Inverse conductance quantum\",examples:[\"inverseConductanceQuantum\"]},magneticFluxQuantum:{description:\"Magnetic flux quantum\",examples:[\"magneticFluxQuantum\"]},nuclearMagneton:{description:\"Nuclear magneton\",examples:[\"nuclearMagneton\"]},klitzing:{description:\"Von Klitzing constant\",examples:[\"klitzing\"]},bohrRadius:{description:\"Bohr radius\",examples:[\"bohrRadius\"]},classicalElectronRadius:{description:\"Classical electron radius\",examples:[\"classicalElectronRadius\"]},electronMass:{description:\"Electron mass\",examples:[\"electronMass\"]},fermiCoupling:{description:\"Fermi coupling constant\",examples:[\"fermiCoupling\"]},fineStructure:{description:\"Fine-structure constant\",examples:[\"fineStructure\"]},hartreeEnergy:{description:\"Hartree energy\",examples:[\"hartreeEnergy\"]},protonMass:{description:\"Proton mass\",examples:[\"protonMass\"]},deuteronMass:{description:\"Deuteron Mass\",examples:[\"deuteronMass\"]},neutronMass:{description:\"Neutron mass\",examples:[\"neutronMass\"]},quantumOfCirculation:{description:\"Quantum of circulation\",examples:[\"quantumOfCirculation\"]},rydberg:{description:\"Rydberg constant\",examples:[\"rydberg\"]},thomsonCrossSection:{description:\"Thomson cross section\",examples:[\"thomsonCrossSection\"]},weakMixingAngle:{description:\"Weak mixing angle\",examples:[\"weakMixingAngle\"]},efimovFactor:{description:\"Efimov factor\",examples:[\"efimovFactor\"]},atomicMass:{description:\"Atomic mass constant\",examples:[\"atomicMass\"]},avogadro:{description:\"Avogadro's number\",examples:[\"avogadro\"]},boltzmann:{description:\"Boltzmann constant\",examples:[\"boltzmann\"]},faraday:{description:\"Faraday constant\",examples:[\"faraday\"]},firstRadiation:{description:\"First radiation constant\",examples:[\"firstRadiation\"]},loschmidt:{description:\"Loschmidt constant at T=273.15 K and p=101.325 kPa\",examples:[\"loschmidt\"]},gasConstant:{description:\"Gas constant\",examples:[\"gasConstant\"]},molarPlanckConstant:{description:\"Molar Planck constant\",examples:[\"molarPlanckConstant\"]},molarVolume:{description:\"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa\",examples:[\"molarVolume\"]},sackurTetrode:{description:\"Sackur-Tetrode constant at T=1 K and p=101.325 kPa\",examples:[\"sackurTetrode\"]},secondRadiation:{description:\"Second radiation constant\",examples:[\"secondRadiation\"]},stefanBoltzmann:{description:\"Stefan-Boltzmann constant\",examples:[\"stefanBoltzmann\"]},wienDisplacement:{description:\"Wien displacement law constant\",examples:[\"wienDisplacement\"]},molarMass:{description:\"Molar mass constant\",examples:[\"molarMass\"]},molarMassC12:{description:\"Molar mass constant of carbon-12\",examples:[\"molarMassC12\"]},gravity:{description:\"Standard acceleration of gravity (standard acceleration of free-fall on Earth)\",examples:[\"gravity\"]},planckLength:{description:\"Planck length\",examples:[\"planckLength\"]},planckMass:{description:\"Planck mass\",examples:[\"planckMass\"]},planckTime:{description:\"Planck time\",examples:[\"planckTime\"]},planckCharge:{description:\"Planck charge\",examples:[\"planckCharge\"]},planckTemperature:{description:\"Planck temperature\",examples:[\"planckTemperature\"]},derivative:{name:\"derivative\",category:\"Algebra\",syntax:[\"derivative(expr, variable)\",\"derivative(expr, variable, {simplify: boolean})\"],description:\"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.\",examples:['derivative(\"2x^3\", \"x\")','derivative(\"2x^3\", \"x\", {simplify: false})','derivative(\"2x^2 + 3x + 4\", \"x\")','derivative(\"sin(2x)\", \"x\")','f = parse(\"x^2 + x\")','x = parse(\"x\")',\"df = derivative(f, x)\",\"df.evaluate({x: 3})\"],seealso:[\"simplify\",\"parse\",\"evaluate\"]},lsolve:{name:\"lsolve\",category:\"Algebra\",syntax:[\"x=lsolve(L, b)\"],description:\"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.\",examples:[\"a = [-2, 3; 2, 1]\",\"b = [11, 9]\",\"x = lsolve(a, b)\"],seealso:[\"lsolveAll\",\"lup\",\"lusolve\",\"usolve\",\"matrix\",\"sparse\"]},lsolveAll:{name:\"lsolveAll\",category:\"Algebra\",syntax:[\"x=lsolveAll(L, b)\"],description:\"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.\",examples:[\"a = [-2, 3; 2, 1]\",\"b = [11, 9]\",\"x = lsolve(a, b)\"],seealso:[\"lsolve\",\"lup\",\"lusolve\",\"usolve\",\"matrix\",\"sparse\"]},lup:{name:\"lup\",category:\"Algebra\",syntax:[\"lup(m)\"],description:\"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U\",examples:[\"lup([[2, 1], [1, 4]])\",\"lup(matrix([[2, 1], [1, 4]]))\",\"lup(sparse([[2, 1], [1, 4]]))\"],seealso:[\"lusolve\",\"lsolve\",\"usolve\",\"matrix\",\"sparse\",\"slu\",\"qr\"]},lusolve:{name:\"lusolve\",category:\"Algebra\",syntax:[\"x=lusolve(A, b)\",\"x=lusolve(lu, b)\"],description:\"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.\",examples:[\"a = [-2, 3; 2, 1]\",\"b = [11, 9]\",\"x = lusolve(a, b)\"],seealso:[\"lup\",\"slu\",\"lsolve\",\"usolve\",\"matrix\",\"sparse\"]},leafCount:{name:\"leafCount\",category:\"Algebra\",syntax:[\"leafCount(expr)\"],description:\"Computes the number of leaves in the parse tree of the given expression\",examples:['leafCount(\"e^(i*pi)-1\")','leafCount(parse(\"{a: 22/7, b: 10^(1/2)}\"))'],seealso:[\"simplify\"]},polynomialRoot:{name:\"polynomialRoot\",category:\"Algebra\",syntax:[\"x=polynomialRoot(-6, 3)\",\"x=polynomialRoot(4, -4, 1)\",\"x=polynomialRoot(-8, 12, -6, 1)\"],description:\"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.\",examples:[\"a = polynomialRoot(-6, 11, -6, 1)\"],seealso:[\"cbrt\",\"sqrt\"]},resolve:{name:\"resolve\",category:\"Algebra\",syntax:[\"resolve(node, scope)\"],description:\"Recursively substitute variables in an expression tree.\",examples:['resolve(parse(\"1 + x\"), { x: 7 })','resolve(parse(\"size(text)\"), { text: \"Hello World\" })','resolve(parse(\"x + y\"), { x: parse(\"3z\") })','resolve(parse(\"3x\"), { x: parse(\"y+z\"), z: parse(\"w^y\") })'],seealso:[\"simplify\",\"evaluate\"],mayThrow:[\"ReferenceError\"]},simplify:{name:\"simplify\",category:\"Algebra\",syntax:[\"simplify(expr)\",\"simplify(expr, rules)\"],description:\"Simplify an expression tree.\",examples:['simplify(\"3 + 2 / 4\")','simplify(\"2x + x\")','f = parse(\"x * (x + 2 + x)\")',\"simplified = simplify(f)\",\"simplified.evaluate({x: 2})\"],seealso:[\"simplifyCore\",\"derivative\",\"evaluate\",\"parse\",\"rationalize\",\"resolve\"]},simplifyConstant:{name:\"simplifyConstant\",category:\"Algebra\",syntax:[\"simplifyConstant(expr)\",\"simplifyConstant(expr, options)\"],description:\"Replace constant subexpressions of node with their values.\",examples:['simplifyConstant(\"(3-3)*x\")','simplifyConstant(parse(\"z-cos(tau/8)\"))'],seealso:[\"simplify\",\"simplifyCore\",\"evaluate\"]},simplifyCore:{name:\"simplifyCore\",category:\"Algebra\",syntax:[\"simplifyCore(node)\"],description:\"Perform simple one-pass simplifications on an expression tree.\",examples:['simplifyCore(parse(\"0*x\"))','simplifyCore(parse(\"(x+0)*2\"))'],seealso:[\"simplify\",\"simplifyConstant\",\"evaluate\"]},symbolicEqual:{name:\"symbolicEqual\",category:\"Algebra\",syntax:[\"symbolicEqual(expr1, expr2)\",\"symbolicEqual(expr1, expr2, options)\"],description:\"Returns true if the difference of the expressions simplifies to 0\",examples:['symbolicEqual(\"x*y\",\"y*x\")','symbolicEqual(\"abs(x^2)\", \"x^2\")','symbolicEqual(\"abs(x)\", \"x\", {context: {abs: {trivial: true}}})'],seealso:[\"simplify\",\"evaluate\"]},rationalize:{name:\"rationalize\",category:\"Algebra\",syntax:[\"rationalize(expr)\",\"rationalize(expr, scope)\",\"rationalize(expr, scope, detailed)\"],description:\"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.\",examples:['rationalize(\"2x/y - y/(x+1)\")','rationalize(\"2x/y - y/(x+1)\", true)'],seealso:[\"simplify\"]},slu:{name:\"slu\",category:\"Algebra\",syntax:[\"slu(A, order, threshold)\"],description:\"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U\",examples:[\"slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)\"],seealso:[\"lusolve\",\"lsolve\",\"usolve\",\"matrix\",\"sparse\",\"lup\",\"qr\"]},usolve:{name:\"usolve\",category:\"Algebra\",syntax:[\"x=usolve(U, b)\"],description:\"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.\",examples:[\"x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])\"],seealso:[\"usolveAll\",\"lup\",\"lusolve\",\"lsolve\",\"matrix\",\"sparse\"]},usolveAll:{name:\"usolveAll\",category:\"Algebra\",syntax:[\"x=usolve(U, b)\"],description:\"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.\",examples:[\"x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])\"],seealso:[\"usolve\",\"lup\",\"lusolve\",\"lsolve\",\"matrix\",\"sparse\"]},qr:{name:\"qr\",category:\"Algebra\",syntax:[\"qr(A)\"],description:\"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.\",examples:[\"qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])\"],seealso:[\"lup\",\"slu\",\"matrix\"]},abs:{name:\"abs\",category:\"Arithmetic\",syntax:[\"abs(x)\"],description:\"Compute the absolute value.\",examples:[\"abs(3.5)\",\"abs(-4.2)\"],seealso:[\"sign\"]},add:{name:\"add\",category:\"Operators\",syntax:[\"x + y\",\"add(x, y)\"],description:\"Add two values.\",examples:[\"a = 2.1 + 3.6\",\"a - 3.6\",\"3 + 2i\",\"3 cm + 2 inch\",'\"2.3\" + \"4\"'],seealso:[\"subtract\"]},cbrt:{name:\"cbrt\",category:\"Arithmetic\",syntax:[\"cbrt(x)\",\"cbrt(x, allRoots)\"],description:\"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned\",examples:[\"cbrt(64)\",\"cube(4)\",\"cbrt(-8)\",\"cbrt(2 + 3i)\",\"cbrt(8i)\",\"cbrt(8i, true)\",\"cbrt(27 m^3)\"],seealso:[\"square\",\"sqrt\",\"cube\",\"multiply\"]},ceil:{name:\"ceil\",category:\"Arithmetic\",syntax:[\"ceil(x)\",\"ceil(x, n)\",\"ceil(unit, valuelessUnit)\",\"ceil(unit, n, valuelessUnit)\"],description:\"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.\",examples:[\"ceil(3.2)\",\"ceil(3.8)\",\"ceil(-4.2)\",\"ceil(3.241cm, cm)\",\"ceil(3.241cm, 2, cm)\"],seealso:[\"floor\",\"fix\",\"round\"]},cube:{name:\"cube\",category:\"Arithmetic\",syntax:[\"cube(x)\"],description:\"Compute the cube of a value. The cube of x is x * x * x.\",examples:[\"cube(2)\",\"2^3\",\"2 * 2 * 2\"],seealso:[\"multiply\",\"square\",\"pow\"]},divide:{name:\"divide\",category:\"Operators\",syntax:[\"x / y\",\"divide(x, y)\"],description:\"Divide two values.\",examples:[\"a = 2 / 3\",\"a * 3\",\"4.5 / 2\",\"3 + 4 / 2\",\"(3 + 4) / 2\",\"18 km / 4.5\"],seealso:[\"multiply\"]},dotDivide:{name:\"dotDivide\",category:\"Operators\",syntax:[\"x ./ y\",\"dotDivide(x, y)\"],description:\"Divide two values element wise.\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"b = [2, 1, 1; 3, 2, 5]\",\"a ./ b\"],seealso:[\"multiply\",\"dotMultiply\",\"divide\"]},dotMultiply:{name:\"dotMultiply\",category:\"Operators\",syntax:[\"x .* y\",\"dotMultiply(x, y)\"],description:\"Multiply two values element wise.\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"b = [2, 1, 1; 3, 2, 5]\",\"a .* b\"],seealso:[\"multiply\",\"divide\",\"dotDivide\"]},dotPow:{name:\"dotPow\",category:\"Operators\",syntax:[\"x .^ y\",\"dotPow(x, y)\"],description:\"Calculates the power of x to y element wise.\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"a .^ 2\"],seealso:[\"pow\"]},exp:{name:\"exp\",category:\"Arithmetic\",syntax:[\"exp(x)\"],description:\"Calculate the exponent of a value.\",examples:[\"exp(1.3)\",\"e ^ 1.3\",\"log(exp(1.3))\",\"x = 2.4\",\"(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula\"],seealso:[\"expm\",\"expm1\",\"pow\",\"log\"]},expm:{name:\"expm\",category:\"Arithmetic\",syntax:[\"exp(x)\"],description:\"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.\",examples:[\"expm([[0,2],[0,0]])\"],seealso:[\"exp\"]},expm1:{name:\"expm1\",category:\"Arithmetic\",syntax:[\"expm1(x)\"],description:\"Calculate the value of subtracting 1 from the exponential value.\",examples:[\"expm1(2)\",\"pow(e, 2) - 1\",\"log(expm1(2) + 1)\"],seealso:[\"exp\",\"pow\",\"log\"]},fix:{name:\"fix\",category:\"Arithmetic\",syntax:[\"fix(x)\",\"fix(x, n)\",\"fix(unit, valuelessUnit)\",\"fix(unit, n, valuelessUnit)\"],description:\"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.\",examples:[\"fix(3.2)\",\"fix(3.8)\",\"fix(-4.2)\",\"fix(-4.8)\",\"fix(3.241cm, cm)\",\"fix(3.241cm, 2, cm)\"],seealso:[\"ceil\",\"floor\",\"round\"]},floor:{name:\"floor\",category:\"Arithmetic\",syntax:[\"floor(x)\",\"floor(x, n)\",\"floor(unit, valuelessUnit)\",\"floor(unit, n, valuelessUnit)\"],description:\"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.\",examples:[\"floor(3.2)\",\"floor(3.8)\",\"floor(-4.2)\",\"floor(3.241cm, cm)\",\"floor(3.241cm, 2, cm)\"],seealso:[\"ceil\",\"fix\",\"round\"]},gcd:{name:\"gcd\",category:\"Arithmetic\",syntax:[\"gcd(a, b)\",\"gcd(a, b, c, ...)\"],description:\"Compute the greatest common divisor.\",examples:[\"gcd(8, 12)\",\"gcd(-4, 6)\",\"gcd(25, 15, -10)\"],seealso:[\"lcm\",\"xgcd\"]},hypot:{name:\"hypot\",category:\"Arithmetic\",syntax:[\"hypot(a, b, c, ...)\",\"hypot([a, b, c, ...])\"],description:\"Calculate the hypotenuse of a list with values.\",examples:[\"hypot(3, 4)\",\"sqrt(3^2 + 4^2)\",\"hypot(-2)\",\"hypot([3, 4, 5])\"],seealso:[\"abs\",\"norm\"]},lcm:{name:\"lcm\",category:\"Arithmetic\",syntax:[\"lcm(x, y)\"],description:\"Compute the least common multiple.\",examples:[\"lcm(4, 6)\",\"lcm(6, 21)\",\"lcm(6, 21, 5)\"],seealso:[\"gcd\"]},log:{name:\"log\",category:\"Arithmetic\",syntax:[\"log(x)\",\"log(x, base)\"],description:\"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).\",examples:[\"log(3.5)\",\"a = log(2.4)\",\"exp(a)\",\"10 ^ 4\",\"log(10000, 10)\",\"log(10000) / log(10)\",\"b = log(1024, 2)\",\"2 ^ b\"],seealso:[\"exp\",\"log1p\",\"log2\",\"log10\"]},log2:{name:\"log2\",category:\"Arithmetic\",syntax:[\"log2(x)\"],description:\"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.\",examples:[\"log2(0.03125)\",\"log2(16)\",\"log2(16) / log2(2)\",\"pow(2, 4)\"],seealso:[\"exp\",\"log1p\",\"log\",\"log10\"]},log1p:{name:\"log1p\",category:\"Arithmetic\",syntax:[\"log1p(x)\",\"log1p(x, base)\"],description:\"Calculate the logarithm of a `value+1`\",examples:[\"log1p(2.5)\",\"exp(log1p(1.4))\",\"pow(10, 4)\",\"log1p(9999, 10)\",\"log1p(9999) / log(10)\"],seealso:[\"exp\",\"log\",\"log2\",\"log10\"]},log10:{name:\"log10\",category:\"Arithmetic\",syntax:[\"log10(x)\"],description:\"Compute the 10-base logarithm of a value.\",examples:[\"log10(0.00001)\",\"log10(10000)\",\"10 ^ 4\",\"log(10000) / log(10)\",\"log(10000, 10)\"],seealso:[\"exp\",\"log\"]},mod:{name:\"mod\",category:\"Operators\",syntax:[\"x % y\",\"x mod y\",\"mod(x, y)\"],description:\"Calculates the modulus, the remainder of an integer division.\",examples:[\"7 % 3\",\"11 % 2\",\"10 mod 4\",\"isOdd(x) = x % 2\",\"isOdd(2)\",\"isOdd(3)\"],seealso:[\"divide\"]},multiply:{name:\"multiply\",category:\"Operators\",syntax:[\"x * y\",\"multiply(x, y)\"],description:\"multiply two values.\",examples:[\"a = 2.1 * 3.4\",\"a / 3.4\",\"2 * 3 + 4\",\"2 * (3 + 4)\",\"3 * 2.1 km\"],seealso:[\"divide\"]},norm:{name:\"norm\",category:\"Arithmetic\",syntax:[\"norm(x)\",\"norm(x, p)\"],description:\"Calculate the norm of a number, vector or matrix.\",examples:[\"abs(-3.5)\",\"norm(-3.5)\",\"norm(3 - 4i)\",\"norm([1, 2, -3], Infinity)\",\"norm([1, 2, -3], -Infinity)\",\"norm([3, 4], 2)\",\"norm([[1, 2], [3, 4]], 1)\",'norm([[1, 2], [3, 4]], \"inf\")','norm([[1, 2], [3, 4]], \"fro\")']},nthRoot:{name:\"nthRoot\",category:\"Arithmetic\",syntax:[\"nthRoot(a)\",\"nthRoot(a, root)\"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation \"x^root = A\".',examples:[\"4 ^ 3\",\"nthRoot(64, 3)\",\"nthRoot(9, 2)\",\"sqrt(9)\"],seealso:[\"nthRoots\",\"pow\",\"sqrt\"]},nthRoots:{name:\"nthRoots\",category:\"Arithmetic\",syntax:[\"nthRoots(A)\",\"nthRoots(A, root)\"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation \"x^root = A\". This function returns an array of complex values.',examples:[\"nthRoots(1)\",\"nthRoots(1, 3)\"],seealso:[\"sqrt\",\"pow\",\"nthRoot\"]},pow:{name:\"pow\",category:\"Operators\",syntax:[\"x ^ y\",\"pow(x, y)\"],description:\"Calculates the power of x to y, x^y.\",examples:[\"2^3\",\"2*2*2\",\"1 + e ^ (pi * i)\",\"pow([[1, 2], [4, 3]], 2)\",\"pow([[1, 2], [4, 3]], -1)\"],seealso:[\"multiply\",\"nthRoot\",\"nthRoots\",\"sqrt\"]},round:{name:\"round\",category:\"Arithmetic\",syntax:[\"round(x)\",\"round(x, n)\",\"round(unit, valuelessUnit)\",\"round(unit, n, valuelessUnit)\"],description:\"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.\",examples:[\"round(3.2)\",\"round(3.8)\",\"round(-4.2)\",\"round(-4.8)\",\"round(pi, 3)\",\"round(123.45678, 2)\",\"round(3.241cm, 2, cm)\",\"round([3.2, 3.8, -4.7])\"],seealso:[\"ceil\",\"floor\",\"fix\"]},sign:{name:\"sign\",category:\"Arithmetic\",syntax:[\"sign(x)\"],description:\"Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.\",examples:[\"sign(3.5)\",\"sign(-4.2)\",\"sign(0)\"],seealso:[\"abs\"]},sqrt:{name:\"sqrt\",category:\"Arithmetic\",syntax:[\"sqrt(x)\"],description:\"Compute the square root value. If x = y * y, then y is the square root of x.\",examples:[\"sqrt(25)\",\"5 * 5\",\"sqrt(-1)\"],seealso:[\"square\",\"sqrtm\",\"multiply\",\"nthRoot\",\"nthRoots\",\"pow\"]},sqrtm:{name:\"sqrtm\",category:\"Arithmetic\",syntax:[\"sqrtm(x)\"],description:\"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.\",examples:[\"sqrtm([[33, 24], [48, 57]])\"],seealso:[\"sqrt\",\"abs\",\"square\",\"multiply\"]},square:{name:\"square\",category:\"Arithmetic\",syntax:[\"square(x)\"],description:\"Compute the square of a value. The square of x is x * x.\",examples:[\"square(3)\",\"sqrt(9)\",\"3^2\",\"3 * 3\"],seealso:[\"multiply\",\"pow\",\"sqrt\",\"cube\"]},subtract:{name:\"subtract\",category:\"Operators\",syntax:[\"x - y\",\"subtract(x, y)\"],description:\"subtract two values.\",examples:[\"a = 5.3 - 2\",\"a + 2\",\"2/3 - 1/6\",\"2 * 3 - 3\",\"2.1 km - 500m\"],seealso:[\"add\"]},unaryMinus:{name:\"unaryMinus\",category:\"Operators\",syntax:[\"-x\",\"unaryMinus(x)\"],description:\"Inverse the sign of a value. Converts booleans and strings to numbers.\",examples:[\"-4.5\",\"-(-5.6)\",'-\"22\"'],seealso:[\"add\",\"subtract\",\"unaryPlus\"]},unaryPlus:{name:\"unaryPlus\",category:\"Operators\",syntax:[\"+x\",\"unaryPlus(x)\"],description:\"Converts booleans and strings to numbers.\",examples:[\"+true\",'+\"2\"'],seealso:[\"add\",\"subtract\",\"unaryMinus\"]},xgcd:{name:\"xgcd\",category:\"Arithmetic\",syntax:[\"xgcd(a, b)\"],description:\"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.\",examples:[\"xgcd(8, 12)\",\"gcd(8, 12)\",\"xgcd(36163, 21199)\"],seealso:[\"gcd\",\"lcm\"]},invmod:{name:\"invmod\",category:\"Arithmetic\",syntax:[\"invmod(a, b)\"],description:\"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)\",examples:[\"invmod(8, 12)\",\"invmod(7, 13)\",\"invmod(15151, 15122)\"],seealso:[\"gcd\",\"xgcd\"]},bitAnd:{name:\"bitAnd\",category:\"Bitwise\",syntax:[\"x & y\",\"bitAnd(x, y)\"],description:\"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0\",examples:[\"5 & 3\",\"bitAnd(53, 131)\",\"[1, 12, 31] & 42\"],seealso:[\"bitNot\",\"bitOr\",\"bitXor\",\"leftShift\",\"rightArithShift\",\"rightLogShift\"]},bitNot:{name:\"bitNot\",category:\"Bitwise\",syntax:[\"~x\",\"bitNot(x)\"],description:\"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.\",examples:[\"~1\",\"~2\",\"bitNot([2, -3, 4])\"],seealso:[\"bitAnd\",\"bitOr\",\"bitXor\",\"leftShift\",\"rightArithShift\",\"rightLogShift\"]},bitOr:{name:\"bitOr\",category:\"Bitwise\",syntax:[\"x | y\",\"bitOr(x, y)\"],description:\"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.\",examples:[\"5 | 3\",\"bitOr([1, 2, 3], 4)\"],seealso:[\"bitAnd\",\"bitNot\",\"bitXor\",\"leftShift\",\"rightArithShift\",\"rightLogShift\"]},bitXor:{name:\"bitXor\",category:\"Bitwise\",syntax:[\"bitXor(x, y)\"],description:\"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.\",examples:[\"bitOr(1, 2)\",\"bitXor([2, 3, 4], 4)\"],seealso:[\"bitAnd\",\"bitNot\",\"bitOr\",\"leftShift\",\"rightArithShift\",\"rightLogShift\"]},leftShift:{name:\"leftShift\",category:\"Bitwise\",syntax:[\"x << y\",\"leftShift(x, y)\"],description:\"Bitwise left logical shift of a value x by y number of bits.\",examples:[\"4 << 1\",\"8 >> 1\"],seealso:[\"bitAnd\",\"bitNot\",\"bitOr\",\"bitXor\",\"rightArithShift\",\"rightLogShift\"]},rightArithShift:{name:\"rightArithShift\",category:\"Bitwise\",syntax:[\"x >> y\",\"rightArithShift(x, y)\"],description:\"Bitwise right arithmetic shift of a value x by y number of bits.\",examples:[\"8 >> 1\",\"4 << 1\",\"-12 >> 2\"],seealso:[\"bitAnd\",\"bitNot\",\"bitOr\",\"bitXor\",\"leftShift\",\"rightLogShift\"]},rightLogShift:{name:\"rightLogShift\",category:\"Bitwise\",syntax:[\"x >>> y\",\"rightLogShift(x, y)\"],description:\"Bitwise right logical shift of a value x by y number of bits.\",examples:[\"8 >>> 1\",\"4 << 1\",\"-12 >>> 2\"],seealso:[\"bitAnd\",\"bitNot\",\"bitOr\",\"bitXor\",\"leftShift\",\"rightArithShift\"]},bellNumbers:{name:\"bellNumbers\",category:\"Combinatorics\",syntax:[\"bellNumbers(n)\"],description:\"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.\",examples:[\"bellNumbers(3)\",\"bellNumbers(8)\"],seealso:[\"stirlingS2\"]},catalan:{name:\"catalan\",category:\"Combinatorics\",syntax:[\"catalan(n)\"],description:\"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.\",examples:[\"catalan(3)\",\"catalan(8)\"],seealso:[\"bellNumbers\"]},composition:{name:\"composition\",category:\"Combinatorics\",syntax:[\"composition(n, k)\"],description:\"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.\",examples:[\"composition(5, 3)\"],seealso:[\"combinations\"]},stirlingS2:{name:\"stirlingS2\",category:\"Combinatorics\",syntax:[\"stirlingS2(n, k)\"],description:\"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.\",examples:[\"stirlingS2(5, 3)\"],seealso:[\"bellNumbers\"]},config:{name:\"config\",category:\"Core\",syntax:[\"config()\",\"config(options)\"],description:\"Get configuration or change configuration.\",examples:[\"config()\",\"1/3 + 1/4\",'config({number: \"Fraction\"})',\"1/3 + 1/4\"],seealso:[]},import:{name:\"import\",category:\"Core\",syntax:[\"import(functions)\",\"import(functions, options)\"],description:\"Import functions or constants from an object.\",examples:[\"import({myFn: f(x)=x^2, myConstant: 32 })\",\"myFn(2)\",\"myConstant\"],seealso:[]},typed:{name:\"typed\",category:\"Core\",syntax:[\"typed(signatures)\",\"typed(name, signatures)\"],description:\"Create a typed function.\",examples:['double = typed({ \"number\": f(x)=x+x, \"string\": f(x)=concat(x,x) })',\"double(2)\",'double(\"hello\")'],seealso:[]},arg:{name:\"arg\",category:\"Complex\",syntax:[\"arg(x)\"],description:\"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).\",examples:[\"arg(2 + 2i)\",\"atan2(3, 2)\",\"arg(2 + 3i)\"],seealso:[\"re\",\"im\",\"conj\",\"abs\"]},conj:{name:\"conj\",category:\"Complex\",syntax:[\"conj(x)\"],description:\"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.\",examples:[\"conj(2 + 3i)\",\"conj(2 - 3i)\",\"conj(-5.2i)\"],seealso:[\"re\",\"im\",\"abs\",\"arg\"]},re:{name:\"re\",category:\"Complex\",syntax:[\"re(x)\"],description:\"Get the real part of a complex number.\",examples:[\"re(2 + 3i)\",\"im(2 + 3i)\",\"re(-5.2i)\",\"re(2.4)\"],seealso:[\"im\",\"conj\",\"abs\",\"arg\"]},im:{name:\"im\",category:\"Complex\",syntax:[\"im(x)\"],description:\"Get the imaginary part of a complex number.\",examples:[\"im(2 + 3i)\",\"re(2 + 3i)\",\"im(-5.2i)\",\"im(2.4)\"],seealso:[\"re\",\"conj\",\"abs\",\"arg\"]},evaluate:{name:\"evaluate\",category:\"Expression\",syntax:[\"evaluate(expression)\",\"evaluate(expression, scope)\",\"evaluate([expr1, expr2, expr3, ...])\",\"evaluate([expr1, expr2, expr3, ...], scope)\"],description:\"Evaluate an expression or an array with expressions.\",examples:['evaluate(\"2 + 3\")','evaluate(\"sqrt(16)\")','evaluate(\"2 inch to cm\")','evaluate(\"sin(x * pi)\", { \"x\": 1/2 })','evaluate([\"width=2\", \"height=4\",\"width*height\"])'],seealso:[\"parser\",\"parse\",\"compile\"]},help:{name:\"help\",category:\"Expression\",syntax:[\"help(object)\",\"help(string)\"],description:\"Display documentation on a function or data type.\",examples:[\"help(sqrt)\",'help(\"complex\")'],seealso:[]},parse:{name:\"parse\",category:\"Expression\",syntax:[\"parse(expr)\",\"parse(expr, options)\",\"parse([expr1, expr2, expr3, ...])\",\"parse([expr1, expr2, expr3, ...], options)\"],description:\"Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().\",examples:['node1 = parse(\"sqrt(3^2 + 4^2)\")',\"node1.evaluate()\",\"code1 = node1.compile()\",\"code1.evaluate()\",\"scope = {a: 3, b: 4}\",'node2 = parse(\"a * b\")',\"node2.evaluate(scope)\",\"code2 = node2.compile()\",\"code2.evaluate(scope)\"],seealso:[\"parser\",\"evaluate\",\"compile\"]},parser:{name:\"parser\",category:\"Expression\",syntax:[\"parser()\"],description:\"Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.\",examples:[\"myParser = parser()\",'myParser.evaluate(\"sqrt(3^2 + 4^2)\")','myParser.set(\"x\", 3)','myParser.evaluate(\"y = x + 3\")','myParser.evaluate([\"y = x + 3\", \"y = y + 1\"])','myParser.get(\"y\")'],seealso:[\"evaluate\",\"parse\",\"compile\"]},compile:{name:\"compile\",category:\"Expression\",syntax:[\"compile(expr) \",\"compile([expr1, expr2, expr3, ...])\"],description:\"Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.\",examples:['code1 = compile(\"sqrt(3^2 + 4^2)\")',\"code1.evaluate() \",'code2 = compile(\"a * b\")',\"code2.evaluate({a: 3, b: 4})\"],seealso:[\"parser\",\"parse\",\"evaluate\"]},distance:{name:\"distance\",category:\"Geometry\",syntax:[\"distance([x1, y1], [x2, y2])\",\"distance([[x1, y1], [x2, y2]])\"],description:\"Calculates the Euclidean distance between two points.\",examples:[\"distance([0,0], [4,4])\",\"distance([[0,0], [4,4]])\"],seealso:[]},intersect:{name:\"intersect\",category:\"Geometry\",syntax:[\"intersect(expr1, expr2, expr3, expr4)\",\"intersect(expr1, expr2, expr3)\"],description:\"Computes the intersection point of lines and/or planes.\",examples:[\"intersect([0, 0], [10, 10], [10, 0], [0, 10])\",\"intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])\"],seealso:[]},and:{name:\"and\",category:\"Logical\",syntax:[\"x and y\",\"and(x, y)\"],description:\"Logical and. Test whether two values are both defined with a nonzero/nonempty value.\",examples:[\"true and false\",\"true and true\",\"2 and 4\"],seealso:[\"not\",\"or\",\"xor\"]},not:{name:\"not\",category:\"Logical\",syntax:[\"not x\",\"not(x)\"],description:\"Logical not. Flips the boolean value of given argument.\",examples:[\"not true\",\"not false\",\"not 2\",\"not 0\"],seealso:[\"and\",\"or\",\"xor\"]},nullish:{name:\"nullish\",category:\"Logical\",syntax:[\"x ?? y\",\"nullish(x, y)\"],description:\"Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.\",examples:[\"null ?? 42\",\"undefined ?? 42\",\"0 ?? 42\",\"false ?? 42\",\"null ?? undefined ?? 42\"],seealso:[\"and\",\"or\",\"not\"]},or:{name:\"or\",category:\"Logical\",syntax:[\"x or y\",\"or(x, y)\"],description:\"Logical or. Test if at least one value is defined with a nonzero/nonempty value.\",examples:[\"true or false\",\"false or false\",\"0 or 4\"],seealso:[\"not\",\"and\",\"xor\"]},xor:{name:\"xor\",category:\"Logical\",syntax:[\"x xor y\",\"xor(x, y)\"],description:\"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.\",examples:[\"true xor false\",\"false xor false\",\"true xor true\",\"0 xor 4\"],seealso:[\"not\",\"and\",\"or\"]},mapSlices:{name:\"mapSlices\",category:\"Matrix\",syntax:[\"mapSlices(A, dim, callback)\"],description:\"Generate a matrix one dimension less than A by applying callback to each slice of A along dimension dim.\",examples:[\"A = [[1, 2], [3, 4]]\",\"mapSlices(A, 1, sum)\",\"mapSlices(A, 2, prod)\"],seealso:[\"map\",\"forEach\"]},concat:{name:\"concat\",category:\"Matrix\",syntax:[\"concat(A, B, C, ...)\",\"concat(A, B, C, ..., dim)\"],description:\"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.\",examples:[\"A = [1, 2; 5, 6]\",\"B = [3, 4; 7, 8]\",\"concat(A, B)\",\"concat(A, B, 1)\",\"concat(A, B, 2)\"],seealso:[\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},count:{name:\"count\",category:\"Matrix\",syntax:[\"count(x)\"],description:\"Count the number of elements of a matrix, array or string.\",examples:[\"a = [1, 2; 3, 4; 5, 6]\",\"count(a)\",\"size(a)\",'count(\"hello world\")'],seealso:[\"size\"]},cross:{name:\"cross\",category:\"Matrix\",syntax:[\"cross(A, B)\"],description:\"Calculate the cross product for two vectors in three dimensional space.\",examples:[\"cross([1, 1, 0], [0, 1, 1])\",\"cross([3, -3, 1], [4, 9, 2])\",\"cross([2, 3, 4], [5, 6, 7])\"],seealso:[\"multiply\",\"dot\"]},column:{name:\"column\",category:\"Matrix\",syntax:[\"column(x, index)\"],description:\"Return a column from a matrix or array.\",examples:[\"A = [[1, 2], [3, 4]]\",\"column(A, 1)\",\"column(A, 2)\"],seealso:[\"row\",\"matrixFromColumns\"]},ctranspose:{name:\"ctranspose\",category:\"Matrix\",syntax:[\"x'\",\"ctranspose(x)\"],description:\"Complex Conjugate and Transpose a matrix\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"a'\",\"ctranspose(a)\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"zeros\"]},det:{name:\"det\",category:\"Matrix\",syntax:[\"det(x)\"],description:\"Calculate the determinant of a matrix\",examples:[\"det([1, 2; 3, 4])\",\"det([-2, 2, 3; -1, 1, 3; 2, 0, -1])\"],seealso:[\"concat\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},diag:{name:\"diag\",category:\"Matrix\",syntax:[\"diag(x)\",\"diag(x, k)\"],description:\"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.\",examples:[\"diag(1:3)\",\"diag(1:3, 1)\",\"a = [1, 2, 3; 4, 5, 6; 7, 8, 9]\",\"diag(a)\"],seealso:[\"concat\",\"det\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},diff:{name:\"diff\",category:\"Matrix\",syntax:[\"diff(arr)\",\"diff(arr, dim)\"],description:[\"Create a new matrix or array with the difference of the passed matrix or array.\",\"Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference\",\"If no dimension parameter is passed it is assumed as dimension 0\",\"Dimension is zero-based in javascript and one-based in the parser\",\"Arrays must be 'rectangular' meaning arrays like [1, 2]\",\"If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays\"],examples:[\"A = [1, 2, 4, 7, 0]\",\"diff(A)\",\"diff(A, 1)\",\"B = [[1, 2], [3, 4]]\",\"diff(B)\",\"diff(B, 1)\",\"diff(B, 2)\",\"diff(B, bignumber(2))\",\"diff([[1, 2], matrix([3, 4])], 2)\"],seealso:[\"subtract\",\"partitionSelect\"]},dot:{name:\"dot\",category:\"Matrix\",syntax:[\"dot(A, B)\",\"A * B\"],description:\"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn\",examples:[\"dot([2, 4, 1], [2, 2, 3])\",\"[2, 4, 1] * [2, 2, 3]\"],seealso:[\"multiply\",\"cross\"]},getMatrixDataType:{name:\"getMatrixDataType\",category:\"Matrix\",syntax:[\"getMatrixDataType(x)\"],description:'Find the data type of all elements in a matrix or array, for example \"number\" if all items are a number and \"Complex\" if all values are complex numbers. If a matrix contains more than one data type, it will return \"mixed\".',examples:[\"getMatrixDataType([1, 2, 3])\",\"getMatrixDataType([[5 cm], [2 inch]])\",'getMatrixDataType([1, \"text\"])',\"getMatrixDataType([1, bignumber(4)])\"],seealso:[\"matrix\",\"sparse\",\"typeOf\"]},identity:{name:\"identity\",category:\"Matrix\",syntax:[\"identity(n)\",\"identity(m, n)\",\"identity([m, n])\"],description:\"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.\",examples:[\"identity(3)\",\"identity(3, 5)\",\"a = [1, 2, 3; 4, 5, 6]\",\"identity(size(a))\"],seealso:[\"concat\",\"det\",\"diag\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},filter:{name:\"filter\",category:\"Matrix\",syntax:[\"filter(x, test)\"],description:\"Filter items in a matrix.\",examples:[\"isPositive(x) = x > 0\",\"filter([6, -2, -1, 4, 3], isPositive)\",\"filter([6, -2, 0, 1, 0], x != 0)\"],seealso:[\"sort\",\"map\",\"forEach\"]},flatten:{name:\"flatten\",category:\"Matrix\",syntax:[\"flatten(x)\"],description:\"Flatten a multi dimensional matrix into a single dimensional matrix.\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"size(a)\",\"b = flatten(a)\",\"size(b)\"],seealso:[\"concat\",\"resize\",\"size\",\"squeeze\"]},forEach:{name:\"forEach\",category:\"Matrix\",syntax:[\"forEach(x, callback)\"],description:\"Iterates over all elements of a matrix/array, and executes the given callback function.\",examples:[\"numberOfPets = {}\",\"addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;\",'forEach([\"Dog\",\"Cat\",\"Cat\"], addPet)',\"numberOfPets\"],seealso:[\"map\",\"sort\",\"filter\"]},inv:{name:\"inv\",category:\"Matrix\",syntax:[\"inv(x)\"],description:\"Calculate the inverse of a matrix\",examples:[\"inv([1, 2; 3, 4])\",\"inv(4)\",\"1 / 4\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},pinv:{name:\"pinv\",category:\"Matrix\",syntax:[\"pinv(x)\"],description:\"Calculate the Moore\u2013Penrose inverse of a matrix\",examples:[\"pinv([1, 2; 3, 4])\",\"pinv([[1, 0], [0, 1], [0, 1]])\",\"pinv(4)\"],seealso:[\"inv\"]},eigs:{name:\"eigs\",category:\"Matrix\",syntax:[\"eigs(x)\"],description:\"Calculate the eigenvalues and optionally eigenvectors of a square matrix\",examples:[\"eigs([[5, 2.3], [2.3, 1]])\",\"eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })\"],seealso:[\"inv\"]},kron:{name:\"kron\",category:\"Matrix\",syntax:[\"kron(x, y)\"],description:\"Calculates the Kronecker product of 2 matrices or vectors.\",examples:[\"kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])\",\"kron([1,1], [2,3,4])\"],seealso:[\"multiply\",\"dot\",\"cross\"]},matrixFromFunction:{name:\"matrixFromFunction\",category:\"Matrix\",syntax:[\"matrixFromFunction(size, fn)\",\"matrixFromFunction(size, fn, format)\",\"matrixFromFunction(size, fn, format, datatype)\",\"matrixFromFunction(size, format, fn)\",\"matrixFromFunction(size, format, datatype, fn)\"],description:\"Create a matrix by evaluating a generating function at each index.\",examples:[\"f(I) = I[1] - I[2]\",\"matrixFromFunction([3,3], f)\",\"g(I) = I[1] - I[2] == 1 ? 4 : 0\",'matrixFromFunction([100, 100], \"sparse\", g)',\"matrixFromFunction([5], random)\"],seealso:[\"matrix\",\"matrixFromRows\",\"matrixFromColumns\",\"zeros\"]},matrixFromRows:{name:\"matrixFromRows\",category:\"Matrix\",syntax:[\"matrixFromRows(...arr)\",\"matrixFromRows(row1, row2)\",\"matrixFromRows(row1, row2, row3)\"],description:\"Create a dense matrix from vectors as individual rows.\",examples:[\"matrixFromRows([1, 2, 3], [[4],[5],[6]])\"],seealso:[\"matrix\",\"matrixFromColumns\",\"matrixFromFunction\",\"zeros\"]},matrixFromColumns:{name:\"matrixFromColumns\",category:\"Matrix\",syntax:[\"matrixFromColumns(...arr)\",\"matrixFromColumns(row1, row2)\",\"matrixFromColumns(row1, row2, row3)\"],description:\"Create a dense matrix from vectors as individual columns.\",examples:[\"matrixFromColumns([1, 2, 3], [[4],[5],[6]])\"],seealso:[\"matrix\",\"matrixFromRows\",\"matrixFromFunction\",\"zeros\"]},map:{name:\"map\",category:\"Matrix\",syntax:[\"map(x, callback)\",\"map(x, y, ..., callback)\"],description:\"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.\",examples:[\"map([1, 2, 3], square)\",\"map([1, 2], [3, 4], f(a,b) = a + b)\"],seealso:[\"filter\",\"forEach\"]},ones:{name:\"ones\",category:\"Matrix\",syntax:[\"ones(m)\",\"ones(m, n)\",\"ones(m, n, p, ...)\",\"ones([m])\",\"ones([m, n])\",\"ones([m, n, p, ...])\"],description:\"Create a matrix containing ones.\",examples:[\"ones(3)\",\"ones(3, 5)\",\"ones([2,3]) * 4.5\",\"a = [1, 2, 3; 4, 5, 6]\",\"ones(size(a))\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},partitionSelect:{name:\"partitionSelect\",category:\"Matrix\",syntax:[\"partitionSelect(x, k)\",\"partitionSelect(x, k, compare)\"],description:\"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.\",examples:[\"partitionSelect([5, 10, 1], 2)\",'partitionSelect([\"C\", \"B\", \"A\", \"D\"], 1, compareText)',\"arr = [5, 2, 1]\",\"partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]\",\"arr\",\"partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]\",\"arr\"],seealso:[\"sort\"]},range:{name:\"range\",category:\"Type\",syntax:[\"start:end\",\"start:step:end\",\"range(start, end)\",\"range(start, end, step)\",\"range(string)\"],description:\"Create a range. Lower bound of the range is included, upper bound is excluded.\",examples:[\"1:5\",\"3:-1:-3\",\"range(3, 7)\",\"range(0, 12, 2)\",'range(\"4:10\")',\"range(1m, 1m, 3m)\",\"a = [1, 2, 3, 4; 5, 6, 7, 8]\",\"a[1:2, 1:2]\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},resize:{name:\"resize\",category:\"Matrix\",syntax:[\"resize(x, size)\",\"resize(x, size, defaultValue)\"],description:\"Resize a matrix.\",examples:[\"resize([1,2,3,4,5], [3])\",\"resize([1,2,3], [5])\",\"resize([1,2,3], [5], -1)\",\"resize(2, [2, 3])\",'resize(\"hello\", [8], \"!\")'],seealso:[\"size\",\"subset\",\"squeeze\",\"reshape\"]},reshape:{name:\"reshape\",category:\"Matrix\",syntax:[\"reshape(x, sizes)\"],description:\"Reshape a multi dimensional array to fit the specified dimensions.\",examples:[\"reshape([1, 2, 3, 4, 5, 6], [2, 3])\",\"reshape([[1, 2], [3, 4]], [1, 4])\",\"reshape([[1, 2], [3, 4]], [4])\",\"reshape([1, 2, 3, 4], [-1, 2])\"],seealso:[\"size\",\"squeeze\",\"resize\"]},rotate:{name:\"rotate\",category:\"Matrix\",syntax:[\"rotate(w, theta)\",\"rotate(w, theta, v)\"],description:\"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.\",examples:[\"rotate([1, 0], pi / 2)\",'rotate(matrix([1, 0]), unit(\"35deg\"))','rotate([1, 0, 0], unit(\"90deg\"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit(\"90deg\"), matrix([0, 0, 1]))'],seealso:[\"matrix\",\"rotationMatrix\"]},rotationMatrix:{name:\"rotationMatrix\",category:\"Matrix\",syntax:[\"rotationMatrix(theta)\",\"rotationMatrix(theta, v)\",\"rotationMatrix(theta, v, format)\"],description:\"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.\",examples:[\"rotationMatrix(pi / 2)\",'rotationMatrix(unit(\"45deg\"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")'],seealso:[\"cos\",\"sin\"]},row:{name:\"row\",category:\"Matrix\",syntax:[\"row(x, index)\"],description:\"Return a row from a matrix or array.\",examples:[\"A = [[1, 2], [3, 4]]\",\"row(A, 1)\",\"row(A, 2)\"],seealso:[\"column\",\"matrixFromRows\"]},size:{name:\"size\",category:\"Matrix\",syntax:[\"size(x)\"],description:\"Calculate the size of a matrix.\",examples:[\"size(2.3)\",'size(\"hello world\")',\"a = [1, 2; 3, 4; 5, 6]\",\"size(a)\",\"size(1:6)\"],seealso:[\"concat\",\"count\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},sort:{name:\"sort\",category:\"Matrix\",syntax:[\"sort(x)\",\"sort(x, compare)\"],description:'Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.',examples:[\"sort([5, 10, 1])\",'sort([\"C\", \"B\", \"A\", \"D\"], \"natural\")',\"sortByLength(a, b) = size(a)[1] - size(b)[1]\",'sort([\"Langdon\", \"Tom\", \"Sara\"], sortByLength)','sort([\"10\", \"1\", \"2\"], \"natural\")'],seealso:[\"map\",\"filter\",\"forEach\"]},squeeze:{name:\"squeeze\",category:\"Matrix\",syntax:[\"squeeze(x)\"],description:\"Remove inner and outer singleton dimensions from a matrix.\",examples:[\"a = zeros(3,2,1)\",\"size(squeeze(a))\",\"b = zeros(1,1,3)\",\"size(squeeze(b))\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},subset:{name:\"subset\",category:\"Matrix\",syntax:[\"value(index)\",\"value(index) = replacement\",\"subset(value, [index])\",\"subset(value, [index], replacement)\"],description:\"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.\",examples:[\"d = [1, 2; 3, 4]\",\"e = []\",\"e[1, 1:2] = [5, 6]\",\"e[2, :] = [7, 8]\",\"f = d * e\",\"f[2, 1]\",\"f[:, 1]\",\"f[[1,2], [1,3]] = [9, 10; 11, 12]\",\"f\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"trace\",\"transpose\",\"zeros\"]},trace:{name:\"trace\",category:\"Matrix\",syntax:[\"trace(A)\"],description:\"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.\",examples:[\"A = [1, 2, 3; -1, 2, 3; 2, 0, 3]\",\"trace(A)\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"transpose\",\"zeros\"]},transpose:{name:\"transpose\",category:\"Matrix\",syntax:[\"x'\",\"transpose(x)\"],description:\"Transpose a matrix\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"a'\",\"transpose(a)\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"zeros\"]},zeros:{name:\"zeros\",category:\"Matrix\",syntax:[\"zeros(m)\",\"zeros(m, n)\",\"zeros(m, n, p, ...)\",\"zeros([m])\",\"zeros([m, n])\",\"zeros([m, n, p, ...])\"],description:\"Create a matrix containing zeros.\",examples:[\"zeros(3)\",\"zeros(3, 5)\",\"a = [1, 2, 3; 4, 5, 6]\",\"zeros(size(a))\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\"]},fft:{name:\"fft\",category:\"Matrix\",syntax:[\"fft(x)\"],description:\"Calculate N-dimensional Fourier transform\",examples:[\"fft([[1, 0], [1, 0]])\"],seealso:[\"ifft\"]},ifft:{name:\"ifft\",category:\"Matrix\",syntax:[\"ifft(x)\"],description:\"Calculate N-dimensional inverse Fourier transform\",examples:[\"ifft([[2, 2], [0, 0]])\"],seealso:[\"fft\"]},sylvester:{name:\"sylvester\",category:\"Algebra\",syntax:[\"sylvester(A,B,C)\"],description:\"Solves the real-valued Sylvester equation AX+XB=C for X\",examples:[\"sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])\",\"A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]\",\"sylvester(A, B, C)\"],seealso:[\"schur\",\"lyap\"]},schur:{name:\"schur\",category:\"Algebra\",syntax:[\"schur(A)\"],description:\"Performs a real Schur decomposition of the real matrix A = UTU'\",examples:[\"schur([[1, 0], [-4, 3]])\",\"A = [[1, 0], [-4, 3]]\",\"schur(A)\"],seealso:[\"lyap\",\"sylvester\"]},lyap:{name:\"lyap\",category:\"Algebra\",syntax:[\"lyap(A,Q)\"],description:\"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P\",examples:[\"lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])\",\"A = [[-2, 0], [1, -4]]\",\"Q = [[3, 1], [1, 3]]\",\"lyap(A,Q)\"],seealso:[\"schur\",\"sylvester\"]},solveODE:{name:\"solveODE\",category:\"Numeric\",syntax:[\"solveODE(func, tspan, y0)\",\"solveODE(func, tspan, y0, options)\"],description:\"Numerical Integration of Ordinary Differential Equations.\",examples:[\"f(t,y) = y\",\"tspan = [0, 4]\",\"solveODE(f, tspan, 1)\",\"solveODE(f, tspan, [1, 2])\",'solveODE(f, tspan, 1, { method:\"RK23\", maxStep:0.1 })'],seealso:[\"derivative\",\"simplifyCore\"]},combinations:{name:\"combinations\",category:\"Probability\",syntax:[\"combinations(n, k)\"],description:\"Compute the number of combinations of n items taken k at a time\",examples:[\"combinations(7, 5)\"],seealso:[\"combinationsWithRep\",\"permutations\",\"factorial\"]},combinationsWithRep:{name:\"combinationsWithRep\",category:\"Probability\",syntax:[\"combinationsWithRep(n, k)\"],description:\"Compute the number of combinations of n items taken k at a time with replacements.\",examples:[\"combinationsWithRep(7, 5)\"],seealso:[\"combinations\",\"permutations\",\"factorial\"]},factorial:{name:\"factorial\",category:\"Probability\",syntax:[\"n!\",\"factorial(n)\"],description:\"Compute the factorial of a value\",examples:[\"5!\",\"5 * 4 * 3 * 2 * 1\",\"3!\"],seealso:[\"combinations\",\"combinationsWithRep\",\"permutations\",\"gamma\"]},gamma:{name:\"gamma\",category:\"Probability\",syntax:[\"gamma(n)\"],description:\"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.\",examples:[\"gamma(4)\",\"3!\",\"gamma(1/2)\",\"sqrt(pi)\"],seealso:[\"factorial\"]},kldivergence:{name:\"kldivergence\",category:\"Probability\",syntax:[\"kldivergence(x, y)\"],description:\"Calculate the Kullback-Leibler (KL) divergence between two distributions.\",examples:[\"kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])\"],seealso:[]},lgamma:{name:\"lgamma\",category:\"Probability\",syntax:[\"lgamma(n)\"],description:\"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.\",examples:[\"lgamma(4)\",\"lgamma(1/2)\",\"lgamma(i)\",\"lgamma(complex(1.1, 2))\"],seealso:[\"gamma\"]},multinomial:{name:\"multinomial\",category:\"Probability\",syntax:[\"multinomial(A)\"],description:\"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.\",examples:[\"multinomial([1, 2, 1])\"],seealso:[\"combinations\",\"factorial\"]},permutations:{name:\"permutations\",category:\"Probability\",syntax:[\"permutations(n)\",\"permutations(n, k)\"],description:\"Compute the number of permutations of n items taken k at a time\",examples:[\"permutations(5)\",\"permutations(5, 3)\"],seealso:[\"combinations\",\"combinationsWithRep\",\"factorial\"]},pickRandom:{name:\"pickRandom\",category:\"Probability\",syntax:[\"pickRandom(array)\",\"pickRandom(array, number)\",\"pickRandom(array, weights)\",\"pickRandom(array, number, weights)\",\"pickRandom(array, weights, number)\"],description:\"Pick a random entry from a given array.\",examples:[\"pickRandom(0:10)\",\"pickRandom([1, 3, 1, 6])\",\"pickRandom([1, 3, 1, 6], 2)\",\"pickRandom([1, 3, 1, 6], [2, 3, 2, 1])\",\"pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])\",\"pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)\"],seealso:[\"random\",\"randomInt\"]},random:{name:\"random\",category:\"Probability\",syntax:[\"random()\",\"random(max)\",\"random(min, max)\",\"random(size)\",\"random(size, max)\",\"random(size, min, max)\"],description:\"Return a random number.\",examples:[\"random()\",\"random(10, 20)\",\"random([2, 3])\"],seealso:[\"pickRandom\",\"randomInt\"]},randomInt:{name:\"randomInt\",category:\"Probability\",syntax:[\"randomInt(max)\",\"randomInt(min, max)\",\"randomInt(size)\",\"randomInt(size, max)\",\"randomInt(size, min, max)\"],description:\"Return a random integer number\",examples:[\"randomInt(10, 20)\",\"randomInt([2, 3], 10)\"],seealso:[\"pickRandom\",\"random\"]},compare:{name:\"compare\",category:\"Relational\",syntax:[\"compare(x, y)\"],description:\"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\",examples:[\"compare(2, 3)\",\"compare(3, 2)\",\"compare(2, 2)\",\"compare(5cm, 40mm)\",\"compare(2, [1, 2, 3])\"],seealso:[\"equal\",\"unequal\",\"smaller\",\"smallerEq\",\"largerEq\",\"compareNatural\",\"compareText\"]},compareNatural:{name:\"compareNatural\",category:\"Relational\",syntax:[\"compareNatural(x, y)\"],description:\"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\",examples:[\"compareNatural(2, 3)\",\"compareNatural(3, 2)\",\"compareNatural(2, 2)\",\"compareNatural(5cm, 40mm)\",'compareNatural(\"2\", \"10\")',\"compareNatural(2 + 3i, 2 + 4i)\",\"compareNatural([1, 2, 4], [1, 2, 3])\",\"compareNatural([1, 5], [1, 2, 3])\",\"compareNatural([1, 2], [1, 2])\",\"compareNatural({a: 2}, {a: 4})\"],seealso:[\"equal\",\"unequal\",\"smaller\",\"smallerEq\",\"largerEq\",\"compare\",\"compareText\"]},compareText:{name:\"compareText\",category:\"Relational\",syntax:[\"compareText(x, y)\"],description:\"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\",examples:['compareText(\"B\", \"A\")','compareText(\"A\", \"B\")','compareText(\"A\", \"A\")','compareText(\"2\", \"10\")','compare(\"2\", \"10\")',\"compare(2, 10)\",'compareNatural(\"2\", \"10\")','compareText(\"B\", [\"A\", \"B\", \"C\"])'],seealso:[\"compare\",\"compareNatural\"]},deepEqual:{name:\"deepEqual\",category:\"Relational\",syntax:[\"deepEqual(x, y)\"],description:\"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.\",examples:[\"deepEqual([1,3,4], [1,3,4])\",\"deepEqual([1,3,4], [1,3])\"],seealso:[\"equal\",\"unequal\",\"smaller\",\"larger\",\"smallerEq\",\"largerEq\",\"compare\"]},equal:{name:\"equal\",category:\"Relational\",syntax:[\"x == y\",\"equal(x, y)\"],description:\"Check equality of two values. Returns true if the values are equal, and false if not.\",examples:[\"2+2 == 3\",\"2+2 == 4\",\"a = 3.2\",\"b = 6-2.8\",\"a == b\",\"50cm == 0.5m\"],seealso:[\"unequal\",\"smaller\",\"larger\",\"smallerEq\",\"largerEq\",\"compare\",\"deepEqual\",\"equalText\"]},equalText:{name:\"equalText\",category:\"Relational\",syntax:[\"equalText(x, y)\"],description:\"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.\",examples:['equalText(\"Hello\", \"Hello\")','equalText(\"a\", \"A\")','equal(\"2e3\", \"2000\")','equalText(\"2e3\", \"2000\")','equalText(\"B\", [\"A\", \"B\", \"C\"])'],seealso:[\"compare\",\"compareNatural\",\"compareText\",\"equal\"]},larger:{name:\"larger\",category:\"Relational\",syntax:[\"x > y\",\"larger(x, y)\"],description:\"Check if value x is larger than y. Returns true if x is larger than y, and false if not. Comparing a value with NaN returns false.\",examples:[\"2 > 3\",\"5 > 2*2\",\"a = 3.3\",\"b = 6-2.8\",\"(a > b)\",\"(b < a)\",\"5 cm > 2 inch\"],seealso:[\"equal\",\"unequal\",\"smaller\",\"smallerEq\",\"largerEq\",\"compare\"]},largerEq:{name:\"largerEq\",category:\"Relational\",syntax:[\"x >= y\",\"largerEq(x, y)\"],description:\"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.\",examples:[\"2 >= 1+1\",\"2 > 1+1\",\"a = 3.2\",\"b = 6-2.8\",\"(a >= b)\"],seealso:[\"equal\",\"unequal\",\"smallerEq\",\"smaller\",\"compare\"]},smaller:{name:\"smaller\",category:\"Relational\",syntax:[\"x < y\",\"smaller(x, y)\"],description:\"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not. Comparing a value with NaN returns false.\",examples:[\"2 < 3\",\"5 < 2*2\",\"a = 3.3\",\"b = 6-2.8\",\"(a < b)\",\"5 cm < 2 inch\"],seealso:[\"equal\",\"unequal\",\"larger\",\"smallerEq\",\"largerEq\",\"compare\"]},smallerEq:{name:\"smallerEq\",category:\"Relational\",syntax:[\"x <= y\",\"smallerEq(x, y)\"],description:\"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.\",examples:[\"2 <= 1+1\",\"2 < 1+1\",\"a = 3.2\",\"b = 6-2.8\",\"(a <= b)\"],seealso:[\"equal\",\"unequal\",\"larger\",\"smaller\",\"largerEq\",\"compare\"]},unequal:{name:\"unequal\",category:\"Relational\",syntax:[\"x != y\",\"unequal(x, y)\"],description:\"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.\",examples:[\"2+2 != 3\",\"2+2 != 4\",\"a = 3.2\",\"b = 6-2.8\",\"a != b\",\"50cm != 0.5m\",\"5 cm != 2 inch\"],seealso:[\"equal\",\"smaller\",\"larger\",\"smallerEq\",\"largerEq\",\"compare\",\"deepEqual\"]},setCartesian:{name:\"setCartesian\",category:\"Set\",syntax:[\"setCartesian(set1, set2)\"],description:\"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.\",examples:[\"setCartesian([1, 2], [3, 4])\"],seealso:[\"setUnion\",\"setIntersect\",\"setDifference\",\"setPowerset\"]},setDifference:{name:\"setDifference\",category:\"Set\",syntax:[\"setDifference(set1, set2)\"],description:\"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.\",examples:[\"setDifference([1, 2, 3, 4], [3, 4, 5, 6])\",\"setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])\"],seealso:[\"setUnion\",\"setIntersect\",\"setSymDifference\"]},setDistinct:{name:\"setDistinct\",category:\"Set\",syntax:[\"setDistinct(set)\"],description:\"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.\",examples:[\"setDistinct([1, 1, 1, 2, 2, 3])\"],seealso:[\"setMultiplicity\"]},setIntersect:{name:\"setIntersect\",category:\"Set\",syntax:[\"setIntersect(set1, set2)\"],description:\"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.\",examples:[\"setIntersect([1, 2, 3, 4], [3, 4, 5, 6])\",\"setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])\"],seealso:[\"setUnion\",\"setDifference\"]},setIsSubset:{name:\"setIsSubset\",category:\"Set\",syntax:[\"setIsSubset(set1, set2)\"],description:\"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.\",examples:[\"setIsSubset([1, 2], [3, 4, 5, 6])\",\"setIsSubset([3, 4], [3, 4, 5, 6])\"],seealso:[\"setUnion\",\"setIntersect\",\"setDifference\"]},setMultiplicity:{name:\"setMultiplicity\",category:\"Set\",syntax:[\"setMultiplicity(element, set)\"],description:\"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.\",examples:[\"setMultiplicity(1, [1, 2, 2, 4])\",\"setMultiplicity(2, [1, 2, 2, 4])\"],seealso:[\"setDistinct\",\"setSize\"]},setPowerset:{name:\"setPowerset\",category:\"Set\",syntax:[\"setPowerset(set)\"],description:\"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.\",examples:[\"setPowerset([1, 2, 3])\"],seealso:[\"setCartesian\"]},setSize:{name:\"setSize\",category:\"Set\",syntax:[\"setSize(set)\",\"setSize(set, unique)\"],description:'Count the number of elements of a (multi)set. When the second parameter \"unique\" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:[\"setSize([1, 2, 2, 4])\",\"setSize([1, 2, 2, 4], true)\"],seealso:[\"setUnion\",\"setIntersect\",\"setDifference\"]},setSymDifference:{name:\"setSymDifference\",category:\"Set\",syntax:[\"setSymDifference(set1, set2)\"],description:\"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.\",examples:[\"setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])\",\"setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])\"],seealso:[\"setUnion\",\"setIntersect\",\"setDifference\"]},setUnion:{name:\"setUnion\",category:\"Set\",syntax:[\"setUnion(set1, set2)\"],description:\"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.\",examples:[\"setUnion([1, 2, 3, 4], [3, 4, 5, 6])\",\"setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])\"],seealso:[\"setIntersect\",\"setDifference\"]},zpk2tf:{name:\"zpk2tf\",category:\"Signal\",syntax:[\"zpk2tf(z, p, k)\"],description:\"Compute the transfer function of a zero-pole-gain model.\",examples:[\"zpk2tf([1, 2], [-1, -2], 1)\",\"zpk2tf([1, 2], [-1, -2])\",\"zpk2tf([1 - 3i, 2 + 2i], [-1, -2])\"],seealso:[]},freqz:{name:\"freqz\",category:\"Signal\",syntax:[\"freqz(b, a)\",\"freqz(b, a, w)\"],description:\"Calculates the frequency response of a filter given its numerator and denominator coefficients.\",examples:[\"freqz([1, 2], [1, 2, 3])\",\"freqz([1, 2], [1, 2, 3], [0, 1])\",\"freqz([1, 2], [1, 2, 3], 512)\"],seealso:[]},erf:{name:\"erf\",category:\"Special\",syntax:[\"erf(x)\"],description:\"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x\",examples:[\"erf(0.2)\",\"erf(-0.5)\",\"erf(4)\"],seealso:[]},zeta:{name:\"zeta\",category:\"Special\",syntax:[\"zeta(s)\"],description:\"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane\",examples:[\"zeta(0.2)\",\"zeta(-0.5)\",\"zeta(4)\"],seealso:[]},cumsum:{name:\"cumsum\",category:\"Statistics\",syntax:[\"cumsum(a, b, c, ...)\",\"cumsum(A)\"],description:\"Compute the cumulative sum of all values.\",examples:[\"cumsum(2, 3, 4, 1)\",\"cumsum([2, 3, 4, 1])\",\"cumsum([1, 2; 3, 4])\",\"cumsum([1, 2; 3, 4], 1)\",\"cumsum([1, 2; 3, 4], 2)\"],seealso:[\"max\",\"mean\",\"median\",\"min\",\"prod\",\"std\",\"sum\",\"variance\"]},mad:{name:\"mad\",category:\"Statistics\",syntax:[\"mad(a, b, c, ...)\",\"mad(A)\"],description:\"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.\",examples:[\"mad(10, 20, 30)\",\"mad([1, 2, 3])\"],seealso:[\"mean\",\"median\",\"std\",\"abs\"]},max:{name:\"max\",category:\"Statistics\",syntax:[\"max(a, b, c, ...)\",\"max(A)\",\"max(A, dimension)\"],description:\"Compute the maximum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.\",examples:[\"max(2, 3, 4, 1)\",\"max([2, 3, 4, 1])\",\"max([2, 5; 4, 3])\",\"max([2, 5; 4, 3], 1)\",\"max([2, 5; 4, 3], 2)\",\"max(2.7, 7.1, -4.5, 2.0, 4.1)\",\"min(2.7, 7.1, -4.5, 2.0, 4.1)\"],seealso:[\"mean\",\"median\",\"min\",\"prod\",\"std\",\"sum\",\"variance\"]},mean:{name:\"mean\",category:\"Statistics\",syntax:[\"mean(a, b, c, ...)\",\"mean(A)\",\"mean(A, dimension)\"],description:\"Compute the arithmetic mean of a list of values.\",examples:[\"mean(2, 3, 4, 1)\",\"mean([2, 3, 4, 1])\",\"mean([2, 5; 4, 3])\",\"mean([2, 5; 4, 3], 1)\",\"mean([2, 5; 4, 3], 2)\",\"mean([1.0, 2.7, 3.2, 4.0])\"],seealso:[\"max\",\"median\",\"min\",\"prod\",\"std\",\"sum\",\"variance\"]},median:{name:\"median\",category:\"Statistics\",syntax:[\"median(a, b, c, ...)\",\"median(A)\"],description:\"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.\",examples:[\"median(5, 2, 7)\",\"median([3, -1, 5, 7])\"],seealso:[\"max\",\"mean\",\"min\",\"prod\",\"std\",\"sum\",\"variance\",\"quantileSeq\"]},min:{name:\"min\",category:\"Statistics\",syntax:[\"min(a, b, c, ...)\",\"min(A)\",\"min(A, dimension)\"],description:\"Compute the minimum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.\",examples:[\"min(2, 3, 4, 1)\",\"min([2, 3, 4, 1])\",\"min([2, 5; 4, 3])\",\"min([2, 5; 4, 3], 1)\",\"min([2, 5; 4, 3], 2)\",\"min(2.7, 7.1, -4.5, 2.0, 4.1)\",\"max(2.7, 7.1, -4.5, 2.0, 4.1)\"],seealso:[\"max\",\"mean\",\"median\",\"prod\",\"std\",\"sum\",\"variance\"]},mode:{name:\"mode\",category:\"Statistics\",syntax:[\"mode(a, b, c, ...)\",\"mode(A)\",\"mode(A, a, b, B, c, ...)\"],description:\"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.\",examples:[\"mode(2, 1, 4, 3, 1)\",\"mode([1, 2.7, 3.2, 4, 2.7])\",\"mode(1, 4, 6, 1, 6)\"],seealso:[\"max\",\"mean\",\"min\",\"median\",\"prod\",\"std\",\"sum\",\"variance\"]},prod:{name:\"prod\",category:\"Statistics\",syntax:[\"prod(a, b, c, ...)\",\"prod(A)\"],description:\"Compute the product of all values.\",examples:[\"prod(2, 3, 4)\",\"prod([2, 3, 4])\",\"prod([2, 5; 4, 3])\"],seealso:[\"max\",\"mean\",\"min\",\"median\",\"min\",\"std\",\"sum\",\"variance\"]},quantileSeq:{name:\"quantileSeq\",category:\"Statistics\",syntax:[\"quantileSeq(A, prob[, sorted])\",\"quantileSeq(A, [prob1, prob2, ...][, sorted])\",\"quantileSeq(A, N[, sorted])\"],description:\"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \\n\\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.\",examples:[\"quantileSeq([3, -1, 5, 7], 0.5)\",\"quantileSeq([3, -1, 5, 7], [1/3, 2/3])\",\"quantileSeq([3, -1, 5, 7], 2)\",\"quantileSeq([-1, 3, 5, 7], 0.5, true)\"],seealso:[\"mean\",\"median\",\"min\",\"max\",\"prod\",\"std\",\"sum\",\"variance\"]},std:{name:\"std\",category:\"Statistics\",syntax:[\"std(a, b, c, ...)\",\"std(A)\",\"std(A, dimension)\",\"std(A, normalization)\",\"std(A, dimension, normalization)\"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',examples:[\"std(2, 4, 6)\",\"std([2, 4, 6, 8])\",'std([2, 4, 6, 8], \"uncorrected\")','std([2, 4, 6, 8], \"biased\")',\"std([1, 2, 3; 4, 5, 6])\"],seealso:[\"max\",\"mean\",\"min\",\"median\",\"prod\",\"sum\",\"variance\"]},sum:{name:\"sum\",category:\"Statistics\",syntax:[\"sum(a, b, c, ...)\",\"sum(A)\",\"sum(A, dimension)\"],description:\"Compute the sum of all values.\",examples:[\"sum(2, 3, 4, 1)\",\"sum([2, 3, 4, 1])\",\"sum([2, 5; 4, 3])\"],seealso:[\"max\",\"mean\",\"median\",\"min\",\"prod\",\"std\",\"variance\"]},variance:{name:\"variance\",category:\"Statistics\",syntax:[\"variance(a, b, c, ...)\",\"variance(A)\",\"variance(A, dimension)\",\"variance(A, normalization)\",\"variance(A, dimension, normalization)\"],description:'Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',examples:[\"variance(2, 4, 6)\",\"variance([2, 4, 6, 8])\",'variance([2, 4, 6, 8], \"uncorrected\")','variance([2, 4, 6, 8], \"biased\")',\"variance([1, 2, 3; 4, 5, 6])\"],seealso:[\"max\",\"mean\",\"min\",\"median\",\"min\",\"prod\",\"std\",\"sum\"]},corr:{name:\"corr\",category:\"Statistics\",syntax:[\"corr(A,B)\"],description:\"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.\",examples:[\"corr([2, 4, 6, 8],[1, 2, 3, 6])\",\"corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))\"],seealso:[\"max\",\"mean\",\"min\",\"median\",\"min\",\"prod\",\"std\",\"sum\"]},acos:{name:\"acos\",category:\"Trigonometry\",syntax:[\"acos(x)\"],description:\"Compute the inverse cosine of a value in radians.\",examples:[\"acos(0.5)\",\"acos(cos(2.3))\"],seealso:[\"cos\",\"atan\",\"asin\"]},acosh:{name:\"acosh\",category:\"Trigonometry\",syntax:[\"acosh(x)\"],description:\"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.\",examples:[\"acosh(1.5)\"],seealso:[\"cosh\",\"asinh\",\"atanh\"]},acot:{name:\"acot\",category:\"Trigonometry\",syntax:[\"acot(x)\"],description:\"Calculate the inverse cotangent of a value.\",examples:[\"acot(0.5)\",\"acot(cot(0.5))\",\"acot(2)\"],seealso:[\"cot\",\"atan\"]},acoth:{name:\"acoth\",category:\"Trigonometry\",syntax:[\"acoth(x)\"],description:\"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.\",examples:[\"acoth(2)\",\"acoth(0.5)\"],seealso:[\"acsch\",\"asech\"]},acsc:{name:\"acsc\",category:\"Trigonometry\",syntax:[\"acsc(x)\"],description:\"Calculate the inverse cotangent of a value.\",examples:[\"acsc(2)\",\"acsc(csc(0.5))\",\"acsc(0.5)\"],seealso:[\"csc\",\"asin\",\"asec\"]},acsch:{name:\"acsch\",category:\"Trigonometry\",syntax:[\"acsch(x)\"],description:\"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.\",examples:[\"acsch(0.5)\"],seealso:[\"asech\",\"acoth\"]},asec:{name:\"asec\",category:\"Trigonometry\",syntax:[\"asec(x)\"],description:\"Calculate the inverse secant of a value.\",examples:[\"asec(0.5)\",\"asec(sec(0.5))\",\"asec(2)\"],seealso:[\"acos\",\"acot\",\"acsc\"]},asech:{name:\"asech\",category:\"Trigonometry\",syntax:[\"asech(x)\"],description:\"Calculate the inverse secant of a value.\",examples:[\"asech(0.5)\"],seealso:[\"acsch\",\"acoth\"]},asin:{name:\"asin\",category:\"Trigonometry\",syntax:[\"asin(x)\"],description:\"Compute the inverse sine of a value in radians.\",examples:[\"asin(0.5)\",\"asin(sin(0.5))\"],seealso:[\"sin\",\"acos\",\"atan\"]},asinh:{name:\"asinh\",category:\"Trigonometry\",syntax:[\"asinh(x)\"],description:\"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.\",examples:[\"asinh(0.5)\"],seealso:[\"acosh\",\"atanh\"]},atan:{name:\"atan\",category:\"Trigonometry\",syntax:[\"atan(x)\"],description:\"Compute the inverse tangent of a value in radians.\",examples:[\"atan(0.5)\",\"atan(tan(0.5))\"],seealso:[\"tan\",\"acos\",\"asin\"]},atanh:{name:\"atanh\",category:\"Trigonometry\",syntax:[\"atanh(x)\"],description:\"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.\",examples:[\"atanh(0.5)\"],seealso:[\"acosh\",\"asinh\"]},atan2:{name:\"atan2\",category:\"Trigonometry\",syntax:[\"atan2(y, x)\"],description:\"Computes the principal value of the arc tangent of y/x in radians.\",examples:[\"atan2(2, 2) / pi\",\"angle = 60 deg in rad\",\"x = cos(angle)\",\"y = sin(angle)\",\"atan2(y, x)\"],seealso:[\"sin\",\"cos\",\"tan\"]},cos:{name:\"cos\",category:\"Trigonometry\",syntax:[\"cos(x)\"],description:\"Compute the cosine of x in radians.\",examples:[\"cos(2)\",\"cos(pi / 4) ^ 2\",\"cos(180 deg)\",\"cos(60 deg)\",\"sin(0.2)^2 + cos(0.2)^2\"],seealso:[\"acos\",\"sin\",\"tan\"]},cosh:{name:\"cosh\",category:\"Trigonometry\",syntax:[\"cosh(x)\"],description:\"Compute the hyperbolic cosine of x in radians.\",examples:[\"cosh(0.5)\"],seealso:[\"sinh\",\"tanh\",\"coth\"]},cot:{name:\"cot\",category:\"Trigonometry\",syntax:[\"cot(x)\"],description:\"Compute the cotangent of x in radians. Defined as 1/tan(x)\",examples:[\"cot(2)\",\"1 / tan(2)\"],seealso:[\"sec\",\"csc\",\"tan\"]},coth:{name:\"coth\",category:\"Trigonometry\",syntax:[\"coth(x)\"],description:\"Compute the hyperbolic cotangent of x in radians.\",examples:[\"coth(2)\",\"1 / tanh(2)\"],seealso:[\"sech\",\"csch\",\"tanh\"]},csc:{name:\"csc\",category:\"Trigonometry\",syntax:[\"csc(x)\"],description:\"Compute the cosecant of x in radians. Defined as 1/sin(x)\",examples:[\"csc(2)\",\"1 / sin(2)\"],seealso:[\"sec\",\"cot\",\"sin\"]},csch:{name:\"csch\",category:\"Trigonometry\",syntax:[\"csch(x)\"],description:\"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)\",examples:[\"csch(2)\",\"1 / sinh(2)\"],seealso:[\"sech\",\"coth\",\"sinh\"]},sec:{name:\"sec\",category:\"Trigonometry\",syntax:[\"sec(x)\"],description:\"Compute the secant of x in radians. Defined as 1/cos(x)\",examples:[\"sec(2)\",\"1 / cos(2)\"],seealso:[\"cot\",\"csc\",\"cos\"]},sech:{name:\"sech\",category:\"Trigonometry\",syntax:[\"sech(x)\"],description:\"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)\",examples:[\"sech(2)\",\"1 / cosh(2)\"],seealso:[\"coth\",\"csch\",\"cosh\"]},sin:{name:\"sin\",category:\"Trigonometry\",syntax:[\"sin(x)\"],description:\"Compute the sine of x in radians.\",examples:[\"sin(2)\",\"sin(pi / 4) ^ 2\",\"sin(90 deg)\",\"sin(30 deg)\",\"sin(0.2)^2 + cos(0.2)^2\"],seealso:[\"asin\",\"cos\",\"tan\"]},sinh:{name:\"sinh\",category:\"Trigonometry\",syntax:[\"sinh(x)\"],description:\"Compute the hyperbolic sine of x in radians.\",examples:[\"sinh(0.5)\"],seealso:[\"cosh\",\"tanh\"]},tan:{name:\"tan\",category:\"Trigonometry\",syntax:[\"tan(x)\"],description:\"Compute the tangent of x in radians.\",examples:[\"tan(0.5)\",\"sin(0.5) / cos(0.5)\",\"tan(pi / 4)\",\"tan(45 deg)\"],seealso:[\"atan\",\"sin\",\"cos\"]},tanh:{name:\"tanh\",category:\"Trigonometry\",syntax:[\"tanh(x)\"],description:\"Compute the hyperbolic tangent of x in radians.\",examples:[\"tanh(0.5)\",\"sinh(0.5) / cosh(0.5)\"],seealso:[\"sinh\",\"cosh\"]},to:{name:\"to\",category:\"Units\",syntax:[\"x to unit\",\"to(x, unit)\"],description:\"Change the unit of a value.\",examples:[\"5 inch to cm\",\"3.2kg to g\",\"16 bytes in bits\"],seealso:[]},toBest:{name:\"toBest\",category:\"Units\",syntax:[\"toBest(x)\",\"toBest(x, unitList)\",\"toBest(x, unitList, options)\"],description:\"Converts to the most appropriate display unit.\",examples:['toBest(unit(5000, \"m\"))','toBest(unit(3500000, \"W\"))','toBest(unit(0.000000123, \"A\"))','toBest(unit(10, \"m\"), \"cm\")','toBest(unit(10, \"m\"), \"mm,km\", {offset: 1.5})'],seealso:[]},clone:{name:\"clone\",category:\"Utils\",syntax:[\"clone(x)\"],description:\"Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices\",examples:[\"clone(3.5)\",\"clone(2 - 4i)\",\"clone(45 deg)\",\"clone([1, 2; 3, 4])\",'clone(\"hello world\")'],seealso:[]},format:{name:\"format\",category:\"Utils\",syntax:[\"format(value)\",\"format(value, precision)\"],description:\"Format a value of any type as string.\",examples:[\"format(2.3)\",\"format(3 - 4i)\",\"format([])\",\"format(pi, 3)\"],seealso:[\"print\"]},bin:{name:\"bin\",category:\"Utils\",syntax:[\"bin(value)\"],description:\"Format a number as binary\",examples:[\"bin(2)\"],seealso:[\"oct\",\"hex\"]},oct:{name:\"oct\",category:\"Utils\",syntax:[\"oct(value)\"],description:\"Format a number as octal\",examples:[\"oct(56)\"],seealso:[\"bin\",\"hex\"]},hex:{name:\"hex\",category:\"Utils\",syntax:[\"hex(value)\"],description:\"Format a number as hexadecimal\",examples:[\"hex(240)\"],seealso:[\"bin\",\"oct\"]},isNaN:{name:\"isNaN\",category:\"Utils\",syntax:[\"isNaN(x)\"],description:\"Test whether a value is NaN (not a number)\",examples:[\"isNaN(2)\",\"isNaN(0 / 0)\",\"isNaN(NaN)\",\"isNaN(Infinity)\"],seealso:[\"isNegative\",\"isNumeric\",\"isPositive\",\"isZero\"]},isInteger:{name:\"isInteger\",category:\"Utils\",syntax:[\"isInteger(x)\"],description:\"Test whether a value is an integer number.\",examples:[\"isInteger(2)\",\"isInteger(3.5)\",\"isInteger([3, 0.5, -2])\"],seealso:[\"isNegative\",\"isNumeric\",\"isPositive\",\"isZero\"]},isNegative:{name:\"isNegative\",category:\"Utils\",syntax:[\"isNegative(x)\"],description:\"Test whether a value is negative: smaller than zero.\",examples:[\"isNegative(2)\",\"isNegative(0)\",\"isNegative(-4)\",\"isNegative([3, 0.5, -2])\"],seealso:[\"isInteger\",\"isNumeric\",\"isPositive\",\"isZero\"]},isNumeric:{name:\"isNumeric\",category:\"Utils\",syntax:[\"isNumeric(x)\"],description:\"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.\",examples:[\"isNumeric(2)\",'isNumeric(\"2\")','hasNumericValue(\"2\")',\"isNumeric(0)\",\"isNumeric(bignumber(500))\",\"isNumeric(fraction(0.125))\",\"isNumeric(2 + 3i)\",'isNumeric([2.3, \"foo\", false])'],seealso:[\"isInteger\",\"isZero\",\"isNegative\",\"isPositive\",\"isNaN\",\"hasNumericValue\"]},hasNumericValue:{name:\"hasNumericValue\",category:\"Utils\",syntax:[\"hasNumericValue(x)\"],description:\"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.\",examples:[\"hasNumericValue(2)\",'hasNumericValue(\"2\")','isNumeric(\"2\")',\"hasNumericValue(0)\",\"hasNumericValue(bignumber(500))\",\"hasNumericValue(fraction(0.125))\",\"hasNumericValue(2 + 3i)\",'hasNumericValue([2.3, \"foo\", false])'],seealso:[\"isInteger\",\"isZero\",\"isNegative\",\"isPositive\",\"isNaN\",\"isNumeric\"]},isPositive:{name:\"isPositive\",category:\"Utils\",syntax:[\"isPositive(x)\"],description:\"Test whether a value is positive: larger than zero.\",examples:[\"isPositive(2)\",\"isPositive(0)\",\"isPositive(-4)\",\"isPositive([3, 0.5, -2])\"],seealso:[\"isInteger\",\"isNumeric\",\"isNegative\",\"isZero\"]},isPrime:{name:\"isPrime\",category:\"Utils\",syntax:[\"isPrime(x)\"],description:\"Test whether a value is prime: has no divisors other than itself and one.\",examples:[\"isPrime(3)\",\"isPrime(-2)\",\"isPrime([2, 17, 100])\"],seealso:[\"isInteger\",\"isNumeric\",\"isNegative\",\"isZero\"]},isZero:{name:\"isZero\",category:\"Utils\",syntax:[\"isZero(x)\"],description:\"Test whether a value is zero.\",examples:[\"isZero(2)\",\"isZero(0)\",\"isZero(-4)\",\"isZero([3, 0, -2, 0])\"],seealso:[\"isInteger\",\"isNumeric\",\"isNegative\",\"isPositive\"]},print:{name:\"print\",category:\"Utils\",syntax:[\"print(template, values)\",\"print(template, values, precision)\"],description:\"Interpolate values into a string template.\",examples:['print(\"Lucy is $age years old\", {age: 5})','print(\"The value of pi is $pi\", {pi: pi}, 3)','print(\"Hello, $user.name!\", {user: {name: \"John\"}})','print(\"Values: $1, $2, $3\", [6, 9, 4])'],seealso:[\"format\"]},typeOf:{name:\"typeOf\",category:\"Utils\",syntax:[\"typeOf(x)\"],description:\"Get the type of a variable.\",examples:[\"typeOf(3.5)\",\"typeOf(2 - 4i)\",\"typeOf(45 deg)\",'typeOf(\"hello world\")'],seealso:[\"getMatrixDataType\"]},numeric:{name:\"numeric\",category:\"Utils\",syntax:[\"numeric(x)\"],description:\"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.\",examples:['numeric(\"4\")','numeric(\"4\", \"number\")','numeric(\"4\", \"bigint\")','numeric(\"4\", \"BigNumber\")','numeric(\"4\", \"Fraction\")','numeric(4, \"Fraction\")','numeric(fraction(2, 5), \"number\")'],seealso:[\"number\",\"bigint\",\"fraction\",\"bignumber\",\"string\",\"format\"]}},Ap=s(\"help\",[\"typed\",\"mathWithTransform\",\"Help\"],e=>{let{typed:t,mathWithTransform:i,Help:a}=e;return t(\"help\",{any:function(e){let t,r=e;if(\"string\"!=typeof e)for(t in i)if(ue(i,t)&&e===i[t]){r=t;break}var n=h(Np,r);if(n)return new a(n);{const e=\"function\"==typeof r?r.name:r;throw new Error('No documentation found on \"'+e+'\"')}}})}),Ep=s(\"chain\",[\"typed\",\"Chain\"],e=>{let{typed:t,Chain:r}=e;return t(\"chain\",{\"\":function(){return new r},any:function(e){return new r(e)}})}),Sp=s(\"det\",[\"typed\",\"matrix\",\"subtractScalar\",\"multiply\",\"divideScalar\",\"isZero\",\"unaryMinus\"],e=>{let{typed:t,matrix:l,subtractScalar:c,multiply:f,divideScalar:p,isZero:m,unaryMinus:h}=e;return t(\"det\",{any:ee,\"Array | Matrix\":function(e){var t=_(e)?e.size():Array.isArray(e)?(e=l(e)).size():[];switch(t.length){case 0:return ee(e);case 1:if(1===t[0])return ee(e.valueOf()[0]);if(0===t[0])return 1;throw new RangeError(\"Matrix must be square (size: \"+S(t)+\")\");case 2:{const l=t[0],n=t[1];if(l===n){var i=e.clone().valueOf();var a=l;if(1===a)return ee(i[0][0]);if(2===a)return c(f(i[0][0],i[1][1]),f(i[1][0],i[0][1]));{let n=!1;const u=new Array(a).fill(0).map((e,t)=>t);for(let r=0;r{let{typed:t,matrix:n,divideScalar:p,addScalar:m,multiply:h,unaryMinus:d,det:g,identity:y,abs:x}=e;return t(\"inv\",{\"Array | Matrix\":function(e){var t=_(e)?e.size():T(e);switch(t.length){case 1:if(1===t[0])return _(e)?n([p(1,e.valueOf()[0])]):[p(1,e[0])];throw new RangeError(\"Matrix must be square (size: \"+S(t)+\")\");case 2:{const p=t[0],r=t[1];if(p===r)return _(e)?n(i(e.valueOf(),p,r),e.storage()):i(e,p,r);throw new RangeError(\"Matrix must be square (size: \"+S(t)+\")\")}default:throw new RangeError(\"Matrix must be two dimensional (size: \"+S(t)+\")\")}},any:function(e){return p(1,e)}});function i(e,n,i){let a,o,s,u,l;if(1===n){if(0===(u=e[0][0]))throw Error(\"Cannot calculate inverse, determinant is zero\");return[[p(1,u)]]}if(2===n){const n=g(e);if(0===n)throw Error(\"Cannot calculate inverse, determinant is zero\");return[[p(e[1][1],n),p(d(e[0][1]),n)],[p(d(e[1][0]),n),p(e[0][0],n)]]}{const g=e.concat();for(a=0;ae&&(e=x(g[a][r]),t=a),a++;if(0===e)throw Error(\"Cannot calculate inverse, determinant is zero\");(a=t)!==r&&(l=g[r],g[r]=g[a],g[a]=l,l=u[r],u[r]=u[a],u[a]=l);var c=g[r],f=u[r];for(a=0;a{let{typed:t,matrix:i,inv:a,deepEqual:r,equal:n,dotDivide:u,dot:o,ctranspose:s,divideScalar:l,multiply:c,add:f,Complex:p}=e;return t(\"pinv\",{\"Array | Matrix\":function(e){var t=_(e)?e.size():T(e);switch(t.length){case 1:return d(e)?s(e):1===t[0]?a(e):u(s(e),o(e,e));case 2:if(d(e))return s(e);var r=t[0],n=t[1];if(r===n)try{return a(e)}catch(e){if(!(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/)))throw e}return _(e)?i(m(e.valueOf(),r,n),e.storage()):m(e,r,n);default:throw new RangeError(\"Matrix must be two dimensional (size: \"+S(t)+\")\")}},any:function(e){return n(e,0)?ee(e):l(1,e)}});function m(e,t,i){var{C:e,F:t}=function(e,r){const n=function(i,a){const o=ee(e);let s=0;for(let n=0;ne.filter((e,t)=>t!h(o(n[t],n[t])))}}(e,t),e=c(a(c(s(e),e)),s(e)),t=c(s(t),a(c(t,s(t))));return c(t,e)}function h(e){return n(f(e,p(1,1)),f(0,p(1,1)))}function d(e){return r(f(e,p(1,1)),f(c(e,0),p(1,1)))}}),Tp=s(\"eigs\",[\"config\",\"typed\",\"matrix\",\"addScalar\",\"equal\",\"subtract\",\"abs\",\"atan\",\"cos\",\"sin\",\"multiplyScalar\",\"divideScalar\",\"inv\",\"bignumber\",\"multiply\",\"add\",\"larger\",\"column\",\"flatten\",\"number\",\"complex\",\"sqrt\",\"diag\",\"size\",\"reshape\",\"qr\",\"usolve\",\"usolveAll\",\"im\",\"re\",\"smaller\",\"matrixFromColumns\",\"dot\"],e=>{let{config:s,typed:t,matrix:i,addScalar:r,subtract:p,equal:n,abs:m,atan:a,cos:o,sin:u,multiplyScalar:h,divideScalar:y,inv:x,bignumber:P,multiply:U,add:l,larger:k,column:c,flatten:j,number:f,complex:L,sqrt:R,diag:$,size:H,reshape:G,qr:V,usolve:Z,usolveAll:W,im:d,re:g,smaller:Y,matrixFromColumns:J,dot:X}=e;const w=function(){let{config:E,addScalar:S,subtract:M,abs:C,atan:T,cos:B,sin:F,multiplyScalar:D,inv:O,bignumber:_,multiply:z,add:q}={config:s,addScalar:r,subtract:p,column:c,flatten:j,equal:n,abs:m,atan:a,cos:o,sin:u,multiplyScalar:h,inv:x,bignumber:P,complex:L,multiply:U,add:l};function I(r){var n=r.length;let i=0,a=[0,1];for(let t=0;t({value:s[t],vector:e}));return{values:s,eigenvectors:t}}return function(n,e){var i,a,o,s,u,l,c=2=Math.abs(b);){const m=r[0][0],x=r[0][1];i=p[m][m],a=p[x][x],o=p[m][x],p=function(t,e,r,n){const i=t.length,a=Math.cos(e),o=Math.sin(e),s=a*a,u=o*o,l=Array(i).fill(0),c=Array(i).fill(0),f=s*t[r][r]-2*a*o*t[r][n]+u*t[n][n],p=u*t[r][r]+2*a*o*t[r][n]+s*t[n][n];for(let e=0;e=C(N);){const g=r[0][0],w=r[0][1];s=d[g][g],u=d[w][w],l=d[g][w],u=M(u,s),d=function(t,e,r,n){const i=t.length,a=_(B(e)),o=_(F(e)),s=D(a,a),u=D(o,o),l=Array(i).fill(_(0)),c=Array(i).fill(_(0)),f=z(_(2),a,o,t[r][n]),p=S(M(D(s,t[r][r]),f),D(u,t[n][n])),m=q(D(u,t[r][r]),f,D(s,t[n][n]));for(let e=0;e2*Math.random()-1);return n&&(a=a.map(e=>M(e))),f(a=l(a=i?a.map(e=>O(e)):a,t),r)}(t,r,i);try{o=u(e,o)}catch(e){continue}if(g(c(o),a))break}if(5<=s)return null;for(s=0;;){const t=u(e,o);if(_(c(l(o,[t])),n))break;if(10<=++s)return null;o=f(t)}return o}function l(e,t){var r,n=i(e);for(r of t)r=a(r,n),e=w(e,N(d(o(r,e),o(r,r)),r));return e}function c(e){return S(E(o(e,e)))}function f(e,t){var r=\"Complex\"===t,t=\"BigNumber\"===t?M(1):r?O(1):1;return N(d(t,c(e)),e)}return function(e,t,r,n){var i=!(4+w(S(e),S(t))),100N(l,e)),d.push(...e.map(e=>({value:o,vector:b(e)})))}return d}(e,t,f,a,p,r,n);return{values:p,eigenvectors:v}}return{values:p}}}();return t(\"eigs\",{Array:function(e){return b(i(e))},\"Array, number|BigNumber\":function(e,t){return b(i(e),{precision:t})},\"Array, Object\":(e,t)=>b(i(e),t),Matrix:function(e){return b(e,{matricize:!0})},\"Matrix, number|BigNumber\":function(e,t){return b(e,{precision:t,matricize:!0})},\"Matrix, Object\":function(e,t){var r={matricize:!0};return gn(r,t),b(e,r)}});function b(e,t){t=1{var{value:e,vector:t}=e;return{value:e,vector:i(t)}}))),r&&Object.defineProperty(n,\"vectors\",{enumerable:!1,get:()=>{throw new Error(\"eigs(M).vectors replaced with eigs(M).eigenvectors\")}}),n}function v(e,r,n){e=e.datatype();if(\"number\"===e||\"BigNumber\"===e||\"Complex\"===e)return e;let i=!1,a=!1,o=!1;for(let t=0;t{let{typed:t,abs:p,add:m,identity:h,inv:d,multiply:g}=e;return t(\"expm\",{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError(\"Matrix must be square (size: \"+S(t)+\")\");var t=t[0],r=function(r){for(let t=0;t<30;t++)for(let e=0;e<=t;e++){var n=t-e;if(function(e,t,r){let n=1;for(let e=2;e<=t;e++)n*=e;let i=n;for(let e=t+1;e<=2*t;e++)i*=e;var a=i*(2*t+1);return 8*Math.pow(e/Math.pow(2,r),2*t)*n*n/(i*a)}(r,e,n)<1e-15)return{q:e,j:n}}throw new Error(\"Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)\")}(function(n){var i=n.size()[0];let e=0;for(let r=0;r{let{typed:t,abs:o,add:s,multiply:u,map:r,sqrt:n,subtract:l,inv:c,size:f,max:p,identity:m}=e;return t(\"sqrtm\",{\"Array | Matrix\":function(i){var e=_(i)?i.size():T(i);switch(e.length){case 1:if(1===e[0])return r(i,n);throw new RangeError(\"Matrix must be square (size: \"+S(e)+\")\");case 2:if(e[0]!==e[1])throw new RangeError(\"Matrix must be square (size: \"+S(e)+\")\");{var a=i;let e,t=0,r=a,n=m(f(a));do{const a=r;if(r=u(.5,s(a,c(n))),n=u(.5,s(n,c(a))),1e-6<(e=p(o(l(r,a))))&&1e3<++t)throw new Error(\"computing square root of matrix: iterative method could not converge\")}while(1e-6{let{typed:t,schur:g,matrixFromColumns:y,matrix:x,multiply:b,range:v,concat:w,transpose:N,index:A,subset:E,add:S,subtract:M,identity:C,lusolve:T,abs:B}=e;return t(Dp,{\"Matrix, Matrix, Matrix\":n,\"Array, Matrix, Matrix\":function(e,t,r){return n(x(e),t,r)},\"Array, Array, Matrix\":function(e,t,r){return n(x(e),x(t),r)},\"Array, Matrix, Array\":function(e,t,r){return n(x(e),t,x(r))},\"Matrix, Array, Matrix\":function(e,t,r){return n(e,x(t),r)},\"Matrix, Array, Array\":function(e,t,r){return n(e,x(t),x(r))},\"Matrix, Matrix, Array\":function(e,t,r){return n(e,t,x(r))},\"Array, Array, Array\":function(e,t,r){return n(x(e),x(t),x(r)).toArray()}});function n(e,t,r){const n=t.size()[0],i=e.size()[0],a=g(e),o=a.T,s=a.U,u=g(b(-1,t)),l=u.T,c=u.U,f=b(b(N(s),r),c),p=v(0,i),m=[],h=(e,t)=>w(e,t,1),d=(e,t)=>w(e,t,0);for(let r=0;r{let{typed:t,matrix:r,identity:o,multiply:s,qr:u,norm:l,subtract:c}=e;return t(\"schur\",{Array:function(e){const t=n(r(e));return{U:t.U.valueOf(),T:t.T.valueOf()}},Matrix:n});function n(e){const t=e.size()[0];let r,n=e,i=o(t),a=0;do{r=n;const e=u(n),t=e.Q,o=e.R;if(n=s(o,t),i=s(i,t),100{let{typed:t,matrix:r,sylvester:n,multiply:i,transpose:a}=e;return t(\"lyap\",{\"Matrix, Matrix\":function(e,t){return n(e,a(e),i(-1,t))},\"Array, Matrix\":function(e,t){return n(r(e),a(r(e)),i(-1,t))},\"Matrix, Array\":function(e,t){return n(e,a(r(e)),r(i(-1,t)))},\"Array, Array\":function(e,t){return n(r(e),a(r(e)),r(i(-1,t))).toArray()}})}),qp=s(\"divide\",[\"typed\",\"matrix\",\"multiply\",\"equalScalar\",\"divideScalar\",\"inv\"],e=>{let{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:a,inv:o}=e;const s=Aa({typed:t,equalScalar:i}),u=Ea({typed:t});return t(\"divide\",Fe({\"Array | Matrix, Array | Matrix\":function(e,t){return n(e,o(t))},\"DenseMatrix, any\":function(e,t){return u(e,t,a,!1)},\"SparseMatrix, any\":function(e,t){return s(e,t,a,!1)},\"Array, any\":function(e,t){return u(r(e),t,a,!1).valueOf()},\"any, Array | Matrix\":function(e,t){return n(e,o(t))}},a.signatures))}),Ip=\"distance\",kp=s(Ip,[\"typed\",\"addScalar\",\"subtractScalar\",\"divideScalar\",\"multiplyScalar\",\"deepEqual\",\"sqrt\",\"abs\"],e=>{let{typed:t,addScalar:l,subtractScalar:c,multiplyScalar:f,divideScalar:p,deepEqual:a,sqrt:m,abs:o}=e;return t(Ip,{\"Array, Array, Array\":function(e,t,r){if(2!==e.length||2!==t.length||2!==r.length)throw new TypeError(\"Invalid Arguments: Try again\");if(!s(e))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for first argument\");if(!s(t))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for second argument\");if(!s(r))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for third argument\");if(a(t,r))throw new TypeError(\"LinePoint1 should not be same with LinePoint2\");var n=c(r[1],t[1]),i=c(t[0],r[0]),t=c(f(r[0],t[1]),f(t[0],r[1]));return d(e[0],e[1],n,i,t)},\"Object, Object, Object\":function(e,t,r){if(2!==Object.keys(e).length||2!==Object.keys(t).length||2!==Object.keys(r).length)throw new TypeError(\"Invalid Arguments: Try again\");if(!s(e))throw new TypeError(\"Values of pointX and pointY should be numbers or BigNumbers\");if(!s(t))throw new TypeError(\"Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers\");if(!s(r))throw new TypeError(\"Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers\");if(a(h(t),h(r)))throw new TypeError(\"LinePoint1 should not be same with LinePoint2\");if(\"pointX\"in e&&\"pointY\"in e&&\"lineOnePtX\"in t&&\"lineOnePtY\"in t&&\"lineTwoPtX\"in r&&\"lineTwoPtY\"in r){const n=c(r.lineTwoPtY,t.lineOnePtY),a=c(t.lineOnePtX,r.lineTwoPtX),i=c(f(r.lineTwoPtX,t.lineOnePtY),f(t.lineOnePtX,r.lineTwoPtY));return d(e.pointX,e.pointY,n,a,i)}throw new TypeError(\"Key names do not match\")},\"Array, Array\":function(e,t){if(2===e.length&&3===t.length){if(!s(e))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for first argument\");if(n(t))return d(e[0],e[1],t[0],t[1],t[2]);throw new TypeError(\"Array with 3 numbers or BigNumbers expected for second argument\")}if(3===e.length&&6===t.length){if(!n(e))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for first argument\");if(u(t))return g(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5]);throw new TypeError(\"Array with 6 numbers or BigNumbers expected for second argument\")}if(e.length===t.length&&02!==e.length||!r(e[0])||!r(e[1])))return}else{if(!(3===e[0].length&&r(e[0][0])&&r(e[0][1])&&r(e[0][2])))return;if(e.some(e=>3!==e.length||!r(e[0])||!r(e[1])||!r(e[2])))return}return 1}(e)){var i=e;const a=[];let r=[],n=[];for(let t=0;t{let{typed:t,config:y,abs:x,add:b,addScalar:v,matrix:i,multiply:w,multiplyScalar:N,divideScalar:A,subtract:E,smaller:S,equalScalar:M,flatten:r,isZero:C,isNumeric:m}=e;return t(\"intersect\",{\"Array, Array, Array\":n,\"Array, Array, Array, Array\":a,\"Matrix, Matrix, Matrix\":function(e,t,r){e=n(e.valueOf(),t.valueOf(),r.valueOf());return null===e?null:i(e)},\"Matrix, Matrix, Matrix, Matrix\":function(e,t,r,n){e=a(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf());return null===e?null:i(e)}});function n(e,t,r){if(e=T(e),t=T(t),r=T(r),!F(e))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for first argument\");if(!F(t))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for second argument\");if(4===(n=r).length&&m(n[0])&&m(n[1])&&m(n[2])&&m(n[3]))return n=e[0],i=e[1],e=e[2],a=t[0],o=t[1],t=t[2],s=r[0],u=r[1],l=r[2],r=r[3],c=N(n,s),s=N(a,s),f=N(i,u),u=N(o,u),p=N(e,l),l=N(t,l),r=E(E(E(r,c),f),p),s=E(E(E(v(v(s,u),l),c),f),p),u=A(r,s),[v(n,N(u,E(a,n))),v(i,N(u,E(o,i))),v(e,N(u,E(t,e)))];var n,i,a,o,s,u,l,c,f,p;throw new TypeError(\"Array with 4 numbers expected as third argument\")}function a(e,t,r,n){if(e=T(e),t=T(t),r=T(r),n=T(n),2===e.length){if(!B(e))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for first argument\");if(!B(t))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for second argument\");if(!B(r))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for third argument\");if(B(n)){var i=t;var a=n;var o=e,s=r,i=E(o,i),a=E(s,a),u=E(N(i[0],a[1]),N(a[0],i[1]));if(C(u))return null;if(S(x(u),y.relTol))return null;var l=N(a[0],o[1]),c=N(a[1],o[0]),f=N(a[0],s[1]),a=N(a[1],s[0]),s=A(v(E(E(l,c),f),a),u);return b(w(i,s),o);return}throw new TypeError(\"Array with 2 numbers or BigNumbers expected for fourth argument\")}if(3!==e.length)throw new TypeError(\"Arrays with two or thee dimensional points expected\");if(!F(e))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for first argument\");if(!F(t))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for second argument\");if(!F(r))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for third argument\");var p,m,h,d,g;{if(F(n))return l=e[0],c=e[1],f=e[2],a=t[0],u=t[1],i=t[2],s=r[0],o=r[1],e=r[2],t=n[0],r=n[1],n=n[2],p=D(l,s,t,s,c,o,r,o,f,e,n,e),m=D(t,s,a,l,r,o,u,c,n,e,i,f),d=D(l,s,a,l,c,o,u,c,f,e,i,f),h=D(t,s,t,s,r,o,r,o,n,e,n,e),g=D(a,l,a,l,u,c,u,c,i,f,i,f),d=E(N(p,m),N(d,h)),g=E(N(g,h),N(m,m)),C(g)?null:(d=A(d,g),g=A(v(p,N(d,m)),h),p=v(l,N(d,E(a,l))),m=v(c,N(d,E(u,c))),h=v(f,N(d,E(i,f))),a=v(s,N(g,E(t,s))),l=v(o,N(g,E(r,o))),u=v(e,N(g,E(n,e))),M(p,a)&&M(m,l)&&M(h,u)?[p,m,h]:null);throw new TypeError(\"Array with 3 numbers or BigNumbers expected for fourth argument\")}}function T(e){return 1===e.length?e[0]:1Array.isArray(e)&&1===e.length)?r(e):e}function B(e){return 2===e.length&&m(e[0])&&m(e[1])}function F(e){return 3===e.length&&m(e[0])&&m(e[1])&&m(e[2])}function D(e,t,r,n,i,a,o,s,u,l,c,f){e=N(E(e,t),E(r,n)),t=N(E(i,a),E(o,s)),r=N(E(u,l),E(c,f));return v(v(e,t),r)}}),Pp=s(\"sum\",[\"typed\",\"config\",\"add\",\"numeric\"],e=>{let{typed:t,config:n,add:i,numeric:a}=e;return t(\"sum\",{\"Array | Matrix\":r,\"Array | Matrix, number | BigNumber\":function(e,t){try{return ri(e,t,i)}catch(e){throw eu(e,\"sum\")}},\"...\":function(e){if(ei(e))throw new TypeError(\"Scalar values expected in function sum\");return r(e)}});function r(e){let r;return ti(e,function(t){try{r=void 0===r?t:i(r,t)}catch(e){throw eu(e,\"sum\",t)}}),r=\"string\"==typeof(r=void 0===r?a(0,n.number):r)?a(r,Ie(r,n)):r}}),Up=\"cumsum\",jp=s(Up,[\"typed\",\"add\",\"unaryPlus\"],e=>{let{typed:t,add:n,unaryPlus:i}=e;return t(Up,{Array:r,Matrix:function(e){return e.create(r(e.valueOf(),e.datatype()))},\"Array, number | BigNumber\":a,\"Matrix, number | BigNumber\":function(e,t){return e.create(a(e.valueOf(),t),e.datatype())},\"...\":function(e){if(ei(e))throw new TypeError(\"All values expected to be scalar in function cumsum\");return r(e)}});function r(e){try{return s(e)}catch(e){throw eu(e,Up)}}function s(t){if(0===t.length)return[];const r=[i(t[0])];for(let e=1;e=r.length)throw new En(t,r.length);try{return function e(t,r){let n,i,a;if(r<=0){const o=t[0][0];if(Array.isArray(o)){for(a=Kn(t),i=[],n=0;n{let{typed:t,add:i,divide:a}=e;return t(\"mean\",{\"Array | Matrix\":r,\"Array | Matrix, number | BigNumber\":function(e,t){try{var r=ri(e,t,i),n=Array.isArray(e)?T(e):e.size();return a(r,n[t])}catch(e){throw eu(e,\"mean\")}},\"...\":function(e){if(ei(e))throw new TypeError(\"Scalar values expected in function mean\");return r(e)}});function r(e){let r,n=0;if(ti(e,function(t){try{r=void 0===r?t:i(r,t),n++}catch(e){throw eu(e,\"mean\",t)}}),0===n)throw new Error(\"Cannot calculate the mean of an empty array\");return a(r,n)}}),$p=s(\"median\",[\"typed\",\"add\",\"divide\",\"compare\",\"partitionSelect\"],e=>{let{typed:t,add:r,divide:n,compare:a,partitionSelect:o}=e;function i(r){try{var e=(r=E(r.valueOf())).length;if(0===e)throw new Error(\"Cannot calculate median of an empty array\");if(e%2==0){var n=e/2-1,i=o(r,1+n);let t=r[n];for(let e=0;e{let{typed:t,abs:r,map:n,median:i,subtract:a}=e;return t(\"mad\",{\"Array | Matrix\":o,\"...\":o});function o(e){if(0===(e=E(e.valueOf())).length)throw new Error(\"Cannot calculate median absolute deviation (mad) of an empty array\");try{const t=i(e);return i(n(e,function(e){return r(a(e,t))}))}catch(e){throw e instanceof TypeError&&e.message.includes(\"median\")?new TypeError(e.message.replace(\"median\",\"mad\")):eu(e,\"mad\")}}}),Gp=\"unbiased\",Vp=\"variance\",Zp=s(Vp,[\"typed\",\"add\",\"subtract\",\"multiply\",\"divide\",\"mapSlices\",\"isNaN\"],e=>{let{typed:t,add:a,subtract:o,multiply:s,divide:u,mapSlices:n,isNaN:l}=e;return t(Vp,{\"Array | Matrix\":function(e){return i(e,Gp)},\"Array | Matrix, string\":i,\"Array | Matrix, number | BigNumber\":function(e,t){return r(e,t,Gp)},\"Array | Matrix, number | BigNumber, string\":r,\"...\":function(e){return i(e,Gp)}});function i(e,t){let r,n=0;if(0===e.length)throw new SyntaxError(\"Function variance requires one or more parameters (0 provided)\");if(ti(e,function(t){try{r=void 0===r?t:a(r,t),n++}catch(e){throw eu(e,\"variance\",t)}}),0===n)throw new Error(\"Cannot calculate variance of an empty array\");const i=u(r,n);if(r=void 0,ti(e,function(e){e=o(e,i);r=void 0===r?s(e,e):a(r,s(e,e))}),l(r))return r;switch(t){case\"uncorrected\":return u(r,n);case\"biased\":return u(r,n+1);case\"unbiased\":{const e=Q(r)?r.mul(0):0;return 1===n?e:u(r,n-1)}default:throw new Error('Unknown normalization \"'+t+'\". Choose \"unbiased\" (default), \"uncorrected\", or \"biased\".')}}function r(e,t,r){try{if(0===e.length)throw new SyntaxError(\"Function variance requires one or more parameters (0 provided)\");return n(e,t,e=>i(e,r))}catch(e){throw eu(e,\"variance\")}}}),Wp=\"quantileSeq\",Yp=s(Wp,[\"typed\",\"?bignumber\",\"add\",\"subtract\",\"divide\",\"multiply\",\"partitionSelect\",\"compare\",\"isInteger\",\"smaller\",\"smallerEq\",\"larger\",\"mapSlices\"],e=>{let{typed:t,bignumber:o,add:l,subtract:c,divide:s,multiply:f,partitionSelect:p,compare:m,isInteger:h,smaller:u,smallerEq:d,larger:g,mapSlices:a}=e;return t(Wp,{\"Array | Matrix, number | BigNumber\":(e,t)=>y(e,t,!1),\"Array | Matrix, number | BigNumber, number\":(e,t,r)=>i(e,t,!1,r,y),\"Array | Matrix, number | BigNumber, boolean\":y,\"Array | Matrix, number | BigNumber, boolean, number\":(e,t,r,n)=>i(e,t,r,n,y),\"Array | Matrix, Array | Matrix\":(e,t)=>x(e,t,!1),\"Array | Matrix, Array | Matrix, number\":(e,t,r)=>i(e,t,!1,r,x),\"Array | Matrix, Array | Matrix, boolean\":x,\"Array | Matrix, Array | Matrix, boolean, number\":(e,t,r,n)=>i(e,t,r,n,x)});function i(e,t,r,n,i){return a(e,n,e=>i(e,t,r))}function y(t,r,n){let i;var a=t.valueOf();if(u(r,0))throw new Error(\"N/prob must be non-negative\");if(d(r,1))return A(r)?b(a,r,n):o(b(a,r,n));if(g(r,1)){if(!h(r))throw new Error(\"N must be a positive integer\");if(g(r,4294967295))throw new Error(\"N must be less than or equal to 2^32-1, as that is the maximum length of an Array\");const t=l(r,1);i=[];for(let e=0;u(e,r);e++){const r=s(e+1,t);i.push(b(a,r,n))}return A(r)?i:o(i)}}function x(e,t,r){const n=e.valueOf(),i=t.valueOf(),a=[];for(let e=0;e{let{typed:t,map:r,sqrt:n,variance:i}=e;return t(\"std\",{\"Array | Matrix\":a,\"Array | Matrix, string\":a,\"Array | Matrix, number | BigNumber\":a,\"Array | Matrix, number | BigNumber, string\":a,\"...\":function(e){return a(e)}});function a(e,t){if(0===e.length)throw new SyntaxError(\"Function std requires one or more parameters (0 provided)\");try{const e=i.apply(null,arguments);return $(e)?r(e,n):n(e)}catch(e){throw e instanceof TypeError&&e.message.includes(\" variance\")?new TypeError(e.message.replace(\" variance\",\" std\")):e}}}),Xp=s(\"corr\",[\"typed\",\"matrix\",\"mean\",\"sqrt\",\"sum\",\"add\",\"subtract\",\"multiply\",\"pow\",\"divide\"],e=>{let{typed:t,matrix:r,sqrt:s,sum:u,add:l,subtract:c,multiply:f,pow:p,divide:m}=e;return t(\"corr\",{\"Array, Array\":n,\"Matrix, Matrix\":function(e,t){e=n(e.toArray(),t.toArray());return Array.isArray(e)?r(e):e}});function n(t,r){const n=[];if(Array.isArray(t[0])&&Array.isArray(r[0])){if(t.length!==r.length)throw new SyntaxError(\"Dimension mismatch. Array A and B must have the same length.\");for(let e=0;el(e,f(t,n[r])),0),e=u(e.map(e=>p(e,2))),o=u(n.map(e=>p(e,2))),a=c(f(t,a),f(r,i)),e=s(f(c(f(t,e),p(r,2)),c(f(t,o),p(i,2))));return m(a,e)}});function Qp(e,t){if(t>1;return Qp(e,r)*Qp(1+r,t)}function Kp(t,r){if(!v(t)||t<0)throw new TypeError(\"Positive integer value expected in function combinations\");if(!v(r)||r<0)throw new TypeError(\"Positive integer value expected in function combinations\");if(t{let t=e[\"typed\"];return t(em,{\"number, number\":Kp,\"BigNumber, BigNumber\":function(e,t){const r=e.constructor;let n,i;const a=e.minus(t),o=new r(1);if(!rm(e)||!rm(t))throw new TypeError(\"Positive integer value expected in function combinations\");if(t.gt(e))throw new TypeError(\"k must be less than n in function combinations\");if(n=o,t.lt(a))for(i=o;i.lte(a);i=i.plus(o))n=n.times(t.plus(i)).dividedBy(i);else for(i=o;i.lte(t);i=i.plus(o))n=n.times(a.plus(i)).dividedBy(i);return n}})});function rm(e){return e.isInteger()&&e.gte(0)}const nm=\"combinationsWithRep\",im=s(nm,[\"typed\"],e=>{let t=e[\"typed\"];return t(nm,{\"number, number\":function(e,t){if(!v(e)||e<0)throw new TypeError(\"Positive integer value expected in function combinationsWithRep\");if(!v(t)||t<0)throw new TypeError(\"Positive integer value expected in function combinationsWithRep\");if(e<1)throw new TypeError(\"k must be less than or equal to n + k - 1\");return t{let{typed:t,config:s,BigNumber:u,Complex:l}=e;return t(\"gamma\",{number:om,Complex:function e(t){if(0===t.im)return om(t.re);if(t.re<.5){const r=new l(1-t.re,-t.im),n=new l(Math.PI*t.re,Math.PI*t.im);return new l(Math.PI).div(n.sin()).div(e(r))}t=new l(t.re-1,t.im);let r=new l(um[0],0);for(let e=1;e{let{Complex:u,typed:t}=e;const l=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(\"lgamma\",{number:fm,Complex:function e(t){if(t.isNaN())return new u(NaN,NaN);if(0===t.im)return new u(fm(t.re),0);if(7<=t.re||7<=Math.abs(t.im))return a(t);if(t.re<=.1){r=6.283185307179586;const a=(!0^(0<(n=t.im)||!(n<0)&&1/n==1/0)?-r:r)*Math.floor(.5*t.re+.25),o=t.mul(Math.PI).sin().log(),i=e(new u(1-t.re,-t.im));return new u(1.1447298858494002,a).sub(o).sub(i)}return 0<=t.im?o(t):o(t.conjugate()).conjugate();var r,n},BigNumber:function(){throw new Error(\"mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber\")}});function a(e){const t=e.sub(.5).mul(e.log()).sub(e).add(lm),r=new u(1,0).div(e),n=r.div(e);let i=l[0],a=l[1];var o=2*n.re,s=n.re*n.re+n.im*n.im;for(let e=2;e<8;e++){const u=a;a=-s*i+l[e],i=o*i+u}e=r.mul(n.mul(i).add(a));return t.add(e)}function o(e){let t=0,r=0,n=e;for(e=e.add(1);e.re<=7;){const u=(n=n.mul(e)).im<0?1:0;0!=u&&0===r&&t++,r=u,e=e.add(1)}return a(e).sub(n.log()).sub(new u(0,2*t*Math.PI*1))}}),hm=\"factorial\",dm=s(hm,[\"typed\",\"gamma\"],e=>{let{typed:t,gamma:r}=e;return t(hm,{number:function(e){if(e<0)throw new Error(\"Value must be non-negative\");return r(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error(\"Value must be non-negative\");return r(e.plus(1))},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),gm=\"kldivergence\",ym=s(gm,[\"typed\",\"matrix\",\"divide\",\"sum\",\"multiply\",\"map\",\"dotDivide\",\"log\",\"isNumeric\"],e=>{let{typed:t,matrix:r,divide:i,sum:a,multiply:o,map:s,dotDivide:u,log:l,isNumeric:c}=e;return t(gm,{\"Array, Array\":function(e,t){return n(r(e),r(t))},\"Matrix, Array\":function(e,t){return n(e,r(t))},\"Array, Matrix\":function(e,t){return n(r(e),t)},\"Matrix, Matrix\":n});function n(e,t){var r=t.size().length,n=e.size().length;if(1l(e))));return c(e)?e:Number.NaN}}),xm=\"multinomial\",bm=s(xm,[\"typed\",\"add\",\"divide\",\"multiply\",\"factorial\",\"isInteger\",\"isPositive\"],e=>{let{typed:t,add:n,divide:i,multiply:a,factorial:o,isInteger:s,isPositive:u}=e;return t(xm,{\"Array | Matrix\":function(e){let t=0,r=1;return ti(e,function(e){if(!s(e)||!u(e))throw new TypeError(\"Positive integer value expected in function multinomial\");t=n(t,e),r=a(r,o(e))}),i(o(t),r)}})}),vm=\"permutations\",wm=s(vm,[\"typed\",\"factorial\"],e=>{let{typed:t,factorial:r}=e;return t(vm,{\"number | BigNumber\":r,\"number, number\":function(e,t){if(!v(e)||e<0)throw new TypeError(\"Positive integer value expected in function permutations\");if(!v(t)||t<0)throw new TypeError(\"Positive integer value expected in function permutations\");if(e{let{typed:t,config:r,on:n}=e,c=Sm(r.randomSeed);return n&&n(\"config\",function(e,t){e.randomSeed!==t.randomSeed&&(c=Sm(e.randomSeed))}),t(Mm,{\"Array | Matrix\":function(e){return i(e,{})},\"Array | Matrix, Object\":i,\"Array | Matrix, number\":function(e,t){return i(e,{number:t})},\"Array | Matrix, Array | Matrix\":function(e,t){return i(e,{weights:t})},\"Array | Matrix, Array | Matrix, number\":function(e,t,r){return i(e,{number:r,weights:t})},\"Array | Matrix, number, Array | Matrix\":function(e,t,r){return i(e,{number:t,weights:r})}});function i(n,e){let{number:t,weights:i,elementWise:r=!0}=e;e=void 0===t;e&&(t=1);const a=_(n)?n.create:_(i)?i.create:null;n=n.valueOf(),i=i&&i.valueOf(),!0===r&&(n=E(n),i=E(i));let o=0;if(void 0!==i){if(i.length!==n.length)throw new Error(\"Weights must have the same length as possibles\");for(let e=0,t=i.length;e{let{typed:t,config:r,on:n}=e,i=Sm(r.randomSeed);return n&&n(\"config\",function(e,t){e.randomSeed!==t.randomSeed&&(i=Sm(e.randomSeed))}),t(\"random\",{\"\":()=>o(0,1),number:e=>o(0,e),\"number, number\":(e,t)=>o(e,t),\"Array | Matrix\":e=>a(e,0,1),\"Array | Matrix, number\":(e,t)=>a(e,0,t),\"Array | Matrix, number, number\":(e,t,r)=>a(e,t,r)});function a(e,t,r){var n=Tm(e.valueOf(),()=>o(t,r));return _(e)?e.create(n,\"number\"):n}function o(e,t){return e+i()*(t-e)}}),Fm=\"randomInt\",Dm=s(Fm,[\"typed\",\"config\",\"log2\",\"?on\"],e=>{let{typed:t,config:r,log2:a,on:n}=e,o=Sm(r.randomSeed);return n&&n(\"config\",function(e,t){e.randomSeed!==t.randomSeed&&(o=Sm(e.randomSeed))}),t(Fm,{\"\":()=>s(0,2),number:e=>s(0,e),\"number, number\":(e,t)=>s(e,t),bigint:e=>u(0n,e),\"bigint, bigint\":u,\"Array | Matrix\":e=>i(e,0,1),\"Array | Matrix, number\":(e,t)=>i(e,0,t),\"Array | Matrix, number, number\":(e,t,r)=>i(e,t,r)});function i(e,t,r){var n=Tm(e.valueOf(),()=>s(t,r));return _(e)?e.create(n,\"number\"):n}function s(e,t){return Math.floor(e+o()*(t-e))}function u(e,t){var r=t-e;if(r<=2n**30n)return e+BigInt(s(0,Number(r)));var n=a(r);let i=r;for(;i>=r;){i=0n;for(let e=0;e{let{typed:t,addScalar:u,multiplyScalar:l,isNegative:c,isInteger:f,number:p,bignumber:m,larger:h}=e;const d=[],g=[];return t(Om,{\"number | BigNumber, number | BigNumber\":function(e,r){if(!f(e)||c(e)||!f(r)||c(r))throw new TypeError(\"Non-negative integer value expected in function stirlingS2\");if(h(r,e))throw new TypeError(\"k must be less than or equal to n in function stirlingS2\");const n=!(A(e)&&A(r)),i=n?g:d,a=n?m:p,o=p(e),s=p(r);if(i[o]&&i[o].length>s)return i[o][s];for(let t=0;t<=o;++t)if(i[t]||(i[t]=[a(0===t?1:0)]),0!==t){const r=i[t],n=i[t-1];for(let e=r.length;e<=t&&e<=s;++e)r[e]=e===t?1:u(l(a(e),n[e]),n[e-1])}return i[o][s]}})}),zm=\"bellNumbers\",qm=s(zm,[\"typed\",\"addScalar\",\"isNegative\",\"isInteger\",\"stirlingS2\"],e=>{let{typed:t,addScalar:n,isNegative:i,isInteger:a,stirlingS2:o}=e;return t(zm,{\"number | BigNumber\":function(t){if(!a(t)||i(t))throw new TypeError(\"Non-negative integer value expected in function bellNumbers\");let r=0;for(let e=0;e<=t;e++)r=n(r,o(t,e));return r}})}),Im=\"catalan\",km=s(Im,[\"typed\",\"addScalar\",\"divideScalar\",\"multiplyScalar\",\"combinations\",\"isNegative\",\"isInteger\"],e=>{let{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:o,isInteger:s}=e;return t(Im,{\"number | BigNumber\":function(e){if(!s(e)||o(e))throw new TypeError(\"Non-negative integer value expected in function catalan\");return n(a(i(e,2),e),r(e,1))}})}),Rm=\"composition\",Pm=s(Rm,[\"typed\",\"addScalar\",\"combinations\",\"isNegative\",\"isPositive\",\"isInteger\",\"larger\"],e=>{let{typed:t,addScalar:r,combinations:n,isPositive:i,isInteger:a,larger:o}=e;return t(Rm,{\"number | BigNumber, number | BigNumber\":function(e,t){if(!(a(e)&&i(e)&&a(t)&&i(t)))throw new TypeError(\"Positive integer value expected in function composition\");if(o(t,e))throw new TypeError(\"k must be less than or equal to n in function composition\");return n(r(e,-1),r(t,-1))}})}),Um=\"leafCount\",jm=s(Um,[\"parse\",\"typed\"],e=>{let t=e[\"typed\"];return t(Um,{Node:function t(e){let r=0;return e.forEach(e=>{r+=t(e)}),r||1}})});function Lm(e){return ae(e)||oe(e)&&e.isUnary()&&ae(e.args[0])}function $m(e){return!!ae(e)||!(!Ae(e)&&!oe(e)||!e.args.every($m))||!(!Me(e)||!$m(e.content))}const Hm=s(\"simplifyUtil\",[\"FunctionNode\",\"OperatorNode\",\"SymbolNode\"],e=>{let{FunctionNode:r,OperatorNode:n,SymbolNode:i}=e;const a=\"defaultF\",o={add:{trivial:!0,total:!0,commutative:!0,associative:!0},unaryPlus:{trivial:!0,total:!0,commutative:!0,associative:!0},subtract:{trivial:!1,total:!0,commutative:!1,associative:!1},multiply:{trivial:!0,total:!0,commutative:!0,associative:!0},divide:{trivial:!1,total:!0,commutative:!1,associative:!1},paren:{trivial:!0,total:!0,commutative:!0,associative:!1},defaultF:{trivial:!1,total:!0,commutative:!1,associative:!1}};function t(e,t){let r=2{let{typed:t,parse:l,equal:o,resolve:r,simplifyConstant:n,simplifyCore:i,AccessorNode:s,ArrayNode:u,ConstantNode:c,FunctionNode:f,IndexNode:p,ObjectNode:m,OperatorNode:h,ParenthesisNode:d,SymbolNode:g,replacer:y}=e;const{hasProperty:x,isCommutative:b,isAssociative:v,mergeContext:w,flatten:N,unflattenr:A,unflattenl:E,createMakeNodeFunction:S,defaultContext:a,realContext:M,positiveContext:C}=Hm({FunctionNode:f,OperatorNode:h,SymbolNode:g}),T=(t.addConversion({from:\"Object\",to:\"Map\",convert:U}),t(\"simplify\",{Node:O,\"Node, Map\":(e,t)=>O(e,!1,t),\"Node, Map, Object\":(e,t,r)=>O(e,!1,t,r),\"Node, Array\":O,\"Node, Array, Map\":O,\"Node, Array, Map, Object\":O}));function B(e){return e.transform(function(e){return Me(e)?B(e.content):e})}t.removeConversion({from:\"Object\",to:\"Map\",convert:U}),T.defaultContext=a,T.realContext=M,T.positiveContext=C;const I={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};T.rules=[i,{l:\"log(e)\",r:\"1\"},{s:\"n-n1 -> n+-n1\",assuming:{subtract:{total:!0}}},{s:\"n-n -> 0\",assuming:{subtract:{total:!1}}},{s:\"-(cl*v) -> v * (-cl)\",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:\"-(cl*v) -> (-cl) * v\",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:\"-(v*cl) -> v * (-cl)\",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:\"-(n1/n2)\",r:\"-n1/n2\"},{l:\"-v\",r:\"v * (-1)\"},{l:\"(n1 + n2)*(-1)\",r:\"n1*(-1) + n2*(-1)\",repeat:!0},{l:\"n/n1^n2\",r:\"n*n1^-n2\"},{l:\"n/n1\",r:\"n*n1^-1\"},{s:\"(n1*n2)^n3 -> n1^n3 * n2^n3\",assuming:{multiply:{commutative:!0}}},{s:\"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)\",assuming:{multiply:{commutative:!1}}},{s:\"(n ^ n1) ^ n2 -> n ^ (n1 * n2)\",assuming:{divide:{total:!0}}},{l:\" vd * ( vd * n1 + n2)\",r:\"vd^2 * n1 + vd * n2\"},{s:\" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2\",assuming:{divide:{total:!0}}},{s:\"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2\",assuming:{divide:{total:!0}}},{s:\"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2\",assuming:{divide:{total:!0}}},{l:\"n*n\",r:\"n^2\"},{s:\"n * n^n1 -> n^(n1+1)\",assuming:{divide:{total:!0}}},{s:\"n^n1 * n^n2 -> n^(n1+n2)\",assuming:{divide:{total:!0}}},n,{s:\"n+n -> 2*n\",assuming:{add:{total:!0}}},{l:\"n+-n\",r:\"0\"},{l:\"vd*n + vd\",r:\"vd*(n+1)\"},{l:\"n3*n1 + n3*n2\",r:\"n3*(n1+n2)\"},{l:\"n3^(-n4)*n1 + n3 * n2\",r:\"n3^(-n4)*(n1 + n3^(n4+1) *n2)\"},{l:\"n3^(-n4)*n1 + n3^n5 * n2\",r:\"n3^(-n4)*(n1 + n3^(n4+n5)*n2)\"},{s:\"n*vd + vd -> (n+1)*vd\",assuming:{multiply:{commutative:!1}}},{s:\"vd + n*vd -> (1+n)*vd\",assuming:{multiply:{commutative:!1}}},{s:\"n1*n3 + n2*n3 -> (n1+n2)*n3\",assuming:{multiply:{commutative:!1}}},{s:\"n^n1 * n -> n^(n1+1)\",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:\"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)\",assuming:{multiply:{commutative:!1}}},{s:\"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)\",assuming:{multiply:{commutative:!1}}},{l:\"n*cd + cd\",r:\"(n+1)*cd\"},{s:\"cd*n + cd -> cd*(n+1)\",assuming:{multiply:{commutative:!1}}},{s:\"cd + cd*n -> cd*(1+n)\",assuming:{multiply:{commutative:!1}}},n,{s:\"(-n)*n1 -> -(n*n1)\",assuming:{subtract:{total:!0}}},{s:\"n1*(-n) -> -(n1*n)\",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:\"ce+ve -> ve+ce\",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:\"vd*cd -> cd*vd\",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:\"n+-n1\",r:\"n-n1\"},{l:\"n+-(n1)\",r:\"n-(n1)\"},{s:\"n*(n1^-1) -> n/n1\",assuming:{multiply:{commutative:!0}}},{s:\"n*n1^-n2 -> n/n1^n2\",assuming:{multiply:{commutative:!0}}},{s:\"n^-1 -> 1/n\",assuming:{multiply:{commutative:!0}}},{l:\"n^1\",r:\"n\"},{s:\"n*(n1/n2) -> (n*n1)/n2\",assuming:{multiply:{associative:!0}}},{s:\"n-(n1+n2) -> n-n1-n2\",assuming:{addition:{associative:!0,commutative:!0}}},{l:\"1*n\",r:\"n\",imposeContext:{multiply:{commutative:!0}}},{s:\"n1/(n2/n3) -> (n1*n3)/n2\",assuming:{multiply:{associative:!0}}},{l:\"n1/(-n2)\",r:\"-n1/n2\"}];let F=0;function D(){return new g(\"_p\"+F++)}function O(e,n){var t=2\");if(2!==r.length)throw SyntaxError(\"Could not parse rule: \"+t.s);n.l=r[0],n.r=r[1]}else n.l=t.l,n.r=t.r;n.l=B(l(n.l)),n.r=B(l(n.r));for(const r of[\"imposeContext\",\"repeat\",\"assuming\"])r in t&&(n[r]=t[r]);if(t.evaluate&&(n.evaluate=l(t.evaluate)),v(n.l,r)){const t=!b(n.l,r);let e;t&&(e=D());const i=S(n.l),a=D();n.expanded={},n.expanded.l=i([n.l,a]),N(n.expanded.l,r),A(n.expanded.l,r),n.expanded.r=i([n.r,a]),t&&(n.expandedNC1={},n.expandedNC1.l=i([e,n.l]),n.expandedNC1.r=i([e,n.r]),n.expandedNC2={},n.expandedNC2.l=i([e,n.expanded.l]),n.expandedNC2.r=i([e,n.expanded.r]))}return n}(t,i);break;case\"function\":e=t;break;default:throw TypeError(\"Unsupported type of rule: \"+o)}a.push(e)}return a}(n||T.rules,i.context);let o=r(e,t);const s={};let u=(o=B(o)).toString({parenthesis:\"all\"});for(;!s[u];){s[u]=!0,F=0;let r=u;a&&console.log(\"Working on: \",u);for(let t=0;t \"+n[t].r.toString())),a){const n=o.toString({parenthesis:\"all\"});n!==r&&(console.log(\"Applying\",e,\"produced\",n),r=n)}E(o,i.context)}u=o.toString({parenthesis:\"all\"})}return o}function _(t,r,n){let i=t;if(t)for(let e=0;e2 commutative non-associative rule arguments not yet implemented\");const e=q(r.args[0],n.args[1],i);if(0===e.length)return[];const a=q(r.args[1],n.args[0],i);if(0===a.length)return[];t=[e,a]}a=function(e){if(0===e.length)return e;const t=e.reduce(R),r=[],n={};for(let e=0;e{let{typed:t,config:n,mathWithTransform:h,matrix:d,fraction:i,bignumber:a,AccessorNode:g,ArrayNode:y,ConstantNode:x,FunctionNode:b,IndexNode:v,ObjectNode:w,OperatorNode:o,SymbolNode:r}=e;const{isCommutative:N,isAssociative:A,allChildren:E,createMakeNodeFunction:S}=Hm({FunctionNode:b,OperatorNode:o,SymbolNode:r}),M=t(\"simplifyConstant\",{Node:e=>T(D(e,{})),\"Node, Object\":function(e,t){return T(D(e,t))}});function s(e){return re(e)?e.valueOf():e instanceof Array?e.map(s):_(e)?d(s(e.valueOf())):e}function C(t,r,n){try{return h[t].apply(null,r)}catch(e){return r=r.map(s),B(h[t].apply(null,r),n)}}const u=t({Fraction:function(e){var t=e=>(\"BigNumber\"===n.number&&a?a:Number)(e),r=e.s*e.n,r=r<0n?new o(\"-\",\"unaryMinus\",[new x(-t(r))]):new x(t(r));return 1n===e.d?r:new o(\"/\",\"divide\",[r,new x(t(e.d))])},number:function(e){return e<0?c(new x(-e)):new x(e)},BigNumber:function(e){return e<0?c(new x(-e)):new x(e)},bigint:function(e){return e<0n?c(new x(-e)):new x(e)},Complex:function(e){throw new Error(\"Cannot convert Complex number to Node\")},string:function(e){return new x(e)},Matrix:function(e){return new y(e.valueOf().map(e=>u(e)))}});function T(e){return O(e)?e:u(e)}function l(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&i){const r=i(e),n=t&&\"number\"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(r.valueOf()===e&&r.n{if(!O(e)){const n=t.pop();if(O(n))return[n,e];try{return t.push(C(r,[n,e],i)),t}catch(e){t.push(n)}}t.push(T(t.pop()));t=1===t.length?t[0]:n(t);return[n([t,T(e)])]},[t]);return 1===e.length?e[0]:n([e[0],u(e[1])])}function D(r,n){switch(r.type){case\"SymbolNode\":return r;case\"ConstantNode\":switch(typeof r.value){case\"number\":case\"bigint\":return B(r.value,n);case\"string\":return r.value;default:if(!isNaN(r.value))return B(r.value,n)}return r;case\"FunctionNode\":if(h[r.name]&&h[r.name].rawArgs)return r;if(![\"add\",\"multiply\"].includes(r.name)){const o=r.args.map(e=>D(e,n));if(!o.some(O))try{return C(r.name,o,n)}catch(r){}if(\"size\"===r.name&&1===o.length&&ye(o[0])){const r=[];let e=o[0];for(;ye(e);)r.push(e.items.length),e=e.items[0];return d(r)}return new b(r.name,o.map(T))}case\"OperatorNode\":{var i=r.fn.toString();let t,e;const s=S(r);if(oe(r)&&r.isUnary())t=[D(r.args[0],n)],e=O(t[0])?s(t):C(i,t,n);else if(A(r,n.context))if(t=(t=E(r,n.context)).map(e=>D(e,n)),N(i,n.context)){const r=[],u=[];for(let e=0;eD(e,n)),e=F(i,t,s,n);return e}case\"ParenthesisNode\":return D(r.content,n);case\"AccessorNode\":var e=D(r.object,n),t=D(r.index,n),a=n;if(!Ee(t))return new g(T(e),T(t));if(ye(e)||_(e)){const l=Array.from(t.dimensions);for(;0D(e,n));return p.some(O)?new y(p.map(T)):d(p)}case\"IndexNode\":return new v(r.dimensions.map(e=>M(e,n)));case\"ObjectNode\":{const m={};for(const h in r.properties)m[h]=M(r.properties[h],n);return new w(m)}default:throw new Error(\"Unimplemented node type in simplifyConstant: \"+r.type)}}return M}),Zm=\"simplifyCore\",Wm=s(Zm,[\"typed\",\"parse\",\"equal\",\"isZero\",\"add\",\"subtract\",\"multiply\",\"divide\",\"pow\",\"AccessorNode\",\"ArrayNode\",\"ConstantNode\",\"FunctionNode\",\"IndexNode\",\"ObjectNode\",\"OperatorNode\",\"ParenthesisNode\",\"SymbolNode\"],e=>{let{typed:t,equal:a,isZero:o,AccessorNode:s,ArrayNode:u,ConstantNode:r,FunctionNode:l,IndexNode:c,ObjectNode:f,OperatorNode:p,SymbolNode:n}=e;const m=new r(0),h=new r(1),d=new r(!0),g=new r(!1);function y(e){return oe(e)&&[\"and\",\"not\",\"or\"].includes(e.op)}const{hasProperty:x,isCommutative:b}=Hm({FunctionNode:l,OperatorNode:p,SymbolNode:n});function v(n){let i=1{1===++r&&(t=v(e,i))}),1===r)return t}let r=n;if(Ae(r)){const n=function(e){var t=\"OperatorNode:\"+e;for(const e of mf)if(t in e)return e[t].op;return null}(r.name);if(!n)return new l(v(r.fn),r.args.map(e=>v(e,i)));if(2v(e,i)));if(ye(r))return new u(r.items.map(e=>v(e,i)));if(ge(r))return new s(v(r.object,i),v(r.index,i));if(Ee(r))return new c(r.dimensions.map(e=>v(e,i)));if(Se(r)){const n={};for(const t in r.properties)n[t]=v(r.properties[t],i);return new f(n)}return r}return t(Zm,{Node:v,\"Node,Object\":v})}),Ym=s(\"resolve\",[\"typed\",\"parse\",\"ConstantNode\",\"FunctionNode\",\"OperatorNode\",\"ParenthesisNode\"],e=>{let{typed:t,parse:n,ConstantNode:i,FunctionNode:a,OperatorNode:o,ParenthesisNode:s}=e;function u(e,t){let r=2u(e,t,r))}return t(\"resolve\",{Node:u,\"Node, Map | null | undefined\":u,\"Node, Object\":(e,t)=>u(e,U(t)),\"Array | Matrix\":t.referToSelf(t=>e=>e.map(e=>t(e))),\"Array | Matrix, null | undefined\":t.referToSelf(t=>e=>e.map(e=>t(e))),\"Array, Object\":t.referTo(\"Array,Map\",r=>(e,t)=>r(e,U(t))),\"Matrix, Object\":t.referTo(\"Matrix,Map\",r=>(e,t)=>r(e,U(t))),\"Array | Matrix, Map\":t.referToSelf(r=>(e,t)=>e.map(e=>r(e,t)))})}),Jm=\"symbolicEqual\",Xm=s(Jm,[\"parse\",\"simplify\",\"typed\",\"OperatorNode\"],e=>{let{simplify:n,typed:t,OperatorNode:i}=e;function r(e,t){var r=2{let{typed:t,config:r,parse:n,simplify:o,equal:l,isZero:c,numeric:i,ConstantNode:a,FunctionNode:f,OperatorNode:p,ParenthesisNode:s,SymbolNode:m}=e;function u(e,t){var r=2u(e,h(t)),\"Node, string, Object\":(e,t,r)=>u(e,h(t),r)}),g=(d._simplify=!0,d.toTex=function(e){return g.apply(null,e.args)},t(\"_derivTex\",{\"Node, SymbolNode\":function(e,t){return ae(e)&&\"string\"===K(e.value)?g(n(e.value).toString(),t.toString(),1):g(e.toTex(),t.toString(),1)},\"Node, ConstantNode\":function(e,t){if(\"string\"===K(t.value))return g(e,n(t.value));throw new Error(\"The second parameter to 'derivative' is a non-string constant\")},\"Node, SymbolNode, ConstantNode\":function(e,t,r){return g(e.toString(),t.name,r.value)},\"string, string, number\":function(e,t,r){return(1===r?\"{d\\\\over d\"+t+\"}\":\"{d^{\"+r+\"}\\\\over d\"+t+\"^{\"+r+\"}}\")+`\\\\left[${e}\\\\right]`}})),y=t(\"_isConst\",{\"function, ConstantNode, string\":function(){return!0},\"function, SymbolNode, string\":function(e,t,r){return t.name!==r},\"function, ParenthesisNode, string\":function(e,t,r){return e(t.content,r)},\"function, FunctionAssignmentNode, string\":function(e,t,r){return!t.params.includes(r)||e(t.expr,r)},\"function, FunctionNode | OperatorNode, string\":function(t,e,r){return e.args.every(e=>t(e,r))}}),x=t(\"_derivative\",{\"ConstantNode, function\":function(){return b(0)},\"SymbolNode, function\":function(e,t){return t(e)?b(0):b(1)},\"ParenthesisNode, function\":function(e,t){return new s(x(e.content,t))},\"FunctionAssignmentNode, function\":function(e,t){return t(e)?b(0):x(e.expr,t)},\"FunctionNode, function\":function(e,t){if(t(e))return b(0);const r=e.args[0];let n,i,a,o,s=!1,u=!1;switch(e.name){case\"cbrt\":s=!0,i=new p(\"*\",\"multiply\",[b(3),new p(\"^\",\"pow\",[r,new p(\"/\",\"divide\",[b(2),b(3)])])]);break;case\"sqrt\":case\"nthRoot\":if(1===e.args.length)s=!0,i=new p(\"*\",\"multiply\",[b(2),new f(\"sqrt\",[r])]);else if(2===e.args.length)return n=new p(\"/\",\"divide\",[b(1),e.args[1]]),x(new p(\"^\",\"pow\",[r,n]),t);break;case\"log10\":n=b(10);case\"log\":if(n||1!==e.args.length){if(1===e.args.length&&n||2===e.args.length&&t(e.args[1]))i=new p(\"*\",\"multiply\",[r.clone(),new f(\"log\",[n||e.args[1]])]),s=!0;else if(2===e.args.length)return x(new p(\"/\",\"divide\",[new f(\"log\",[r]),new f(\"log\",[e.args[1]])]),t)}else i=r.clone(),s=!0;break;case\"pow\":if(2===e.args.length)return x(new p(\"^\",\"pow\",[r,e.args[1]]),t);break;case\"exp\":i=new f(\"exp\",[r.clone()]);break;case\"sin\":i=new f(\"cos\",[r.clone()]);break;case\"cos\":i=new p(\"-\",\"unaryMinus\",[new f(\"sin\",[r.clone()])]);break;case\"tan\":i=new p(\"^\",\"pow\",[new f(\"sec\",[r.clone()]),b(2)]);break;case\"sec\":i=new p(\"*\",\"multiply\",[e,new f(\"tan\",[r.clone()])]);break;case\"csc\":u=!0,i=new p(\"*\",\"multiply\",[e,new f(\"cot\",[r.clone()])]);break;case\"cot\":u=!0,i=new p(\"^\",\"pow\",[new f(\"csc\",[r.clone()]),b(2)]);break;case\"asin\":s=!0,i=new f(\"sqrt\",[new p(\"-\",\"subtract\",[b(1),new p(\"^\",\"pow\",[r.clone(),b(2)])])]);break;case\"acos\":s=!0,u=!0,i=new f(\"sqrt\",[new p(\"-\",\"subtract\",[b(1),new p(\"^\",\"pow\",[r.clone(),b(2)])])]);break;case\"atan\":s=!0,i=new p(\"+\",\"add\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)]);break;case\"asec\":s=!0,i=new p(\"*\",\"multiply\",[new f(\"abs\",[r.clone()]),new f(\"sqrt\",[new p(\"-\",\"subtract\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)])])]);break;case\"acsc\":s=!0,u=!0,i=new p(\"*\",\"multiply\",[new f(\"abs\",[r.clone()]),new f(\"sqrt\",[new p(\"-\",\"subtract\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)])])]);break;case\"acot\":s=!0,u=!0,i=new p(\"+\",\"add\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)]);break;case\"sinh\":i=new f(\"cosh\",[r.clone()]);break;case\"cosh\":i=new f(\"sinh\",[r.clone()]);break;case\"tanh\":i=new p(\"^\",\"pow\",[new f(\"sech\",[r.clone()]),b(2)]);break;case\"sech\":u=!0,i=new p(\"*\",\"multiply\",[e,new f(\"tanh\",[r.clone()])]);break;case\"csch\":u=!0,i=new p(\"*\",\"multiply\",[e,new f(\"coth\",[r.clone()])]);break;case\"coth\":u=!0,i=new p(\"^\",\"pow\",[new f(\"csch\",[r.clone()]),b(2)]);break;case\"asinh\":s=!0,i=new f(\"sqrt\",[new p(\"+\",\"add\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)])]);break;case\"acosh\":s=!0,i=new f(\"sqrt\",[new p(\"-\",\"subtract\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)])]);break;case\"atanh\":s=!0,i=new p(\"-\",\"subtract\",[b(1),new p(\"^\",\"pow\",[r.clone(),b(2)])]);break;case\"asech\":s=!0,u=!0,i=new p(\"*\",\"multiply\",[r.clone(),new f(\"sqrt\",[new p(\"-\",\"subtract\",[b(1),new p(\"^\",\"pow\",[r.clone(),b(2)])])])]);break;case\"acsch\":s=!0,u=!0,i=new p(\"*\",\"multiply\",[new f(\"abs\",[r.clone()]),new f(\"sqrt\",[new p(\"+\",\"add\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)])])]);break;case\"acoth\":s=!0,u=!0,i=new p(\"-\",\"subtract\",[b(1),new p(\"^\",\"pow\",[r.clone(),b(2)])]);break;case\"abs\":i=new p(\"/\",\"divide\",[new f(new m(\"abs\"),[r.clone()]),r.clone()]);break;default:throw new Error('Cannot process function \"'+e.name+'\" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}o=s?(a=\"/\",\"divide\"):(a=\"*\",\"multiply\");let l=x(r,t);return u&&(l=new p(\"-\",\"unaryMinus\",[l])),new p(a,o,[l,i])},\"OperatorNode, function\":function(e,r){if(r(e))return b(0);if(\"+\"===e.op)return new p(e.op,e.fn,e.args.map(function(e){return x(e,r)}));if(\"-\"===e.op){if(e.isUnary())return new p(e.op,e.fn,[x(e.args[0],r)]);if(e.isBinary())return new p(e.op,e.fn,[x(e.args[0],r),x(e.args[1],r)])}if(\"*\"===e.op){const t=e.args.filter(function(e){return r(e)});if(0{let{typed:t,simplifyConstant:l,simplifyCore:c,simplify:f,ConstantNode:p,OperatorNode:m,SymbolNode:h}=e;function r(a){var e=1r(e,{},t),\"Node, Object\":r,\"Node, Object, boolean\":r});function d(e,a){let o=(a=void 0===a?[]:a)[0]=0,s=\"\";!function t(r,e,n){var i=r.type;if(\"FunctionNode\"===i)throw new Error(\"There is an unsolved function call\");if(\"OperatorNode\"===i){if(!\"+-*^\".includes(r.op))throw new Error(\"Operator \"+r.op+\" invalid\");if(null!==e){if((\"unaryMinus\"===r.fn||\"pow\"===r.fn)&&\"add\"!==e.fn&&\"subtract\"!==e.fn&&\"multiply\"!==e.fn)throw new Error(\"Invalid \"+r.op+\" placing\");if((\"subtract\"===r.fn||\"add\"===r.fn||\"multiply\"===r.fn)&&\"add\"!==e.fn&&\"subtract\"!==e.fn)throw new Error(\"Invalid \"+r.op+\" placing\");if((\"subtract\"===r.fn||\"add\"===r.fn||\"unaryMinus\"===r.fn)&&0!==n.noFil)throw new Error(\"Invalid \"+r.op+\" placing\")}\"^\"!==r.op&&\"*\"!==r.op||(n.fire=r.op);for(let e=0;eo&&(a[t]=0),a[t]+=n.cte*(\"+\"===n.oper?1:-1),o=Math.max(t,o),0}n.cte=t,\"\"===n.fire&&(a[0]+=n.cte*(\"+\"===n.oper?1:-1))}}}(e,null,{cte:1,oper:\"+\",fire:\"\"});let n,i=!0;for(let r=o=a.length-1;0<=r;r--)if(0!==a[r]){let t=new p(i?a[r]:Math.abs(a[r]));var u=a[r]<0?\"-\":\"+\";if(0{let{typed:t,add:a,multiply:o,Complex:s,number:u}=e;return t(\"zpk2tf\",{\"Array,Array,number\":n,\"Array,Array\":function(e,t){return n(e,t,1)},\"Matrix,Matrix,number\":function(e,t,r){return n(e.valueOf(),t.valueOf(),r)},\"Matrix,Matrix\":function(e,t){return n(e.valueOf(),t.valueOf(),1)}});function n(r,n,t){r.some(e=>\"BigNumber\"===e.type)&&(r=r.map(e=>u(e))),n.some(e=>\"BigNumber\"===e.type)&&(n=n.map(e=>u(e)));let i=[s(1,0)],a=[s(1,0)];for(let t=0;t{let{typed:t,add:l,multiply:c,Complex:f,divide:r,matrix:n}=e;return t(\"freqz\",{\"Array, Array\":function(e,t){return i(e,t,a(512))},\"Array, Array, Array\":i,\"Array, Array, number\":function(e,t,r){if(r<0)throw new Error(\"w must be a positive number\");return i(e,t,a(r))},\"Matrix, Matrix\":function(e,t){var r=a(512),{w:e,h:t}=i(e.valueOf(),t.valueOf(),r);return{w:n(e),h:n(t)}},\"Matrix, Matrix, Matrix\":function(e,t,r){e=i(e.valueOf(),t.valueOf(),r.valueOf()).h;return{h:n(e),w:n(r)}},\"Matrix, Matrix, number\":function(e,t,r){if(r<0)throw new Error(\"w must be a positive number\");r=a(r),e=i(e.valueOf(),t.valueOf(),r).h;return{h:n(e),w:n(r)}}});function i(i,a,o){const s=[],u=[];for(let n=0;n{let n=e[\"classes\"];return function(e,t){const r=n[t&&t.mathjs];return r&&\"function\"==typeof r.fromJSON?r.fromJSON(t):t}}),a0=s(\"replacer\",[],()=>function(e,t){return\"number\"!=typeof t||isFinite(t)&&!isNaN(t)?\"bigint\"==typeof t?{mathjs:\"bigint\",value:String(t)}:t:{mathjs:\"number\",value:String(t)}}),o0=Math.PI,s0=2*Math.PI,u0=Math.E,l0=s(\"true\",[],()=>!0),c0=s(\"false\",[],()=>!1),f0=s(\"null\",[],()=>null),p0=T0(\"Infinity\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(1/0):1/0}),m0=T0(\"NaN\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(NaN):NaN}),h0=T0(\"pi\",[\"config\",\"?BigNumber\"],e=>{var{config:e,BigNumber:t}=e;return\"BigNumber\"===e.number?_l(t):o0}),d0=T0(\"tau\",[\"config\",\"?BigNumber\"],e=>{var{config:e,BigNumber:t}=e;return\"BigNumber\"===e.number?zl(t):s0}),g0=T0(\"e\",[\"config\",\"?BigNumber\"],e=>{var{config:e,BigNumber:t}=e;return\"BigNumber\"===e.number?Dl(t):u0}),y0=T0(\"phi\",[\"config\",\"?BigNumber\"],e=>{var{config:e,BigNumber:t}=e;return\"BigNumber\"===e.number?Ol(t):1.618033988749895}),x0=T0(\"LN2\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(2).ln():Math.LN2}),b0=T0(\"LN10\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(10).ln():Math.LN10}),v0=T0(\"LOG2E\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(1).div(new r(2).ln()):Math.LOG2E}),w0=T0(\"LOG10E\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(1).div(new r(10).ln()):Math.LOG10E}),N0=T0(\"SQRT1_2\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(\"0.5\").sqrt():Math.SQRT1_2}),A0=T0(\"SQRT2\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(2).sqrt():Math.SQRT2}),E0=T0(\"i\",[\"Complex\"],e=>{e=e.Complex;return e.I}),S0=s(\"PI\",[\"pi\"],e=>{e=e.pi;return e}),M0=s(\"E\",[\"e\"],e=>{e=e.e;return e}),C0=s(\"version\",[],()=>\"14.8.1\");function T0(e,t,r){return s(e,t,r,{recreateOnConfigChange:!0})}const B0=e(\"speedOfLight\",\"299792458\",\"m s^-1\"),F0=e(\"gravitationConstant\",\"6.67430e-11\",\"m^3 kg^-1 s^-2\"),D0=e(\"planckConstant\",\"6.62607015e-34\",\"J s\"),O0=e(\"reducedPlanckConstant\",\"1.0545718176461565e-34\",\"J s\"),_0=e(\"magneticConstant\",\"1.25663706212e-6\",\"N A^-2\"),z0=e(\"electricConstant\",\"8.8541878128e-12\",\"F m^-1\"),q0=e(\"vacuumImpedance\",\"376.730313667\",\"ohm\"),I0=e(\"coulomb\",\"8.987551792261171e9\",\"N m^2 C^-2\"),k0=e(\"coulombConstant\",\"8.987551792261171e9\",\"N m^2 C^-2\"),R0=e(\"elementaryCharge\",\"1.602176634e-19\",\"C\"),P0=e(\"bohrMagneton\",\"9.2740100783e-24\",\"J T^-1\"),U0=e(\"conductanceQuantum\",\"7.748091729863649e-5\",\"S\"),j0=e(\"inverseConductanceQuantum\",\"12906.403729652257\",\"ohm\"),L0=e(\"magneticFluxQuantum\",\"2.0678338484619295e-15\",\"Wb\"),$0=e(\"nuclearMagneton\",\"5.0507837461e-27\",\"J T^-1\"),H0=e(\"klitzing\",\"25812.807459304513\",\"ohm\"),G0=e(\"bohrRadius\",\"5.29177210903e-11\",\"m\"),V0=e(\"classicalElectronRadius\",\"2.8179403262e-15\",\"m\"),Z0=e(\"electronMass\",\"9.1093837015e-31\",\"kg\"),W0=e(\"fermiCoupling\",\"1.1663787e-5\",\"GeV^-2\"),Y0=Mh(\"fineStructure\",.0072973525693),J0=e(\"hartreeEnergy\",\"4.3597447222071e-18\",\"J\"),X0=e(\"protonMass\",\"1.67262192369e-27\",\"kg\"),Q0=e(\"deuteronMass\",\"3.3435830926e-27\",\"kg\"),K0=e(\"neutronMass\",\"1.6749271613e-27\",\"kg\"),eh=e(\"quantumOfCirculation\",\"3.6369475516e-4\",\"m^2 s^-1\"),th=e(\"rydberg\",\"10973731.568160\",\"m^-1\"),rh=e(\"thomsonCrossSection\",\"6.6524587321e-29\",\"m^2\"),nh=Mh(\"weakMixingAngle\",.2229),ih=Mh(\"efimovFactor\",22.7),ah=e(\"atomicMass\",\"1.66053906660e-27\",\"kg\"),oh=e(\"avogadro\",\"6.02214076e23\",\"mol^-1\"),sh=e(\"boltzmann\",\"1.380649e-23\",\"J K^-1\"),uh=e(\"faraday\",\"96485.33212331001\",\"C mol^-1\"),lh=e(\"firstRadiation\",\"3.7417718521927573e-16\",\"W m^2\"),ch=e(\"loschmidt\",\"2.686780111798444e25\",\"m^-3\"),fh=e(\"gasConstant\",\"8.31446261815324\",\"J K^-1 mol^-1\"),ph=e(\"molarPlanckConstant\",\"3.990312712893431e-10\",\"J s mol^-1\"),mh=e(\"molarVolume\",\"0.022413969545014137\",\"m^3 mol^-1\"),hh=Mh(\"sackurTetrode\",-1.16487052358),dh=e(\"secondRadiation\",\"0.014387768775039337\",\"m K\"),gh=e(\"stefanBoltzmann\",\"5.67037441918443e-8\",\"W m^-2 K^-4\"),yh=e(\"wienDisplacement\",\"2.897771955e-3\",\"m K\"),xh=e(\"molarMass\",\"0.99999999965e-3\",\"kg mol^-1\"),bh=e(\"molarMassC12\",\"11.9999999958e-3\",\"kg mol^-1\"),vh=e(\"gravity\",\"9.80665\",\"m s^-2\"),wh=e(\"planckLength\",\"1.616255e-35\",\"m\"),Nh=e(\"planckMass\",\"2.176435e-8\",\"kg\"),Ah=e(\"planckTime\",\"5.391245e-44\",\"s\"),Eh=e(\"planckCharge\",\"1.87554603778e-18\",\"C\"),Sh=e(\"planckTemperature\",\"1.416785e+32\",\"K\");function e(e,a,o){return s(e,[\"config\",\"Unit\",\"BigNumber\"],e=>{let{config:t,Unit:r,BigNumber:n}=e;const i=new r(\"BigNumber\"===t.number?new n(a):parseFloat(a),o);return i.fixPrefix=!0,i})}function Mh(e,n){return s(e,[\"config\",\"BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(n):n})}const Ch=s(\"mapSlices\",[\"typed\",\"isInteger\"],e=>{let{typed:t,isInteger:r}=e;const n=ga({typed:t,isInteger:r});return t(\"mapSlices\",{\"...any\":function(e){const t=e[1];A(t)?e[1]=t-1:Q(t)&&(e[1]=t.minus(1));try{return n.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0,...ga.meta}),Th=s(\"column\",[\"typed\",\"Index\",\"matrix\",\"range\"],e=>{let{typed:t,Index:r,matrix:n,range:i}=e;const a=es({typed:t,Index:r,matrix:n,range:i});return t(\"column\",{\"...any\":function(e){var t=e.length-1,r=e[t];A(r)&&(e[t]=r-1);try{return a.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0});function Bh(e,t,r){var n=e.filter(function(e){return se(e)&&!(e.name in t)&&!r.has(e.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression \"'+e+'\"');const i=n.name,a=new Map,o=new k(r,a,new Set([i])),s=e.compile();return function(e){return a.set(i,e),s.evaluate(o)}}const Fh=s(\"transformCallback\",[\"typed\"],e=>{let o=e[\"typed\"];return function(e,t){return o.isTypedFunction(e)?function i(e,a){const t=Object.fromEntries(Object.entries(e.signatures).map(e=>{let[t,r]=e;const n=t.split(\",\").length;return o.isTypedFunction(r)?[t,i(r,a)]:[t,Dh(r,n,a)]}));return\"string\"==typeof e.name?o(e.name,t):o(t)}(e,t):Dh(e,e.length,t)}});function Dh(o,e,s){return e===s?o:e===s+1?function(){for(var e=arguments.length,t=new Array(e),r=0;re+1)}const _h=s(\"filter\",[\"typed\"],e=>{let u=e[\"typed\"];function t(e,t,r){const n=is({typed:u}),i=Fh({typed:u});if(0===e.length)return n();let a=e[0];if(1===e.length)return n(a);var o=e.length-1;let s=e[o];return a=a&&l(a,r),s=s&&(se(s)||Ne(s)?l(s,r):Bh(s,t,r)),n(a,i(s,o))}function l(e,t){return e.compile().evaluate(t)}return t.rawArgs=!0,t},{isTransformFunction:!0}),zh=s(\"forEach\",[\"typed\"],e=>{e=e.typed;const o=ls({typed:e}),s=Fh({typed:e});function t(e,t,r){if(0===e.length)return o();let n=e[0];if(1===e.length)return o(n);var i=e.length-1;let a=e[i];return n=n&&u(n,r),a=a&&(se(a)||Ne(a)?u(a,r):Bh(a,t,r)),o(n,s(a,i))}function u(e,t){return e.compile().evaluate(t)}return t.rawArgs=!0,t},{isTransformFunction:!0}),qh=s(\"index\",[\"Index\",\"getMatrixDataType\"],e=>{let{Index:t,getMatrixDataType:n}=e;return function(){const r=[];for(let t=0,e=arguments.length;t{e=e.typed;const s=gs({typed:e}),u=Fh({typed:e});function t(e,t,r){if(0===e.length)return s();if(1===e.length)return s(e[0]);var n=e.length-1;let i=e.slice(0,n),a=e[n];return i=i.map(e=>o(e,r)),a=a&&(se(a)||Ne(a)?o(a,r):Bh(a,t,r)),s(...i,u(a,n));function o(e,t){return e.compile().evaluate(t)}}return t.rawArgs=!0,t},{isTransformFunction:!0});function kh(e){var t,r;return 2===e.length&&$(e[0])&&(A(r=t=(e=e.slice())[1])||Q(r))&&(e[1]=A(r=t)?r-1:Q(r)?r.minus(1):r),e}const Rh=s(\"max\",[\"typed\",\"config\",\"numeric\",\"larger\",\"isNaN\"],e=>{let{typed:t,config:r,numeric:n,larger:i,isNaN:a}=e;const o=Nl({typed:t,config:r,numeric:n,larger:i,isNaN:a});return t(\"max\",{\"...any\":function(e){e=kh(e);try{return o.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Ph=s(\"mean\",[\"typed\",\"add\",\"divide\"],e=>{let{typed:t,add:r,divide:n}=e;const i=Lp({typed:t,add:r,divide:n});return t(\"mean\",{\"...any\":function(e){e=kh(e);try{return i.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Uh=s(\"min\",[\"typed\",\"config\",\"numeric\",\"smaller\",\"isNaN\"],e=>{let{typed:t,config:r,numeric:n,smaller:i,isNaN:a}=e;const o=Al({typed:t,config:r,numeric:n,smaller:i,isNaN:a});return t(\"min\",{\"...any\":function(e){e=kh(e);try{return o.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),jh=s(\"range\",[\"typed\",\"config\",\"?matrix\",\"?bignumber\",\"smaller\",\"smallerEq\",\"larger\",\"largerEq\",\"add\",\"isPositive\"],e=>{let{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u,add:l,isPositive:c}=e;const f=Ns({typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u,add:l,isPositive:c});return t(\"range\",{\"...any\":function(e){return\"boolean\"!=typeof e[e.length-1]&&e.push(!0),f.apply(null,e)}})},{isTransformFunction:!0}),Lh=s(\"row\",[\"typed\",\"Index\",\"matrix\",\"range\"],e=>{let{typed:t,Index:r,matrix:n,range:i}=e;const a=Bs({typed:t,Index:r,matrix:n,range:i});return t(\"row\",{\"...any\":function(e){var t=e.length-1,r=e[t];A(r)&&(e[t]=r-1);try{return a.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),$h=s(\"subset\",[\"typed\",\"matrix\",\"zeros\",\"add\"],e=>{let{typed:t,matrix:r,zeros:n,add:i}=e;const a=_s({typed:t,matrix:r,zeros:n,add:i});return t(\"subset\",{\"...any\":function(e){try{return a.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Hh=s(\"concat\",[\"typed\",\"matrix\",\"isInteger\"],e=>{let{typed:t,matrix:r,isInteger:n}=e;const i=Ko({typed:t,matrix:r,isInteger:n});return t(\"concat\",{\"...any\":function(e){const t=e.length-1,r=e[t];A(r)?e[t]=r-1:Q(r)&&(e[t]=r.minus(1));try{return i.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Gh=s(\"diff\",[\"typed\",\"matrix\",\"subtract\",\"number\",\"bignumber\"],e=>{let{typed:t,matrix:r,subtract:n,number:i,bignumber:a}=e;const o=ys({typed:t,matrix:r,subtract:n,number:i,bignumber:a});return t(\"diff\",{\"...any\":function(e){e=kh(e);try{return o.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Vh=s(\"std\",[\"typed\",\"map\",\"sqrt\",\"variance\"],e=>{let{typed:t,map:r,sqrt:n,variance:i}=e;const a=Jp({typed:t,map:r,sqrt:n,variance:i});return t(\"std\",{\"...any\":function(e){e=kh(e);try{return a.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Zh=s(\"sum\",[\"typed\",\"config\",\"add\",\"numeric\"],e=>{let{typed:t,config:r,add:n,numeric:i}=e;const a=Pp({typed:t,config:r,add:n,numeric:i});return t(\"sum\",{\"...any\":function(e){e=kh(e);try{return a.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Wh=s(\"quantileSeq\",[\"typed\",\"bignumber\",\"add\",\"subtract\",\"divide\",\"multiply\",\"partitionSelect\",\"compare\",\"isInteger\",\"smaller\",\"smallerEq\",\"larger\",\"mapSlices\"],e=>{let{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:s,compare:u,isInteger:l,smaller:c,smallerEq:f,larger:p,mapSlices:m}=e;const h=Yp({typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:s,compare:u,isInteger:l,smaller:c,smallerEq:f,larger:p,mapSlices:m});return t(\"quantileSeq\",{\"Array | Matrix, number | BigNumber\":h,\"Array | Matrix, number | BigNumber, number\":(e,t,r)=>h(e,t,d(r)),\"Array | Matrix, number | BigNumber, boolean\":h,\"Array | Matrix, number | BigNumber, boolean, number\":(e,t,r,n)=>h(e,t,r,d(n)),\"Array | Matrix, Array | Matrix\":h,\"Array | Matrix, Array | Matrix, number\":(e,t,r)=>h(e,t,d(r)),\"Array | Matrix, Array | Matrix, boolean\":h,\"Array | Matrix, Array | Matrix, boolean, number\":(e,t,r,n)=>h(e,t,r,d(n))});function d(e){return kh([[],e])[1]}},{isTransformFunction:!0}),Yh=s(\"cumsum\",[\"typed\",\"add\",\"unaryPlus\"],e=>{let{typed:t,add:r,unaryPlus:n}=e;const i=jp({typed:t,add:r,unaryPlus:n});return t(\"cumsum\",{\"...any\":function(e){if(2===e.length&&$(e[0])){const t=e[1];A(t)?e[1]=t-1:Q(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Jh=\"variance\",Xh=s(Jh,[\"typed\",\"add\",\"subtract\",\"multiply\",\"divide\",\"mapSlices\",\"isNaN\"],e=>{let{typed:t,add:r,subtract:n,multiply:i,divide:a,mapSlices:o,isNaN:s}=e;const u=Zp({typed:t,add:r,subtract:n,multiply:i,divide:a,mapSlices:o,isNaN:s});return t(Jh,{\"...any\":function(e){e=kh(e);try{return u.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Qh=s(\"print\",[\"typed\",\"matrix\",\"zeros\",\"add\"],e=>{let{typed:t,matrix:r,zeros:n,add:i}=e;const a=su({typed:t,matrix:r,zeros:n,add:i});return t(\"print\",{\"string, Object | Array\":function(e,t){return a(o(e),t)},\"string, Object | Array, number | Object\":function(e,t,r){return a(o(e),t,r)}});function o(e){return e.replace(ou,e=>\"$\"+e.slice(1).split(\".\").map(function(e){return!isNaN(e)&&0{var{typed:e,matrix:t,equalScalar:r,zeros:n,not:i,concat:a}=e;const o=Lu({typed:e,matrix:t,equalScalar:r,zeros:n,not:i,concat:a});function s(e,t,r){var n=e[0].compile().evaluate(r);if(!$(n)&&!o(n,!0))return!1;e=e[1].compile().evaluate(r);return o(n,e)}return s.rawArgs=!0,s},{isTransformFunction:!0}),ed=s(\"or\",[\"typed\",\"matrix\",\"equalScalar\",\"DenseMatrix\",\"concat\"],e=>{var{typed:e,matrix:t,equalScalar:r,DenseMatrix:n,concat:i}=e;const a=Xo({typed:e,matrix:t,equalScalar:r,DenseMatrix:n,concat:i});function o(e,t,r){var n=e[0].compile().evaluate(r);if(!$(n)&&a(n,!1))return!0;e=e[1].compile().evaluate(r);return a(n,e)}return o.rawArgs=!0,o},{isTransformFunction:!0}),td=s(\"nullish\",[\"typed\",\"matrix\",\"size\",\"flatten\",\"deepEqual\"],e=>{var{typed:e,matrix:t,size:r,flatten:n,deepEqual:i}=e;const a=Jo({typed:e,matrix:t,size:r,flatten:n,deepEqual:i});function o(e,t,r){var n=e[0].compile().evaluate(r);if(!$(n)&&null!=n&&void 0!==n)return n;e=e[1].compile().evaluate(r);return a(n,e)}return o.rawArgs=!0,o},{isTransformFunction:!0}),rd=s(\"bitAnd\",[\"typed\",\"matrix\",\"zeros\",\"add\",\"equalScalar\",\"not\",\"concat\"],e=>{var{typed:e,matrix:t,equalScalar:r,zeros:n,not:i,concat:a}=e;const o=zo({typed:e,matrix:t,equalScalar:r,zeros:n,not:i,concat:a});function s(e,t,r){var n=e[0].compile().evaluate(r);if(!$(n)){if(isNaN(n))return NaN;if(0===n||!1===n)return 0}e=e[1].compile().evaluate(r);return o(n,e)}return s.rawArgs=!0,s},{isTransformFunction:!0}),nd=s(\"bitOr\",[\"typed\",\"matrix\",\"equalScalar\",\"DenseMatrix\",\"concat\"],e=>{var{typed:e,matrix:t,equalScalar:r,DenseMatrix:n,concat:i}=e;const a=Io({typed:e,matrix:t,equalScalar:r,DenseMatrix:n,concat:i});function o(e,t,r){var n=e[0].compile().evaluate(r);if(!$(n)){if(isNaN(n))return NaN;if(-1===n)return-1;if(!0===n)return 1}e=e[1].compile().evaluate(r);return a(n,e)}return o.rawArgs=!0,o},{isTransformFunction:!0});var id=fd(504);const ad={relTol:1e-12,absTol:1e-15,matrix:\"Matrix\",number:\"number\",numberFallback:\"number\",precision:64,predictable:!1,randomSeed:null},od=[\"Matrix\",\"Array\"],sd=[\"number\",\"BigNumber\",\"bigint\",\"Fraction\"];function ud(n,i){function a(e){if(e){if(void 0!==e.epsilon){console.warn('Warning: The configuration option \"epsilon\" is deprecated. Use \"relTol\" and \"absTol\" instead.');const n=ee(e);return n.relTol=e.epsilon,n.absTol=.001*e.epsilon,delete n.epsilon,a(n)}var t=ee(n),r=(ld(e,\"matrix\",od),ld(e,\"number\",sd),function e(t,r){if(Array.isArray(r))throw new TypeError(\"Arrays are not supported by deepExtend\");for(const n in r)if(ue(r,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(r[n]&&r[n].constructor===Object)void 0===t[n]&&(t[n]={}),t[n]&&t[n].constructor===Object?e(t[n],r[n]):t[n]=r[n];else{if(Array.isArray(r[n]))throw new TypeError(\"Arrays are not supported by deepExtend\");t[n]=r[n]}}(n,e),ee(n)),e=ee(e);return i(\"config\",r,t,e),r}return ee(n)}return a.MATRIX_OPTIONS=od,a.NUMBER_OPTIONS=sd,Object.keys(ad).forEach(e=>{Object.defineProperty(a,e,{get:()=>n[e],enumerable:!0,configurable:!0})}),a}function ld(e,t,r){void 0===e[t]||r.includes(e[t])||console.warn('Warning: Unknown value \"'+e[t]+'\" for configuration option \"'+t+'\". Available options: '+r.map(e=>JSON.stringify(e)).join(\", \")+\".\")}const cd=function e(t,r){r=gn({},ad,r);if(\"function\"!=typeof Object.create)throw new Error(\"ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.\");const n=function(e){const t=new id;return e.on=t.on.bind(t),e.off=t.off.bind(t),e.once=t.once.bind(t),e.emit=t.emit.bind(t),e}({isNumber:A,isComplex:te,isBigNumber:Q,isBigInt:R,isFraction:re,isUnit:L,isString:j,isArray:b,isMatrix:_,isCollection:$,isDenseMatrix:H,isSparseMatrix:G,isRange:V,isIndex:Z,isBoolean:W,isResultSet:Y,isHelp:J,isFunction:X,isDate:ne,isRegExp:ie,isObject:ce,isMap:fe,isPartitionedMap:pe,isObjectWrappingMap:me,isNull:he,isUndefined:de,isAccessorNode:ge,isArrayNode:ye,isAssignmentNode:xe,isBlockNode:be,isConditionalNode:ve,isConstantNode:ae,isFunctionAssignmentNode:Ne,isFunctionNode:Ae,isIndexNode:Ee,isNode:O,isObjectNode:Se,isOperatorNode:oe,isParenthesisNode:Me,isRangeNode:Ce,isRelationalNode:Te,isSymbolNode:se,isChain:Be}),i=(n.config=ud(r,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}},{});function a(){for(var e=arguments.length,t=new Array(e),r=0;r{if(e.includes(\".\"))throw new Error(\"Factory dependency should not contain a nested path. Name: \"+JSON.stringify(e));\"math\"===e?t.math=p:\"mathWithTransform\"===e?t.mathWithTransform=p.expression.mathWithTransform:\"classes\"===e?t.classes=p:t[e]=p[e]});var e=r(t);if(e&&\"function\"==typeof e.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = \"expression.transform\"');if(void 0===s||n.override)return e;if(f.isTypedFunction(s)&&f.isTypedFunction(e))return f(s,e);if(n.silent)return s;throw new Error('Cannot import \"'+i+'\": already exists')}const a=d(r)?p.expression.transform:p,o=i in p.expression.transform,s=ue(a,i)?a[i]:void 0,u=null!=(e=null==(e=r.meta)?void 0:e.formerly)?e:\"\",l=d(r)||!((e=r).fn.includes(\".\")||ue(g,e.fn)||e.meta&&e.meta.isClass),c=p.expression.mathWithTransform;r.meta&&!1===r.meta.lazy?(a[i]=t(),u&&(a[u]=a[i])):(_e(a,i,t),u&&_e(a,u,t)),s&&o?(h(i),u&&h(u)):l&&(_e(c,i,()=>a[i]),u&&_e(c,u,()=>a[i])),m[i]=r,p.emit(\"import\",i,t)}function r(e){return!ue(g,e)}function d(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}const g={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(e,i){const t=arguments.length;if(1!==t&&2!==t)throw new Za(\"import\",t,1,2);i=i||{};var r,n={};!function t(r,e,n){if(Array.isArray(e))e.forEach(e=>t(r,e));else if(ce(e)||\"object\"==typeof e&&\"Module\"===e[Symbol.toStringTag])for(const i in e)ue(e,i)&&t(r,e[i],i);else if(ze(e)||void 0!==n){const t=ze(e)?d(e)?e.fn+\".transform\":e.fn:n;if(ue(r,t)&&r[t]!==e&&!i.silent)throw new Error('Cannot import \"'+t+'\" twice');r[t]=e}else if(!i.silent)throw new TypeError(\"Factory, Object, or Array expected\")}(n,e);for(const e in n)if(ue(n,e)){const t=n[e];if(ze(t))o(t,i);else if(\"function\"==typeof(r=t)||\"number\"==typeof r||\"string\"==typeof r||\"boolean\"==typeof r||null===r||L(r)||te(r)||Q(r)||re(r)||_(r)||Array.isArray(r))a(e,t,i);else if(!i.silent)throw new TypeError(\"Factory, Object, or Array expected\")}}}(a,n,i);return n.import=o,n.on(\"config\",()=>{Object.values(i).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&o(e,{override:!0})})}),n.create=e.bind(null,t),n.factory=s,n.import(Object.values(Oe(t))),n.ArgumentsError=Za,n.DimensionError=z,n.IndexError=En,n}(t)})(),pd.default});", "/*! markdown-it 14.1.1 https://github.com/markdown-it/markdown-it @license MIT */\n(function(global, factory) {\n typeof exports === \"object\" && typeof module !== \"undefined\" ? module.exports = factory() : typeof define === \"function\" && define.amd ? define(factory) : (global = typeof globalThis !== \"undefined\" ? globalThis : global || self,\n global.markdownit = factory());\n})(this, function() {\n \"use strict\";\n /* eslint-disable no-bitwise */ const decodeCache = {};\n function getDecodeCache(exclude) {\n let cache = decodeCache[exclude];\n if (cache) {\n return cache;\n }\n cache = decodeCache[exclude] = [];\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i);\n cache.push(ch);\n }\n for (let i = 0; i < exclude.length; i++) {\n const ch = exclude.charCodeAt(i);\n cache[ch] = \"%\" + (\"0\" + ch.toString(16).toUpperCase()).slice(-2);\n }\n return cache;\n }\n // Decode percent-encoded string.\n\n function decode$1(string, exclude) {\n if (typeof exclude !== \"string\") {\n exclude = decode$1.defaultChars;\n }\n const cache = getDecodeCache(exclude);\n return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {\n let result = \"\";\n for (let i = 0, l = seq.length; i < l; i += 3) {\n const b1 = parseInt(seq.slice(i + 1, i + 3), 16);\n if (b1 < 128) {\n result += cache[b1];\n continue;\n }\n if ((b1 & 224) === 192 && i + 3 < l) {\n // 110xxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16);\n if ((b2 & 192) === 128) {\n const chr = b1 << 6 & 1984 | b2 & 63;\n if (chr < 128) {\n result += \"\\ufffd\\ufffd\";\n } else {\n result += String.fromCharCode(chr);\n }\n i += 3;\n continue;\n }\n }\n if ((b1 & 240) === 224 && i + 6 < l) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16);\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16);\n if ((b2 & 192) === 128 && (b3 & 192) === 128) {\n const chr = b1 << 12 & 61440 | b2 << 6 & 4032 | b3 & 63;\n if (chr < 2048 || chr >= 55296 && chr <= 57343) {\n result += \"\\ufffd\\ufffd\\ufffd\";\n } else {\n result += String.fromCharCode(chr);\n }\n i += 6;\n continue;\n }\n }\n if ((b1 & 248) === 240 && i + 9 < l) {\n // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16);\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16);\n const b4 = parseInt(seq.slice(i + 10, i + 12), 16);\n if ((b2 & 192) === 128 && (b3 & 192) === 128 && (b4 & 192) === 128) {\n let chr = b1 << 18 & 1835008 | b2 << 12 & 258048 | b3 << 6 & 4032 | b4 & 63;\n if (chr < 65536 || chr > 1114111) {\n result += \"\\ufffd\\ufffd\\ufffd\\ufffd\";\n } else {\n chr -= 65536;\n result += String.fromCharCode(55296 + (chr >> 10), 56320 + (chr & 1023));\n }\n i += 9;\n continue;\n }\n }\n result += \"\\ufffd\";\n }\n return result;\n });\n }\n decode$1.defaultChars = \";/?:@&=+$,#\";\n decode$1.componentChars = \"\";\n const encodeCache = {};\n // Create a lookup array where anything but characters in `chars` string\n // and alphanumeric chars is percent-encoded.\n\n function getEncodeCache(exclude) {\n let cache = encodeCache[exclude];\n if (cache) {\n return cache;\n }\n cache = encodeCache[exclude] = [];\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i);\n if (/^[0-9a-z]$/i.test(ch)) {\n // always allow unencoded alphanumeric characters\n cache.push(ch);\n } else {\n cache.push(\"%\" + (\"0\" + i.toString(16).toUpperCase()).slice(-2));\n }\n }\n for (let i = 0; i < exclude.length; i++) {\n cache[exclude.charCodeAt(i)] = exclude[i];\n }\n return cache;\n }\n // Encode unsafe characters with percent-encoding, skipping already\n // encoded sequences.\n\n // - string - string to encode\n // - exclude - list of characters to ignore (in addition to a-zA-Z0-9)\n // - keepEscaped - don't encode '%' in a correct escape sequence (default: true)\n\n function encode$1(string, exclude, keepEscaped) {\n if (typeof exclude !== \"string\") {\n // encode(string, keepEscaped)\n keepEscaped = exclude;\n exclude = encode$1.defaultChars;\n }\n if (typeof keepEscaped === \"undefined\") {\n keepEscaped = true;\n }\n const cache = getEncodeCache(exclude);\n let result = \"\";\n for (let i = 0, l = string.length; i < l; i++) {\n const code = string.charCodeAt(i);\n if (keepEscaped && code === 37 /* % */ && i + 2 < l) {\n if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {\n result += string.slice(i, i + 3);\n i += 2;\n continue;\n }\n }\n if (code < 128) {\n result += cache[code];\n continue;\n }\n if (code >= 55296 && code <= 57343) {\n if (code >= 55296 && code <= 56319 && i + 1 < l) {\n const nextCode = string.charCodeAt(i + 1);\n if (nextCode >= 56320 && nextCode <= 57343) {\n result += encodeURIComponent(string[i] + string[i + 1]);\n i++;\n continue;\n }\n }\n result += \"%EF%BF%BD\";\n continue;\n }\n result += encodeURIComponent(string[i]);\n }\n return result;\n }\n encode$1.defaultChars = \";/?:@&=+$,-_.!~*'()#\";\n encode$1.componentChars = \"-_.!~*'()\";\n function format(url) {\n let result = \"\";\n result += url.protocol || \"\";\n result += url.slashes ? \"//\" : \"\";\n result += url.auth ? url.auth + \"@\" : \"\";\n if (url.hostname && url.hostname.indexOf(\":\") !== -1) {\n // ipv6 address\n result += \"[\" + url.hostname + \"]\";\n } else {\n result += url.hostname || \"\";\n }\n result += url.port ? \":\" + url.port : \"\";\n result += url.pathname || \"\";\n result += url.search || \"\";\n result += url.hash || \"\";\n return result;\n }\n // Copyright Joyent, Inc. and other Node contributors.\n\n // Permission is hereby granted, free of charge, to any person obtaining a\n // copy of this software and associated documentation files (the\n // \"Software\"), to deal in the Software without restriction, including\n // without limitation the rights to use, copy, modify, merge, publish,\n // distribute, sublicense, and/or sell copies of the Software, and to permit\n // persons to whom the Software is furnished to do so, subject to the\n // following conditions:\n\n // The above copyright notice and this permission notice shall be included\n // in all copies or substantial portions of the Software.\n\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n // Changes from joyent/node:\n\n // 1. No leading slash in paths,\n // e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`\n\n // 2. Backslashes are not replaced with slashes,\n // so `http:\\\\example.org\\` is treated like a relative path\n\n // 3. Trailing colon is treated like a part of the path,\n // i.e. in `http://example.org:foo` pathname is `:foo`\n\n // 4. Nothing is URL-encoded in the resulting object,\n // (in joyent/node some chars in auth and paths are encoded)\n\n // 5. `url.parse()` does not have `parseQueryString` argument\n\n // 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,\n // which can be constructed using other parts of the url.\n\n function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n }\n // Reference: RFC 3986, RFC 1808, RFC 2396\n // define these here so at least they only have to be\n // compiled once on the first module load.\n const protocolPattern = /^([a-z0-9.+-]+:)/i;\n const portPattern = /:[0-9]*$/;\n // Special case for a simple path URL\n /* eslint-disable-next-line no-useless-escape */ const simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/;\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n const delims = [ \"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\" ];\n // RFC 2396: characters not allowed for various reasons.\n const unwise = [ \"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\" ].concat(delims);\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n const autoEscape = [ \"'\" ].concat(unwise);\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n const nonHostChars = [ \"%\", \"/\", \"?\", \";\", \"#\" ].concat(autoEscape);\n const hostEndingChars = [ \"/\", \"?\", \"#\" ];\n const hostnameMaxLen = 255;\n const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/;\n const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/;\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n // protocols that never have a hostname.\n const hostlessProtocol = {\n javascript: true,\n \"javascript:\": true\n };\n // protocols that always contain a // bit.\n const slashedProtocol = {\n http: true,\n https: true,\n ftp: true,\n gopher: true,\n file: true,\n \"http:\": true,\n \"https:\": true,\n \"ftp:\": true,\n \"gopher:\": true,\n \"file:\": true\n };\n function urlParse(url, slashesDenoteHost) {\n if (url && url instanceof Url) return url;\n const u = new Url;\n u.parse(url, slashesDenoteHost);\n return u;\n }\n Url.prototype.parse = function(url, slashesDenoteHost) {\n let lowerProto, hec, slashes;\n let rest = url;\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n if (!slashesDenoteHost && url.split(\"#\").length === 1) {\n // Try fast path regexp\n const simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n }\n return this;\n }\n }\n let proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n lowerProto = proto.toLowerCase();\n this.protocol = proto;\n rest = rest.substr(proto.length);\n }\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n /* eslint-disable-next-line no-useless-escape */ if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n // find the first instance of any hostEndingChars\n let hostEnd = -1;\n for (let i = 0; i < hostEndingChars.length; i++) {\n hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec;\n }\n }\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n let auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf(\"@\");\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n }\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = auth;\n }\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (let i = 0; i < nonHostChars.length; i++) {\n hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec;\n }\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1) {\n hostEnd = rest.length;\n }\n if (rest[hostEnd - 1] === \":\") {\n hostEnd--;\n }\n const host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n // pull out port.\n this.parseHost(host);\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || \"\";\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n const ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n // validate a little.\n if (!ipv6Hostname) {\n const hostparts = this.hostname.split(/\\./);\n for (let i = 0, l = hostparts.length; i < l; i++) {\n const part = hostparts[i];\n if (!part) {\n continue;\n }\n if (!part.match(hostnamePartPattern)) {\n let newpart = \"\";\n for (let j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += \"x\";\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n const validParts = hostparts.slice(0, i);\n const notHost = hostparts.slice(i + 1);\n const bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = notHost.join(\".\") + rest;\n }\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = \"\";\n }\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n }\n }\n // chop off from the tail first.\n const hash = rest.indexOf(\"#\");\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n const qm = rest.indexOf(\"?\");\n if (qm !== -1) {\n this.search = rest.substr(qm);\n rest = rest.slice(0, qm);\n }\n if (rest) {\n this.pathname = rest;\n }\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {\n this.pathname = \"\";\n }\n return this;\n };\n Url.prototype.parseHost = function(host) {\n let port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== \":\") {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) {\n this.hostname = host;\n }\n };\n var mdurl = Object.freeze({\n __proto__: null,\n decode: decode$1,\n encode: encode$1,\n format: format,\n parse: urlParse\n });\n var Any = /[\\0-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\n var Cc = /[\\0-\\x1F\\x7F-\\x9F]/;\n var regex$1 = /[\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u0890\\u0891\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB]|\\uD804[\\uDCBD\\uDCCD]|\\uD80D[\\uDC30-\\uDC3F]|\\uD82F[\\uDCA0-\\uDCA3]|\\uD834[\\uDD73-\\uDD7A]|\\uDB40[\\uDC01\\uDC20-\\uDC7F]/;\n var P = /[!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\\xA1\\xA7\\xAB\\xB6\\xB7\\xBB\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1B7D\\u1B7E\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]|\\uD800[\\uDD00-\\uDD02\\uDF9F\\uDFD0]|\\uD801\\uDD6F|\\uD802[\\uDC57\\uDD1F\\uDD3F\\uDE50-\\uDE58\\uDE7F\\uDEF0-\\uDEF6\\uDF39-\\uDF3F\\uDF99-\\uDF9C]|\\uD803[\\uDEAD\\uDF55-\\uDF59\\uDF86-\\uDF89]|\\uD804[\\uDC47-\\uDC4D\\uDCBB\\uDCBC\\uDCBE-\\uDCC1\\uDD40-\\uDD43\\uDD74\\uDD75\\uDDC5-\\uDDC8\\uDDCD\\uDDDB\\uDDDD-\\uDDDF\\uDE38-\\uDE3D\\uDEA9]|\\uD805[\\uDC4B-\\uDC4F\\uDC5A\\uDC5B\\uDC5D\\uDCC6\\uDDC1-\\uDDD7\\uDE41-\\uDE43\\uDE60-\\uDE6C\\uDEB9\\uDF3C-\\uDF3E]|\\uD806[\\uDC3B\\uDD44-\\uDD46\\uDDE2\\uDE3F-\\uDE46\\uDE9A-\\uDE9C\\uDE9E-\\uDEA2\\uDF00-\\uDF09]|\\uD807[\\uDC41-\\uDC45\\uDC70\\uDC71\\uDEF7\\uDEF8\\uDF43-\\uDF4F\\uDFFF]|\\uD809[\\uDC70-\\uDC74]|\\uD80B[\\uDFF1\\uDFF2]|\\uD81A[\\uDE6E\\uDE6F\\uDEF5\\uDF37-\\uDF3B\\uDF44]|\\uD81B[\\uDE97-\\uDE9A\\uDFE2]|\\uD82F\\uDC9F|\\uD836[\\uDE87-\\uDE8B]|\\uD83A[\\uDD5E\\uDD5F]/;\n var regex = /[\\$\\+<->\\^`\\|~\\xA2-\\xA6\\xA8\\xA9\\xAC\\xAE-\\xB1\\xB4\\xB8\\xD7\\xF7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u07FE\\u07FF\\u0888\\u09F2\\u09F3\\u09FA\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C0\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2426\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2B95\\u2B97-\\u2BFF\\u2CE5-\\u2CEA\\u2E50\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u309B\\u309C\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E3\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A\\uAB6B\\uFB29\\uFBB2-\\uFBC2\\uFD40-\\uFD4F\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC\\uFFFD]|\\uD800[\\uDD37-\\uDD3F\\uDD79-\\uDD89\\uDD8C-\\uDD8E\\uDD90-\\uDD9C\\uDDA0\\uDDD0-\\uDDFC]|\\uD802[\\uDC77\\uDC78\\uDEC8]|\\uD805\\uDF3F|\\uD807[\\uDFD5-\\uDFF1]|\\uD81A[\\uDF3C-\\uDF3F\\uDF45]|\\uD82F\\uDC9C|\\uD833[\\uDF50-\\uDFC3]|\\uD834[\\uDC00-\\uDCF5\\uDD00-\\uDD26\\uDD29-\\uDD64\\uDD6A-\\uDD6C\\uDD83\\uDD84\\uDD8C-\\uDDA9\\uDDAE-\\uDDEA\\uDE00-\\uDE41\\uDE45\\uDF00-\\uDF56]|\\uD835[\\uDEC1\\uDEDB\\uDEFB\\uDF15\\uDF35\\uDF4F\\uDF6F\\uDF89\\uDFA9\\uDFC3]|\\uD836[\\uDC00-\\uDDFF\\uDE37-\\uDE3A\\uDE6D-\\uDE74\\uDE76-\\uDE83\\uDE85\\uDE86]|\\uD838[\\uDD4F\\uDEFF]|\\uD83B[\\uDCAC\\uDCB0\\uDD2E\\uDEF0\\uDEF1]|\\uD83C[\\uDC00-\\uDC2B\\uDC30-\\uDC93\\uDCA0-\\uDCAE\\uDCB1-\\uDCBF\\uDCC1-\\uDCCF\\uDCD1-\\uDCF5\\uDD0D-\\uDDAD\\uDDE6-\\uDE02\\uDE10-\\uDE3B\\uDE40-\\uDE48\\uDE50\\uDE51\\uDE60-\\uDE65\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDED7\\uDEDC-\\uDEEC\\uDEF0-\\uDEFC\\uDF00-\\uDF76\\uDF7B-\\uDFD9\\uDFE0-\\uDFEB\\uDFF0]|\\uD83E[\\uDC00-\\uDC0B\\uDC10-\\uDC47\\uDC50-\\uDC59\\uDC60-\\uDC87\\uDC90-\\uDCAD\\uDCB0\\uDCB1\\uDD00-\\uDE53\\uDE60-\\uDE6D\\uDE70-\\uDE7C\\uDE80-\\uDE88\\uDE90-\\uDEBD\\uDEBF-\\uDEC5\\uDECE-\\uDEDB\\uDEE0-\\uDEE8\\uDEF0-\\uDEF8\\uDF00-\\uDF92\\uDF94-\\uDFCA]/;\n var Z = /[ \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]/;\n var ucmicro = Object.freeze({\n __proto__: null,\n Any: Any,\n Cc: Cc,\n Cf: regex$1,\n P: P,\n S: regex,\n Z: Z\n });\n // Generated using scripts/write-decode-map.ts\n var htmlDecodeTree = new Uint16Array(\n // prettier-ignore\n '\\u1d41<\\xd5\\u0131\\u028a\\u049d\\u057b\\u05d0\\u0675\\u06de\\u07a2\\u07d6\\u080f\\u0a4a\\u0a91\\u0da1\\u0e6d\\u0f09\\u0f26\\u10ca\\u1228\\u12e1\\u1415\\u149d\\u14c3\\u14df\\u1525\\0\\0\\0\\0\\0\\0\\u156b\\u16cd\\u198d\\u1c12\\u1ddd\\u1f7e\\u2060\\u21b0\\u228d\\u23c0\\u23fb\\u2442\\u2824\\u2912\\u2d08\\u2e48\\u2fce\\u3016\\u32ba\\u3639\\u37ac\\u38fe\\u3a28\\u3a71\\u3ae0\\u3b2e\\u0800EMabcfglmnoprstu\\\\bfms\\x7f\\x84\\x8b\\x90\\x95\\x98\\xa6\\xb3\\xb9\\xc8\\xcflig\\u803b\\xc6\\u40c6P\\u803b&\\u4026cute\\u803b\\xc1\\u40c1reve;\\u4102\\u0100iyx}rc\\u803b\\xc2\\u40c2;\\u4410r;\\uc000\\ud835\\udd04rave\\u803b\\xc0\\u40c0pha;\\u4391acr;\\u4100d;\\u6a53\\u0100gp\\x9d\\xa1on;\\u4104f;\\uc000\\ud835\\udd38plyFunction;\\u6061ing\\u803b\\xc5\\u40c5\\u0100cs\\xbe\\xc3r;\\uc000\\ud835\\udc9cign;\\u6254ilde\\u803b\\xc3\\u40c3ml\\u803b\\xc4\\u40c4\\u0400aceforsu\\xe5\\xfb\\xfe\\u0117\\u011c\\u0122\\u0127\\u012a\\u0100cr\\xea\\xf2kslash;\\u6216\\u0176\\xf6\\xf8;\\u6ae7ed;\\u6306y;\\u4411\\u0180crt\\u0105\\u010b\\u0114ause;\\u6235noullis;\\u612ca;\\u4392r;\\uc000\\ud835\\udd05pf;\\uc000\\ud835\\udd39eve;\\u42d8c\\xf2\\u0113mpeq;\\u624e\\u0700HOacdefhilorsu\\u014d\\u0151\\u0156\\u0180\\u019e\\u01a2\\u01b5\\u01b7\\u01ba\\u01dc\\u0215\\u0273\\u0278\\u027ecy;\\u4427PY\\u803b\\xa9\\u40a9\\u0180cpy\\u015d\\u0162\\u017aute;\\u4106\\u0100;i\\u0167\\u0168\\u62d2talDifferentialD;\\u6145leys;\\u612d\\u0200aeio\\u0189\\u018e\\u0194\\u0198ron;\\u410cdil\\u803b\\xc7\\u40c7rc;\\u4108nint;\\u6230ot;\\u410a\\u0100dn\\u01a7\\u01adilla;\\u40b8terDot;\\u40b7\\xf2\\u017fi;\\u43a7rcle\\u0200DMPT\\u01c7\\u01cb\\u01d1\\u01d6ot;\\u6299inus;\\u6296lus;\\u6295imes;\\u6297o\\u0100cs\\u01e2\\u01f8kwiseContourIntegral;\\u6232eCurly\\u0100DQ\\u0203\\u020foubleQuote;\\u601duote;\\u6019\\u0200lnpu\\u021e\\u0228\\u0247\\u0255on\\u0100;e\\u0225\\u0226\\u6237;\\u6a74\\u0180git\\u022f\\u0236\\u023aruent;\\u6261nt;\\u622fourIntegral;\\u622e\\u0100fr\\u024c\\u024e;\\u6102oduct;\\u6210nterClockwiseContourIntegral;\\u6233oss;\\u6a2fcr;\\uc000\\ud835\\udc9ep\\u0100;C\\u0284\\u0285\\u62d3ap;\\u624d\\u0580DJSZacefios\\u02a0\\u02ac\\u02b0\\u02b4\\u02b8\\u02cb\\u02d7\\u02e1\\u02e6\\u0333\\u048d\\u0100;o\\u0179\\u02a5trahd;\\u6911cy;\\u4402cy;\\u4405cy;\\u440f\\u0180grs\\u02bf\\u02c4\\u02c7ger;\\u6021r;\\u61a1hv;\\u6ae4\\u0100ay\\u02d0\\u02d5ron;\\u410e;\\u4414l\\u0100;t\\u02dd\\u02de\\u6207a;\\u4394r;\\uc000\\ud835\\udd07\\u0100af\\u02eb\\u0327\\u0100cm\\u02f0\\u0322ritical\\u0200ADGT\\u0300\\u0306\\u0316\\u031ccute;\\u40b4o\\u0174\\u030b\\u030d;\\u42d9bleAcute;\\u42ddrave;\\u4060ilde;\\u42dcond;\\u62c4ferentialD;\\u6146\\u0470\\u033d\\0\\0\\0\\u0342\\u0354\\0\\u0405f;\\uc000\\ud835\\udd3b\\u0180;DE\\u0348\\u0349\\u034d\\u40a8ot;\\u60dcqual;\\u6250ble\\u0300CDLRUV\\u0363\\u0372\\u0382\\u03cf\\u03e2\\u03f8ontourIntegra\\xec\\u0239o\\u0274\\u0379\\0\\0\\u037b\\xbb\\u0349nArrow;\\u61d3\\u0100eo\\u0387\\u03a4ft\\u0180ART\\u0390\\u0396\\u03a1rrow;\\u61d0ightArrow;\\u61d4e\\xe5\\u02cang\\u0100LR\\u03ab\\u03c4eft\\u0100AR\\u03b3\\u03b9rrow;\\u67f8ightArrow;\\u67faightArrow;\\u67f9ight\\u0100AT\\u03d8\\u03derrow;\\u61d2ee;\\u62a8p\\u0241\\u03e9\\0\\0\\u03efrrow;\\u61d1ownArrow;\\u61d5erticalBar;\\u6225n\\u0300ABLRTa\\u0412\\u042a\\u0430\\u045e\\u047f\\u037crrow\\u0180;BU\\u041d\\u041e\\u0422\\u6193ar;\\u6913pArrow;\\u61f5reve;\\u4311eft\\u02d2\\u043a\\0\\u0446\\0\\u0450ightVector;\\u6950eeVector;\\u695eector\\u0100;B\\u0459\\u045a\\u61bdar;\\u6956ight\\u01d4\\u0467\\0\\u0471eeVector;\\u695fector\\u0100;B\\u047a\\u047b\\u61c1ar;\\u6957ee\\u0100;A\\u0486\\u0487\\u62a4rrow;\\u61a7\\u0100ct\\u0492\\u0497r;\\uc000\\ud835\\udc9frok;\\u4110\\u0800NTacdfglmopqstux\\u04bd\\u04c0\\u04c4\\u04cb\\u04de\\u04e2\\u04e7\\u04ee\\u04f5\\u0521\\u052f\\u0536\\u0552\\u055d\\u0560\\u0565G;\\u414aH\\u803b\\xd0\\u40d0cute\\u803b\\xc9\\u40c9\\u0180aiy\\u04d2\\u04d7\\u04dcron;\\u411arc\\u803b\\xca\\u40ca;\\u442dot;\\u4116r;\\uc000\\ud835\\udd08rave\\u803b\\xc8\\u40c8ement;\\u6208\\u0100ap\\u04fa\\u04fecr;\\u4112ty\\u0253\\u0506\\0\\0\\u0512mallSquare;\\u65fberySmallSquare;\\u65ab\\u0100gp\\u0526\\u052aon;\\u4118f;\\uc000\\ud835\\udd3csilon;\\u4395u\\u0100ai\\u053c\\u0549l\\u0100;T\\u0542\\u0543\\u6a75ilde;\\u6242librium;\\u61cc\\u0100ci\\u0557\\u055ar;\\u6130m;\\u6a73a;\\u4397ml\\u803b\\xcb\\u40cb\\u0100ip\\u056a\\u056fsts;\\u6203onentialE;\\u6147\\u0280cfios\\u0585\\u0588\\u058d\\u05b2\\u05ccy;\\u4424r;\\uc000\\ud835\\udd09lled\\u0253\\u0597\\0\\0\\u05a3mallSquare;\\u65fcerySmallSquare;\\u65aa\\u0370\\u05ba\\0\\u05bf\\0\\0\\u05c4f;\\uc000\\ud835\\udd3dAll;\\u6200riertrf;\\u6131c\\xf2\\u05cb\\u0600JTabcdfgorst\\u05e8\\u05ec\\u05ef\\u05fa\\u0600\\u0612\\u0616\\u061b\\u061d\\u0623\\u066c\\u0672cy;\\u4403\\u803b>\\u403emma\\u0100;d\\u05f7\\u05f8\\u4393;\\u43dcreve;\\u411e\\u0180eiy\\u0607\\u060c\\u0610dil;\\u4122rc;\\u411c;\\u4413ot;\\u4120r;\\uc000\\ud835\\udd0a;\\u62d9pf;\\uc000\\ud835\\udd3eeater\\u0300EFGLST\\u0635\\u0644\\u064e\\u0656\\u065b\\u0666qual\\u0100;L\\u063e\\u063f\\u6265ess;\\u62dbullEqual;\\u6267reater;\\u6aa2ess;\\u6277lantEqual;\\u6a7eilde;\\u6273cr;\\uc000\\ud835\\udca2;\\u626b\\u0400Aacfiosu\\u0685\\u068b\\u0696\\u069b\\u069e\\u06aa\\u06be\\u06caRDcy;\\u442a\\u0100ct\\u0690\\u0694ek;\\u42c7;\\u405eirc;\\u4124r;\\u610clbertSpace;\\u610b\\u01f0\\u06af\\0\\u06b2f;\\u610dizontalLine;\\u6500\\u0100ct\\u06c3\\u06c5\\xf2\\u06a9rok;\\u4126mp\\u0144\\u06d0\\u06d8ownHum\\xf0\\u012fqual;\\u624f\\u0700EJOacdfgmnostu\\u06fa\\u06fe\\u0703\\u0707\\u070e\\u071a\\u071e\\u0721\\u0728\\u0744\\u0778\\u078b\\u078f\\u0795cy;\\u4415lig;\\u4132cy;\\u4401cute\\u803b\\xcd\\u40cd\\u0100iy\\u0713\\u0718rc\\u803b\\xce\\u40ce;\\u4418ot;\\u4130r;\\u6111rave\\u803b\\xcc\\u40cc\\u0180;ap\\u0720\\u072f\\u073f\\u0100cg\\u0734\\u0737r;\\u412ainaryI;\\u6148lie\\xf3\\u03dd\\u01f4\\u0749\\0\\u0762\\u0100;e\\u074d\\u074e\\u622c\\u0100gr\\u0753\\u0758ral;\\u622bsection;\\u62c2isible\\u0100CT\\u076c\\u0772omma;\\u6063imes;\\u6062\\u0180gpt\\u077f\\u0783\\u0788on;\\u412ef;\\uc000\\ud835\\udd40a;\\u4399cr;\\u6110ilde;\\u4128\\u01eb\\u079a\\0\\u079ecy;\\u4406l\\u803b\\xcf\\u40cf\\u0280cfosu\\u07ac\\u07b7\\u07bc\\u07c2\\u07d0\\u0100iy\\u07b1\\u07b5rc;\\u4134;\\u4419r;\\uc000\\ud835\\udd0dpf;\\uc000\\ud835\\udd41\\u01e3\\u07c7\\0\\u07ccr;\\uc000\\ud835\\udca5rcy;\\u4408kcy;\\u4404\\u0380HJacfos\\u07e4\\u07e8\\u07ec\\u07f1\\u07fd\\u0802\\u0808cy;\\u4425cy;\\u440cppa;\\u439a\\u0100ey\\u07f6\\u07fbdil;\\u4136;\\u441ar;\\uc000\\ud835\\udd0epf;\\uc000\\ud835\\udd42cr;\\uc000\\ud835\\udca6\\u0580JTaceflmost\\u0825\\u0829\\u082c\\u0850\\u0863\\u09b3\\u09b8\\u09c7\\u09cd\\u0a37\\u0a47cy;\\u4409\\u803b<\\u403c\\u0280cmnpr\\u0837\\u083c\\u0841\\u0844\\u084dute;\\u4139bda;\\u439bg;\\u67ealacetrf;\\u6112r;\\u619e\\u0180aey\\u0857\\u085c\\u0861ron;\\u413ddil;\\u413b;\\u441b\\u0100fs\\u0868\\u0970t\\u0500ACDFRTUVar\\u087e\\u08a9\\u08b1\\u08e0\\u08e6\\u08fc\\u092f\\u095b\\u0390\\u096a\\u0100nr\\u0883\\u088fgleBracket;\\u67e8row\\u0180;BR\\u0899\\u089a\\u089e\\u6190ar;\\u61e4ightArrow;\\u61c6eiling;\\u6308o\\u01f5\\u08b7\\0\\u08c3bleBracket;\\u67e6n\\u01d4\\u08c8\\0\\u08d2eeVector;\\u6961ector\\u0100;B\\u08db\\u08dc\\u61c3ar;\\u6959loor;\\u630aight\\u0100AV\\u08ef\\u08f5rrow;\\u6194ector;\\u694e\\u0100er\\u0901\\u0917e\\u0180;AV\\u0909\\u090a\\u0910\\u62a3rrow;\\u61a4ector;\\u695aiangle\\u0180;BE\\u0924\\u0925\\u0929\\u62b2ar;\\u69cfqual;\\u62b4p\\u0180DTV\\u0937\\u0942\\u094cownVector;\\u6951eeVector;\\u6960ector\\u0100;B\\u0956\\u0957\\u61bfar;\\u6958ector\\u0100;B\\u0965\\u0966\\u61bcar;\\u6952ight\\xe1\\u039cs\\u0300EFGLST\\u097e\\u098b\\u0995\\u099d\\u09a2\\u09adqualGreater;\\u62daullEqual;\\u6266reater;\\u6276ess;\\u6aa1lantEqual;\\u6a7dilde;\\u6272r;\\uc000\\ud835\\udd0f\\u0100;e\\u09bd\\u09be\\u62d8ftarrow;\\u61daidot;\\u413f\\u0180npw\\u09d4\\u0a16\\u0a1bg\\u0200LRlr\\u09de\\u09f7\\u0a02\\u0a10eft\\u0100AR\\u09e6\\u09ecrrow;\\u67f5ightArrow;\\u67f7ightArrow;\\u67f6eft\\u0100ar\\u03b3\\u0a0aight\\xe1\\u03bfight\\xe1\\u03caf;\\uc000\\ud835\\udd43er\\u0100LR\\u0a22\\u0a2ceftArrow;\\u6199ightArrow;\\u6198\\u0180cht\\u0a3e\\u0a40\\u0a42\\xf2\\u084c;\\u61b0rok;\\u4141;\\u626a\\u0400acefiosu\\u0a5a\\u0a5d\\u0a60\\u0a77\\u0a7c\\u0a85\\u0a8b\\u0a8ep;\\u6905y;\\u441c\\u0100dl\\u0a65\\u0a6fiumSpace;\\u605flintrf;\\u6133r;\\uc000\\ud835\\udd10nusPlus;\\u6213pf;\\uc000\\ud835\\udd44c\\xf2\\u0a76;\\u439c\\u0480Jacefostu\\u0aa3\\u0aa7\\u0aad\\u0ac0\\u0b14\\u0b19\\u0d91\\u0d97\\u0d9ecy;\\u440acute;\\u4143\\u0180aey\\u0ab4\\u0ab9\\u0aberon;\\u4147dil;\\u4145;\\u441d\\u0180gsw\\u0ac7\\u0af0\\u0b0eative\\u0180MTV\\u0ad3\\u0adf\\u0ae8ediumSpace;\\u600bhi\\u0100cn\\u0ae6\\u0ad8\\xeb\\u0ad9eryThi\\xee\\u0ad9ted\\u0100GL\\u0af8\\u0b06reaterGreate\\xf2\\u0673essLes\\xf3\\u0a48Line;\\u400ar;\\uc000\\ud835\\udd11\\u0200Bnpt\\u0b22\\u0b28\\u0b37\\u0b3areak;\\u6060BreakingSpace;\\u40a0f;\\u6115\\u0680;CDEGHLNPRSTV\\u0b55\\u0b56\\u0b6a\\u0b7c\\u0ba1\\u0beb\\u0c04\\u0c5e\\u0c84\\u0ca6\\u0cd8\\u0d61\\u0d85\\u6aec\\u0100ou\\u0b5b\\u0b64ngruent;\\u6262pCap;\\u626doubleVerticalBar;\\u6226\\u0180lqx\\u0b83\\u0b8a\\u0b9bement;\\u6209ual\\u0100;T\\u0b92\\u0b93\\u6260ilde;\\uc000\\u2242\\u0338ists;\\u6204reater\\u0380;EFGLST\\u0bb6\\u0bb7\\u0bbd\\u0bc9\\u0bd3\\u0bd8\\u0be5\\u626fqual;\\u6271ullEqual;\\uc000\\u2267\\u0338reater;\\uc000\\u226b\\u0338ess;\\u6279lantEqual;\\uc000\\u2a7e\\u0338ilde;\\u6275ump\\u0144\\u0bf2\\u0bfdownHump;\\uc000\\u224e\\u0338qual;\\uc000\\u224f\\u0338e\\u0100fs\\u0c0a\\u0c27tTriangle\\u0180;BE\\u0c1a\\u0c1b\\u0c21\\u62eaar;\\uc000\\u29cf\\u0338qual;\\u62ecs\\u0300;EGLST\\u0c35\\u0c36\\u0c3c\\u0c44\\u0c4b\\u0c58\\u626equal;\\u6270reater;\\u6278ess;\\uc000\\u226a\\u0338lantEqual;\\uc000\\u2a7d\\u0338ilde;\\u6274ested\\u0100GL\\u0c68\\u0c79reaterGreater;\\uc000\\u2aa2\\u0338essLess;\\uc000\\u2aa1\\u0338recedes\\u0180;ES\\u0c92\\u0c93\\u0c9b\\u6280qual;\\uc000\\u2aaf\\u0338lantEqual;\\u62e0\\u0100ei\\u0cab\\u0cb9verseElement;\\u620cghtTriangle\\u0180;BE\\u0ccb\\u0ccc\\u0cd2\\u62ebar;\\uc000\\u29d0\\u0338qual;\\u62ed\\u0100qu\\u0cdd\\u0d0cuareSu\\u0100bp\\u0ce8\\u0cf9set\\u0100;E\\u0cf0\\u0cf3\\uc000\\u228f\\u0338qual;\\u62e2erset\\u0100;E\\u0d03\\u0d06\\uc000\\u2290\\u0338qual;\\u62e3\\u0180bcp\\u0d13\\u0d24\\u0d4eset\\u0100;E\\u0d1b\\u0d1e\\uc000\\u2282\\u20d2qual;\\u6288ceeds\\u0200;EST\\u0d32\\u0d33\\u0d3b\\u0d46\\u6281qual;\\uc000\\u2ab0\\u0338lantEqual;\\u62e1ilde;\\uc000\\u227f\\u0338erset\\u0100;E\\u0d58\\u0d5b\\uc000\\u2283\\u20d2qual;\\u6289ilde\\u0200;EFT\\u0d6e\\u0d6f\\u0d75\\u0d7f\\u6241qual;\\u6244ullEqual;\\u6247ilde;\\u6249erticalBar;\\u6224cr;\\uc000\\ud835\\udca9ilde\\u803b\\xd1\\u40d1;\\u439d\\u0700Eacdfgmoprstuv\\u0dbd\\u0dc2\\u0dc9\\u0dd5\\u0ddb\\u0de0\\u0de7\\u0dfc\\u0e02\\u0e20\\u0e22\\u0e32\\u0e3f\\u0e44lig;\\u4152cute\\u803b\\xd3\\u40d3\\u0100iy\\u0dce\\u0dd3rc\\u803b\\xd4\\u40d4;\\u441eblac;\\u4150r;\\uc000\\ud835\\udd12rave\\u803b\\xd2\\u40d2\\u0180aei\\u0dee\\u0df2\\u0df6cr;\\u414cga;\\u43a9cron;\\u439fpf;\\uc000\\ud835\\udd46enCurly\\u0100DQ\\u0e0e\\u0e1aoubleQuote;\\u601cuote;\\u6018;\\u6a54\\u0100cl\\u0e27\\u0e2cr;\\uc000\\ud835\\udcaaash\\u803b\\xd8\\u40d8i\\u016c\\u0e37\\u0e3cde\\u803b\\xd5\\u40d5es;\\u6a37ml\\u803b\\xd6\\u40d6er\\u0100BP\\u0e4b\\u0e60\\u0100ar\\u0e50\\u0e53r;\\u603eac\\u0100ek\\u0e5a\\u0e5c;\\u63deet;\\u63b4arenthesis;\\u63dc\\u0480acfhilors\\u0e7f\\u0e87\\u0e8a\\u0e8f\\u0e92\\u0e94\\u0e9d\\u0eb0\\u0efcrtialD;\\u6202y;\\u441fr;\\uc000\\ud835\\udd13i;\\u43a6;\\u43a0usMinus;\\u40b1\\u0100ip\\u0ea2\\u0eadncareplan\\xe5\\u069df;\\u6119\\u0200;eio\\u0eb9\\u0eba\\u0ee0\\u0ee4\\u6abbcedes\\u0200;EST\\u0ec8\\u0ec9\\u0ecf\\u0eda\\u627aqual;\\u6aaflantEqual;\\u627cilde;\\u627eme;\\u6033\\u0100dp\\u0ee9\\u0eeeuct;\\u620fortion\\u0100;a\\u0225\\u0ef9l;\\u621d\\u0100ci\\u0f01\\u0f06r;\\uc000\\ud835\\udcab;\\u43a8\\u0200Ufos\\u0f11\\u0f16\\u0f1b\\u0f1fOT\\u803b\"\\u4022r;\\uc000\\ud835\\udd14pf;\\u611acr;\\uc000\\ud835\\udcac\\u0600BEacefhiorsu\\u0f3e\\u0f43\\u0f47\\u0f60\\u0f73\\u0fa7\\u0faa\\u0fad\\u1096\\u10a9\\u10b4\\u10bearr;\\u6910G\\u803b\\xae\\u40ae\\u0180cnr\\u0f4e\\u0f53\\u0f56ute;\\u4154g;\\u67ebr\\u0100;t\\u0f5c\\u0f5d\\u61a0l;\\u6916\\u0180aey\\u0f67\\u0f6c\\u0f71ron;\\u4158dil;\\u4156;\\u4420\\u0100;v\\u0f78\\u0f79\\u611cerse\\u0100EU\\u0f82\\u0f99\\u0100lq\\u0f87\\u0f8eement;\\u620builibrium;\\u61cbpEquilibrium;\\u696fr\\xbb\\u0f79o;\\u43a1ght\\u0400ACDFTUVa\\u0fc1\\u0feb\\u0ff3\\u1022\\u1028\\u105b\\u1087\\u03d8\\u0100nr\\u0fc6\\u0fd2gleBracket;\\u67e9row\\u0180;BL\\u0fdc\\u0fdd\\u0fe1\\u6192ar;\\u61e5eftArrow;\\u61c4eiling;\\u6309o\\u01f5\\u0ff9\\0\\u1005bleBracket;\\u67e7n\\u01d4\\u100a\\0\\u1014eeVector;\\u695dector\\u0100;B\\u101d\\u101e\\u61c2ar;\\u6955loor;\\u630b\\u0100er\\u102d\\u1043e\\u0180;AV\\u1035\\u1036\\u103c\\u62a2rrow;\\u61a6ector;\\u695biangle\\u0180;BE\\u1050\\u1051\\u1055\\u62b3ar;\\u69d0qual;\\u62b5p\\u0180DTV\\u1063\\u106e\\u1078ownVector;\\u694feeVector;\\u695cector\\u0100;B\\u1082\\u1083\\u61bear;\\u6954ector\\u0100;B\\u1091\\u1092\\u61c0ar;\\u6953\\u0100pu\\u109b\\u109ef;\\u611dndImplies;\\u6970ightarrow;\\u61db\\u0100ch\\u10b9\\u10bcr;\\u611b;\\u61b1leDelayed;\\u69f4\\u0680HOacfhimoqstu\\u10e4\\u10f1\\u10f7\\u10fd\\u1119\\u111e\\u1151\\u1156\\u1161\\u1167\\u11b5\\u11bb\\u11bf\\u0100Cc\\u10e9\\u10eeHcy;\\u4429y;\\u4428FTcy;\\u442ccute;\\u415a\\u0280;aeiy\\u1108\\u1109\\u110e\\u1113\\u1117\\u6abcron;\\u4160dil;\\u415erc;\\u415c;\\u4421r;\\uc000\\ud835\\udd16ort\\u0200DLRU\\u112a\\u1134\\u113e\\u1149ownArrow\\xbb\\u041eeftArrow\\xbb\\u089aightArrow\\xbb\\u0fddpArrow;\\u6191gma;\\u43a3allCircle;\\u6218pf;\\uc000\\ud835\\udd4a\\u0272\\u116d\\0\\0\\u1170t;\\u621aare\\u0200;ISU\\u117b\\u117c\\u1189\\u11af\\u65a1ntersection;\\u6293u\\u0100bp\\u118f\\u119eset\\u0100;E\\u1197\\u1198\\u628fqual;\\u6291erset\\u0100;E\\u11a8\\u11a9\\u6290qual;\\u6292nion;\\u6294cr;\\uc000\\ud835\\udcaear;\\u62c6\\u0200bcmp\\u11c8\\u11db\\u1209\\u120b\\u0100;s\\u11cd\\u11ce\\u62d0et\\u0100;E\\u11cd\\u11d5qual;\\u6286\\u0100ch\\u11e0\\u1205eeds\\u0200;EST\\u11ed\\u11ee\\u11f4\\u11ff\\u627bqual;\\u6ab0lantEqual;\\u627dilde;\\u627fTh\\xe1\\u0f8c;\\u6211\\u0180;es\\u1212\\u1213\\u1223\\u62d1rset\\u0100;E\\u121c\\u121d\\u6283qual;\\u6287et\\xbb\\u1213\\u0580HRSacfhiors\\u123e\\u1244\\u1249\\u1255\\u125e\\u1271\\u1276\\u129f\\u12c2\\u12c8\\u12d1ORN\\u803b\\xde\\u40deADE;\\u6122\\u0100Hc\\u124e\\u1252cy;\\u440by;\\u4426\\u0100bu\\u125a\\u125c;\\u4009;\\u43a4\\u0180aey\\u1265\\u126a\\u126fron;\\u4164dil;\\u4162;\\u4422r;\\uc000\\ud835\\udd17\\u0100ei\\u127b\\u1289\\u01f2\\u1280\\0\\u1287efore;\\u6234a;\\u4398\\u0100cn\\u128e\\u1298kSpace;\\uc000\\u205f\\u200aSpace;\\u6009lde\\u0200;EFT\\u12ab\\u12ac\\u12b2\\u12bc\\u623cqual;\\u6243ullEqual;\\u6245ilde;\\u6248pf;\\uc000\\ud835\\udd4bipleDot;\\u60db\\u0100ct\\u12d6\\u12dbr;\\uc000\\ud835\\udcafrok;\\u4166\\u0ae1\\u12f7\\u130e\\u131a\\u1326\\0\\u132c\\u1331\\0\\0\\0\\0\\0\\u1338\\u133d\\u1377\\u1385\\0\\u13ff\\u1404\\u140a\\u1410\\u0100cr\\u12fb\\u1301ute\\u803b\\xda\\u40dar\\u0100;o\\u1307\\u1308\\u619fcir;\\u6949r\\u01e3\\u1313\\0\\u1316y;\\u440eve;\\u416c\\u0100iy\\u131e\\u1323rc\\u803b\\xdb\\u40db;\\u4423blac;\\u4170r;\\uc000\\ud835\\udd18rave\\u803b\\xd9\\u40d9acr;\\u416a\\u0100di\\u1341\\u1369er\\u0100BP\\u1348\\u135d\\u0100ar\\u134d\\u1350r;\\u405fac\\u0100ek\\u1357\\u1359;\\u63dfet;\\u63b5arenthesis;\\u63ddon\\u0100;P\\u1370\\u1371\\u62c3lus;\\u628e\\u0100gp\\u137b\\u137fon;\\u4172f;\\uc000\\ud835\\udd4c\\u0400ADETadps\\u1395\\u13ae\\u13b8\\u13c4\\u03e8\\u13d2\\u13d7\\u13f3rrow\\u0180;BD\\u1150\\u13a0\\u13a4ar;\\u6912ownArrow;\\u61c5ownArrow;\\u6195quilibrium;\\u696eee\\u0100;A\\u13cb\\u13cc\\u62a5rrow;\\u61a5own\\xe1\\u03f3er\\u0100LR\\u13de\\u13e8eftArrow;\\u6196ightArrow;\\u6197i\\u0100;l\\u13f9\\u13fa\\u43d2on;\\u43a5ing;\\u416ecr;\\uc000\\ud835\\udcb0ilde;\\u4168ml\\u803b\\xdc\\u40dc\\u0480Dbcdefosv\\u1427\\u142c\\u1430\\u1433\\u143e\\u1485\\u148a\\u1490\\u1496ash;\\u62abar;\\u6aeby;\\u4412ash\\u0100;l\\u143b\\u143c\\u62a9;\\u6ae6\\u0100er\\u1443\\u1445;\\u62c1\\u0180bty\\u144c\\u1450\\u147aar;\\u6016\\u0100;i\\u144f\\u1455cal\\u0200BLST\\u1461\\u1465\\u146a\\u1474ar;\\u6223ine;\\u407ceparator;\\u6758ilde;\\u6240ThinSpace;\\u600ar;\\uc000\\ud835\\udd19pf;\\uc000\\ud835\\udd4dcr;\\uc000\\ud835\\udcb1dash;\\u62aa\\u0280cefos\\u14a7\\u14ac\\u14b1\\u14b6\\u14bcirc;\\u4174dge;\\u62c0r;\\uc000\\ud835\\udd1apf;\\uc000\\ud835\\udd4ecr;\\uc000\\ud835\\udcb2\\u0200fios\\u14cb\\u14d0\\u14d2\\u14d8r;\\uc000\\ud835\\udd1b;\\u439epf;\\uc000\\ud835\\udd4fcr;\\uc000\\ud835\\udcb3\\u0480AIUacfosu\\u14f1\\u14f5\\u14f9\\u14fd\\u1504\\u150f\\u1514\\u151a\\u1520cy;\\u442fcy;\\u4407cy;\\u442ecute\\u803b\\xdd\\u40dd\\u0100iy\\u1509\\u150drc;\\u4176;\\u442br;\\uc000\\ud835\\udd1cpf;\\uc000\\ud835\\udd50cr;\\uc000\\ud835\\udcb4ml;\\u4178\\u0400Hacdefos\\u1535\\u1539\\u153f\\u154b\\u154f\\u155d\\u1560\\u1564cy;\\u4416cute;\\u4179\\u0100ay\\u1544\\u1549ron;\\u417d;\\u4417ot;\\u417b\\u01f2\\u1554\\0\\u155boWidt\\xe8\\u0ad9a;\\u4396r;\\u6128pf;\\u6124cr;\\uc000\\ud835\\udcb5\\u0be1\\u1583\\u158a\\u1590\\0\\u15b0\\u15b6\\u15bf\\0\\0\\0\\0\\u15c6\\u15db\\u15eb\\u165f\\u166d\\0\\u1695\\u169b\\u16b2\\u16b9\\0\\u16becute\\u803b\\xe1\\u40e1reve;\\u4103\\u0300;Ediuy\\u159c\\u159d\\u15a1\\u15a3\\u15a8\\u15ad\\u623e;\\uc000\\u223e\\u0333;\\u623frc\\u803b\\xe2\\u40e2te\\u80bb\\xb4\\u0306;\\u4430lig\\u803b\\xe6\\u40e6\\u0100;r\\xb2\\u15ba;\\uc000\\ud835\\udd1erave\\u803b\\xe0\\u40e0\\u0100ep\\u15ca\\u15d6\\u0100fp\\u15cf\\u15d4sym;\\u6135\\xe8\\u15d3ha;\\u43b1\\u0100ap\\u15dfc\\u0100cl\\u15e4\\u15e7r;\\u4101g;\\u6a3f\\u0264\\u15f0\\0\\0\\u160a\\u0280;adsv\\u15fa\\u15fb\\u15ff\\u1601\\u1607\\u6227nd;\\u6a55;\\u6a5clope;\\u6a58;\\u6a5a\\u0380;elmrsz\\u1618\\u1619\\u161b\\u161e\\u163f\\u164f\\u1659\\u6220;\\u69a4e\\xbb\\u1619sd\\u0100;a\\u1625\\u1626\\u6221\\u0461\\u1630\\u1632\\u1634\\u1636\\u1638\\u163a\\u163c\\u163e;\\u69a8;\\u69a9;\\u69aa;\\u69ab;\\u69ac;\\u69ad;\\u69ae;\\u69aft\\u0100;v\\u1645\\u1646\\u621fb\\u0100;d\\u164c\\u164d\\u62be;\\u699d\\u0100pt\\u1654\\u1657h;\\u6222\\xbb\\xb9arr;\\u637c\\u0100gp\\u1663\\u1667on;\\u4105f;\\uc000\\ud835\\udd52\\u0380;Eaeiop\\u12c1\\u167b\\u167d\\u1682\\u1684\\u1687\\u168a;\\u6a70cir;\\u6a6f;\\u624ad;\\u624bs;\\u4027rox\\u0100;e\\u12c1\\u1692\\xf1\\u1683ing\\u803b\\xe5\\u40e5\\u0180cty\\u16a1\\u16a6\\u16a8r;\\uc000\\ud835\\udcb6;\\u402amp\\u0100;e\\u12c1\\u16af\\xf1\\u0288ilde\\u803b\\xe3\\u40e3ml\\u803b\\xe4\\u40e4\\u0100ci\\u16c2\\u16c8onin\\xf4\\u0272nt;\\u6a11\\u0800Nabcdefiklnoprsu\\u16ed\\u16f1\\u1730\\u173c\\u1743\\u1748\\u1778\\u177d\\u17e0\\u17e6\\u1839\\u1850\\u170d\\u193d\\u1948\\u1970ot;\\u6aed\\u0100cr\\u16f6\\u171ek\\u0200ceps\\u1700\\u1705\\u170d\\u1713ong;\\u624cpsilon;\\u43f6rime;\\u6035im\\u0100;e\\u171a\\u171b\\u623dq;\\u62cd\\u0176\\u1722\\u1726ee;\\u62bded\\u0100;g\\u172c\\u172d\\u6305e\\xbb\\u172drk\\u0100;t\\u135c\\u1737brk;\\u63b6\\u0100oy\\u1701\\u1741;\\u4431quo;\\u601e\\u0280cmprt\\u1753\\u175b\\u1761\\u1764\\u1768aus\\u0100;e\\u010a\\u0109ptyv;\\u69b0s\\xe9\\u170cno\\xf5\\u0113\\u0180ahw\\u176f\\u1771\\u1773;\\u43b2;\\u6136een;\\u626cr;\\uc000\\ud835\\udd1fg\\u0380costuvw\\u178d\\u179d\\u17b3\\u17c1\\u17d5\\u17db\\u17de\\u0180aiu\\u1794\\u1796\\u179a\\xf0\\u0760rc;\\u65efp\\xbb\\u1371\\u0180dpt\\u17a4\\u17a8\\u17adot;\\u6a00lus;\\u6a01imes;\\u6a02\\u0271\\u17b9\\0\\0\\u17becup;\\u6a06ar;\\u6605riangle\\u0100du\\u17cd\\u17d2own;\\u65bdp;\\u65b3plus;\\u6a04e\\xe5\\u1444\\xe5\\u14adarow;\\u690d\\u0180ako\\u17ed\\u1826\\u1835\\u0100cn\\u17f2\\u1823k\\u0180lst\\u17fa\\u05ab\\u1802ozenge;\\u69ebriangle\\u0200;dlr\\u1812\\u1813\\u1818\\u181d\\u65b4own;\\u65beeft;\\u65c2ight;\\u65b8k;\\u6423\\u01b1\\u182b\\0\\u1833\\u01b2\\u182f\\0\\u1831;\\u6592;\\u65914;\\u6593ck;\\u6588\\u0100eo\\u183e\\u184d\\u0100;q\\u1843\\u1846\\uc000=\\u20e5uiv;\\uc000\\u2261\\u20e5t;\\u6310\\u0200ptwx\\u1859\\u185e\\u1867\\u186cf;\\uc000\\ud835\\udd53\\u0100;t\\u13cb\\u1863om\\xbb\\u13cctie;\\u62c8\\u0600DHUVbdhmptuv\\u1885\\u1896\\u18aa\\u18bb\\u18d7\\u18db\\u18ec\\u18ff\\u1905\\u190a\\u1910\\u1921\\u0200LRlr\\u188e\\u1890\\u1892\\u1894;\\u6557;\\u6554;\\u6556;\\u6553\\u0280;DUdu\\u18a1\\u18a2\\u18a4\\u18a6\\u18a8\\u6550;\\u6566;\\u6569;\\u6564;\\u6567\\u0200LRlr\\u18b3\\u18b5\\u18b7\\u18b9;\\u655d;\\u655a;\\u655c;\\u6559\\u0380;HLRhlr\\u18ca\\u18cb\\u18cd\\u18cf\\u18d1\\u18d3\\u18d5\\u6551;\\u656c;\\u6563;\\u6560;\\u656b;\\u6562;\\u655fox;\\u69c9\\u0200LRlr\\u18e4\\u18e6\\u18e8\\u18ea;\\u6555;\\u6552;\\u6510;\\u650c\\u0280;DUdu\\u06bd\\u18f7\\u18f9\\u18fb\\u18fd;\\u6565;\\u6568;\\u652c;\\u6534inus;\\u629flus;\\u629eimes;\\u62a0\\u0200LRlr\\u1919\\u191b\\u191d\\u191f;\\u655b;\\u6558;\\u6518;\\u6514\\u0380;HLRhlr\\u1930\\u1931\\u1933\\u1935\\u1937\\u1939\\u193b\\u6502;\\u656a;\\u6561;\\u655e;\\u653c;\\u6524;\\u651c\\u0100ev\\u0123\\u1942bar\\u803b\\xa6\\u40a6\\u0200ceio\\u1951\\u1956\\u195a\\u1960r;\\uc000\\ud835\\udcb7mi;\\u604fm\\u0100;e\\u171a\\u171cl\\u0180;bh\\u1968\\u1969\\u196b\\u405c;\\u69c5sub;\\u67c8\\u016c\\u1974\\u197el\\u0100;e\\u1979\\u197a\\u6022t\\xbb\\u197ap\\u0180;Ee\\u012f\\u1985\\u1987;\\u6aae\\u0100;q\\u06dc\\u06db\\u0ce1\\u19a7\\0\\u19e8\\u1a11\\u1a15\\u1a32\\0\\u1a37\\u1a50\\0\\0\\u1ab4\\0\\0\\u1ac1\\0\\0\\u1b21\\u1b2e\\u1b4d\\u1b52\\0\\u1bfd\\0\\u1c0c\\u0180cpr\\u19ad\\u19b2\\u19ddute;\\u4107\\u0300;abcds\\u19bf\\u19c0\\u19c4\\u19ca\\u19d5\\u19d9\\u6229nd;\\u6a44rcup;\\u6a49\\u0100au\\u19cf\\u19d2p;\\u6a4bp;\\u6a47ot;\\u6a40;\\uc000\\u2229\\ufe00\\u0100eo\\u19e2\\u19e5t;\\u6041\\xee\\u0693\\u0200aeiu\\u19f0\\u19fb\\u1a01\\u1a05\\u01f0\\u19f5\\0\\u19f8s;\\u6a4don;\\u410ddil\\u803b\\xe7\\u40e7rc;\\u4109ps\\u0100;s\\u1a0c\\u1a0d\\u6a4cm;\\u6a50ot;\\u410b\\u0180dmn\\u1a1b\\u1a20\\u1a26il\\u80bb\\xb8\\u01adptyv;\\u69b2t\\u8100\\xa2;e\\u1a2d\\u1a2e\\u40a2r\\xe4\\u01b2r;\\uc000\\ud835\\udd20\\u0180cei\\u1a3d\\u1a40\\u1a4dy;\\u4447ck\\u0100;m\\u1a47\\u1a48\\u6713ark\\xbb\\u1a48;\\u43c7r\\u0380;Ecefms\\u1a5f\\u1a60\\u1a62\\u1a6b\\u1aa4\\u1aaa\\u1aae\\u65cb;\\u69c3\\u0180;el\\u1a69\\u1a6a\\u1a6d\\u42c6q;\\u6257e\\u0261\\u1a74\\0\\0\\u1a88rrow\\u0100lr\\u1a7c\\u1a81eft;\\u61baight;\\u61bb\\u0280RSacd\\u1a92\\u1a94\\u1a96\\u1a9a\\u1a9f\\xbb\\u0f47;\\u64c8st;\\u629birc;\\u629aash;\\u629dnint;\\u6a10id;\\u6aefcir;\\u69c2ubs\\u0100;u\\u1abb\\u1abc\\u6663it\\xbb\\u1abc\\u02ec\\u1ac7\\u1ad4\\u1afa\\0\\u1b0aon\\u0100;e\\u1acd\\u1ace\\u403a\\u0100;q\\xc7\\xc6\\u026d\\u1ad9\\0\\0\\u1ae2a\\u0100;t\\u1ade\\u1adf\\u402c;\\u4040\\u0180;fl\\u1ae8\\u1ae9\\u1aeb\\u6201\\xee\\u1160e\\u0100mx\\u1af1\\u1af6ent\\xbb\\u1ae9e\\xf3\\u024d\\u01e7\\u1afe\\0\\u1b07\\u0100;d\\u12bb\\u1b02ot;\\u6a6dn\\xf4\\u0246\\u0180fry\\u1b10\\u1b14\\u1b17;\\uc000\\ud835\\udd54o\\xe4\\u0254\\u8100\\xa9;s\\u0155\\u1b1dr;\\u6117\\u0100ao\\u1b25\\u1b29rr;\\u61b5ss;\\u6717\\u0100cu\\u1b32\\u1b37r;\\uc000\\ud835\\udcb8\\u0100bp\\u1b3c\\u1b44\\u0100;e\\u1b41\\u1b42\\u6acf;\\u6ad1\\u0100;e\\u1b49\\u1b4a\\u6ad0;\\u6ad2dot;\\u62ef\\u0380delprvw\\u1b60\\u1b6c\\u1b77\\u1b82\\u1bac\\u1bd4\\u1bf9arr\\u0100lr\\u1b68\\u1b6a;\\u6938;\\u6935\\u0270\\u1b72\\0\\0\\u1b75r;\\u62dec;\\u62dfarr\\u0100;p\\u1b7f\\u1b80\\u61b6;\\u693d\\u0300;bcdos\\u1b8f\\u1b90\\u1b96\\u1ba1\\u1ba5\\u1ba8\\u622arcap;\\u6a48\\u0100au\\u1b9b\\u1b9ep;\\u6a46p;\\u6a4aot;\\u628dr;\\u6a45;\\uc000\\u222a\\ufe00\\u0200alrv\\u1bb5\\u1bbf\\u1bde\\u1be3rr\\u0100;m\\u1bbc\\u1bbd\\u61b7;\\u693cy\\u0180evw\\u1bc7\\u1bd4\\u1bd8q\\u0270\\u1bce\\0\\0\\u1bd2re\\xe3\\u1b73u\\xe3\\u1b75ee;\\u62ceedge;\\u62cfen\\u803b\\xa4\\u40a4earrow\\u0100lr\\u1bee\\u1bf3eft\\xbb\\u1b80ight\\xbb\\u1bbde\\xe4\\u1bdd\\u0100ci\\u1c01\\u1c07onin\\xf4\\u01f7nt;\\u6231lcty;\\u632d\\u0980AHabcdefhijlorstuwz\\u1c38\\u1c3b\\u1c3f\\u1c5d\\u1c69\\u1c75\\u1c8a\\u1c9e\\u1cac\\u1cb7\\u1cfb\\u1cff\\u1d0d\\u1d7b\\u1d91\\u1dab\\u1dbb\\u1dc6\\u1dcdr\\xf2\\u0381ar;\\u6965\\u0200glrs\\u1c48\\u1c4d\\u1c52\\u1c54ger;\\u6020eth;\\u6138\\xf2\\u1133h\\u0100;v\\u1c5a\\u1c5b\\u6010\\xbb\\u090a\\u016b\\u1c61\\u1c67arow;\\u690fa\\xe3\\u0315\\u0100ay\\u1c6e\\u1c73ron;\\u410f;\\u4434\\u0180;ao\\u0332\\u1c7c\\u1c84\\u0100gr\\u02bf\\u1c81r;\\u61catseq;\\u6a77\\u0180glm\\u1c91\\u1c94\\u1c98\\u803b\\xb0\\u40b0ta;\\u43b4ptyv;\\u69b1\\u0100ir\\u1ca3\\u1ca8sht;\\u697f;\\uc000\\ud835\\udd21ar\\u0100lr\\u1cb3\\u1cb5\\xbb\\u08dc\\xbb\\u101e\\u0280aegsv\\u1cc2\\u0378\\u1cd6\\u1cdc\\u1ce0m\\u0180;os\\u0326\\u1cca\\u1cd4nd\\u0100;s\\u0326\\u1cd1uit;\\u6666amma;\\u43ddin;\\u62f2\\u0180;io\\u1ce7\\u1ce8\\u1cf8\\u40f7de\\u8100\\xf7;o\\u1ce7\\u1cf0ntimes;\\u62c7n\\xf8\\u1cf7cy;\\u4452c\\u026f\\u1d06\\0\\0\\u1d0arn;\\u631eop;\\u630d\\u0280lptuw\\u1d18\\u1d1d\\u1d22\\u1d49\\u1d55lar;\\u4024f;\\uc000\\ud835\\udd55\\u0280;emps\\u030b\\u1d2d\\u1d37\\u1d3d\\u1d42q\\u0100;d\\u0352\\u1d33ot;\\u6251inus;\\u6238lus;\\u6214quare;\\u62a1blebarwedg\\xe5\\xfan\\u0180adh\\u112e\\u1d5d\\u1d67ownarrow\\xf3\\u1c83arpoon\\u0100lr\\u1d72\\u1d76ef\\xf4\\u1cb4igh\\xf4\\u1cb6\\u0162\\u1d7f\\u1d85karo\\xf7\\u0f42\\u026f\\u1d8a\\0\\0\\u1d8ern;\\u631fop;\\u630c\\u0180cot\\u1d98\\u1da3\\u1da6\\u0100ry\\u1d9d\\u1da1;\\uc000\\ud835\\udcb9;\\u4455l;\\u69f6rok;\\u4111\\u0100dr\\u1db0\\u1db4ot;\\u62f1i\\u0100;f\\u1dba\\u1816\\u65bf\\u0100ah\\u1dc0\\u1dc3r\\xf2\\u0429a\\xf2\\u0fa6angle;\\u69a6\\u0100ci\\u1dd2\\u1dd5y;\\u445fgrarr;\\u67ff\\u0900Dacdefglmnopqrstux\\u1e01\\u1e09\\u1e19\\u1e38\\u0578\\u1e3c\\u1e49\\u1e61\\u1e7e\\u1ea5\\u1eaf\\u1ebd\\u1ee1\\u1f2a\\u1f37\\u1f44\\u1f4e\\u1f5a\\u0100Do\\u1e06\\u1d34o\\xf4\\u1c89\\u0100cs\\u1e0e\\u1e14ute\\u803b\\xe9\\u40e9ter;\\u6a6e\\u0200aioy\\u1e22\\u1e27\\u1e31\\u1e36ron;\\u411br\\u0100;c\\u1e2d\\u1e2e\\u6256\\u803b\\xea\\u40ealon;\\u6255;\\u444dot;\\u4117\\u0100Dr\\u1e41\\u1e45ot;\\u6252;\\uc000\\ud835\\udd22\\u0180;rs\\u1e50\\u1e51\\u1e57\\u6a9aave\\u803b\\xe8\\u40e8\\u0100;d\\u1e5c\\u1e5d\\u6a96ot;\\u6a98\\u0200;ils\\u1e6a\\u1e6b\\u1e72\\u1e74\\u6a99nters;\\u63e7;\\u6113\\u0100;d\\u1e79\\u1e7a\\u6a95ot;\\u6a97\\u0180aps\\u1e85\\u1e89\\u1e97cr;\\u4113ty\\u0180;sv\\u1e92\\u1e93\\u1e95\\u6205et\\xbb\\u1e93p\\u01001;\\u1e9d\\u1ea4\\u0133\\u1ea1\\u1ea3;\\u6004;\\u6005\\u6003\\u0100gs\\u1eaa\\u1eac;\\u414bp;\\u6002\\u0100gp\\u1eb4\\u1eb8on;\\u4119f;\\uc000\\ud835\\udd56\\u0180als\\u1ec4\\u1ece\\u1ed2r\\u0100;s\\u1eca\\u1ecb\\u62d5l;\\u69e3us;\\u6a71i\\u0180;lv\\u1eda\\u1edb\\u1edf\\u43b5on\\xbb\\u1edb;\\u43f5\\u0200csuv\\u1eea\\u1ef3\\u1f0b\\u1f23\\u0100io\\u1eef\\u1e31rc\\xbb\\u1e2e\\u0269\\u1ef9\\0\\0\\u1efb\\xed\\u0548ant\\u0100gl\\u1f02\\u1f06tr\\xbb\\u1e5dess\\xbb\\u1e7a\\u0180aei\\u1f12\\u1f16\\u1f1als;\\u403dst;\\u625fv\\u0100;D\\u0235\\u1f20D;\\u6a78parsl;\\u69e5\\u0100Da\\u1f2f\\u1f33ot;\\u6253rr;\\u6971\\u0180cdi\\u1f3e\\u1f41\\u1ef8r;\\u612fo\\xf4\\u0352\\u0100ah\\u1f49\\u1f4b;\\u43b7\\u803b\\xf0\\u40f0\\u0100mr\\u1f53\\u1f57l\\u803b\\xeb\\u40ebo;\\u60ac\\u0180cip\\u1f61\\u1f64\\u1f67l;\\u4021s\\xf4\\u056e\\u0100eo\\u1f6c\\u1f74ctatio\\xee\\u0559nential\\xe5\\u0579\\u09e1\\u1f92\\0\\u1f9e\\0\\u1fa1\\u1fa7\\0\\0\\u1fc6\\u1fcc\\0\\u1fd3\\0\\u1fe6\\u1fea\\u2000\\0\\u2008\\u205allingdotse\\xf1\\u1e44y;\\u4444male;\\u6640\\u0180ilr\\u1fad\\u1fb3\\u1fc1lig;\\u8000\\ufb03\\u0269\\u1fb9\\0\\0\\u1fbdg;\\u8000\\ufb00ig;\\u8000\\ufb04;\\uc000\\ud835\\udd23lig;\\u8000\\ufb01lig;\\uc000fj\\u0180alt\\u1fd9\\u1fdc\\u1fe1t;\\u666dig;\\u8000\\ufb02ns;\\u65b1of;\\u4192\\u01f0\\u1fee\\0\\u1ff3f;\\uc000\\ud835\\udd57\\u0100ak\\u05bf\\u1ff7\\u0100;v\\u1ffc\\u1ffd\\u62d4;\\u6ad9artint;\\u6a0d\\u0100ao\\u200c\\u2055\\u0100cs\\u2011\\u2052\\u03b1\\u201a\\u2030\\u2038\\u2045\\u2048\\0\\u2050\\u03b2\\u2022\\u2025\\u2027\\u202a\\u202c\\0\\u202e\\u803b\\xbd\\u40bd;\\u6153\\u803b\\xbc\\u40bc;\\u6155;\\u6159;\\u615b\\u01b3\\u2034\\0\\u2036;\\u6154;\\u6156\\u02b4\\u203e\\u2041\\0\\0\\u2043\\u803b\\xbe\\u40be;\\u6157;\\u615c5;\\u6158\\u01b6\\u204c\\0\\u204e;\\u615a;\\u615d8;\\u615el;\\u6044wn;\\u6322cr;\\uc000\\ud835\\udcbb\\u0880Eabcdefgijlnorstv\\u2082\\u2089\\u209f\\u20a5\\u20b0\\u20b4\\u20f0\\u20f5\\u20fa\\u20ff\\u2103\\u2112\\u2138\\u0317\\u213e\\u2152\\u219e\\u0100;l\\u064d\\u2087;\\u6a8c\\u0180cmp\\u2090\\u2095\\u209dute;\\u41f5ma\\u0100;d\\u209c\\u1cda\\u43b3;\\u6a86reve;\\u411f\\u0100iy\\u20aa\\u20aerc;\\u411d;\\u4433ot;\\u4121\\u0200;lqs\\u063e\\u0642\\u20bd\\u20c9\\u0180;qs\\u063e\\u064c\\u20c4lan\\xf4\\u0665\\u0200;cdl\\u0665\\u20d2\\u20d5\\u20e5c;\\u6aa9ot\\u0100;o\\u20dc\\u20dd\\u6a80\\u0100;l\\u20e2\\u20e3\\u6a82;\\u6a84\\u0100;e\\u20ea\\u20ed\\uc000\\u22db\\ufe00s;\\u6a94r;\\uc000\\ud835\\udd24\\u0100;g\\u0673\\u061bmel;\\u6137cy;\\u4453\\u0200;Eaj\\u065a\\u210c\\u210e\\u2110;\\u6a92;\\u6aa5;\\u6aa4\\u0200Eaes\\u211b\\u211d\\u2129\\u2134;\\u6269p\\u0100;p\\u2123\\u2124\\u6a8arox\\xbb\\u2124\\u0100;q\\u212e\\u212f\\u6a88\\u0100;q\\u212e\\u211bim;\\u62e7pf;\\uc000\\ud835\\udd58\\u0100ci\\u2143\\u2146r;\\u610am\\u0180;el\\u066b\\u214e\\u2150;\\u6a8e;\\u6a90\\u8300>;cdlqr\\u05ee\\u2160\\u216a\\u216e\\u2173\\u2179\\u0100ci\\u2165\\u2167;\\u6aa7r;\\u6a7aot;\\u62d7Par;\\u6995uest;\\u6a7c\\u0280adels\\u2184\\u216a\\u2190\\u0656\\u219b\\u01f0\\u2189\\0\\u218epro\\xf8\\u209er;\\u6978q\\u0100lq\\u063f\\u2196les\\xf3\\u2088i\\xed\\u066b\\u0100en\\u21a3\\u21adrtneqq;\\uc000\\u2269\\ufe00\\xc5\\u21aa\\u0500Aabcefkosy\\u21c4\\u21c7\\u21f1\\u21f5\\u21fa\\u2218\\u221d\\u222f\\u2268\\u227dr\\xf2\\u03a0\\u0200ilmr\\u21d0\\u21d4\\u21d7\\u21dbrs\\xf0\\u1484f\\xbb\\u2024il\\xf4\\u06a9\\u0100dr\\u21e0\\u21e4cy;\\u444a\\u0180;cw\\u08f4\\u21eb\\u21efir;\\u6948;\\u61adar;\\u610firc;\\u4125\\u0180alr\\u2201\\u220e\\u2213rts\\u0100;u\\u2209\\u220a\\u6665it\\xbb\\u220alip;\\u6026con;\\u62b9r;\\uc000\\ud835\\udd25s\\u0100ew\\u2223\\u2229arow;\\u6925arow;\\u6926\\u0280amopr\\u223a\\u223e\\u2243\\u225e\\u2263rr;\\u61fftht;\\u623bk\\u0100lr\\u2249\\u2253eftarrow;\\u61a9ightarrow;\\u61aaf;\\uc000\\ud835\\udd59bar;\\u6015\\u0180clt\\u226f\\u2274\\u2278r;\\uc000\\ud835\\udcbdas\\xe8\\u21f4rok;\\u4127\\u0100bp\\u2282\\u2287ull;\\u6043hen\\xbb\\u1c5b\\u0ae1\\u22a3\\0\\u22aa\\0\\u22b8\\u22c5\\u22ce\\0\\u22d5\\u22f3\\0\\0\\u22f8\\u2322\\u2367\\u2362\\u237f\\0\\u2386\\u23aa\\u23b4cute\\u803b\\xed\\u40ed\\u0180;iy\\u0771\\u22b0\\u22b5rc\\u803b\\xee\\u40ee;\\u4438\\u0100cx\\u22bc\\u22bfy;\\u4435cl\\u803b\\xa1\\u40a1\\u0100fr\\u039f\\u22c9;\\uc000\\ud835\\udd26rave\\u803b\\xec\\u40ec\\u0200;ino\\u073e\\u22dd\\u22e9\\u22ee\\u0100in\\u22e2\\u22e6nt;\\u6a0ct;\\u622dfin;\\u69dcta;\\u6129lig;\\u4133\\u0180aop\\u22fe\\u231a\\u231d\\u0180cgt\\u2305\\u2308\\u2317r;\\u412b\\u0180elp\\u071f\\u230f\\u2313in\\xe5\\u078ear\\xf4\\u0720h;\\u4131f;\\u62b7ed;\\u41b5\\u0280;cfot\\u04f4\\u232c\\u2331\\u233d\\u2341are;\\u6105in\\u0100;t\\u2338\\u2339\\u621eie;\\u69dddo\\xf4\\u2319\\u0280;celp\\u0757\\u234c\\u2350\\u235b\\u2361al;\\u62ba\\u0100gr\\u2355\\u2359er\\xf3\\u1563\\xe3\\u234darhk;\\u6a17rod;\\u6a3c\\u0200cgpt\\u236f\\u2372\\u2376\\u237by;\\u4451on;\\u412ff;\\uc000\\ud835\\udd5aa;\\u43b9uest\\u803b\\xbf\\u40bf\\u0100ci\\u238a\\u238fr;\\uc000\\ud835\\udcben\\u0280;Edsv\\u04f4\\u239b\\u239d\\u23a1\\u04f3;\\u62f9ot;\\u62f5\\u0100;v\\u23a6\\u23a7\\u62f4;\\u62f3\\u0100;i\\u0777\\u23aelde;\\u4129\\u01eb\\u23b8\\0\\u23bccy;\\u4456l\\u803b\\xef\\u40ef\\u0300cfmosu\\u23cc\\u23d7\\u23dc\\u23e1\\u23e7\\u23f5\\u0100iy\\u23d1\\u23d5rc;\\u4135;\\u4439r;\\uc000\\ud835\\udd27ath;\\u4237pf;\\uc000\\ud835\\udd5b\\u01e3\\u23ec\\0\\u23f1r;\\uc000\\ud835\\udcbfrcy;\\u4458kcy;\\u4454\\u0400acfghjos\\u240b\\u2416\\u2422\\u2427\\u242d\\u2431\\u2435\\u243bppa\\u0100;v\\u2413\\u2414\\u43ba;\\u43f0\\u0100ey\\u241b\\u2420dil;\\u4137;\\u443ar;\\uc000\\ud835\\udd28reen;\\u4138cy;\\u4445cy;\\u445cpf;\\uc000\\ud835\\udd5ccr;\\uc000\\ud835\\udcc0\\u0b80ABEHabcdefghjlmnoprstuv\\u2470\\u2481\\u2486\\u248d\\u2491\\u250e\\u253d\\u255a\\u2580\\u264e\\u265e\\u2665\\u2679\\u267d\\u269a\\u26b2\\u26d8\\u275d\\u2768\\u278b\\u27c0\\u2801\\u2812\\u0180art\\u2477\\u247a\\u247cr\\xf2\\u09c6\\xf2\\u0395ail;\\u691barr;\\u690e\\u0100;g\\u0994\\u248b;\\u6a8bar;\\u6962\\u0963\\u24a5\\0\\u24aa\\0\\u24b1\\0\\0\\0\\0\\0\\u24b5\\u24ba\\0\\u24c6\\u24c8\\u24cd\\0\\u24f9ute;\\u413amptyv;\\u69b4ra\\xee\\u084cbda;\\u43bbg\\u0180;dl\\u088e\\u24c1\\u24c3;\\u6991\\xe5\\u088e;\\u6a85uo\\u803b\\xab\\u40abr\\u0400;bfhlpst\\u0899\\u24de\\u24e6\\u24e9\\u24eb\\u24ee\\u24f1\\u24f5\\u0100;f\\u089d\\u24e3s;\\u691fs;\\u691d\\xeb\\u2252p;\\u61abl;\\u6939im;\\u6973l;\\u61a2\\u0180;ae\\u24ff\\u2500\\u2504\\u6aabil;\\u6919\\u0100;s\\u2509\\u250a\\u6aad;\\uc000\\u2aad\\ufe00\\u0180abr\\u2515\\u2519\\u251drr;\\u690crk;\\u6772\\u0100ak\\u2522\\u252cc\\u0100ek\\u2528\\u252a;\\u407b;\\u405b\\u0100es\\u2531\\u2533;\\u698bl\\u0100du\\u2539\\u253b;\\u698f;\\u698d\\u0200aeuy\\u2546\\u254b\\u2556\\u2558ron;\\u413e\\u0100di\\u2550\\u2554il;\\u413c\\xec\\u08b0\\xe2\\u2529;\\u443b\\u0200cqrs\\u2563\\u2566\\u256d\\u257da;\\u6936uo\\u0100;r\\u0e19\\u1746\\u0100du\\u2572\\u2577har;\\u6967shar;\\u694bh;\\u61b2\\u0280;fgqs\\u258b\\u258c\\u0989\\u25f3\\u25ff\\u6264t\\u0280ahlrt\\u2598\\u25a4\\u25b7\\u25c2\\u25e8rrow\\u0100;t\\u0899\\u25a1a\\xe9\\u24f6arpoon\\u0100du\\u25af\\u25b4own\\xbb\\u045ap\\xbb\\u0966eftarrows;\\u61c7ight\\u0180ahs\\u25cd\\u25d6\\u25derrow\\u0100;s\\u08f4\\u08a7arpoon\\xf3\\u0f98quigarro\\xf7\\u21f0hreetimes;\\u62cb\\u0180;qs\\u258b\\u0993\\u25falan\\xf4\\u09ac\\u0280;cdgs\\u09ac\\u260a\\u260d\\u261d\\u2628c;\\u6aa8ot\\u0100;o\\u2614\\u2615\\u6a7f\\u0100;r\\u261a\\u261b\\u6a81;\\u6a83\\u0100;e\\u2622\\u2625\\uc000\\u22da\\ufe00s;\\u6a93\\u0280adegs\\u2633\\u2639\\u263d\\u2649\\u264bppro\\xf8\\u24c6ot;\\u62d6q\\u0100gq\\u2643\\u2645\\xf4\\u0989gt\\xf2\\u248c\\xf4\\u099bi\\xed\\u09b2\\u0180ilr\\u2655\\u08e1\\u265asht;\\u697c;\\uc000\\ud835\\udd29\\u0100;E\\u099c\\u2663;\\u6a91\\u0161\\u2669\\u2676r\\u0100du\\u25b2\\u266e\\u0100;l\\u0965\\u2673;\\u696alk;\\u6584cy;\\u4459\\u0280;acht\\u0a48\\u2688\\u268b\\u2691\\u2696r\\xf2\\u25c1orne\\xf2\\u1d08ard;\\u696bri;\\u65fa\\u0100io\\u269f\\u26a4dot;\\u4140ust\\u0100;a\\u26ac\\u26ad\\u63b0che\\xbb\\u26ad\\u0200Eaes\\u26bb\\u26bd\\u26c9\\u26d4;\\u6268p\\u0100;p\\u26c3\\u26c4\\u6a89rox\\xbb\\u26c4\\u0100;q\\u26ce\\u26cf\\u6a87\\u0100;q\\u26ce\\u26bbim;\\u62e6\\u0400abnoptwz\\u26e9\\u26f4\\u26f7\\u271a\\u272f\\u2741\\u2747\\u2750\\u0100nr\\u26ee\\u26f1g;\\u67ecr;\\u61fdr\\xeb\\u08c1g\\u0180lmr\\u26ff\\u270d\\u2714eft\\u0100ar\\u09e6\\u2707ight\\xe1\\u09f2apsto;\\u67fcight\\xe1\\u09fdparrow\\u0100lr\\u2725\\u2729ef\\xf4\\u24edight;\\u61ac\\u0180afl\\u2736\\u2739\\u273dr;\\u6985;\\uc000\\ud835\\udd5dus;\\u6a2dimes;\\u6a34\\u0161\\u274b\\u274fst;\\u6217\\xe1\\u134e\\u0180;ef\\u2757\\u2758\\u1800\\u65cange\\xbb\\u2758ar\\u0100;l\\u2764\\u2765\\u4028t;\\u6993\\u0280achmt\\u2773\\u2776\\u277c\\u2785\\u2787r\\xf2\\u08a8orne\\xf2\\u1d8car\\u0100;d\\u0f98\\u2783;\\u696d;\\u600eri;\\u62bf\\u0300achiqt\\u2798\\u279d\\u0a40\\u27a2\\u27ae\\u27bbquo;\\u6039r;\\uc000\\ud835\\udcc1m\\u0180;eg\\u09b2\\u27aa\\u27ac;\\u6a8d;\\u6a8f\\u0100bu\\u252a\\u27b3o\\u0100;r\\u0e1f\\u27b9;\\u601arok;\\u4142\\u8400<;cdhilqr\\u082b\\u27d2\\u2639\\u27dc\\u27e0\\u27e5\\u27ea\\u27f0\\u0100ci\\u27d7\\u27d9;\\u6aa6r;\\u6a79re\\xe5\\u25f2mes;\\u62c9arr;\\u6976uest;\\u6a7b\\u0100Pi\\u27f5\\u27f9ar;\\u6996\\u0180;ef\\u2800\\u092d\\u181b\\u65c3r\\u0100du\\u2807\\u280dshar;\\u694ahar;\\u6966\\u0100en\\u2817\\u2821rtneqq;\\uc000\\u2268\\ufe00\\xc5\\u281e\\u0700Dacdefhilnopsu\\u2840\\u2845\\u2882\\u288e\\u2893\\u28a0\\u28a5\\u28a8\\u28da\\u28e2\\u28e4\\u0a83\\u28f3\\u2902Dot;\\u623a\\u0200clpr\\u284e\\u2852\\u2863\\u287dr\\u803b\\xaf\\u40af\\u0100et\\u2857\\u2859;\\u6642\\u0100;e\\u285e\\u285f\\u6720se\\xbb\\u285f\\u0100;s\\u103b\\u2868to\\u0200;dlu\\u103b\\u2873\\u2877\\u287bow\\xee\\u048cef\\xf4\\u090f\\xf0\\u13d1ker;\\u65ae\\u0100oy\\u2887\\u288cmma;\\u6a29;\\u443cash;\\u6014asuredangle\\xbb\\u1626r;\\uc000\\ud835\\udd2ao;\\u6127\\u0180cdn\\u28af\\u28b4\\u28c9ro\\u803b\\xb5\\u40b5\\u0200;acd\\u1464\\u28bd\\u28c0\\u28c4s\\xf4\\u16a7ir;\\u6af0ot\\u80bb\\xb7\\u01b5us\\u0180;bd\\u28d2\\u1903\\u28d3\\u6212\\u0100;u\\u1d3c\\u28d8;\\u6a2a\\u0163\\u28de\\u28e1p;\\u6adb\\xf2\\u2212\\xf0\\u0a81\\u0100dp\\u28e9\\u28eeels;\\u62a7f;\\uc000\\ud835\\udd5e\\u0100ct\\u28f8\\u28fdr;\\uc000\\ud835\\udcc2pos\\xbb\\u159d\\u0180;lm\\u2909\\u290a\\u290d\\u43bctimap;\\u62b8\\u0c00GLRVabcdefghijlmoprstuvw\\u2942\\u2953\\u297e\\u2989\\u2998\\u29da\\u29e9\\u2a15\\u2a1a\\u2a58\\u2a5d\\u2a83\\u2a95\\u2aa4\\u2aa8\\u2b04\\u2b07\\u2b44\\u2b7f\\u2bae\\u2c34\\u2c67\\u2c7c\\u2ce9\\u0100gt\\u2947\\u294b;\\uc000\\u22d9\\u0338\\u0100;v\\u2950\\u0bcf\\uc000\\u226b\\u20d2\\u0180elt\\u295a\\u2972\\u2976ft\\u0100ar\\u2961\\u2967rrow;\\u61cdightarrow;\\u61ce;\\uc000\\u22d8\\u0338\\u0100;v\\u297b\\u0c47\\uc000\\u226a\\u20d2ightarrow;\\u61cf\\u0100Dd\\u298e\\u2993ash;\\u62afash;\\u62ae\\u0280bcnpt\\u29a3\\u29a7\\u29ac\\u29b1\\u29ccla\\xbb\\u02deute;\\u4144g;\\uc000\\u2220\\u20d2\\u0280;Eiop\\u0d84\\u29bc\\u29c0\\u29c5\\u29c8;\\uc000\\u2a70\\u0338d;\\uc000\\u224b\\u0338s;\\u4149ro\\xf8\\u0d84ur\\u0100;a\\u29d3\\u29d4\\u666el\\u0100;s\\u29d3\\u0b38\\u01f3\\u29df\\0\\u29e3p\\u80bb\\xa0\\u0b37mp\\u0100;e\\u0bf9\\u0c00\\u0280aeouy\\u29f4\\u29fe\\u2a03\\u2a10\\u2a13\\u01f0\\u29f9\\0\\u29fb;\\u6a43on;\\u4148dil;\\u4146ng\\u0100;d\\u0d7e\\u2a0aot;\\uc000\\u2a6d\\u0338p;\\u6a42;\\u443dash;\\u6013\\u0380;Aadqsx\\u0b92\\u2a29\\u2a2d\\u2a3b\\u2a41\\u2a45\\u2a50rr;\\u61d7r\\u0100hr\\u2a33\\u2a36k;\\u6924\\u0100;o\\u13f2\\u13f0ot;\\uc000\\u2250\\u0338ui\\xf6\\u0b63\\u0100ei\\u2a4a\\u2a4ear;\\u6928\\xed\\u0b98ist\\u0100;s\\u0ba0\\u0b9fr;\\uc000\\ud835\\udd2b\\u0200Eest\\u0bc5\\u2a66\\u2a79\\u2a7c\\u0180;qs\\u0bbc\\u2a6d\\u0be1\\u0180;qs\\u0bbc\\u0bc5\\u2a74lan\\xf4\\u0be2i\\xed\\u0bea\\u0100;r\\u0bb6\\u2a81\\xbb\\u0bb7\\u0180Aap\\u2a8a\\u2a8d\\u2a91r\\xf2\\u2971rr;\\u61aear;\\u6af2\\u0180;sv\\u0f8d\\u2a9c\\u0f8c\\u0100;d\\u2aa1\\u2aa2\\u62fc;\\u62facy;\\u445a\\u0380AEadest\\u2ab7\\u2aba\\u2abe\\u2ac2\\u2ac5\\u2af6\\u2af9r\\xf2\\u2966;\\uc000\\u2266\\u0338rr;\\u619ar;\\u6025\\u0200;fqs\\u0c3b\\u2ace\\u2ae3\\u2aeft\\u0100ar\\u2ad4\\u2ad9rro\\xf7\\u2ac1ightarro\\xf7\\u2a90\\u0180;qs\\u0c3b\\u2aba\\u2aealan\\xf4\\u0c55\\u0100;s\\u0c55\\u2af4\\xbb\\u0c36i\\xed\\u0c5d\\u0100;r\\u0c35\\u2afei\\u0100;e\\u0c1a\\u0c25i\\xe4\\u0d90\\u0100pt\\u2b0c\\u2b11f;\\uc000\\ud835\\udd5f\\u8180\\xac;in\\u2b19\\u2b1a\\u2b36\\u40acn\\u0200;Edv\\u0b89\\u2b24\\u2b28\\u2b2e;\\uc000\\u22f9\\u0338ot;\\uc000\\u22f5\\u0338\\u01e1\\u0b89\\u2b33\\u2b35;\\u62f7;\\u62f6i\\u0100;v\\u0cb8\\u2b3c\\u01e1\\u0cb8\\u2b41\\u2b43;\\u62fe;\\u62fd\\u0180aor\\u2b4b\\u2b63\\u2b69r\\u0200;ast\\u0b7b\\u2b55\\u2b5a\\u2b5flle\\xec\\u0b7bl;\\uc000\\u2afd\\u20e5;\\uc000\\u2202\\u0338lint;\\u6a14\\u0180;ce\\u0c92\\u2b70\\u2b73u\\xe5\\u0ca5\\u0100;c\\u0c98\\u2b78\\u0100;e\\u0c92\\u2b7d\\xf1\\u0c98\\u0200Aait\\u2b88\\u2b8b\\u2b9d\\u2ba7r\\xf2\\u2988rr\\u0180;cw\\u2b94\\u2b95\\u2b99\\u619b;\\uc000\\u2933\\u0338;\\uc000\\u219d\\u0338ghtarrow\\xbb\\u2b95ri\\u0100;e\\u0ccb\\u0cd6\\u0380chimpqu\\u2bbd\\u2bcd\\u2bd9\\u2b04\\u0b78\\u2be4\\u2bef\\u0200;cer\\u0d32\\u2bc6\\u0d37\\u2bc9u\\xe5\\u0d45;\\uc000\\ud835\\udcc3ort\\u026d\\u2b05\\0\\0\\u2bd6ar\\xe1\\u2b56m\\u0100;e\\u0d6e\\u2bdf\\u0100;q\\u0d74\\u0d73su\\u0100bp\\u2beb\\u2bed\\xe5\\u0cf8\\xe5\\u0d0b\\u0180bcp\\u2bf6\\u2c11\\u2c19\\u0200;Ees\\u2bff\\u2c00\\u0d22\\u2c04\\u6284;\\uc000\\u2ac5\\u0338et\\u0100;e\\u0d1b\\u2c0bq\\u0100;q\\u0d23\\u2c00c\\u0100;e\\u0d32\\u2c17\\xf1\\u0d38\\u0200;Ees\\u2c22\\u2c23\\u0d5f\\u2c27\\u6285;\\uc000\\u2ac6\\u0338et\\u0100;e\\u0d58\\u2c2eq\\u0100;q\\u0d60\\u2c23\\u0200gilr\\u2c3d\\u2c3f\\u2c45\\u2c47\\xec\\u0bd7lde\\u803b\\xf1\\u40f1\\xe7\\u0c43iangle\\u0100lr\\u2c52\\u2c5ceft\\u0100;e\\u0c1a\\u2c5a\\xf1\\u0c26ight\\u0100;e\\u0ccb\\u2c65\\xf1\\u0cd7\\u0100;m\\u2c6c\\u2c6d\\u43bd\\u0180;es\\u2c74\\u2c75\\u2c79\\u4023ro;\\u6116p;\\u6007\\u0480DHadgilrs\\u2c8f\\u2c94\\u2c99\\u2c9e\\u2ca3\\u2cb0\\u2cb6\\u2cd3\\u2ce3ash;\\u62adarr;\\u6904p;\\uc000\\u224d\\u20d2ash;\\u62ac\\u0100et\\u2ca8\\u2cac;\\uc000\\u2265\\u20d2;\\uc000>\\u20d2nfin;\\u69de\\u0180Aet\\u2cbd\\u2cc1\\u2cc5rr;\\u6902;\\uc000\\u2264\\u20d2\\u0100;r\\u2cca\\u2ccd\\uc000<\\u20d2ie;\\uc000\\u22b4\\u20d2\\u0100At\\u2cd8\\u2cdcrr;\\u6903rie;\\uc000\\u22b5\\u20d2im;\\uc000\\u223c\\u20d2\\u0180Aan\\u2cf0\\u2cf4\\u2d02rr;\\u61d6r\\u0100hr\\u2cfa\\u2cfdk;\\u6923\\u0100;o\\u13e7\\u13e5ear;\\u6927\\u1253\\u1a95\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\u2d2d\\0\\u2d38\\u2d48\\u2d60\\u2d65\\u2d72\\u2d84\\u1b07\\0\\0\\u2d8d\\u2dab\\0\\u2dc8\\u2dce\\0\\u2ddc\\u2e19\\u2e2b\\u2e3e\\u2e43\\u0100cs\\u2d31\\u1a97ute\\u803b\\xf3\\u40f3\\u0100iy\\u2d3c\\u2d45r\\u0100;c\\u1a9e\\u2d42\\u803b\\xf4\\u40f4;\\u443e\\u0280abios\\u1aa0\\u2d52\\u2d57\\u01c8\\u2d5alac;\\u4151v;\\u6a38old;\\u69bclig;\\u4153\\u0100cr\\u2d69\\u2d6dir;\\u69bf;\\uc000\\ud835\\udd2c\\u036f\\u2d79\\0\\0\\u2d7c\\0\\u2d82n;\\u42dbave\\u803b\\xf2\\u40f2;\\u69c1\\u0100bm\\u2d88\\u0df4ar;\\u69b5\\u0200acit\\u2d95\\u2d98\\u2da5\\u2da8r\\xf2\\u1a80\\u0100ir\\u2d9d\\u2da0r;\\u69beoss;\\u69bbn\\xe5\\u0e52;\\u69c0\\u0180aei\\u2db1\\u2db5\\u2db9cr;\\u414dga;\\u43c9\\u0180cdn\\u2dc0\\u2dc5\\u01cdron;\\u43bf;\\u69b6pf;\\uc000\\ud835\\udd60\\u0180ael\\u2dd4\\u2dd7\\u01d2r;\\u69b7rp;\\u69b9\\u0380;adiosv\\u2dea\\u2deb\\u2dee\\u2e08\\u2e0d\\u2e10\\u2e16\\u6228r\\xf2\\u1a86\\u0200;efm\\u2df7\\u2df8\\u2e02\\u2e05\\u6a5dr\\u0100;o\\u2dfe\\u2dff\\u6134f\\xbb\\u2dff\\u803b\\xaa\\u40aa\\u803b\\xba\\u40bagof;\\u62b6r;\\u6a56lope;\\u6a57;\\u6a5b\\u0180clo\\u2e1f\\u2e21\\u2e27\\xf2\\u2e01ash\\u803b\\xf8\\u40f8l;\\u6298i\\u016c\\u2e2f\\u2e34de\\u803b\\xf5\\u40f5es\\u0100;a\\u01db\\u2e3as;\\u6a36ml\\u803b\\xf6\\u40f6bar;\\u633d\\u0ae1\\u2e5e\\0\\u2e7d\\0\\u2e80\\u2e9d\\0\\u2ea2\\u2eb9\\0\\0\\u2ecb\\u0e9c\\0\\u2f13\\0\\0\\u2f2b\\u2fbc\\0\\u2fc8r\\u0200;ast\\u0403\\u2e67\\u2e72\\u0e85\\u8100\\xb6;l\\u2e6d\\u2e6e\\u40b6le\\xec\\u0403\\u0269\\u2e78\\0\\0\\u2e7bm;\\u6af3;\\u6afdy;\\u443fr\\u0280cimpt\\u2e8b\\u2e8f\\u2e93\\u1865\\u2e97nt;\\u4025od;\\u402eil;\\u6030enk;\\u6031r;\\uc000\\ud835\\udd2d\\u0180imo\\u2ea8\\u2eb0\\u2eb4\\u0100;v\\u2ead\\u2eae\\u43c6;\\u43d5ma\\xf4\\u0a76ne;\\u660e\\u0180;tv\\u2ebf\\u2ec0\\u2ec8\\u43c0chfork\\xbb\\u1ffd;\\u43d6\\u0100au\\u2ecf\\u2edfn\\u0100ck\\u2ed5\\u2eddk\\u0100;h\\u21f4\\u2edb;\\u610e\\xf6\\u21f4s\\u0480;abcdemst\\u2ef3\\u2ef4\\u1908\\u2ef9\\u2efd\\u2f04\\u2f06\\u2f0a\\u2f0e\\u402bcir;\\u6a23ir;\\u6a22\\u0100ou\\u1d40\\u2f02;\\u6a25;\\u6a72n\\u80bb\\xb1\\u0e9dim;\\u6a26wo;\\u6a27\\u0180ipu\\u2f19\\u2f20\\u2f25ntint;\\u6a15f;\\uc000\\ud835\\udd61nd\\u803b\\xa3\\u40a3\\u0500;Eaceinosu\\u0ec8\\u2f3f\\u2f41\\u2f44\\u2f47\\u2f81\\u2f89\\u2f92\\u2f7e\\u2fb6;\\u6ab3p;\\u6ab7u\\xe5\\u0ed9\\u0100;c\\u0ece\\u2f4c\\u0300;acens\\u0ec8\\u2f59\\u2f5f\\u2f66\\u2f68\\u2f7eppro\\xf8\\u2f43urlye\\xf1\\u0ed9\\xf1\\u0ece\\u0180aes\\u2f6f\\u2f76\\u2f7approx;\\u6ab9qq;\\u6ab5im;\\u62e8i\\xed\\u0edfme\\u0100;s\\u2f88\\u0eae\\u6032\\u0180Eas\\u2f78\\u2f90\\u2f7a\\xf0\\u2f75\\u0180dfp\\u0eec\\u2f99\\u2faf\\u0180als\\u2fa0\\u2fa5\\u2faalar;\\u632eine;\\u6312urf;\\u6313\\u0100;t\\u0efb\\u2fb4\\xef\\u0efbrel;\\u62b0\\u0100ci\\u2fc0\\u2fc5r;\\uc000\\ud835\\udcc5;\\u43c8ncsp;\\u6008\\u0300fiopsu\\u2fda\\u22e2\\u2fdf\\u2fe5\\u2feb\\u2ff1r;\\uc000\\ud835\\udd2epf;\\uc000\\ud835\\udd62rime;\\u6057cr;\\uc000\\ud835\\udcc6\\u0180aeo\\u2ff8\\u3009\\u3013t\\u0100ei\\u2ffe\\u3005rnion\\xf3\\u06b0nt;\\u6a16st\\u0100;e\\u3010\\u3011\\u403f\\xf1\\u1f19\\xf4\\u0f14\\u0a80ABHabcdefhilmnoprstux\\u3040\\u3051\\u3055\\u3059\\u30e0\\u310e\\u312b\\u3147\\u3162\\u3172\\u318e\\u3206\\u3215\\u3224\\u3229\\u3258\\u326e\\u3272\\u3290\\u32b0\\u32b7\\u0180art\\u3047\\u304a\\u304cr\\xf2\\u10b3\\xf2\\u03ddail;\\u691car\\xf2\\u1c65ar;\\u6964\\u0380cdenqrt\\u3068\\u3075\\u3078\\u307f\\u308f\\u3094\\u30cc\\u0100eu\\u306d\\u3071;\\uc000\\u223d\\u0331te;\\u4155i\\xe3\\u116emptyv;\\u69b3g\\u0200;del\\u0fd1\\u3089\\u308b\\u308d;\\u6992;\\u69a5\\xe5\\u0fd1uo\\u803b\\xbb\\u40bbr\\u0580;abcfhlpstw\\u0fdc\\u30ac\\u30af\\u30b7\\u30b9\\u30bc\\u30be\\u30c0\\u30c3\\u30c7\\u30cap;\\u6975\\u0100;f\\u0fe0\\u30b4s;\\u6920;\\u6933s;\\u691e\\xeb\\u225d\\xf0\\u272el;\\u6945im;\\u6974l;\\u61a3;\\u619d\\u0100ai\\u30d1\\u30d5il;\\u691ao\\u0100;n\\u30db\\u30dc\\u6236al\\xf3\\u0f1e\\u0180abr\\u30e7\\u30ea\\u30eer\\xf2\\u17e5rk;\\u6773\\u0100ak\\u30f3\\u30fdc\\u0100ek\\u30f9\\u30fb;\\u407d;\\u405d\\u0100es\\u3102\\u3104;\\u698cl\\u0100du\\u310a\\u310c;\\u698e;\\u6990\\u0200aeuy\\u3117\\u311c\\u3127\\u3129ron;\\u4159\\u0100di\\u3121\\u3125il;\\u4157\\xec\\u0ff2\\xe2\\u30fa;\\u4440\\u0200clqs\\u3134\\u3137\\u313d\\u3144a;\\u6937dhar;\\u6969uo\\u0100;r\\u020e\\u020dh;\\u61b3\\u0180acg\\u314e\\u315f\\u0f44l\\u0200;ips\\u0f78\\u3158\\u315b\\u109cn\\xe5\\u10bbar\\xf4\\u0fa9t;\\u65ad\\u0180ilr\\u3169\\u1023\\u316esht;\\u697d;\\uc000\\ud835\\udd2f\\u0100ao\\u3177\\u3186r\\u0100du\\u317d\\u317f\\xbb\\u047b\\u0100;l\\u1091\\u3184;\\u696c\\u0100;v\\u318b\\u318c\\u43c1;\\u43f1\\u0180gns\\u3195\\u31f9\\u31fcht\\u0300ahlrst\\u31a4\\u31b0\\u31c2\\u31d8\\u31e4\\u31eerrow\\u0100;t\\u0fdc\\u31ada\\xe9\\u30c8arpoon\\u0100du\\u31bb\\u31bfow\\xee\\u317ep\\xbb\\u1092eft\\u0100ah\\u31ca\\u31d0rrow\\xf3\\u0feaarpoon\\xf3\\u0551ightarrows;\\u61c9quigarro\\xf7\\u30cbhreetimes;\\u62ccg;\\u42daingdotse\\xf1\\u1f32\\u0180ahm\\u320d\\u3210\\u3213r\\xf2\\u0feaa\\xf2\\u0551;\\u600foust\\u0100;a\\u321e\\u321f\\u63b1che\\xbb\\u321fmid;\\u6aee\\u0200abpt\\u3232\\u323d\\u3240\\u3252\\u0100nr\\u3237\\u323ag;\\u67edr;\\u61fer\\xeb\\u1003\\u0180afl\\u3247\\u324a\\u324er;\\u6986;\\uc000\\ud835\\udd63us;\\u6a2eimes;\\u6a35\\u0100ap\\u325d\\u3267r\\u0100;g\\u3263\\u3264\\u4029t;\\u6994olint;\\u6a12ar\\xf2\\u31e3\\u0200achq\\u327b\\u3280\\u10bc\\u3285quo;\\u603ar;\\uc000\\ud835\\udcc7\\u0100bu\\u30fb\\u328ao\\u0100;r\\u0214\\u0213\\u0180hir\\u3297\\u329b\\u32a0re\\xe5\\u31f8mes;\\u62cai\\u0200;efl\\u32aa\\u1059\\u1821\\u32ab\\u65b9tri;\\u69celuhar;\\u6968;\\u611e\\u0d61\\u32d5\\u32db\\u32df\\u332c\\u3338\\u3371\\0\\u337a\\u33a4\\0\\0\\u33ec\\u33f0\\0\\u3428\\u3448\\u345a\\u34ad\\u34b1\\u34ca\\u34f1\\0\\u3616\\0\\0\\u3633cute;\\u415bqu\\xef\\u27ba\\u0500;Eaceinpsy\\u11ed\\u32f3\\u32f5\\u32ff\\u3302\\u330b\\u330f\\u331f\\u3326\\u3329;\\u6ab4\\u01f0\\u32fa\\0\\u32fc;\\u6ab8on;\\u4161u\\xe5\\u11fe\\u0100;d\\u11f3\\u3307il;\\u415frc;\\u415d\\u0180Eas\\u3316\\u3318\\u331b;\\u6ab6p;\\u6abaim;\\u62e9olint;\\u6a13i\\xed\\u1204;\\u4441ot\\u0180;be\\u3334\\u1d47\\u3335\\u62c5;\\u6a66\\u0380Aacmstx\\u3346\\u334a\\u3357\\u335b\\u335e\\u3363\\u336drr;\\u61d8r\\u0100hr\\u3350\\u3352\\xeb\\u2228\\u0100;o\\u0a36\\u0a34t\\u803b\\xa7\\u40a7i;\\u403bwar;\\u6929m\\u0100in\\u3369\\xf0nu\\xf3\\xf1t;\\u6736r\\u0100;o\\u3376\\u2055\\uc000\\ud835\\udd30\\u0200acoy\\u3382\\u3386\\u3391\\u33a0rp;\\u666f\\u0100hy\\u338b\\u338fcy;\\u4449;\\u4448rt\\u026d\\u3399\\0\\0\\u339ci\\xe4\\u1464ara\\xec\\u2e6f\\u803b\\xad\\u40ad\\u0100gm\\u33a8\\u33b4ma\\u0180;fv\\u33b1\\u33b2\\u33b2\\u43c3;\\u43c2\\u0400;deglnpr\\u12ab\\u33c5\\u33c9\\u33ce\\u33d6\\u33de\\u33e1\\u33e6ot;\\u6a6a\\u0100;q\\u12b1\\u12b0\\u0100;E\\u33d3\\u33d4\\u6a9e;\\u6aa0\\u0100;E\\u33db\\u33dc\\u6a9d;\\u6a9fe;\\u6246lus;\\u6a24arr;\\u6972ar\\xf2\\u113d\\u0200aeit\\u33f8\\u3408\\u340f\\u3417\\u0100ls\\u33fd\\u3404lsetm\\xe9\\u336ahp;\\u6a33parsl;\\u69e4\\u0100dl\\u1463\\u3414e;\\u6323\\u0100;e\\u341c\\u341d\\u6aaa\\u0100;s\\u3422\\u3423\\u6aac;\\uc000\\u2aac\\ufe00\\u0180flp\\u342e\\u3433\\u3442tcy;\\u444c\\u0100;b\\u3438\\u3439\\u402f\\u0100;a\\u343e\\u343f\\u69c4r;\\u633ff;\\uc000\\ud835\\udd64a\\u0100dr\\u344d\\u0402es\\u0100;u\\u3454\\u3455\\u6660it\\xbb\\u3455\\u0180csu\\u3460\\u3479\\u349f\\u0100au\\u3465\\u346fp\\u0100;s\\u1188\\u346b;\\uc000\\u2293\\ufe00p\\u0100;s\\u11b4\\u3475;\\uc000\\u2294\\ufe00u\\u0100bp\\u347f\\u348f\\u0180;es\\u1197\\u119c\\u3486et\\u0100;e\\u1197\\u348d\\xf1\\u119d\\u0180;es\\u11a8\\u11ad\\u3496et\\u0100;e\\u11a8\\u349d\\xf1\\u11ae\\u0180;af\\u117b\\u34a6\\u05b0r\\u0165\\u34ab\\u05b1\\xbb\\u117car\\xf2\\u1148\\u0200cemt\\u34b9\\u34be\\u34c2\\u34c5r;\\uc000\\ud835\\udcc8tm\\xee\\xf1i\\xec\\u3415ar\\xe6\\u11be\\u0100ar\\u34ce\\u34d5r\\u0100;f\\u34d4\\u17bf\\u6606\\u0100an\\u34da\\u34edight\\u0100ep\\u34e3\\u34eapsilo\\xee\\u1ee0h\\xe9\\u2eafs\\xbb\\u2852\\u0280bcmnp\\u34fb\\u355e\\u1209\\u358b\\u358e\\u0480;Edemnprs\\u350e\\u350f\\u3511\\u3515\\u351e\\u3523\\u352c\\u3531\\u3536\\u6282;\\u6ac5ot;\\u6abd\\u0100;d\\u11da\\u351aot;\\u6ac3ult;\\u6ac1\\u0100Ee\\u3528\\u352a;\\u6acb;\\u628alus;\\u6abfarr;\\u6979\\u0180eiu\\u353d\\u3552\\u3555t\\u0180;en\\u350e\\u3545\\u354bq\\u0100;q\\u11da\\u350feq\\u0100;q\\u352b\\u3528m;\\u6ac7\\u0100bp\\u355a\\u355c;\\u6ad5;\\u6ad3c\\u0300;acens\\u11ed\\u356c\\u3572\\u3579\\u357b\\u3326ppro\\xf8\\u32faurlye\\xf1\\u11fe\\xf1\\u11f3\\u0180aes\\u3582\\u3588\\u331bppro\\xf8\\u331aq\\xf1\\u3317g;\\u666a\\u0680123;Edehlmnps\\u35a9\\u35ac\\u35af\\u121c\\u35b2\\u35b4\\u35c0\\u35c9\\u35d5\\u35da\\u35df\\u35e8\\u35ed\\u803b\\xb9\\u40b9\\u803b\\xb2\\u40b2\\u803b\\xb3\\u40b3;\\u6ac6\\u0100os\\u35b9\\u35bct;\\u6abeub;\\u6ad8\\u0100;d\\u1222\\u35c5ot;\\u6ac4s\\u0100ou\\u35cf\\u35d2l;\\u67c9b;\\u6ad7arr;\\u697bult;\\u6ac2\\u0100Ee\\u35e4\\u35e6;\\u6acc;\\u628blus;\\u6ac0\\u0180eiu\\u35f4\\u3609\\u360ct\\u0180;en\\u121c\\u35fc\\u3602q\\u0100;q\\u1222\\u35b2eq\\u0100;q\\u35e7\\u35e4m;\\u6ac8\\u0100bp\\u3611\\u3613;\\u6ad4;\\u6ad6\\u0180Aan\\u361c\\u3620\\u362drr;\\u61d9r\\u0100hr\\u3626\\u3628\\xeb\\u222e\\u0100;o\\u0a2b\\u0a29war;\\u692alig\\u803b\\xdf\\u40df\\u0be1\\u3651\\u365d\\u3660\\u12ce\\u3673\\u3679\\0\\u367e\\u36c2\\0\\0\\0\\0\\0\\u36db\\u3703\\0\\u3709\\u376c\\0\\0\\0\\u3787\\u0272\\u3656\\0\\0\\u365bget;\\u6316;\\u43c4r\\xeb\\u0e5f\\u0180aey\\u3666\\u366b\\u3670ron;\\u4165dil;\\u4163;\\u4442lrec;\\u6315r;\\uc000\\ud835\\udd31\\u0200eiko\\u3686\\u369d\\u36b5\\u36bc\\u01f2\\u368b\\0\\u3691e\\u01004f\\u1284\\u1281a\\u0180;sv\\u3698\\u3699\\u369b\\u43b8ym;\\u43d1\\u0100cn\\u36a2\\u36b2k\\u0100as\\u36a8\\u36aeppro\\xf8\\u12c1im\\xbb\\u12acs\\xf0\\u129e\\u0100as\\u36ba\\u36ae\\xf0\\u12c1rn\\u803b\\xfe\\u40fe\\u01ec\\u031f\\u36c6\\u22e7es\\u8180\\xd7;bd\\u36cf\\u36d0\\u36d8\\u40d7\\u0100;a\\u190f\\u36d5r;\\u6a31;\\u6a30\\u0180eps\\u36e1\\u36e3\\u3700\\xe1\\u2a4d\\u0200;bcf\\u0486\\u36ec\\u36f0\\u36f4ot;\\u6336ir;\\u6af1\\u0100;o\\u36f9\\u36fc\\uc000\\ud835\\udd65rk;\\u6ada\\xe1\\u3362rime;\\u6034\\u0180aip\\u370f\\u3712\\u3764d\\xe5\\u1248\\u0380adempst\\u3721\\u374d\\u3740\\u3751\\u3757\\u375c\\u375fngle\\u0280;dlqr\\u3730\\u3731\\u3736\\u3740\\u3742\\u65b5own\\xbb\\u1dbbeft\\u0100;e\\u2800\\u373e\\xf1\\u092e;\\u625cight\\u0100;e\\u32aa\\u374b\\xf1\\u105aot;\\u65ecinus;\\u6a3alus;\\u6a39b;\\u69cdime;\\u6a3bezium;\\u63e2\\u0180cht\\u3772\\u377d\\u3781\\u0100ry\\u3777\\u377b;\\uc000\\ud835\\udcc9;\\u4446cy;\\u445brok;\\u4167\\u0100io\\u378b\\u378ex\\xf4\\u1777head\\u0100lr\\u3797\\u37a0eftarro\\xf7\\u084fightarrow\\xbb\\u0f5d\\u0900AHabcdfghlmoprstuw\\u37d0\\u37d3\\u37d7\\u37e4\\u37f0\\u37fc\\u380e\\u381c\\u3823\\u3834\\u3851\\u385d\\u386b\\u38a9\\u38cc\\u38d2\\u38ea\\u38f6r\\xf2\\u03edar;\\u6963\\u0100cr\\u37dc\\u37e2ute\\u803b\\xfa\\u40fa\\xf2\\u1150r\\u01e3\\u37ea\\0\\u37edy;\\u445eve;\\u416d\\u0100iy\\u37f5\\u37farc\\u803b\\xfb\\u40fb;\\u4443\\u0180abh\\u3803\\u3806\\u380br\\xf2\\u13adlac;\\u4171a\\xf2\\u13c3\\u0100ir\\u3813\\u3818sht;\\u697e;\\uc000\\ud835\\udd32rave\\u803b\\xf9\\u40f9\\u0161\\u3827\\u3831r\\u0100lr\\u382c\\u382e\\xbb\\u0957\\xbb\\u1083lk;\\u6580\\u0100ct\\u3839\\u384d\\u026f\\u383f\\0\\0\\u384arn\\u0100;e\\u3845\\u3846\\u631cr\\xbb\\u3846op;\\u630fri;\\u65f8\\u0100al\\u3856\\u385acr;\\u416b\\u80bb\\xa8\\u0349\\u0100gp\\u3862\\u3866on;\\u4173f;\\uc000\\ud835\\udd66\\u0300adhlsu\\u114b\\u3878\\u387d\\u1372\\u3891\\u38a0own\\xe1\\u13b3arpoon\\u0100lr\\u3888\\u388cef\\xf4\\u382digh\\xf4\\u382fi\\u0180;hl\\u3899\\u389a\\u389c\\u43c5\\xbb\\u13faon\\xbb\\u389aparrows;\\u61c8\\u0180cit\\u38b0\\u38c4\\u38c8\\u026f\\u38b6\\0\\0\\u38c1rn\\u0100;e\\u38bc\\u38bd\\u631dr\\xbb\\u38bdop;\\u630eng;\\u416fri;\\u65f9cr;\\uc000\\ud835\\udcca\\u0180dir\\u38d9\\u38dd\\u38e2ot;\\u62f0lde;\\u4169i\\u0100;f\\u3730\\u38e8\\xbb\\u1813\\u0100am\\u38ef\\u38f2r\\xf2\\u38a8l\\u803b\\xfc\\u40fcangle;\\u69a7\\u0780ABDacdeflnoprsz\\u391c\\u391f\\u3929\\u392d\\u39b5\\u39b8\\u39bd\\u39df\\u39e4\\u39e8\\u39f3\\u39f9\\u39fd\\u3a01\\u3a20r\\xf2\\u03f7ar\\u0100;v\\u3926\\u3927\\u6ae8;\\u6ae9as\\xe8\\u03e1\\u0100nr\\u3932\\u3937grt;\\u699c\\u0380eknprst\\u34e3\\u3946\\u394b\\u3952\\u395d\\u3964\\u3996app\\xe1\\u2415othin\\xe7\\u1e96\\u0180hir\\u34eb\\u2ec8\\u3959op\\xf4\\u2fb5\\u0100;h\\u13b7\\u3962\\xef\\u318d\\u0100iu\\u3969\\u396dgm\\xe1\\u33b3\\u0100bp\\u3972\\u3984setneq\\u0100;q\\u397d\\u3980\\uc000\\u228a\\ufe00;\\uc000\\u2acb\\ufe00setneq\\u0100;q\\u398f\\u3992\\uc000\\u228b\\ufe00;\\uc000\\u2acc\\ufe00\\u0100hr\\u399b\\u399fet\\xe1\\u369ciangle\\u0100lr\\u39aa\\u39afeft\\xbb\\u0925ight\\xbb\\u1051y;\\u4432ash\\xbb\\u1036\\u0180elr\\u39c4\\u39d2\\u39d7\\u0180;be\\u2dea\\u39cb\\u39cfar;\\u62bbq;\\u625alip;\\u62ee\\u0100bt\\u39dc\\u1468a\\xf2\\u1469r;\\uc000\\ud835\\udd33tr\\xe9\\u39aesu\\u0100bp\\u39ef\\u39f1\\xbb\\u0d1c\\xbb\\u0d59pf;\\uc000\\ud835\\udd67ro\\xf0\\u0efbtr\\xe9\\u39b4\\u0100cu\\u3a06\\u3a0br;\\uc000\\ud835\\udccb\\u0100bp\\u3a10\\u3a18n\\u0100Ee\\u3980\\u3a16\\xbb\\u397en\\u0100Ee\\u3992\\u3a1e\\xbb\\u3990igzag;\\u699a\\u0380cefoprs\\u3a36\\u3a3b\\u3a56\\u3a5b\\u3a54\\u3a61\\u3a6airc;\\u4175\\u0100di\\u3a40\\u3a51\\u0100bg\\u3a45\\u3a49ar;\\u6a5fe\\u0100;q\\u15fa\\u3a4f;\\u6259erp;\\u6118r;\\uc000\\ud835\\udd34pf;\\uc000\\ud835\\udd68\\u0100;e\\u1479\\u3a66at\\xe8\\u1479cr;\\uc000\\ud835\\udccc\\u0ae3\\u178e\\u3a87\\0\\u3a8b\\0\\u3a90\\u3a9b\\0\\0\\u3a9d\\u3aa8\\u3aab\\u3aaf\\0\\0\\u3ac3\\u3ace\\0\\u3ad8\\u17dc\\u17dftr\\xe9\\u17d1r;\\uc000\\ud835\\udd35\\u0100Aa\\u3a94\\u3a97r\\xf2\\u03c3r\\xf2\\u09f6;\\u43be\\u0100Aa\\u3aa1\\u3aa4r\\xf2\\u03b8r\\xf2\\u09eba\\xf0\\u2713is;\\u62fb\\u0180dpt\\u17a4\\u3ab5\\u3abe\\u0100fl\\u3aba\\u17a9;\\uc000\\ud835\\udd69im\\xe5\\u17b2\\u0100Aa\\u3ac7\\u3acar\\xf2\\u03cer\\xf2\\u0a01\\u0100cq\\u3ad2\\u17b8r;\\uc000\\ud835\\udccd\\u0100pt\\u17d6\\u3adcr\\xe9\\u17d4\\u0400acefiosu\\u3af0\\u3afd\\u3b08\\u3b0c\\u3b11\\u3b15\\u3b1b\\u3b21c\\u0100uy\\u3af6\\u3afbte\\u803b\\xfd\\u40fd;\\u444f\\u0100iy\\u3b02\\u3b06rc;\\u4177;\\u444bn\\u803b\\xa5\\u40a5r;\\uc000\\ud835\\udd36cy;\\u4457pf;\\uc000\\ud835\\udd6acr;\\uc000\\ud835\\udcce\\u0100cm\\u3b26\\u3b29y;\\u444el\\u803b\\xff\\u40ff\\u0500acdefhiosw\\u3b42\\u3b48\\u3b54\\u3b58\\u3b64\\u3b69\\u3b6d\\u3b74\\u3b7a\\u3b80cute;\\u417a\\u0100ay\\u3b4d\\u3b52ron;\\u417e;\\u4437ot;\\u417c\\u0100et\\u3b5d\\u3b61tr\\xe6\\u155fa;\\u43b6r;\\uc000\\ud835\\udd37cy;\\u4436grarr;\\u61ddpf;\\uc000\\ud835\\udd6bcr;\\uc000\\ud835\\udccf\\u0100jn\\u3b85\\u3b87;\\u600dj;\\u600c'.split(\"\").map(c => c.charCodeAt(0)));\n // Generated using scripts/write-decode-map.ts\n var xmlDecodeTree = new Uint16Array(\n // prettier-ignore\n \"\\u0200aglq\\t\\x15\\x18\\x1b\\u026d\\x0f\\0\\0\\x12p;\\u4026os;\\u4027t;\\u403et;\\u403cuot;\\u4022\".split(\"\").map(c => c.charCodeAt(0)));\n // Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134\n var _a;\n const decodeMap = new Map([ [ 0, 65533 ],\n // C1 Unicode control character reference replacements\n [ 128, 8364 ], [ 130, 8218 ], [ 131, 402 ], [ 132, 8222 ], [ 133, 8230 ], [ 134, 8224 ], [ 135, 8225 ], [ 136, 710 ], [ 137, 8240 ], [ 138, 352 ], [ 139, 8249 ], [ 140, 338 ], [ 142, 381 ], [ 145, 8216 ], [ 146, 8217 ], [ 147, 8220 ], [ 148, 8221 ], [ 149, 8226 ], [ 150, 8211 ], [ 151, 8212 ], [ 152, 732 ], [ 153, 8482 ], [ 154, 353 ], [ 155, 8250 ], [ 156, 339 ], [ 158, 382 ], [ 159, 376 ] ]);\n /**\n * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.\n */ const fromCodePoint$1 =\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins\n (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function(codePoint) {\n let output = \"\";\n if (codePoint > 65535) {\n codePoint -= 65536;\n output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);\n codePoint = 56320 | codePoint & 1023;\n }\n output += String.fromCharCode(codePoint);\n return output;\n };\n /**\n * Replace the given code point with a replacement character if it is a\n * surrogate or is outside the valid range. Otherwise return the code\n * point unchanged.\n */ function replaceCodePoint(codePoint) {\n var _a;\n if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {\n return 65533;\n }\n return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;\n }\n var CharCodes;\n (function(CharCodes) {\n CharCodes[CharCodes[\"NUM\"] = 35] = \"NUM\";\n CharCodes[CharCodes[\"SEMI\"] = 59] = \"SEMI\";\n CharCodes[CharCodes[\"EQUALS\"] = 61] = \"EQUALS\";\n CharCodes[CharCodes[\"ZERO\"] = 48] = \"ZERO\";\n CharCodes[CharCodes[\"NINE\"] = 57] = \"NINE\";\n CharCodes[CharCodes[\"LOWER_A\"] = 97] = \"LOWER_A\";\n CharCodes[CharCodes[\"LOWER_F\"] = 102] = \"LOWER_F\";\n CharCodes[CharCodes[\"LOWER_X\"] = 120] = \"LOWER_X\";\n CharCodes[CharCodes[\"LOWER_Z\"] = 122] = \"LOWER_Z\";\n CharCodes[CharCodes[\"UPPER_A\"] = 65] = \"UPPER_A\";\n CharCodes[CharCodes[\"UPPER_F\"] = 70] = \"UPPER_F\";\n CharCodes[CharCodes[\"UPPER_Z\"] = 90] = \"UPPER_Z\";\n })(CharCodes || (CharCodes = {}));\n /** Bit that needs to be set to convert an upper case ASCII character to lower case */ const TO_LOWER_BIT = 32;\n var BinTrieFlags;\n (function(BinTrieFlags) {\n BinTrieFlags[BinTrieFlags[\"VALUE_LENGTH\"] = 49152] = \"VALUE_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"BRANCH_LENGTH\"] = 16256] = \"BRANCH_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"JUMP_TABLE\"] = 127] = \"JUMP_TABLE\";\n })(BinTrieFlags || (BinTrieFlags = {}));\n function isNumber(code) {\n return code >= CharCodes.ZERO && code <= CharCodes.NINE;\n }\n function isHexadecimalCharacter(code) {\n return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F;\n }\n function isAsciiAlphaNumeric(code) {\n return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code);\n }\n /**\n * Checks if the given character is a valid end character for an entity in an attribute.\n *\n * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.\n * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state\n */ function isEntityInAttributeInvalidEnd(code) {\n return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);\n }\n var EntityDecoderState;\n (function(EntityDecoderState) {\n EntityDecoderState[EntityDecoderState[\"EntityStart\"] = 0] = \"EntityStart\";\n EntityDecoderState[EntityDecoderState[\"NumericStart\"] = 1] = \"NumericStart\";\n EntityDecoderState[EntityDecoderState[\"NumericDecimal\"] = 2] = \"NumericDecimal\";\n EntityDecoderState[EntityDecoderState[\"NumericHex\"] = 3] = \"NumericHex\";\n EntityDecoderState[EntityDecoderState[\"NamedEntity\"] = 4] = \"NamedEntity\";\n })(EntityDecoderState || (EntityDecoderState = {}));\n var DecodingMode;\n (function(DecodingMode) {\n /** Entities in text nodes that can end with any character. */\n DecodingMode[DecodingMode[\"Legacy\"] = 0] = \"Legacy\";\n /** Only allow entities terminated with a semicolon. */ DecodingMode[DecodingMode[\"Strict\"] = 1] = \"Strict\";\n /** Entities in attributes have limitations on ending characters. */ DecodingMode[DecodingMode[\"Attribute\"] = 2] = \"Attribute\";\n })(DecodingMode || (DecodingMode = {}));\n /**\n * Token decoder with support of writing partial entities.\n */ class EntityDecoder {\n constructor(/** The tree used to decode entities. */\n decodeTree,\n /**\n * The function that is called when a codepoint is decoded.\n *\n * For multi-byte named entities, this will be called multiple times,\n * with the second codepoint, and the same `consumed` value.\n *\n * @param codepoint The decoded codepoint.\n * @param consumed The number of bytes consumed by the decoder.\n */\n emitCodePoint, /** An object that is used to produce errors. */\n errors) {\n this.decodeTree = decodeTree;\n this.emitCodePoint = emitCodePoint;\n this.errors = errors;\n /** The current state of the decoder. */ this.state = EntityDecoderState.EntityStart;\n /** Characters that were consumed while parsing an entity. */ this.consumed = 1;\n /**\n * The result of the entity.\n *\n * Either the result index of a numeric entity, or the codepoint of a\n * numeric entity.\n */ this.result = 0;\n /** The current index in the decode tree. */ this.treeIndex = 0;\n /** The number of characters that were consumed in excess. */ this.excess = 1;\n /** The mode in which the decoder is operating. */ this.decodeMode = DecodingMode.Strict;\n }\n /** Resets the instance to make it reusable. */ startEntity(decodeMode) {\n this.decodeMode = decodeMode;\n this.state = EntityDecoderState.EntityStart;\n this.result = 0;\n this.treeIndex = 0;\n this.excess = 1;\n this.consumed = 1;\n }\n /**\n * Write an entity to the decoder. This can be called multiple times with partial entities.\n * If the entity is incomplete, the decoder will return -1.\n *\n * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the\n * entity is incomplete, and resume when the next string is written.\n *\n * @param string The string containing the entity (or a continuation of the entity).\n * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */ write(str, offset) {\n switch (this.state) {\n case EntityDecoderState.EntityStart:\n {\n if (str.charCodeAt(offset) === CharCodes.NUM) {\n this.state = EntityDecoderState.NumericStart;\n this.consumed += 1;\n return this.stateNumericStart(str, offset + 1);\n }\n this.state = EntityDecoderState.NamedEntity;\n return this.stateNamedEntity(str, offset);\n }\n\n case EntityDecoderState.NumericStart:\n {\n return this.stateNumericStart(str, offset);\n }\n\n case EntityDecoderState.NumericDecimal:\n {\n return this.stateNumericDecimal(str, offset);\n }\n\n case EntityDecoderState.NumericHex:\n {\n return this.stateNumericHex(str, offset);\n }\n\n case EntityDecoderState.NamedEntity:\n {\n return this.stateNamedEntity(str, offset);\n }\n }\n }\n /**\n * Switches between the numeric decimal and hexadecimal states.\n *\n * Equivalent to the `Numeric character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */ stateNumericStart(str, offset) {\n if (offset >= str.length) {\n return -1;\n }\n if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {\n this.state = EntityDecoderState.NumericHex;\n this.consumed += 1;\n return this.stateNumericHex(str, offset + 1);\n }\n this.state = EntityDecoderState.NumericDecimal;\n return this.stateNumericDecimal(str, offset);\n }\n addToNumericResult(str, start, end, base) {\n if (start !== end) {\n const digitCount = end - start;\n this.result = this.result * Math.pow(base, digitCount) + parseInt(str.substr(start, digitCount), base);\n this.consumed += digitCount;\n }\n }\n /**\n * Parses a hexadecimal numeric entity.\n *\n * Equivalent to the `Hexademical character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */ stateNumericHex(str, offset) {\n const startIdx = offset;\n while (offset < str.length) {\n const char = str.charCodeAt(offset);\n if (isNumber(char) || isHexadecimalCharacter(char)) {\n offset += 1;\n } else {\n this.addToNumericResult(str, startIdx, offset, 16);\n return this.emitNumericEntity(char, 3);\n }\n }\n this.addToNumericResult(str, startIdx, offset, 16);\n return -1;\n }\n /**\n * Parses a decimal numeric entity.\n *\n * Equivalent to the `Decimal character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */ stateNumericDecimal(str, offset) {\n const startIdx = offset;\n while (offset < str.length) {\n const char = str.charCodeAt(offset);\n if (isNumber(char)) {\n offset += 1;\n } else {\n this.addToNumericResult(str, startIdx, offset, 10);\n return this.emitNumericEntity(char, 2);\n }\n }\n this.addToNumericResult(str, startIdx, offset, 10);\n return -1;\n }\n /**\n * Validate and emit a numeric entity.\n *\n * Implements the logic from the `Hexademical character reference start\n * state` and `Numeric character reference end state` in the HTML spec.\n *\n * @param lastCp The last code point of the entity. Used to see if the\n * entity was terminated with a semicolon.\n * @param expectedLength The minimum number of characters that should be\n * consumed. Used to validate that at least one digit\n * was consumed.\n * @returns The number of characters that were consumed.\n */ emitNumericEntity(lastCp, expectedLength) {\n var _a;\n // Ensure we consumed at least one digit.\n if (this.consumed <= expectedLength) {\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n // Figure out if this is a legit end of the entity\n if (lastCp === CharCodes.SEMI) {\n this.consumed += 1;\n } else if (this.decodeMode === DecodingMode.Strict) {\n return 0;\n }\n this.emitCodePoint(replaceCodePoint(this.result), this.consumed);\n if (this.errors) {\n if (lastCp !== CharCodes.SEMI) {\n this.errors.missingSemicolonAfterCharacterReference();\n }\n this.errors.validateNumericCharacterReference(this.result);\n }\n return this.consumed;\n }\n /**\n * Parses a named entity.\n *\n * Equivalent to the `Named character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */ stateNamedEntity(str, offset) {\n const {decodeTree: decodeTree} = this;\n let current = decodeTree[this.treeIndex];\n // The mask is the number of bytes of the value, including the current byte.\n let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n for (;offset < str.length; offset++, this.excess++) {\n const char = str.charCodeAt(offset);\n this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);\n if (this.treeIndex < 0) {\n return this.result === 0 ||\n // If we are parsing an attribute\n this.decodeMode === DecodingMode.Attribute && (\n // We shouldn't have consumed any characters after the entity,\n valueLength === 0 ||\n // And there should be no invalid characters.\n isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();\n }\n current = decodeTree[this.treeIndex];\n valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n // If the branch is a value, store it and continue\n if (valueLength !== 0) {\n // If the entity is terminated by a semicolon, we are done.\n if (char === CharCodes.SEMI) {\n return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);\n }\n // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.\n if (this.decodeMode !== DecodingMode.Strict) {\n this.result = this.treeIndex;\n this.consumed += this.excess;\n this.excess = 0;\n }\n }\n }\n return -1;\n }\n /**\n * Emit a named entity that was not terminated with a semicolon.\n *\n * @returns The number of characters consumed.\n */ emitNotTerminatedNamedEntity() {\n var _a;\n const {result: result, decodeTree: decodeTree} = this;\n const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;\n this.emitNamedEntityData(result, valueLength, this.consumed);\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();\n return this.consumed;\n }\n /**\n * Emit a named entity.\n *\n * @param result The index of the entity in the decode tree.\n * @param valueLength The number of bytes in the entity.\n * @param consumed The number of characters consumed.\n *\n * @returns The number of characters consumed.\n */ emitNamedEntityData(result, valueLength, consumed) {\n const {decodeTree: decodeTree} = this;\n this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed);\n if (valueLength === 3) {\n // For multi-byte values, we need to emit the second byte.\n this.emitCodePoint(decodeTree[result + 2], consumed);\n }\n return consumed;\n }\n /**\n * Signal to the parser that the end of the input was reached.\n *\n * Remaining data will be emitted and relevant errors will be produced.\n *\n * @returns The number of characters consumed.\n */ end() {\n var _a;\n switch (this.state) {\n case EntityDecoderState.NamedEntity:\n {\n // Emit a named entity if we have one.\n return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;\n }\n\n // Otherwise, emit a numeric entity if we have one.\n case EntityDecoderState.NumericDecimal:\n {\n return this.emitNumericEntity(0, 2);\n }\n\n case EntityDecoderState.NumericHex:\n {\n return this.emitNumericEntity(0, 3);\n }\n\n case EntityDecoderState.NumericStart:\n {\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n\n case EntityDecoderState.EntityStart:\n {\n // Return 0 if we have no entity.\n return 0;\n }\n }\n }\n }\n /**\n * Creates a function that decodes entities in a string.\n *\n * @param decodeTree The decode tree.\n * @returns A function that decodes entities in a string.\n */ function getDecoder(decodeTree) {\n let ret = \"\";\n const decoder = new EntityDecoder(decodeTree, str => ret += fromCodePoint$1(str));\n return function decodeWithTrie(str, decodeMode) {\n let lastIndex = 0;\n let offset = 0;\n while ((offset = str.indexOf(\"&\", offset)) >= 0) {\n ret += str.slice(lastIndex, offset);\n decoder.startEntity(decodeMode);\n const len = decoder.write(str,\n // Skip the \"&\"\n offset + 1);\n if (len < 0) {\n lastIndex = offset + decoder.end();\n break;\n }\n lastIndex = offset + len;\n // If `len` is 0, skip the current `&` and continue.\n offset = len === 0 ? lastIndex + 1 : lastIndex;\n }\n const result = ret + str.slice(lastIndex);\n // Make sure we don't keep a reference to the final string.\n ret = \"\";\n return result;\n };\n }\n /**\n * Determines the branch of the current node that is taken given the current\n * character. This function is used to traverse the trie.\n *\n * @param decodeTree The trie.\n * @param current The current node.\n * @param nodeIdx The index right after the current node and its value.\n * @param char The current character.\n * @returns The index of the next node, or -1 if no branch is taken.\n */ function determineBranch(decodeTree, current, nodeIdx, char) {\n const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;\n const jumpOffset = current & BinTrieFlags.JUMP_TABLE;\n // Case 1: Single branch encoded in jump offset\n if (branchCount === 0) {\n return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;\n }\n // Case 2: Multiple branches encoded in jump table\n if (jumpOffset) {\n const value = char - jumpOffset;\n return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIdx + value] - 1;\n }\n // Case 3: Multiple branches encoded in dictionary\n // Binary search for the character.\n let lo = nodeIdx;\n let hi = lo + branchCount - 1;\n while (lo <= hi) {\n const mid = lo + hi >>> 1;\n const midVal = decodeTree[mid];\n if (midVal < char) {\n lo = mid + 1;\n } else if (midVal > char) {\n hi = mid - 1;\n } else {\n return decodeTree[mid + branchCount];\n }\n }\n return -1;\n }\n const htmlDecoder = getDecoder(htmlDecodeTree);\n getDecoder(xmlDecodeTree);\n /**\n * Decodes an HTML string.\n *\n * @param str The string to decode.\n * @param mode The decoding mode.\n * @returns The decoded string.\n */ function decodeHTML(str, mode = DecodingMode.Legacy) {\n return htmlDecoder(str, mode);\n }\n // Utilities\n\n function _class$1(obj) {\n return Object.prototype.toString.call(obj);\n }\n function isString$1(obj) {\n return _class$1(obj) === \"[object String]\";\n }\n const _hasOwnProperty = Object.prototype.hasOwnProperty;\n function has(object, key) {\n return _hasOwnProperty.call(object, key);\n }\n // Merge objects\n\n function assign$1(obj /* from1, from2, from3, ... */) {\n const sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n if (!source) {\n return;\n }\n if (typeof source !== \"object\") {\n throw new TypeError(source + \"must be object\");\n }\n Object.keys(source).forEach(function(key) {\n obj[key] = source[key];\n });\n });\n return obj;\n }\n // Remove element from array and put another array at those position.\n // Useful for some operations with tokens\n function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n }\n function isValidEntityCode(c) {\n /* eslint no-bitwise:0 */\n // broken sequence\n if (c >= 55296 && c <= 57343) {\n return false;\n }\n // never used\n if (c >= 64976 && c <= 65007) {\n return false;\n }\n if ((c & 65535) === 65535 || (c & 65535) === 65534) {\n return false;\n }\n // control codes\n if (c >= 0 && c <= 8) {\n return false;\n }\n if (c === 11) {\n return false;\n }\n if (c >= 14 && c <= 31) {\n return false;\n }\n if (c >= 127 && c <= 159) {\n return false;\n }\n // out of range\n if (c > 1114111) {\n return false;\n }\n return true;\n }\n function fromCodePoint(c) {\n /* eslint no-bitwise:0 */\n if (c > 65535) {\n c -= 65536;\n const surrogate1 = 55296 + (c >> 10);\n const surrogate2 = 56320 + (c & 1023);\n return String.fromCharCode(surrogate1, surrogate2);\n }\n return String.fromCharCode(c);\n }\n const UNESCAPE_MD_RE = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_`{|}~])/g;\n const ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;\n const UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + \"|\" + ENTITY_RE.source, \"gi\");\n const DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;\n function replaceEntityPattern(match, name) {\n if (name.charCodeAt(0) === 35 /* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {\n const code = name[1].toLowerCase() === \"x\" ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10);\n if (isValidEntityCode(code)) {\n return fromCodePoint(code);\n }\n return match;\n }\n const decoded = decodeHTML(match);\n if (decoded !== match) {\n return decoded;\n }\n return match;\n }\n /* function replaceEntities(str) {\n if (str.indexOf('&') < 0) { return str; }\n\n return str.replace(ENTITY_RE, replaceEntityPattern);\n } */ function unescapeMd(str) {\n if (str.indexOf(\"\\\\\") < 0) {\n return str;\n }\n return str.replace(UNESCAPE_MD_RE, \"$1\");\n }\n function unescapeAll(str) {\n if (str.indexOf(\"\\\\\") < 0 && str.indexOf(\"&\") < 0) {\n return str;\n }\n return str.replace(UNESCAPE_ALL_RE, function(match, escaped, entity) {\n if (escaped) {\n return escaped;\n }\n return replaceEntityPattern(match, entity);\n });\n }\n const HTML_ESCAPE_TEST_RE = /[&<>\"]/;\n const HTML_ESCAPE_REPLACE_RE = /[&<>\"]/g;\n const HTML_REPLACEMENTS = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\"\n };\n function replaceUnsafeChar(ch) {\n return HTML_REPLACEMENTS[ch];\n }\n function escapeHtml(str) {\n if (HTML_ESCAPE_TEST_RE.test(str)) {\n return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);\n }\n return str;\n }\n const REGEXP_ESCAPE_RE = /[.?*+^$[\\]\\\\(){}|-]/g;\n function escapeRE$1(str) {\n return str.replace(REGEXP_ESCAPE_RE, \"\\\\$&\");\n }\n function isSpace(code) {\n switch (code) {\n case 9:\n case 32:\n return true;\n }\n return false;\n }\n // Zs (unicode class) || [\\t\\f\\v\\r\\n]\n function isWhiteSpace(code) {\n if (code >= 8192 && code <= 8202) {\n return true;\n }\n switch (code) {\n case 9:\n // \\t\n case 10:\n // \\n\n case 11:\n // \\v\n case 12:\n // \\f\n case 13:\n // \\r\n case 32:\n case 160:\n case 5760:\n case 8239:\n case 8287:\n case 12288:\n return true;\n }\n return false;\n }\n /* eslint-disable max-len */\n // Currently without astral characters support.\n function isPunctChar(ch) {\n return P.test(ch) || regex.test(ch);\n }\n // Markdown ASCII punctuation characters.\n\n // !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n // http://spec.commonmark.org/0.15/#ascii-punctuation-character\n\n // Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.\n\n function isMdAsciiPunct(ch) {\n switch (ch) {\n case 33 /* ! */ :\n case 34 /* \" */ :\n case 35 /* # */ :\n case 36 /* $ */ :\n case 37 /* % */ :\n case 38 /* & */ :\n case 39 /* ' */ :\n case 40 /* ( */ :\n case 41 /* ) */ :\n case 42 /* * */ :\n case 43 /* + */ :\n case 44 /* , */ :\n case 45 /* - */ :\n case 46 /* . */ :\n case 47 /* / */ :\n case 58 /* : */ :\n case 59 /* ; */ :\n case 60 /* < */ :\n case 61 /* = */ :\n case 62 /* > */ :\n case 63 /* ? */ :\n case 64 /* @ */ :\n case 91 /* [ */ :\n case 92 /* \\ */ :\n case 93 /* ] */ :\n case 94 /* ^ */ :\n case 95 /* _ */ :\n case 96 /* ` */ :\n case 123 /* { */ :\n case 124 /* | */ :\n case 125 /* } */ :\n case 126 /* ~ */ :\n return true;\n\n default:\n return false;\n }\n }\n // Hepler to unify [reference labels].\n\n function normalizeReference(str) {\n // Trim and collapse whitespace\n str = str.trim().replace(/\\s+/g, \" \");\n // In node v10 '\u1E9E'.toLowerCase() === '\u1E7E', which is presumed to be a bug\n // fixed in v12 (couldn't find any details).\n\n // So treat this one as a special case\n // (remove this when node v10 is no longer supported).\n\n if (\"\\u1e9e\".toLowerCase() === \"\\u1e7e\") {\n str = str.replace(/\\u1e9e/g, \"\\xdf\");\n }\n // .toLowerCase().toUpperCase() should get rid of all differences\n // between letter variants.\n\n // Simple .toLowerCase() doesn't normalize 125 code points correctly,\n // and .toUpperCase doesn't normalize 6 of them (list of exceptions:\n // \u0130, \u03F4, \u1E9E, \u2126, \u212A, \u212B - those are already uppercased, but have differently\n // uppercased versions).\n\n // Here's an example showing how it happens. Lets take greek letter omega:\n // uppercase U+0398 (\u0398), U+03f4 (\u03F4) and lowercase U+03b8 (\u03B8), U+03d1 (\u03D1)\n\n // Unicode entries:\n // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8;\n // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398\n // 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398\n // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8;\n\n // Case-insensitive comparison should treat all of them as equivalent.\n\n // But .toLowerCase() doesn't change \u03D1 (it's already lowercase),\n // and .toUpperCase() doesn't change \u03F4 (already uppercase).\n\n // Applying first lower then upper case normalizes any character:\n // '\\u0398\\u03f4\\u03b8\\u03d1'.toLowerCase().toUpperCase() === '\\u0398\\u0398\\u0398\\u0398'\n\n // Note: this is equivalent to unicode case folding; unicode normalization\n // is a different step that is not required here.\n\n // Final result should be uppercased, because it's later stored in an object\n // (this avoid a conflict with Object.prototype members,\n // most notably, `__proto__`)\n\n return str.toLowerCase().toUpperCase();\n }\n // Re-export libraries commonly used in both markdown-it and its plugins,\n // so plugins won't have to depend on them explicitly, which reduces their\n // bundled size (e.g. a browser build).\n\n const lib = {\n mdurl: mdurl,\n ucmicro: ucmicro\n };\n var utils = Object.freeze({\n __proto__: null,\n arrayReplaceAt: arrayReplaceAt,\n assign: assign$1,\n escapeHtml: escapeHtml,\n escapeRE: escapeRE$1,\n fromCodePoint: fromCodePoint,\n has: has,\n isMdAsciiPunct: isMdAsciiPunct,\n isPunctChar: isPunctChar,\n isSpace: isSpace,\n isString: isString$1,\n isValidEntityCode: isValidEntityCode,\n isWhiteSpace: isWhiteSpace,\n lib: lib,\n normalizeReference: normalizeReference,\n unescapeAll: unescapeAll,\n unescapeMd: unescapeMd\n });\n // Parse link label\n\n // this function assumes that first character (\"[\") already matches;\n // returns the end of the label\n\n function parseLinkLabel(state, start, disableNested) {\n let level, found, marker, prevPos;\n const max = state.posMax;\n const oldPos = state.pos;\n state.pos = start + 1;\n level = 1;\n while (state.pos < max) {\n marker = state.src.charCodeAt(state.pos);\n if (marker === 93 /* ] */) {\n level--;\n if (level === 0) {\n found = true;\n break;\n }\n }\n prevPos = state.pos;\n state.md.inline.skipToken(state);\n if (marker === 91 /* [ */) {\n if (prevPos === state.pos - 1) {\n // increase level if we find text `[`, which is not a part of any token\n level++;\n } else if (disableNested) {\n state.pos = oldPos;\n return -1;\n }\n }\n }\n let labelEnd = -1;\n if (found) {\n labelEnd = state.pos;\n }\n // restore old state\n state.pos = oldPos;\n return labelEnd;\n }\n // Parse link destination\n\n function parseLinkDestination(str, start, max) {\n let code;\n let pos = start;\n const result = {\n ok: false,\n pos: 0,\n str: \"\"\n };\n if (str.charCodeAt(pos) === 60 /* < */) {\n pos++;\n while (pos < max) {\n code = str.charCodeAt(pos);\n if (code === 10 /* \\n */) {\n return result;\n }\n if (code === 60 /* < */) {\n return result;\n }\n if (code === 62 /* > */) {\n result.pos = pos + 1;\n result.str = unescapeAll(str.slice(start + 1, pos));\n result.ok = true;\n return result;\n }\n if (code === 92 /* \\ */ && pos + 1 < max) {\n pos += 2;\n continue;\n }\n pos++;\n }\n // no closing '>'\n return result;\n }\n // this should be ... } else { ... branch\n let level = 0;\n while (pos < max) {\n code = str.charCodeAt(pos);\n if (code === 32) {\n break;\n }\n // ascii control characters\n if (code < 32 || code === 127) {\n break;\n }\n if (code === 92 /* \\ */ && pos + 1 < max) {\n if (str.charCodeAt(pos + 1) === 32) {\n break;\n }\n pos += 2;\n continue;\n }\n if (code === 40 /* ( */) {\n level++;\n if (level > 32) {\n return result;\n }\n }\n if (code === 41 /* ) */) {\n if (level === 0) {\n break;\n }\n level--;\n }\n pos++;\n }\n if (start === pos) {\n return result;\n }\n if (level !== 0) {\n return result;\n }\n result.str = unescapeAll(str.slice(start, pos));\n result.pos = pos;\n result.ok = true;\n return result;\n }\n // Parse link title\n\n // Parse link title within `str` in [start, max] range,\n // or continue previous parsing if `prev_state` is defined (equal to result of last execution).\n\n function parseLinkTitle(str, start, max, prev_state) {\n let code;\n let pos = start;\n const state = {\n // if `true`, this is a valid link title\n ok: false,\n // if `true`, this link can be continued on the next line\n can_continue: false,\n // if `ok`, it's the position of the first character after the closing marker\n pos: 0,\n // if `ok`, it's the unescaped title\n str: \"\",\n // expected closing marker character code\n marker: 0\n };\n if (prev_state) {\n // this is a continuation of a previous parseLinkTitle call on the next line,\n // used in reference links only\n state.str = prev_state.str;\n state.marker = prev_state.marker;\n } else {\n if (pos >= max) {\n return state;\n }\n let marker = str.charCodeAt(pos);\n if (marker !== 34 /* \" */ && marker !== 39 /* ' */ && marker !== 40 /* ( */) {\n return state;\n }\n start++;\n pos++;\n // if opening marker is \"(\", switch it to closing marker \")\"\n if (marker === 40) {\n marker = 41;\n }\n state.marker = marker;\n }\n while (pos < max) {\n code = str.charCodeAt(pos);\n if (code === state.marker) {\n state.pos = pos + 1;\n state.str += unescapeAll(str.slice(start, pos));\n state.ok = true;\n return state;\n } else if (code === 40 /* ( */ && state.marker === 41 /* ) */) {\n return state;\n } else if (code === 92 /* \\ */ && pos + 1 < max) {\n pos++;\n }\n pos++;\n }\n // no closing marker found, but this link title may continue on the next line (for references)\n state.can_continue = true;\n state.str += unescapeAll(str.slice(start, pos));\n return state;\n }\n // Just a shortcut for bulk export\n var helpers = Object.freeze({\n __proto__: null,\n parseLinkDestination: parseLinkDestination,\n parseLinkLabel: parseLinkLabel,\n parseLinkTitle: parseLinkTitle\n });\n /**\n * class Renderer\n *\n * Generates HTML from parsed token stream. Each instance has independent\n * copy of rules. Those can be rewritten with ease. Also, you can add new\n * rules if you create plugin and adds new token types.\n **/ const default_rules = {};\n default_rules.code_inline = function(tokens, idx, options, env, slf) {\n const token = tokens[idx];\n return \"\" + escapeHtml(token.content) + \"\";\n };\n default_rules.code_block = function(tokens, idx, options, env, slf) {\n const token = tokens[idx];\n return \"\" + escapeHtml(tokens[idx].content) + \"\\n\";\n };\n default_rules.fence = function(tokens, idx, options, env, slf) {\n const token = tokens[idx];\n const info = token.info ? unescapeAll(token.info).trim() : \"\";\n let langName = \"\";\n let langAttrs = \"\";\n if (info) {\n const arr = info.split(/(\\s+)/g);\n langName = arr[0];\n langAttrs = arr.slice(2).join(\"\");\n }\n let highlighted;\n if (options.highlight) {\n highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content);\n } else {\n highlighted = escapeHtml(token.content);\n }\n if (highlighted.indexOf(\"${highlighted}\\n`;\n }\n return `
${highlighted}
\\n`;\n };\n default_rules.image = function(tokens, idx, options, env, slf) {\n const token = tokens[idx];\n // \"alt\" attr MUST be set, even if empty. Because it's mandatory and\n // should be placed on proper position for tests.\n\n // Replace content with actual value\n token.attrs[token.attrIndex(\"alt\")][1] = slf.renderInlineAsText(token.children, options, env);\n return slf.renderToken(tokens, idx, options);\n };\n default_rules.hardbreak = function(tokens, idx, options /*, env */) {\n return options.xhtmlOut ? \"
\\n\" : \"
\\n\";\n };\n default_rules.softbreak = function(tokens, idx, options /*, env */) {\n return options.breaks ? options.xhtmlOut ? \"
\\n\" : \"
\\n\" : \"\\n\";\n };\n default_rules.text = function(tokens, idx /*, options, env */) {\n return escapeHtml(tokens[idx].content);\n };\n default_rules.html_block = function(tokens, idx /*, options, env */) {\n return tokens[idx].content;\n };\n default_rules.html_inline = function(tokens, idx /*, options, env */) {\n return tokens[idx].content;\n };\n /**\n * new Renderer()\n *\n * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.\n **/ function Renderer() {\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return ''; };\n * md.renderer.rules.strong_close = function () { return ''; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs)\n * for more details and examples.\n **/\n this.rules = assign$1({}, default_rules);\n }\n /**\n * Renderer.renderAttrs(token) -> String\n *\n * Render token attributes to string.\n **/ Renderer.prototype.renderAttrs = function renderAttrs(token) {\n let i, l, result;\n if (!token.attrs) {\n return \"\";\n }\n result = \"\";\n for (i = 0, l = token.attrs.length; i < l; i++) {\n result += \" \" + escapeHtml(token.attrs[i][0]) + '=\"' + escapeHtml(token.attrs[i][1]) + '\"';\n }\n return result;\n };\n /**\n * Renderer.renderToken(tokens, idx, options) -> String\n * - tokens (Array): list of tokens\n * - idx (Numbed): token index to render\n * - options (Object): params of parser instance\n *\n * Default token renderer. Can be overriden by custom function\n * in [[Renderer#rules]].\n **/ Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {\n const token = tokens[idx];\n let result = \"\";\n // Tight list paragraphs\n if (token.hidden) {\n return \"\";\n }\n // Insert a newline between hidden paragraph and subsequent opening\n // block-level tag.\n\n // For example, here we should insert a newline before blockquote:\n // - a\n // >\n\n if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {\n result += \"\\n\";\n }\n // Add token name, e.g. ``.\n needLf = false;\n }\n }\n }\n }\n result += needLf ? \">\\n\" : \">\";\n return result;\n };\n /**\n * Renderer.renderInline(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * The same as [[Renderer.render]], but for single token of `inline` type.\n **/ Renderer.prototype.renderInline = function(tokens, options, env) {\n let result = \"\";\n const rules = this.rules;\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type;\n if (typeof rules[type] !== \"undefined\") {\n result += rules[type](tokens, i, options, env, this);\n } else {\n result += this.renderToken(tokens, i, options);\n }\n }\n return result;\n };\n /** internal\n * Renderer.renderInlineAsText(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * Special kludge for image `alt` attributes to conform CommonMark spec.\n * Don't try to use it! Spec requires to show `alt` content with stripped markup,\n * instead of simple escaping.\n **/ Renderer.prototype.renderInlineAsText = function(tokens, options, env) {\n let result = \"\";\n for (let i = 0, len = tokens.length; i < len; i++) {\n switch (tokens[i].type) {\n case \"text\":\n result += tokens[i].content;\n break;\n\n case \"image\":\n result += this.renderInlineAsText(tokens[i].children, options, env);\n break;\n\n case \"html_inline\":\n case \"html_block\":\n result += tokens[i].content;\n break;\n\n case \"softbreak\":\n case \"hardbreak\":\n result += \"\\n\";\n break;\n // all other tokens are skipped\n }\n }\n return result;\n };\n /**\n * Renderer.render(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * Takes token stream and generates HTML. Probably, you will never need to call\n * this method directly.\n **/ Renderer.prototype.render = function(tokens, options, env) {\n let result = \"\";\n const rules = this.rules;\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type;\n if (type === \"inline\") {\n result += this.renderInline(tokens[i].children, options, env);\n } else if (typeof rules[type] !== \"undefined\") {\n result += rules[type](tokens, i, options, env, this);\n } else {\n result += this.renderToken(tokens, i, options, env);\n }\n }\n return result;\n };\n /**\n * class Ruler\n *\n * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and\n * [[MarkdownIt#inline]] to manage sequences of functions (rules):\n *\n * - keep rules in defined order\n * - assign the name to each rule\n * - enable/disable rules\n * - add/replace rules\n * - allow assign rules to additional named chains (in the same)\n * - cacheing lists of active rules\n *\n * You will not need use this class directly until write plugins. For simple\n * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and\n * [[MarkdownIt.use]].\n **/\n /**\n * new Ruler()\n **/ function Ruler() {\n // List of added rules. Each element is:\n // {\n // name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ]\n // }\n this.__rules__ = [];\n // Cached rule chains.\n\n // First level - chain name, '' for default.\n // Second level - diginal anchor for fast filtering by charcodes.\n\n this.__cache__ = null;\n }\n // Helper methods, should not be used directly\n // Find rule index by name\n\n Ruler.prototype.__find__ = function(name) {\n for (let i = 0; i < this.__rules__.length; i++) {\n if (this.__rules__[i].name === name) {\n return i;\n }\n }\n return -1;\n };\n // Build rules lookup cache\n\n Ruler.prototype.__compile__ = function() {\n const self = this;\n const chains = [ \"\" ];\n // collect unique names\n self.__rules__.forEach(function(rule) {\n if (!rule.enabled) {\n return;\n }\n rule.alt.forEach(function(altName) {\n if (chains.indexOf(altName) < 0) {\n chains.push(altName);\n }\n });\n });\n self.__cache__ = {};\n chains.forEach(function(chain) {\n self.__cache__[chain] = [];\n self.__rules__.forEach(function(rule) {\n if (!rule.enabled) {\n return;\n }\n if (chain && rule.alt.indexOf(chain) < 0) {\n return;\n }\n self.__cache__[chain].push(rule.fn);\n });\n });\n };\n /**\n * Ruler.at(name, fn [, options])\n * - name (String): rule name to replace.\n * - fn (Function): new rule function.\n * - options (Object): new rule options (not mandatory).\n *\n * Replace rule by name with new function & options. Throws error if name not\n * found.\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * Replace existing typographer replacement rule with new one:\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.core.ruler.at('replacements', function replace(state) {\n * //...\n * });\n * ```\n **/ Ruler.prototype.at = function(name, fn, options) {\n const index = this.__find__(name);\n const opt = options || {};\n if (index === -1) {\n throw new Error(\"Parser rule not found: \" + name);\n }\n this.__rules__[index].fn = fn;\n this.__rules__[index].alt = opt.alt || [];\n this.__cache__ = null;\n };\n /**\n * Ruler.before(beforeName, ruleName, fn [, options])\n * - beforeName (String): new rule will be added before this one.\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Add new rule to chain before one with given name. See also\n * [[Ruler.after]], [[Ruler.push]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/ Ruler.prototype.before = function(beforeName, ruleName, fn, options) {\n const index = this.__find__(beforeName);\n const opt = options || {};\n if (index === -1) {\n throw new Error(\"Parser rule not found: \" + beforeName);\n }\n this.__rules__.splice(index, 0, {\n name: ruleName,\n enabled: true,\n fn: fn,\n alt: opt.alt || []\n });\n this.__cache__ = null;\n };\n /**\n * Ruler.after(afterName, ruleName, fn [, options])\n * - afterName (String): new rule will be added after this one.\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Add new rule to chain after one with given name. See also\n * [[Ruler.before]], [[Ruler.push]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.inline.ruler.after('text', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/ Ruler.prototype.after = function(afterName, ruleName, fn, options) {\n const index = this.__find__(afterName);\n const opt = options || {};\n if (index === -1) {\n throw new Error(\"Parser rule not found: \" + afterName);\n }\n this.__rules__.splice(index + 1, 0, {\n name: ruleName,\n enabled: true,\n fn: fn,\n alt: opt.alt || []\n });\n this.__cache__ = null;\n };\n /**\n * Ruler.push(ruleName, fn [, options])\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Push new rule to the end of chain. See also\n * [[Ruler.before]], [[Ruler.after]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.core.ruler.push('my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/ Ruler.prototype.push = function(ruleName, fn, options) {\n const opt = options || {};\n this.__rules__.push({\n name: ruleName,\n enabled: true,\n fn: fn,\n alt: opt.alt || []\n });\n this.__cache__ = null;\n };\n /**\n * Ruler.enable(list [, ignoreInvalid]) -> Array\n * - list (String|Array): list of rule names to enable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * Returns list of found rule names (if no exception happened).\n *\n * See also [[Ruler.disable]], [[Ruler.enableOnly]].\n **/ Ruler.prototype.enable = function(list, ignoreInvalid) {\n if (!Array.isArray(list)) {\n list = [ list ];\n }\n const result = [];\n // Search by name and enable\n list.forEach(function(name) {\n const idx = this.__find__(name);\n if (idx < 0) {\n if (ignoreInvalid) {\n return;\n }\n throw new Error(\"Rules manager: invalid rule name \" + name);\n }\n this.__rules__[idx].enabled = true;\n result.push(name);\n }, this);\n this.__cache__ = null;\n return result;\n };\n /**\n * Ruler.enableOnly(list [, ignoreInvalid])\n * - list (String|Array): list of rule names to enable (whitelist).\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable rules with given names, and disable everything else. If any rule name\n * not found - throw Error. Errors can be disabled by second param.\n *\n * See also [[Ruler.disable]], [[Ruler.enable]].\n **/ Ruler.prototype.enableOnly = function(list, ignoreInvalid) {\n if (!Array.isArray(list)) {\n list = [ list ];\n }\n this.__rules__.forEach(function(rule) {\n rule.enabled = false;\n });\n this.enable(list, ignoreInvalid);\n };\n /**\n * Ruler.disable(list [, ignoreInvalid]) -> Array\n * - list (String|Array): list of rule names to disable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Disable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * Returns list of found rule names (if no exception happened).\n *\n * See also [[Ruler.enable]], [[Ruler.enableOnly]].\n **/ Ruler.prototype.disable = function(list, ignoreInvalid) {\n if (!Array.isArray(list)) {\n list = [ list ];\n }\n const result = [];\n // Search by name and disable\n list.forEach(function(name) {\n const idx = this.__find__(name);\n if (idx < 0) {\n if (ignoreInvalid) {\n return;\n }\n throw new Error(\"Rules manager: invalid rule name \" + name);\n }\n this.__rules__[idx].enabled = false;\n result.push(name);\n }, this);\n this.__cache__ = null;\n return result;\n };\n /**\n * Ruler.getRules(chainName) -> Array\n *\n * Return array of active functions (rules) for given chain name. It analyzes\n * rules configuration, compiles caches if not exists and returns result.\n *\n * Default chain name is `''` (empty string). It can't be skipped. That's\n * done intentionally, to keep signature monomorphic for high speed.\n **/ Ruler.prototype.getRules = function(chainName) {\n if (this.__cache__ === null) {\n this.__compile__();\n }\n // Chain can be empty, if rules disabled. But we still have to return Array.\n return this.__cache__[chainName] || [];\n };\n // Token class\n /**\n * class Token\n **/\n /**\n * new Token(type, tag, nesting)\n *\n * Create new token and fill passed properties.\n **/ function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/ this.tag = tag;\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/ this.attrs = null;\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/ this.map = null;\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/ this.nesting = nesting;\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/ this.level = 0;\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/ this.children = null;\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/ this.content = \"\";\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/ this.markup = \"\";\n /**\n * Token#info -> String\n *\n * Additional information:\n *\n * - Info string for \"fence\" tokens\n * - The value \"auto\" for autolink \"link_open\" and \"link_close\" tokens\n * - The string value of the item marker for ordered-list \"list_item_open\" tokens\n **/ this.info = \"\";\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/ this.meta = null;\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/ this.block = false;\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/ this.hidden = false;\n }\n /**\n * Token.attrIndex(name) -> Number\n *\n * Search attribute index by name.\n **/ Token.prototype.attrIndex = function attrIndex(name) {\n if (!this.attrs) {\n return -1;\n }\n const attrs = this.attrs;\n for (let i = 0, len = attrs.length; i < len; i++) {\n if (attrs[i][0] === name) {\n return i;\n }\n }\n return -1;\n };\n /**\n * Token.attrPush(attrData)\n *\n * Add `[ name, value ]` attribute to list. Init attrs if necessary\n **/ Token.prototype.attrPush = function attrPush(attrData) {\n if (this.attrs) {\n this.attrs.push(attrData);\n } else {\n this.attrs = [ attrData ];\n }\n };\n /**\n * Token.attrSet(name, value)\n *\n * Set `name` attribute to `value`. Override old value if exists.\n **/ Token.prototype.attrSet = function attrSet(name, value) {\n const idx = this.attrIndex(name);\n const attrData = [ name, value ];\n if (idx < 0) {\n this.attrPush(attrData);\n } else {\n this.attrs[idx] = attrData;\n }\n };\n /**\n * Token.attrGet(name)\n *\n * Get the value of attribute `name`, or null if it does not exist.\n **/ Token.prototype.attrGet = function attrGet(name) {\n const idx = this.attrIndex(name);\n let value = null;\n if (idx >= 0) {\n value = this.attrs[idx][1];\n }\n return value;\n };\n /**\n * Token.attrJoin(name, value)\n *\n * Join value to existing attribute via space. Or create new attribute if not\n * exists. Useful to operate with token classes.\n **/ Token.prototype.attrJoin = function attrJoin(name, value) {\n const idx = this.attrIndex(name);\n if (idx < 0) {\n this.attrPush([ name, value ]);\n } else {\n this.attrs[idx][1] = this.attrs[idx][1] + \" \" + value;\n }\n };\n // Core state object\n\n function StateCore(src, md, env) {\n this.src = src;\n this.env = env;\n this.tokens = [];\n this.inlineMode = false;\n this.md = md;\n // link to parser instance\n }\n // re-export Token class to use in core rules\n StateCore.prototype.Token = Token;\n // Normalize input string\n // https://spec.commonmark.org/0.29/#line-ending\n const NEWLINES_RE = /\\r\\n?|\\n/g;\n const NULL_RE = /\\0/g;\n function normalize(state) {\n let str;\n // Normalize newlines\n str = state.src.replace(NEWLINES_RE, \"\\n\");\n // Replace NULL characters\n str = str.replace(NULL_RE, \"\\ufffd\");\n state.src = str;\n }\n function block(state) {\n let token;\n if (state.inlineMode) {\n token = new state.Token(\"inline\", \"\", 0);\n token.content = state.src;\n token.map = [ 0, 1 ];\n token.children = [];\n state.tokens.push(token);\n } else {\n state.md.block.parse(state.src, state.md, state.env, state.tokens);\n }\n }\n function inline(state) {\n const tokens = state.tokens;\n // Parse inlines\n for (let i = 0, l = tokens.length; i < l; i++) {\n const tok = tokens[i];\n if (tok.type === \"inline\") {\n state.md.inline.parse(tok.content, state.md, state.env, tok.children);\n }\n }\n }\n // Replace link-like texts with link nodes.\n\n // Currently restricted by `md.validateLink()` to http/https/ftp\n\n function isLinkOpen$1(str) {\n return /^\\s]/i.test(str);\n }\n function isLinkClose$1(str) {\n return /^<\\/a\\s*>/i.test(str);\n }\n function linkify$1(state) {\n const blockTokens = state.tokens;\n if (!state.md.options.linkify) {\n return;\n }\n for (let j = 0, l = blockTokens.length; j < l; j++) {\n if (blockTokens[j].type !== \"inline\" || !state.md.linkify.pretest(blockTokens[j].content)) {\n continue;\n }\n let tokens = blockTokens[j].children;\n let htmlLinkLevel = 0;\n // We scan from the end, to keep position when new tags added.\n // Use reversed logic in links start/end match\n for (let i = tokens.length - 1; i >= 0; i--) {\n const currentToken = tokens[i];\n // Skip content of markdown links\n if (currentToken.type === \"link_close\") {\n i--;\n while (tokens[i].level !== currentToken.level && tokens[i].type !== \"link_open\") {\n i--;\n }\n continue;\n }\n // Skip content of html tag links\n if (currentToken.type === \"html_inline\") {\n if (isLinkOpen$1(currentToken.content) && htmlLinkLevel > 0) {\n htmlLinkLevel--;\n }\n if (isLinkClose$1(currentToken.content)) {\n htmlLinkLevel++;\n }\n }\n if (htmlLinkLevel > 0) {\n continue;\n }\n if (currentToken.type === \"text\" && state.md.linkify.test(currentToken.content)) {\n const text = currentToken.content;\n let links = state.md.linkify.match(text);\n // Now split string to nodes\n const nodes = [];\n let level = currentToken.level;\n let lastPos = 0;\n // forbid escape sequence at the start of the string,\n // this avoids http\\://example.com/ from being linkified as\n // http://example.com/\n if (links.length > 0 && links[0].index === 0 && i > 0 && tokens[i - 1].type === \"text_special\") {\n links = links.slice(1);\n }\n for (let ln = 0; ln < links.length; ln++) {\n const url = links[ln].url;\n const fullUrl = state.md.normalizeLink(url);\n if (!state.md.validateLink(fullUrl)) {\n continue;\n }\n let urlText = links[ln].text;\n // Linkifier might send raw hostnames like \"example.com\", where url\n // starts with domain name. So we prepend http:// in those cases,\n // and remove it afterwards.\n\n if (!links[ln].schema) {\n urlText = state.md.normalizeLinkText(\"http://\" + urlText).replace(/^http:\\/\\//, \"\");\n } else if (links[ln].schema === \"mailto:\" && !/^mailto:/i.test(urlText)) {\n urlText = state.md.normalizeLinkText(\"mailto:\" + urlText).replace(/^mailto:/, \"\");\n } else {\n urlText = state.md.normalizeLinkText(urlText);\n }\n const pos = links[ln].index;\n if (pos > lastPos) {\n const token = new state.Token(\"text\", \"\", 0);\n token.content = text.slice(lastPos, pos);\n token.level = level;\n nodes.push(token);\n }\n const token_o = new state.Token(\"link_open\", \"a\", 1);\n token_o.attrs = [ [ \"href\", fullUrl ] ];\n token_o.level = level++;\n token_o.markup = \"linkify\";\n token_o.info = \"auto\";\n nodes.push(token_o);\n const token_t = new state.Token(\"text\", \"\", 0);\n token_t.content = urlText;\n token_t.level = level;\n nodes.push(token_t);\n const token_c = new state.Token(\"link_close\", \"a\", -1);\n token_c.level = --level;\n token_c.markup = \"linkify\";\n token_c.info = \"auto\";\n nodes.push(token_c);\n lastPos = links[ln].lastIndex;\n }\n if (lastPos < text.length) {\n const token = new state.Token(\"text\", \"\", 0);\n token.content = text.slice(lastPos);\n token.level = level;\n nodes.push(token);\n }\n // replace current node\n blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);\n }\n }\n }\n }\n // Simple typographic replacements\n\n // (c) (C) \u2192 \u00A9\n // (tm) (TM) \u2192 \u2122\n // (r) (R) \u2192 \u00AE\n // +- \u2192 \u00B1\n // ... \u2192 \u2026 (also ?.... \u2192 ?.., !.... \u2192 !..)\n // ???????? \u2192 ???, !!!!! \u2192 !!!, `,,` \u2192 `,`\n // -- \u2192 –, --- \u2192 —\n\n // TODO:\n // - fractionals 1/2, 1/4, 3/4 -> \u00BD, \u00BC, \u00BE\n // - multiplications 2 x 4 -> 2 \u00D7 4\n const RARE_RE = /\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/;\n // Workaround for phantomjs - need regex without /g flag,\n // or root check will fail every second time\n const SCOPED_ABBR_TEST_RE = /\\((c|tm|r)\\)/i;\n const SCOPED_ABBR_RE = /\\((c|tm|r)\\)/gi;\n const SCOPED_ABBR = {\n c: \"\\xa9\",\n r: \"\\xae\",\n tm: \"\\u2122\"\n };\n function replaceFn(match, name) {\n return SCOPED_ABBR[name.toLowerCase()];\n }\n function replace_scoped(inlineTokens) {\n let inside_autolink = 0;\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i];\n if (token.type === \"text\" && !inside_autolink) {\n token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);\n }\n if (token.type === \"link_open\" && token.info === \"auto\") {\n inside_autolink--;\n }\n if (token.type === \"link_close\" && token.info === \"auto\") {\n inside_autolink++;\n }\n }\n }\n function replace_rare(inlineTokens) {\n let inside_autolink = 0;\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i];\n if (token.type === \"text\" && !inside_autolink) {\n if (RARE_RE.test(token.content)) {\n token.content = token.content.replace(/\\+-/g, \"\\xb1\").replace(/\\.{2,}/g, \"\\u2026\").replace(/([?!])\\u2026/g, \"$1..\").replace(/([?!]){4,}/g, \"$1$1$1\").replace(/,{2,}/g, \",\").replace(/(^|[^-])---(?=[^-]|$)/gm, \"$1\\u2014\").replace(/(^|\\s)--(?=\\s|$)/gm, \"$1\\u2013\").replace(/(^|[^-\\s])--(?=[^-\\s]|$)/gm, \"$1\\u2013\");\n }\n }\n if (token.type === \"link_open\" && token.info === \"auto\") {\n inside_autolink--;\n }\n if (token.type === \"link_close\" && token.info === \"auto\") {\n inside_autolink++;\n }\n }\n }\n function replace(state) {\n let blkIdx;\n if (!state.md.options.typographer) {\n return;\n }\n for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== \"inline\") {\n continue;\n }\n if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {\n replace_scoped(state.tokens[blkIdx].children);\n }\n if (RARE_RE.test(state.tokens[blkIdx].content)) {\n replace_rare(state.tokens[blkIdx].children);\n }\n }\n }\n // Convert straight quotation marks to typographic ones\n\n const QUOTE_TEST_RE = /['\"]/;\n const QUOTE_RE = /['\"]/g;\n const APOSTROPHE = \"\\u2019\";\n /* \u2019 */ function replaceAt(str, index, ch) {\n return str.slice(0, index) + ch + str.slice(index + 1);\n }\n function process_inlines(tokens, state) {\n let j;\n const stack = [];\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n const thisLevel = tokens[i].level;\n for (j = stack.length - 1; j >= 0; j--) {\n if (stack[j].level <= thisLevel) {\n break;\n }\n }\n stack.length = j + 1;\n if (token.type !== \"text\") {\n continue;\n }\n let text = token.content;\n let pos = 0;\n let max = text.length;\n /* eslint no-labels:0,block-scoped-var:0 */ OUTER: while (pos < max) {\n QUOTE_RE.lastIndex = pos;\n const t = QUOTE_RE.exec(text);\n if (!t) {\n break;\n }\n let canOpen = true;\n let canClose = true;\n pos = t.index + 1;\n const isSingle = t[0] === \"'\";\n // Find previous character,\n // default to space if it's the beginning of the line\n\n let lastChar = 32;\n if (t.index - 1 >= 0) {\n lastChar = text.charCodeAt(t.index - 1);\n } else {\n for (j = i - 1; j >= 0; j--) {\n if (tokens[j].type === \"softbreak\" || tokens[j].type === \"hardbreak\") break;\n // lastChar defaults to 0x20\n if (!tokens[j].content) continue;\n // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);\n break;\n }\n }\n // Find next character,\n // default to space if it's the end of the line\n\n let nextChar = 32;\n if (pos < max) {\n nextChar = text.charCodeAt(pos);\n } else {\n for (j = i + 1; j < tokens.length; j++) {\n if (tokens[j].type === \"softbreak\" || tokens[j].type === \"hardbreak\") break;\n // nextChar defaults to 0x20\n if (!tokens[j].content) continue;\n // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n nextChar = tokens[j].content.charCodeAt(0);\n break;\n }\n }\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));\n const isLastWhiteSpace = isWhiteSpace(lastChar);\n const isNextWhiteSpace = isWhiteSpace(nextChar);\n if (isNextWhiteSpace) {\n canOpen = false;\n } else if (isNextPunctChar) {\n if (!(isLastWhiteSpace || isLastPunctChar)) {\n canOpen = false;\n }\n }\n if (isLastWhiteSpace) {\n canClose = false;\n } else if (isLastPunctChar) {\n if (!(isNextWhiteSpace || isNextPunctChar)) {\n canClose = false;\n }\n }\n if (nextChar === 34 /* \" */ && t[0] === '\"') {\n if (lastChar >= 48 /* 0 */ && lastChar <= 57 /* 9 */) {\n // special case: 1\"\" - count first quote as an inch\n canClose = canOpen = false;\n }\n }\n if (canOpen && canClose) {\n // Replace quotes in the middle of punctuation sequence, but not\n // in the middle of the words, i.e.:\n // 1. foo \" bar \" baz - not replaced\n // 2. foo-\"-bar-\"-baz - replaced\n // 3. foo\"bar\"baz - not replaced\n canOpen = isLastPunctChar;\n canClose = isNextPunctChar;\n }\n if (!canOpen && !canClose) {\n // middle of word\n if (isSingle) {\n token.content = replaceAt(token.content, t.index, APOSTROPHE);\n }\n continue;\n }\n if (canClose) {\n // this could be a closing quote, rewind the stack to get a match\n for (j = stack.length - 1; j >= 0; j--) {\n let item = stack[j];\n if (stack[j].level < thisLevel) {\n break;\n }\n if (item.single === isSingle && stack[j].level === thisLevel) {\n item = stack[j];\n let openQuote;\n let closeQuote;\n if (isSingle) {\n openQuote = state.md.options.quotes[2];\n closeQuote = state.md.options.quotes[3];\n } else {\n openQuote = state.md.options.quotes[0];\n closeQuote = state.md.options.quotes[1];\n }\n // replace token.content *before* tokens[item.token].content,\n // because, if they are pointing at the same token, replaceAt\n // could mess up indices when quote length != 1\n token.content = replaceAt(token.content, t.index, closeQuote);\n tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote);\n pos += closeQuote.length - 1;\n if (item.token === i) {\n pos += openQuote.length - 1;\n }\n text = token.content;\n max = text.length;\n stack.length = j;\n continue OUTER;\n }\n }\n }\n if (canOpen) {\n stack.push({\n token: i,\n pos: t.index,\n single: isSingle,\n level: thisLevel\n });\n } else if (canClose && isSingle) {\n token.content = replaceAt(token.content, t.index, APOSTROPHE);\n }\n }\n }\n }\n function smartquotes(state) {\n /* eslint max-depth:0 */\n if (!state.md.options.typographer) {\n return;\n }\n for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== \"inline\" || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {\n continue;\n }\n process_inlines(state.tokens[blkIdx].children, state);\n }\n }\n // Join raw text tokens with the rest of the text\n\n // This is set as a separate rule to provide an opportunity for plugins\n // to run text replacements after text join, but before escape join.\n\n // For example, `\\:)` shouldn't be replaced with an emoji.\n\n function text_join(state) {\n let curr, last;\n const blockTokens = state.tokens;\n const l = blockTokens.length;\n for (let j = 0; j < l; j++) {\n if (blockTokens[j].type !== \"inline\") continue;\n const tokens = blockTokens[j].children;\n const max = tokens.length;\n for (curr = 0; curr < max; curr++) {\n if (tokens[curr].type === \"text_special\") {\n tokens[curr].type = \"text\";\n }\n }\n for (curr = last = 0; curr < max; curr++) {\n if (tokens[curr].type === \"text\" && curr + 1 < max && tokens[curr + 1].type === \"text\") {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;\n } else {\n if (curr !== last) {\n tokens[last] = tokens[curr];\n }\n last++;\n }\n }\n if (curr !== last) {\n tokens.length = last;\n }\n }\n }\n /** internal\n * class Core\n *\n * Top-level rules executor. Glues block/inline parsers and does intermediate\n * transformations.\n **/ const _rules$2 = [ [ \"normalize\", normalize ], [ \"block\", block ], [ \"inline\", inline ], [ \"linkify\", linkify$1 ], [ \"replacements\", replace ], [ \"smartquotes\", smartquotes ],\n // `text_join` finds `text_special` tokens (for escape sequences)\n // and joins them with the rest of the text\n [ \"text_join\", text_join ] ];\n /**\n * new Core()\n **/ function Core() {\n /**\n * Core#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of core rules.\n **/\n this.ruler = new Ruler;\n for (let i = 0; i < _rules$2.length; i++) {\n this.ruler.push(_rules$2[i][0], _rules$2[i][1]);\n }\n }\n /**\n * Core.process(state)\n *\n * Executes core chain rules.\n **/ Core.prototype.process = function(state) {\n const rules = this.ruler.getRules(\"\");\n for (let i = 0, l = rules.length; i < l; i++) {\n rules[i](state);\n }\n };\n Core.prototype.State = StateCore;\n // Parser state class\n function StateBlock(src, md, env, tokens) {\n this.src = src;\n // link to parser instance\n this.md = md;\n this.env = env;\n\n // Internal state vartiables\n\n this.tokens = tokens;\n this.bMarks = [];\n // line begin offsets for fast jumps\n this.eMarks = [];\n // line end offsets for fast jumps\n this.tShift = [];\n // offsets of the first non-space characters (tabs not expanded)\n this.sCount = [];\n // indents for each line (tabs expanded)\n // An amount of virtual spaces (tabs expanded) between beginning\n // of each line (bMarks) and real beginning of that line.\n\n // It exists only as a hack because blockquotes override bMarks\n // losing information in the process.\n\n // It's used only when expanding tabs, you can think about it as\n // an initial tab length, e.g. bsCount=21 applied to string `\\t123`\n // means first tab should be expanded to 4-21%4 === 3 spaces.\n\n this.bsCount = [];\n // block parser variables\n // required block content indent (for example, if we are\n // inside a list, it would be positioned after list marker)\n this.blkIndent = 0;\n this.line = 0;\n // line index in src\n this.lineMax = 0;\n // lines count\n this.tight = false;\n // loose/tight mode for lists\n this.ddIndent = -1;\n // indent of the current dd block (-1 if there isn't any)\n this.listIndent = -1;\n // indent of the current list block (-1 if there isn't any)\n // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'\n // used in lists to determine if they interrupt a paragraph\n this.parentType = \"root\";\n this.level = 0;\n // Create caches\n // Generate markers.\n const s = this.src;\n for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) {\n const ch = s.charCodeAt(pos);\n if (!indent_found) {\n if (isSpace(ch)) {\n indent++;\n if (ch === 9) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n continue;\n } else {\n indent_found = true;\n }\n }\n if (ch === 10 || pos === len - 1) {\n if (ch !== 10) {\n pos++;\n }\n this.bMarks.push(start);\n this.eMarks.push(pos);\n this.tShift.push(indent);\n this.sCount.push(offset);\n this.bsCount.push(0);\n indent_found = false;\n indent = 0;\n offset = 0;\n start = pos + 1;\n }\n }\n // Push fake entry to simplify cache bounds checks\n this.bMarks.push(s.length);\n this.eMarks.push(s.length);\n this.tShift.push(0);\n this.sCount.push(0);\n this.bsCount.push(0);\n this.lineMax = this.bMarks.length - 1;\n // don't count last fake line\n }\n // Push new token to \"stream\".\n\n StateBlock.prototype.push = function(type, tag, nesting) {\n const token = new Token(type, tag, nesting);\n token.block = true;\n if (nesting < 0) this.level--;\n // closing tag\n token.level = this.level;\n if (nesting > 0) this.level++;\n // opening tag\n this.tokens.push(token);\n return token;\n };\n StateBlock.prototype.isEmpty = function isEmpty(line) {\n return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];\n };\n StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {\n for (let max = this.lineMax; from < max; from++) {\n if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {\n break;\n }\n }\n return from;\n };\n // Skip spaces from given position.\n StateBlock.prototype.skipSpaces = function skipSpaces(pos) {\n for (let max = this.src.length; pos < max; pos++) {\n const ch = this.src.charCodeAt(pos);\n if (!isSpace(ch)) {\n break;\n }\n }\n return pos;\n };\n // Skip spaces from given position in reverse.\n StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {\n if (pos <= min) {\n return pos;\n }\n while (pos > min) {\n if (!isSpace(this.src.charCodeAt(--pos))) {\n return pos + 1;\n }\n }\n return pos;\n };\n // Skip char codes from given position\n StateBlock.prototype.skipChars = function skipChars(pos, code) {\n for (let max = this.src.length; pos < max; pos++) {\n if (this.src.charCodeAt(pos) !== code) {\n break;\n }\n }\n return pos;\n };\n // Skip char codes reverse from given position - 1\n StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {\n if (pos <= min) {\n return pos;\n }\n while (pos > min) {\n if (code !== this.src.charCodeAt(--pos)) {\n return pos + 1;\n }\n }\n return pos;\n };\n // cut lines range from source.\n StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {\n if (begin >= end) {\n return \"\";\n }\n const queue = new Array(end - begin);\n for (let i = 0, line = begin; line < end; line++, i++) {\n let lineIndent = 0;\n const lineStart = this.bMarks[line];\n let first = lineStart;\n let last;\n if (line + 1 < end || keepLastLF) {\n // No need for bounds check because we have fake entry on tail.\n last = this.eMarks[line] + 1;\n } else {\n last = this.eMarks[line];\n }\n while (first < last && lineIndent < indent) {\n const ch = this.src.charCodeAt(first);\n if (isSpace(ch)) {\n if (ch === 9) {\n lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;\n } else {\n lineIndent++;\n }\n } else if (first - lineStart < this.tShift[line]) {\n // patched tShift masked characters to look like spaces (blockquotes, list markers)\n lineIndent++;\n } else {\n break;\n }\n first++;\n }\n if (lineIndent > indent) {\n // partially expanding tabs in code blocks, e.g '\\t\\tfoobar'\n // with indent=2 becomes ' \\tfoobar'\n queue[i] = new Array(lineIndent - indent + 1).join(\" \") + this.src.slice(first, last);\n } else {\n queue[i] = this.src.slice(first, last);\n }\n }\n return queue.join(\"\");\n };\n // re-export Token class to use in block rules\n StateBlock.prototype.Token = Token;\n // GFM table, https://github.github.com/gfm/#tables-extension-\n // Limit the amount of empty autocompleted cells in a table,\n // see https://github.com/markdown-it/markdown-it/issues/1000,\n\n // Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k.\n // We set it to 65k, which can expand user input by a factor of x370\n // (256x256 square is 1.8kB expanded into 650kB).\n const MAX_AUTOCOMPLETED_CELLS = 65536;\n function getLine(state, line) {\n const pos = state.bMarks[line] + state.tShift[line];\n const max = state.eMarks[line];\n return state.src.slice(pos, max);\n }\n function escapedSplit(str) {\n const result = [];\n const max = str.length;\n let pos = 0;\n let ch = str.charCodeAt(pos);\n let isEscaped = false;\n let lastPos = 0;\n let current = \"\";\n while (pos < max) {\n if (ch === 124 /* | */) {\n if (!isEscaped) {\n // pipe separating cells, '|'\n result.push(current + str.substring(lastPos, pos));\n current = \"\";\n lastPos = pos + 1;\n } else {\n // escaped pipe, '\\|'\n current += str.substring(lastPos, pos - 1);\n lastPos = pos;\n }\n }\n isEscaped = ch === 92 /* \\ */;\n pos++;\n ch = str.charCodeAt(pos);\n }\n result.push(current + str.substring(lastPos));\n return result;\n }\n function table(state, startLine, endLine, silent) {\n // should have at least two lines\n if (startLine + 2 > endLine) {\n return false;\n }\n let nextLine = startLine + 1;\n if (state.sCount[nextLine] < state.blkIndent) {\n return false;\n }\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n return false;\n }\n // first character of the second line should be '|', '-', ':',\n // and no other characters are allowed but spaces;\n // basically, this is the equivalent of /^[-:|][-:|\\s]*$/ regexp\n let pos = state.bMarks[nextLine] + state.tShift[nextLine];\n if (pos >= state.eMarks[nextLine]) {\n return false;\n }\n const firstCh = state.src.charCodeAt(pos++);\n if (firstCh !== 124 /* | */ && firstCh !== 45 /* - */ && firstCh !== 58 /* : */) {\n return false;\n }\n if (pos >= state.eMarks[nextLine]) {\n return false;\n }\n const secondCh = state.src.charCodeAt(pos++);\n if (secondCh !== 124 /* | */ && secondCh !== 45 /* - */ && secondCh !== 58 /* : */ && !isSpace(secondCh)) {\n return false;\n }\n // if first character is '-', then second character must not be a space\n // (due to parsing ambiguity with list)\n if (firstCh === 45 /* - */ && isSpace(secondCh)) {\n return false;\n }\n while (pos < state.eMarks[nextLine]) {\n const ch = state.src.charCodeAt(pos);\n if (ch !== 124 /* | */ && ch !== 45 /* - */ && ch !== 58 /* : */ && !isSpace(ch)) {\n return false;\n }\n pos++;\n }\n let lineText = getLine(state, startLine + 1);\n let columns = lineText.split(\"|\");\n const aligns = [];\n for (let i = 0; i < columns.length; i++) {\n const t = columns[i].trim();\n if (!t) {\n // allow empty columns before and after table, but not in between columns;\n // e.g. allow ` |---| `, disallow ` ---||--- `\n if (i === 0 || i === columns.length - 1) {\n continue;\n } else {\n return false;\n }\n }\n if (!/^:?-+:?$/.test(t)) {\n return false;\n }\n if (t.charCodeAt(t.length - 1) === 58 /* : */) {\n aligns.push(t.charCodeAt(0) === 58 /* : */ ? \"center\" : \"right\");\n } else if (t.charCodeAt(0) === 58 /* : */) {\n aligns.push(\"left\");\n } else {\n aligns.push(\"\");\n }\n }\n lineText = getLine(state, startLine).trim();\n if (lineText.indexOf(\"|\") === -1) {\n return false;\n }\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n columns = escapedSplit(lineText);\n if (columns.length && columns[0] === \"\") columns.shift();\n if (columns.length && columns[columns.length - 1] === \"\") columns.pop();\n // header row will define an amount of columns in the entire table,\n // and align row should be exactly the same (the rest of the rows can differ)\n const columnCount = columns.length;\n if (columnCount === 0 || columnCount !== aligns.length) {\n return false;\n }\n if (silent) {\n return true;\n }\n const oldParentType = state.parentType;\n state.parentType = \"table\";\n // use 'blockquote' lists for termination because it's\n // the most similar to tables\n const terminatorRules = state.md.block.ruler.getRules(\"blockquote\");\n const token_to = state.push(\"table_open\", \"table\", 1);\n const tableLines = [ startLine, 0 ];\n token_to.map = tableLines;\n const token_tho = state.push(\"thead_open\", \"thead\", 1);\n token_tho.map = [ startLine, startLine + 1 ];\n const token_htro = state.push(\"tr_open\", \"tr\", 1);\n token_htro.map = [ startLine, startLine + 1 ];\n for (let i = 0; i < columns.length; i++) {\n const token_ho = state.push(\"th_open\", \"th\", 1);\n if (aligns[i]) {\n token_ho.attrs = [ [ \"style\", \"text-align:\" + aligns[i] ] ];\n }\n const token_il = state.push(\"inline\", \"\", 0);\n token_il.content = columns[i].trim();\n token_il.children = [];\n state.push(\"th_close\", \"th\", -1);\n }\n state.push(\"tr_close\", \"tr\", -1);\n state.push(\"thead_close\", \"thead\", -1);\n let tbodyLines;\n let autocompletedCells = 0;\n for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) {\n break;\n }\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) {\n break;\n }\n lineText = getLine(state, nextLine).trim();\n if (!lineText) {\n break;\n }\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n break;\n }\n columns = escapedSplit(lineText);\n if (columns.length && columns[0] === \"\") columns.shift();\n if (columns.length && columns[columns.length - 1] === \"\") columns.pop();\n // note: autocomplete count can be negative if user specifies more columns than header,\n // but that does not affect intended use (which is limiting expansion)\n autocompletedCells += columnCount - columns.length;\n if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) {\n break;\n }\n if (nextLine === startLine + 2) {\n const token_tbo = state.push(\"tbody_open\", \"tbody\", 1);\n token_tbo.map = tbodyLines = [ startLine + 2, 0 ];\n }\n const token_tro = state.push(\"tr_open\", \"tr\", 1);\n token_tro.map = [ nextLine, nextLine + 1 ];\n for (let i = 0; i < columnCount; i++) {\n const token_tdo = state.push(\"td_open\", \"td\", 1);\n if (aligns[i]) {\n token_tdo.attrs = [ [ \"style\", \"text-align:\" + aligns[i] ] ];\n }\n const token_il = state.push(\"inline\", \"\", 0);\n token_il.content = columns[i] ? columns[i].trim() : \"\";\n token_il.children = [];\n state.push(\"td_close\", \"td\", -1);\n }\n state.push(\"tr_close\", \"tr\", -1);\n }\n if (tbodyLines) {\n state.push(\"tbody_close\", \"tbody\", -1);\n tbodyLines[1] = nextLine;\n }\n state.push(\"table_close\", \"table\", -1);\n tableLines[1] = nextLine;\n state.parentType = oldParentType;\n state.line = nextLine;\n return true;\n }\n // Code block (4 spaces padded)\n function code(state, startLine, endLine /*, silent */) {\n if (state.sCount[startLine] - state.blkIndent < 4) {\n return false;\n }\n let nextLine = startLine + 1;\n let last = nextLine;\n while (nextLine < endLine) {\n if (state.isEmpty(nextLine)) {\n nextLine++;\n continue;\n }\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n nextLine++;\n last = nextLine;\n continue;\n }\n break;\n }\n state.line = last;\n const token = state.push(\"code_block\", \"code\", 0);\n token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + \"\\n\";\n token.map = [ startLine, state.line ];\n return true;\n }\n // fences (``` lang, ~~~ lang)\n function fence(state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n let max = state.eMarks[startLine];\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n if (pos + 3 > max) {\n return false;\n }\n const marker = state.src.charCodeAt(pos);\n if (marker !== 126 /* ~ */ && marker !== 96 /* ` */) {\n return false;\n }\n // scan marker length\n let mem = pos;\n pos = state.skipChars(pos, marker);\n let len = pos - mem;\n if (len < 3) {\n return false;\n }\n const markup = state.src.slice(mem, pos);\n const params = state.src.slice(pos, max);\n if (marker === 96 /* ` */) {\n if (params.indexOf(String.fromCharCode(marker)) >= 0) {\n return false;\n }\n }\n // Since start is found, we can report success here in validation mode\n if (silent) {\n return true;\n }\n // search end of block\n let nextLine = startLine;\n let haveEndMarker = false;\n for (;;) {\n nextLine++;\n if (nextLine >= endLine) {\n // unclosed block should be autoclosed by end of document.\n // also block seems to be autoclosed by end of parent\n break;\n }\n pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];\n max = state.eMarks[nextLine];\n if (pos < max && state.sCount[nextLine] < state.blkIndent) {\n // non-empty line with negative indent should stop the list:\n // - ```\n // test\n break;\n }\n if (state.src.charCodeAt(pos) !== marker) {\n continue;\n }\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n // closing fence should be indented less than 4 spaces\n continue;\n }\n pos = state.skipChars(pos, marker);\n // closing code fence must be at least as long as the opening one\n if (pos - mem < len) {\n continue;\n }\n // make sure tail has spaces only\n pos = state.skipSpaces(pos);\n if (pos < max) {\n continue;\n }\n haveEndMarker = true;\n // found!\n break;\n }\n // If a fence has heading spaces, they should be removed from its inner block\n len = state.sCount[startLine];\n state.line = nextLine + (haveEndMarker ? 1 : 0);\n const token = state.push(\"fence\", \"code\", 0);\n token.info = params;\n token.content = state.getLines(startLine + 1, nextLine, len, true);\n token.markup = markup;\n token.map = [ startLine, state.line ];\n return true;\n }\n // Block quotes\n function blockquote(state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n let max = state.eMarks[startLine];\n const oldLineMax = state.lineMax;\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n // check the block quote marker\n if (state.src.charCodeAt(pos) !== 62 /* > */) {\n return false;\n }\n // we know that it's going to be a valid blockquote,\n // so no point trying to find the end of it in silent mode\n if (silent) {\n return true;\n }\n const oldBMarks = [];\n const oldBSCount = [];\n const oldSCount = [];\n const oldTShift = [];\n const terminatorRules = state.md.block.ruler.getRules(\"blockquote\");\n const oldParentType = state.parentType;\n state.parentType = \"blockquote\";\n let lastLineEmpty = false;\n let nextLine;\n // Search the end of the block\n\n // Block ends with either:\n // 1. an empty line outside:\n // ```\n // > test\n\n // ```\n // 2. an empty line inside:\n // ```\n // >\n // test\n // ```\n // 3. another tag:\n // ```\n // > test\n // - - -\n // ```\n for (nextLine = startLine; nextLine < endLine; nextLine++) {\n // check if it's outdented, i.e. it's inside list item and indented\n // less than said list item:\n // ```\n // 1. anything\n // > current blockquote\n // 2. checking this line\n // ```\n const isOutdented = state.sCount[nextLine] < state.blkIndent;\n pos = state.bMarks[nextLine] + state.tShift[nextLine];\n max = state.eMarks[nextLine];\n if (pos >= max) {\n // Case 1: line is not inside the blockquote, and this line is empty.\n break;\n }\n if (state.src.charCodeAt(pos++) === 62 /* > */ && !isOutdented) {\n // This line is inside the blockquote.\n // set offset past spaces and \">\"\n let initial = state.sCount[nextLine] + 1;\n let spaceAfterMarker;\n let adjustTab;\n // skip one optional space after '>'\n if (state.src.charCodeAt(pos) === 32 /* space */) {\n // ' > test '\n // ^ -- position start of line here:\n pos++;\n initial++;\n adjustTab = false;\n spaceAfterMarker = true;\n } else if (state.src.charCodeAt(pos) === 9 /* tab */) {\n spaceAfterMarker = true;\n if ((state.bsCount[nextLine] + initial) % 4 === 3) {\n // ' >\\t test '\n // ^ -- position start of line here (tab has width===1)\n pos++;\n initial++;\n adjustTab = false;\n } else {\n // ' >\\t test '\n // ^ -- position start of line here + shift bsCount slightly\n // to make extra space appear\n adjustTab = true;\n }\n } else {\n spaceAfterMarker = false;\n }\n let offset = initial;\n oldBMarks.push(state.bMarks[nextLine]);\n state.bMarks[nextLine] = pos;\n while (pos < max) {\n const ch = state.src.charCodeAt(pos);\n if (isSpace(ch)) {\n if (ch === 9) {\n offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n pos++;\n }\n lastLineEmpty = pos >= max;\n oldBSCount.push(state.bsCount[nextLine]);\n state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);\n oldSCount.push(state.sCount[nextLine]);\n state.sCount[nextLine] = offset - initial;\n oldTShift.push(state.tShift[nextLine]);\n state.tShift[nextLine] = pos - state.bMarks[nextLine];\n continue;\n }\n // Case 2: line is not inside the blockquote, and the last line was empty.\n if (lastLineEmpty) {\n break;\n }\n // Case 3: another tag found.\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) {\n // Quirk to enforce \"hard termination mode\" for paragraphs;\n // normally if you call `tokenize(state, startLine, nextLine)`,\n // paragraphs will look below nextLine for paragraph continuation,\n // but if blockquote is terminated by another tag, they shouldn't\n state.lineMax = nextLine;\n if (state.blkIndent !== 0) {\n // state.blkIndent was non-zero, we now set it to zero,\n // so we need to re-calculate all offsets to appear as\n // if indent wasn't changed\n oldBMarks.push(state.bMarks[nextLine]);\n oldBSCount.push(state.bsCount[nextLine]);\n oldTShift.push(state.tShift[nextLine]);\n oldSCount.push(state.sCount[nextLine]);\n state.sCount[nextLine] -= state.blkIndent;\n }\n break;\n }\n oldBMarks.push(state.bMarks[nextLine]);\n oldBSCount.push(state.bsCount[nextLine]);\n oldTShift.push(state.tShift[nextLine]);\n oldSCount.push(state.sCount[nextLine]);\n // A negative indentation means that this is a paragraph continuation\n\n state.sCount[nextLine] = -1;\n }\n const oldIndent = state.blkIndent;\n state.blkIndent = 0;\n const token_o = state.push(\"blockquote_open\", \"blockquote\", 1);\n token_o.markup = \">\";\n const lines = [ startLine, 0 ];\n token_o.map = lines;\n state.md.block.tokenize(state, startLine, nextLine);\n const token_c = state.push(\"blockquote_close\", \"blockquote\", -1);\n token_c.markup = \">\";\n state.lineMax = oldLineMax;\n state.parentType = oldParentType;\n lines[1] = state.line;\n // Restore original tShift; this might not be necessary since the parser\n // has already been here, but just to make sure we can do that.\n for (let i = 0; i < oldTShift.length; i++) {\n state.bMarks[i + startLine] = oldBMarks[i];\n state.tShift[i + startLine] = oldTShift[i];\n state.sCount[i + startLine] = oldSCount[i];\n state.bsCount[i + startLine] = oldBSCount[i];\n }\n state.blkIndent = oldIndent;\n return true;\n }\n // Horizontal rule\n function hr(state, startLine, endLine, silent) {\n const max = state.eMarks[startLine];\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n const marker = state.src.charCodeAt(pos++);\n // Check hr marker\n if (marker !== 42 /* * */ && marker !== 45 /* - */ && marker !== 95 /* _ */) {\n return false;\n }\n // markers can be mixed with spaces, but there should be at least 3 of them\n let cnt = 1;\n while (pos < max) {\n const ch = state.src.charCodeAt(pos++);\n if (ch !== marker && !isSpace(ch)) {\n return false;\n }\n if (ch === marker) {\n cnt++;\n }\n }\n if (cnt < 3) {\n return false;\n }\n if (silent) {\n return true;\n }\n state.line = startLine + 1;\n const token = state.push(\"hr\", \"hr\", 0);\n token.map = [ startLine, state.line ];\n token.markup = Array(cnt + 1).join(String.fromCharCode(marker));\n return true;\n }\n // Lists\n // Search `[-+*][\\n ]`, returns next pos after marker on success\n // or -1 on fail.\n function skipBulletListMarker(state, startLine) {\n const max = state.eMarks[startLine];\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n const marker = state.src.charCodeAt(pos++);\n // Check bullet\n if (marker !== 42 /* * */ && marker !== 45 /* - */ && marker !== 43 /* + */) {\n return -1;\n }\n if (pos < max) {\n const ch = state.src.charCodeAt(pos);\n if (!isSpace(ch)) {\n // \" -test \" - is not a list item\n return -1;\n }\n }\n return pos;\n }\n // Search `\\d+[.)][\\n ]`, returns next pos after marker on success\n // or -1 on fail.\n function skipOrderedListMarker(state, startLine) {\n const start = state.bMarks[startLine] + state.tShift[startLine];\n const max = state.eMarks[startLine];\n let pos = start;\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) {\n return -1;\n }\n let ch = state.src.charCodeAt(pos++);\n if (ch < 48 /* 0 */ || ch > 57 /* 9 */) {\n return -1;\n }\n for (;;) {\n // EOL -> fail\n if (pos >= max) {\n return -1;\n }\n ch = state.src.charCodeAt(pos++);\n if (ch >= 48 /* 0 */ && ch <= 57 /* 9 */) {\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) {\n return -1;\n }\n continue;\n }\n // found valid marker\n if (ch === 41 /* ) */ || ch === 46 /* . */) {\n break;\n }\n return -1;\n }\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n }\n function markTightParagraphs(state, idx) {\n const level = state.level + 2;\n for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) {\n if (state.tokens[i].level === level && state.tokens[i].type === \"paragraph_open\") {\n state.tokens[i + 2].hidden = true;\n state.tokens[i].hidden = true;\n i += 2;\n }\n }\n }\n function list(state, startLine, endLine, silent) {\n let max, pos, start, token;\n let nextLine = startLine;\n let tight = true;\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n return false;\n }\n // Special case:\n // - item 1\n // - item 2\n // - item 3\n // - item 4\n // - this one is a paragraph continuation\n if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) {\n return false;\n }\n let isTerminatingParagraph = false;\n // limit conditions when list can interrupt\n // a paragraph (validation mode only)\n if (silent && state.parentType === \"paragraph\") {\n // Next list item should still terminate previous list item;\n // This code can fail if plugins use blkIndent as well as lists,\n // but I hope the spec gets fixed long before that happens.\n if (state.sCount[nextLine] >= state.blkIndent) {\n isTerminatingParagraph = true;\n }\n }\n // Detect list type and position after marker\n let isOrdered;\n let markerValue;\n let posAfterMarker;\n if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {\n isOrdered = true;\n start = state.bMarks[nextLine] + state.tShift[nextLine];\n markerValue = Number(state.src.slice(start, posAfterMarker - 1));\n // If we're starting a new ordered list right after\n // a paragraph, it should start with 1.\n if (isTerminatingParagraph && markerValue !== 1) return false;\n } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) {\n isOrdered = false;\n } else {\n return false;\n }\n // If we're starting a new unordered list right after\n // a paragraph, first line should not be empty.\n if (isTerminatingParagraph) {\n if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false;\n }\n // For validation mode we can terminate immediately\n if (silent) {\n return true;\n }\n // We should terminate list on style change. Remember first one to compare.\n const markerCharCode = state.src.charCodeAt(posAfterMarker - 1);\n // Start list\n const listTokIdx = state.tokens.length;\n if (isOrdered) {\n token = state.push(\"ordered_list_open\", \"ol\", 1);\n if (markerValue !== 1) {\n token.attrs = [ [ \"start\", markerValue ] ];\n }\n } else {\n token = state.push(\"bullet_list_open\", \"ul\", 1);\n }\n const listLines = [ nextLine, 0 ];\n token.map = listLines;\n token.markup = String.fromCharCode(markerCharCode);\n\n // Iterate list items\n\n let prevEmptyEnd = false;\n const terminatorRules = state.md.block.ruler.getRules(\"list\");\n const oldParentType = state.parentType;\n state.parentType = \"list\";\n while (nextLine < endLine) {\n pos = posAfterMarker;\n max = state.eMarks[nextLine];\n const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]);\n let offset = initial;\n while (pos < max) {\n const ch = state.src.charCodeAt(pos);\n if (ch === 9) {\n offset += 4 - (offset + state.bsCount[nextLine]) % 4;\n } else if (ch === 32) {\n offset++;\n } else {\n break;\n }\n pos++;\n }\n const contentStart = pos;\n let indentAfterMarker;\n if (contentStart >= max) {\n // trimming space in \"- \\n 3\" case, indent is 1 here\n indentAfterMarker = 1;\n } else {\n indentAfterMarker = offset - initial;\n }\n // If we have more than 4 spaces, the indent is 1\n // (the rest is just indented code block)\n if (indentAfterMarker > 4) {\n indentAfterMarker = 1;\n }\n // \" - test\"\n // ^^^^^ - calculating total length of this thing\n const indent = initial + indentAfterMarker;\n // Run subparser & write tokens\n token = state.push(\"list_item_open\", \"li\", 1);\n token.markup = String.fromCharCode(markerCharCode);\n const itemLines = [ nextLine, 0 ];\n token.map = itemLines;\n if (isOrdered) {\n token.info = state.src.slice(start, posAfterMarker - 1);\n }\n // change current state, then restore it after parser subcall\n const oldTight = state.tight;\n const oldTShift = state.tShift[nextLine];\n const oldSCount = state.sCount[nextLine];\n // - example list\n // ^ listIndent position will be here\n // ^ blkIndent position will be here\n\n const oldListIndent = state.listIndent;\n state.listIndent = state.blkIndent;\n state.blkIndent = indent;\n state.tight = true;\n state.tShift[nextLine] = contentStart - state.bMarks[nextLine];\n state.sCount[nextLine] = offset;\n if (contentStart >= max && state.isEmpty(nextLine + 1)) {\n // workaround for this case\n // (list item is empty, list terminates before \"foo\"):\n // ~~~~~~~~\n // -\n // foo\n // ~~~~~~~~\n state.line = Math.min(state.line + 2, endLine);\n } else {\n state.md.block.tokenize(state, nextLine, endLine, true);\n }\n // If any of list item is tight, mark list as tight\n if (!state.tight || prevEmptyEnd) {\n tight = false;\n }\n // Item become loose if finish with empty line,\n // but we should filter last element, because it means list finish\n prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1);\n state.blkIndent = state.listIndent;\n state.listIndent = oldListIndent;\n state.tShift[nextLine] = oldTShift;\n state.sCount[nextLine] = oldSCount;\n state.tight = oldTight;\n token = state.push(\"list_item_close\", \"li\", -1);\n token.markup = String.fromCharCode(markerCharCode);\n nextLine = state.line;\n itemLines[1] = nextLine;\n if (nextLine >= endLine) {\n break;\n }\n\n // Try to check if list is terminated or continued.\n\n if (state.sCount[nextLine] < state.blkIndent) {\n break;\n }\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n break;\n }\n // fail if terminating block found\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) {\n break;\n }\n // fail if list has another type\n if (isOrdered) {\n posAfterMarker = skipOrderedListMarker(state, nextLine);\n if (posAfterMarker < 0) {\n break;\n }\n start = state.bMarks[nextLine] + state.tShift[nextLine];\n } else {\n posAfterMarker = skipBulletListMarker(state, nextLine);\n if (posAfterMarker < 0) {\n break;\n }\n }\n if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) {\n break;\n }\n }\n // Finalize list\n if (isOrdered) {\n token = state.push(\"ordered_list_close\", \"ol\", -1);\n } else {\n token = state.push(\"bullet_list_close\", \"ul\", -1);\n }\n token.markup = String.fromCharCode(markerCharCode);\n listLines[1] = nextLine;\n state.line = nextLine;\n state.parentType = oldParentType;\n // mark paragraphs tight if needed\n if (tight) {\n markTightParagraphs(state, listTokIdx);\n }\n return true;\n }\n function reference(state, startLine, _endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n let max = state.eMarks[startLine];\n let nextLine = startLine + 1;\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n if (state.src.charCodeAt(pos) !== 91 /* [ */) {\n return false;\n }\n function getNextLine(nextLine) {\n const endLine = state.lineMax;\n if (nextLine >= endLine || state.isEmpty(nextLine)) {\n // empty line or end of input\n return null;\n }\n let isContinuation = false;\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) {\n isContinuation = true;\n }\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) {\n isContinuation = true;\n }\n if (!isContinuation) {\n const terminatorRules = state.md.block.ruler.getRules(\"reference\");\n const oldParentType = state.parentType;\n state.parentType = \"reference\";\n // Some tags can terminate paragraph without empty line.\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n state.parentType = oldParentType;\n if (terminate) {\n // terminated by another block\n return null;\n }\n }\n const pos = state.bMarks[nextLine] + state.tShift[nextLine];\n const max = state.eMarks[nextLine];\n // max + 1 explicitly includes the newline\n return state.src.slice(pos, max + 1);\n }\n let str = state.src.slice(pos, max + 1);\n max = str.length;\n let labelEnd = -1;\n for (pos = 1; pos < max; pos++) {\n const ch = str.charCodeAt(pos);\n if (ch === 91 /* [ */) {\n return false;\n } else if (ch === 93 /* ] */) {\n labelEnd = pos;\n break;\n } else if (ch === 10 /* \\n */) {\n const lineContent = getNextLine(nextLine);\n if (lineContent !== null) {\n str += lineContent;\n max = str.length;\n nextLine++;\n }\n } else if (ch === 92 /* \\ */) {\n pos++;\n if (pos < max && str.charCodeAt(pos) === 10) {\n const lineContent = getNextLine(nextLine);\n if (lineContent !== null) {\n str += lineContent;\n max = str.length;\n nextLine++;\n }\n }\n }\n }\n if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58 /* : */) {\n return false;\n }\n // [label]: destination 'title'\n // ^^^ skip optional whitespace here\n for (pos = labelEnd + 2; pos < max; pos++) {\n const ch = str.charCodeAt(pos);\n if (ch === 10) {\n const lineContent = getNextLine(nextLine);\n if (lineContent !== null) {\n str += lineContent;\n max = str.length;\n nextLine++;\n }\n } else if (isSpace(ch)) ; else {\n break;\n }\n }\n // [label]: destination 'title'\n // ^^^^^^^^^^^ parse this\n const destRes = state.md.helpers.parseLinkDestination(str, pos, max);\n if (!destRes.ok) {\n return false;\n }\n const href = state.md.normalizeLink(destRes.str);\n if (!state.md.validateLink(href)) {\n return false;\n }\n pos = destRes.pos;\n // save cursor state, we could require to rollback later\n const destEndPos = pos;\n const destEndLineNo = nextLine;\n // [label]: destination 'title'\n // ^^^ skipping those spaces\n const start = pos;\n for (;pos < max; pos++) {\n const ch = str.charCodeAt(pos);\n if (ch === 10) {\n const lineContent = getNextLine(nextLine);\n if (lineContent !== null) {\n str += lineContent;\n max = str.length;\n nextLine++;\n }\n } else if (isSpace(ch)) ; else {\n break;\n }\n }\n // [label]: destination 'title'\n // ^^^^^^^ parse this\n let titleRes = state.md.helpers.parseLinkTitle(str, pos, max);\n while (titleRes.can_continue) {\n const lineContent = getNextLine(nextLine);\n if (lineContent === null) break;\n str += lineContent;\n pos = max;\n max = str.length;\n nextLine++;\n titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes);\n }\n let title;\n if (pos < max && start !== pos && titleRes.ok) {\n title = titleRes.str;\n pos = titleRes.pos;\n } else {\n title = \"\";\n pos = destEndPos;\n nextLine = destEndLineNo;\n }\n // skip trailing spaces until the rest of the line\n while (pos < max) {\n const ch = str.charCodeAt(pos);\n if (!isSpace(ch)) {\n break;\n }\n pos++;\n }\n if (pos < max && str.charCodeAt(pos) !== 10) {\n if (title) {\n // garbage at the end of the line after title,\n // but it could still be a valid reference if we roll back\n title = \"\";\n pos = destEndPos;\n nextLine = destEndLineNo;\n while (pos < max) {\n const ch = str.charCodeAt(pos);\n if (!isSpace(ch)) {\n break;\n }\n pos++;\n }\n }\n }\n if (pos < max && str.charCodeAt(pos) !== 10) {\n // garbage at the end of the line\n return false;\n }\n const label = normalizeReference(str.slice(1, labelEnd));\n if (!label) {\n // CommonMark 0.20 disallows empty labels\n return false;\n }\n // Reference can not terminate anything. This check is for safety only.\n /* istanbul ignore if */ if (silent) {\n return true;\n }\n if (typeof state.env.references === \"undefined\") {\n state.env.references = {};\n }\n if (typeof state.env.references[label] === \"undefined\") {\n state.env.references[label] = {\n title: title,\n href: href\n };\n }\n state.line = nextLine;\n return true;\n }\n // List of valid html blocks names, according to commonmark spec\n // https://spec.commonmark.org/0.30/#html-blocks\n var block_names = [ \"address\", \"article\", \"aside\", \"base\", \"basefont\", \"blockquote\", \"body\", \"caption\", \"center\", \"col\", \"colgroup\", \"dd\", \"details\", \"dialog\", \"dir\", \"div\", \"dl\", \"dt\", \"fieldset\", \"figcaption\", \"figure\", \"footer\", \"form\", \"frame\", \"frameset\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"head\", \"header\", \"hr\", \"html\", \"iframe\", \"legend\", \"li\", \"link\", \"main\", \"menu\", \"menuitem\", \"nav\", \"noframes\", \"ol\", \"optgroup\", \"option\", \"p\", \"param\", \"search\", \"section\", \"summary\", \"table\", \"tbody\", \"td\", \"tfoot\", \"th\", \"thead\", \"title\", \"tr\", \"track\", \"ul\" ];\n // Regexps to match html elements\n const attr_name = \"[a-zA-Z_:][a-zA-Z0-9:._-]*\";\n const unquoted = \"[^\\\"'=<>`\\\\x00-\\\\x20]+\";\n const single_quoted = \"'[^']*'\";\n const double_quoted = '\"[^\"]*\"';\n const attr_value = \"(?:\" + unquoted + \"|\" + single_quoted + \"|\" + double_quoted + \")\";\n const attribute = \"(?:\\\\s+\" + attr_name + \"(?:\\\\s*=\\\\s*\" + attr_value + \")?)\";\n const open_tag = \"<[A-Za-z][A-Za-z0-9\\\\-]*\" + attribute + \"*\\\\s*\\\\/?>\";\n const close_tag = \"<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>\";\n const comment = \"\\x3c!---?>|\\x3c!--(?:[^-]|-[^-]|--[^>])*--\\x3e\";\n const processing = \"<[?][\\\\s\\\\S]*?[?]>\";\n const declaration = \"]*>\";\n const cdata = \"\";\n const HTML_TAG_RE = new RegExp(\"^(?:\" + open_tag + \"|\" + close_tag + \"|\" + comment + \"|\" + processing + \"|\" + declaration + \"|\" + cdata + \")\");\n const HTML_OPEN_CLOSE_TAG_RE = new RegExp(\"^(?:\" + open_tag + \"|\" + close_tag + \")\");\n // HTML block\n // An array of opening and corresponding closing sequences for html tags,\n // last argument defines whether it can terminate a paragraph or not\n\n const HTML_SEQUENCES = [ [ /^<(script|pre|style|textarea)(?=(\\s|>|$))/i, /<\\/(script|pre|style|textarea)>/i, true ], [ /^/, true ], [ /^<\\?/, /\\?>/, true ], [ /^/, true ], [ /^/, true ], [ new RegExp(\"^|$))\", \"i\"), /^$/, true ], [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + \"\\\\s*$\"), /^$/, false ] ];\n function html_block(state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n let max = state.eMarks[startLine];\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n if (!state.md.options.html) {\n return false;\n }\n if (state.src.charCodeAt(pos) !== 60 /* < */) {\n return false;\n }\n let lineText = state.src.slice(pos, max);\n let i = 0;\n for (;i < HTML_SEQUENCES.length; i++) {\n if (HTML_SEQUENCES[i][0].test(lineText)) {\n break;\n }\n }\n if (i === HTML_SEQUENCES.length) {\n return false;\n }\n if (silent) {\n // true if this sequence can be a terminator, false otherwise\n return HTML_SEQUENCES[i][2];\n }\n let nextLine = startLine + 1;\n // If we are here - we detected HTML block.\n // Let's roll down till block end.\n if (!HTML_SEQUENCES[i][1].test(lineText)) {\n for (;nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) {\n break;\n }\n pos = state.bMarks[nextLine] + state.tShift[nextLine];\n max = state.eMarks[nextLine];\n lineText = state.src.slice(pos, max);\n if (HTML_SEQUENCES[i][1].test(lineText)) {\n if (lineText.length !== 0) {\n nextLine++;\n }\n break;\n }\n }\n }\n state.line = nextLine;\n const token = state.push(\"html_block\", \"\", 0);\n token.map = [ startLine, nextLine ];\n token.content = state.getLines(startLine, nextLine, state.blkIndent, true);\n return true;\n }\n // heading (#, ##, ...)\n function heading(state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n let max = state.eMarks[startLine];\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n let ch = state.src.charCodeAt(pos);\n if (ch !== 35 /* # */ || pos >= max) {\n return false;\n }\n // count heading level\n let level = 1;\n ch = state.src.charCodeAt(++pos);\n while (ch === 35 /* # */ && pos < max && level <= 6) {\n level++;\n ch = state.src.charCodeAt(++pos);\n }\n if (level > 6 || pos < max && !isSpace(ch)) {\n return false;\n }\n if (silent) {\n return true;\n }\n // Let's cut tails like ' ### ' from the end of string\n max = state.skipSpacesBack(max, pos);\n const tmp = state.skipCharsBack(max, 35, pos);\n // #\n if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {\n max = tmp;\n }\n state.line = startLine + 1;\n const token_o = state.push(\"heading_open\", \"h\" + String(level), 1);\n token_o.markup = \"########\".slice(0, level);\n token_o.map = [ startLine, state.line ];\n const token_i = state.push(\"inline\", \"\", 0);\n token_i.content = state.src.slice(pos, max).trim();\n token_i.map = [ startLine, state.line ];\n token_i.children = [];\n const token_c = state.push(\"heading_close\", \"h\" + String(level), -1);\n token_c.markup = \"########\".slice(0, level);\n return true;\n }\n // lheading (---, ===)\n function lheading(state, startLine, endLine /*, silent */) {\n const terminatorRules = state.md.block.ruler.getRules(\"paragraph\");\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n const oldParentType = state.parentType;\n state.parentType = \"paragraph\";\n // use paragraph to match terminatorRules\n // jump line-by-line until empty one or EOF\n let level = 0;\n let marker;\n let nextLine = startLine + 1;\n for (;nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) {\n continue;\n }\n\n // Check for underline in setext header\n\n if (state.sCount[nextLine] >= state.blkIndent) {\n let pos = state.bMarks[nextLine] + state.tShift[nextLine];\n const max = state.eMarks[nextLine];\n if (pos < max) {\n marker = state.src.charCodeAt(pos);\n if (marker === 45 /* - */ || marker === 61 /* = */) {\n pos = state.skipChars(pos, marker);\n pos = state.skipSpaces(pos);\n if (pos >= max) {\n level = marker === 61 /* = */ ? 1 : 2;\n break;\n }\n }\n }\n }\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) {\n continue;\n }\n // Some tags can terminate paragraph without empty line.\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) {\n break;\n }\n }\n if (!level) {\n // Didn't find valid underline\n return false;\n }\n const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();\n state.line = nextLine + 1;\n const token_o = state.push(\"heading_open\", \"h\" + String(level), 1);\n token_o.markup = String.fromCharCode(marker);\n token_o.map = [ startLine, state.line ];\n const token_i = state.push(\"inline\", \"\", 0);\n token_i.content = content;\n token_i.map = [ startLine, state.line - 1 ];\n token_i.children = [];\n const token_c = state.push(\"heading_close\", \"h\" + String(level), -1);\n token_c.markup = String.fromCharCode(marker);\n state.parentType = oldParentType;\n return true;\n }\n // Paragraph\n function paragraph(state, startLine, endLine) {\n const terminatorRules = state.md.block.ruler.getRules(\"paragraph\");\n const oldParentType = state.parentType;\n let nextLine = startLine + 1;\n state.parentType = \"paragraph\";\n // jump line-by-line until empty one or EOF\n for (;nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) {\n continue;\n }\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) {\n continue;\n }\n // Some tags can terminate paragraph without empty line.\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) {\n break;\n }\n }\n const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();\n state.line = nextLine;\n const token_o = state.push(\"paragraph_open\", \"p\", 1);\n token_o.map = [ startLine, state.line ];\n const token_i = state.push(\"inline\", \"\", 0);\n token_i.content = content;\n token_i.map = [ startLine, state.line ];\n token_i.children = [];\n state.push(\"paragraph_close\", \"p\", -1);\n state.parentType = oldParentType;\n return true;\n }\n /** internal\n * class ParserBlock\n *\n * Block-level tokenizer.\n **/ const _rules$1 = [\n // First 2 params - rule name & source. Secondary array - list of rules,\n // which can be terminated by this one.\n [ \"table\", table, [ \"paragraph\", \"reference\" ] ], [ \"code\", code ], [ \"fence\", fence, [ \"paragraph\", \"reference\", \"blockquote\", \"list\" ] ], [ \"blockquote\", blockquote, [ \"paragraph\", \"reference\", \"blockquote\", \"list\" ] ], [ \"hr\", hr, [ \"paragraph\", \"reference\", \"blockquote\", \"list\" ] ], [ \"list\", list, [ \"paragraph\", \"reference\", \"blockquote\" ] ], [ \"reference\", reference ], [ \"html_block\", html_block, [ \"paragraph\", \"reference\", \"blockquote\" ] ], [ \"heading\", heading, [ \"paragraph\", \"reference\", \"blockquote\" ] ], [ \"lheading\", lheading ], [ \"paragraph\", paragraph ] ];\n /**\n * new ParserBlock()\n **/ function ParserBlock() {\n /**\n * ParserBlock#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of block rules.\n **/\n this.ruler = new Ruler;\n for (let i = 0; i < _rules$1.length; i++) {\n this.ruler.push(_rules$1[i][0], _rules$1[i][1], {\n alt: (_rules$1[i][2] || []).slice()\n });\n }\n }\n // Generate tokens for input range\n\n ParserBlock.prototype.tokenize = function(state, startLine, endLine) {\n const rules = this.ruler.getRules(\"\");\n const len = rules.length;\n const maxNesting = state.md.options.maxNesting;\n let line = startLine;\n let hasEmptyLines = false;\n while (line < endLine) {\n state.line = line = state.skipEmptyLines(line);\n if (line >= endLine) {\n break;\n }\n // Termination condition for nested calls.\n // Nested calls currently used for blockquotes & lists\n if (state.sCount[line] < state.blkIndent) {\n break;\n }\n // If nesting level exceeded - skip tail to the end. That's not ordinary\n // situation and we should not care about content.\n if (state.level >= maxNesting) {\n state.line = endLine;\n break;\n }\n // Try all possible rules.\n // On success, rule should:\n\n // - update `state.line`\n // - update `state.tokens`\n // - return true\n const prevLine = state.line;\n let ok = false;\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, line, endLine, false);\n if (ok) {\n if (prevLine >= state.line) {\n throw new Error(\"block rule didn't increment state.line\");\n }\n break;\n }\n }\n // this can only happen if user disables paragraph rule\n if (!ok) throw new Error(\"none of the block rules matched\");\n // set state.tight if we had an empty line before current tag\n // i.e. latest empty line should not count\n state.tight = !hasEmptyLines;\n // paragraph might \"eat\" one newline after it in nested lists\n if (state.isEmpty(state.line - 1)) {\n hasEmptyLines = true;\n }\n line = state.line;\n if (line < endLine && state.isEmpty(line)) {\n hasEmptyLines = true;\n line++;\n state.line = line;\n }\n }\n };\n /**\n * ParserBlock.parse(str, md, env, outTokens)\n *\n * Process input string and push block tokens into `outTokens`\n **/ ParserBlock.prototype.parse = function(src, md, env, outTokens) {\n if (!src) {\n return;\n }\n const state = new this.State(src, md, env, outTokens);\n this.tokenize(state, state.line, state.lineMax);\n };\n ParserBlock.prototype.State = StateBlock;\n // Inline parser state\n function StateInline(src, md, env, outTokens) {\n this.src = src;\n this.env = env;\n this.md = md;\n this.tokens = outTokens;\n this.tokens_meta = Array(outTokens.length);\n this.pos = 0;\n this.posMax = this.src.length;\n this.level = 0;\n this.pending = \"\";\n this.pendingLevel = 0;\n // Stores { start: end } pairs. Useful for backtrack\n // optimization of pairs parse (emphasis, strikes).\n this.cache = {};\n // List of emphasis-like delimiters for current tag\n this.delimiters = [];\n // Stack of delimiter lists for upper level tags\n this._prev_delimiters = [];\n // backtick length => last seen position\n this.backticks = {};\n this.backticksScanned = false;\n // Counter used to disable inline linkify-it execution\n // inside and markdown links\n this.linkLevel = 0;\n }\n // Flush pending text\n\n StateInline.prototype.pushPending = function() {\n const token = new Token(\"text\", \"\", 0);\n token.content = this.pending;\n token.level = this.pendingLevel;\n this.tokens.push(token);\n this.pending = \"\";\n return token;\n };\n // Push new token to \"stream\".\n // If pending text exists - flush it as text token\n\n StateInline.prototype.push = function(type, tag, nesting) {\n if (this.pending) {\n this.pushPending();\n }\n const token = new Token(type, tag, nesting);\n let token_meta = null;\n if (nesting < 0) {\n // closing tag\n this.level--;\n this.delimiters = this._prev_delimiters.pop();\n }\n token.level = this.level;\n if (nesting > 0) {\n // opening tag\n this.level++;\n this._prev_delimiters.push(this.delimiters);\n this.delimiters = [];\n token_meta = {\n delimiters: this.delimiters\n };\n }\n this.pendingLevel = this.level;\n this.tokens.push(token);\n this.tokens_meta.push(token_meta);\n return token;\n };\n // Scan a sequence of emphasis-like markers, and determine whether\n // it can start an emphasis sequence or end an emphasis sequence.\n\n // - start - position to scan from (it should point at a valid marker);\n // - canSplitWord - determine if these markers can be found inside a word\n\n StateInline.prototype.scanDelims = function(start, canSplitWord) {\n const max = this.posMax;\n const marker = this.src.charCodeAt(start);\n // treat beginning of the line as a whitespace\n const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 32;\n let pos = start;\n while (pos < max && this.src.charCodeAt(pos) === marker) {\n pos++;\n }\n const count = pos - start;\n // treat end of the line as a whitespace\n const nextChar = pos < max ? this.src.charCodeAt(pos) : 32;\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));\n const isLastWhiteSpace = isWhiteSpace(lastChar);\n const isNextWhiteSpace = isWhiteSpace(nextChar);\n const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);\n const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar);\n const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar);\n const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar);\n return {\n can_open: can_open,\n can_close: can_close,\n length: count\n };\n };\n // re-export Token class to use in block rules\n StateInline.prototype.Token = Token;\n // Skip text characters for text token, place those to pending buffer\n // and increment current pos\n // Rule to skip pure text\n // '{}$%@~+=:' reserved for extentions\n // !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n // !!!! Don't confuse with \"Markdown ASCII Punctuation\" chars\n // http://spec.commonmark.org/0.15/#ascii-punctuation-character\n function isTerminatorChar(ch) {\n switch (ch) {\n case 10 /* \\n */ :\n case 33 /* ! */ :\n case 35 /* # */ :\n case 36 /* $ */ :\n case 37 /* % */ :\n case 38 /* & */ :\n case 42 /* * */ :\n case 43 /* + */ :\n case 45 /* - */ :\n case 58 /* : */ :\n case 60 /* < */ :\n case 61 /* = */ :\n case 62 /* > */ :\n case 64 /* @ */ :\n case 91 /* [ */ :\n case 92 /* \\ */ :\n case 93 /* ] */ :\n case 94 /* ^ */ :\n case 95 /* _ */ :\n case 96 /* ` */ :\n case 123 /* { */ :\n case 125 /* } */ :\n case 126 /* ~ */ :\n return true;\n\n default:\n return false;\n }\n }\n function text(state, silent) {\n let pos = state.pos;\n while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {\n pos++;\n }\n if (pos === state.pos) {\n return false;\n }\n if (!silent) {\n state.pending += state.src.slice(state.pos, pos);\n }\n state.pos = pos;\n return true;\n }\n // Alternative implementation, for memory.\n\n // It costs 10% of performance, but allows extend terminators list, if place it\n // to `ParserInline` property. Probably, will switch to it sometime, such\n // flexibility required.\n /*\n var TERMINATOR_RE = /[\\n!#$%&*+\\-:<=>@[\\\\\\]^_`{}~]/;\n\n module.exports = function text(state, silent) {\n var pos = state.pos,\n idx = state.src.slice(pos).search(TERMINATOR_RE);\n\n // first char is terminator -> empty text\n if (idx === 0) { return false; }\n\n // no terminator -> text till end of string\n if (idx < 0) {\n if (!silent) { state.pending += state.src.slice(pos); }\n state.pos = state.src.length;\n return true;\n }\n\n if (!silent) { state.pending += state.src.slice(pos, pos + idx); }\n\n state.pos += idx;\n\n return true;\n }; */\n // Process links like https://example.org/\n // RFC3986: scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n const SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;\n function linkify(state, silent) {\n if (!state.md.options.linkify) return false;\n if (state.linkLevel > 0) return false;\n const pos = state.pos;\n const max = state.posMax;\n if (pos + 3 > max) return false;\n if (state.src.charCodeAt(pos) !== 58 /* : */) return false;\n if (state.src.charCodeAt(pos + 1) !== 47 /* / */) return false;\n if (state.src.charCodeAt(pos + 2) !== 47 /* / */) return false;\n const match = state.pending.match(SCHEME_RE);\n if (!match) return false;\n const proto = match[1];\n const link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length));\n if (!link) return false;\n let url = link.url;\n // invalid link, but still detected by linkify somehow;\n // need to check to prevent infinite loop below\n if (url.length <= proto.length) return false;\n // disallow '*' at the end of the link (conflicts with emphasis)\n // do manual backsearch to avoid perf issues with regex /\\*+$/ on \"****...****a\".\n let urlEnd = url.length;\n while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 42 /* * */) {\n urlEnd--;\n }\n if (urlEnd !== url.length) {\n url = url.slice(0, urlEnd);\n }\n const fullUrl = state.md.normalizeLink(url);\n if (!state.md.validateLink(fullUrl)) return false;\n if (!silent) {\n state.pending = state.pending.slice(0, -proto.length);\n const token_o = state.push(\"link_open\", \"a\", 1);\n token_o.attrs = [ [ \"href\", fullUrl ] ];\n token_o.markup = \"linkify\";\n token_o.info = \"auto\";\n const token_t = state.push(\"text\", \"\", 0);\n token_t.content = state.md.normalizeLinkText(url);\n const token_c = state.push(\"link_close\", \"a\", -1);\n token_c.markup = \"linkify\";\n token_c.info = \"auto\";\n }\n state.pos += url.length - proto.length;\n return true;\n }\n // Proceess '\\n'\n function newline(state, silent) {\n let pos = state.pos;\n if (state.src.charCodeAt(pos) !== 10 /* \\n */) {\n return false;\n }\n const pmax = state.pending.length - 1;\n const max = state.posMax;\n // ' \\n' -> hardbreak\n // Lookup in pending chars is bad practice! Don't copy to other rules!\n // Pending string is stored in concat mode, indexed lookups will cause\n // convertion to flat mode.\n if (!silent) {\n if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) {\n if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {\n // Find whitespaces tail of pending chars.\n let ws = pmax - 1;\n while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32) ws--;\n state.pending = state.pending.slice(0, ws);\n state.push(\"hardbreak\", \"br\", 0);\n } else {\n state.pending = state.pending.slice(0, -1);\n state.push(\"softbreak\", \"br\", 0);\n }\n } else {\n state.push(\"softbreak\", \"br\", 0);\n }\n }\n pos++;\n // skip heading spaces for next line\n while (pos < max && isSpace(state.src.charCodeAt(pos))) {\n pos++;\n }\n state.pos = pos;\n return true;\n }\n // Process escaped chars and hardbreaks\n const ESCAPED = [];\n for (let i = 0; i < 256; i++) {\n ESCAPED.push(0);\n }\n \"\\\\!\\\"#$%&'()*+,./:;<=>?@[]^_`{|}~-\".split(\"\").forEach(function(ch) {\n ESCAPED[ch.charCodeAt(0)] = 1;\n });\n function escape(state, silent) {\n let pos = state.pos;\n const max = state.posMax;\n if (state.src.charCodeAt(pos) !== 92 /* \\ */) return false;\n pos++;\n // '\\' at the end of the inline block\n if (pos >= max) return false;\n let ch1 = state.src.charCodeAt(pos);\n if (ch1 === 10) {\n if (!silent) {\n state.push(\"hardbreak\", \"br\", 0);\n }\n pos++;\n // skip leading whitespaces from next line\n while (pos < max) {\n ch1 = state.src.charCodeAt(pos);\n if (!isSpace(ch1)) break;\n pos++;\n }\n state.pos = pos;\n return true;\n }\n let escapedStr = state.src[pos];\n if (ch1 >= 55296 && ch1 <= 56319 && pos + 1 < max) {\n const ch2 = state.src.charCodeAt(pos + 1);\n if (ch2 >= 56320 && ch2 <= 57343) {\n escapedStr += state.src[pos + 1];\n pos++;\n }\n }\n const origStr = \"\\\\\" + escapedStr;\n if (!silent) {\n const token = state.push(\"text_special\", \"\", 0);\n if (ch1 < 256 && ESCAPED[ch1] !== 0) {\n token.content = escapedStr;\n } else {\n token.content = origStr;\n }\n token.markup = origStr;\n token.info = \"escape\";\n }\n state.pos = pos + 1;\n return true;\n }\n // Parse backticks\n function backtick(state, silent) {\n let pos = state.pos;\n const ch = state.src.charCodeAt(pos);\n if (ch !== 96 /* ` */) {\n return false;\n }\n const start = pos;\n pos++;\n const max = state.posMax;\n // scan marker length\n while (pos < max && state.src.charCodeAt(pos) === 96 /* ` */) {\n pos++;\n }\n const marker = state.src.slice(start, pos);\n const openerLength = marker.length;\n if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {\n if (!silent) state.pending += marker;\n state.pos += openerLength;\n return true;\n }\n let matchEnd = pos;\n let matchStart;\n // Nothing found in the cache, scan until the end of the line (or until marker is found)\n while ((matchStart = state.src.indexOf(\"`\", matchEnd)) !== -1) {\n matchEnd = matchStart + 1;\n // scan marker length\n while (matchEnd < max && state.src.charCodeAt(matchEnd) === 96 /* ` */) {\n matchEnd++;\n }\n const closerLength = matchEnd - matchStart;\n if (closerLength === openerLength) {\n // Found matching closer length.\n if (!silent) {\n const token = state.push(\"code_inline\", \"code\", 0);\n token.markup = marker;\n token.content = state.src.slice(pos, matchStart).replace(/\\n/g, \" \").replace(/^ (.+) $/, \"$1\");\n }\n state.pos = matchEnd;\n return true;\n }\n // Some different length found, put it in cache as upper limit of where closer can be found\n state.backticks[closerLength] = matchStart;\n }\n // Scanned through the end, didn't find anything\n state.backticksScanned = true;\n if (!silent) state.pending += marker;\n state.pos += openerLength;\n return true;\n }\n // ~~strike through~~\n\n // Insert each marker as a separate text token, and add it to delimiter list\n\n function strikethrough_tokenize(state, silent) {\n const start = state.pos;\n const marker = state.src.charCodeAt(start);\n if (silent) {\n return false;\n }\n if (marker !== 126 /* ~ */) {\n return false;\n }\n const scanned = state.scanDelims(state.pos, true);\n let len = scanned.length;\n const ch = String.fromCharCode(marker);\n if (len < 2) {\n return false;\n }\n let token;\n if (len % 2) {\n token = state.push(\"text\", \"\", 0);\n token.content = ch;\n len--;\n }\n for (let i = 0; i < len; i += 2) {\n token = state.push(\"text\", \"\", 0);\n token.content = ch + ch;\n state.delimiters.push({\n marker: marker,\n length: 0,\n // disable \"rule of 3\" length checks meant for emphasis\n token: state.tokens.length - 1,\n end: -1,\n open: scanned.can_open,\n close: scanned.can_close\n });\n }\n state.pos += scanned.length;\n return true;\n }\n function postProcess$1(state, delimiters) {\n let token;\n const loneMarkers = [];\n const max = delimiters.length;\n for (let i = 0; i < max; i++) {\n const startDelim = delimiters[i];\n if (startDelim.marker !== 126 /* ~ */) {\n continue;\n }\n if (startDelim.end === -1) {\n continue;\n }\n const endDelim = delimiters[startDelim.end];\n token = state.tokens[startDelim.token];\n token.type = \"s_open\";\n token.tag = \"s\";\n token.nesting = 1;\n token.markup = \"~~\";\n token.content = \"\";\n token = state.tokens[endDelim.token];\n token.type = \"s_close\";\n token.tag = \"s\";\n token.nesting = -1;\n token.markup = \"~~\";\n token.content = \"\";\n if (state.tokens[endDelim.token - 1].type === \"text\" && state.tokens[endDelim.token - 1].content === \"~\") {\n loneMarkers.push(endDelim.token - 1);\n }\n }\n // If a marker sequence has an odd number of characters, it's splitted\n // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the\n // start of the sequence.\n\n // So, we have to move all those markers after subsequent s_close tags.\n\n while (loneMarkers.length) {\n const i = loneMarkers.pop();\n let j = i + 1;\n while (j < state.tokens.length && state.tokens[j].type === \"s_close\") {\n j++;\n }\n j--;\n if (i !== j) {\n token = state.tokens[j];\n state.tokens[j] = state.tokens[i];\n state.tokens[i] = token;\n }\n }\n }\n // Walk through delimiter list and replace text tokens with tags\n\n function strikethrough_postProcess(state) {\n const tokens_meta = state.tokens_meta;\n const max = state.tokens_meta.length;\n postProcess$1(state, state.delimiters);\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n postProcess$1(state, tokens_meta[curr].delimiters);\n }\n }\n }\n var r_strikethrough = {\n tokenize: strikethrough_tokenize,\n postProcess: strikethrough_postProcess\n };\n // Process *this* and _that_\n\n // Insert each marker as a separate text token, and add it to delimiter list\n\n function emphasis_tokenize(state, silent) {\n const start = state.pos;\n const marker = state.src.charCodeAt(start);\n if (silent) {\n return false;\n }\n if (marker !== 95 /* _ */ && marker !== 42 /* * */) {\n return false;\n }\n const scanned = state.scanDelims(state.pos, marker === 42);\n for (let i = 0; i < scanned.length; i++) {\n const token = state.push(\"text\", \"\", 0);\n token.content = String.fromCharCode(marker);\n state.delimiters.push({\n // Char code of the starting marker (number).\n marker: marker,\n // Total length of these series of delimiters.\n length: scanned.length,\n // A position of the token this delimiter corresponds to.\n token: state.tokens.length - 1,\n // If this delimiter is matched as a valid opener, `end` will be\n // equal to its position, otherwise it's `-1`.\n end: -1,\n // Boolean flags that determine if this delimiter could open or close\n // an emphasis.\n open: scanned.can_open,\n close: scanned.can_close\n });\n }\n state.pos += scanned.length;\n return true;\n }\n function postProcess(state, delimiters) {\n const max = delimiters.length;\n for (let i = max - 1; i >= 0; i--) {\n const startDelim = delimiters[i];\n if (startDelim.marker !== 95 /* _ */ && startDelim.marker !== 42 /* * */) {\n continue;\n }\n // Process only opening markers\n if (startDelim.end === -1) {\n continue;\n }\n const endDelim = delimiters[startDelim.end];\n // If the previous delimiter has the same marker and is adjacent to this one,\n // merge those into one strong delimiter.\n\n // `whatever` -> `whatever`\n\n const isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 &&\n // check that first two markers match and adjacent\n delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 &&\n // check that last two markers are adjacent (we can safely assume they match)\n delimiters[startDelim.end + 1].token === endDelim.token + 1;\n const ch = String.fromCharCode(startDelim.marker);\n const token_o = state.tokens[startDelim.token];\n token_o.type = isStrong ? \"strong_open\" : \"em_open\";\n token_o.tag = isStrong ? \"strong\" : \"em\";\n token_o.nesting = 1;\n token_o.markup = isStrong ? ch + ch : ch;\n token_o.content = \"\";\n const token_c = state.tokens[endDelim.token];\n token_c.type = isStrong ? \"strong_close\" : \"em_close\";\n token_c.tag = isStrong ? \"strong\" : \"em\";\n token_c.nesting = -1;\n token_c.markup = isStrong ? ch + ch : ch;\n token_c.content = \"\";\n if (isStrong) {\n state.tokens[delimiters[i - 1].token].content = \"\";\n state.tokens[delimiters[startDelim.end + 1].token].content = \"\";\n i--;\n }\n }\n }\n // Walk through delimiter list and replace text tokens with tags\n\n function emphasis_post_process(state) {\n const tokens_meta = state.tokens_meta;\n const max = state.tokens_meta.length;\n postProcess(state, state.delimiters);\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n postProcess(state, tokens_meta[curr].delimiters);\n }\n }\n }\n var r_emphasis = {\n tokenize: emphasis_tokenize,\n postProcess: emphasis_post_process\n };\n // Process [link]( \"stuff\")\n function link(state, silent) {\n let code, label, res, ref;\n let href = \"\";\n let title = \"\";\n let start = state.pos;\n let parseReference = true;\n if (state.src.charCodeAt(state.pos) !== 91 /* [ */) {\n return false;\n }\n const oldPos = state.pos;\n const max = state.posMax;\n const labelStart = state.pos + 1;\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) {\n return false;\n }\n let pos = labelEnd + 1;\n if (pos < max && state.src.charCodeAt(pos) === 40 /* ( */) {\n // Inline link\n // might have found a valid shortcut link, disable reference parsing\n parseReference = false;\n // [link]( \"title\" )\n // ^^ skipping these spaces\n pos++;\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n if (pos >= max) {\n return false;\n }\n // [link]( \"title\" )\n // ^^^^^^ parsing link destination\n start = pos;\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);\n if (res.ok) {\n href = state.md.normalizeLink(res.str);\n if (state.md.validateLink(href)) {\n pos = res.pos;\n } else {\n href = \"\";\n }\n // [link]( \"title\" )\n // ^^ skipping these spaces\n start = pos;\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n // [link]( \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);\n if (pos < max && start !== pos && res.ok) {\n title = res.str;\n pos = res.pos;\n // [link]( \"title\" )\n // ^^ skipping these spaces\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n }\n }\n if (pos >= max || state.src.charCodeAt(pos) !== 41 /* ) */) {\n // parsing a valid shortcut link failed, fallback to reference\n parseReference = true;\n }\n pos++;\n }\n if (parseReference) {\n // Link reference\n if (typeof state.env.references === \"undefined\") {\n return false;\n }\n if (pos < max && state.src.charCodeAt(pos) === 91 /* [ */) {\n start = pos + 1;\n pos = state.md.helpers.parseLinkLabel(state, pos);\n if (pos >= 0) {\n label = state.src.slice(start, pos++);\n } else {\n pos = labelEnd + 1;\n }\n } else {\n pos = labelEnd + 1;\n }\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) {\n label = state.src.slice(labelStart, labelEnd);\n }\n ref = state.env.references[normalizeReference(label)];\n if (!ref) {\n state.pos = oldPos;\n return false;\n }\n href = ref.href;\n title = ref.title;\n }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n\n if (!silent) {\n state.pos = labelStart;\n state.posMax = labelEnd;\n const token_o = state.push(\"link_open\", \"a\", 1);\n const attrs = [ [ \"href\", href ] ];\n token_o.attrs = attrs;\n if (title) {\n attrs.push([ \"title\", title ]);\n }\n state.linkLevel++;\n state.md.inline.tokenize(state);\n state.linkLevel--;\n state.push(\"link_close\", \"a\", -1);\n }\n state.pos = pos;\n state.posMax = max;\n return true;\n }\n // Process ![image]( \"title\")\n function image(state, silent) {\n let code, content, label, pos, ref, res, title, start;\n let href = \"\";\n const oldPos = state.pos;\n const max = state.posMax;\n if (state.src.charCodeAt(state.pos) !== 33 /* ! */) {\n return false;\n }\n if (state.src.charCodeAt(state.pos + 1) !== 91 /* [ */) {\n return false;\n }\n const labelStart = state.pos + 2;\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) {\n return false;\n }\n pos = labelEnd + 1;\n if (pos < max && state.src.charCodeAt(pos) === 40 /* ( */) {\n // Inline link\n // [link]( \"title\" )\n // ^^ skipping these spaces\n pos++;\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n if (pos >= max) {\n return false;\n }\n // [link]( \"title\" )\n // ^^^^^^ parsing link destination\n start = pos;\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);\n if (res.ok) {\n href = state.md.normalizeLink(res.str);\n if (state.md.validateLink(href)) {\n pos = res.pos;\n } else {\n href = \"\";\n }\n }\n // [link]( \"title\" )\n // ^^ skipping these spaces\n start = pos;\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n // [link]( \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);\n if (pos < max && start !== pos && res.ok) {\n title = res.str;\n pos = res.pos;\n // [link]( \"title\" )\n // ^^ skipping these spaces\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n } else {\n title = \"\";\n }\n if (pos >= max || state.src.charCodeAt(pos) !== 41 /* ) */) {\n state.pos = oldPos;\n return false;\n }\n pos++;\n } else {\n // Link reference\n if (typeof state.env.references === \"undefined\") {\n return false;\n }\n if (pos < max && state.src.charCodeAt(pos) === 91 /* [ */) {\n start = pos + 1;\n pos = state.md.helpers.parseLinkLabel(state, pos);\n if (pos >= 0) {\n label = state.src.slice(start, pos++);\n } else {\n pos = labelEnd + 1;\n }\n } else {\n pos = labelEnd + 1;\n }\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) {\n label = state.src.slice(labelStart, labelEnd);\n }\n ref = state.env.references[normalizeReference(label)];\n if (!ref) {\n state.pos = oldPos;\n return false;\n }\n href = ref.href;\n title = ref.title;\n }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n\n if (!silent) {\n content = state.src.slice(labelStart, labelEnd);\n const tokens = [];\n state.md.inline.parse(content, state.md, state.env, tokens);\n const token = state.push(\"image\", \"img\", 0);\n const attrs = [ [ \"src\", href ], [ \"alt\", \"\" ] ];\n token.attrs = attrs;\n token.children = tokens;\n token.content = content;\n if (title) {\n attrs.push([ \"title\", title ]);\n }\n }\n state.pos = pos;\n state.posMax = max;\n return true;\n }\n // Process autolinks ''\n /* eslint max-len:0 */ const EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/;\n /* eslint-disable-next-line no-control-regex */ const AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\\x00-\\x20]*)$/;\n function autolink(state, silent) {\n let pos = state.pos;\n if (state.src.charCodeAt(pos) !== 60 /* < */) {\n return false;\n }\n const start = state.pos;\n const max = state.posMax;\n for (;;) {\n if (++pos >= max) return false;\n const ch = state.src.charCodeAt(pos);\n if (ch === 60 /* < */) return false;\n if (ch === 62 /* > */) break;\n }\n const url = state.src.slice(start + 1, pos);\n if (AUTOLINK_RE.test(url)) {\n const fullUrl = state.md.normalizeLink(url);\n if (!state.md.validateLink(fullUrl)) {\n return false;\n }\n if (!silent) {\n const token_o = state.push(\"link_open\", \"a\", 1);\n token_o.attrs = [ [ \"href\", fullUrl ] ];\n token_o.markup = \"autolink\";\n token_o.info = \"auto\";\n const token_t = state.push(\"text\", \"\", 0);\n token_t.content = state.md.normalizeLinkText(url);\n const token_c = state.push(\"link_close\", \"a\", -1);\n token_c.markup = \"autolink\";\n token_c.info = \"auto\";\n }\n state.pos += url.length + 2;\n return true;\n }\n if (EMAIL_RE.test(url)) {\n const fullUrl = state.md.normalizeLink(\"mailto:\" + url);\n if (!state.md.validateLink(fullUrl)) {\n return false;\n }\n if (!silent) {\n const token_o = state.push(\"link_open\", \"a\", 1);\n token_o.attrs = [ [ \"href\", fullUrl ] ];\n token_o.markup = \"autolink\";\n token_o.info = \"auto\";\n const token_t = state.push(\"text\", \"\", 0);\n token_t.content = state.md.normalizeLinkText(url);\n const token_c = state.push(\"link_close\", \"a\", -1);\n token_c.markup = \"autolink\";\n token_c.info = \"auto\";\n }\n state.pos += url.length + 2;\n return true;\n }\n return false;\n }\n // Process html tags\n function isLinkOpen(str) {\n return /^\\s]/i.test(str);\n }\n function isLinkClose(str) {\n return /^<\\/a\\s*>/i.test(str);\n }\n function isLetter(ch) {\n /* eslint no-bitwise:0 */\n const lc = ch | 32;\n // to lower case\n return lc >= 97 /* a */ && lc <= 122 /* z */;\n }\n function html_inline(state, silent) {\n if (!state.md.options.html) {\n return false;\n }\n // Check start\n const max = state.posMax;\n const pos = state.pos;\n if (state.src.charCodeAt(pos) !== 60 /* < */ || pos + 2 >= max) {\n return false;\n }\n // Quick fail on second char\n const ch = state.src.charCodeAt(pos + 1);\n if (ch !== 33 /* ! */ && ch !== 63 /* ? */ && ch !== 47 /* / */ && !isLetter(ch)) {\n return false;\n }\n const match = state.src.slice(pos).match(HTML_TAG_RE);\n if (!match) {\n return false;\n }\n if (!silent) {\n const token = state.push(\"html_inline\", \"\", 0);\n token.content = match[0];\n if (isLinkOpen(token.content)) state.linkLevel++;\n if (isLinkClose(token.content)) state.linkLevel--;\n }\n state.pos += match[0].length;\n return true;\n }\n // Process html entity - {, ¯, ", ...\n const DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;\n const NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;\n function entity(state, silent) {\n const pos = state.pos;\n const max = state.posMax;\n if (state.src.charCodeAt(pos) !== 38 /* & */) return false;\n if (pos + 1 >= max) return false;\n const ch = state.src.charCodeAt(pos + 1);\n if (ch === 35 /* # */) {\n const match = state.src.slice(pos).match(DIGITAL_RE);\n if (match) {\n if (!silent) {\n const code = match[1][0].toLowerCase() === \"x\" ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);\n const token = state.push(\"text_special\", \"\", 0);\n token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(65533);\n token.markup = match[0];\n token.info = \"entity\";\n }\n state.pos += match[0].length;\n return true;\n }\n } else {\n const match = state.src.slice(pos).match(NAMED_RE);\n if (match) {\n const decoded = decodeHTML(match[0]);\n if (decoded !== match[0]) {\n if (!silent) {\n const token = state.push(\"text_special\", \"\", 0);\n token.content = decoded;\n token.markup = match[0];\n token.info = \"entity\";\n }\n state.pos += match[0].length;\n return true;\n }\n }\n }\n return false;\n }\n // For each opening emphasis-like marker find a matching closing one\n\n function processDelimiters(delimiters) {\n const openersBottom = {};\n const max = delimiters.length;\n if (!max) return;\n // headerIdx is the first delimiter of the current (where closer is) delimiter run\n let headerIdx = 0;\n let lastTokenIdx = -2;\n // needs any value lower than -1\n const jumps = [];\n for (let closerIdx = 0; closerIdx < max; closerIdx++) {\n const closer = delimiters[closerIdx];\n jumps.push(0);\n // markers belong to same delimiter run if:\n // - they have adjacent tokens\n // - AND markers are the same\n\n if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {\n headerIdx = closerIdx;\n }\n lastTokenIdx = closer.token;\n // Length is only used for emphasis-specific \"rule of 3\",\n // if it's not defined (in strikethrough or 3rd party plugins),\n // we can default it to 0 to disable those checks.\n\n closer.length = closer.length || 0;\n if (!closer.close) continue;\n // Previously calculated lower bounds (previous fails)\n // for each marker, each delimiter length modulo 3,\n // and for whether this closer can be an opener;\n // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460\n /* eslint-disable-next-line no-prototype-builtins */ if (!openersBottom.hasOwnProperty(closer.marker)) {\n openersBottom[closer.marker] = [ -1, -1, -1, -1, -1, -1 ];\n }\n const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3];\n let openerIdx = headerIdx - jumps[headerIdx] - 1;\n let newMinOpenerIdx = openerIdx;\n for (;openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {\n const opener = delimiters[openerIdx];\n if (opener.marker !== closer.marker) continue;\n if (opener.open && opener.end < 0) {\n let isOddMatch = false;\n // from spec:\n\n // If one of the delimiters can both open and close emphasis, then the\n // sum of the lengths of the delimiter runs containing the opening and\n // closing delimiters must not be a multiple of 3 unless both lengths\n // are multiples of 3.\n\n if (opener.close || closer.open) {\n if ((opener.length + closer.length) % 3 === 0) {\n if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {\n isOddMatch = true;\n }\n }\n }\n if (!isOddMatch) {\n // If previous delimiter cannot be an opener, we can safely skip\n // the entire sequence in future checks. This is required to make\n // sure algorithm has linear complexity (see *_*_*_*_*_... case).\n const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0;\n jumps[closerIdx] = closerIdx - openerIdx + lastJump;\n jumps[openerIdx] = lastJump;\n closer.open = false;\n opener.end = closerIdx;\n opener.close = false;\n newMinOpenerIdx = -1;\n // treat next token as start of run,\n // it optimizes skips in **<...>**a**<...>** pathological case\n lastTokenIdx = -2;\n break;\n }\n }\n }\n if (newMinOpenerIdx !== -1) {\n // If match for this delimiter run failed, we want to set lower bound for\n // future lookups. This is required to make sure algorithm has linear\n // complexity.\n // See details here:\n // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442\n openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx;\n }\n }\n }\n function link_pairs(state) {\n const tokens_meta = state.tokens_meta;\n const max = state.tokens_meta.length;\n processDelimiters(state.delimiters);\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n processDelimiters(tokens_meta[curr].delimiters);\n }\n }\n }\n // Clean up tokens after emphasis and strikethrough postprocessing:\n // merge adjacent text nodes into one and re-calculate all token levels\n\n // This is necessary because initially emphasis delimiter markers (*, _, ~)\n // are treated as their own separate text tokens. Then emphasis rule either\n // leaves them as text (needed to merge with adjacent text) or turns them\n // into opening/closing tags (which messes up levels inside).\n\n function fragments_join(state) {\n let curr, last;\n let level = 0;\n const tokens = state.tokens;\n const max = state.tokens.length;\n for (curr = last = 0; curr < max; curr++) {\n // re-calculate levels after emphasis/strikethrough turns some text nodes\n // into opening/closing tags\n if (tokens[curr].nesting < 0) level--;\n // closing tag\n tokens[curr].level = level;\n if (tokens[curr].nesting > 0) level++;\n // opening tag\n if (tokens[curr].type === \"text\" && curr + 1 < max && tokens[curr + 1].type === \"text\") {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;\n } else {\n if (curr !== last) {\n tokens[last] = tokens[curr];\n }\n last++;\n }\n }\n if (curr !== last) {\n tokens.length = last;\n }\n }\n /** internal\n * class ParserInline\n *\n * Tokenizes paragraph content.\n **/\n // Parser rules\n const _rules = [ [ \"text\", text ], [ \"linkify\", linkify ], [ \"newline\", newline ], [ \"escape\", escape ], [ \"backticks\", backtick ], [ \"strikethrough\", r_strikethrough.tokenize ], [ \"emphasis\", r_emphasis.tokenize ], [ \"link\", link ], [ \"image\", image ], [ \"autolink\", autolink ], [ \"html_inline\", html_inline ], [ \"entity\", entity ] ];\n // `rule2` ruleset was created specifically for emphasis/strikethrough\n // post-processing and may be changed in the future.\n\n // Don't use this for anything except pairs (plugins working with `balance_pairs`).\n\n const _rules2 = [ [ \"balance_pairs\", link_pairs ], [ \"strikethrough\", r_strikethrough.postProcess ], [ \"emphasis\", r_emphasis.postProcess ],\n // rules for pairs separate '**' into its own text tokens, which may be left unused,\n // rule below merges unused segments back with the rest of the text\n [ \"fragments_join\", fragments_join ] ];\n /**\n * new ParserInline()\n **/ function ParserInline() {\n /**\n * ParserInline#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of inline rules.\n **/\n this.ruler = new Ruler;\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n /**\n * ParserInline#ruler2 -> Ruler\n *\n * [[Ruler]] instance. Second ruler used for post-processing\n * (e.g. in emphasis-like rules).\n **/ this.ruler2 = new Ruler;\n for (let i = 0; i < _rules2.length; i++) {\n this.ruler2.push(_rules2[i][0], _rules2[i][1]);\n }\n }\n // Skip single token by running all rules in validation mode;\n // returns `true` if any rule reported success\n\n ParserInline.prototype.skipToken = function(state) {\n const pos = state.pos;\n const rules = this.ruler.getRules(\"\");\n const len = rules.length;\n const maxNesting = state.md.options.maxNesting;\n const cache = state.cache;\n if (typeof cache[pos] !== \"undefined\") {\n state.pos = cache[pos];\n return;\n }\n let ok = false;\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n // Increment state.level and decrement it later to limit recursion.\n // It's harmless to do here, because no tokens are created. But ideally,\n // we'd need a separate private state variable for this purpose.\n state.level++;\n ok = rules[i](state, true);\n state.level--;\n if (ok) {\n if (pos >= state.pos) {\n throw new Error(\"inline rule didn't increment state.pos\");\n }\n break;\n }\n }\n } else {\n // Too much nesting, just skip until the end of the paragraph.\n // NOTE: this will cause links to behave incorrectly in the following case,\n // when an amount of `[` is exactly equal to `maxNesting + 1`:\n // [[[[[[[[[[[[[[[[[[[[[foo]()\n // TODO: remove this workaround when CM standard will allow nested links\n // (we can replace it by preventing links from being parsed in\n // validation mode)\n state.pos = state.posMax;\n }\n if (!ok) {\n state.pos++;\n }\n cache[pos] = state.pos;\n };\n // Generate tokens for input range\n\n ParserInline.prototype.tokenize = function(state) {\n const rules = this.ruler.getRules(\"\");\n const len = rules.length;\n const end = state.posMax;\n const maxNesting = state.md.options.maxNesting;\n while (state.pos < end) {\n // Try all possible rules.\n // On success, rule should:\n // - update `state.pos`\n // - update `state.tokens`\n // - return true\n const prevPos = state.pos;\n let ok = false;\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, false);\n if (ok) {\n if (prevPos >= state.pos) {\n throw new Error(\"inline rule didn't increment state.pos\");\n }\n break;\n }\n }\n }\n if (ok) {\n if (state.pos >= end) {\n break;\n }\n continue;\n }\n state.pending += state.src[state.pos++];\n }\n if (state.pending) {\n state.pushPending();\n }\n };\n /**\n * ParserInline.parse(str, md, env, outTokens)\n *\n * Process input string and push inline tokens into `outTokens`\n **/ ParserInline.prototype.parse = function(str, md, env, outTokens) {\n const state = new this.State(str, md, env, outTokens);\n this.tokenize(state);\n const rules = this.ruler2.getRules(\"\");\n const len = rules.length;\n for (let i = 0; i < len; i++) {\n rules[i](state);\n }\n };\n ParserInline.prototype.State = StateInline;\n function reFactory(opts) {\n const re = {};\n opts = opts || {};\n re.src_Any = Any.source;\n re.src_Cc = Cc.source;\n re.src_Z = Z.source;\n re.src_P = P.source;\n // \\p{\\Z\\P\\Cc\\CF} (white spaces + control + format + punctuation)\n re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join(\"|\");\n // \\p{\\Z\\Cc} (white spaces + control)\n re.src_ZCc = [ re.src_Z, re.src_Cc ].join(\"|\");\n // Experimental. List of chars, completely prohibited in links\n // because can separate it from other part of text\n const text_separators = \"[><\\uff5c]\";\n // All possible word characters (everything without punctuation, spaces & controls)\n // Defined via punctuation & spaces to save space\n // Should be something like \\p{\\L\\N\\S\\M} (\\w but without `_`)\n re.src_pseudo_letter = \"(?:(?!\" + text_separators + \"|\" + re.src_ZPCc + \")\" + re.src_Any + \")\";\n // The same as abothe but without [0-9]\n // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';\n re.src_ip4 = \"(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\";\n // Prohibit any of \"@/[]()\" in user/pass to avoid wrong domain fetch.\n re.src_auth = \"(?:(?:(?!\" + re.src_ZCc + \"|[@/\\\\[\\\\]()]).)+@)?\";\n re.src_port = \"(?::(?:6(?:[0-4]\\\\d{3}|5(?:[0-4]\\\\d{2}|5(?:[0-2]\\\\d|3[0-5])))|[1-5]?\\\\d{1,4}))?\";\n re.src_host_terminator = \"(?=$|\" + text_separators + \"|\" + re.src_ZPCc + \")\" + \"(?!\" + (opts[\"---\"] ? \"-(?!--)|\" : \"-|\") + \"_|:\\\\d|\\\\.-|\\\\.(?!$|\" + re.src_ZPCc + \"))\";\n re.src_path = \"(?:\" + \"[/?#]\" + \"(?:\" + \"(?!\" + re.src_ZCc + \"|\" + text_separators + \"|[()[\\\\]{}.,\\\"'?!\\\\-;]).|\" + \"\\\\[(?:(?!\" + re.src_ZCc + \"|\\\\]).)*\\\\]|\" + \"\\\\((?:(?!\" + re.src_ZCc + \"|[)]).)*\\\\)|\" + \"\\\\{(?:(?!\" + re.src_ZCc + \"|[}]).)*\\\\}|\" + '\\\\\"(?:(?!' + re.src_ZCc + '|[\"]).)+\\\\\"|' + \"\\\\'(?:(?!\" + re.src_ZCc + \"|[']).)+\\\\'|\" +\n // allow `I'm_king` if no pair found\n \"\\\\'(?=\" + re.src_pseudo_letter + \"|[-])|\" +\n // google has many dots in \"google search\" links (#66, #81).\n // github has ... in commit range links,\n // Restrict to\n // - english\n // - percent-encoded\n // - parts of file path\n // - params separator\n // until more examples found.\n \"\\\\.{2,}[a-zA-Z0-9%/&]|\" + \"\\\\.(?!\" + re.src_ZCc + \"|[.]|$)|\" + (opts[\"---\"] ? \"\\\\-(?!--(?:[^-]|$))(?:-*)|\" : \"\\\\-+|\") +\n // allow `,,,` in paths\n \",(?!\" + re.src_ZCc + \"|$)|\" +\n // allow `;` if not followed by space-like char\n \";(?!\" + re.src_ZCc + \"|$)|\" +\n // allow `!!!` in paths, but not at the end\n \"\\\\!+(?!\" + re.src_ZCc + \"|[!]|$)|\" + \"\\\\?(?!\" + re.src_ZCc + \"|[?]|$)\" + \")+\" + \"|\\\\/\" + \")?\";\n // Allow anything in markdown spec, forbid quote (\") at the first position\n // because emails enclosed in quotes are far more common\n re.src_email_name = '[\\\\-;:&=\\\\+\\\\$,\\\\.a-zA-Z0-9_][\\\\-;:&=\\\\+\\\\$,\\\\\"\\\\.a-zA-Z0-9_]*';\n re.src_xn = \"xn--[a-z0-9\\\\-]{1,59}\";\n // More to read about domain names\n // http://serverfault.com/questions/638260/\n re.src_domain_root =\n // Allow letters & digits (http://test1)\n \"(?:\" + re.src_xn + \"|\" + re.src_pseudo_letter + \"{1,63}\" + \")\";\n re.src_domain = \"(?:\" + re.src_xn + \"|\" + \"(?:\" + re.src_pseudo_letter + \")\" + \"|\" + \"(?:\" + re.src_pseudo_letter + \"(?:-|\" + re.src_pseudo_letter + \"){0,61}\" + re.src_pseudo_letter + \")\" + \")\";\n re.src_host = \"(?:\" +\n // Don't need IP check, because digits are already allowed in normal domain names\n // src_ip4 +\n // '|' +\n \"(?:(?:(?:\" + re.src_domain + \")\\\\.)*\" + re.src_domain /* _root */ + \")\" + \")\";\n re.tpl_host_fuzzy = \"(?:\" + re.src_ip4 + \"|\" + \"(?:(?:(?:\" + re.src_domain + \")\\\\.)+(?:%TLDS%))\" + \")\";\n re.tpl_host_no_ip_fuzzy = \"(?:(?:(?:\" + re.src_domain + \")\\\\.)+(?:%TLDS%))\";\n re.src_host_strict = re.src_host + re.src_host_terminator;\n re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator;\n re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator;\n re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;\n re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;\n\n // Main rules\n\n // Rude test fuzzy links by host, for quick deny\n re.tpl_host_fuzzy_test = \"localhost|www\\\\.|\\\\.\\\\d{1,3}\\\\.|(?:\\\\.(?:%TLDS%)(?:\" + re.src_ZPCc + \"|>|$))\";\n re.tpl_email_fuzzy = \"(^|\" + text_separators + '|\"|\\\\(|' + re.src_ZCc + \")\" + \"(\" + re.src_email_name + \"@\" + re.tpl_host_fuzzy_strict + \")\";\n re.tpl_link_fuzzy =\n // Fuzzy link can't be prepended with .:/\\- and non punctuation.\n // but can start with > (markdown blockquote)\n \"(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\\uff5c]|\" + re.src_ZPCc + \"))\" + \"((?![$+<=>^`|\\uff5c])\" + re.tpl_host_port_fuzzy_strict + re.src_path + \")\";\n re.tpl_link_no_ip_fuzzy =\n // Fuzzy link can't be prepended with .:/\\- and non punctuation.\n // but can start with > (markdown blockquote)\n \"(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\\uff5c]|\" + re.src_ZPCc + \"))\" + \"((?![$+<=>^`|\\uff5c])\" + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + \")\";\n return re;\n }\n\n // Helpers\n\n // Merge objects\n\n function assign(obj /* from1, from2, from3, ... */) {\n const sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n if (!source) {\n return;\n }\n Object.keys(source).forEach(function(key) {\n obj[key] = source[key];\n });\n });\n return obj;\n }\n function _class(obj) {\n return Object.prototype.toString.call(obj);\n }\n function isString(obj) {\n return _class(obj) === \"[object String]\";\n }\n function isObject(obj) {\n return _class(obj) === \"[object Object]\";\n }\n function isRegExp(obj) {\n return _class(obj) === \"[object RegExp]\";\n }\n function isFunction(obj) {\n return _class(obj) === \"[object Function]\";\n }\n function escapeRE(str) {\n return str.replace(/[.?*+^$[\\]\\\\(){}|-]/g, \"\\\\$&\");\n }\n\n const defaultOptions = {\n fuzzyLink: true,\n fuzzyEmail: true,\n fuzzyIP: false\n };\n function isOptionsObj(obj) {\n return Object.keys(obj || {}).reduce(function(acc, k) {\n /* eslint-disable-next-line no-prototype-builtins */\n return acc || defaultOptions.hasOwnProperty(k);\n }, false);\n }\n const defaultSchemas = {\n \"http:\": {\n validate: function(text, pos, self) {\n const tail = text.slice(pos);\n if (!self.re.http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.http = new RegExp(\"^\\\\/\\\\/\" + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, \"i\");\n }\n if (self.re.http.test(tail)) {\n return tail.match(self.re.http)[0].length;\n }\n return 0;\n }\n },\n \"https:\": \"http:\",\n \"ftp:\": \"http:\",\n \"//\": {\n validate: function(text, pos, self) {\n const tail = text.slice(pos);\n if (!self.re.no_http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.no_http = new RegExp(\"^\" + self.re.src_auth +\n // Don't allow single-level domains, because of false positives like '//test'\n // with code comments\n \"(?:localhost|(?:(?:\" + self.re.src_domain + \")\\\\.)+\" + self.re.src_domain_root + \")\" + self.re.src_port + self.re.src_host_terminator + self.re.src_path, \"i\");\n }\n if (self.re.no_http.test(tail)) {\n // should not be `://` & `///`, that protects from errors in protocol name\n if (pos >= 3 && text[pos - 3] === \":\") {\n return 0;\n }\n if (pos >= 3 && text[pos - 3] === \"/\") {\n return 0;\n }\n return tail.match(self.re.no_http)[0].length;\n }\n return 0;\n }\n },\n \"mailto:\": {\n validate: function(text, pos, self) {\n const tail = text.slice(pos);\n if (!self.re.mailto) {\n self.re.mailto = new RegExp(\"^\" + self.re.src_email_name + \"@\" + self.re.src_host_strict, \"i\");\n }\n if (self.re.mailto.test(tail)) {\n return tail.match(self.re.mailto)[0].length;\n }\n return 0;\n }\n }\n };\n // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)\n /* eslint-disable-next-line max-len */ const tlds_2ch_src_re = \"a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]\";\n // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead\n const tlds_default = \"biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\\u0440\\u0444\".split(\"|\");\n function resetScanCache(self) {\n self.__index__ = -1;\n self.__text_cache__ = \"\";\n }\n function createValidator(re) {\n return function(text, pos) {\n const tail = text.slice(pos);\n if (re.test(tail)) {\n return tail.match(re)[0].length;\n }\n return 0;\n };\n }\n function createNormalizer() {\n return function(match, self) {\n self.normalize(match);\n };\n }\n // Schemas compiler. Build regexps.\n\n function compile(self) {\n // Load & clone RE patterns.\n const re = self.re = reFactory(self.__opts__);\n // Define dynamic patterns\n const tlds = self.__tlds__.slice();\n self.onCompile();\n if (!self.__tlds_replaced__) {\n tlds.push(tlds_2ch_src_re);\n }\n tlds.push(re.src_xn);\n re.src_tlds = tlds.join(\"|\");\n function untpl(tpl) {\n return tpl.replace(\"%TLDS%\", re.src_tlds);\n }\n re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), \"i\");\n re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), \"i\");\n re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), \"i\");\n re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), \"i\");\n\n // Compile each schema\n\n const aliases = [];\n self.__compiled__ = {};\n // Reset compiled data\n function schemaError(name, val) {\n throw new Error('(LinkifyIt) Invalid schema \"' + name + '\": ' + val);\n }\n Object.keys(self.__schemas__).forEach(function(name) {\n const val = self.__schemas__[name];\n // skip disabled methods\n if (val === null) {\n return;\n }\n const compiled = {\n validate: null,\n link: null\n };\n self.__compiled__[name] = compiled;\n if (isObject(val)) {\n if (isRegExp(val.validate)) {\n compiled.validate = createValidator(val.validate);\n } else if (isFunction(val.validate)) {\n compiled.validate = val.validate;\n } else {\n schemaError(name, val);\n }\n if (isFunction(val.normalize)) {\n compiled.normalize = val.normalize;\n } else if (!val.normalize) {\n compiled.normalize = createNormalizer();\n } else {\n schemaError(name, val);\n }\n return;\n }\n if (isString(val)) {\n aliases.push(name);\n return;\n }\n schemaError(name, val);\n });\n\n // Compile postponed aliases\n\n aliases.forEach(function(alias) {\n if (!self.__compiled__[self.__schemas__[alias]]) {\n // Silently fail on missed schemas to avoid errons on disable.\n // schemaError(alias, self.__schemas__[alias]);\n return;\n }\n self.__compiled__[alias].validate = self.__compiled__[self.__schemas__[alias]].validate;\n self.__compiled__[alias].normalize = self.__compiled__[self.__schemas__[alias]].normalize;\n });\n\n // Fake record for guessed links\n\n self.__compiled__[\"\"] = {\n validate: null,\n normalize: createNormalizer()\n };\n\n // Build schema condition\n\n const slist = Object.keys(self.__compiled__).filter(function(name) {\n // Filter disabled & fake schemas\n return name.length > 0 && self.__compiled__[name];\n }).map(escapeRE).join(\"|\");\n // (?!_) cause 1.5x slowdown\n self.re.schema_test = RegExp(\"(^|(?!_)(?:[><\\uff5c]|\" + re.src_ZPCc + \"))(\" + slist + \")\", \"i\");\n self.re.schema_search = RegExp(\"(^|(?!_)(?:[><\\uff5c]|\" + re.src_ZPCc + \"))(\" + slist + \")\", \"ig\");\n self.re.schema_at_start = RegExp(\"^\" + self.re.schema_search.source, \"i\");\n self.re.pretest = RegExp(\"(\" + self.re.schema_test.source + \")|(\" + self.re.host_fuzzy_test.source + \")|@\", \"i\");\n\n // Cleanup\n\n resetScanCache(self);\n }\n /**\n * class Match\n *\n * Match result. Single element of array, returned by [[LinkifyIt#match]]\n **/ function Match(self, shift) {\n const start = self.__index__;\n const end = self.__last_index__;\n const text = self.__text_cache__.slice(start, end);\n /**\n * Match#schema -> String\n *\n * Prefix (protocol) for matched string.\n **/ this.schema = self.__schema__.toLowerCase();\n /**\n * Match#index -> Number\n *\n * First position of matched string.\n **/ this.index = start + shift;\n /**\n * Match#lastIndex -> Number\n *\n * Next position after matched string.\n **/ this.lastIndex = end + shift;\n /**\n * Match#raw -> String\n *\n * Matched string.\n **/ this.raw = text;\n /**\n * Match#text -> String\n *\n * Notmalized text of matched string.\n **/ this.text = text;\n /**\n * Match#url -> String\n *\n * Normalized url of matched string.\n **/ this.url = text;\n }\n function createMatch(self, shift) {\n const match = new Match(self, shift);\n self.__compiled__[match.schema].normalize(match, self);\n return match;\n }\n /**\n * class LinkifyIt\n **/\n /**\n * new LinkifyIt(schemas, options)\n * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Creates new linkifier instance with optional additional schemas.\n * Can be called without `new` keyword for convenience.\n *\n * By default understands:\n *\n * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n * - \"fuzzy\" links and emails (example.com, foo@bar.com).\n *\n * `schemas` is an object, where each key/value describes protocol/rule:\n *\n * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`\n * for example). `linkify-it` makes shure that prefix is not preceeded with\n * alphanumeric char and symbols. Only whitespaces and punctuation allowed.\n * - __value__ - rule to check tail after link prefix\n * - _String_ - just alias to existing rule\n * - _Object_\n * - _validate_ - validator function (should return matched length on success),\n * or `RegExp`.\n * - _normalize_ - optional function to normalize text & url of matched result\n * (for example, for @twitter mentions).\n *\n * `options`:\n *\n * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.\n * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts\n * like version numbers. Default `false`.\n * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.\n *\n **/ function LinkifyIt(schemas, options) {\n if (!(this instanceof LinkifyIt)) {\n return new LinkifyIt(schemas, options);\n }\n if (!options) {\n if (isOptionsObj(schemas)) {\n options = schemas;\n schemas = {};\n }\n }\n this.__opts__ = assign({}, defaultOptions, options);\n // Cache last tested result. Used to skip repeating steps on next `match` call.\n this.__index__ = -1;\n this.__last_index__ = -1;\n // Next scan position\n this.__schema__ = \"\";\n this.__text_cache__ = \"\";\n this.__schemas__ = assign({}, defaultSchemas, schemas);\n this.__compiled__ = {};\n this.__tlds__ = tlds_default;\n this.__tlds_replaced__ = false;\n this.re = {};\n compile(this);\n }\n /** chainable\n * LinkifyIt#add(schema, definition)\n * - schema (String): rule name (fixed pattern prefix)\n * - definition (String|RegExp|Object): schema definition\n *\n * Add new rule definition. See constructor description for details.\n **/ LinkifyIt.prototype.add = function add(schema, definition) {\n this.__schemas__[schema] = definition;\n compile(this);\n return this;\n };\n /** chainable\n * LinkifyIt#set(options)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Set recognition options for links without schema.\n **/ LinkifyIt.prototype.set = function set(options) {\n this.__opts__ = assign(this.__opts__, options);\n return this;\n };\n /**\n * LinkifyIt#test(text) -> Boolean\n *\n * Searches linkifiable pattern and returns `true` on success or `false` on fail.\n **/ LinkifyIt.prototype.test = function test(text) {\n // Reset scan cache\n this.__text_cache__ = text;\n this.__index__ = -1;\n if (!text.length) {\n return false;\n }\n let m, ml, me, len, shift, next, re, tld_pos, at_pos;\n // try to scan for link with schema - that's the most simple rule\n if (this.re.schema_test.test(text)) {\n re = this.re.schema_search;\n re.lastIndex = 0;\n while ((m = re.exec(text)) !== null) {\n len = this.testSchemaAt(text, m[2], re.lastIndex);\n if (len) {\n this.__schema__ = m[2];\n this.__index__ = m.index + m[1].length;\n this.__last_index__ = m.index + m[0].length + len;\n break;\n }\n }\n }\n if (this.__opts__.fuzzyLink && this.__compiled__[\"http:\"]) {\n // guess schemaless links\n tld_pos = text.search(this.re.host_fuzzy_test);\n if (tld_pos >= 0) {\n // if tld is located after found link - no need to check fuzzy pattern\n if (this.__index__ < 0 || tld_pos < this.__index__) {\n if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {\n shift = ml.index + ml[1].length;\n if (this.__index__ < 0 || shift < this.__index__) {\n this.__schema__ = \"\";\n this.__index__ = shift;\n this.__last_index__ = ml.index + ml[0].length;\n }\n }\n }\n }\n }\n if (this.__opts__.fuzzyEmail && this.__compiled__[\"mailto:\"]) {\n // guess schemaless emails\n at_pos = text.indexOf(\"@\");\n if (at_pos >= 0) {\n // We can't skip this check, because this cases are possible:\n // 192.168.1.1@gmail.com, my.in@example.com\n if ((me = text.match(this.re.email_fuzzy)) !== null) {\n shift = me.index + me[1].length;\n next = me.index + me[0].length;\n if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) {\n this.__schema__ = \"mailto:\";\n this.__index__ = shift;\n this.__last_index__ = next;\n }\n }\n }\n }\n return this.__index__ >= 0;\n };\n /**\n * LinkifyIt#pretest(text) -> Boolean\n *\n * Very quick check, that can give false positives. Returns true if link MAY BE\n * can exists. Can be used for speed optimization, when you need to check that\n * link NOT exists.\n **/ LinkifyIt.prototype.pretest = function pretest(text) {\n return this.re.pretest.test(text);\n };\n /**\n * LinkifyIt#testSchemaAt(text, name, position) -> Number\n * - text (String): text to scan\n * - name (String): rule (schema) name\n * - position (Number): text offset to check from\n *\n * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly\n * at given position. Returns length of found pattern (0 on fail).\n **/ LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {\n // If not supported schema check requested - terminate\n if (!this.__compiled__[schema.toLowerCase()]) {\n return 0;\n }\n return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);\n };\n /**\n * LinkifyIt#match(text) -> Array|null\n *\n * Returns array of found link descriptions or `null` on fail. We strongly\n * recommend to use [[LinkifyIt#test]] first, for best speed.\n *\n * ##### Result match description\n *\n * - __schema__ - link schema, can be empty for fuzzy links, or `//` for\n * protocol-neutral links.\n * - __index__ - offset of matched text\n * - __lastIndex__ - index of next char after mathch end\n * - __raw__ - matched text\n * - __text__ - normalized text\n * - __url__ - link, generated from matched text\n **/ LinkifyIt.prototype.match = function match(text) {\n const result = [];\n let shift = 0;\n // Try to take previous element from cache, if .test() called before\n if (this.__index__ >= 0 && this.__text_cache__ === text) {\n result.push(createMatch(this, shift));\n shift = this.__last_index__;\n }\n // Cut head if cache was used\n let tail = shift ? text.slice(shift) : text;\n // Scan string until end reached\n while (this.test(tail)) {\n result.push(createMatch(this, shift));\n tail = tail.slice(this.__last_index__);\n shift += this.__last_index__;\n }\n if (result.length) {\n return result;\n }\n return null;\n };\n /**\n * LinkifyIt#matchAtStart(text) -> Match|null\n *\n * Returns fully-formed (not fuzzy) link if it starts at the beginning\n * of the string, and null otherwise.\n **/ LinkifyIt.prototype.matchAtStart = function matchAtStart(text) {\n // Reset scan cache\n this.__text_cache__ = text;\n this.__index__ = -1;\n if (!text.length) return null;\n const m = this.re.schema_at_start.exec(text);\n if (!m) return null;\n const len = this.testSchemaAt(text, m[2], m[0].length);\n if (!len) return null;\n this.__schema__ = m[2];\n this.__index__ = m.index + m[1].length;\n this.__last_index__ = m.index + m[0].length + len;\n return createMatch(this, 0);\n };\n /** chainable\n * LinkifyIt#tlds(list [, keepOld]) -> this\n * - list (Array): list of tlds\n * - keepOld (Boolean): merge with current list if `true` (`false` by default)\n *\n * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)\n * to avoid false positives. By default this algorythm used:\n *\n * - hostname with any 2-letter root zones are ok.\n * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444\n * are ok.\n * - encoded (`xn--...`) root zones are ok.\n *\n * If list is replaced, then exact match for 2-chars root zones will be checked.\n **/ LinkifyIt.prototype.tlds = function tlds(list, keepOld) {\n list = Array.isArray(list) ? list : [ list ];\n if (!keepOld) {\n this.__tlds__ = list.slice();\n this.__tlds_replaced__ = true;\n compile(this);\n return this;\n }\n this.__tlds__ = this.__tlds__.concat(list).sort().filter(function(el, idx, arr) {\n return el !== arr[idx - 1];\n }).reverse();\n compile(this);\n return this;\n };\n /**\n * LinkifyIt#normalize(match)\n *\n * Default normalizer (if schema does not define it's own).\n **/ LinkifyIt.prototype.normalize = function normalize(match) {\n // Do minimal possible changes by default. Need to collect feedback prior\n // to move forward https://github.com/markdown-it/linkify-it/issues/1\n if (!match.schema) {\n match.url = \"http://\" + match.url;\n }\n if (match.schema === \"mailto:\" && !/^mailto:/i.test(match.url)) {\n match.url = \"mailto:\" + match.url;\n }\n };\n /**\n * LinkifyIt#onCompile()\n *\n * Override to modify basic RegExp-s.\n **/ LinkifyIt.prototype.onCompile = function onCompile() {};\n /** Highest positive signed 32-bit float value */ const maxInt = 2147483647;\n // aka. 0x7FFFFFFF or 2^31-1\n /** Bootstring parameters */ const base = 36;\n const tMin = 1;\n const tMax = 26;\n const skew = 38;\n const damp = 700;\n const initialBias = 72;\n const initialN = 128;\n // 0x80\n const delimiter = \"-\";\n // '\\x2D'\n /** Regular expressions */ const regexPunycode = /^xn--/;\n const regexNonASCII = /[^\\0-\\x7F]/;\n // Note: U+007F DEL is excluded too.\n const regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g;\n // RFC 3490 separators\n /** Error messages */ const errors = {\n overflow: \"Overflow: input needs wider integers to process\",\n \"not-basic\": \"Illegal input >= 0x80 (not a basic code point)\",\n \"invalid-input\": \"Invalid input\"\n };\n /** Convenience shortcuts */ const baseMinusTMin = base - tMin;\n const floor = Math.floor;\n const stringFromCharCode = String.fromCharCode;\n /*--------------------------------------------------------------------------*/\n /**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */ function error(type) {\n throw new RangeError(errors[type]);\n }\n /**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */ function map(array, callback) {\n const result = [];\n let length = array.length;\n while (length--) {\n result[length] = callback(array[length]);\n }\n return result;\n }\n /**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {String} A new string of characters returned by the callback\n * function.\n */ function mapDomain(domain, callback) {\n const parts = domain.split(\"@\");\n let result = \"\";\n if (parts.length > 1) {\n // In email addresses, only the domain name should be punycoded. Leave\n // the local part (i.e. everything up to `@`) intact.\n result = parts[0] + \"@\";\n domain = parts[1];\n }\n // Avoid `split(regex)` for IE8 compatibility. See #17.\n domain = domain.replace(regexSeparators, \".\");\n const labels = domain.split(\".\");\n const encoded = map(labels, callback).join(\".\");\n return result + encoded;\n }\n /**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */ function ucs2decode(string) {\n const output = [];\n let counter = 0;\n const length = string.length;\n while (counter < length) {\n const value = string.charCodeAt(counter++);\n if (value >= 55296 && value <= 56319 && counter < length) {\n // It's a high surrogate, and there is a next character.\n const extra = string.charCodeAt(counter++);\n if ((extra & 64512) == 56320) {\n // Low surrogate.\n output.push(((value & 1023) << 10) + (extra & 1023) + 65536);\n } else {\n // It's an unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair.\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n }\n /**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */ const ucs2encode = codePoints => String.fromCodePoint(...codePoints);\n /**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */ const basicToDigit = function(codePoint) {\n if (codePoint >= 48 && codePoint < 58) {\n return 26 + (codePoint - 48);\n }\n if (codePoint >= 65 && codePoint < 91) {\n return codePoint - 65;\n }\n if (codePoint >= 97 && codePoint < 123) {\n return codePoint - 97;\n }\n return base;\n };\n /**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */ const digitToBasic = function(digit, flag) {\n // 0..25 map to ASCII a..z or A..Z\n // 26..35 map to ASCII 0..9\n return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n };\n /**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */ const adapt = function(delta, numPoints, firstTime) {\n let k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (;delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n };\n /**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */ const decode = function(input) {\n // Don't use UCS-2.\n const output = [];\n const inputLength = input.length;\n let i = 0;\n let n = initialN;\n let bias = initialBias;\n // Handle the basic code points: let `basic` be the number of input code\n // points before the last delimiter, or `0` if there is none, then copy\n // the first basic code points to the output.\n let basic = input.lastIndexOf(delimiter);\n if (basic < 0) {\n basic = 0;\n }\n for (let j = 0; j < basic; ++j) {\n // if it's not a basic code point\n if (input.charCodeAt(j) >= 128) {\n error(\"not-basic\");\n }\n output.push(input.charCodeAt(j));\n }\n // Main decoding loop: start just after the last delimiter if any basic code\n // points were copied; start at the beginning otherwise.\n for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {\n // `index` is the index of the next character to be consumed.\n // Decode a generalized variable-length integer into `delta`,\n // which gets added to `i`. The overflow checking is easier\n // if we increase `i` as we go, then subtract off its starting\n // value at the end to obtain `delta`.\n const oldi = i;\n for (let w = 1, k = base; ;k += base) {\n if (index >= inputLength) {\n error(\"invalid-input\");\n }\n const digit = basicToDigit(input.charCodeAt(index++));\n if (digit >= base) {\n error(\"invalid-input\");\n }\n if (digit > floor((maxInt - i) / w)) {\n error(\"overflow\");\n }\n i += digit * w;\n const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n if (digit < t) {\n break;\n }\n const baseMinusT = base - t;\n if (w > floor(maxInt / baseMinusT)) {\n error(\"overflow\");\n }\n w *= baseMinusT;\n }\n const out = output.length + 1;\n bias = adapt(i - oldi, out, oldi == 0);\n // `i` was supposed to wrap around from `out` to `0`,\n // incrementing `n` each time, so we'll fix that now:\n if (floor(i / out) > maxInt - n) {\n error(\"overflow\");\n }\n n += floor(i / out);\n i %= out;\n // Insert `n` at position `i` of the output.\n output.splice(i++, 0, n);\n }\n return String.fromCodePoint(...output);\n };\n /**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */ const encode = function(input) {\n const output = [];\n // Convert the input in UCS-2 to an array of Unicode code points.\n input = ucs2decode(input);\n // Cache the length.\n const inputLength = input.length;\n // Initialize the state.\n let n = initialN;\n let delta = 0;\n let bias = initialBias;\n // Handle the basic code points.\n for (const currentValue of input) {\n if (currentValue < 128) {\n output.push(stringFromCharCode(currentValue));\n }\n }\n const basicLength = output.length;\n let handledCPCount = basicLength;\n // `handledCPCount` is the number of code points that have been handled;\n // `basicLength` is the number of basic code points.\n // Finish the basic string with a delimiter unless it's empty.\n if (basicLength) {\n output.push(delimiter);\n }\n // Main encoding loop:\n while (handledCPCount < inputLength) {\n // All non-basic code points < n have been handled already. Find the next\n // larger one:\n let m = maxInt;\n for (const currentValue of input) {\n if (currentValue >= n && currentValue < m) {\n m = currentValue;\n }\n }\n // Increase `delta` enough to advance the decoder's state to ,\n // but guard against overflow.\n const handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n error(\"overflow\");\n }\n delta += (m - n) * handledCPCountPlusOne;\n n = m;\n for (const currentValue of input) {\n if (currentValue < n && ++delta > maxInt) {\n error(\"overflow\");\n }\n if (currentValue === n) {\n // Represent delta as a generalized variable-length integer.\n let q = delta;\n for (let k = base; ;k += base) {\n const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n if (q < t) {\n break;\n }\n const qMinusT = q - t;\n const baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));\n q = floor(qMinusT / baseMinusT);\n }\n output.push(stringFromCharCode(digitToBasic(q, 0)));\n bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);\n delta = 0;\n ++handledCPCount;\n }\n }\n ++delta;\n ++n;\n }\n return output.join(\"\");\n };\n /**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */ const toUnicode = function(input) {\n return mapDomain(input, function(string) {\n return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;\n });\n };\n /**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */ const toASCII = function(input) {\n return mapDomain(input, function(string) {\n return regexNonASCII.test(string) ? \"xn--\" + encode(string) : string;\n });\n };\n /*--------------------------------------------------------------------------*/\n /** Define the public API */ const punycode = {\n /**\n * A string representing the current Punycode.js version number.\n * @memberOf punycode\n * @type String\n */\n version: \"2.3.1\",\n /**\n * An object of methods to convert from JavaScript's internal character\n * representation (UCS-2) to Unicode code points, and back.\n * @see \n * @memberOf punycode\n * @type Object\n */\n ucs2: {\n decode: ucs2decode,\n encode: ucs2encode\n },\n decode: decode,\n encode: encode,\n toASCII: toASCII,\n toUnicode: toUnicode\n };\n // markdown-it default options\n var cfg_default = {\n options: {\n // Enable HTML tags in source\n html: false,\n // Use '/' to close single tags (
)\n xhtmlOut: false,\n // Convert '\\n' in paragraphs into
\n breaks: false,\n // CSS language prefix for fenced blocks\n langPrefix: \"language-\",\n // autoconvert URL-like texts to links\n linkify: false,\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n // For example, you can use '\u00AB\u00BB\u201E\u201C' for Russian, '\u201E\u201C\u201A\u2018' for German,\n // and ['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A'] for French (including nbsp).\n quotes: \"\\u201c\\u201d\\u2018\\u2019\",\n /* \u201C\u201D\u2018\u2019 */\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with )\n xhtmlOut: false,\n // Convert '\\n' in paragraphs into
\n breaks: false,\n // CSS language prefix for fenced blocks\n langPrefix: \"language-\",\n // autoconvert URL-like texts to links\n linkify: false,\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n // For example, you can use '\u00AB\u00BB\u201E\u201C' for Russian, '\u201E\u201C\u201A\u2018' for German,\n // and ['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A'] for French (including nbsp).\n quotes: \"\\u201c\\u201d\\u2018\\u2019\",\n /* \u201C\u201D\u2018\u2019 */\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with )\n xhtmlOut: true,\n // Convert '\\n' in paragraphs into
\n breaks: false,\n // CSS language prefix for fenced blocks\n langPrefix: \"language-\",\n // autoconvert URL-like texts to links\n linkify: false,\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n // For example, you can use '\u00AB\u00BB\u201E\u201C' for Russian, '\u201E\u201C\u201A\u2018' for German,\n // and ['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A'] for French (including nbsp).\n quotes: \"\\u201c\\u201d\\u2018\\u2019\",\n /* \u201C\u201D\u2018\u2019 */\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with = 0) {\n try {\n parsed.hostname = punycode.toASCII(parsed.hostname);\n } catch (er) {}\n }\n }\n return encode$1(format(parsed));\n }\n function normalizeLinkText(url) {\n const parsed = urlParse(url, true);\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toUnicode(parsed.hostname);\n } catch (er) {}\n }\n }\n // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720\n return decode$1(format(parsed), decode$1.defaultChars + \"%\");\n }\n /**\n * class MarkdownIt\n *\n * Main parser/renderer class.\n *\n * ##### Usage\n *\n * ```javascript\n * // node.js, \"classic\" way:\n * var MarkdownIt = require('markdown-it'),\n * md = new MarkdownIt();\n * var result = md.render('# markdown-it rulezz!');\n *\n * // node.js, the same, but with sugar:\n * var md = require('markdown-it')();\n * var result = md.render('# markdown-it rulezz!');\n *\n * // browser without AMD, added to \"window\" on script load\n * // Note, there are no dash.\n * var md = window.markdownit();\n * var result = md.render('# markdown-it rulezz!');\n * ```\n *\n * Single line rendering, without paragraph wrap:\n *\n * ```javascript\n * var md = require('markdown-it')();\n * var result = md.renderInline('__markdown-it__ rulezz!');\n * ```\n **/\n /**\n * new MarkdownIt([presetName, options])\n * - presetName (String): optional, `commonmark` / `zero`\n * - options (Object)\n *\n * Creates parser instanse with given config. Can be called without `new`.\n *\n * ##### presetName\n *\n * MarkdownIt provides named presets as a convenience to quickly\n * enable/disable active syntax rules and options for common use cases.\n *\n * - [\"commonmark\"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.mjs) -\n * configures parser to strict [CommonMark](http://commonmark.org/) mode.\n * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.mjs) -\n * similar to GFM, used when no preset name given. Enables all available rules,\n * but still without html, typographer & autolinker.\n * - [\"zero\"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.mjs) -\n * all rules disabled. Useful to quickly setup your config via `.enable()`.\n * For example, when you need only `bold` and `italic` markup and nothing else.\n *\n * ##### options:\n *\n * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!\n * That's not safe! You may need external sanitizer to protect output from XSS.\n * It's better to extend features via plugins, instead of enabling HTML.\n * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags\n * (`
`). This is needed only for full CommonMark compatibility. In real\n * world you will need HTML output.\n * - __breaks__ - `false`. Set `true` to convert `\\n` in paragraphs into `
`.\n * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.\n * Can be useful for external highlighters.\n * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.\n * - __typographer__ - `false`. Set `true` to enable [some language-neutral\n * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs) +\n * quotes beautification (smartquotes).\n * - __quotes__ - `\u201C\u201D\u2018\u2019`, String or Array. Double + single quotes replacement\n * pairs, when typographer enabled and smartquotes on. For example, you can\n * use `'\u00AB\u00BB\u201E\u201C'` for Russian, `'\u201E\u201C\u201A\u2018'` for German, and\n * `['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A']` for French (including nbsp).\n * - __highlight__ - `null`. Highlighter function for fenced code blocks.\n * Highlighter `function (str, lang)` should return escaped HTML. It can also\n * return empty string if the source was not changed and should be escaped\n * externaly. If result starts with ` or ``):\n *\n * ```javascript\n * var hljs = require('highlight.js') // https://highlightjs.org/\n *\n * // Actual default values\n * var md = require('markdown-it')({\n * highlight: function (str, lang) {\n * if (lang && hljs.getLanguage(lang)) {\n * try {\n * return '
' +\n   *                hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +\n   *                '
';\n * } catch (__) {}\n * }\n *\n * return '
' + md.utils.escapeHtml(str) + '
';\n * }\n * });\n * ```\n *\n **/ function MarkdownIt(presetName, options) {\n if (!(this instanceof MarkdownIt)) {\n return new MarkdownIt(presetName, options);\n }\n if (!options) {\n if (!isString$1(presetName)) {\n options = presetName || {};\n presetName = \"default\";\n }\n }\n /**\n * MarkdownIt#inline -> ParserInline\n *\n * Instance of [[ParserInline]]. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/ this.inline = new ParserInline;\n /**\n * MarkdownIt#block -> ParserBlock\n *\n * Instance of [[ParserBlock]]. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/ this.block = new ParserBlock;\n /**\n * MarkdownIt#core -> Core\n *\n * Instance of [[Core]] chain executor. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/ this.core = new Core;\n /**\n * MarkdownIt#renderer -> Renderer\n *\n * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering\n * rules for new token types, generated by plugins.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * function myToken(tokens, idx, options, env, self) {\n * //...\n * return result;\n * };\n *\n * md.renderer.rules['my_token'] = myToken\n * ```\n *\n * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs).\n **/ this.renderer = new Renderer;\n /**\n * MarkdownIt#linkify -> LinkifyIt\n *\n * [linkify-it](https://github.com/markdown-it/linkify-it) instance.\n * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.mjs)\n * rule.\n **/ this.linkify = new LinkifyIt;\n /**\n * MarkdownIt#validateLink(url) -> Boolean\n *\n * Link validation function. CommonMark allows too much in links. By default\n * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas\n * except some embedded image types.\n *\n * You can change this behaviour:\n *\n * ```javascript\n * var md = require('markdown-it')();\n * // enable everything\n * md.validateLink = function () { return true; }\n * ```\n **/ this.validateLink = validateLink;\n /**\n * MarkdownIt#normalizeLink(url) -> String\n *\n * Function used to encode link url to a machine-readable format,\n * which includes url-encoding, punycode, etc.\n **/ this.normalizeLink = normalizeLink;\n /**\n * MarkdownIt#normalizeLinkText(url) -> String\n *\n * Function used to decode link url to a human-readable format`\n **/ this.normalizeLinkText = normalizeLinkText;\n // Expose utils & helpers for easy acces from plugins\n /**\n * MarkdownIt#utils -> utils\n *\n * Assorted utility functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.mjs).\n **/ this.utils = utils;\n /**\n * MarkdownIt#helpers -> helpers\n *\n * Link components parser functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).\n **/ this.helpers = assign$1({}, helpers);\n this.options = {};\n this.configure(presetName);\n if (options) {\n this.set(options);\n }\n }\n /** chainable\n * MarkdownIt.set(options)\n *\n * Set parser options (in the same format as in constructor). Probably, you\n * will never need it, but you can change options after constructor call.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')()\n * .set({ html: true, breaks: true })\n * .set({ typographer, true });\n * ```\n *\n * __Note:__ To achieve the best possible performance, don't modify a\n * `markdown-it` instance options on the fly. If you need multiple configurations\n * it's best to create multiple instances and initialize each with separate\n * config.\n **/ MarkdownIt.prototype.set = function(options) {\n assign$1(this.options, options);\n return this;\n };\n /** chainable, internal\n * MarkdownIt.configure(presets)\n *\n * Batch load of all options and compenent settings. This is internal method,\n * and you probably will not need it. But if you will - see available presets\n * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)\n *\n * We strongly recommend to use presets instead of direct config loads. That\n * will give better compatibility with next versions.\n **/ MarkdownIt.prototype.configure = function(presets) {\n const self = this;\n if (isString$1(presets)) {\n const presetName = presets;\n presets = config[presetName];\n if (!presets) {\n throw new Error('Wrong `markdown-it` preset \"' + presetName + '\", check name');\n }\n }\n if (!presets) {\n throw new Error(\"Wrong `markdown-it` preset, can't be empty\");\n }\n if (presets.options) {\n self.set(presets.options);\n }\n if (presets.components) {\n Object.keys(presets.components).forEach(function(name) {\n if (presets.components[name].rules) {\n self[name].ruler.enableOnly(presets.components[name].rules);\n }\n if (presets.components[name].rules2) {\n self[name].ruler2.enableOnly(presets.components[name].rules2);\n }\n });\n }\n return this;\n };\n /** chainable\n * MarkdownIt.enable(list, ignoreInvalid)\n * - list (String|Array): rule name or list of rule names to enable\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable list or rules. It will automatically find appropriate components,\n * containing rules with given names. If rule not found, and `ignoreInvalid`\n * not set - throws exception.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')()\n * .enable(['sub', 'sup'])\n * .disable('smartquotes');\n * ```\n **/ MarkdownIt.prototype.enable = function(list, ignoreInvalid) {\n let result = [];\n if (!Array.isArray(list)) {\n list = [ list ];\n }\n [ \"core\", \"block\", \"inline\" ].forEach(function(chain) {\n result = result.concat(this[chain].ruler.enable(list, true));\n }, this);\n result = result.concat(this.inline.ruler2.enable(list, true));\n const missed = list.filter(function(name) {\n return result.indexOf(name) < 0;\n });\n if (missed.length && !ignoreInvalid) {\n throw new Error(\"MarkdownIt. Failed to enable unknown rule(s): \" + missed);\n }\n return this;\n };\n /** chainable\n * MarkdownIt.disable(list, ignoreInvalid)\n * - list (String|Array): rule name or list of rule names to disable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * The same as [[MarkdownIt.enable]], but turn specified rules off.\n **/ MarkdownIt.prototype.disable = function(list, ignoreInvalid) {\n let result = [];\n if (!Array.isArray(list)) {\n list = [ list ];\n }\n [ \"core\", \"block\", \"inline\" ].forEach(function(chain) {\n result = result.concat(this[chain].ruler.disable(list, true));\n }, this);\n result = result.concat(this.inline.ruler2.disable(list, true));\n const missed = list.filter(function(name) {\n return result.indexOf(name) < 0;\n });\n if (missed.length && !ignoreInvalid) {\n throw new Error(\"MarkdownIt. Failed to disable unknown rule(s): \" + missed);\n }\n return this;\n };\n /** chainable\n * MarkdownIt.use(plugin, params)\n *\n * Load specified plugin with given params into current parser instance.\n * It's just a sugar to call `plugin(md, params)` with curring.\n *\n * ##### Example\n *\n * ```javascript\n * var iterator = require('markdown-it-for-inline');\n * var md = require('markdown-it')()\n * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {\n * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');\n * });\n * ```\n **/ MarkdownIt.prototype.use = function(plugin /*, params, ... */) {\n const args = [ this ].concat(Array.prototype.slice.call(arguments, 1));\n plugin.apply(plugin, args);\n return this;\n };\n /** internal\n * MarkdownIt.parse(src, env) -> Array\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Parse input string and return list of block tokens (special token type\n * \"inline\" will contain list of inline tokens). You should not call this\n * method directly, until you write custom renderer (for example, to produce\n * AST).\n *\n * `env` is used to pass data between \"distributed\" rules and return additional\n * metadata like reference info, needed for the renderer. It also can be used to\n * inject data in specific cases. Usually, you will be ok to pass `{}`,\n * and then pass updated object to renderer.\n **/ MarkdownIt.prototype.parse = function(src, env) {\n if (typeof src !== \"string\") {\n throw new Error(\"Input data should be a String\");\n }\n const state = new this.core.State(src, this, env);\n this.core.process(state);\n return state.tokens;\n };\n /**\n * MarkdownIt.render(src [, env]) -> String\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Render markdown string into html. It does all magic for you :).\n *\n * `env` can be used to inject additional metadata (`{}` by default).\n * But you will not need it with high probability. See also comment\n * in [[MarkdownIt.parse]].\n **/ MarkdownIt.prototype.render = function(src, env) {\n env = env || {};\n return this.renderer.render(this.parse(src, env), this.options, env);\n };\n /** internal\n * MarkdownIt.parseInline(src, env) -> Array\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the\n * block tokens list with the single `inline` element, containing parsed inline\n * tokens in `children` property. Also updates `env` object.\n **/ MarkdownIt.prototype.parseInline = function(src, env) {\n const state = new this.core.State(src, this, env);\n state.inlineMode = true;\n this.core.process(state);\n return state.tokens;\n };\n /**\n * MarkdownIt.renderInline(src [, env]) -> String\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Similar to [[MarkdownIt.render]] but for single paragraph content. Result\n * will NOT be wrapped into `

` tags.\n **/ MarkdownIt.prototype.renderInline = function(src, env) {\n env = env || {};\n return this.renderer.render(this.parseInline(src, env), this.options, env);\n };\n return MarkdownIt;\n});\n", "// This file is part of Stack - https://stack.maths.ed.ac.uk\n//\n// Stack is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Stack is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Stack. If not, see .\n\n/**\n * This is part of the free text input/ ASCII display block.\n *\n * @package qtype_stack\n * @copyright 2026 University of Edinburgh\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n// Markdown-it block rule plugin.\n//\n// Syntax:\n// Opening marker: a single backtick, optionally followed by spaces/tabs, at end of line.\n// Content: any lines until the closing marker.\n// Closing marker: any line whose first non-whitespace character is a backtick.\n//\n// A backtick followed by non-whitespace characters is left untouched so that\n// code_inline still fires for `inline code`.\n\n// UMD wrapper: works as a plain "); @@ -162,7 +165,12 @@ public function compile($format, $options): ?MP_Node { $r->items = array_merge($r->items, $suppliedtext); $r->items[] = new MP_String(''); - $r->items[] = new MP_String('

'); + $r->items[] = new MP_String('
'); + $r->items[] = new MP_String('
'); + $r->items[] = new MP_String('
'); + $r->items[] = new MP_String('
'); + $r->items[] = new MP_String('
'); + $r->items[] = new MP_String('
'); return $r; } diff --git a/stack/cas/castext2/blocks/iframe.block.php b/stack/cas/castext2/blocks/iframe.block.php index 4b80c4858bf..29bb4fcd3d0 100644 --- a/stack/cas/castext2/blocks/iframe.block.php +++ b/stack/cas/castext2/blocks/iframe.block.php @@ -27,6 +27,7 @@ require_once(__DIR__ . '/../block.interface.php'); require_once(__DIR__ . '/../../../utils.class.php'); require_once(__DIR__ . '/../../../../vle_specific.php'); +require_once(__DIR__ . '/../../../../locallib.php'); require_once(__DIR__ . '/../../../../api/util/StackIframeHolder.php'); use api\util\StackIframeHolder; @@ -42,6 +43,17 @@ * that allow targetted content within this block. */ class stack_cas_castext2_iframe extends stack_cas_castext2_block { + /** + * This is intentionally replaced during postprocessing, not compilation, + * so messages use the current user's language rather than the author's. + * @var string JSON containing strings needing to be passed to JS. + */ + public const ASCII_STRINGS_PLACEHOLDER = '///STACK_ASCII_STRINGS///'; + /** + * @var string Identifier of ascii strings needing to be passed to JS. + */ + private const ASCII_STRING_PREFIX = 'asciistring'; + // All frames need unique (at request level) identifiers, // we use running numbering. // phpcs:ignore moodle.Commenting.VariableComment.Missing @@ -203,6 +215,13 @@ public function postprocess( $code ); } + if (strpos($code, self::ASCII_STRINGS_PLACEHOLDER) !== false) { + $code = str_replace( + self::ASCII_STRINGS_PLACEHOLDER, + self::get_ascii_strings_json(), + $code + ); + } // Unpack held things if they happen to exist inside the IFRAME. // That content would never go through the processing that that logic // protects against. @@ -234,6 +253,23 @@ public function postprocess( return $holder->add_to_map(html_writer::tag('div', '', $attributes)); } + /** + * Strings used by JavaScript inside the ASCII block iframe. + * String keys are discovered by the asciistring prefix. + * @return string + */ + private static function get_ascii_strings_json(): string { + $strings = []; + $stringmanager = get_string_manager(); + $englishstrings = $stringmanager->load_component_strings('qtype_stack', 'en'); + foreach (array_keys($englishstrings) as $key) { + if (strpos($key, self::ASCII_STRING_PREFIX) === 0) { + $strings[$key] = stack_string($key); + } + } + return json_encode($strings); + } + // phpcs:ignore moodle.Commenting.MissingDocblock.Function public function validate(&$errors = [], $options = []): bool { // Basically, check that the dimensions have units we know. diff --git a/tests/ascii_block_test.php b/tests/ascii_block_test.php index 04fdb072b0f..ca0faf49dd9 100644 --- a/tests/ascii_block_test.php +++ b/tests/ascii_block_test.php @@ -37,6 +37,7 @@ require_once(__DIR__ . '/../stack/cas/castext2/blocks/filter.block.php'); require_once(__DIR__ . '/../stack/cas/castext2/blocks/extractor.block.php'); +use api\util\StackIframeHolder; use stack_cas_castext2_iframe; /** @@ -60,6 +61,15 @@ private function get_string_items(\MP_List $compiled): array { return $strings; } + /** + * Build a JSON object fragment for an ASCII string entry. + * @param string $key + * @return string + */ + private function ascii_string_json_fragment(string $key): string { + return '"' . $key . '":' . json_encode(stack_string($key)); + } + public function test_basic_ascii_block(): void { stack_cas_castext2_iframe::register_counter('///IFRAME_COUNT///'); @@ -107,12 +117,16 @@ public function test_ascii_compile_adds_default_filter_and_input_request(): void $strings = $this->get_string_items($compiled); $joined = implode("\n", $strings); $this->assertStringContainsString('stack_js.request_access_to_input("ans1",true)', $joined); - $expectedlinkcode = '{init(inputIds,[{"operation":"filter","type":"markdown","transforms":"asciimath,aligneq,minwrap"}]);}'; + $expectedlinkcode = '{init(inputIds,[{"operation":"filter","type":"markdown","transforms":"asciimath,aligneq,minwrap"}]' . + ',{"asciistrings":///STACK_ASCII_STRINGS///});}'; $this->assertStringContainsString($expectedlinkcode, $joined); $this->assertStringContainsString( - 'id="asciiContainerRow" style="width:calc(100% - 13px);height:calc(100vh - 14px);min-height:calc(400px - 14px);"', + 'id="asciiShell" class="stackascii-shell" style="width:calc(100% - 13px);height:calc(100vh - 4px);min-height:calc(400px - 4px);"', $joined ); + $this->assertStringContainsString('
', $joined); + $this->assertStringContainsString('
', $joined); + $this->assertStringContainsString('
', $joined); } public function test_ascii_compile_without_input_parameter_uses_empty_input_requests(): void { @@ -127,7 +141,8 @@ public function test_ascii_compile_without_input_parameter_uses_empty_input_requ $this->assertStringNotContainsString('stack_js.request_access_to_input(', $joined); $this->assertStringContainsString('', $joined); - $expectedlinkcode = '{init(inputIds,[{"operation":"filter","type":"markdown","transforms":"asciimath,aligneq,minwrap"}]);}'; + $expectedlinkcode = '{init(inputIds,[{"operation":"filter","type":"markdown","transforms":"asciimath,aligneq,minwrap"}]' . + ',{"asciistrings":///STACK_ASCII_STRINGS///});}'; $this->assertStringContainsString($expectedlinkcode, $joined); } @@ -158,10 +173,11 @@ public function test_ascii_compile_uses_child_filter_and_extractor_operations(): $this->assertStringContainsString('stack_js.request_access_to_input("ans1",true)', $joined); $this->assertStringContainsString('stack_js.request_access_to_input("ans2")', $joined); $expectedlinkcode = '{init(inputIds,[{"type":"markdown","transforms":"aligneq","display":"true","operation":"filter"}' . - ',{"type":"lastexpr","targetinput":"ans2","operation":"extractor"}]);}'; + ',{"type":"lastexpr","targetinput":"ans2","operation":"extractor"}]' . + ',{"asciistrings":///STACK_ASCII_STRINGS///});}'; $this->assertStringContainsString($expectedlinkcode, $joined); $this->assertStringContainsString( - 'id="asciiContainerRow" style="width:calc(80% - 13px);height:calc(100vh - 14px);min-height:calc(300px - 14px);"', + 'id="asciiShell" class="stackascii-shell" style="width:calc(80% - 13px);height:calc(100vh - 4px);min-height:calc(300px - 4px);"', $joined ); $this->assertStringNotContainsString('"transforms":"aligneq,boldfilter"', $joined); @@ -195,15 +211,50 @@ public function test_ascii_compile_uses_child_filter_markdown_maths(): void { $this->assertStringContainsString('stack_js.request_access_to_input("ans2")', $joined); $expectedlinkcode = '{init(inputIds,[{"type":"markdown","transforms":"asciimath,aligneq,minwrap",' . '"display":"true","operation":"filter"}' . - ',{"type":"lastexpr","targetinput":"ans2","operation":"extractor"}]);}'; + ',{"type":"lastexpr","targetinput":"ans2","operation":"extractor"}]' . + ',{"asciistrings":///STACK_ASCII_STRINGS///});}'; $this->assertStringContainsString($expectedlinkcode, $joined); $this->assertStringContainsString( - 'id="asciiContainerRow" style="width:calc(80% - 13px);height:calc(100vh - 14px);min-height:calc(300px - 14px);"', + 'id="asciiShell" class="stackascii-shell" style="width:calc(80% - 13px);height:calc(100vh - 4px);min-height:calc(300px - 4px);"', $joined ); $this->assertStringNotContainsString('"transforms":"aligneq,boldfilter"', $joined); } + public function test_ascii_iframe_replaces_ascii_string_placeholder(): void { + stack_cas_castext2_iframe::register_counter('///IFRAME_COUNT///'); + StackIframeHolder::$iframes = []; + $oldlibrarymode = StackIframeHolder::$islibrary; + StackIframeHolder::$islibrary = true; + + try { + $raw = '[[ascii input="ans1"]][[/ascii]]'; + $at1 = castext2_evaluatable::make_from_source($raw, 'test-case'); + $session = new stack_cas_session2([$at1]); + $session->instantiate(); + $at1->apply_placeholder_holder($at1->get_rendered()); + + $this->assertCount(1, StackIframeHolder::$iframes); + $iframehtml = StackIframeHolder::$iframes[0][1]; + $this->assertStringNotContainsString('///STACK_ASCII_STRINGS///', $iframehtml); + $this->assertStringContainsString( + $this->ascii_string_json_fragment('asciistringextractorsearchnotfound'), + $iframehtml + ); + $this->assertStringContainsString( + $this->ascii_string_json_fragment('asciistringextractorregexrequired'), + $iframehtml + ); + $this->assertStringContainsString( + $this->ascii_string_json_fragment('asciistringextractorlastcalcnotfound'), + $iframehtml + ); + } finally { + StackIframeHolder::$iframes = []; + StackIframeHolder::$islibrary = $oldlibrarymode; + } + } + public function test_ascii_validate_width_unit_and_number(): void { $valid = '[[ascii input="ans1" width="500px"]][[/ascii]]'; $invalidunit = '[[ascii input="ans1" width="500bad"]][[/ascii]]'; diff --git a/tests/jest/ascii.extractors.allregexmatch.test.js b/tests/jest/ascii.extractors.allregexmatch.test.js index e2428201e7b..e349afb1b1c 100644 --- a/tests/jest/ascii.extractors.allregexmatch.test.js +++ b/tests/jest/ascii.extractors.allregexmatch.test.js @@ -1,21 +1,37 @@ import allregexmatch from '../../corsscripts/ascii/extractors/allregexmatch.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; describe('allregexmatch extractor', () => { + beforeEach(() => { + setExtractorStrings({ + asciistringextractorregexrequired: 'This extractor requires a regular expression.', + asciistringextractorregexnotfound: 'No line matched the requested regular expression.' + }); + }); + describe('guard clauses', () => { - test('returns ERROR when operation is undefined', () => { - expect(allregexmatch('any raw', null, undefined)).toBe('ERROR'); + test('returns translated error when operation is undefined', () => { + expect(allregexmatch('any raw', null, undefined)).toEqual({ + error: 'This extractor requires a regular expression.' + }); }); - test('returns ERROR when operation is null', () => { - expect(allregexmatch('any raw', null, null)).toBe('ERROR'); + test('returns translated error when operation is null', () => { + expect(allregexmatch('any raw', null, null)).toEqual({ + error: 'This extractor requires a regular expression.' + }); }); - test('returns ERROR when operation.regex is missing', () => { - expect(allregexmatch('any raw', null, {})).toBe('ERROR'); + test('returns translated error when operation.regex is missing', () => { + expect(allregexmatch('any raw', null, {})).toEqual({ + error: 'This extractor requires a regular expression.' + }); }); - test('returns ERROR when operation.regex is empty', () => { - expect(allregexmatch('any raw', null, { regex: '' })).toBe('ERROR'); + test('returns translated error when operation.regex is empty', () => { + expect(allregexmatch('any raw', null, { regex: '' })).toEqual({ + error: 'This extractor requires a regular expression.' + }); }); }); @@ -24,19 +40,25 @@ describe('allregexmatch extractor', () => { const raw = 'f(x) = x\ny = 3\nf(x) = x^2'; const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; const result = allregexmatch(raw, null, operation); - expect(result).toBe(JSON.stringify({ matches: ['f(x) = x', 'f(x) = x^2'] })); + expect(result).toEqual({ + result: JSON.stringify({ matches: ['f(x) = x', 'f(x) = x^2'] }) + }); }); test('trims lines before matching and keeps order', () => { const raw = ' f(x) = a \n\n f(x) = b'; const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; const result = allregexmatch(raw, null, operation); - expect(result).toBe(JSON.stringify({ matches: ['f(x) = a', 'f(x) = b'] })); + expect(result).toEqual({ + result: JSON.stringify({ matches: ['f(x) = a', 'f(x) = b'] }) + }); }); - test('returns ERROR when no lines match', () => { + test('returns translated error when no lines match', () => { const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; - expect(allregexmatch('y = x\na = 1', null, operation)).toBe('ERROR'); + expect(allregexmatch('y = x\na = 1', null, operation)).toEqual({ + error: 'No line matched the requested regular expression.' + }); }); }); }); diff --git a/tests/jest/ascii.extractors.allregexremainder.test.js b/tests/jest/ascii.extractors.allregexremainder.test.js index 2dea306d4e5..45695f979bb 100644 --- a/tests/jest/ascii.extractors.allregexremainder.test.js +++ b/tests/jest/ascii.extractors.allregexremainder.test.js @@ -1,22 +1,35 @@ import allregexremainder from '../../corsscripts/ascii/extractors/allregexremainder.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; describe('allregexremainder extractor', () => { + beforeEach(() => { + setExtractorStrings({ + asciistringextractorregexnotfound: 'No line matched the requested regular expression.' + }); + }); + test('returns matched lines with the regex prefix removed', () => { const raw = 'f(x) = x\ny = 3\nf(x) = x^2'; const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; const result = allregexremainder(raw, null, operation); - expect(result).toBe(JSON.stringify({ matches: ['x', 'x^2'] })); + expect(result).toEqual({ + result: JSON.stringify({ matches: ['x', 'x^2'] }) + }); }); test('returns empty strings when regex consumes whole matching lines', () => { const raw = '42\nabc\n99'; const operation = { regex: '^\\d+$' }; const result = allregexremainder(raw, null, operation); - expect(result).toBe(JSON.stringify({ matches: ['', ''] })); + expect(result).toEqual({ + result: JSON.stringify({ matches: ['', ''] }) + }); }); - test('returns ERROR when no lines match', () => { + test('returns translated error when no lines match', () => { const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; - expect(allregexremainder('y = x\na = 1', null, operation)).toBe('ERROR'); + expect(allregexremainder('y = x\na = 1', null, operation)).toEqual({ + error: 'No line matched the requested regular expression.' + }); }); -}); \ No newline at end of file +}); diff --git a/tests/jest/ascii.extractors.lastblock.test.js b/tests/jest/ascii.extractors.lastblock.test.js index 067c221d55c..4fbce64a790 100644 --- a/tests/jest/ascii.extractors.lastblock.test.js +++ b/tests/jest/ascii.extractors.lastblock.test.js @@ -1,18 +1,24 @@ import lastblock from '../../corsscripts/ascii/extractors/lastblock.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; describe('lastblock extractor', () => { + beforeEach(() => { + setExtractorStrings({ + asciistringextractorlastblocknotfound: 'No AsciiMath expression or block was found to extract.' + }); + }); // ── Block-mode tests ────────────────────────────────────────────────────── describe('with blocks', () => { test('returns raw of a single code_inline block', () => { const blocks = [{ type: 'code_inline', raw: 'x^2' }]; - expect(lastblock('', blocks)).toBe('x^2'); + expect(lastblock('', blocks)).toEqual({ result: 'x^2' }); }); test('returns raw of a single asciimath_block', () => { const blocks = [{ type: 'asciimath_block', raw: 'x + 1\ny = 2' }]; - expect(lastblock('', blocks)).toBe('x + 1\ny = 2'); + expect(lastblock('', blocks)).toEqual({ result: 'x + 1\ny = 2' }); }); test('returns raw of the last code_inline when multiple blocks exist', () => { @@ -20,7 +26,7 @@ describe('lastblock extractor', () => { { type: 'code_inline', raw: 'first' }, { type: 'code_inline', raw: 'last' } ]; - expect(lastblock('', blocks)).toBe('last'); + expect(lastblock('', blocks)).toEqual({ result: 'last' }); }); test('returns raw of the last asciimath_block when it is the last relevant block', () => { @@ -28,7 +34,7 @@ describe('lastblock extractor', () => { { type: 'code_inline', raw: 'first' }, { type: 'asciimath_block', raw: 'second block' } ]; - expect(lastblock('', blocks)).toBe('second block'); + expect(lastblock('', blocks)).toEqual({ result: 'second block' }); }); test('scans bottom-up: last code_inline after an asciimath_block wins', () => { @@ -36,7 +42,7 @@ describe('lastblock extractor', () => { { type: 'asciimath_block', raw: 'math block' }, { type: 'code_inline', raw: 'inline after' } ]; - expect(lastblock('', blocks)).toBe('inline after'); + expect(lastblock('', blocks)).toEqual({ result: 'inline after' }); }); test('ignores blocks that are not code_inline or asciimath_block', () => { @@ -44,7 +50,9 @@ describe('lastblock extractor', () => { { type: 'paragraph', raw: 'ignored' }, { type: 'heading', raw: 'also ignored' }, ]; - expect(lastblock('', blocks)).toBe('ERROR'); + expect(lastblock('', blocks)).toEqual({ + error: 'No AsciiMath expression or block was found to extract.' + }); }); test('mixes eligible and non-eligible blocks, returns last eligible', () => { @@ -52,7 +60,7 @@ describe('lastblock extractor', () => { { type: 'code_inline', raw: 'inline' }, { type: 'paragraph', raw: 'para' } ]; - expect(lastblock('', blocks)).toBe('inline'); + expect(lastblock('', blocks)).toEqual({ result: 'inline' }); }); }); @@ -60,35 +68,39 @@ describe('lastblock extractor', () => { describe('without blocks (raw fallback)', () => { test('returns last non-empty line of raw', () => { - expect(lastblock('line one\nline two', null)).toBe('line two'); + expect(lastblock('line one\nline two', null)).toEqual({ result: 'line two' }); }); test('skips trailing empty lines in raw', () => { - expect(lastblock('line one\nline two\n\n', null)).toBe('line two'); + expect(lastblock('line one\nline two\n\n', null)).toEqual({ result: 'line two' }); }); test('returns the only non-empty line', () => { - expect(lastblock('\n\n hello world \n', null)).toBe(' hello world '); + expect(lastblock('\n\n hello world \n', null)).toEqual({ result: ' hello world ' }); }); test('returns line as-is (untrimmed) from raw', () => { - expect(lastblock(' trimmed ', null)).toBe(' trimmed '); + expect(lastblock(' trimmed ', null)).toEqual({ result: ' trimmed ' }); }); - test('returns ERROR when raw is all empty lines', () => { - expect(lastblock('\n\n\n', null)).toBe('ERROR'); + test('returns translated error when raw is all empty lines', () => { + expect(lastblock('\n\n\n', null)).toEqual({ + error: 'No AsciiMath expression or block was found to extract.' + }); }); - test('returns ERROR for empty raw string', () => { - expect(lastblock('', null)).toBe('ERROR'); + test('returns translated error for empty raw string', () => { + expect(lastblock('', null)).toEqual({ + error: 'No AsciiMath expression or block was found to extract.' + }); }); test('handles windows-style line endings in raw', () => { - expect(lastblock('first\r\nsecond', null)).toBe('second'); + expect(lastblock('first\r\nsecond', null)).toEqual({ result: 'second' }); }); test('falls back to raw when blocks is an empty array', () => { - expect(lastblock('fallback line', [])).toBe('fallback line'); + expect(lastblock('fallback line', [])).toEqual({ result: 'fallback line' }); }); }); }); diff --git a/tests/jest/ascii.extractors.lastcalc.test.js b/tests/jest/ascii.extractors.lastcalc.test.js index 94fc3e9583c..6b85d458442 100644 --- a/tests/jest/ascii.extractors.lastcalc.test.js +++ b/tests/jest/ascii.extractors.lastcalc.test.js @@ -1,16 +1,22 @@ import lastcalc from '../../corsscripts/ascii/extractors/lastcalc.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; describe('lastcalc extractor', () => { + beforeEach(() => { + setExtractorStrings({ + asciistringextractorlastcalcnotfound: 'No calculation block was found to extract.' + }); + }); describe('with blocks', () => { test('returns trimmed content of a single calculation block', () => { const blocks = [{ type: 'calculation', rendered: '1 + 1' }]; - expect(lastcalc('', blocks)).toBe('1 + 1'); + expect(lastcalc('', blocks)).toEqual({ result: '1 + 1' }); }); test('trims whitespace from the calculation block rendered', () => { const blocks = [{ type: 'calculation', rendered: ' x^2 ' }]; - expect(lastcalc('', blocks)).toBe('x^2'); + expect(lastcalc('', blocks)).toEqual({ result: 'x^2' }); }); test('returns trimmed content of the last calculation block when multiple exist', () => { @@ -18,7 +24,7 @@ describe('lastcalc extractor', () => { { type: 'calculation', rendered: 'first calc' }, { type: 'calculation', rendered: 'last calc' } ]; - expect(lastcalc('', blocks)).toBe('last calc'); + expect(lastcalc('', blocks)).toEqual({ result: 'last calc' }); }); test('scans bottom-up: last calculation block wins over earlier ones', () => { @@ -28,7 +34,7 @@ describe('lastcalc extractor', () => { { type: 'code_inline', rendered: 'also irrelevant' }, { type: 'calculation', rendered: 'calc two' } ]; - expect(lastcalc('', blocks)).toBe('calc two'); + expect(lastcalc('', blocks)).toEqual({ result: 'calc two' }); }); test('ignores non-calculation blocks', () => { @@ -37,26 +43,34 @@ describe('lastcalc extractor', () => { { type: 'calculation', rendered: 'calc one' }, { type: 'asciimath_block', rendered: 'also not a calc' } ]; - expect(lastcalc('', blocks)).toBe('calc one'); + expect(lastcalc('', blocks)).toEqual({ result: 'calc one' }); }); - test('returns ERROR when blocks array contains no calculation blocks', () => { + test('returns translated error when blocks array contains no calculation blocks', () => { const blocks = [{ type: 'paragraph', rendered: 'some text' }]; - expect(lastcalc('', blocks)).toBe('ERROR'); + expect(lastcalc('', blocks)).toEqual({ + error: 'No calculation block was found to extract.' + }); }); - test('returns ERROR for an empty blocks array', () => { - expect(lastcalc('', [])).toBe('ERROR'); + test('returns translated error for an empty blocks array', () => { + expect(lastcalc('', [])).toEqual({ + error: 'No calculation block was found to extract.' + }); }); }); describe('without blocks', () => { - test('returns ERROR when blocks is null', () => { - expect(lastcalc('anything', null)).toBe('ERROR'); + test('returns translated error when blocks is null', () => { + expect(lastcalc('anything', null)).toEqual({ + error: 'No calculation block was found to extract.' + }); }); - test('returns ERROR when blocks is undefined', () => { - expect(lastcalc('anything', undefined)).toBe('ERROR'); + test('returns translated error when blocks is undefined', () => { + expect(lastcalc('anything', undefined)).toEqual({ + error: 'No calculation block was found to extract.' + }); }); }); }); diff --git a/tests/jest/ascii.extractors.lastexpr.test.js b/tests/jest/ascii.extractors.lastexpr.test.js index 4de1cb747c6..2e0f1281ff8 100644 --- a/tests/jest/ascii.extractors.lastexpr.test.js +++ b/tests/jest/ascii.extractors.lastexpr.test.js @@ -1,28 +1,34 @@ import lastexpr from '../../corsscripts/ascii/extractors/lastexpr.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; describe('lastexpr extractor', () => { + beforeEach(() => { + setExtractorStrings({ + asciistringextractorlastexprnotfound: 'No expression or non-empty line was found to extract.' + }); + }); // ── Block-mode tests ────────────────────────────────────────────────────── describe('with blocks', () => { test('returns trimmed raw of a single code_inline block', () => { const blocks = [{ type: 'code_inline', raw: 'x^2' }]; - expect(lastexpr('', blocks)).toBe('x^2'); + expect(lastexpr('', blocks)).toEqual({ result: 'x^2' }); }); test('trims whitespace from code_inline raw', () => { const blocks = [{ type: 'code_inline', raw: ' x^2 ' }]; - expect(lastexpr('', blocks)).toBe('x^2'); + expect(lastexpr('', blocks)).toEqual({ result: 'x^2' }); }); test('returns last non-empty line of an asciimath_block', () => { const blocks = [{ type: 'asciimath_block', raw: 'first line\nsecond line' }]; - expect(lastexpr('', blocks)).toBe('second line'); + expect(lastexpr('', blocks)).toEqual({ result: 'second line' }); }); test('skips empty trailing lines in an asciimath_block', () => { const blocks = [{ type: 'asciimath_block', raw: 'only line\n\n' }]; - expect(lastexpr('', blocks)).toBe('only line'); + expect(lastexpr('', blocks)).toEqual({ result: 'only line' }); }); test('scans asciimath_block lines bottom-up to find last non-empty line', () => { @@ -30,7 +36,7 @@ describe('lastexpr extractor', () => { type: 'asciimath_block', raw: 'line1\nline2\nline3\n ' }]; - expect(lastexpr('', blocks)).toBe('line3'); + expect(lastexpr('', blocks)).toEqual({ result: 'line3' }); }); test('returns last code_inline over an earlier asciimath_block', () => { @@ -38,7 +44,7 @@ describe('lastexpr extractor', () => { { type: 'asciimath_block', raw: 'math line' }, { type: 'code_inline', raw: 'inline last' } ]; - expect(lastexpr('', blocks)).toBe('inline last'); + expect(lastexpr('', blocks)).toEqual({ result: 'inline last' }); }); test('falls back to asciimath_block when last block is not eligible', () => { @@ -46,7 +52,7 @@ describe('lastexpr extractor', () => { { type: 'asciimath_block', raw: 'math content' }, { type: 'paragraph', raw: 'not eligible' } ]; - expect(lastexpr('', blocks)).toBe('math content'); + expect(lastexpr('', blocks)).toEqual({ result: 'math content' }); }); test('scans bottom-up: last code_inline wins when multiple exist', () => { @@ -54,7 +60,7 @@ describe('lastexpr extractor', () => { { type: 'code_inline', raw: 'first' }, { type: 'code_inline', raw: 'last' } ]; - expect(lastexpr('', blocks)).toBe('last'); + expect(lastexpr('', blocks)).toEqual({ result: 'last' }); }); test('ignores blocks that are not code_inline or asciimath_block', () => { @@ -63,17 +69,19 @@ describe('lastexpr extractor', () => { { type: 'code_inline', raw: 'first' }, { type: 'calculation', raw: 'also ignored' } ]; - expect(lastexpr('', blocks)).toBe('first'); + expect(lastexpr('', blocks)).toEqual({ result: 'first' }); }); - test('returns ERROR when no eligible block is found', () => { + test('returns translated error when no eligible block is found', () => { const blocks = [{ type: 'paragraph', raw: 'nothing' }]; - expect(lastexpr('', blocks)).toBe('ERROR'); + expect(lastexpr('', blocks)).toEqual({ + error: 'No expression or non-empty line was found to extract.' + }); }); test('handles windows-style line endings in asciimath_block', () => { const blocks = [{ type: 'asciimath_block', raw: 'line one\r\nline two' }]; - expect(lastexpr('', blocks)).toBe('line two'); + expect(lastexpr('', blocks)).toEqual({ result: 'line two' }); }); }); @@ -81,31 +89,35 @@ describe('lastexpr extractor', () => { describe('without blocks (raw fallback)', () => { test('returns last non-empty line of raw', () => { - expect(lastexpr('line one\nline two', null)).toBe('line two'); + expect(lastexpr('line one\nline two', null)).toEqual({ result: 'line two' }); }); test('skips trailing empty lines in raw', () => { - expect(lastexpr('line one\nline two\n \n', null)).toBe('line two'); + expect(lastexpr('line one\nline two\n \n', null)).toEqual({ result: 'line two' }); }); test('trims whitespace from matched raw line', () => { - expect(lastexpr(' trimmed ', null)).toBe('trimmed'); + expect(lastexpr(' trimmed ', null)).toEqual({ result: 'trimmed' }); }); - test('returns ERROR when all raw lines are empty', () => { - expect(lastexpr('\n\n\n', null)).toBe('ERROR'); + test('returns translated error when all raw lines are empty', () => { + expect(lastexpr('\n\n\n', null)).toEqual({ + error: 'No expression or non-empty line was found to extract.' + }); }); - test('returns ERROR for empty raw with null blocks', () => { - expect(lastexpr('', null)).toBe('ERROR'); + test('returns translated error for empty raw with null blocks', () => { + expect(lastexpr('', null)).toEqual({ + error: 'No expression or non-empty line was found to extract.' + }); }); test('handles windows-style line endings in raw fallback', () => { - expect(lastexpr('first\r\nsecond', null)).toBe('second'); + expect(lastexpr('first\r\nsecond', null)).toEqual({ result: 'second' }); }); test('falls back to raw when blocks is an empty array', () => { - expect(lastexpr('fallback', [])).toBe('fallback'); + expect(lastexpr('fallback', [])).toEqual({ result: 'fallback' }); }); }); }); diff --git a/tests/jest/ascii.extractors.lastregexmatch.test.js b/tests/jest/ascii.extractors.lastregexmatch.test.js index 190e0d77434..414e63f7683 100644 --- a/tests/jest/ascii.extractors.lastregexmatch.test.js +++ b/tests/jest/ascii.extractors.lastregexmatch.test.js @@ -1,34 +1,50 @@ import lastregexmatch from '../../corsscripts/ascii/extractors/lastregexmatch.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; describe('lastregexmatch extractor', () => { + beforeEach(() => { + setExtractorStrings({ + asciistringextractorregexrequired: 'This extractor requires a regular expression.', + asciistringextractorregexnotfound: 'No line matched the requested regular expression.' + }); + }); + describe('guard clauses', () => { - test('returns ERROR when operation is undefined', () => { - expect(lastregexmatch('any raw', [], undefined)).toBe('ERROR'); + test('returns translated error when operation is undefined', () => { + expect(lastregexmatch('any raw', [], undefined)).toEqual({ + error: 'This extractor requires a regular expression.' + }); }); - test('returns ERROR when operation is null', () => { - expect(lastregexmatch('any raw', [], null)).toBe('ERROR'); + test('returns translated error when operation is null', () => { + expect(lastregexmatch('any raw', [], null)).toEqual({ + error: 'This extractor requires a regular expression.' + }); }); - test('returns ERROR when operation.regex is missing', () => { - expect(lastregexmatch('any raw', [], {})).toBe('ERROR'); + test('returns translated error when operation.regex is missing', () => { + expect(lastregexmatch('any raw', [], {})).toEqual({ + error: 'This extractor requires a regular expression.' + }); }); }); test('returns full last matching line from raw', () => { const raw = 'f(x) = first\nother\nf(x) = last'; const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; - expect(lastregexmatch(raw, null, operation)).toBe('f(x) = last'); + expect(lastregexmatch(raw, null, operation)).toEqual({ result: 'f(x) = last' }); }); test('trims lines before matching', () => { const raw = ' f(x) = expr '; const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; - expect(lastregexmatch(raw, null, operation)).toBe('f(x) = expr'); + expect(lastregexmatch(raw, null, operation)).toEqual({ result: 'f(x) = expr' }); }); - test('returns ERROR when there is no match', () => { + test('returns translated error when there is no match', () => { const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; - expect(lastregexmatch('a = 1\nb = 2', null, operation)).toBe('ERROR'); + expect(lastregexmatch('a = 1\nb = 2', null, operation)).toEqual({ + error: 'No line matched the requested regular expression.' + }); }); }); diff --git a/tests/jest/ascii.extractors.lastregexremainder.test.js b/tests/jest/ascii.extractors.lastregexremainder.test.js index 0e40201bada..31dd6f13996 100644 --- a/tests/jest/ascii.extractors.lastregexremainder.test.js +++ b/tests/jest/ascii.extractors.lastregexremainder.test.js @@ -1,37 +1,46 @@ import lastregexremainder from '../../corsscripts/ascii/extractors/lastregexremainder.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; describe('lastregexremainder extractor', () => { + beforeEach(() => { + setExtractorStrings({ + asciistringextractorregexnotfound: 'No line matched the requested regular expression.' + }); + }); + test('returns empty string when regex consumes whole matching line', () => { const raw = 'abc\n42\n99'; - expect(lastregexremainder(raw, null, { regex: '^\\d+$' })).toBe(''); + expect(lastregexremainder(raw, null, { regex: '^\\d+$' })).toEqual({ result: '' }); }); - test('returns ERROR when there is no match', () => { + test('returns translated error when there is no match', () => { const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; - expect(lastregexremainder('a = 1\nb = 2', null, operation)).toBe('ERROR'); + expect(lastregexremainder('a = 1\nb = 2', null, operation)).toEqual({ + error: 'No line matched the requested regular expression.' + }); }); test('returns suffix of the last matching line', () => { const raw = 'f(x) = first\nother\n f(x) = last '; const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; - expect(lastregexremainder(raw, null, operation)).toBe('last'); + expect(lastregexremainder(raw, null, operation)).toEqual({ result: 'last' }); }); test('returns basic match', () => { const raw = ' f(x) = x^2'; const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; - expect(lastregexremainder(raw, null, operation)).toBe('x^2'); + expect(lastregexremainder(raw, null, operation)).toEqual({ result: 'x^2' }); }); test('returns basic match no whitespace', () => { const raw = ' f(x)=x^2'; const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; - expect(lastregexremainder(raw, null, operation)).toBe('x^2'); + expect(lastregexremainder(raw, null, operation)).toEqual({ result: 'x^2' }); }); test('returns basic match backticks', () => { const raw = ' f(x)= `x^2` '; const operation = { regex: '^f\\(x\\)\\s*=\\s*' }; - expect(lastregexremainder(raw, null, operation)).toBe('`x^2`'); + expect(lastregexremainder(raw, null, operation)).toEqual({ result: '`x^2`' }); }); -}); \ No newline at end of file +}); diff --git a/tests/jest/ascii.extractors.laststringremainder.test.js b/tests/jest/ascii.extractors.laststringremainder.test.js index cbd5c0b42ae..145958129e2 100644 --- a/tests/jest/ascii.extractors.laststringremainder.test.js +++ b/tests/jest/ascii.extractors.laststringremainder.test.js @@ -1,13 +1,25 @@ import laststringremainder from '../../corsscripts/ascii/extractors/laststringremainder.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; describe('laststringremainder extractor', () => { + beforeEach(() => { + setExtractorStrings({ + asciistringextractorsearchrequired: 'This extractor requires a search parameter.', + asciistringextractorsearchnotfound: 'No line matched the requested search text.' + }); + }); + describe('guard clauses', () => { - test('returns ERROR when operation is undefined', () => { - expect(laststringremainder('any raw', null, undefined)).toBe('ERROR'); + test('returns translated error when operation is undefined', () => { + expect(laststringremainder('any raw', null, undefined)).toEqual({ + error: 'This extractor requires a search parameter.' + }); }); - test('returns ERROR when operation.string is missing', () => { - expect(laststringremainder('any raw', null, {})).toBe('ERROR'); + test('returns translated error when operation.string is missing', () => { + expect(laststringremainder('any raw', null, {})).toEqual({ + error: 'This extractor requires a search parameter.' + }); }); }); @@ -15,32 +27,34 @@ describe('laststringremainder extractor', () => { test('returns remainder after matched prefix on the last matching line', () => { const raw = 'Answer = first\nother\nAnswer = last'; const operation = { string: 'Answer =' }; - expect(laststringremainder(raw, null, operation)).toBe('last'); + expect(laststringremainder(raw, null, operation)).toEqual({ result: 'last' }); }); test('supports optional backticks around the line', () => { const raw = '`Answer = value`'; const operation = { string: 'Answer =' }; - expect(laststringremainder(raw, null, operation)).toBe('value'); + expect(laststringremainder(raw, null, operation)).toEqual({ result: 'value' }); }); test('supports optional backticks around thevalue', () => { const raw = 'Answer = ` value ` '; const operation = { string: 'Answer =' }; - expect(laststringremainder(raw, null, operation)).toBe('value'); + expect(laststringremainder(raw, null, operation)).toEqual({ result: 'value' }); }); test('trims matching lines before processing', () => { const raw = ' Answer = x^2 '; const operation = { string: 'Answer =' }; - expect(laststringremainder(raw, null, operation)).toBe('x^2'); + expect(laststringremainder(raw, null, operation)).toEqual({ result: 'x^2' }); }); }); describe('no-match behavior', () => { - test('returns ERROR when no lines match', () => { + test('returns translated error when no lines match', () => { const operation = { string: 'Answer =' }; - expect(laststringremainder('f(x) = x^2', null, operation)).toBe('ERROR'); + expect(laststringremainder('f(x) = x^2', null, operation)).toEqual({ + error: 'No line matched the requested search text.' + }); }); }); }); diff --git a/tests/jest/ascii.extractors.laststringremainderwhitespace.test.js b/tests/jest/ascii.extractors.laststringremainderwhitespace.test.js index dc9458b2c0e..14c01e3e4ca 100644 --- a/tests/jest/ascii.extractors.laststringremainderwhitespace.test.js +++ b/tests/jest/ascii.extractors.laststringremainderwhitespace.test.js @@ -1,92 +1,105 @@ import laststringremainderwhitespace from '../../corsscripts/ascii/extractors/laststringremainderwhitespace.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; describe('laststringremainderwhitespace extractor', () => { - test('returns ERROR when there is no match', () => { + beforeEach(() => { + setExtractorStrings({ + asciistringextractorsearchnotfound: 'No line matched the requested search text.' + }); + }); + + test('returns translated error when there is no match', () => { const operation = { search: 'f(x) =' }; - expect(laststringremainderwhitespace('a = 1\nb = 2', null, operation)).toBe('ERROR'); + expect(laststringremainderwhitespace('a = 1\nb = 2', null, operation)).toEqual({ + error: 'No line matched the requested search text.' + }); }); test('returns suffix of the last matching line', () => { const raw = 'f(x) = first\nother\n f(x) = last '; const operation = { search: 'f(x) =' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('last'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'last' }); }); test('returns basic match', () => { const raw = ' f(x) = x^2'; const operation = { search: 'f(x) =' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('x^2'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'x^2' }); }); test('returns basic match no whitespace', () => { const raw = ' f(x) =x^2'; const operation = { search: 'f(x) =' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('x^2'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'x^2' }); }); test('returns basic match backticks', () => { const raw = ' f(x) = `x^2` '; const operation = { search: 'f(x) =' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('x^2'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'x^2' }); }); test('returns basic match backticks internal whitespace', () => { const raw = ' f(x) = ` x^7 ` '; const operation = { search: 'f(x) =' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('x^7'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'x^7' }); }); test('returns basic match no whitespace', () => { const raw = 'f(x)=x^2'; const operation = { search: 'f(x) =' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('x^2'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'x^2' }); }); test('returns external match backticks internal whitespace', () => { const raw = '`f(x)=x^2`'; const operation = { search: 'f(x)=' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('x^2'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'x^2' }); }); test('returns external match backticks lots of whitespace', () => { const raw = '` f(x) =x^2 `'; const operation = { search: 'f(x) =' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('x^2'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'x^2' }); }); test('returns external match backticks lots of whitespace, full stop', () => { const raw = '` f(x) =x^3+1 ` . '; const operation = { search: 'f(x) =' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('x^3+1'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'x^3+1' }); }); - test('Fail to match because of previous text', () => { + test('fails to match because of previous text', () => { const raw = 'hence `f(x)=x^2`.'; const operation = { search: 'f(x) =' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('ERROR'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ + error: 'No line matched the requested search text.' + }); }); test('returns basic match backticks internal whitespace', () => { const raw = ' f(x)= x^2 '; const operation = { search: 'f(x)=' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('x^2'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'x^2' }); }); test('returns basic match backticks internal whitespace, full stop', () => { const raw = ' f(x)= x^2. '; const operation = { search: 'f(x)=' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('x^2'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: 'x^2' }); }); - test('returns error because of internal whitespace in line but not search string', () => { + test('returns translated error because of internal whitespace in line but not search string', () => { const raw = ' f(x) = x^2 '; const operation = { search: 'f(x)=' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('ERROR'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ + error: 'No line matched the requested search text.' + }); }); test('returns last match', () => { const raw = ' a=1\n a = 2'; const operation = { search: 'a =' }; - expect(laststringremainderwhitespace(raw, null, operation)).toBe('2'); + expect(laststringremainderwhitespace(raw, null, operation)).toEqual({ result: '2' }); }); }); diff --git a/tests/jest/ascii.stackascii.test.js b/tests/jest/ascii.stackascii.test.js index e90c60b1400..8de6d2101a7 100644 --- a/tests/jest/ascii.stackascii.test.js +++ b/tests/jest/ascii.stackascii.test.js @@ -79,6 +79,7 @@ describe('stackascii init', () => { id, value, innerHTML: '', + offsetHeight: 0, scrollTop: 0, scrollHeight: 0, clientHeight: 0, @@ -104,13 +105,19 @@ describe('stackascii init', () => { function setupEnvironment(inputValue, answerCount = 1) { const markdownInput = createElement('markdownInput', inputValue); + const shell = createElement('asciiShell'); const output = createElement('asciiContainerRow'); + const renderedOutput = createElement('asciiRenderedContent'); + const errorOutput = createElement('asciiErrorRow'); const supplied = createElement('asciiSuppliedText'); const answers = Array.from({ length: answerCount }, (_, index) => createElement(`answer${index + 1}`)); const elements = { markdownInput, + asciiShell: shell, asciiContainerRow: output, + asciiRenderedContent: renderedOutput, + asciiErrorRow: errorOutput, asciiSuppliedText: supplied }; for (const answer of answers) { @@ -131,7 +138,7 @@ describe('stackascii init', () => { }); global.clearTimeout = jest.fn(); - return { markdownInput, output, answers, elements }; + return { markdownInput, shell, output, renderedOutput, errorOutput, answers, elements }; } beforeEach(() => { @@ -176,7 +183,9 @@ describe('stackascii init', () => { blockCollector.blocks.push({ type: 'calculation', raw: text }); return `CALC:${text}`; }); - mockLastexpr.mockImplementation((raw, blocks, op) => `EXTRACT:${raw}:${blocks.map((block) => block.type).join('|')}`); + mockLastexpr.mockImplementation((raw, blocks, op) => ({ + result: `EXTRACT:${raw}:${blocks.map((block) => block.type).join('|')}` + })); const operations = [ { operation: 'filter', type: 'markdown', reset: 'false', display: 'true' }, @@ -192,7 +201,7 @@ describe('stackascii init', () => { { type: 'markdown', raw: ' alpha ' }, { type: 'calculation', raw: ' alpha ' } ], operations[2]); - expect(env.output.innerHTML).toBe('MD: alpha '); + expect(env.renderedOutput.innerHTML).toBe('MD: alpha '); expect(env.answers[0].value).toBe('EXTRACT: alpha :markdown|calculation'); expect(env.answers[0].dispatchEvent).toHaveBeenCalledWith({ type: 'change' }); expect(global.MathJax.typesetPromise).toHaveBeenCalledWith([env.output]); @@ -209,8 +218,12 @@ describe('stackascii init', () => { blockCollector.blocks = [{ type: 'calculation', raw: text }]; return `CALC:${text}`; }); - mockLastexpr.mockImplementation((raw, blocks, op) => `EXTRACT:${raw}:${blocks.map((block) => block.type).join('|')}`); - mockLastcalc.mockImplementation((raw, blocks, op) => `EXTRACTCALC:${raw}:${blocks.map((block) => block.type).join('|')}`); + mockLastexpr.mockImplementation((raw, blocks, op) => ({ + result: `EXTRACT:${raw}:${blocks.map((block) => block.type).join('|')}` + })); + mockLastcalc.mockImplementation((raw, blocks, op) => ({ + result: `EXTRACTCALC:${raw}:${blocks.map((block) => block.type).join('|')}` + })); const operations = [ { operation: 'filter', type: 'markdown' }, @@ -229,7 +242,7 @@ describe('stackascii init', () => { expect(mockLastcalc).toHaveBeenCalledWith(' alpha ', [ { type: 'calculation', raw: 'MD: alpha ' } ], operations[3]); - expect(env.output.innerHTML).toBe('CALC:MD: alpha '); + expect(env.renderedOutput.innerHTML).toBe('CALC:MD: alpha '); expect(env.answers[0].value).toBe('EXTRACT: alpha :markdown'); expect(env.answers[0].dispatchEvent).toHaveBeenCalledWith({ type: 'change' }); expect(env.answers[1].value).toBe('EXTRACTCALC: alpha :calculation'); @@ -237,10 +250,10 @@ describe('stackascii init', () => { expect(global.MathJax.typesetPromise).toHaveBeenCalledWith([env.output]); }); - test('clears the answer input when an extractor returns ERROR', () => { + test('clears the answer input when an extractor returns an error object', () => { const env = setupEnvironment('beta', 1); - mockLaststringremainder.mockReturnValue('ERROR'); + mockLaststringremainder.mockReturnValue({ error: 'No line matched the requested search text.' }); const operations = [{ operation: 'extractor', type: 'laststringremainder' }]; @@ -249,7 +262,27 @@ describe('stackascii init', () => { expect(mockLaststringremainder).toHaveBeenCalledWith('beta', [], operations[0]); expect(env.answers[0].value).toBe(''); expect(env.answers[0].dispatchEvent).not.toHaveBeenCalled(); - expect(env.output.innerHTML).toBe('beta'); + expect(env.renderedOutput.innerHTML).toBe('beta'); + expect(env.errorOutput.innerHTML).toBe(''); + }); + + test('shows extractor errors in the ASCII panel when enabled', () => { + const env = setupEnvironment('beta', 1); + + mockLaststringremainder.mockReturnValue({ error: 'Translated extractor failure.' }); + + const operations = [{ operation: 'extractor', type: 'laststringremainder', errors: 'true' }]; + + init(['markdownInput', 'answer1'], operations, { + asciistrings: { asciistringextractorsearchnotfound: 'Translated extractor failure.' } + }); + + expect(env.answers[0].value).toBe(''); + expect(env.errorOutput.innerHTML).toBe( + '

Translated extractor failure.

' + ); + expect(env.shell.classList.add).toHaveBeenCalledWith('stackascii-has-errors'); + expect(env.renderedOutput.style.paddingBottom).toBe('5px'); }); test('debounces and rerenders when the input changes', () => { @@ -269,7 +302,7 @@ describe('stackascii init', () => { expect(global.clearTimeout).toHaveBeenCalled(); expect(global.setTimeout).toHaveBeenCalledWith(expect.any(Function), 100); expect(mockMarkdown).toHaveBeenCalledTimes(2); - expect(env.output.innerHTML).toBe('MD:gamma'); + expect(env.renderedOutput.innerHTML).toBe('MD:gamma'); }); test('registers one-way scroll sync and applies inbound scroll positions', () => { From 17db49deb8f52111dc7680555858b3942f73e567 Mon Sep 17 00:00:00 2001 From: Edmund Farrow Date: Tue, 21 Jul 2026 16:00:19 +0100 Subject: [PATCH 2/7] freetext-errors - Tidy --- corsscripts/ascii/extractors/allregexmatch.js | 2 +- corsscripts/ascii/extractors/allregexremainder.js | 2 +- .../extractors/{extractorresult.js => extractorhelper.js} | 1 - corsscripts/ascii/extractors/lastblock.js | 2 +- corsscripts/ascii/extractors/lastcalc.js | 2 +- corsscripts/ascii/extractors/lastexpr.js | 2 +- corsscripts/ascii/extractors/lastregexmatch.js | 2 +- corsscripts/ascii/extractors/lastregexremainder.js | 2 +- corsscripts/ascii/extractors/laststringremainder.js | 2 +- corsscripts/ascii/extractors/laststringremainderwhitespace.js | 2 +- corsscripts/ascii/stackascii.js | 4 ++-- tests/jest/ascii.extractors.allregexmatch.test.js | 2 +- tests/jest/ascii.extractors.allregexremainder.test.js | 2 +- tests/jest/ascii.extractors.lastblock.test.js | 2 +- tests/jest/ascii.extractors.lastcalc.test.js | 2 +- tests/jest/ascii.extractors.lastexpr.test.js | 2 +- tests/jest/ascii.extractors.lastregexmatch.test.js | 2 +- tests/jest/ascii.extractors.lastregexremainder.test.js | 2 +- tests/jest/ascii.extractors.laststringremainder.test.js | 2 +- .../ascii.extractors.laststringremainderwhitespace.test.js | 2 +- 20 files changed, 20 insertions(+), 21 deletions(-) rename corsscripts/ascii/extractors/{extractorresult.js => extractorhelper.js} (99%) diff --git a/corsscripts/ascii/extractors/allregexmatch.js b/corsscripts/ascii/extractors/allregexmatch.js index f504461f334..9eece0da540 100644 --- a/corsscripts/ascii/extractors/allregexmatch.js +++ b/corsscripts/ascii/extractors/allregexmatch.js @@ -1,4 +1,4 @@ -import { extractorError, extractorResult } from './extractorresult.js'; +import { extractorError, extractorResult } from './extractorhelper.js'; // Extractor: allregexmatch // [[extractor targetinput="ans2" type="allregexmatch" regex="^f\\(x\\)\\s*=\\s*" /]] diff --git a/corsscripts/ascii/extractors/allregexremainder.js b/corsscripts/ascii/extractors/allregexremainder.js index 4e36de7f1bd..585c5c19688 100644 --- a/corsscripts/ascii/extractors/allregexremainder.js +++ b/corsscripts/ascii/extractors/allregexremainder.js @@ -1,4 +1,4 @@ -import { extractorError, extractorResult } from './extractorresult.js'; +import { extractorError, extractorResult } from './extractorhelper.js'; // Extractor: allregexremainder // [[extractor targetinput="ans2" type="allregexremainder" regex="^f\\(x\\)\\s*=\\s*" /]] diff --git a/corsscripts/ascii/extractors/extractorresult.js b/corsscripts/ascii/extractors/extractorhelper.js similarity index 99% rename from corsscripts/ascii/extractors/extractorresult.js rename to corsscripts/ascii/extractors/extractorhelper.js index 6ec3887c65e..0d7c23055e2 100644 --- a/corsscripts/ascii/extractors/extractorresult.js +++ b/corsscripts/ascii/extractors/extractorhelper.js @@ -23,4 +23,3 @@ export function extractorError(key, detail = '') { error: message }; } - diff --git a/corsscripts/ascii/extractors/lastblock.js b/corsscripts/ascii/extractors/lastblock.js index 5b934e58c98..31f08d500a9 100644 --- a/corsscripts/ascii/extractors/lastblock.js +++ b/corsscripts/ascii/extractors/lastblock.js @@ -1,4 +1,4 @@ -import { extractorError, extractorResult } from './extractorresult.js'; +import { extractorError, extractorResult } from './extractorhelper.js'; // Extractor: lastblock // Returns the raw content of the last code_inline, or the full content diff --git a/corsscripts/ascii/extractors/lastcalc.js b/corsscripts/ascii/extractors/lastcalc.js index 66191f21826..bd8ef72c893 100644 --- a/corsscripts/ascii/extractors/lastcalc.js +++ b/corsscripts/ascii/extractors/lastcalc.js @@ -1,4 +1,4 @@ -import { extractorError, extractorResult } from './extractorresult.js'; +import { extractorError, extractorResult } from './extractorhelper.js'; // Extractor: lastcalc // Returns the trimmed content of the last calculation block. diff --git a/corsscripts/ascii/extractors/lastexpr.js b/corsscripts/ascii/extractors/lastexpr.js index 07b70e342b1..34898560fa1 100644 --- a/corsscripts/ascii/extractors/lastexpr.js +++ b/corsscripts/ascii/extractors/lastexpr.js @@ -1,4 +1,4 @@ -import { extractorError, extractorResult } from './extractorresult.js'; +import { extractorError, extractorResult } from './extractorhelper.js'; // Extractor: lastexpr // Returns the trimmed content of the last code_inline, or the last non-empty line diff --git a/corsscripts/ascii/extractors/lastregexmatch.js b/corsscripts/ascii/extractors/lastregexmatch.js index eebae8df9e1..992c491289c 100644 --- a/corsscripts/ascii/extractors/lastregexmatch.js +++ b/corsscripts/ascii/extractors/lastregexmatch.js @@ -1,4 +1,4 @@ -import { extractorError, extractorResult } from './extractorresult.js'; +import { extractorError, extractorResult } from './extractorhelper.js'; // Extractor: lastregexmatch // [[extractor targetinput="ans2" type="lastregexmatch" regex="^f\\(x\\)\\s*=\\s*" /]] diff --git a/corsscripts/ascii/extractors/lastregexremainder.js b/corsscripts/ascii/extractors/lastregexremainder.js index ab8adb339b7..376ce96b5fd 100644 --- a/corsscripts/ascii/extractors/lastregexremainder.js +++ b/corsscripts/ascii/extractors/lastregexremainder.js @@ -1,4 +1,4 @@ -import { extractorError, extractorResult } from './extractorresult.js'; +import { extractorError, extractorResult } from './extractorhelper.js'; // Extractor: lastregexremainder // [[extractor targetinput="ans2" type="lastregexmatch" regex="^f\\(x\\)\\s*=\\s*" /]] diff --git a/corsscripts/ascii/extractors/laststringremainder.js b/corsscripts/ascii/extractors/laststringremainder.js index 6a94ea2f250..f5df324897c 100644 --- a/corsscripts/ascii/extractors/laststringremainder.js +++ b/corsscripts/ascii/extractors/laststringremainder.js @@ -1,4 +1,4 @@ -import { extractorError, extractorResult } from './extractorresult.js'; +import { extractorError, extractorResult } from './extractorhelper.js'; // Extractor: laststringremainder // [[extractor targetinput="ans2" type="laststringremainder" string="Answer =" /]] diff --git a/corsscripts/ascii/extractors/laststringremainderwhitespace.js b/corsscripts/ascii/extractors/laststringremainderwhitespace.js index 8f6bd407de2..196464b0185 100644 --- a/corsscripts/ascii/extractors/laststringremainderwhitespace.js +++ b/corsscripts/ascii/extractors/laststringremainderwhitespace.js @@ -1,4 +1,4 @@ -import { extractorError, extractorResult } from './extractorresult.js'; +import { extractorError, extractorResult } from './extractorhelper.js'; // Extractor: laststringremainderwhitespace // [[extractor targetinput="ans2" type="laststringremainderwhitespace" string="f(x) =" /]] diff --git a/corsscripts/ascii/stackascii.js b/corsscripts/ascii/stackascii.js index 293b02791d9..2b03fcc6408 100644 --- a/corsscripts/ascii/stackascii.js +++ b/corsscripts/ascii/stackascii.js @@ -45,7 +45,7 @@ import lastregexmatch from './extractors/lastregexmatch.js'; import lastregexremainder from './extractors/lastregexremainder.js'; import allregexmatch from './extractors/allregexmatch.js'; import allregexremainder from './extractors/allregexremainder.js'; -import { setExtractorStrings } from './extractors/extractorresult.js'; +import { setExtractorStrings } from './extractors/extractorhelper.js'; const extractorlib = { lastblock, @@ -163,7 +163,7 @@ export default function init(inputIds, operations, options = {}) { } if (!isHTML) { - output.classList.add('plaintext'); + renderedOutput.classList.add('plaintext'); } renderedOutput.innerHTML = processedOutput; if (extractorErrors.length > 0) { diff --git a/tests/jest/ascii.extractors.allregexmatch.test.js b/tests/jest/ascii.extractors.allregexmatch.test.js index e349afb1b1c..f0bc131ff07 100644 --- a/tests/jest/ascii.extractors.allregexmatch.test.js +++ b/tests/jest/ascii.extractors.allregexmatch.test.js @@ -1,5 +1,5 @@ import allregexmatch from '../../corsscripts/ascii/extractors/allregexmatch.js'; -import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorhelper.js'; describe('allregexmatch extractor', () => { beforeEach(() => { diff --git a/tests/jest/ascii.extractors.allregexremainder.test.js b/tests/jest/ascii.extractors.allregexremainder.test.js index 45695f979bb..8fccf03237a 100644 --- a/tests/jest/ascii.extractors.allregexremainder.test.js +++ b/tests/jest/ascii.extractors.allregexremainder.test.js @@ -1,5 +1,5 @@ import allregexremainder from '../../corsscripts/ascii/extractors/allregexremainder.js'; -import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorhelper.js'; describe('allregexremainder extractor', () => { beforeEach(() => { diff --git a/tests/jest/ascii.extractors.lastblock.test.js b/tests/jest/ascii.extractors.lastblock.test.js index 4fbce64a790..abbe109ee60 100644 --- a/tests/jest/ascii.extractors.lastblock.test.js +++ b/tests/jest/ascii.extractors.lastblock.test.js @@ -1,5 +1,5 @@ import lastblock from '../../corsscripts/ascii/extractors/lastblock.js'; -import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorhelper.js'; describe('lastblock extractor', () => { beforeEach(() => { diff --git a/tests/jest/ascii.extractors.lastcalc.test.js b/tests/jest/ascii.extractors.lastcalc.test.js index 6b85d458442..14cba07ee0c 100644 --- a/tests/jest/ascii.extractors.lastcalc.test.js +++ b/tests/jest/ascii.extractors.lastcalc.test.js @@ -1,5 +1,5 @@ import lastcalc from '../../corsscripts/ascii/extractors/lastcalc.js'; -import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorhelper.js'; describe('lastcalc extractor', () => { beforeEach(() => { diff --git a/tests/jest/ascii.extractors.lastexpr.test.js b/tests/jest/ascii.extractors.lastexpr.test.js index 2e0f1281ff8..3527e7b77c8 100644 --- a/tests/jest/ascii.extractors.lastexpr.test.js +++ b/tests/jest/ascii.extractors.lastexpr.test.js @@ -1,5 +1,5 @@ import lastexpr from '../../corsscripts/ascii/extractors/lastexpr.js'; -import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorhelper.js'; describe('lastexpr extractor', () => { beforeEach(() => { diff --git a/tests/jest/ascii.extractors.lastregexmatch.test.js b/tests/jest/ascii.extractors.lastregexmatch.test.js index 414e63f7683..9f4f0db64c0 100644 --- a/tests/jest/ascii.extractors.lastregexmatch.test.js +++ b/tests/jest/ascii.extractors.lastregexmatch.test.js @@ -1,5 +1,5 @@ import lastregexmatch from '../../corsscripts/ascii/extractors/lastregexmatch.js'; -import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorhelper.js'; describe('lastregexmatch extractor', () => { beforeEach(() => { diff --git a/tests/jest/ascii.extractors.lastregexremainder.test.js b/tests/jest/ascii.extractors.lastregexremainder.test.js index 31dd6f13996..ecf3b22795d 100644 --- a/tests/jest/ascii.extractors.lastregexremainder.test.js +++ b/tests/jest/ascii.extractors.lastregexremainder.test.js @@ -1,5 +1,5 @@ import lastregexremainder from '../../corsscripts/ascii/extractors/lastregexremainder.js'; -import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorhelper.js'; describe('lastregexremainder extractor', () => { beforeEach(() => { diff --git a/tests/jest/ascii.extractors.laststringremainder.test.js b/tests/jest/ascii.extractors.laststringremainder.test.js index 145958129e2..ab6770395e6 100644 --- a/tests/jest/ascii.extractors.laststringremainder.test.js +++ b/tests/jest/ascii.extractors.laststringremainder.test.js @@ -1,5 +1,5 @@ import laststringremainder from '../../corsscripts/ascii/extractors/laststringremainder.js'; -import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorhelper.js'; describe('laststringremainder extractor', () => { beforeEach(() => { diff --git a/tests/jest/ascii.extractors.laststringremainderwhitespace.test.js b/tests/jest/ascii.extractors.laststringremainderwhitespace.test.js index 14c01e3e4ca..4fa7d463d33 100644 --- a/tests/jest/ascii.extractors.laststringremainderwhitespace.test.js +++ b/tests/jest/ascii.extractors.laststringremainderwhitespace.test.js @@ -1,5 +1,5 @@ import laststringremainderwhitespace from '../../corsscripts/ascii/extractors/laststringremainderwhitespace.js'; -import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorresult.js'; +import { setExtractorStrings } from '../../corsscripts/ascii/extractors/extractorhelper.js'; describe('laststringremainderwhitespace extractor', () => { beforeEach(() => { From 9adf30c61d4eb488891188f1d78eae689e9f77ac Mon Sep 17 00:00:00 2001 From: Edmund Farrow Date: Wed, 22 Jul 2026 14:45:21 +0100 Subject: [PATCH 3/7] freetext-errors - Add error detail and HTML escape it. Fix bug when result is blank. --- corsscripts/ascii/extractors/allregexmatch.js | 2 +- corsscripts/ascii/extractors/allregexremainder.js | 2 +- corsscripts/ascii/extractors/lastregexmatch.js | 2 +- .../ascii/extractors/lastregexremainder.js | 2 +- .../ascii/extractors/laststringremainder.js | 8 ++++---- .../extractors/laststringremainderwhitespace.js | 2 +- corsscripts/ascii/stackascii.bundle.js | 14 +++++++------- corsscripts/ascii/stackascii.bundle.js.map | 6 +++--- corsscripts/ascii/stackascii.js | 15 ++++++++++++--- .../Authoring/Question_blocks/ASCII_extractors.md | 4 ++-- lang/en/qtype_stack.php | 4 ++-- stack/cas/castext2/blocks/ascii.block.php | 1 - tests/jest/ascii.extractors.allregexmatch.test.js | 2 +- .../ascii.extractors.allregexremainder.test.js | 2 +- .../jest/ascii.extractors.lastregexmatch.test.js | 2 +- .../ascii.extractors.lastregexremainder.test.js | 2 +- .../ascii.extractors.laststringremainder.test.js | 14 +++++++------- ...tractors.laststringremainderwhitespace.test.js | 6 +++--- 18 files changed, 49 insertions(+), 41 deletions(-) diff --git a/corsscripts/ascii/extractors/allregexmatch.js b/corsscripts/ascii/extractors/allregexmatch.js index 9eece0da540..182cf8b7d97 100644 --- a/corsscripts/ascii/extractors/allregexmatch.js +++ b/corsscripts/ascii/extractors/allregexmatch.js @@ -19,7 +19,7 @@ export default function allregexmatch(raw, blocks, operation) { } if (matches.length === 0) { - return extractorError('asciistringextractorregexnotfound'); + return extractorError('asciistringextractorregexnotfound', operation.regex); } return extractorResult(JSON.stringify({ matches })); } diff --git a/corsscripts/ascii/extractors/allregexremainder.js b/corsscripts/ascii/extractors/allregexremainder.js index 585c5c19688..e585fab275b 100644 --- a/corsscripts/ascii/extractors/allregexremainder.js +++ b/corsscripts/ascii/extractors/allregexremainder.js @@ -20,7 +20,7 @@ export default function allregexremainder(raw, blocks, operation) { } if (matches.length === 0) { - return extractorError('asciistringextractorregexnotfound'); + return extractorError('asciistringextractorregexnotfound', operation.regex); } return extractorResult(JSON.stringify({ matches })); } diff --git a/corsscripts/ascii/extractors/lastregexmatch.js b/corsscripts/ascii/extractors/lastregexmatch.js index 992c491289c..bbec1ebe763 100644 --- a/corsscripts/ascii/extractors/lastregexmatch.js +++ b/corsscripts/ascii/extractors/lastregexmatch.js @@ -19,5 +19,5 @@ export default function lastregexmatch(raw, blocks, operation) { return extractorResult(trimmed); } } - return extractorError('asciistringextractorregexnotfound'); + return extractorError('asciistringextractorregexnotfound', operation.regex); } diff --git a/corsscripts/ascii/extractors/lastregexremainder.js b/corsscripts/ascii/extractors/lastregexremainder.js index 376ce96b5fd..491280fef74 100644 --- a/corsscripts/ascii/extractors/lastregexremainder.js +++ b/corsscripts/ascii/extractors/lastregexremainder.js @@ -19,5 +19,5 @@ export default function lastregexremainder(raw, blocks, operation) { return extractorResult(trimmed.replace(pattern, '')); } } - return extractorError('asciistringextractorregexnotfound'); + return extractorError('asciistringextractorregexnotfound', operation.regex); } diff --git a/corsscripts/ascii/extractors/laststringremainder.js b/corsscripts/ascii/extractors/laststringremainder.js index f5df324897c..75707266b25 100644 --- a/corsscripts/ascii/extractors/laststringremainder.js +++ b/corsscripts/ascii/extractors/laststringremainder.js @@ -6,7 +6,7 @@ import { extractorError, extractorResult } from './extractorhelper.js'; // Returns the remainder of the line stripped of backslashes and leading/trailing spaces. // Scans lines in reverse order. export default function laststringremainder(raw, blocks, operation) { - if (!operation || !operation.string) { + if (!operation || !operation.search) { return extractorError('asciistringextractorsearchrequired'); } @@ -14,10 +14,10 @@ export default function laststringremainder(raw, blocks, operation) { lines.reverse(); for (const line of lines) { let trimmed = line.replace(/^[\s`]+|[\s`]+$/g, ''); - if (trimmed.includes(operation.string)) { - trimmed = trimmed.replace(operation.string, ''); + if (trimmed.includes(operation.search)) { + trimmed = trimmed.replace(operation.search, ''); return extractorResult(trimmed.replace(/^[\s`]+|[\s`]+$/g, '')); } } - return extractorError('asciistringextractorsearchnotfound'); + return extractorError('asciistringextractorsearchnotfound', operation.search); } diff --git a/corsscripts/ascii/extractors/laststringremainderwhitespace.js b/corsscripts/ascii/extractors/laststringremainderwhitespace.js index 196464b0185..c1fae7986e8 100644 --- a/corsscripts/ascii/extractors/laststringremainderwhitespace.js +++ b/corsscripts/ascii/extractors/laststringremainderwhitespace.js @@ -36,7 +36,7 @@ export default function laststringremainderwhitespace(raw, blocks, operation) { return extractorResult(retmatch.trim()); } } - return extractorError('asciistringextractorsearchnotfound'); + return extractorError('asciistringextractorsearchnotfound', operation.search); } function escaperegex(str) { diff --git a/corsscripts/ascii/stackascii.bundle.js b/corsscripts/ascii/stackascii.bundle.js index d5250894167..8ddfd76ff3d 100644 --- a/corsscripts/ascii/stackascii.bundle.js +++ b/corsscripts/ascii/stackascii.bundle.js @@ -67,13 +67,13 @@ In case of a (multi dimensional) array or matrix, the prob order quantile of all `:"")+e2.getLines(n2+1,d,e2.tShift[n2],!0)+(f?`${f} `:""),p.map=[n2,e2.line],p.markup=t,!0},l={alt:["paragraph","reference","blockquote","list"]};e.tex=(e2,t2)=>{if(typeof t2?.render!="function")throw TypeError('[@mdit/plugin-tex]: "render" option should be a function');let{allowInlineWithSpace:n2=!1,mathFence:r2=!1,delimiters:i2="dollars",render:u}=t2;if(r2){let t3=e2.renderer.rules.fence;e2.renderer.rules.fence=(e3,n3,r3,i3,a2)=>{let o2=e3[n3];return o2.info.trim()==="math"?u(o2.content,!0,i3):t3(e3,n3,r3,i3,a2)}}(i2==="dollars"||i2==="all")&&(e2.inline.ruler.after("escape","math_inline_dollar",a(n2)),e2.block.ruler.after("blockquote","math_block_dollar",s,l)),(i2==="brackets"||i2==="all")&&(e2.inline.ruler.before("escape","math_inline_bracket",o()),e2.block.ruler.after("blockquote","math_block_bracket",c,l)),e2.renderer.rules.math_inline=(e3,t3,n3,r3)=>u(e3[t3].content,!1,r3),e2.renderer.rules.math_block=(e3,t3,n3,r3)=>u(e3[t3].content,!0,r3)}})}});var import_mathjs_min=__toESM(require_mathjs_min()),allowed={functions:new Set(["sin","cos","tan","asin","acos","atan","sqrt","log","log10","exp","abs","floor","celing","round","mod","gcd","lcm","factorial","combinations","permutations","min","max","sum","prod","mean","median","mode","variance","std"]),operators:new Set(["add","subtract","multiply","divide","pow","unaryMinus","unaryPlus","factorial","mod"]),nodetypes:new Set(["ConstantNode","ParenthesisNode","ArrayNode","OperatorNode","FunctionNode","SymbolNode"])};function calculation(text,blockCollector){return blockCollector&&(blockCollector.isHTML=!1,blockCollector.blocks=[]),text.replace(/\{@([^\n]+?)@\}/g,(match,raw)=>{let rendered;try{let node=import_mathjs_min.default.parse(raw);validate(node,allowed),rendered=String(node.evaluate())}catch{rendered=raw}return blockCollector&&blockCollector.blocks.push({type:"calculation",raw,rendered}),rendered})}function validate(node,allowed2){node.traverse(n=>{switch(n.type){case"ParenthesisNode":break;case"SymbolNode":break;case"FunctionNode":if(!allowed2.functions.has(n.fn.name))throw new Error(`Function not allowed: ${n.fn.name}`);break;case"OperatorNode":if(!allowed2.operators.has(n.fn))throw new Error(`Operator not allowed: ${n.fn}`);break;default:if(!allowed2.nodetypes.has(n.type))throw new Error(`Node type not allowed: ${n.type}`)}})}var import_mathjs_min2=__toESM(require_mathjs_min());function cas(text,blockCollector){return blockCollector&&(blockCollector.isHTML=!1,blockCollector.blocks=[]),text.replace(/\{@([^\n]+?)@\}/g,(match,raw)=>{let rendered;try{rendered=String(import_mathjs_min2.default.evaluate(raw))}catch{rendered=raw}return blockCollector&&blockCollector.blocks.push({type:"calculation",raw,rendered}),rendered})}var import_markdownit=__toESM(require_markdownit()),import_asciimathblock=__toESM(require_asciimathblock());function markdownitrules(mdit,options){"use strict";let state2=options.state,originalCodeRule=mdit.renderer.rules.code_inline;mdit.core.ruler.push("reset_collector",()=>{state2.collector&&(state2.collector.isHTML=!0,state2.collector.blocks=[])}),mdit.renderer.rules.code_inline=function(tokens,idx,options2,env,self2){let code=tokens[idx].content,rendered="";return state2.transforms.length===0?rendered=originalCodeRule(tokens,idx,options2,env,self2):rendered=applyTransforms(code,"code_inline"),state2.collector&&state2.collector.blocks.push({type:"code_inline",raw:code,rendered}),rendered},mdit.renderer.rules.asciimath_block=function(tokens,idx){let code=tokens[idx].content,rendered="";return state2.transforms.length===0?rendered="`"+mdit.render(code)+"`":rendered=applyTransforms(code,"asciimath_block"),state2.collector&&state2.collector.blocks.push({type:"asciimath_block",raw:code,rendered}),rendered},mdit.renderer.rules.math_inline=function(tokens,idx){let code=tokens[idx].content,rendered="";return state2.transforms.length===0?rendered="\\("+mdit.renderInline(code)+"\\)":rendered=applyTransforms(code,"math_inline"),state2.collector&&state2.collector.blocks.push({type:"math_inline",raw:code,rendered}),rendered},mdit.renderer.rules.math_block=function(tokens,idx){let code=tokens[idx].content,rendered="";return state2.transforms.length===0?rendered="\\["+mdit.render(code)+"\\]":rendered=applyTransforms(code,"math_block"),state2.collector&&state2.collector.blocks.push({type:"math_block",raw:code,rendered}),rendered};function splitBlock(code){return code.split(/\r?\n/).map(line=>line.trim()).filter(line=>line!=="")}function applyTransforms(code,rule){let lines=splitBlock(code);for(let transform of state2.transforms){if(!state2.transformLib[transform])throw new Error(`markdownitrules: unknown transform "${transform}"`);lines=state2.transformLib[transform](lines,rule)}return lines.join(` `)+` -`}}var mdItPluginTex=__toESM(require_tex());function asciimath(lines,rule){switch(rule){case"asciimath_block":case"code_inline":return isLaTeX(lines)?lines:lines.map(line=>window.AMparseMath(line,!0));default:return lines}}function isLaTeX(lines){let code=lines.join();return["^{","_{","\\left","\\right","\\begin"].some(s=>code.includes(s))?!0:/\\[a-zA-Z]+/.test(code)}function findtextindex(str,needle,without=[],strend=!1){let braceDepth=0;for(let i=0;istr.startsWith(token,i));if(isIncluded==null)continue;if(!without.some(token=>str.startsWith(token,i)))return strend?isIncluded.slice(isIncluded.length-1,isIncluded.length)=="{"?i+isIncluded.length-1:i+isIncluded.length:i}}return!1}function aligneq(lines,rule){switch(rule){case"asciimath_block":case"math_block":break;case"code_inline":case"math_inline":return lines;default:return lines}let skipenv=["align","flalign","alignat","xalignat","xxalignat","gather","multline","equation","split","subequations"].flatMap(token=>[`\\begin{${token}}`,`\\begin{${token}*}`]);var skip=!1;for(let str of lines)findtextindex(str,skipenv)!==!1&&(skip=!0);if(skip)return lines;let output=["\\begin{align*}"];for(let str of lines){str=str.replace(/^\s*(?:\\displaystyle\s*)?/,""),str=str.trim();let matchimp=["Rightarrow","Leftarrow","Leftrightarrow","therefore","because","checkmark","models","vdash"].flatMap(token=>[`\\${token}`,`\\${token}`,`\\${token}`]).find(token=>str.startsWith(token));var connector="";matchimp!==void 0&&(connector=str.slice(0,matchimp.length),str=str.slice(matchimp.length));let matchtxt=findtextindex(str,["\\text{"],["\\text{or}","\\text{and}","\\text{if}"]);matchtxt&&(str=str.slice(0,matchtxt)+" & & "+str.slice(matchtxt));let relst=["in","notin","subset","subseteq","supset","supseteq","leq","lt","le","geq","gt","ge","preq","preqeq","succ","succeq","ne","neq","approx","equiv","propto","cong"],relations=["=",">","<"].concat(relst.flatMap(token=>[`\\${token}{`,`\\${token} `])),matcheqed=findtextindex(str,relations,[],!0);matcheqed!==!1?str=str.slice(0,matcheqed)+" &\\, "+str.slice(matcheqed):str=" &\\, "+str,str=connector+" & & "+str.trim()+"\\\\",str=str.trim(),output.push(str)}return output.push("\\end{align*}"),output}function boldfilter(lines,rule){let rowBreak="\\\\";return lines.map((line,i)=>i===0||i===lines.length-1?line:splitTopLevelAmpersands(line).map(col=>{let trimmed=col.trim();if(trimmed==="")return col;let trailingBreak="";if(trimmed.endsWith(rowBreak)&&(trailingBreak=rowBreak,trimmed=trimmed.slice(0,-rowBreak.length).trim()),trimmed==="")return col;let displayPrefix="\\displaystyle",bold;if(trimmed.startsWith(displayPrefix)){let rest=trimmed.slice(displayPrefix.length).trim();bold=rest?`${displayPrefix}\\boldsymbol{${rest}}`:displayPrefix}else bold=`\\boldsymbol{${trimmed}}`;return bold+trailingBreak}).join("&"))}function splitTopLevelAmpersands(line){let cols=[],start=0,depth=0,envStack=[];for(let i=0;i0?line[i-1]:"";if(ch==="{"&&prev!=="\\"){depth++;continue}if(ch==="}"&&prev!=="\\"){depth=Math.max(0,depth-1);continue}ch==="&"&&prev!=="\\"&&depth===0&&envStack.length===0&&(cols.push(line.slice(start,i)),start=i+1)}return cols.push(line.slice(start)),cols}function minwrap(lines,rule){if(lines&&lines.length===0)return[""];switch(rule){case"asciimath_block":case"math_block":return wraplatex(lines);case"code_inline":case"math_inline":return[`\\(${lines[0]}\\)`];default:return lines}}function wraplatex(lines){let skipenv=["align","flalign","alignat","xalignat","xxalignat","gather","multline","equation","split","subequations"].flatMap(token=>[`\\begin{${token}}`,`\\begin{${token}*}`]);var skip=!1;for(let str of lines)findtextindex(str,skipenv)!==!1&&(skip=!0);return skip||(lines.push("\\]"),lines.unshift("\\[")),lines}var transformLib={asciimath,boldfilter,aligneq,minwrap},state={transforms:[],transformLib,collector:null},converter=(0,import_markdownit.default)({html:!0}).use(mdItPluginTex.tex,{render:content=>content,delimiters:"brackets"}).use(import_asciimathblock.default).use(markdownitrules,{state});function markdown(text,blockCollector,op){return state.transforms=(op.transforms||"").split(",").map(s=>s.trim()).filter(Boolean),state.collector=blockCollector||null,converter.render(text)}function cas2(text,blockCollector){return blockCollector&&(blockCollector.isHTML=!1,blockCollector.blocks=[]),text}var extractorStrings={};function setExtractorStrings(strings={}){extractorStrings={...strings}}function extractorResult(result){return{result}}function extractorError(key,detail=""){let message=extractorStrings[key]||key;return detail!==""&&(message=message+" "+String(detail)),{error:message}}function lastblock(raw,blocks){if(blocks&&blocks.length>0){for(let i=blocks.length-1;i>=0;i--){let block=blocks[i];if(block.type==="code_inline")return extractorResult(block.raw);if(block.type==="asciimath_block")return extractorResult(block.raw)}return extractorError("asciistringextractorlastblocknotfound")}let lines=raw.split(/\r?\n/);for(let i=lines.length-1;i>=0;i--)if(lines[i].trim()!=="")return extractorResult(lines[i]);return extractorError("asciistringextractorlastblocknotfound")}function lastcalc(raw,blocks){if(blocks){for(let i=blocks.length-1;i>=0;i--)if(blocks[i].type==="calculation")return extractorResult(blocks[i].rendered.trim())}return extractorError("asciistringextractorlastcalcnotfound")}function lastexpr(raw,blocks){if(blocks&&blocks.length>0)for(let i=blocks.length-1;i>=0;i--){let block=blocks[i];if(block.type==="code_inline")return extractorResult(block.raw.trim());if(block.type==="asciimath_block"){let lines2=block.raw.split(/\r?\n/);for(let j=lines2.length-1;j>=0;j--){let trimmed=lines2[j].trim();if(trimmed!=="")return extractorResult(trimmed)}}}let lines=raw.split(/\r?\n/);for(let i=lines.length-1;i>=0;i--){let trimmed=lines[i].trim();if(trimmed!=="")return extractorResult(trimmed)}return extractorError("asciistringextractorlastexprnotfound")}function laststringremainder(raw,blocks,operation){if(!operation||!operation.string)return extractorError("asciistringextractorsearchrequired");let lines=raw.split(` -`);lines.reverse();for(let line of lines){let trimmed=line.replace(/^[\s`]+|[\s`]+$/g,"");if(trimmed.includes(operation.string))return trimmed=trimmed.replace(operation.string,""),extractorResult(trimmed.replace(/^[\s`]+|[\s`]+$/g,""))}return extractorError("asciistringextractorsearchnotfound")}function laststringremainderwhitespace(raw,blocks,operation){if(!operation||!operation.search)return extractorError("asciistringextractorsearchrequired");var match=escaperegex(operation.search);match="^"+match+"\\s*`?([^`]+)`?";let pattern=new RegExp(match),lines=raw.split(` -`);lines.reverse();for(let line of lines){var trimmed=line.trim();trimmed.endsWith(".")&&(trimmed=trimmed.slice(0,-1),trimmed=trimmed.trim()),trimmed.startsWith("`")&&trimmed.endsWith("`")&&(trimmed=trimmed.slice(1,-1),trimmed=trimmed.trim());let matched=trimmed.match(pattern);if(matched){let retmatch=matched[1];return extractorResult(retmatch.trim())}}return extractorError("asciistringextractorsearchnotfound")}function escaperegex(str){return str.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s*")}function lastregexmatch(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),lines=raw.split(` -`);lines.reverse();for(let line of lines){let trimmed=line.trim();if(pattern.test(trimmed))return extractorResult(trimmed)}return extractorError("asciistringextractorregexnotfound")}function lastregexremainder(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),lines=raw.split(` -`);lines.reverse();for(let line of lines){let trimmed=line.trim();if(pattern.test(trimmed))return extractorResult(trimmed.replace(pattern,""))}return extractorError("asciistringextractorregexnotfound")}function allregexmatch(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),matches=[];for(let line of raw.split(` -`)){let trimmed=line.trim();trimmed&&pattern.test(trimmed)&&matches.push(trimmed)}return matches.length===0?extractorError("asciistringextractorregexnotfound"):extractorResult(JSON.stringify({matches}))}function allregexremainder(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),matches=[];for(let line of raw.split(` -`)){let trimmed=line.trim();trimmed&&pattern.test(trimmed)&&matches.push(trimmed.replace(pattern,""))}return matches.length===0?extractorError("asciistringextractorregexnotfound"):extractorResult(JSON.stringify({matches}))}var filterlib={calculation,cas,markdown,plain:cas2},extractorlib={lastblock,lastcalc,lastexpr,laststringremainder,laststringremainderwhitespace,lastregexmatch,lastregexremainder,allregexmatch,allregexremainder};function init(inputIds,operations,options={}){setExtractorStrings(options.asciistrings||{});let markdownContainerId=inputIds.length?inputIds[0]:null,suppliedText=document.getElementById("asciiSuppliedText").innerHTML,shell=document.getElementById("asciiShell"),output=document.getElementById("asciiContainerRow"),renderedOutput=document.getElementById("asciiRenderedContent"),errorOutput=document.getElementById("asciiErrorRow"),syncScrollPosition=createScrollSyncHandler(markdownContainerId,typeof FRAME_ID<"u"?FRAME_ID:null,output),alloperations=operations,blockCollector={blocks:[],isHTML:!1};function renderMath(){let raw="";markdownContainerId?raw=document.getElementById(markdownContainerId).value:raw=suppliedText;let processedOutput=raw,isHTML=!1,displayfixed=!1,answerIndex=1,extractorErrors=[];if(alloperations&&alloperations.forEach((currentop,i)=>{if(currentop.operation==="filter"){let filter=filterlib[currentop.type];if(filter){let filterInput=processedOutput;currentop.reset==="true"&&(filterInput=raw);let filterOutput=filter(filterInput,blockCollector,currentop);displayfixed||(processedOutput=filterOutput,isHTML=blockCollector.isHTML),currentop.display==="true"&&(displayfixed=!0)}}else if(currentop.operation==="extractor"){let extractor=extractorlib[currentop.type]?extractorlib[currentop.type]:extractorlib.lastexpr,answerEl=document.getElementById(inputIds[answerIndex]);if(answerIndex++,extractor&&answerEl){let value=extractor(raw,blockCollector.blocks,currentop),oldValue=answerEl.value;value.error?(answerEl.value="",currentop.errors==="true"&&extractorErrors.push(value.error)):value.result?answerEl.value=value.result:answerEl.value=value,answerEl.value!==oldValue&&answerEl.dispatchEvent(new Event("change"))}}}),isHTML||output.classList.add("plaintext"),renderedOutput.innerHTML=processedOutput,extractorErrors.length>0){errorOutput.innerHTML=extractorErrors.map(message=>'

'+message+"

").join(""),shell.classList.add("stackascii-has-errors");let errorHeight=Number(errorOutput.offsetHeight)||0;renderedOutput.style.paddingBottom=`${errorHeight+5}px`}else shell.classList.remove("stackascii-has-errors"),renderedOutput.style.paddingBottom="";syncScrollPosition(),typeof MathJax.typesetPromise=="function"?MathJax.typesetPromise([output]).then(()=>{syncScrollPosition()}):MathJax.Hub&&typeof MathJax.Hub.Queue=="function"&&(MathJax.Hub.Queue(["Typeset",MathJax.Hub,"asciiContainerRow"]),MathJax.Hub.Queue(()=>{syncScrollPosition()}))}if(markdownContainerId){let debounceTimer;document.getElementById(markdownContainerId).addEventListener("change",()=>{clearTimeout(debounceTimer),debounceTimer=setTimeout(renderMath,100)})}renderMath()}function setScrollPosition(element,position){let maxScroll=element.scrollHeight-element.clientHeight,previousScrollBehavior=element.style.scrollBehavior;element.style.scrollBehavior="auto",element.scrollTop=maxScroll>0?position*maxScroll:0,element.style.scrollBehavior=previousScrollBehavior}function createScrollSyncHandler(markdownContainerId,frameId,output){if(!markdownContainerId||!frameId)return()=>{};let syncedScrollPosition=0,syncScrollPosition=()=>{setScrollPosition(output,syncedScrollPosition)};window.addEventListener("message",event=>{let message=JSON.parse(event.data);message.tgt!==frameId||message.type!=="input-scroll-position"||message.name!==markdownContainerId||(syncedScrollPosition=message.position,syncScrollPosition())});let registration={version:"STACK-JS:1.6.0",type:"track-input-scroll",name:markdownContainerId,"limit-to-question":!0,src:frameId};return window.parent.postMessage(JSON.stringify(registration),"*"),syncScrollPosition}export{init as default}; +`}}var mdItPluginTex=__toESM(require_tex());function asciimath(lines,rule){switch(rule){case"asciimath_block":case"code_inline":return isLaTeX(lines)?lines:lines.map(line=>window.AMparseMath(line,!0));default:return lines}}function isLaTeX(lines){let code=lines.join();return["^{","_{","\\left","\\right","\\begin"].some(s=>code.includes(s))?!0:/\\[a-zA-Z]+/.test(code)}function findtextindex(str,needle,without=[],strend=!1){let braceDepth=0;for(let i=0;istr.startsWith(token,i));if(isIncluded==null)continue;if(!without.some(token=>str.startsWith(token,i)))return strend?isIncluded.slice(isIncluded.length-1,isIncluded.length)=="{"?i+isIncluded.length-1:i+isIncluded.length:i}}return!1}function aligneq(lines,rule){switch(rule){case"asciimath_block":case"math_block":break;case"code_inline":case"math_inline":return lines;default:return lines}let skipenv=["align","flalign","alignat","xalignat","xxalignat","gather","multline","equation","split","subequations"].flatMap(token=>[`\\begin{${token}}`,`\\begin{${token}*}`]);var skip=!1;for(let str of lines)findtextindex(str,skipenv)!==!1&&(skip=!0);if(skip)return lines;let output=["\\begin{align*}"];for(let str of lines){str=str.replace(/^\s*(?:\\displaystyle\s*)?/,""),str=str.trim();let matchimp=["Rightarrow","Leftarrow","Leftrightarrow","therefore","because","checkmark","models","vdash"].flatMap(token=>[`\\${token}`,`\\${token}`,`\\${token}`]).find(token=>str.startsWith(token));var connector="";matchimp!==void 0&&(connector=str.slice(0,matchimp.length),str=str.slice(matchimp.length));let matchtxt=findtextindex(str,["\\text{"],["\\text{or}","\\text{and}","\\text{if}"]);matchtxt&&(str=str.slice(0,matchtxt)+" & & "+str.slice(matchtxt));let relst=["in","notin","subset","subseteq","supset","supseteq","leq","lt","le","geq","gt","ge","preq","preqeq","succ","succeq","ne","neq","approx","equiv","propto","cong"],relations=["=",">","<"].concat(relst.flatMap(token=>[`\\${token}{`,`\\${token} `])),matcheqed=findtextindex(str,relations,[],!0);matcheqed!==!1?str=str.slice(0,matcheqed)+" &\\, "+str.slice(matcheqed):str=" &\\, "+str,str=connector+" & & "+str.trim()+"\\\\",str=str.trim(),output.push(str)}return output.push("\\end{align*}"),output}function boldfilter(lines,rule){let rowBreak="\\\\";return lines.map((line,i)=>i===0||i===lines.length-1?line:splitTopLevelAmpersands(line).map(col=>{let trimmed=col.trim();if(trimmed==="")return col;let trailingBreak="";if(trimmed.endsWith(rowBreak)&&(trailingBreak=rowBreak,trimmed=trimmed.slice(0,-rowBreak.length).trim()),trimmed==="")return col;let displayPrefix="\\displaystyle",bold;if(trimmed.startsWith(displayPrefix)){let rest=trimmed.slice(displayPrefix.length).trim();bold=rest?`${displayPrefix}\\boldsymbol{${rest}}`:displayPrefix}else bold=`\\boldsymbol{${trimmed}}`;return bold+trailingBreak}).join("&"))}function splitTopLevelAmpersands(line){let cols=[],start=0,depth=0,envStack=[];for(let i=0;i0?line[i-1]:"";if(ch==="{"&&prev!=="\\"){depth++;continue}if(ch==="}"&&prev!=="\\"){depth=Math.max(0,depth-1);continue}ch==="&"&&prev!=="\\"&&depth===0&&envStack.length===0&&(cols.push(line.slice(start,i)),start=i+1)}return cols.push(line.slice(start)),cols}function minwrap(lines,rule){if(lines&&lines.length===0)return[""];switch(rule){case"asciimath_block":case"math_block":return wraplatex(lines);case"code_inline":case"math_inline":return[`\\(${lines[0]}\\)`];default:return lines}}function wraplatex(lines){let skipenv=["align","flalign","alignat","xalignat","xxalignat","gather","multline","equation","split","subequations"].flatMap(token=>[`\\begin{${token}}`,`\\begin{${token}*}`]);var skip=!1;for(let str of lines)findtextindex(str,skipenv)!==!1&&(skip=!0);return skip||(lines.push("\\]"),lines.unshift("\\[")),lines}var transformLib={asciimath,boldfilter,aligneq,minwrap},state={transforms:[],transformLib,collector:null},converter=(0,import_markdownit.default)({html:!0}).use(mdItPluginTex.tex,{render:content=>content,delimiters:"brackets"}).use(import_asciimathblock.default).use(markdownitrules,{state});function markdown(text,blockCollector,op){return state.transforms=(op.transforms||"").split(",").map(s=>s.trim()).filter(Boolean),state.collector=blockCollector||null,converter.render(text)}function cas2(text,blockCollector){return blockCollector&&(blockCollector.isHTML=!1,blockCollector.blocks=[]),text}var extractorStrings={};function setExtractorStrings(strings={}){extractorStrings={...strings}}function extractorResult(result){return{result}}function extractorError(key,detail=""){let message=extractorStrings[key]||key;return detail!==""&&(message=message+" "+String(detail)),{error:message}}function lastblock(raw,blocks){if(blocks&&blocks.length>0){for(let i=blocks.length-1;i>=0;i--){let block=blocks[i];if(block.type==="code_inline")return extractorResult(block.raw);if(block.type==="asciimath_block")return extractorResult(block.raw)}return extractorError("asciistringextractorlastblocknotfound")}let lines=raw.split(/\r?\n/);for(let i=lines.length-1;i>=0;i--)if(lines[i].trim()!=="")return extractorResult(lines[i]);return extractorError("asciistringextractorlastblocknotfound")}function lastcalc(raw,blocks){if(blocks){for(let i=blocks.length-1;i>=0;i--)if(blocks[i].type==="calculation")return extractorResult(blocks[i].rendered.trim())}return extractorError("asciistringextractorlastcalcnotfound")}function lastexpr(raw,blocks){if(blocks&&blocks.length>0)for(let i=blocks.length-1;i>=0;i--){let block=blocks[i];if(block.type==="code_inline")return extractorResult(block.raw.trim());if(block.type==="asciimath_block"){let lines2=block.raw.split(/\r?\n/);for(let j=lines2.length-1;j>=0;j--){let trimmed=lines2[j].trim();if(trimmed!=="")return extractorResult(trimmed)}}}let lines=raw.split(/\r?\n/);for(let i=lines.length-1;i>=0;i--){let trimmed=lines[i].trim();if(trimmed!=="")return extractorResult(trimmed)}return extractorError("asciistringextractorlastexprnotfound")}function laststringremainder(raw,blocks,operation){if(!operation||!operation.search)return extractorError("asciistringextractorsearchrequired");let lines=raw.split(` +`);lines.reverse();for(let line of lines){let trimmed=line.replace(/^[\s`]+|[\s`]+$/g,"");if(trimmed.includes(operation.search))return trimmed=trimmed.replace(operation.search,""),extractorResult(trimmed.replace(/^[\s`]+|[\s`]+$/g,""))}return extractorError("asciistringextractorsearchnotfound",operation.search)}function laststringremainderwhitespace(raw,blocks,operation){if(!operation||!operation.search)return extractorError("asciistringextractorsearchrequired");var match=escaperegex(operation.search);match="^"+match+"\\s*`?([^`]+)`?";let pattern=new RegExp(match),lines=raw.split(` +`);lines.reverse();for(let line of lines){var trimmed=line.trim();trimmed.endsWith(".")&&(trimmed=trimmed.slice(0,-1),trimmed=trimmed.trim()),trimmed.startsWith("`")&&trimmed.endsWith("`")&&(trimmed=trimmed.slice(1,-1),trimmed=trimmed.trim());let matched=trimmed.match(pattern);if(matched){let retmatch=matched[1];return extractorResult(retmatch.trim())}}return extractorError("asciistringextractorsearchnotfound",operation.search)}function escaperegex(str){return str.replace(/[.*+?^${}()|[\]\\]/g,"\\$&").replace(/\s+/g,"\\s*")}function lastregexmatch(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),lines=raw.split(` +`);lines.reverse();for(let line of lines){let trimmed=line.trim();if(pattern.test(trimmed))return extractorResult(trimmed)}return extractorError("asciistringextractorregexnotfound",operation.regex)}function lastregexremainder(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),lines=raw.split(` +`);lines.reverse();for(let line of lines){let trimmed=line.trim();if(pattern.test(trimmed))return extractorResult(trimmed.replace(pattern,""))}return extractorError("asciistringextractorregexnotfound",operation.regex)}function allregexmatch(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),matches=[];for(let line of raw.split(` +`)){let trimmed=line.trim();trimmed&&pattern.test(trimmed)&&matches.push(trimmed)}return matches.length===0?extractorError("asciistringextractorregexnotfound",operation.regex):extractorResult(JSON.stringify({matches}))}function allregexremainder(raw,blocks,operation){if(!operation||!operation.regex)return extractorError("asciistringextractorregexrequired");let pattern=new RegExp(operation.regex),matches=[];for(let line of raw.split(` +`)){let trimmed=line.trim();trimmed&&pattern.test(trimmed)&&matches.push(trimmed.replace(pattern,""))}return matches.length===0?extractorError("asciistringextractorregexnotfound",operation.regex):extractorResult(JSON.stringify({matches}))}var filterlib={calculation,cas,markdown,plain:cas2},extractorlib={lastblock,lastcalc,lastexpr,laststringremainder,laststringremainderwhitespace,lastregexmatch,lastregexremainder,allregexmatch,allregexremainder};function init(inputIds,operations,options={}){setExtractorStrings(options.asciistrings||{});let markdownContainerId=inputIds.length?inputIds[0]:null,suppliedText=document.getElementById("asciiSuppliedText").innerHTML,shell=document.getElementById("asciiShell"),output=document.getElementById("asciiContainerRow"),renderedOutput=document.getElementById("asciiRenderedContent"),errorOutput=document.getElementById("asciiErrorRow"),syncScrollPosition=createScrollSyncHandler(markdownContainerId,typeof FRAME_ID<"u"?FRAME_ID:null,output),alloperations=operations,blockCollector={blocks:[],isHTML:!1};function renderMath(){let raw="";markdownContainerId?raw=document.getElementById(markdownContainerId).value:raw=suppliedText;let processedOutput=raw,isHTML=!1,displayfixed=!1,answerIndex=1,extractorErrors=[];if(alloperations&&alloperations.forEach((currentop,i)=>{if(currentop.operation==="filter"){let filter=filterlib[currentop.type];if(filter){let filterInput=processedOutput;currentop.reset==="true"&&(filterInput=raw);let filterOutput=filter(filterInput,blockCollector,currentop);displayfixed||(processedOutput=filterOutput,isHTML=blockCollector.isHTML),currentop.display==="true"&&(displayfixed=!0)}}else if(currentop.operation==="extractor"){let extractor=extractorlib[currentop.type]?extractorlib[currentop.type]:extractorlib.lastexpr,answerEl=document.getElementById(inputIds[answerIndex]);if(answerIndex++,extractor&&answerEl){let value=extractor(raw,blockCollector.blocks,currentop),oldValue=answerEl.value;Object.hasOwn(value,"error")?(answerEl.value="",currentop.errors==="true"&&extractorErrors.push(value.error)):Object.hasOwn(value,"result")?answerEl.value=value.result:answerEl.value=value,answerEl.value!==oldValue&&answerEl.dispatchEvent(new Event("change"))}}}),isHTML||renderedOutput.classList.add("plaintext"),renderedOutput.innerHTML=processedOutput,extractorErrors.length>0){errorOutput.innerHTML=extractorErrors.map(message=>'

'+escapeHTML(message)+"

").join(""),shell.classList.add("stackascii-has-errors");let errorHeight=Number(errorOutput.offsetHeight)||0;renderedOutput.style.paddingBottom=`${errorHeight+5}px`}else shell.classList.remove("stackascii-has-errors"),renderedOutput.style.paddingBottom="";syncScrollPosition(),typeof MathJax.typesetPromise=="function"?MathJax.typesetPromise([output]).then(()=>{syncScrollPosition()}):MathJax.Hub&&typeof MathJax.Hub.Queue=="function"&&(MathJax.Hub.Queue(["Typeset",MathJax.Hub,"asciiContainerRow"]),MathJax.Hub.Queue(()=>{syncScrollPosition()}))}if(markdownContainerId){let debounceTimer;document.getElementById(markdownContainerId).addEventListener("change",()=>{clearTimeout(debounceTimer),debounceTimer=setTimeout(renderMath,100)})}renderMath()}function setScrollPosition(element,position){let maxScroll=element.scrollHeight-element.clientHeight,previousScrollBehavior=element.style.scrollBehavior;element.style.scrollBehavior="auto",element.scrollTop=maxScroll>0?position*maxScroll:0,element.style.scrollBehavior=previousScrollBehavior}function createScrollSyncHandler(markdownContainerId,frameId,output){if(!markdownContainerId||!frameId)return()=>{};let syncedScrollPosition=0,syncScrollPosition=()=>{setScrollPosition(output,syncedScrollPosition)};window.addEventListener("message",event=>{let message=JSON.parse(event.data);message.tgt!==frameId||message.type!=="input-scroll-position"||message.name!==markdownContainerId||(syncedScrollPosition=message.position,syncScrollPosition())});let registration={version:"STACK-JS:1.6.0",type:"track-input-scroll",name:markdownContainerId,"limit-to-question":!0,src:frameId};return window.parent.postMessage(JSON.stringify(registration),"*"),syncScrollPosition}function escapeHTML(value){return String(value).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}export{init as default}; /*! For license information please see math.js.LICENSE.txt Licensed under Apache License 2.0 */ /*! markdown-it 14.1.1 https://github.com/markdown-it/markdown-it @license MIT */ /** diff --git a/corsscripts/ascii/stackascii.bundle.js.map b/corsscripts/ascii/stackascii.bundle.js.map index b6bdbe96e3a..e493617a18c 100644 --- a/corsscripts/ascii/stackascii.bundle.js.map +++ b/corsscripts/ascii/stackascii.bundle.js.map @@ -1,8 +1,8 @@ { "version": 3, - "sources": ["mathjs.min.js", "markdownit.js", "markdownitextensions/asciimathblock.js", "markdownitextensions/tex.js", "filters/calculation.js", "filters/cas.js", "filters/markdown.js", "filters/markdownitrules.js", "markdownittransforms/100_asciimath.js", "markdownittransforms/findtextindex.js", "markdownittransforms/200_aligneq.js", "markdownittransforms/250_boldfilter.js", "markdownittransforms/900_minwrap.js", "filters/plain.js", "extractors/extractorresult.js", "extractors/lastblock.js", "extractors/lastcalc.js", "extractors/lastexpr.js", "extractors/laststringremainder.js", "extractors/laststringremainderwhitespace.js", "extractors/lastregexmatch.js", "extractors/lastregexremainder.js", "extractors/allregexmatch.js", "extractors/allregexremainder.js", "stackascii.js"], + "sources": ["mathjs.min.js", "markdownit.js", "markdownitextensions/asciimathblock.js", "markdownitextensions/tex.js", "filters/calculation.js", "filters/cas.js", "filters/markdown.js", "filters/markdownitrules.js", "markdownittransforms/100_asciimath.js", "markdownittransforms/findtextindex.js", "markdownittransforms/200_aligneq.js", "markdownittransforms/250_boldfilter.js", "markdownittransforms/900_minwrap.js", "filters/plain.js", "extractors/extractorhelper.js", "extractors/lastblock.js", "extractors/lastcalc.js", "extractors/lastexpr.js", "extractors/laststringremainder.js", "extractors/laststringremainderwhitespace.js", "extractors/lastregexmatch.js", "extractors/lastregexremainder.js", "extractors/allregexmatch.js", "extractors/allregexremainder.js", "stackascii.js"], "sourceRoot": "cors.php?name=ascii/", - "sourcesContent": ["/*! For license information please see math.js.LICENSE.txt Licensed under Apache License 2.0 */\n!function(e,t){\"object\"==typeof exports&&\"object\"==typeof module?module.exports=t():\"function\"==typeof define&&define.amd?define([],t):\"object\"==typeof exports?exports.math=t():e.math=t()}(this,()=>{var r={31:function(e,r,n){var o;!function(e){function i(e){var t=this,r=\"\";t.next=function(){var e=t.x^t.x>>>2;return t.x=t.y,t.y=t.z,t.z=t.w,t.w=t.v,(t.d=t.d+362437|0)+(t.v=t.v^t.v<<4^e^e<<1)|0},t.x=0,t.y=0,t.z=0,t.w=0,e===((t.v=0)|e)?t.x=e:r+=e;for(var n=0;n>>4),t.next()}function a(e,t){return t.x=e.x,t.y=e.y,t.z=e.z,t.w=e.w,t.v=e.v,t.d=e.d,t}function t(e,t){function r(){return(n.next()>>>0)/4294967296}var n=new i(e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(\"object\"==typeof e&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.xorwow=t}(e=n.nmd(e),n.amdD)},67:function(e,r,n){var o;!function(e){function i(e){var t,i=this,r=(i.next=function(){var e=i.x,t=i.i,r=e[t],n=(r^=r>>>7)^r<<24;return n=(n=(n^=(r=e[t+1&7])^r>>>10)^((r=e[t+3&7])^r>>>3))^((r=e[t+4&7])^r<<7),r=e[t+7&7],n^=(r^=r<<13)^r<<9,e[t]=n,i.i=t+1&7,n},i),n=e,a=[];if(n===(0|n))a[0]=n;else for(n=\"\"+n,t=0;t>>0)/4294967296}var n=new i(e=null==e?+new Date:e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(e.x&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.xorshift7=t}(e=n.nmd(e),n.amdD)},144:e=>{\"use strict\";function s(e,t){return u({},e,t)}var u=Object.assign||function(e){for(var t=1;t=e.length&&n.slice(0,e.length)===e&&(i+=a[o[t]],n=n.slice(e.length,n.length),r=!0)}),r||(i+=n.slice(0,1),n=n.slice(1,n.length))}();return i}},180:function(e,r,n){var o;!function(e){function i(e){var n,t=this,r=(n=4022871197,function(e){e=String(e);for(var t=0;t>>0)*n)>>>0,n+=4294967296*(r-=n)}return 2.3283064365386963e-10*(n>>>0)});t.next=function(){var e=2091639*t.s0+2.3283064365386963e-10*t.c;return t.s0=t.s1,t.s1=t.s2,t.s2=e-(t.c=0|e)},t.c=1,t.s0=r(\" \"),t.s1=r(\" \"),t.s2=r(\" \"),t.s0-=r(e),t.s0<0&&(t.s0+=1),t.s1-=r(e),t.s1<0&&(t.s1+=1),t.s2-=r(e),t.s2<0&&(t.s2+=1)}function a(e,t){return t.c=e.c,t.s0=e.s0,t.s1=e.s1,t.s2=e.s2,t}function t(e,t){var r=new i(e),e=t&&t.state,n=r.next;return n.int32=function(){return 4294967296*r.next()|0},n.double=function(){return n()+11102230246251565e-32*(2097152*n()|0)},n.quick=n,e&&(\"object\"==typeof e&&a(e,r),n.state=function(){return a(r,{})}),n}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.alea=t}(e=n.nmd(e),n.amdD)},181:function(e,r,n){var o;!function(e){function i(e){var t=this,r=\"\";t.x=0,t.y=0,t.z=0,t.w=0,t.next=function(){var e=t.x^t.x<<11;return t.x=t.y,t.y=t.z,t.z=t.w,t.w^=t.w>>>19^e^e>>>8},e===(0|e)?t.x=e:r+=e;for(var n=0;n>>0)/4294967296}var n=new i(e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(\"object\"==typeof e&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.xor128=t}(e=n.nmd(e),n.amdD)},234:()=>{},369:function(e){e.exports=function(){\"use strict\";function T(){return!0}function ce(){return!1}function fe(){}const B=\"Argument is not a typed-function.\";return function e(){function c(e){return\"object\"==typeof e&&null!==e&&e.constructor===Object}const t=[{name:\"number\",test:function(e){return\"number\"==typeof e}},{name:\"string\",test:function(e){return\"string\"==typeof e}},{name:\"boolean\",test:function(e){return\"boolean\"==typeof e}},{name:\"Function\",test:function(e){return\"function\"==typeof e}},{name:\"Array\",test:Array.isArray},{name:\"Date\",test:function(e){return e instanceof Date}},{name:\"RegExp\",test:function(e){return e instanceof RegExp}},{name:\"Object\",test:c},{name:\"null\",test:function(e){return null===e}},{name:\"undefined\",test:function(e){return void 0===e}}],r={name:\"any\",test:T,isAny:!0};let a,o,i=0,J={createCount:0};function s(e){var t=a.get(e);if(t)return t;let r='Unknown type \"'+e+'\"';var n=e.toLowerCase();let i;for(i of o)if(i.toLowerCase()===n){r+='. Did you mean \"'+i+'\" ?';break}throw new TypeError(r)}function n(t){var e=1{const t=a.get(e);return!t.isAny&&t.test(r)});return e.length?e:[\"any\"]}function f(e){return e&&\"function\"==typeof e&&\"_typedFunctionData\"in e}function p(r,n,i){if(!f(r))throw new TypeError(B);const a=i&&i.exact,o=Q(Array.isArray(n)?n.join(\",\"):n),e=X(o);if(!a||e in r.signatures){const n=r._typedFunctionData.signatureMap.get(e);if(n)return n}var s=o.length;let u,t;if(a){let e;for(e in u=[],r.signatures)u.push(r._typedFunctionData.signatureMap.get(e))}else u=r._typedFunctionData.signatures;for(let t=0;t!r.has(e.name)))continue}i.push(e)}}if(0===(u=i).length)break}for(t of u)if(t.params.length<=s)return t;throw new TypeError(\"Signature not found (signature: \"+(r.name||\"unnamed\")+\"(\"+X(o,\", \")+\"))\")}function X(e,t){t=1e.name).join(t)}function oe(e){const t=function(e){if(0===e.length)return[];const r=e.map(s);1e.index-t.index);let n=r[0].conversionsTo;if(1===e.length)return n;n=n.concat([]);const i=new Set(e);for(let t=1;te.name));let r=e.hasAny,n=e.name;var i=t.map(function(e){var t=s(e.from);return r=t.isAny||r,n+=\"|\"+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}});return{types:e.types.concat(i),name:n,hasAny:r,hasConversion:0t.typeSet.add(e.name))),t.typeSet}function Q(e){const t=[];if(\"string\"!=typeof e)throw new TypeError(\"Signatures must be strings\");const r=e.trim();if(\"\"===r)return t;const n=r.split(\",\");for(let e=0;es(e.trim()));let n=!1,i=t?\"...\":\"\";return{types:r.map(function(e){return n=e.isAny||n,i+=e.name+\"|\",{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}}),name:i.slice(0,-1),hasAny:n,hasConversion:!1,restParam:t}}(n[e].trim());if(r.restParam&&e!==n.length-1)throw new SyntaxError('Unexpected rest parameter \"'+n[e]+'\": only allowed for the last parameter');if(0===r.types.length)return null;t.push(r)}return t}function K(e){e=ie(e);return!!e&&e.restParam}function ee(e){if(e&&0!==e.types.length){if(1===e.types.length)return s(e.types[0].name).test;if(2===e.types.length){const T=s(e.types[0].name).test,t=s(e.types[1].name).test;return function(e){return T(e)||t(e)}}{const T=e.types.map(function(e){return s(e.name).test});return function(t){for(let e=0;e{let t;for(t of te(e.params,r))n.add(t)}),n.has(\"any\")?[\"any\"]:Array.from(n)}function g(r,n,e){let t,i;var a=r||\"unnamed\";let o,s=e;for(o=0;o{const t=ee(h(e.params,o));(oe)return(t=new TypeError(\"Too many arguments in function \"+a+\" (expected: \"+e+\", actual: \"+n.length+\")\")).data={category:\"tooManyArgs\",fn:a,index:n.length,expectedLength:e},t;const u=[];for(let e=0;eA(e)?w(e.referToSelf.callback):N(e)?v(e.referTo.references,e.referTo.callback):e),a=new Array(i.length).fill(!1);let o=!0;for(;o;){let t=!(o=!1);for(let e=0;e{const t=n[e];if(q.test(t.toString()))throw new SyntaxError(\"Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.\")})}const i=[],a=[],o={},s=[];let u;for(u in r)if(Object.prototype.hasOwnProperty.call(r,u)){const t=Q(u);if(t){i.forEach(function(e){if(function(n,i){const a=Math.max(n.length,i.length);for(let r=0;r=e:r?e>=o:e===o}(e,t))throw new TypeError('Conflicting signatures \"'+X(e)+'\" and \"'+X(t)+'\".')}),i.push(t);const ce=a.length,fe=(a.push(r[u]),t.map(oe));let e;for(e of function t(r,n,i){if(ne.name).join(\"|\"),hasAny:t.some(e=>e.isAny),hasConversion:!1,restParam:!0}),e.push(o)}else e=o.types.map(function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}});return a=e,Array.prototype.concat.apply([],a.map(function(e){return t(r,n+1,i.concat([e]))}))}var a;return[i]}(fe,0,[])){const t=X(e);s.push({params:e,name:t,fn:ce}),e.every(e=>!e.hasConversion)&&(o[t]=ce)}}}s.sort(se);var e=le(a,o,z);let l;for(l in o)Object.prototype.hasOwnProperty.call(o,l)&&(o[l]=e[o[l]]);const c=[],f=new Map;for(l of s)f.has(l.name)||(l.fn=e[l.fn],c.push(l),f.set(l.name,l));var p=c[0]&&c[0].params.length<=2&&!K(c[0].params),m=c[1]&&c[1].params.length<=2&&!K(c[1].params),h=c[2]&&c[2].params.length<=2&&!K(c[2].params),d=c[3]&&c[3].params.length<=2&&!K(c[3].params),g=c[4]&&c[4].params.length<=2&&!K(c[4].params),y=c[5]&&c[5].params.length<=2&&!K(c[5].params),x=p&&m&&h&&d&&g&&y;for(let e=0;e=n+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(n=ee(e[0]),function(e){return n(e[0])&&1===e.length}):2===e.length?(n=ee(e[0]),i=ee(e[1]),function(e){return n(e[0])&&i(e[1])&&2===e.length}):(r=e.map(ee),function(t){for(let e=0;ee.hasConversion)){const i=K(e),a=e.map(ue);t=function(){const t=[],r=i?arguments.length-1:arguments.length;for(let e=0;ee.test),W=c.map(e=>e.implementation),Y=function(){for(let e=G;eX(Q(e))),t=ie(arguments);if(\"function\"!=typeof t)throw new TypeError(\"Callback function expected as last argument\");return v(e,t)},J.referToSelf=w,J.convert=function(t,e){const r=s(e);if(r.test(t))return t;const n=r.conversionsTo;if(0===n.length)throw new Error(\"There are no conversions to \"+e+\" defined.\");for(let e=0;ee.from===t.from);if(n){if(!e||!e.override)throw new Error('There is already a conversion from \"'+t.from+'\" to \"'+r.name+'\"');J.removeConversion({from:n.from,to:t.to,convert:n.convert})}r.conversionsTo.push({from:t.from,convert:t.convert,index:i++})},J.addConversions=function(e,t){e.forEach(e=>J.addConversion(e,t))},J.removeConversion=function(r){S(r);const e=s(r.to),t=function(t){for(let e=0;e{var n=r(180),i=r(181),a=r(31),o=r(67),s=r(833),u=r(717),r=r(801);r.alea=n,r.xor128=i,r.xorwow=a,r.xorshift7=o,r.xor4096=s,r.tychei=u,e.exports=r},504:e=>{function t(){}t.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n>>7^(t=i.c),t=t-(r=i.d)|0,r=r<<24^r>>>8^(n=i.a),n=n-e|0;return i.b=e=e<<20^e>>>12^t,i.c=t=t-r|0,i.d=r<<16^t>>>16^n,i.a=n-e|0},i.a=0,i.b=0,i.c=-1640531527,i.d=1367130551,e===Math.floor(e)?(i.a=e/4294967296|0,i.b=0|e):t+=e;for(var r=0;r>>0)/4294967296}var n=new i(e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(\"object\"==typeof e&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.tychei=t}(e=n.nmd(e),n.amdD)},801:function(e,t,r){var o,s=\"undefined\"!=typeof self?self:this,u=[],l=Math,c=256,f=l.pow(c,6),p=l.pow(2,52),m=2*p,h=255;function n(e,t,r){function n(){for(var e=a.g(6),t=f,r=0;e>>=1;return(e+r)/t}var i=[],e=y(function e(t,r){var n,i=[],a=typeof t;if(r&&\"object\"==a)for(n in t)try{i.push(e(t[n],r-1))}catch(t){}return i.length?i:\"string\"==a?t:t+\"\\0\"}((t=1==t?{entropy:!0}:t||{}).entropy?[e,x(u)]:null==e?function(){try{var e;return o&&(e=o.randomBytes)?e=e(c):(e=new Uint8Array(c),(s.crypto||s.msCrypto).getRandomValues(e)),x(e)}catch(e){var t=s.navigator,t=t&&t.plugins;return[+new Date,s,t,s.screen,x(u)]}}():e,3),i),a=new d(i);return n.int32=function(){return 0|a.g(4)},n.quick=function(){return a.g(4)/4294967296},n.double=n,y(x(a.S),u),(t.pass||r||function(e,t,r,n){return n&&(n.S&&g(n,a),e.state=function(){return g(a,{})}),r?(l.random=e,t):e})(n,e,\"global\"in t?t.global:this==l,t.state)}function d(e){var t,r=e.length,o=this,n=0,i=o.i=o.j=0,a=o.S=[];for(r||(e=[r++]);n>>15^((e^=e<<17)^e>>>12),o.i=i,t+(r^r>>>16)|0},o),u=e,l=[],c=128;for(u===(0|u)?(r=u,u=null):(u+=\"\\0\",r=0,c=Math.max(c,u.length)),n=0,i=-32;i>>15)^r<<4)^r>>>13,0<=i&&(n=0==(t=l[127&i]^=r+(a=a+1640531527|0))?n+1:0);for(128<=n&&(l[127&(u&&u.length||0)]=-1),n=127,i=512;0>>15)^(t=(t^=t<<17)^t>>>12);s.w=a,s.X=l,s.i=n}function a(e,t){return t.i=e.i,t.w=e.w,t.X=e.X.slice(),t}function t(e,t){function r(){return(n.next()>>>0)/4294967296}var n=new i(e=null==e?+new Date:e),e=t&&t.state;return r.double=function(){do{var e=((n.next()>>>11)+(n.next()>>>0)/4294967296)/(1<<21)}while(0===e);return e},r.int32=n.next,r.quick=r,e&&(e.X&&a(e,n),r.state=function(){return a(n,{})}),r}e&&e.exports?e.exports=t:n.amdD&&n.amdO?void 0!==(o=function(){return t}.call(r,n,r,e))&&(e.exports=o):this.xor4096=t}(e=n.nmd(e),n.amdD)},880:e=>{e.exports=function t(e,r){\"use strict\";function n(e){return t.insensitive&&(\"\"+e).toLowerCase()||\"\"+e}var i,a,o=/(^([+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?)?$|^0x[0-9a-f]+$|\\d+)/gi,s=/(^[ ]*|[ ]*$)/g,u=/(^([\\w ]+,?[\\w ]+)?[\\w ]+,?[\\w ]+\\d+:\\d+(:\\d+)?[\\w ]?|^\\d{1,4}[\\/\\-]\\d{1,4}[\\/\\-]\\d{1,4}|^\\w+, \\w+ \\d+, \\d{4})/,l=/^0x[0-9a-f]+$/i,c=/^0/,e=n(e).replace(s,\"\")||\"\",r=n(r).replace(s,\"\")||\"\",f=e.replace(o,\"\\0$1\\0\").replace(/\\0$/,\"\").replace(/^\\0/,\"\").split(\"\\0\"),p=r.replace(o,\"\\0$1\\0\").replace(/\\0$/,\"\").replace(/^\\0/,\"\").split(\"\\0\"),s=parseInt(e.match(l),16)||1!==f.length&&e.match(u)&&Date.parse(e),o=parseInt(r.match(l),16)||s&&r.match(u)&&Date.parse(r)||null;if(o){if(s{for(var r in t)fd.o(t,r)&&!fd.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},fd.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),fd.r=e=>{\"undefined\"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:\"Module\"}),Object.defineProperty(e,\"__esModule\",{value:!0})},fd.nmd=e=>(e.paths=[],e.children||(e.children=[]),e);var pd={};return(()=>{\"use strict\";fd.d(pd,{default:()=>cd});var t={},l=(fd.r(t),fd.d(t,{createAbs:()=>ha,createAccessorNode:()=>cf,createAcos:()=>jl,createAcosh:()=>ac,createAcot:()=>oc,createAcoth:()=>sc,createAcsc:()=>uc,createAcsch:()=>lc,createAdd:()=>Jc,createAddScalar:()=>ba,createAnd:()=>Lu,createAndTransform:()=>Kh,createArg:()=>Po,createArrayNode:()=>pf,createAsec:()=>cc,createAsech:()=>fc,createAsin:()=>pc,createAsinh:()=>mc,createAssignmentNode:()=>xf,createAtan:()=>hc,createAtan2:()=>dc,createAtanh:()=>gc,createAtomicMass:()=>ah,createAvogadro:()=>oh,createBellNumbers:()=>qm,createBigNumberClass:()=>Zr,createBigint:()=>Mi,createBignumber:()=>Fi,createBin:()=>nu,createBitAnd:()=>zo,createBitAndTransform:()=>rd,createBitNot:()=>qo,createBitOr:()=>Io,createBitOrTransform:()=>nd,createBitXor:()=>Ro,createBlockNode:()=>vf,createBohrMagneton:()=>P0,createBohrRadius:()=>G0,createBoltzmann:()=>sh,createBoolean:()=>Bi,createCatalan:()=>km,createCbrt:()=>Na,createCeil:()=>Ta,createChain:()=>Ep,createChainClass:()=>bp,createClassicalElectronRadius:()=>V0,createClone:()=>Qn,createColumn:()=>es,createColumnTransform:()=>Th,createCombinations:()=>tm,createCombinationsWithRep:()=>im,createCompare:()=>Hu,createCompareNatural:()=>Wu,createCompareText:()=>Ju,createCompile:()=>Xf,createComplex:()=>Di,createComplexClass:()=>en,createComposition:()=>Pm,createConcat:()=>Ko,createConcatTransform:()=>Hh,createConditionalNode:()=>Nf,createConductanceQuantum:()=>U0,createConj:()=>Uo,createConstantNode:()=>Ff,createCorr:()=>Xp,createCos:()=>xc,createCosh:()=>bc,createCot:()=>vc,createCoth:()=>wc,createCoulomb:()=>I0,createCoulombConstant:()=>k0,createCount:()=>ts,createCreateUnit:()=>Ul,createCross:()=>rs,createCsc:()=>Nc,createCsch:()=>Ac,createCtranspose:()=>js,createCube:()=>Ba,createCumSum:()=>jp,createCumSumTransform:()=>Yh,createDeepEqual:()=>dl,createDenseMatrixClass:()=>Xn,createDerivative:()=>Km,createDet:()=>Sp,createDeuteronMass:()=>Q0,createDiag:()=>ns,createDiff:()=>ys,createDiffTransform:()=>Gh,createDistance:()=>kp,createDivide:()=>qp,createDivideScalar:()=>du,createDot:()=>Kc,createDotDivide:()=>Mu,createDotMultiply:()=>yo,createDotPow:()=>Eu,createE:()=>g0,createEfimovFactor:()=>ih,createEigs:()=>Tp,createElectricConstant:()=>z0,createElectronMass:()=>Z0,createElementaryCharge:()=>R0,createEqual:()=>Qu,createEqualScalar:()=>Ai,createEqualText:()=>tl,createErf:()=>Vs,createEvaluate:()=>Kf,createExp:()=>Fa,createExpm:()=>Bp,createExpm1:()=>Da,createFactorial:()=>dm,createFalse:()=>c0,createFaraday:()=>uh,createFermiCoupling:()=>W0,createFft:()=>$s,createFibonacciHeapClass:()=>Cl,createFilter:()=>is,createFilterTransform:()=>_h,createFineStructure:()=>Y0,createFirstRadiation:()=>lh,createFix:()=>_a,createFlatten:()=>ss,createFloor:()=>ka,createForEach:()=>ls,createForEachTransform:()=>zh,createFormat:()=>ru,createFraction:()=>Oi,createFractionClass:()=>mn,createFreqz:()=>n0,createFunctionAssignmentNode:()=>Of,createFunctionNode:()=>Wf,createGamma:()=>pm,createGasConstant:()=>fh,createGcd:()=>Ya,createGetMatrixDataType:()=>ps,createGravitationConstant:()=>F0,createGravity:()=>vh,createHartreeEnergy:()=>J0,createHasNumericValue:()=>di,createHelp:()=>Ap,createHelpClass:()=>xp,createHex:()=>au,createHypot:()=>Xc,createI:()=>E0,createIdentity:()=>hs,createIfft:()=>Hs,createIm:()=>jo,createImmutableDenseMatrixClass:()=>El,createIndex:()=>tf,createIndexClass:()=>Sl,createIndexNode:()=>zf,createIndexTransform:()=>qh,createInfinity:()=>p0,createIntersect:()=>Rp,createInv:()=>Mp,createInverseConductanceQuantum:()=>j0,createInvmod:()=>mo,createIsInteger:()=>oi,createIsNaN:()=>bi,createIsNegative:()=>fi,createIsNumeric:()=>mi,createIsPositive:()=>yi,createIsPrime:()=>pu,createIsZero:()=>xi,createKldivergence:()=>ym,createKlitzing:()=>H0,createKron:()=>ds,createLN10:()=>b0,createLN2:()=>x0,createLOG10E:()=>w0,createLOG2E:()=>v0,createLarger:()=>ll,createLargerEq:()=>pl,createLcm:()=>Xa,createLeafCount:()=>jm,createLeftShift:()=>ku,createLgamma:()=>mm,createLog:()=>vu,createLog10:()=>eo,createLog1p:()=>wu,createLog2:()=>to,createLoschmidt:()=>ch,createLsolve:()=>Tu,createLsolveAll:()=>Du,createLup:()=>rp,createLusolve:()=>dp,createLyap:()=>zp,createMad:()=>Hp,createMagneticConstant:()=>_0,createMagneticFluxQuantum:()=>L0,createMap:()=>gs,createMapSlices:()=>ga,createMapSlicesTransform:()=>Ch,createMapTransform:()=>Ih,createMatrix:()=>_i,createMatrixClass:()=>dn,createMatrixFromColumns:()=>Pi,createMatrixFromFunction:()=>qi,createMatrixFromRows:()=>ki,createMax:()=>Nl,createMaxTransform:()=>Rh,createMean:()=>Lp,createMeanTransform:()=>Ph,createMedian:()=>$p,createMin:()=>Al,createMinTransform:()=>Uh,createMod:()=>$a,createMode:()=>Ks,createMolarMass:()=>xh,createMolarMassC12:()=>bh,createMolarPlanckConstant:()=>ph,createMolarVolume:()=>mh,createMultinomial:()=>bm,createMultiply:()=>io,createMultiplyScalar:()=>ro,createNaN:()=>m0,createNeutronMass:()=>K0,createNode:()=>nf,createNorm:()=>Qc,createNot:()=>Wo,createNthRoot:()=>oo,createNthRoots:()=>Au,createNuclearMagneton:()=>$0,createNull:()=>f0,createNullish:()=>Jo,createNullishTransform:()=>td,createNumber:()=>Si,createNumeric:()=>mu,createObjectNode:()=>If,createOct:()=>iu,createOnes:()=>xs,createOperatorNode:()=>Pf,createOr:()=>Xo,createOrTransform:()=>ed,createParenthesisNode:()=>jf,createParse:()=>Yf,createParser:()=>tp,createParserClass:()=>ep,createPartitionSelect:()=>vl,createPermutations:()=>wm,createPhi:()=>y0,createPi:()=>h0,createPickRandom:()=>Cm,createPinv:()=>Cp,createPlanckCharge:()=>Eh,createPlanckConstant:()=>D0,createPlanckLength:()=>wh,createPlanckMass:()=>Nh,createPlanckTemperature:()=>Sh,createPlanckTime:()=>Ah,createPolynomialRoot:()=>yp,createPow:()=>gu,createPrint:()=>su,createPrintTransform:()=>Qh,createProd:()=>tu,createProtonMass:()=>X0,createQr:()=>np,createQuantileSeq:()=>Yp,createQuantileSeqTransform:()=>Wh,createQuantumOfCirculation:()=>eh,createRandom:()=>Bm,createRandomInt:()=>Dm,createRange:()=>Ns,createRangeClass:()=>hn,createRangeNode:()=>$f,createRangeTransform:()=>jh,createRationalize:()=>t0,createRe:()=>Lo,createReducedPlanckConstant:()=>O0,createRelationalNode:()=>Gf,createReplacer:()=>a0,createReshape:()=>Es,createResize:()=>Ss,createResolve:()=>Ym,createResultSet:()=>ft,createReviver:()=>i0,createRightArithShift:()=>Pu,createRightLogShift:()=>ju,createRotate:()=>Ms,createRotationMatrix:()=>Ts,createRound:()=>xu,createRow:()=>Bs,createRowTransform:()=>Lh,createRydberg:()=>th,createSQRT1_2:()=>N0,createSQRT2:()=>A0,createSackurTetrode:()=>hh,createSchur:()=>_p,createSec:()=>Ec,createSech:()=>Sc,createSecondRadiation:()=>dh,createSetCartesian:()=>Dc,createSetDifference:()=>_c,createSetDistinct:()=>qc,createSetIntersect:()=>kc,createSetIsSubset:()=>Pc,createSetMultiplicity:()=>jc,createSetPowerset:()=>$c,createSetSize:()=>Gc,createSetSymDifference:()=>Zc,createSetUnion:()=>Yc,createSign:()=>so,createSimplify:()=>Gm,createSimplifyConstant:()=>Vm,createSimplifyCore:()=>Wm,createSin:()=>Mc,createSinh:()=>Cc,createSize:()=>Fs,createSlu:()=>pp,createSmaller:()=>nl,createSmallerEq:()=>ol,createSolveODE:()=>Gs,createSort:()=>wl,createSpaClass:()=>Tl,createSparse:()=>Rl,createSparseMatrixClass:()=>Ei,createSpeedOfLight:()=>B0,createSplitUnit:()=>ji,createSqrt:()=>uo,createSqrtm:()=>Fp,createSquare:()=>lo,createSqueeze:()=>Os,createStd:()=>Jp,createStdTransform:()=>Vh,createStefanBoltzmann:()=>gh,createStirlingS2:()=>_m,createString:()=>Ci,createSubset:()=>_s,createSubsetTransform:()=>$h,createSubtract:()=>fo,createSubtractScalar:()=>wa,createSum:()=>Pp,createSumTransform:()=>Zh,createSylvester:()=>Op,createSymbolNode:()=>Vf,createSymbolicEqual:()=>Xm,createTan:()=>Tc,createTanh:()=>Bc,createTau:()=>d0,createThomsonCrossSection:()=>rh,createTo:()=>lu,createToBest:()=>cu,createTrace:()=>ef,createTranspose:()=>Ps,createTrue:()=>l0,createTypeOf:()=>vi,createTyped:()=>st,createUnaryMinus:()=>fa,createUnaryPlus:()=>ma,createUnequal:()=>yl,createUnitClass:()=>Il,createUnitFunction:()=>kl,createUppercaseE:()=>M0,createUppercasePi:()=>S0,createUsolve:()=>Bu,createUsolveAll:()=>_u,createVacuumImpedance:()=>q0,createVariance:()=>Zp,createVarianceTransform:()=>Xh,createVersion:()=>C0,createWeakMixingAngle:()=>nh,createWienDisplacement:()=>yh,createXgcd:()=>po,createXor:()=>Qo,createZeros:()=>Ls,createZeta:()=>Qs,createZpk2tf:()=>r0}),fd(369));function h(e,t){if(n(e,t))return e[t];if(\"function\"==typeof e[t]&&q(e,t))throw new Error('Cannot access method \"'+t+'\" as a property');throw new Error('No access to property \"'+t+'\"')}function D(e,t,r){if(n(e,t))return e[t]=r;throw new Error('No access to property \"'+t+'\"')}function n(e,t){return!((\"object\"!=typeof e||!e||e.constructor!==Object)&&!Array.isArray(e)||!ue(r,t)&&(t in Object.prototype||t in Function.prototype))}function q(e,t){return!(null==e||\"function\"!=typeof e[t]||ue(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)||!ue(i,t)&&(t in Object.prototype||t in Function.prototype))}const r={length:!0,name:!0},i={toString:!0,valueOf:!0,toLocaleString:!0};class I{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return h(this.wrappedObject,e)}set(e,t){return D(this.wrappedObject,e,t),this}has(e){return n(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return a(this.keys(),e=>[e,this.get(e)])}forEach(e){for(const t of this.keys())e(this.get(t),t,this)}delete(e){n(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(const e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}class k{constructor(e,t,r){this.a=e,this.b=t,this.bKeys=r,this[Symbol.iterator]=this.entries}get(e){return(this.bKeys.has(e)?this.b:this.a).get(e)}set(e,t){return(this.bKeys.has(e)?this.b:this.a).set(e,t),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return a(this.keys(),e=>[e,this.get(e)])}forEach(e){for(const t of this.keys())e(this.get(t),t,this)}delete(e){return(this.bKeys.has(e)?this.b:this.a).delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function a(t,r){return{next:()=>{var e=t.next();return e.done?e:{value:r(e.value),done:!1}}}}function P(){return new Map}function U(e){if(!e)return P();if(fe(e))return e;if(ce(e))return new I(e);throw new Error(\"createMap can create maps from objects or Maps\")}function A(e){return\"number\"==typeof e}function Q(e){return!(!e||\"object\"!=typeof e||\"function\"!=typeof e.constructor)&&(!0===e.isBigNumber&&\"object\"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||\"function\"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function R(e){return\"bigint\"==typeof e}function te(e){return e&&\"object\"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function re(e){return e&&\"object\"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function L(e){return e&&!0===e.constructor.prototype.isUnit||!1}function j(e){return\"string\"==typeof e}const b=Array.isArray;function _(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function $(e){return Array.isArray(e)||_(e)}function H(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function G(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function V(e){return e&&!0===e.constructor.prototype.isRange||!1}function Z(e){return e&&!0===e.constructor.prototype.isIndex||!1}function W(e){return\"boolean\"==typeof e}function Y(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function J(e){return e&&!0===e.constructor.prototype.isHelp||!1}function X(e){return\"function\"==typeof e}function ne(e){return e instanceof Date}function ie(e){return e instanceof RegExp}function ce(e){return!(!e||\"object\"!=typeof e||e.constructor!==Object||te(e)||re(e))}function fe(e){return!!e&&(e instanceof Map||e instanceof I||\"function\"==typeof e.set&&\"function\"==typeof e.get&&\"function\"==typeof e.keys&&\"function\"==typeof e.has)}function pe(e){return fe(e)&&fe(e.a)&&fe(e.b)}function me(e){return fe(e)&&ce(e.wrappedObject)}function he(e){return null===e}function de(e){return void 0===e}function ge(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function ye(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function xe(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function be(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function ve(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function ae(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function we(e){return ae(e)||oe(e)&&1===e.args.length&&ae(e.args[0])&&\"-+~\".includes(e.op)}function Ne(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function Ae(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function Ee(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function O(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function Se(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function oe(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function Me(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function Ce(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function Te(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function se(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function Be(e){return e&&!0===e.constructor.prototype.isChain||!1}function K(e){var t=typeof e;return\"object\"==t?null===e?\"null\":Q(e)?\"BigNumber\":e.constructor&&e.constructor.name?e.constructor.name:\"Object\":t}function ee(e){var t=typeof e;if(\"number\"==t||\"bigint\"==t||\"string\"==t||\"boolean\"==t||null==e)return e;if(\"function\"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map(ee);if(e instanceof Date)return new Date(e.valueOf());if(Q(e))return e;if(ce(e)){var r=e,n=ee;const i={};for(const a in r)ue(r,a)&&(i[a]=n(r[a]));return i}if(\"function\"==t)return e;throw new TypeError(`Cannot clone: unknown type of value (value: ${e})`)}function Fe(e,t){for(const r in t)ue(t,r)&&(e[r]=t[r]);return e}function De(e,t){let r,n,i;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(n=0,i=e.length;n!(e&&\"?\"===e[0])).every(e=>void 0!==i[e]))return u(t);{const a=n.filter(e=>void 0===i[e]);throw new Error(`Cannot create function \"${r}\", some dependencies are missing: ${a.map(e=>`\"${e}\"`).join(\", \")}.`)}}return t.isFactory=!0,t.fn=o,t.dependencies=s.slice().sort(),e&&(t.meta=e),t}function ze(e){return\"function\"==typeof e&&\"string\"==typeof e.fn&&Array.isArray(e.dependencies)}function qe(e){return e&&\"?\"===e[0]?e.slice(1):e}function v(e){return\"boolean\"==typeof e||!!isFinite(e)&&e===Math.round(e)}function Ie(e,t){if(\"bigint\"===t.number)try{BigInt(e)}catch(e){return t.numberFallback}return t.number}const ke=Math.sign||function(e){return 0l.length||u-c+1>l.length;)l.push(0);else{const a=Math.abs(u-c)-(l.length-1);for(let e=0;e=i)return We(e,t);{let e=o.coefficients;const r=o.exponent,n=(e=(e=e.length{throw new Error('Option \"precision\" must be a number or BigNumber')})),void 0!==e.wordSize&&(r=it(e.wordSize,()=>{throw new Error('Option \"wordSize\" must be a number or BigNumber')})),e.notation&&(n=e.notation)}return{notation:n,precision:t,wordSize:r}}function Ve(e){var t=String(e).toLowerCase().match(/^(-?)(\\d+\\.?\\d*)(e([+-]?\\d+))?$/);if(!t)throw new SyntaxError(\"Invalid number \"+e);const r=t[1],n=t[2];let i=parseFloat(t[4]||\"0\");e=n.indexOf(\".\");i+=-1!==e?e-1:n.length-1;const a=n.replace(\".\",\"\").replace(/^0*/,function(e){return i-=e.length,\"\"}).replace(/0*$/,\"\").split(\"\").map(function(e){return parseInt(e)});return 0===a.length&&(a.push(0),i++),{sign:r,coefficients:a,exponent:i}}function Ze(e,t){if(isNaN(e)||!isFinite(e))return String(e);e=Ve(e),e=\"number\"==typeof t?Ye(e,e.exponent+1+t):e;let r=e.coefficients,n=e.exponent+1;t=n+(t||0);return r.lengtht&&5<=n.splice(t,n.length-t)[0]){let e=t-1;for(n[e]++;10===n[e];)n.pop(),0===e&&(n.unshift(0),r.exponent++,e++),e--,n[e]++}return r}function Je(t){const r=[];for(let e=0;e/^[A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CD\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7DC\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u{10000}-\\u{1000B}\\u{1000D}-\\u{10026}\\u{10028}-\\u{1003A}\\u{1003C}\\u{1003D}\\u{1003F}-\\u{1004D}\\u{10050}-\\u{1005D}\\u{10080}-\\u{100FA}\\u{10280}-\\u{1029C}\\u{102A0}-\\u{102D0}\\u{10300}-\\u{1031F}\\u{1032D}-\\u{10340}\\u{10342}-\\u{10349}\\u{10350}-\\u{10375}\\u{10380}-\\u{1039D}\\u{103A0}-\\u{103C3}\\u{103C8}-\\u{103CF}\\u{10400}-\\u{1049D}\\u{104B0}-\\u{104D3}\\u{104D8}-\\u{104FB}\\u{10500}-\\u{10527}\\u{10530}-\\u{10563}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}\\u{10595}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}\\u{105BC}\\u{105C0}-\\u{105F3}\\u{10600}-\\u{10736}\\u{10740}-\\u{10755}\\u{10760}-\\u{10767}\\u{10780}-\\u{10785}\\u{10787}-\\u{107B0}\\u{107B2}-\\u{107BA}\\u{10800}-\\u{10805}\\u{10808}\\u{1080A}-\\u{10835}\\u{10837}\\u{10838}\\u{1083C}\\u{1083F}-\\u{10855}\\u{10860}-\\u{10876}\\u{10880}-\\u{1089E}\\u{108E0}-\\u{108F2}\\u{108F4}\\u{108F5}\\u{10900}-\\u{10915}\\u{10920}-\\u{10939}\\u{10980}-\\u{109B7}\\u{109BE}\\u{109BF}\\u{10A00}\\u{10A10}-\\u{10A13}\\u{10A15}-\\u{10A17}\\u{10A19}-\\u{10A35}\\u{10A60}-\\u{10A7C}\\u{10A80}-\\u{10A9C}\\u{10AC0}-\\u{10AC7}\\u{10AC9}-\\u{10AE4}\\u{10B00}-\\u{10B35}\\u{10B40}-\\u{10B55}\\u{10B60}-\\u{10B72}\\u{10B80}-\\u{10B91}\\u{10C00}-\\u{10C48}\\u{10C80}-\\u{10CB2}\\u{10CC0}-\\u{10CF2}\\u{10D00}-\\u{10D23}\\u{10D4A}-\\u{10D65}\\u{10D6F}-\\u{10D85}\\u{10E80}-\\u{10EA9}\\u{10EB0}\\u{10EB1}\\u{10EC2}-\\u{10EC4}\\u{10F00}-\\u{10F1C}\\u{10F27}\\u{10F30}-\\u{10F45}\\u{10F70}-\\u{10F81}\\u{10FB0}-\\u{10FC4}\\u{10FE0}-\\u{10FF6}\\u{11003}-\\u{11037}\\u{11071}\\u{11072}\\u{11075}\\u{11083}-\\u{110AF}\\u{110D0}-\\u{110E8}\\u{11103}-\\u{11126}\\u{11144}\\u{11147}\\u{11150}-\\u{11172}\\u{11176}\\u{11183}-\\u{111B2}\\u{111C1}-\\u{111C4}\\u{111DA}\\u{111DC}\\u{11200}-\\u{11211}\\u{11213}-\\u{1122B}\\u{1123F}\\u{11240}\\u{11280}-\\u{11286}\\u{11288}\\u{1128A}-\\u{1128D}\\u{1128F}-\\u{1129D}\\u{1129F}-\\u{112A8}\\u{112B0}-\\u{112DE}\\u{11305}-\\u{1130C}\\u{1130F}\\u{11310}\\u{11313}-\\u{11328}\\u{1132A}-\\u{11330}\\u{11332}\\u{11333}\\u{11335}-\\u{11339}\\u{1133D}\\u{11350}\\u{1135D}-\\u{11361}\\u{11380}-\\u{11389}\\u{1138B}\\u{1138E}\\u{11390}-\\u{113B5}\\u{113B7}\\u{113D1}\\u{113D3}\\u{11400}-\\u{11434}\\u{11447}-\\u{1144A}\\u{1145F}-\\u{11461}\\u{11480}-\\u{114AF}\\u{114C4}\\u{114C5}\\u{114C7}\\u{11580}-\\u{115AE}\\u{115D8}-\\u{115DB}\\u{11600}-\\u{1162F}\\u{11644}\\u{11680}-\\u{116AA}\\u{116B8}\\u{11700}-\\u{1171A}\\u{11740}-\\u{11746}\\u{11800}-\\u{1182B}\\u{118A0}-\\u{118DF}\\u{118FF}-\\u{11906}\\u{11909}\\u{1190C}-\\u{11913}\\u{11915}\\u{11916}\\u{11918}-\\u{1192F}\\u{1193F}\\u{11941}\\u{119A0}-\\u{119A7}\\u{119AA}-\\u{119D0}\\u{119E1}\\u{119E3}\\u{11A00}\\u{11A0B}-\\u{11A32}\\u{11A3A}\\u{11A50}\\u{11A5C}-\\u{11A89}\\u{11A9D}\\u{11AB0}-\\u{11AF8}\\u{11BC0}-\\u{11BE0}\\u{11C00}-\\u{11C08}\\u{11C0A}-\\u{11C2E}\\u{11C40}\\u{11C72}-\\u{11C8F}\\u{11D00}-\\u{11D06}\\u{11D08}\\u{11D09}\\u{11D0B}-\\u{11D30}\\u{11D46}\\u{11D60}-\\u{11D65}\\u{11D67}\\u{11D68}\\u{11D6A}-\\u{11D89}\\u{11D98}\\u{11EE0}-\\u{11EF2}\\u{11F02}\\u{11F04}-\\u{11F10}\\u{11F12}-\\u{11F33}\\u{11FB0}\\u{12000}-\\u{12399}\\u{12480}-\\u{12543}\\u{12F90}-\\u{12FF0}\\u{13000}-\\u{1342F}\\u{13441}-\\u{13446}\\u{13460}-\\u{143FA}\\u{14400}-\\u{14646}\\u{16100}-\\u{1611D}\\u{16800}-\\u{16A38}\\u{16A40}-\\u{16A5E}\\u{16A70}-\\u{16ABE}\\u{16AD0}-\\u{16AED}\\u{16B00}-\\u{16B2F}\\u{16B40}-\\u{16B43}\\u{16B63}-\\u{16B77}\\u{16B7D}-\\u{16B8F}\\u{16D40}-\\u{16D6C}\\u{16E40}-\\u{16E7F}\\u{16F00}-\\u{16F4A}\\u{16F50}\\u{16F93}-\\u{16F9F}\\u{16FE0}\\u{16FE1}\\u{16FE3}\\u{17000}-\\u{187F7}\\u{18800}-\\u{18CD5}\\u{18CFF}-\\u{18D08}\\u{1AFF0}-\\u{1AFF3}\\u{1AFF5}-\\u{1AFFB}\\u{1AFFD}\\u{1AFFE}\\u{1B000}-\\u{1B122}\\u{1B132}\\u{1B150}-\\u{1B152}\\u{1B155}\\u{1B164}-\\u{1B167}\\u{1B170}-\\u{1B2FB}\\u{1BC00}-\\u{1BC6A}\\u{1BC70}-\\u{1BC7C}\\u{1BC80}-\\u{1BC88}\\u{1BC90}-\\u{1BC99}\\u{1D400}-\\u{1D454}\\u{1D456}-\\u{1D49C}\\u{1D49E}\\u{1D49F}\\u{1D4A2}\\u{1D4A5}\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D51E}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D552}-\\u{1D6A5}\\u{1D6A8}-\\u{1D6C0}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6FA}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D734}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D76E}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D7A8}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7CB}\\u{1DF00}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E030}-\\u{1E06D}\\u{1E100}-\\u{1E12C}\\u{1E137}-\\u{1E13D}\\u{1E14E}\\u{1E290}-\\u{1E2AD}\\u{1E2C0}-\\u{1E2EB}\\u{1E4D0}-\\u{1E4EB}\\u{1E5D0}-\\u{1E5ED}\\u{1E5F0}\\u{1E7E0}-\\u{1E7E6}\\u{1E7E8}-\\u{1E7EB}\\u{1E7ED}\\u{1E7EE}\\u{1E7F0}-\\u{1E7FE}\\u{1E800}-\\u{1E8C4}\\u{1E900}-\\u{1E943}\\u{1E94B}\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u{20000}-\\u{2A6DF}\\u{2A700}-\\u{2B739}\\u{2B740}-\\u{2B81D}\\u{2B820}-\\u{2CEA1}\\u{2CEB0}-\\u{2EBE0}\\u{2EBF0}-\\u{2EE5D}\\u{2F800}-\\u{2FA1D}\\u{30000}-\\u{3134A}\\u{31350}-\\u{323AF}][0-9A-Za-z\\xAA\\xB5\\xBA\\xC0-\\xD6\\xD8-\\xF6\\xF8-\\u02C1\\u02C6-\\u02D1\\u02E0-\\u02E4\\u02EC\\u02EE\\u0370-\\u0374\\u0376\\u0377\\u037A-\\u037D\\u037F\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03F5\\u03F7-\\u0481\\u048A-\\u052F\\u0531-\\u0556\\u0559\\u0560-\\u0588\\u05D0-\\u05EA\\u05EF-\\u05F2\\u0620-\\u064A\\u066E\\u066F\\u0671-\\u06D3\\u06D5\\u06E5\\u06E6\\u06EE\\u06EF\\u06FA-\\u06FC\\u06FF\\u0710\\u0712-\\u072F\\u074D-\\u07A5\\u07B1\\u07CA-\\u07EA\\u07F4\\u07F5\\u07FA\\u0800-\\u0815\\u081A\\u0824\\u0828\\u0840-\\u0858\\u0860-\\u086A\\u0870-\\u0887\\u0889-\\u088E\\u08A0-\\u08C9\\u0904-\\u0939\\u093D\\u0950\\u0958-\\u0961\\u0971-\\u0980\\u0985-\\u098C\\u098F\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09BD\\u09CE\\u09DC\\u09DD\\u09DF-\\u09E1\\u09F0\\u09F1\\u09FC\\u0A05-\\u0A0A\\u0A0F\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32\\u0A33\\u0A35\\u0A36\\u0A38\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AD0\\u0AE0\\u0AE1\\u0AF9\\u0B05-\\u0B0C\\u0B0F\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32\\u0B33\\u0B35-\\u0B39\\u0B3D\\u0B5C\\u0B5D\\u0B5F-\\u0B61\\u0B71\\u0B83\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99\\u0B9A\\u0B9C\\u0B9E\\u0B9F\\u0BA3\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB9\\u0BD0\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C39\\u0C3D\\u0C58-\\u0C5A\\u0C5D\\u0C60\\u0C61\\u0C80\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CBD\\u0CDD\\u0CDE\\u0CE0\\u0CE1\\u0CF1\\u0CF2\\u0D04-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D3A\\u0D3D\\u0D4E\\u0D54-\\u0D56\\u0D5F-\\u0D61\\u0D7A-\\u0D7F\\u0D85-\\u0D96\\u0D9A-\\u0DB1\\u0DB3-\\u0DBB\\u0DBD\\u0DC0-\\u0DC6\\u0E01-\\u0E30\\u0E32\\u0E33\\u0E40-\\u0E46\\u0E81\\u0E82\\u0E84\\u0E86-\\u0E8A\\u0E8C-\\u0EA3\\u0EA5\\u0EA7-\\u0EB0\\u0EB2\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0EC6\\u0EDC-\\u0EDF\\u0F00\\u0F40-\\u0F47\\u0F49-\\u0F6C\\u0F88-\\u0F8C\\u1000-\\u102A\\u103F\\u1050-\\u1055\\u105A-\\u105D\\u1061\\u1065\\u1066\\u106E-\\u1070\\u1075-\\u1081\\u108E\\u10A0-\\u10C5\\u10C7\\u10CD\\u10D0-\\u10FA\\u10FC-\\u1248\\u124A-\\u124D\\u1250-\\u1256\\u1258\\u125A-\\u125D\\u1260-\\u1288\\u128A-\\u128D\\u1290-\\u12B0\\u12B2-\\u12B5\\u12B8-\\u12BE\\u12C0\\u12C2-\\u12C5\\u12C8-\\u12D6\\u12D8-\\u1310\\u1312-\\u1315\\u1318-\\u135A\\u1380-\\u138F\\u13A0-\\u13F5\\u13F8-\\u13FD\\u1401-\\u166C\\u166F-\\u167F\\u1681-\\u169A\\u16A0-\\u16EA\\u16F1-\\u16F8\\u1700-\\u1711\\u171F-\\u1731\\u1740-\\u1751\\u1760-\\u176C\\u176E-\\u1770\\u1780-\\u17B3\\u17D7\\u17DC\\u1820-\\u1878\\u1880-\\u1884\\u1887-\\u18A8\\u18AA\\u18B0-\\u18F5\\u1900-\\u191E\\u1950-\\u196D\\u1970-\\u1974\\u1980-\\u19AB\\u19B0-\\u19C9\\u1A00-\\u1A16\\u1A20-\\u1A54\\u1AA7\\u1B05-\\u1B33\\u1B45-\\u1B4C\\u1B83-\\u1BA0\\u1BAE\\u1BAF\\u1BBA-\\u1BE5\\u1C00-\\u1C23\\u1C4D-\\u1C4F\\u1C5A-\\u1C7D\\u1C80-\\u1C8A\\u1C90-\\u1CBA\\u1CBD-\\u1CBF\\u1CE9-\\u1CEC\\u1CEE-\\u1CF3\\u1CF5\\u1CF6\\u1CFA\\u1D00-\\u1DBF\\u1E00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2071\\u207F\\u2090-\\u209C\\u2102\\u2107\\u210A-\\u2113\\u2115\\u2119-\\u211D\\u2124\\u2126\\u2128\\u212A-\\u212D\\u212F-\\u2139\\u213C-\\u213F\\u2145-\\u2149\\u214E\\u2183\\u2184\\u2C00-\\u2CE4\\u2CEB-\\u2CEE\\u2CF2\\u2CF3\\u2D00-\\u2D25\\u2D27\\u2D2D\\u2D30-\\u2D67\\u2D6F\\u2D80-\\u2D96\\u2DA0-\\u2DA6\\u2DA8-\\u2DAE\\u2DB0-\\u2DB6\\u2DB8-\\u2DBE\\u2DC0-\\u2DC6\\u2DC8-\\u2DCE\\u2DD0-\\u2DD6\\u2DD8-\\u2DDE\\u2E2F\\u3005\\u3006\\u3031-\\u3035\\u303B\\u303C\\u3041-\\u3096\\u309D-\\u309F\\u30A1-\\u30FA\\u30FC-\\u30FF\\u3105-\\u312F\\u3131-\\u318E\\u31A0-\\u31BF\\u31F0-\\u31FF\\u3400-\\u4DBF\\u4E00-\\uA48C\\uA4D0-\\uA4FD\\uA500-\\uA60C\\uA610-\\uA61F\\uA62A\\uA62B\\uA640-\\uA66E\\uA67F-\\uA69D\\uA6A0-\\uA6E5\\uA717-\\uA71F\\uA722-\\uA788\\uA78B-\\uA7CD\\uA7D0\\uA7D1\\uA7D3\\uA7D5-\\uA7DC\\uA7F2-\\uA801\\uA803-\\uA805\\uA807-\\uA80A\\uA80C-\\uA822\\uA840-\\uA873\\uA882-\\uA8B3\\uA8F2-\\uA8F7\\uA8FB\\uA8FD\\uA8FE\\uA90A-\\uA925\\uA930-\\uA946\\uA960-\\uA97C\\uA984-\\uA9B2\\uA9CF\\uA9E0-\\uA9E4\\uA9E6-\\uA9EF\\uA9FA-\\uA9FE\\uAA00-\\uAA28\\uAA40-\\uAA42\\uAA44-\\uAA4B\\uAA60-\\uAA76\\uAA7A\\uAA7E-\\uAAAF\\uAAB1\\uAAB5\\uAAB6\\uAAB9-\\uAABD\\uAAC0\\uAAC2\\uAADB-\\uAADD\\uAAE0-\\uAAEA\\uAAF2-\\uAAF4\\uAB01-\\uAB06\\uAB09-\\uAB0E\\uAB11-\\uAB16\\uAB20-\\uAB26\\uAB28-\\uAB2E\\uAB30-\\uAB5A\\uAB5C-\\uAB69\\uAB70-\\uABE2\\uAC00-\\uD7A3\\uD7B0-\\uD7C6\\uD7CB-\\uD7FB\\uF900-\\uFA6D\\uFA70-\\uFAD9\\uFB00-\\uFB06\\uFB13-\\uFB17\\uFB1D\\uFB1F-\\uFB28\\uFB2A-\\uFB36\\uFB38-\\uFB3C\\uFB3E\\uFB40\\uFB41\\uFB43\\uFB44\\uFB46-\\uFBB1\\uFBD3-\\uFD3D\\uFD50-\\uFD8F\\uFD92-\\uFDC7\\uFDF0-\\uFDFB\\uFE70-\\uFE74\\uFE76-\\uFEFC\\uFF21-\\uFF3A\\uFF41-\\uFF5A\\uFF66-\\uFFBE\\uFFC2-\\uFFC7\\uFFCA-\\uFFCF\\uFFD2-\\uFFD7\\uFFDA-\\uFFDC\\u{10000}-\\u{1000B}\\u{1000D}-\\u{10026}\\u{10028}-\\u{1003A}\\u{1003C}\\u{1003D}\\u{1003F}-\\u{1004D}\\u{10050}-\\u{1005D}\\u{10080}-\\u{100FA}\\u{10280}-\\u{1029C}\\u{102A0}-\\u{102D0}\\u{10300}-\\u{1031F}\\u{1032D}-\\u{10340}\\u{10342}-\\u{10349}\\u{10350}-\\u{10375}\\u{10380}-\\u{1039D}\\u{103A0}-\\u{103C3}\\u{103C8}-\\u{103CF}\\u{10400}-\\u{1049D}\\u{104B0}-\\u{104D3}\\u{104D8}-\\u{104FB}\\u{10500}-\\u{10527}\\u{10530}-\\u{10563}\\u{10570}-\\u{1057A}\\u{1057C}-\\u{1058A}\\u{1058C}-\\u{10592}\\u{10594}\\u{10595}\\u{10597}-\\u{105A1}\\u{105A3}-\\u{105B1}\\u{105B3}-\\u{105B9}\\u{105BB}\\u{105BC}\\u{105C0}-\\u{105F3}\\u{10600}-\\u{10736}\\u{10740}-\\u{10755}\\u{10760}-\\u{10767}\\u{10780}-\\u{10785}\\u{10787}-\\u{107B0}\\u{107B2}-\\u{107BA}\\u{10800}-\\u{10805}\\u{10808}\\u{1080A}-\\u{10835}\\u{10837}\\u{10838}\\u{1083C}\\u{1083F}-\\u{10855}\\u{10860}-\\u{10876}\\u{10880}-\\u{1089E}\\u{108E0}-\\u{108F2}\\u{108F4}\\u{108F5}\\u{10900}-\\u{10915}\\u{10920}-\\u{10939}\\u{10980}-\\u{109B7}\\u{109BE}\\u{109BF}\\u{10A00}\\u{10A10}-\\u{10A13}\\u{10A15}-\\u{10A17}\\u{10A19}-\\u{10A35}\\u{10A60}-\\u{10A7C}\\u{10A80}-\\u{10A9C}\\u{10AC0}-\\u{10AC7}\\u{10AC9}-\\u{10AE4}\\u{10B00}-\\u{10B35}\\u{10B40}-\\u{10B55}\\u{10B60}-\\u{10B72}\\u{10B80}-\\u{10B91}\\u{10C00}-\\u{10C48}\\u{10C80}-\\u{10CB2}\\u{10CC0}-\\u{10CF2}\\u{10D00}-\\u{10D23}\\u{10D4A}-\\u{10D65}\\u{10D6F}-\\u{10D85}\\u{10E80}-\\u{10EA9}\\u{10EB0}\\u{10EB1}\\u{10EC2}-\\u{10EC4}\\u{10F00}-\\u{10F1C}\\u{10F27}\\u{10F30}-\\u{10F45}\\u{10F70}-\\u{10F81}\\u{10FB0}-\\u{10FC4}\\u{10FE0}-\\u{10FF6}\\u{11003}-\\u{11037}\\u{11071}\\u{11072}\\u{11075}\\u{11083}-\\u{110AF}\\u{110D0}-\\u{110E8}\\u{11103}-\\u{11126}\\u{11144}\\u{11147}\\u{11150}-\\u{11172}\\u{11176}\\u{11183}-\\u{111B2}\\u{111C1}-\\u{111C4}\\u{111DA}\\u{111DC}\\u{11200}-\\u{11211}\\u{11213}-\\u{1122B}\\u{1123F}\\u{11240}\\u{11280}-\\u{11286}\\u{11288}\\u{1128A}-\\u{1128D}\\u{1128F}-\\u{1129D}\\u{1129F}-\\u{112A8}\\u{112B0}-\\u{112DE}\\u{11305}-\\u{1130C}\\u{1130F}\\u{11310}\\u{11313}-\\u{11328}\\u{1132A}-\\u{11330}\\u{11332}\\u{11333}\\u{11335}-\\u{11339}\\u{1133D}\\u{11350}\\u{1135D}-\\u{11361}\\u{11380}-\\u{11389}\\u{1138B}\\u{1138E}\\u{11390}-\\u{113B5}\\u{113B7}\\u{113D1}\\u{113D3}\\u{11400}-\\u{11434}\\u{11447}-\\u{1144A}\\u{1145F}-\\u{11461}\\u{11480}-\\u{114AF}\\u{114C4}\\u{114C5}\\u{114C7}\\u{11580}-\\u{115AE}\\u{115D8}-\\u{115DB}\\u{11600}-\\u{1162F}\\u{11644}\\u{11680}-\\u{116AA}\\u{116B8}\\u{11700}-\\u{1171A}\\u{11740}-\\u{11746}\\u{11800}-\\u{1182B}\\u{118A0}-\\u{118DF}\\u{118FF}-\\u{11906}\\u{11909}\\u{1190C}-\\u{11913}\\u{11915}\\u{11916}\\u{11918}-\\u{1192F}\\u{1193F}\\u{11941}\\u{119A0}-\\u{119A7}\\u{119AA}-\\u{119D0}\\u{119E1}\\u{119E3}\\u{11A00}\\u{11A0B}-\\u{11A32}\\u{11A3A}\\u{11A50}\\u{11A5C}-\\u{11A89}\\u{11A9D}\\u{11AB0}-\\u{11AF8}\\u{11BC0}-\\u{11BE0}\\u{11C00}-\\u{11C08}\\u{11C0A}-\\u{11C2E}\\u{11C40}\\u{11C72}-\\u{11C8F}\\u{11D00}-\\u{11D06}\\u{11D08}\\u{11D09}\\u{11D0B}-\\u{11D30}\\u{11D46}\\u{11D60}-\\u{11D65}\\u{11D67}\\u{11D68}\\u{11D6A}-\\u{11D89}\\u{11D98}\\u{11EE0}-\\u{11EF2}\\u{11F02}\\u{11F04}-\\u{11F10}\\u{11F12}-\\u{11F33}\\u{11FB0}\\u{12000}-\\u{12399}\\u{12480}-\\u{12543}\\u{12F90}-\\u{12FF0}\\u{13000}-\\u{1342F}\\u{13441}-\\u{13446}\\u{13460}-\\u{143FA}\\u{14400}-\\u{14646}\\u{16100}-\\u{1611D}\\u{16800}-\\u{16A38}\\u{16A40}-\\u{16A5E}\\u{16A70}-\\u{16ABE}\\u{16AD0}-\\u{16AED}\\u{16B00}-\\u{16B2F}\\u{16B40}-\\u{16B43}\\u{16B63}-\\u{16B77}\\u{16B7D}-\\u{16B8F}\\u{16D40}-\\u{16D6C}\\u{16E40}-\\u{16E7F}\\u{16F00}-\\u{16F4A}\\u{16F50}\\u{16F93}-\\u{16F9F}\\u{16FE0}\\u{16FE1}\\u{16FE3}\\u{17000}-\\u{187F7}\\u{18800}-\\u{18CD5}\\u{18CFF}-\\u{18D08}\\u{1AFF0}-\\u{1AFF3}\\u{1AFF5}-\\u{1AFFB}\\u{1AFFD}\\u{1AFFE}\\u{1B000}-\\u{1B122}\\u{1B132}\\u{1B150}-\\u{1B152}\\u{1B155}\\u{1B164}-\\u{1B167}\\u{1B170}-\\u{1B2FB}\\u{1BC00}-\\u{1BC6A}\\u{1BC70}-\\u{1BC7C}\\u{1BC80}-\\u{1BC88}\\u{1BC90}-\\u{1BC99}\\u{1D400}-\\u{1D454}\\u{1D456}-\\u{1D49C}\\u{1D49E}\\u{1D49F}\\u{1D4A2}\\u{1D4A5}\\u{1D4A6}\\u{1D4A9}-\\u{1D4AC}\\u{1D4AE}-\\u{1D4B9}\\u{1D4BB}\\u{1D4BD}-\\u{1D4C3}\\u{1D4C5}-\\u{1D505}\\u{1D507}-\\u{1D50A}\\u{1D50D}-\\u{1D514}\\u{1D516}-\\u{1D51C}\\u{1D51E}-\\u{1D539}\\u{1D53B}-\\u{1D53E}\\u{1D540}-\\u{1D544}\\u{1D546}\\u{1D54A}-\\u{1D550}\\u{1D552}-\\u{1D6A5}\\u{1D6A8}-\\u{1D6C0}\\u{1D6C2}-\\u{1D6DA}\\u{1D6DC}-\\u{1D6FA}\\u{1D6FC}-\\u{1D714}\\u{1D716}-\\u{1D734}\\u{1D736}-\\u{1D74E}\\u{1D750}-\\u{1D76E}\\u{1D770}-\\u{1D788}\\u{1D78A}-\\u{1D7A8}\\u{1D7AA}-\\u{1D7C2}\\u{1D7C4}-\\u{1D7CB}\\u{1DF00}-\\u{1DF1E}\\u{1DF25}-\\u{1DF2A}\\u{1E030}-\\u{1E06D}\\u{1E100}-\\u{1E12C}\\u{1E137}-\\u{1E13D}\\u{1E14E}\\u{1E290}-\\u{1E2AD}\\u{1E2C0}-\\u{1E2EB}\\u{1E4D0}-\\u{1E4EB}\\u{1E5D0}-\\u{1E5ED}\\u{1E5F0}\\u{1E7E0}-\\u{1E7E6}\\u{1E7E8}-\\u{1E7EB}\\u{1E7ED}\\u{1E7EE}\\u{1E7F0}-\\u{1E7FE}\\u{1E800}-\\u{1E8C4}\\u{1E900}-\\u{1E943}\\u{1E94B}\\u{1EE00}-\\u{1EE03}\\u{1EE05}-\\u{1EE1F}\\u{1EE21}\\u{1EE22}\\u{1EE24}\\u{1EE27}\\u{1EE29}-\\u{1EE32}\\u{1EE34}-\\u{1EE37}\\u{1EE39}\\u{1EE3B}\\u{1EE42}\\u{1EE47}\\u{1EE49}\\u{1EE4B}\\u{1EE4D}-\\u{1EE4F}\\u{1EE51}\\u{1EE52}\\u{1EE54}\\u{1EE57}\\u{1EE59}\\u{1EE5B}\\u{1EE5D}\\u{1EE5F}\\u{1EE61}\\u{1EE62}\\u{1EE64}\\u{1EE67}-\\u{1EE6A}\\u{1EE6C}-\\u{1EE72}\\u{1EE74}-\\u{1EE77}\\u{1EE79}-\\u{1EE7C}\\u{1EE7E}\\u{1EE80}-\\u{1EE89}\\u{1EE8B}-\\u{1EE9B}\\u{1EEA1}-\\u{1EEA3}\\u{1EEA5}-\\u{1EEA9}\\u{1EEAB}-\\u{1EEBB}\\u{20000}-\\u{2A6DF}\\u{2A700}-\\u{2B739}\\u{2B740}-\\u{2B81D}\\u{2B820}-\\u{2CEA1}\\u{2CEB0}-\\u{2EBE0}\\u{2EBF0}-\\u{2EE5D}\\u{2F800}-\\u{2FA1D}\\u{30000}-\\u{3134A}\\u{31350}-\\u{323AF}]*$/u.test(e)},{name:\"string\",test:j},{name:\"Chain\",test:Be},{name:\"Array\",test:b},{name:\"Matrix\",test:_},{name:\"DenseMatrix\",test:H},{name:\"SparseMatrix\",test:G},{name:\"Range\",test:V},{name:\"Index\",test:Z},{name:\"boolean\",test:W},{name:\"ResultSet\",test:Y},{name:\"Help\",test:J},{name:\"function\",test:X},{name:\"Date\",test:ne},{name:\"RegExp\",test:ie},{name:\"null\",test:he},{name:\"undefined\",test:de},{name:\"AccessorNode\",test:ge},{name:\"ArrayNode\",test:ye},{name:\"AssignmentNode\",test:xe},{name:\"BlockNode\",test:be},{name:\"ConditionalNode\",test:ve},{name:\"ConstantNode\",test:ae},{name:\"FunctionNode\",test:Ae},{name:\"FunctionAssignmentNode\",test:Ne},{name:\"IndexNode\",test:Ee},{name:\"Node\",test:O},{name:\"ObjectNode\",test:Se},{name:\"OperatorNode\",test:oe},{name:\"ParenthesisNode\",test:Me},{name:\"RangeNode\",test:Ce},{name:\"RelationalNode\",test:Te},{name:\"SymbolNode\",test:se},{name:\"Map\",test:fe},{name:\"Object\",test:ce}]),a.addConversions([{from:\"number\",to:\"BigNumber\",convert:function(e){if(r||ut(e),1515 significant digits to BigNumber (value: \"+e+\"). Use function bignumber(x) to convert to BigNumber.\");return new r(e)}},{from:\"number\",to:\"Complex\",convert:function(e){return n||lt(e),new n(e,0)}},{from:\"BigNumber\",to:\"Complex\",convert:function(e){return n||lt(e),new n(e.toNumber(),0)}},{from:\"bigint\",to:\"number\",convert:function(e){if(e>Number.MAX_SAFE_INTEGER)throw new TypeError(\"Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: \"+e+\")\");return Number(e)}},{from:\"bigint\",to:\"BigNumber\",convert:function(e){return r||ut(e),new r(e.toString())}},{from:\"bigint\",to:\"Fraction\",convert:function(e){return i||ct(e),new i(e)}},{from:\"Fraction\",to:\"BigNumber\",convert:function(e){throw new TypeError(\"Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.\")}},{from:\"Fraction\",to:\"Complex\",convert:function(e){return n||lt(e),new n(e.valueOf(),0)}},{from:\"number\",to:\"Fraction\",convert:function(e){i||ct(e);const t=new i(e);if(t.valueOf()!==e)throw new TypeError(\"Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: \"+e+\"). Use function fraction(x) to convert to Fraction.\");return t}},{from:\"string\",to:\"number\",convert:function(e){var t=Number(e);if(isNaN(t))throw new Error('Cannot convert \"'+e+'\" to a number');return t}},{from:\"string\",to:\"BigNumber\",convert:function(t){r||ut(t);try{return new r(t)}catch(e){throw new Error('Cannot convert \"'+t+'\" to BigNumber')}}},{from:\"string\",to:\"bigint\",convert:function(t){try{return BigInt(t)}catch(e){throw new Error('Cannot convert \"'+t+'\" to BigInt')}}},{from:\"string\",to:\"Fraction\",convert:function(t){i||ct(t);try{return new i(t)}catch(e){throw new Error('Cannot convert \"'+t+'\" to Fraction')}}},{from:\"string\",to:\"Complex\",convert:function(t){n||lt(t);try{return new n(t)}catch(e){throw new Error('Cannot convert \"'+t+'\" to Complex')}}},{from:\"boolean\",to:\"number\",convert:function(e){return+e}},{from:\"boolean\",to:\"BigNumber\",convert:function(e){return r||ut(e),new r(+e)}},{from:\"boolean\",to:\"bigint\",convert:function(e){return BigInt(+e)}},{from:\"boolean\",to:\"Fraction\",convert:function(e){return i||ct(e),new i(+e)}},{from:\"boolean\",to:\"string\",convert:function(e){return String(e)}},{from:\"Array\",to:\"Matrix\",convert:function(e){if(t)return new t(e);throw new Error(\"Cannot convert array into a Matrix: no class 'DenseMatrix' provided\")}},{from:\"Matrix\",to:\"Array\",convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,r)=>{var n=a.createError(e,t,r);if([\"wrongType\",\"mismatch\"].includes(n.data.category)&&1===t.length&&$(t[0])&&r.some(e=>!e.params.includes(\",\"))){const t=new TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw t.data=n.data,t}throw n},a.onMismatch=(e,t,r)=>{var n=a.createError(e,t,r);if([\"wrongType\",\"mismatch\"].includes(n.data.category)&&1===t.length&&$(t[0])&&r.some(e=>!e.params.includes(\",\"))){const t=new TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw t.data=n.data,t}throw n},a});function ut(e){throw new Error(`Cannot convert value ${e} into a BigNumber: no class 'BigNumber' provided`)}function lt(e){throw new Error(`Cannot convert value ${e} into a Complex number: no class 'Complex' provided`)}function ct(e){throw new Error(`Cannot convert value ${e} into a Fraction, no class 'Fraction' provided.`)}const ft=s(\"ResultSet\",[],()=>{function t(e){if(!(this instanceof t))throw new SyntaxError(\"Constructor must be called with the new operator\");this.entries=e||[]}return t.prototype.type=\"ResultSet\",t.prototype.isResultSet=!0,t.prototype.valueOf=function(){return this.entries},t.prototype.toString=function(){return\"[\"+this.entries.map(String).join(\", \")+\"]\"},t.prototype.toJSON=function(){return{mathjs:\"ResultSet\",entries:this.entries}},t.fromJSON=function(e){return new t(e.entries)},t},{isClass:!0});var pt,mt,ht=9e15,dt=1e9,gt=\"0123456789abcdef\",yt=\"2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058\",xt=\"3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789\",bt={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-ht,maxE:ht,crypto:!1},w=!0,vt=\"[DecimalError] \",wt=vt+\"Invalid argument: \",Nt=vt+\"Precision limit exceeded\",At=vt+\"crypto unavailable\",Et=\"[object Decimal]\",St=Math.floor,d=Math.pow,Mt=/^0b([01]+(\\.[01]*)?|\\.[01]+)(p[+-]?\\d+)?$/i,Ct=/^0x([0-9a-f]+(\\.[0-9a-f]*)?|\\.[0-9a-f]+)(p[+-]?\\d+)?$/i,Tt=/^0o([0-7]+(\\.[0-7]*)?|\\.[0-7]+)(p[+-]?\\d+)?$/i,Bt=/^(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,Ft=1e7,Dt=yt.length-1,Ot=xt.length-1,o={toStringTag:Et};function _t(e){var t,r,n,i=e.length-1,a=\"\",o=e[0];if(0r-1&&(void 0===a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}o.absoluteValue=o.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),B(e)},o.ceil=function(){return B(new this.constructor(this),this.e+1,2)},o.clampedTo=o.clamp=function(e,t){var r=this.constructor;if(e=new r(e),t=new r(t),!e.s||!t.s)return new r(NaN);if(e.gt(t))throw Error(wt+t);return this.cmp(e)<0?e:0e.e^o<0?1:-1;for(t=0,r=(s=i.length)<(n=a.length)?s:n;ta[t]^o<0?1:-1;return s===n?0:nthis.d.length-2},o.isNaN=function(){return!this.s},o.isNegative=o.isNeg=function(){return this.s<0},o.isPositive=o.isPos=function(){return 0(n=Math.max(Math.ceil(s/7),o)+2)&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for((c=(n=l.length)<(o=f.length))&&(o=n),n=0;n(i=(c=Math.ceil(a/7))>i?c+1:i+1)&&(n=i,r.length=1),r.reverse();n--;)r.push(0);r.reverse()}for((i=s.length)-(n=u.length)<0&&(n=i,r=u,u=s,s=r),t=0;n;)t=(s[--n]=s[n]+u[n]+t)/Ft|0,s[n]%=Ft;for(t&&(s.unshift(t),++l),i=s.length;0==s[--i];)s.pop();return e.d=s,e.e=jt(s,l),w?B(e,a,o):e},o.precision=o.sd=function(e){var t;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(wt+e);return this.d?(t=Ht(this.d),e&&this.e+1>t&&(t=this.e+1)):t=NaN,t},o.round=function(){var e=this.constructor;return B(new e(this),this.e+1,e.rounding)},o.sine=o.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Kt(e,2,t,t);r=16<(r=1.4*Math.sqrt(n))?16:0|r,t=Kt(e,2,t=t.times(1/er(5,r)),t);for(var i,a=new e(5),o=new e(16),s=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}(n,tr(n,r)),n.precision=e,n.rounding=t,B(2=e.d.length-1&&(r=l<0?-l:l)<=9007199254740991)return i=Vt(u,s,r,n),e.s<0?new u(1).div(i):B(i,n,a);if((o=s.s)<0){if(tu.maxE+1||t=n.toExpPos):(zt(e,1,dt),void 0===t?t=n.rounding:zt(t,0,8),Ut(r=B(new n(r),e,t),e<=r.e||r.e<=n.toExpNeg,e));return r.isNeg()&&!r.isZero()?\"-\"+t:t},o.toSignificantDigits=o.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(zt(e,1,dt),void 0===t?t=r.rounding:zt(t,0,8)),B(new r(this),e,t)},o.toString=function(){var e=this,t=e.constructor,t=Ut(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?\"-\"+t:t},o.truncated=o.trunc=function(){return B(new this.constructor(this),this.e+1,1)},o.valueOf=o.toJSON=function(){var e=this,t=e.constructor,t=Ut(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?\"-\"+t:t};var N=function(e,t,r,n,i,a){var o,s,u,l,c,f,p,m,h,d,g,y,x,b,v,w,N,A,E,S=e.constructor,M=e.s==t.s?1:-1,C=e.d,T=t.d;if(!(C&&C[0]&&T&&T[0]))return new S(e.s&&t.s&&(C?!T||C[0]!=T[0]:T)?C&&0==C[0]||!T?0*M:M/0:NaN);for(s=a?(c=1,e.e-t.e):(a=Ft,St(e.e/(c=7))-St(t.e/c)),A=T.length,w=C.length,h=(M=new S(M)).d=[],u=0;T[u]==(C[u]||0);u++);if(T[u]>(C[u]||0)&&s--,null==r?(x=r=S.precision,n=S.rounding):x=i?r+(e.e-t.e)+1:r,x<0)h.push(1),f=!0;else{if(x=x/c+2|0,u=0,1==A){for(T=T[l=0],x++;(u=a/2&&++N;l=0,(o=Rt(T,d,A,g))<0?(y=d[0],1<(l=(y=A!=g?y*a+(d[1]||0):y)/N|0)?1==(o=Rt(p=kt(T,l=a<=l?a-1:l,a),d,m=p.length,g=d.length))&&(l--,Pt(p,At[i]?1:-1;break}return a}function Pt(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]=(s=c.length)){if(!n)break e;for(;s++<=f;)c.push(0);l=u=0,o=(a%=7)-7+(i=1)}else{for(l=s=c[f],i=1;10<=s;s/=10)i++;u=(o=(a%=7)-7+i)<0?0:l/d(10,i-o-1)%10|0}if(n=n||t<0||void 0!==c[f+1]||(o<0?l:l%d(10,i-o-1)),u=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):5p.maxE?(e.d=null,e.e=NaN):e.ee.constructor.maxE?(e.d=null,e.e=NaN):e.ei-1;)c[r]=0,r||(++a,c.unshift(1));for(s=c.length;!c[s-1];--s);for(o=0,l=\"\";os)for(a-=s;a--;)l+=\"0\";else at&&(e.length=t,1)}function ir(e){return new this(e).abs()}function ar(e){return new this(e).acos()}function or(e){return new this(e).acosh()}function sr(e,t){return new this(e).plus(t)}function ur(e){return new this(e).asin()}function lr(e){return new this(e).asinh()}function cr(e){return new this(e).atan()}function fr(e){return new this(e).atanh()}function pr(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?$t(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=$t(this,a,1).times(.5)).s=e.s:r=t.s<0?(this.precision=a,this.rounding=1,r=this.atan(N(e,t,a,1)),t=$t(this,a,1),this.precision=n,this.rounding=i,e.s<0?r.minus(t):r.plus(t)):this.atan(N(e,t,a,1)):(r=$t(this,a,1).times(0a.maxE?(i.e=NaN,i.d=null):e.e{let{on:t,config:r}=e;const n=Vr.clone({precision:r.precision,modulo:Vr.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type=\"BigNumber\",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:\"BigNumber\",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},t&&t(\"config\",function(e,t){e.precision!==t.precision&&n.config({precision:e.precision})}),n},{isClass:!0}),Wr=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},Yr=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},Jr=function(){throw SyntaxError(\"Invalid Param\")};function Xr(e,t){var r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}function Qr(e,n){const i=Kr;if(null==e)i.re=i.im=0;else if(void 0!==n)i.re=e,i.im=n;else switch(typeof e){case\"object\":if(\"im\"in e&&\"re\"in e)i.re=e.re,i.im=e.im;else if(\"abs\"in e&&\"arg\"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return u.INFINITY;i.re=e.abs*Math.cos(e.arg),i.im=e.abs*Math.sin(e.arg)}else if(\"r\"in e&&\"phi\"in e){if(!isFinite(e.r)&&isFinite(e.phi))return u.INFINITY;i.re=e.r*Math.cos(e.phi),i.im=e.r*Math.sin(e.phi)}else 2===e.length?(i.re=e[0],i.im=e[1]):Jr();break;case\"string\":i.im=i.re=0;const n=e.replace(/_/g,\"\").match(/\\d+\\.?\\d*e[+-]?\\d+|\\d+\\.?\\d*|\\.\\d+|./g);let t=1,r=0;null===n&&Jr();for(let e=0;e(Object.defineProperty(u,\"name\",{value:\"Complex\"}),(u.prototype.constructor=u).prototype.type=\"Complex\",u.prototype.isComplex=!0,u.prototype.toJSON=function(){return{mathjs:\"Complex\",re:this.re,im:this.im}},u.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},u.prototype.format=function(e){let t=this.im,r=this.re;const n=He(this.re,e),i=He(this.im,e),a=A(e)?e:e?e.precision:null;if(null!==a){const e=Math.pow(10,-a);Math.abs(r/t)t.re?1:e.ret.im?1:e.imr?(u=n,i):(u=t,r);break}am.s*m.n*this.d},gte:function(e,t){return y(e,t),this.s*this.n*m.d>=m.s*m.n*this.d},compare:function(e,t){y(e,t);e=this.s*this.n*m.d-m.s*m.n*this.d;return(pp&&this.s>=p?f:p),e)},floor:function(e){return e=nn**BigInt(e||0),g(on(this.s*e*this.n/this.d)-(e*this.n%this.d>p&&this.s=p?f:p)+tn*(e*this.n%this.d)>this.d?f:p),e)},roundTo:function(e,t){y(e,t);var e=this.n*m.d,t=this.d*m.n,r=e%t;let n=on(e/t);return t<=r+r&&n++,g(this.s*n*m.n,m.d)},divisible:function(e,t){return y(e,t),!(!(m.n*this.d)||this.n*m.d%(m.n*this.d))},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(t){let r=this.n,n=this.d,i=(t=t||15,function(e){for(;e%tn===p;e/=tn);for(;e%rn===p;e/=rn);if(e===f)return p;let t=nn%e,r=1;for(;t!==f;r++)if(t=t*nn%e,2e3p;e=e*e%r,t>>=f)t&f&&(n=n*e%r);return n}(nn,e,t);for(let e=0;e<300;e++){if(r===n)return BigInt(e);r=r*nn%t,n=n*nn%t}return 0}(n,i),o=this.sp&&(n=n+i+\" \",t%=r),n=(n+=t)+\"/\"+r),n},toLatex:function(e){let t=this.n,r=this.d,n=this.sp&&(n+=i,t%=r),n=(n=(n+=\"\\\\frac{\")+t+\"}{\")+r+\"}\"),n},toContinued:function(){let e=this.n,t=this.d,r=[];do{r.push(on(e/t));var n=e%t;e=t,t=n}while(e!==f);return r},simplify:function(e){const n=BigInt(1/(e||.001)|0),i=this.abs(),a=i.toContinued();for(let r=1;r(Object.defineProperty(ln,\"name\",{value:\"Fraction\"}),(ln.prototype.constructor=ln).prototype.type=\"Fraction\",ln.prototype.isFraction=!0,ln.prototype.toJSON=function(){return{mathjs:\"Fraction\",n:String(this.s*this.n),d:String(this.d)}},ln.fromJSON=function(e){return new ln(e)},ln),{isClass:!0}),hn=s(\"Range\",[],()=>{function o(e,t,r){if(!(this instanceof o))throw new SyntaxError(\"Constructor must be called with the new operator\");var n=null!=e,i=null!=t,a=null!=r;if(n)if(Q(e))e=e.toNumber();else if(\"number\"!=typeof e&&!R(e))throw new TypeError(\"Parameter start must be a number or bigint\");if(i)if(Q(t))t=t.toNumber();else if(\"number\"!=typeof t&&!R(t))throw new TypeError(\"Parameter end must be a number or bigint\");if(a)if(Q(r))r=r.toNumber();else if(\"number\"!=typeof r&&!R(r))throw new TypeError(\"Parameter step must be a number or bigint\");this.start=n?parseFloat(e):0,this.end=i?parseFloat(t):0,this.step=a?parseFloat(r):1}return o.prototype.type=\"Range\",o.prototype.isRange=!0,o.parse=function(e){if(\"string\"!=typeof e)return null;const t=e.split(\":\").map(function(e){return parseFloat(e)});if(t.some(function(e){return isNaN(e)}))return null;switch(t.length){case 2:return new o(t[0],t[1]);case 3:return new o(t[0],t[2],t[1]);default:return null}},o.prototype.clone=function(){return new o(this.start,this.end,this.step)},o.prototype.size=function(){let e=0;var t=this.start,r=this.step,t=this.end-t;return ke(r)===ke(t)?e=Math.ceil(t/r):0==t&&(e=0),[e=isNaN(e)?0:e]},o.prototype.min=function(){var e=this.size()[0];return 0n;)e(t,[i],this),t+=r,i++},o.prototype.map=function(n){const i=[];return this.forEach(function(e,t,r){i[t[0]]=n(e,t,r)}),i},o.prototype.toArray=function(){const r=[];return this.forEach(function(e,t){r[t[0]]=e}),r},o.prototype.valueOf=function(){return this.toArray()},o.prototype.format=function(e){let t=He(this.start,e);return 1!==this.step&&(t+=\":\"+He(this.step,e)),t+=\":\"+He(this.end,e)},o.prototype.toString=function(){return this.format()},o.prototype.toJSON=function(){return{mathjs:\"Range\",start:this.start,end:this.end,step:this.step}},o.fromJSON=function(e){return new o(e.start,e.end,e.step)},o},{isClass:!0}),dn=s(\"Matrix\",[],()=>{function e(){if(!(this instanceof e))throw new SyntaxError(\"Constructor must be called with the new operator\")}return e.prototype.type=\"Matrix\",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error(\"Cannot invoke storage on a Matrix interface\")},e.prototype.datatype=function(){throw new Error(\"Cannot invoke datatype on a Matrix interface\")},e.prototype.create=function(e,t){throw new Error(\"Cannot invoke create on a Matrix interface\")},e.prototype.subset=function(e,t,r){throw new Error(\"Cannot invoke subset on a Matrix interface\")},e.prototype.get=function(e){throw new Error(\"Cannot invoke get on a Matrix interface\")},e.prototype.set=function(e,t,r){throw new Error(\"Cannot invoke set on a Matrix interface\")},e.prototype.resize=function(e,t){throw new Error(\"Cannot invoke resize on a Matrix interface\")},e.prototype.reshape=function(e,t){throw new Error(\"Cannot invoke reshape on a Matrix interface\")},e.prototype.clone=function(){throw new Error(\"Cannot invoke clone on a Matrix interface\")},e.prototype.size=function(){throw new Error(\"Cannot invoke size on a Matrix interface\")},e.prototype.map=function(e,t){throw new Error(\"Cannot invoke map on a Matrix interface\")},e.prototype.forEach=function(e){throw new Error(\"Cannot invoke forEach on a Matrix interface\")},e.prototype[Symbol.iterator]=function(){throw new Error(\"Cannot iterate a Matrix interface\")},e.prototype.toArray=function(){throw new Error(\"Cannot invoke toArray on a Matrix interface\")},e.prototype.valueOf=function(){throw new Error(\"Cannot invoke valueOf on a Matrix interface\")},e.prototype.format=function(e){throw new Error(\"Cannot invoke format on a Matrix interface\")},e.prototype.toString=function(){throw new Error(\"Cannot invoke toString on a Matrix interface\")},e},{isClass:!0});function gn(){return(gn=Object.assign?Object.assign.bind():function(e){for(var t=1;tvn(e)+\": \"+S(t[e],r)).join(\", \")+\"}\":String(t);{var n=t,i=r;if(\"function\"==typeof i)return i(n);if(!n.isFinite())return n.isNaN()?\"NaN\":n.gt(0)?\"Infinity\":\"-Infinity\";const{notation:s,precision:u,wordSize:l}=Ge(i);switch(s){case\"fixed\":return n.toFixed(u);case\"exponential\":return xn(n,u);case\"engineering\":{var a=n;var o=u;const c=a.e,f=c%3==0?c:c<0?c-3-c%3:c-c%3;let e=a.mul(Math.pow(10,-f)).toPrecision(o);return(e=e.includes(\"e\")?new a.constructor(e).toFixed():e)+\"e\"+(0<=c?\"+\":\"\")+f.toString();return}case\"bin\":return yn(n,2,l);case\"oct\":return yn(n,8,l);case\"hex\":return yn(n,16,l);case\"auto\":{const s=bn(null==i?void 0:i.lowerExp,-3),l=bn(null==i?void 0:i.upperExp,5);if(n.isZero())return\"0\";let e;const p=n.toSignificantDigits(u),m=p.e;return(e=m>=s&&mt.truncate?r.substring(0,t.truncate-3)+\"...\":r}function vn(e){const t=String(e);let r=\"\",n=0;for(;n/g,\">\")}function An(e,t){if(!j(e))throw new TypeError(\"Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: \"+K(e)+\", index: 0)\");if(j(t))return e===t?0:t=this.max?this.message=\"Index out of range (\"+this.index+\" > \"+(this.max-1)+\")\":this.message=\"Index out of range (\"+this.index+\")\",this.stack=(new Error).stack}function T(e){const t=[];for(;Array.isArray(e);)t.push(e.length),e=e[0];return t}function Sn(e,t){if(0===t.length){if(Array.isArray(e))throw new z(e.length,0)}else!function e(t,r,n){let i;var a=t.length;if(a!==r[n])throw new z(a,r[n]);if(n\")}(e,t,0)}function Mn(e,t){const r=e.isMatrix?e._size:T(e);t._sourceSize.forEach((e,t)=>{if(null!==e&&e!==r[t])throw new z(e,r[t])})}function M(e,t){if(void 0!==e){if(!A(e)||!v(e))throw new TypeError(\"Index must be an integer (value: \"+e+\")\");if(e<0||\"number\"==typeof t&&t<=e)throw new En(e,t)}}function Cn(t){for(let e=0;ee*t,1)}function On(e,t){const r=t||T(e);for(;Array.isArray(e)&&1===e.length;)e=e[0],r.shift();let n=r.length;for(;1===r[n-1];)n--;return nt.test(e))}function Rn(e,t){return Array.prototype.join.call(e,t)}function Pn(t){if(!Array.isArray(t))throw new TypeError(\"Array input expected\");if(0===t.length)return t;const r=[];let n=0;r[0]={value:t[0],identifier:0};for(let e=1;ee.length),i=Math.max(...n),a=new Array(i).fill(null);for(let e=0;ea[t]&&(a[t]=r[e])}}for(let e=0;er[a])throw new Error(`shape mismatch: mismatch is found in arg with shape (${t}) not possible to broadcast dimension ${i} with size ${t[e]} to size `+r[a])}}function Gn(e,t){let r=T(e);if(De(r,t))return e;Hn(r,t);var n,i,a,o=$n(r,t),s=o.length,t=[...Array(s-r.length).fill(1),...r];let u=gn([],e);r.lengthe[t],e)}function Zn(i,a,e){if(0===i.length)return[];if(20),t=o.isMatrix?o.get(s):Vn(o,s);n=function(t,e,r){const n=[e,r,o];for(let e=3;0{let[t,r]=e;t.split(\",\").length===n&&i.push(r)}),1===i.length)return i[0]}(a,n);i=void 0!==l?l:a}else i=a;return 1<=n&&n<=3?{isUnary:1===n,fn:function(){for(var e=arguments.length,t=new Array(e),r=0;r{let t=e[\"Matrix\"];function g(e,t){if(!(this instanceof g))throw new SyntaxError(\"Constructor must be called with the new operator\");if(t&&!j(t))throw new Error(\"Invalid datatype: \"+t);if(_(e))\"DenseMatrix\"===e.type?(this._data=ee(e._data),this._size=ee(e._size)):(this._data=e.toArray(),this._size=e.size()),this._datatype=t||e._datatype;else if(e&&b(e.data)&&b(e.size))this._data=e.data,this._size=e.size,Sn(this._data,this._size),this._datatype=t||e.datatype;else if(b(e))this._data=r(e),this._size=T(this._data),Sn(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError(\"Unsupported type of data (\"+K(e)+\")\");this._data=[],this._size=[0],this._datatype=t}}function a(t,e,r){if(0!==e.length)return t._size=e.slice(0),t._data=Tn(t._data,t._size,r),t;{let e=t._data;for(;b(e);)e=e[0];return e}}function y(e,r,t){const n=e._size.slice(0);let i=!1;for(;n.lengthn[e]&&(n[e]=r[e],i=!0);i&&a(e,n,t)}function r(e){return _(e)?r(e.valueOf()):b(e)?e.map(r):e}return(g.prototype=new t).createDenseMatrix=function(e,t){return new g(e,t)},Object.defineProperty(g,\"name\",{value:\"DenseMatrix\"}),(g.prototype.constructor=g).prototype.type=\"DenseMatrix\",g.prototype.isDenseMatrix=!0,g.prototype.getDataType=function(){return jn(this._data,K)},g.prototype.storage=function(){return\"dense\"},g.prototype.datatype=function(){return this._datatype},g.prototype.create=function(e,t){return new g(e,t)},g.prototype.subset=function(e,t,n){switch(arguments.length){case 1:var r=this,i=e;if(!Z(i))throw new TypeError(\"Invalid index\");if(i.isScalar())return r.get(i.min());{var a=i.size();if(a.length!==r._size.length)throw new z(a.length,r._size.length);var o=i.min(),s=i.max();for(let e=0,t=r._size.length;e(M(e,r.length),t(r[e],n+1))):e.map(e=>(M(e,r.length),r[e]))).valueOf()}(e),size:o}}(r._data,i);return m._size=h.size,m._datatype=r._datatype,m._data=h.data,m}case 2:case 3:{var u=this;a=e;i=t;var l=n;if(!a||!0!==a.isIndex)throw new TypeError(\"Invalid index\");var c=a.size(),f=a.isScalar();let r;if(_(i)?(r=i.size(),i=i.valueOf()):r=T(i),f){if(0!==r.length)throw new TypeError(\"Scalar expected\");u.set(a.min(),i,l)}else{if(!De(r,c))try{r=T(i=0===r.length?Gn([i],c):Gn(i,c))}catch(u){}if(c.length\");y(u,a.max().map(function(e){return e+1}),l);{f=u._data;var p=a;l=i;const d=p.size().length-1;!function r(n,i){let a=2{M(e,n.length),r(n[e],i[t[0]],a+1)}):e.forEach((e,t)=>{M(e,n.length),n[e]=i[t[0]]})}(f,l)}}return u;return}default:throw new SyntaxError(\"Wrong number of arguments\")}},g.prototype.get=function(e){return Vn(this._data,e)},g.prototype.set=function(e,t,r){if(!b(e))throw new TypeError(\"Array expected\");if(e.lengthArray.isArray(e)&&1===e.length?e[0]:e);return a(r?this.clone():this,e,t)},g.prototype.reshape=function(e,t){const r=t?this.clone():this;r._data=Bn(r._data,e);t=r._size.reduce((e,t)=>e*t);return r._size=Fn(e,t),r},g.prototype.clone=function(){return new g({data:ee(this._data),size:ee(this._size),datatype:this._datatype})},g.prototype.size=function(){return this._size.slice(0)},g.prototype.map=function(t){let r=2e*t,1);for(let e=0;e[e[t]]);e.push(new g(r,this._datatype))}return e},g.prototype.toArray=function(){return ee(this._data)},g.prototype.valueOf=function(){return this._data},g.prototype.format=function(e){return S(this._data,e)},g.prototype.toString=function(){return S(this._data)},g.prototype.toJSON=function(){return{mathjs:\"DenseMatrix\",data:this._data,size:this._size,datatype:this._datatype}},g.prototype.diagonal=function(e){if(e){if(!A(e=Q(e)?e.toNumber():e)||!v(e))throw new TypeError(\"The parameter k must be an integer number\")}else e=0;const t=0{let t=e[\"typed\"];return t(\"clone\",{any:ee})});function Kn(e){const t=e.length,r=e[0].length;let n,i;const a=[];for(i=0;it(e),!1,!0):Wn(e,t,!0)}function le(e,t,r){if(!r)return _(e)?e.map(e=>t(e),!1,!0):Zn(e,t,!0);const n=e=>0===e?e:t(e);return _(e)?e.map(e=>n(e),!1,!0):Zn(e,n,!0)}function ri(e,t,r){var n=Array.isArray(e)?T(e):e.size();if(t<0||t>=n.length)throw new En(t,n.length);return _(e)?e.create(ni(e.valueOf(),t,r),e.datatype()):ni(e,t,r)}function ni(e,t,r){let n,i,a,o;if(t<=0){if(Array.isArray(e[0])){for(o=Kn(e),i=[],n=0;n{let t=e[\"typed\"];return t(ai,{number:v,BigNumber:function(e){return e.isInt()},bigint:function(e){return!0},Fraction:function(e){return 1n===e.d},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),si=\"number\";function ui(e){return Number.isNaN(e)}function li(e,t,r,n){r=2{let{typed:r,config:t}=e;return r(ci,{number:e=>!Xe(e,0,t.relTol,t.absTol)&&e<0,BigNumber:e=>!li(e,new e.constructor(0),t.relTol,t.absTol)&&e.isNeg()&&!e.isZero()&&!e.isNaN(),bigint:e=>e<0n,Fraction:e=>e.s<0n,Unit:r.referToSelf(t=>e=>r.find(t,e.valueType())(e.value)),\"Array | Matrix\":r.referToSelf(t=>e=>le(e,t))})}),pi=\"isNumeric\",mi=s(pi,[\"typed\"],e=>{let t=e[\"typed\"];return t(pi,{\"number | BigNumber | bigint | Fraction | boolean\":()=>!0,\"Complex | Unit | string | null | undefined | Node\":()=>!1,\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),hi=\"hasNumericValue\",di=s(hi,[\"typed\",\"isNumeric\"],e=>{let{typed:t,isNumeric:r}=e;return t(hi,{boolean:()=>!0,string:function(e){return 0{let{typed:r,config:t}=e;return r(gi,{number:e=>!Xe(e,0,t.relTol,t.absTol)&&0!(li(e,new e.constructor(0),t.relTol,t.absTol)||e.isNeg()||e.isZero()||e.isNaN()),bigint:e=>0n0ne=>r.find(t,e.valueType())(e.value)),\"Array | Matrix\":r.referToSelf(t=>e=>le(e,t))})}),xi=s(\"isZero\",[\"typed\",\"equalScalar\"],e=>{let{typed:r,equalScalar:t}=e;return r(\"isZero\",{\"number | BigNumber | Complex | Fraction\":e=>t(e,0),bigint:e=>0n===e,Unit:r.referToSelf(t=>e=>r.find(t,e.valueType())(e.value)),\"Array | Matrix\":r.referToSelf(t=>e=>le(e,t))})}),bi=s(\"isNaN\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"isNaN\",{number:ui,BigNumber:function(e){return e.isNaN()},bigint:function(e){return!1},Fraction:function(e){return!1},Complex:function(e){return e.isNaN()},Unit:function(e){return Number.isNaN(e.value)},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),vi=s(\"typeOf\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"typeOf\",{any:K})}),wi=s(\"compareUnits\",[\"typed\"],e=>{let n=e[\"typed\"];return{\"Unit, Unit\":n.referToSelf(r=>(e,t)=>{if(e.equalBase(t))return n.find(r,[e.valueType(),t.valueType()])(e.value,t.value);throw new Error(\"Cannot compare units with different base\")})}}),Ni=\"equalScalar\",Ai=s(Ni,[\"typed\",\"config\"],e=>{let{typed:t,config:i}=e;e=wi({typed:t});return t(Ni,{\"boolean, boolean\":function(e,t){return e===t},\"number, number\":function(e,t){return Xe(e,t,i.relTol,i.absTol)},\"BigNumber, BigNumber\":function(e,t){return e.eq(t)||li(e,t,i.relTol,i.absTol)},\"bigint, bigint\":function(e,t){return e===t},\"Fraction, Fraction\":function(e,t){return e.equals(t)},\"Complex, Complex\":function(e,t){return e=e,t=t,r=i.relTol,n=i.absTol,Xe(e.re,t.re,r,n)&&Xe(e.im,t.im,r,n);var r,n}},e)}),Ei=(s(Ni,[\"typed\",\"config\"],e=>{let{typed:t,config:r}=e;return t(Ni,{\"number, number\":function(e,t){return Xe(e,t,r.relTol,r.absTol)}})}),s(\"SparseMatrix\",[\"typed\",\"equalScalar\",\"Matrix\"],e=>{let{typed:y,equalScalar:x,Matrix:t}=e;function E(e,t){if(!(this instanceof E))throw new SyntaxError(\"Constructor must be called with the new operator\");if(t&&!j(t))throw new Error(\"Invalid datatype: \"+t);if(_(e))r=this,i=t,\"SparseMatrix\"===(n=e).type?(r._values=n._values?ee(n._values):void 0,r._index=ee(n._index),r._ptr=ee(n._ptr),r._size=ee(n._size),r._datatype=i||n._datatype):a(r,n.valueOf(),i||n._datatype);else if(e&&b(e.index)&&b(e.ptr)&&b(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(b(e))a(this,e,t);else{if(e)throw new TypeError(\"Unsupported type of data (\"+K(e)+\")\");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}var r,n,i}function a(r,n,i){r._values=[],r._index=[],r._ptr=[],r._datatype=i;var a=n.length;let o=0,s=x,u=0;if(j(i)&&(s=y.find(x,[i,i])||x,u=y.convert(0,i)),0p){for(c=p;cn-1&&(r._values.splice(f,1),r._index.splice(f,1),e++)}r._ptr[c]=r._values.length}return r._size[0]=n,r._size[1]=t,r}function r(t,r,e,n,i){const a=n[0],o=n[1],s=[];let u,l;for(u=0;u\");if(1===n.length)o.dimension(0).forEach(function(e,t){M(e),c.set([e,0],f[t[0]],p)});else{const n=o.dimension(0),A=o.dimension(1);n.forEach(function(r,n){M(r),A.forEach(function(e,t){M(e),c.set([r,e],f[n[0]][t[0]],p)})})}}return c;return}default:throw new SyntaxError(\"Wrong number of arguments\")}},E.prototype.get=function(e){if(!b(e))throw new TypeError(\"Array expected\");if(e.length!==this._size.length)throw new z(e.length,this._size.length);if(!this._values)throw new Error(\"Cannot invoke get on a Pattern only matrix\");var t=e[0],e=e[1],r=(M(t,this._size[0]),M(e,this._size[1]),m(t,this._ptr[e],this._ptr[e+1],this._index));return ri-1||e>a-1)&&(d(this,Math.max(n+1,i),Math.max(e+1,a),r),i=this._size[0],a=this._size[1]),M(n,i),M(e,a);r=m(n,this._ptr[e],this._ptr[e+1],this._index);if(rArray.isArray(e)&&1===e.length?e[0]:e);if(2!==n.length)throw new Error(\"Only two dimensions matrix are supported\");return n.forEach(function(e){if(!A(e)||!v(e)||e<0)throw new TypeError(\"Invalid size, must contain positive integers (size: \"+S(n)+\")\")}),d(r?this.clone():this,n[0],n[1],t)},E.prototype.reshape=function(t,r){if(!b(t))throw new TypeError(\"Array expected\");if(2!==t.length)throw new Error(\"Sparse matrices can only be reshaped in two dimensions\");t.forEach(function(e){if(!A(e)||!v(e)||e<=-2||0===e)throw new TypeError(\"Invalid size, must contain positive integers or -1 (size: \"+S(t)+\")\")});const n=this._size[0]*this._size[1];if(n!==(t=Fn(t,n))[0]*t[1])throw new Error(\"Reshaping sparse matrix will result in the wrong number of elements\");const i=r?this.clone():this;if(this._size[0]===t[0]&&this._size[1]===t[1])return i;const a=[];for(let t=0;t \"+(this._values?S(this._values[e],r):\"X\")}return a},E.prototype.toString=function(){return S(this.toArray())},E.prototype.toJSON=function(){return{mathjs:\"SparseMatrix\",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},E.prototype.diagonal=function(e){if(e){if(!A(e=Q(e)?e.toNumber():e)||!v(e))throw new TypeError(\"The parameter k must be an integer number\")}else e=0;const r=0{let t=e[\"typed\"];const r=t(\"number\",{\"\":function(){return 0},number:function(e){return e},string:function(r){if(\"NaN\"===r)return NaN;var n=(e=(n=r).match(/(0[box])([0-9a-fA-F]*)\\.([0-9a-fA-F]*)/))?{input:n,radix:{\"0b\":2,\"0o\":8,\"0x\":16}[e[1]],integerPart:e[2],fractionalPart:e[3]}:null;if(n){var i=n,e=parseInt(i.integerPart,i.radix);let t=0;for(let e=0;e2**e-1)throw new SyntaxError(`String \"${r}\" is out of range`);t>=2**(e-1)&&(t-=2**e)}return t}},BigNumber:function(e){return e.toNumber()},bigint:function(e){return Number(e)},Fraction:function(e){return e.valueOf()},Unit:t.referToSelf(r=>e=>{const t=e.clone();return t.value=r(e.value),t}),null:function(e){return 0},\"Unit, string | Unit\":function(e,t){return e.toNumber(t)},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))});return r.fromJSON=function(e){return parseFloat(e.value)},r}),Mi=s(\"bigint\",[\"typed\"],e=>{let t=e[\"typed\"];const r=t(\"bigint\",{\"\":function(){return 0n},bigint:function(e){return e},number:function(e){return BigInt(e.toFixed())},BigNumber:function(e){return BigInt(e.round().toString())},Fraction:function(e){return BigInt(e.valueOf().toFixed())},\"string | boolean\":function(e){return BigInt(e)},null:function(e){return 0n},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))});return r.fromJSON=function(e){return BigInt(e.value)},r}),Ci=s(\"string\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"string\",{\"\":function(){return\"\"},number:He,null:function(e){return\"null\"},boolean:function(e){return e+\"\"},string:function(e){return e},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t)),any:function(e){return String(e)}})}),Ti=\"boolean\",Bi=s(Ti,[\"typed\"],e=>{let t=e[\"typed\"];return t(Ti,{\"\":function(){return!1},boolean:function(e){return e},number:function(e){return!!e},null:function(e){return!1},BigNumber:function(e){return!e.isZero()},string:function(e){var t=e.toLowerCase();if(\"true\"===t)return!0;if(\"false\"===t)return!1;t=Number(e);if(\"\"===e||isNaN(t))throw new Error('Cannot convert \"'+e+'\" to a boolean');return!!t},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Fi=s(\"bignumber\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:a}=e;return t(\"bignumber\",{\"\":function(){return new a(0)},number:function(e){return new a(e+\"\")},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){const r=t[2],n=a(t[1]),i=new a(2).pow(Number(r));if(n.gt(i.sub(1)))throw new SyntaxError(`String \"${e}\" is out of range`);t=new a(2).pow(Number(r)-1);return n.gte(t)?n.sub(i):n}return new a(e)},BigNumber:function(e){return e},bigint:function(e){return new a(e.toString())},Unit:t.referToSelf(r=>e=>{const t=e.clone();return t.value=r(e.value),t}),Fraction:function(e){return new a(String(e.n)).div(String(e.d)).times(String(e.s))},null:function(e){return new a(0)},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Di=s(\"complex\",[\"typed\",\"Complex\"],e=>{let{typed:t,Complex:r}=e;return t(\"complex\",{\"\":function(){return r.ZERO},number:function(e){return new r(e,0)},\"number, number\":function(e,t){return new r(e,t)},\"BigNumber, BigNumber\":function(e,t){return new r(e.toNumber(),t.toNumber())},Fraction:function(e){return new r(e.valueOf(),0)},Complex:function(e){return e.clone()},string:function(e){return r(e)},null:function(e){return r(0)},Object:function(e){if(\"re\"in e&&\"im\"in e)return new r(e.re,e.im);if(\"r\"in e&&\"phi\"in e||\"abs\"in e&&\"arg\"in e)return new r(e);throw new Error(\"Expected object with properties (re and im) or (r and phi) or (abs and arg)\")},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Oi=s(\"fraction\",[\"typed\",\"Fraction\"],e=>{let{typed:t,Fraction:r}=e;return t(\"fraction\",{number:function(e){if(!isFinite(e)||isNaN(e))throw new Error(e+\" cannot be represented as a fraction\");return new r(e)},string:function(e){return new r(e)},\"number, number\":function(e,t){return new r(e,t)},\"bigint, bigint\":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},bigint:function(e){return new r(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf(r=>e=>{const t=e.clone();return t.value=r(e.value),t}),Object:function(e){return new r(e)},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),_i=s(\"matrix\",[\"typed\",\"Matrix\",\"DenseMatrix\",\"SparseMatrix\"],e=>{let{typed:t,DenseMatrix:n,SparseMatrix:i}=e;return t(\"matrix\",{\"\":function(){return r([])},string:function(e){return r([],e)},\"string, string\":function(e,t){return r([],e,t)},Array:function(e){return r(e)},Matrix:function(e){return r(e,e.storage())},\"Array | Matrix, string\":r,\"Array | Matrix, string, string\":r});function r(e,t,r){if(\"dense\"===t||\"default\"===t||void 0===t)return new n(e,r);if(\"sparse\"===t)return new i(e,r);throw new TypeError(\"Unknown matrix type \"+JSON.stringify(t)+\".\")}}),zi=\"matrixFromFunction\",qi=s(zi,[\"typed\",\"matrix\",\"isZero\"],e=>{let{typed:t,matrix:a,isZero:o}=e;return t(zi,{\"Array | Matrix, function, string, string\":i,\"Array | Matrix, function, string\":function(e,t,r){return i(e,t,r)},\"Matrix, function\":function(e,t){return i(e,t,\"dense\")},\"Array, function\":function(e,t){return i(e,t,\"dense\").toArray()},\"Array | Matrix, string, function\":function(e,t,r){return i(e,r,t)},\"Array | Matrix, string, string, function\":function(e,t,r,n){return i(e,n,t,r)}});function i(e,n,t,r){let i;return(i=void 0!==r?a(t,r):a(t)).resize(e),i.forEach(function(e,t){var r=n(t);o(r)||i.set(t,r)}),i}}),Ii=\"matrixFromRows\",ki=s(Ii,[\"typed\",\"matrix\",\"flatten\",\"size\"],e=>{let{typed:t,matrix:r,flatten:i,size:n}=e;return t(Ii,{\"...Array\":a,\"...Matrix\":function(e){return r(a(e.map(e=>e.toArray())))}});function a(e){if(0===e.length)throw new TypeError(\"At least one row is needed to construct a matrix.\");const t=o(e[0]),r=[];for(const n of e){const e=o(n);if(e!==t)throw new TypeError(\"The vectors had different length: \"+(0|t)+\" \u2260 \"+(0|e));r.push(i(n))}return r}function o(e){e=n(e);if(1===e.length)return e[0];if(2!==e.length)throw new TypeError(\"Only one- or two-dimensional vectors are supported.\");if(1===e[0])return e[1];if(1===e[1])return e[0];throw new TypeError(\"At least one of the arguments is not a vector.\")}}),Ri=\"matrixFromColumns\",Pi=s(Ri,[\"typed\",\"matrix\",\"flatten\",\"size\"],e=>{let{typed:t,matrix:r,flatten:a,size:n}=e;return t(Ri,{\"...Array\":i,\"...Matrix\":function(e){return r(i(e.map(e=>e.toArray())))}});function i(e){if(0===e.length)throw new TypeError(\"At least one column is needed to construct a matrix.\");const t=o(e[0]),r=[];for(let e=0;e{let t=e[\"typed\"];return t(Ui,{\"Unit, Array\":function(e,t){return e.splitUnit(t)}})}),Li=\"number\",$i=\"number, number\";function Hi(e){return Math.abs(e)}function Gi(e,t){return e+t}function Vi(e,t){return e-t}function Zi(e,t){return e*t}function Wi(e){return-e}function Yi(e){return e}function Ji(e){return je(e)}function Xi(e){return e*e*e}function Qi(e){return Math.exp(e)}function Ki(e){return Le(e)}function ea(e,t){if(!v(e)||!v(t))throw new Error(\"Parameters in function lcm must be integer numbers\");if(0===e||0===t)return 0;for(var r,n=e*t;0!==t;)t=e%(r=t),e=r;return Math.abs(n/e)}function ta(e,t){return t?Math.log(e)/Math.log(t):Math.log(e)}function ra(e){return Pe(e)}function na(e){return Re(e)}function ia(e){let t=1{let n=e[\"typed\"];return n(ca,{number:Wi,\"Complex | BigNumber | Fraction\":e=>e.neg(),bigint:e=>-e,Unit:n.referToSelf(r=>e=>{const t=e.clone();return t.value=n.find(r,t.valueType())(e.value),t}),\"Array | Matrix\":n.referToSelf(t=>e=>le(e,t,!0))})}),pa=\"unaryPlus\",ma=s(pa,[\"typed\",\"config\",\"numeric\"],e=>{let{typed:t,config:r,numeric:n}=e;return t(pa,{number:Yi,Complex:function(e){return e},BigNumber:function(e){return e},bigint:function(e){return e},Fraction:function(e){return e},Unit:function(e){return e.clone()},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0)),boolean:function(e){return n(e?1:0,r.number)},string:function(e){return n(e,Ie(e,r))}})}),ha=s(\"abs\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"abs\",{number:Hi,\"Complex | BigNumber | Fraction | Unit\":e=>e.abs(),bigint:e=>e<0n?-e:e,\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0))})}),da=\"mapSlices\",ga=s(da,[\"typed\",\"isInteger\"],e=>{let{typed:t,isInteger:i}=e;return t(da,{\"Array | Matrix, number | BigNumber, function\":function(e,t,r){if(!i(t))throw new TypeError(\"Integer number expected for dimension\");var n=Array.isArray(e)?T(e):e.size();if(t<0||t>=n.length)throw new En(t,n.length);return _(e)?e.create(ya(e.valueOf(),t,r),e.datatype()):ya(e,t,r)}})},{formerly:\"apply\"});function ya(e,t,r){let n,i,a;if(t<=0){if(Array.isArray(e[0])){for(a=function(e){const t=e.length,r=e[0].length;let n,i;const a=[];for(i=0;i{let i=e[\"typed\"];return i(xa,{\"number, number\":Gi,\"Complex, Complex\":function(e,t){return e.add(t)},\"BigNumber, BigNumber\":function(e,t){return e.plus(t)},\"bigint, bigint\":function(e,t){return e+t},\"Fraction, Fraction\":function(e,t){return e.add(t)},\"Unit, Unit\":i.referToSelf(n=>(e,t)=>{if(null===e.value||void 0===e.value)throw new Error(\"Parameter x contains a unit with undefined value\");if(null===t.value||void 0===t.value)throw new Error(\"Parameter y contains a unit with undefined value\");if(!e.equalBase(t))throw new Error(\"Units do not match\");const r=e.clone();return r.value=i.find(n,[r.valueType(),t.valueType()])(r.value,t.value),r.fixPrefix=!1,r})})}),va=\"subtractScalar\",wa=s(va,[\"typed\"],e=>{let i=e[\"typed\"];return i(va,{\"number, number\":Vi,\"Complex, Complex\":function(e,t){return e.sub(t)},\"BigNumber, BigNumber\":function(e,t){return e.minus(t)},\"bigint, bigint\":function(e,t){return e-t},\"Fraction, Fraction\":function(e,t){return e.sub(t)},\"Unit, Unit\":i.referToSelf(n=>(e,t)=>{if(null===e.value||void 0===e.value)throw new Error(\"Parameter x contains a unit with undefined value\");if(null===t.value||void 0===t.value)throw new Error(\"Parameter y contains a unit with undefined value\");if(!e.equalBase(t))throw new Error(\"Units do not match\");const r=e.clone();return r.value=i.find(n,[r.valueType(),t.valueType()])(r.value,t.value),r.fixPrefix=!1,r})})}),Na=s(\"cbrt\",[\"config\",\"typed\",\"isNegative\",\"unaryMinus\",\"matrix\",\"Complex\",\"BigNumber\",\"Fraction\"],e=>{let{config:a,typed:t,isNegative:i,unaryMinus:o,matrix:s,Complex:u,BigNumber:l,Fraction:c}=e;return t(\"cbrt\",{number:Ji,Complex:f,\"Complex, boolean\":f,BigNumber:function(e){return e.cbrt()},Unit:function(t){if(t.value&&te(t.value)){let e=t.clone();return e.value=1,(e=e.pow(1/3)).value=f(t.value),e}{var e,r=i(t.value);r&&(t.value=o(t.value)),e=Q(t.value)?new l(1).div(3):re(t.value)?new c(1,3):1/3;const n=t.pow(e);return r&&(n.value=o(n.value)),n}}});function f(e,t){var r=e.arg()/3,n=e.abs(),i=new u(Ji(n),0).mul(new u(0,r).exp());if(t){const e=[i,new u(Ji(n),0).mul(new u(0,r+2*Math.PI/3).exp()),new u(Ji(n),0).mul(new u(0,r-2*Math.PI/3).exp())];return\"Array\"===a.matrix?e:s(e)}return i}}),Aa=s(\"matAlgo11xS0s\",[\"typed\",\"equalScalar\"],e=>{let{typed:x,equalScalar:b}=e;return function(i,a,e,o){var s=i._values,u=i._index,l=i._ptr,t=i._size,r=i._datatype;if(!s)throw new Error(\"Cannot perform operation on Pattern Sparse Matrix and Scalar value\");var n=t[0],c=t[1];let f,p=b,m=0,h=e;\"string\"==typeof r&&(f=r,p=x.find(b,[f,f]),m=x.convert(0,f),a=x.convert(a,f),h=x.find(e,[f,f]));const d=[],g=[],y=[];for(let n=0;n{let{typed:d,DenseMatrix:g}=e;return function(i,t,e,r){var a=i._values,o=i._index,s=i._ptr,n=i._size,i=i._datatype;if(!a)throw new Error(\"Cannot perform operation on Pattern Sparse Matrix and Scalar value\");var u=n[0],l=n[1];let c,f=e;\"string\"==typeof i&&(c=i,t=d.convert(t,c),f=d.find(e,[c,c]));const p=[],m=[],h=[];for(let n=0;n{let l=e[\"typed\"];return function(e,t,r,n){var i=e._data,a=e._size,o=e._datatype;let s,u=r;\"string\"==typeof o&&(s=o,t=l.convert(t,s),u=l.find(r,[s,s]));o=0{let{typed:t,config:n,round:i}=e;function r(e){var t=Math.ceil(e),r=i(e);return t!==r&&Xe(e,r,n.relTol,n.absTol)&&!Xe(e,t,n.relTol,n.absTol)?r:t}return t(Sa,{number:r,\"number, number\":function(e,t){if(!v(t))throw new RangeError(\"number of decimals in function ceil must be an integer\");if(t<0||15{let{typed:t,config:i,round:a,matrix:n,equalScalar:o,zeros:s,DenseMatrix:r}=e;const u=Aa({typed:t,equalScalar:o}),l=x({typed:t,DenseMatrix:r}),c=Ea({typed:t}),f=Ca({typed:t,config:i,round:a});function p(e){const t=(e,t)=>li(e,t,i.relTol,i.absTol),r=e.ceil(),n=a(e);return!r.eq(n)&&t(e,n)&&!t(e,r)?n:r}return t(\"ceil\",{number:f.signatures.number,\"number,number\":f.signatures[\"number,number\"],Complex:function(e){return e.ceil()},\"Complex, number\":function(e,t){return e.ceil(t)},\"Complex, BigNumber\":function(e,t){return e.ceil(t.toNumber())},BigNumber:p,\"BigNumber, BigNumber\":function(e,t){t=Ma.pow(t);return p(e.mul(t)).div(t)},bigint:e=>e,\"bigint, number\":(e,t)=>e,\"bigint, BigNumber\":(e,t)=>e,Fraction:function(e){return e.ceil()},\"Fraction, number\":function(e,t){return e.ceil(t)},\"Fraction, BigNumber\":function(e,t){return e.ceil(t.toNumber())},\"Unit, number, Unit\":t.referToSelf(n=>function(e,t,r){e=e.toNumeric(r);return r.multiply(n(e,t))}),\"Unit, BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>n(e,t.toNumber(),r)),\"Array | Matrix, number | BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>le(e,e=>n(e,t,r),!0)),\"Array | Matrix | Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e,0,t)),\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0)),\"Array, number | BigNumber\":t.referToSelf(r=>(e,t)=>le(e,e=>r(e,t),!0)),\"SparseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>u(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>c(e,t,r,!1)),\"number | Complex | Fraction | BigNumber, Array\":t.referToSelf(r=>(e,t)=>c(n(t),e,r,!0).valueOf()),\"number | Complex | Fraction | BigNumber, Matrix\":t.referToSelf(r=>(e,t)=>o(e,0)?s(t.size(),t.storage()):(\"dense\"===t.storage()?c:l)(t,e,r,!0))})}),Ba=s(\"cube\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"cube\",{number:Xi,Complex:function(e){return e.mul(e).mul(e)},BigNumber:function(e){return e.times(e).times(e)},bigint:function(e){return e*e*e},Fraction:function(e){return e.pow(3)},Unit:function(e){return e.pow(3)}})}),Fa=s(\"exp\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"exp\",{number:Qi,Complex:function(e){return e.exp()},BigNumber:function(e){return e.exp()}})}),Da=s(\"expm1\",[\"typed\",\"Complex\"],e=>{let{typed:t,Complex:r}=e;return t(\"expm1\",{number:Ki,Complex:function(e){var t=Math.exp(e.re);return new r(t*Math.cos(e.im)-1,t*Math.sin(e.im))},BigNumber:function(e){return e.exp().minus(1)}})}),Oa=s(\"fix\",[\"typed\",\"ceil\",\"floor\"],e=>{let{typed:t,ceil:r,floor:n}=e;return t(\"fix\",{number:function(e){return(0{let{typed:t,Complex:r,matrix:n,ceil:i,floor:a,equalScalar:o,zeros:s,DenseMatrix:u}=e;const l=x({typed:t,DenseMatrix:u}),c=Ea({typed:t}),f=Oa({typed:t,ceil:i,floor:a});return t(\"fix\",{number:f.signatures.number,\"number, number | BigNumber\":f.signatures[\"number,number\"],Complex:function(e){return new r(0e,\"bigint, number\":(e,t)=>e,\"bigint, BigNumber\":(e,t)=>e,Fraction:function(e){return e.s<0n?e.ceil():e.floor()},\"Fraction, number | BigNumber\":function(e,t){return(e.s<0n?i:a)(e,t)},\"Unit, number, Unit\":t.referToSelf(n=>function(e,t,r){e=e.toNumeric(r);return r.multiply(n(e,t))}),\"Unit, BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>n(e,t.toNumber(),r)),\"Array | Matrix, number | BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>le(e,e=>n(e,t,r),!0)),\"Array | Matrix | Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e,0,t)),\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0)),\"Array | Matrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>le(e,e=>r(e,t),!0)),\"number | Complex | Fraction | BigNumber, Array\":t.referToSelf(r=>(e,t)=>c(n(t),e,r,!0).valueOf()),\"number | Complex | Fraction | BigNumber, Matrix\":t.referToSelf(r=>(e,t)=>o(e,0)?s(t.size(),t.storage()):(\"dense\"===t.storage()?c:l)(t,e,r,!0))})}),za=\"floor\",qa=new Vr(10),Ia=s(za,[\"typed\",\"config\",\"round\"],e=>{let{typed:t,config:n,round:i}=e;function r(e){var t=Math.floor(e),r=i(e);return t!==r&&Xe(e,r,n.relTol,n.absTol)&&!Xe(e,t,n.relTol,n.absTol)?r:t}return t(za,{number:r,\"number, number\":function(e,t){if(!v(t))throw new RangeError(\"number of decimals in function floor must be an integer\");if(t<0||15{let{typed:t,config:i,round:a,matrix:n,equalScalar:o,zeros:s,DenseMatrix:r}=e;const u=Aa({typed:t,equalScalar:o}),l=x({typed:t,DenseMatrix:r}),c=Ea({typed:t}),f=Ia({typed:t,config:i,round:a});function p(e){const t=(e,t)=>li(e,t,i.relTol,i.absTol),r=e.floor(),n=a(e);return!r.eq(n)&&t(e,n)&&!t(e,r)?n:r}return t(\"floor\",{number:f.signatures.number,\"number,number\":f.signatures[\"number,number\"],Complex:function(e){return e.floor()},\"Complex, number\":function(e,t){return e.floor(t)},\"Complex, BigNumber\":function(e,t){return e.floor(t.toNumber())},BigNumber:p,\"BigNumber, BigNumber\":function(e,t){t=qa.pow(t);return p(e.mul(t)).div(t)},bigint:e=>e,\"bigint, number\":(e,t)=>e,\"bigint, BigNumber\":(e,t)=>e,Fraction:function(e){return e.floor()},\"Fraction, number\":function(e,t){return e.floor(t)},\"Fraction, BigNumber\":function(e,t){return e.floor(t.toNumber())},\"Unit, number, Unit\":t.referToSelf(n=>function(e,t,r){e=e.toNumeric(r);return r.multiply(n(e,t))}),\"Unit, BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>n(e,t.toNumber(),r)),\"Array | Matrix, number | BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>le(e,e=>n(e,t,r),!0)),\"Array | Matrix | Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e,0,t)),\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0)),\"Array, number | BigNumber\":t.referToSelf(r=>(e,t)=>le(e,e=>r(e,t),!0)),\"SparseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>u(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>c(e,t,r,!1)),\"number | Complex | Fraction | BigNumber, Array\":t.referToSelf(r=>(e,t)=>c(n(t),e,r,!0).valueOf()),\"number | Complex | Fraction | BigNumber, Matrix\":t.referToSelf(r=>(e,t)=>o(e,0)?s(t.size(),t.storage()):(\"dense\"===t.storage()?c:l)(t,e,r,!0))})}),Ra=s(\"matAlgo02xDS0\",[\"typed\",\"equalScalar\"],e=>{let{typed:v,equalScalar:w}=e;return function(e,t,r,i){var a=e._data,n=e._size,o=e._datatype||e.getDataType(),s=t._values,u=t._index,l=t._ptr,c=t._size,f=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(n.length!==c.length)throw new z(n.length,c.length);if(n[0]!==c[0]||n[1]!==c[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+n+\") must match Matrix B (\"+c+\")\");if(!s)throw new Error(\"Cannot perform operation on Dense Matrix and Pattern Sparse Matrix\");var c=n[0],p=n[1];let m,h=w,d=0,g=r;\"string\"==typeof o&&o===f&&\"mixed\"!==o&&(m=o,h=v.find(w,[m,m]),d=v.convert(0,m),g=v.find(r,[m,m]));const y=[],x=[],b=[];for(let n=0;n{let v=e[\"typed\"];return function(e,i,t,a){var o=e._data,r=e._size,n=e._datatype||e.getDataType(),s=i._values,u=i._index,l=i._ptr,c=i._size,f=i._datatype||void 0===i._data?i._datatype:i.getDataType();if(r.length!==c.length)throw new z(r.length,c.length);if(r[0]!==c[0]||r[1]!==c[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+r+\") must match Matrix B (\"+c+\")\");if(!s)throw new Error(\"Cannot perform operation on Dense Matrix and Pattern Sparse Matrix\");var p=r[0],m=r[1];let h,d=0,g=t;\"string\"==typeof n&&n===f&&\"mixed\"!==n&&(h=n,d=v.convert(0,h),g=v.find(t,[h,h]));const y=[];for(let e=0;e{let{typed:B,equalScalar:F}=e;return function(e,t,r){var n=e._values,i=e._index,a=e._ptr,o=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=t._values,l=t._index,c=t._ptr,f=t._size,p=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(o.length!==f.length)throw new z(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+o+\") must match Matrix B (\"+f+\")\");var f=o[0],m=o[1];let h,d=F,g=0,y=r;\"string\"==typeof s&&s===p&&\"mixed\"!==s&&(h=s,d=B.find(F,[h,h]),g=B.convert(0,h),y=B.find(r,[h,h]));const x=n&&u?[]:void 0,b=[],v=[],w=x?[]:void 0,N=x?[]:void 0,A=[],E=[];let S,M,C,T;for(M=0;M{let p=e[\"typed\"];return function(e,t,r){const n=e._data,i=e._size,a=e._datatype,o=t._data,s=t._size,u=t._datatype,l=[];if(i.length!==s.length)throw new z(i.length,s.length);for(let e=0;e{var t=r;return De(e.size(),t)?e:e.create(Gn(e.valueOf(),t),e.datatype())})}const C=s(\"matrixAlgorithmSuite\",[\"typed\",\"matrix\"],e=>{let{typed:o,matrix:s}=e;const u=ja({typed:o}),l=Ea({typed:o});return function(n){const r=n.elop,i=n.SD||n.DS;let e;r?(e={\"DenseMatrix, DenseMatrix\":(e,t)=>u(...La(e,t),r),\"Array, Array\":(e,t)=>u(...La(s(e),s(t)),r).valueOf(),\"Array, DenseMatrix\":(e,t)=>u(...La(s(e),t),r),\"DenseMatrix, Array\":(e,t)=>u(...La(e,s(t)),r)},n.SS&&(e[\"SparseMatrix, SparseMatrix\"]=(e,t)=>n.SS(...La(e,t),r,!1)),n.DS&&(e[\"DenseMatrix, SparseMatrix\"]=(e,t)=>n.DS(...La(e,t),r,!1),e[\"Array, SparseMatrix\"]=(e,t)=>n.DS(...La(s(e),t),r,!1)),i&&(e[\"SparseMatrix, DenseMatrix\"]=(e,t)=>i(...La(t,e),r,!0),e[\"SparseMatrix, Array\"]=(e,t)=>i(...La(s(t),e),r,!0))):(e={\"DenseMatrix, DenseMatrix\":o.referToSelf(r=>(e,t)=>u(...La(e,t),r)),\"Array, Array\":o.referToSelf(r=>(e,t)=>u(...La(s(e),s(t)),r).valueOf()),\"Array, DenseMatrix\":o.referToSelf(r=>(e,t)=>u(...La(s(e),t),r)),\"DenseMatrix, Array\":o.referToSelf(r=>(e,t)=>u(...La(e,s(t)),r))},n.SS&&(e[\"SparseMatrix, SparseMatrix\"]=o.referToSelf(r=>(e,t)=>n.SS(...La(e,t),r,!1))),n.DS&&(e[\"DenseMatrix, SparseMatrix\"]=o.referToSelf(r=>(e,t)=>n.DS(...La(e,t),r,!1)),e[\"Array, SparseMatrix\"]=o.referToSelf(r=>(e,t)=>n.DS(...La(s(e),t),r,!1))),i&&(e[\"SparseMatrix, DenseMatrix\"]=o.referToSelf(r=>(e,t)=>i(...La(t,e),r,!0)),e[\"SparseMatrix, Array\"]=o.referToSelf(r=>(e,t)=>i(...La(s(t),e),r,!0))));var t=n.scalar||\"any\";(n.Ds||n.Ss)&&(r?(e[\"DenseMatrix,\"+t]=(e,t)=>l(e,t,r,!1),e[t+\", DenseMatrix\"]=(e,t)=>l(t,e,r,!0),e[\"Array,\"+t]=(e,t)=>l(s(e),t,r,!1).valueOf(),e[t+\", Array\"]=(e,t)=>l(s(t),e,r,!0).valueOf()):(e[\"DenseMatrix,\"+t]=o.referToSelf(r=>(e,t)=>l(e,t,r,!1)),e[t+\", DenseMatrix\"]=o.referToSelf(r=>(e,t)=>l(t,e,r,!0)),e[\"Array,\"+t]=o.referToSelf(r=>(e,t)=>l(s(e),t,r,!1).valueOf()),e[t+\", Array\"]=o.referToSelf(r=>(e,t)=>l(s(t),e,r,!0).valueOf())));const a=void 0!==n.sS?n.sS:n.Ss;return r?(n.Ss&&(e[\"SparseMatrix,\"+t]=(e,t)=>n.Ss(e,t,r,!1)),a&&(e[t+\", SparseMatrix\"]=(e,t)=>a(t,e,r,!0))):(n.Ss&&(e[\"SparseMatrix,\"+t]=o.referToSelf(r=>(e,t)=>n.Ss(e,t,r,!1))),a&&(e[t+\", SparseMatrix\"]=o.referToSelf(r=>(e,t)=>a(t,e,r,!0)))),r&&r.signatures&&Fe(e,r.signatures),e}}),$a=s(\"mod\",[\"typed\",\"config\",\"round\",\"matrix\",\"equalScalar\",\"zeros\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s,concat:u}=e;const l=ka({typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}),c=Ra({typed:t,equalScalar:a}),f=Pa({typed:t}),p=Ua({typed:t,equalScalar:a}),m=Aa({typed:t,equalScalar:a}),h=x({typed:t,DenseMatrix:s});return t(\"mod\",{\"number, number\":function(e,t){return 0===t?e:e-t*l(e/t)},\"BigNumber, BigNumber\":function(e,t){return t.isZero()?e:e.sub(t.mul(l(e.div(t))))},\"bigint, bigint\":function(e,t){return 0n===t?e:e<0?0n===(r=e%t)?r:r+t:e%t;var r},\"Fraction, Fraction\":function(e,t){return t.equals(0)?e:e.sub(t.mul(l(e.div(t))))}},C({typed:t,matrix:i,concat:u})({SS:p,DS:f,SD:c,Ss:m,sS:h}))}),Ha=s(\"matAlgo01xDSid\",[\"typed\"],e=>{let w=e[\"typed\"];return function(n,e,t,i){var a=n._data,r=n._size,o=n._datatype||n.getDataType(),s=e._values,u=e._index,l=e._ptr,c=e._size,f=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(r.length!==c.length)throw new z(r.length,c.length);if(r[0]!==c[0]||r[1]!==c[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+r+\") must match Matrix B (\"+c+\")\");if(!s)throw new Error(\"Cannot perform operation on Dense Matrix and Pattern Sparse Matrix\");const p=r[0],m=r[1],h=\"string\"==typeof o&&\"mixed\"!==o&&o===f?o:void 0,d=h?w.find(t,[h,h]):t;let g,y;const x=[];for(g=0;g{let{typed:F,equalScalar:D}=e;return function(e,t,r){var n=e._values,i=e._index,a=e._ptr,o=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=t._values,l=t._index,c=t._ptr,f=t._size,p=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(o.length!==f.length)throw new z(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+o+\") must match Matrix B (\"+f+\")\");var f=o[0],m=o[1];let h,d=D,g=0,y=r;\"string\"==typeof s&&s===p&&\"mixed\"!==s&&(h=s,d=F.find(D,[h,h]),g=F.convert(0,h),y=F.find(r,[h,h]));const x=n&&u?[]:void 0,b=[],v=[],w=n&&u?[]:void 0,N=n&&u?[]:void 0,A=[],E=[];let S,M,C,T,B;for(M=0;M{let{typed:d,DenseMatrix:g}=e;return function(i,t,e,r){var a=i._values,o=i._index,s=i._ptr,n=i._size,i=i._datatype;if(!a)throw new Error(\"Cannot perform operation on Pattern Sparse Matrix and Scalar value\");var u=n[0],l=n[1];let c,f=e;\"string\"==typeof i&&(c=i,t=d.convert(t,c),f=d.find(e,[c,c]));const p=[],m=[],h=[];for(let n=0;nArray.isArray(e))}const Ya=s(\"gcd\",[\"typed\",\"config\",\"round\",\"matrix\",\"equalScalar\",\"zeros\",\"BigNumber\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,config:n,round:i,equalScalar:a,zeros:o,BigNumber:s,DenseMatrix:u,concat:l}=e;const c=$a({typed:t,config:n,round:i,matrix:r,equalScalar:a,zeros:o,DenseMatrix:u,concat:l}),f=Ha({typed:t}),p=Ga({typed:t,equalScalar:a}),m=Va({typed:t,DenseMatrix:u});return t(\"gcd\",{\"number, number\":function(e,t){if(!v(e)||!v(t))throw new Error(\"Parameters in function gcd must be integer numbers\");for(var r;0!==t;)r=c(e,t),e=t,t=r;return e<0?-e:e},\"BigNumber, BigNumber\":function(e,t){if(!e.isInt()||!t.isInt())throw new Error(\"Parameters in function gcd must be integer numbers\");const r=new s(0);for(;!t.isZero();){const r=c(e,t);e=t,t=r}return e.lt(r)?e.neg():e},\"Fraction, Fraction\":(e,t)=>e.gcd(t)},C({typed:t,matrix:r,concat:l})({SS:p,DS:f,Ss:m}),{\"number | BigNumber | Fraction | Matrix | Array, number | BigNumber | Fraction | Matrix | Array, ...number | BigNumber | Fraction | Matrix | Array\":t.referToSelf(i=>(e,t,r)=>{let n=i(e,t);for(let e=0;ee=>{if(1===e.length&&Array.isArray(e[0])&&Wa(e[0]))return t(...e[0]);if(Wa(e))return t(...e);throw new Za(\"gcd() supports only 1d matrices!\")}),Matrix:t.referToSelf(t=>e=>t(e.toArray()))})}),Ja=s(\"matAlgo06xS0S0\",[\"typed\",\"equalScalar\"],e=>{let{typed:v,equalScalar:w}=e;return function(e,r,t){var n=e._values,i=e._size,a=e._datatype||void 0===e._data?e._datatype:e.getDataType(),o=r._values,s=r._size,u=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(i.length!==s.length)throw new z(i.length,s.length);if(i[0]!==s[0]||i[1]!==s[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+i+\") must match Matrix B (\"+s+\")\");var s=i[0],l=i[1];let c,f=w,p=0,m=t;\"string\"==typeof a&&a===u&&\"mixed\"!==a&&(c=a,f=v.find(w,[c,c]),p=v.convert(0,c),m=v.find(t,[c,c]));const h=n&&o?[]:void 0,d=[],g=[],y=h?[]:void 0,x=[],b=[];for(let t=0;t{let{typed:t,matrix:r,equalScalar:n,concat:i}=e;const a=Ra({typed:t,equalScalar:n}),o=Ja({typed:t,equalScalar:n}),s=Aa({typed:t,equalScalar:n}),u=C({typed:t,matrix:r,concat:i}),l=\"number | BigNumber | Fraction | Matrix | Array\",c={};return c[l+`, ${l}, ...`+l]=t.referToSelf(i=>(e,t,r)=>{let n=i(e,t);for(let e=0;ee.lcm(t)},u({SS:o,DS:a,Ss:s}),c)});function Qa(t,r,n,i){return function(e){if(0{let{typed:t,config:r,Complex:n}=e;function i(e){return e.log().div(Math.LN10)}function a(e){return i(new n(e,0))}return t(\"log10\",{number:function(e){return(0<=e||r.predictable?ra:a)(e)},bigint:Qa(Ka,ra,r,a),Complex:i,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log():a(e.toNumber())},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),to=s(\"log2\",[\"typed\",\"config\",\"Complex\"],e=>{let{typed:t,config:r,Complex:n}=e;function i(e){return a(new n(e,0))}return t(\"log2\",{number:function(e){return(0<=e||r.predictable?na:i)(e)},bigint:Qa(4,na,r,i),Complex:a,BigNumber:function(e){return!e.isNegative()||r.predictable?e.log(2):i(e.toNumber())},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))});function a(e){var t=Math.sqrt(e.re*e.re+e.im*e.im);return new n(Math.log2?Math.log2(t):Math.log(t)/Math.LN2,Math.atan2(e.im,e.re)/Math.LN2)}}),ro=s(\"multiplyScalar\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"multiplyScalar\",{\"number, number\":Zi,\"Complex, Complex\":function(e,t){return e.mul(t)},\"BigNumber, BigNumber\":function(e,t){return e.times(t)},\"bigint, bigint\":function(e,t){return e*t},\"Fraction, Fraction\":function(e,t){return e.mul(t)},\"number | Fraction | BigNumber | Complex, Unit\":(e,t)=>t.multiply(e),\"Unit, number | Fraction | BigNumber | Complex | Unit\":(e,t)=>e.multiply(t)})}),no=\"multiply\",io=s(no,[\"typed\",\"matrix\",\"addScalar\",\"multiplyScalar\",\"equalScalar\",\"dot\"],e=>{let{typed:F,matrix:i,addScalar:D,multiplyScalar:O,equalScalar:N,dot:a}=e;const r=Aa({typed:F,equalScalar:N}),n=Ea({typed:F});function o(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError(\"Dimension mismatch in multiplication. Vectors must have the same length\");break;case 2:if(e[0]!==t[0])throw new RangeError(\"Dimension mismatch in multiplication. Vector length (\"+e[0]+\") must match Matrix rows (\"+t[0]+\")\");break;default:throw new Error(\"Can only multiply a 1 or 2 dimensional matrix (Matrix B has \"+t.length+\" dimensions)\")}break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw new RangeError(\"Dimension mismatch in multiplication. Matrix columns (\"+e[1]+\") must match Vector length (\"+t[0]+\")\");break;case 2:if(e[1]!==t[0])throw new RangeError(\"Dimension mismatch in multiplication. Matrix A columns (\"+e[1]+\") must match Matrix B rows (\"+t[0]+\")\");break;default:throw new Error(\"Can only multiply a 1 or 2 dimensional matrix (Matrix B has \"+t.length+\" dimensions)\")}break;default:throw new Error(\"Can only multiply a 1 or 2 dimensional matrix (Matrix A has \"+e.length+\" dimensions)\")}}const s=F(\"_multiplyMatrixVector\",{\"DenseMatrix, any\":function(e,t){var r=e._data,n=e._size,i=e._datatype||e.getDataType(),a=t._data,o=t._datatype||t.getDataType(),s=n[0],u=n[1];let l,c=D,f=O;i&&o&&i===o&&\"string\"==typeof i&&\"mixed\"!==i&&(l=i,c=F.find(D,[l,l]),f=F.find(O,[l,l]));const p=[];for(let e=0;eF){let n=0;for(let r=0;r(e,t)=>{o(T(e),T(t));const r=n(i(e),i(t));return _(r)?r.valueOf():r}),\"Matrix, Matrix\":function(e,t){var r=e.size(),n=t.size();return o(r,n),(1===r.length?1===n.length?function(e,t){if(0===r[0])throw new Error(\"Cannot multiply two empty vectors\");return a(e,t)}:function(t,r){if(\"dense\"!==r.storage())throw new Error(\"Support for SparseMatrix not implemented\");{var a=t._data,o=t._size,s=t._datatype||t.getDataType(),u=r._data,l=r._size,c=r._datatype||r.getDataType(),f=o[0],p=l[1];let e,n=D,i=O;s&&c&&s===c&&\"string\"==typeof s&&\"mixed\"!==s&&(e=s,n=F.find(D,[e,e]),i=F.find(O,[e,e]));const m=[];for(let r=0;r(e,t)=>r(e,i(t))),\"Array, Matrix\":F.referToSelf(r=>(e,t)=>r(i(e,t.storage()),t)),\"SparseMatrix, any\":function(e,t){return r(e,t,O,!1)},\"DenseMatrix, any\":function(e,t){return n(e,t,O,!1)},\"any, SparseMatrix\":function(e,t){return r(t,e,O,!0)},\"any, DenseMatrix\":function(e,t){return n(t,e,O,!0)},\"Array, any\":function(e,t){return n(i(e),t,O,!1).valueOf()},\"any, Array\":function(e,t){return n(i(t),e,O,!0).valueOf()},\"any, any\":O,\"any, any, ...any\":F.referToSelf(i=>(e,t,r)=>{let n=i(e,t);for(let e=0;e{let{typed:t,matrix:n,equalScalar:r,BigNumber:u,concat:i}=e;const a=Ha({typed:t}),o=Ra({typed:t,equalScalar:r}),s=Ja({typed:t,equalScalar:r}),l=Aa({typed:t,equalScalar:r}),c=C({typed:t,matrix:n,concat:i});function f(){throw new Error(\"Complex number not supported in function nthRoot. Use nthRoots instead.\")}return t(ao,{number:ia,\"number, number\":ia,BigNumber:e=>p(e,new u(2)),\"BigNumber, BigNumber\":p,Complex:f,\"Complex, number\":f,Array:t.referTo(\"DenseMatrix,number\",t=>e=>t(n(e),2).valueOf()),DenseMatrix:t.referTo(\"DenseMatrix,number\",t=>e=>t(e,2)),SparseMatrix:t.referTo(\"SparseMatrix,number\",t=>e=>t(e,2)),\"SparseMatrix, SparseMatrix\":t.referToSelf(r=>(e,t)=>{if(1===t.density())return s(e,t,r);throw new Error(\"Root must be non-zero\")}),\"DenseMatrix, SparseMatrix\":t.referToSelf(r=>(e,t)=>{if(1===t.density())return a(e,t,r,!1);throw new Error(\"Root must be non-zero\")}),\"Array, SparseMatrix\":t.referTo(\"DenseMatrix,SparseMatrix\",r=>(e,t)=>r(n(e),t)),\"number | BigNumber, SparseMatrix\":t.referToSelf(r=>(e,t)=>{if(1===t.density())return l(t,e,r,!0);throw new Error(\"Root must be non-zero\")})},c({scalar:\"number | BigNumber\",SD:o,Ss:l,sS:!1}));function p(e,t){const r=u.precision,n=u.clone({precision:r+2}),i=new u(0),a=new n(1),o=t.isNegative();if((t=o?t.neg():t).isZero())throw new Error(\"Root must be non-zero\");if(e.isNegative()&&!t.abs().mod(2).equals(1))throw new Error(\"Root must be odd when a is negative.\");if(e.isZero())return o?new n(1/0):0;if(!e.isFinite())return o?i:e;let s=e.abs().pow(a.div(t));return s=e.isNeg()?s.neg():s,new u((o?a.div(s):s).toPrecision(r))}}),so=s(\"sign\",[\"typed\",\"BigNumber\",\"Fraction\",\"complex\"],e=>{let{typed:r,BigNumber:t,complex:n,Fraction:i}=e;return r(\"sign\",{number:aa,Complex:function(e){return 0===e.im?n(aa(e.re)):e.sign()},BigNumber:function(e){return new t(e.cmp(0))},bigint:function(e){return 0ne=>le(e,t,!0)),Unit:r.referToSelf(t=>e=>{if(e._isDerived()||0===e.units[0].unit.offset)return r.find(t,e.valueType())(e.value);throw new TypeError(\"sign is ambiguous for units with offset\")})})}),uo=s(\"sqrt\",[\"config\",\"typed\",\"Complex\"],e=>{let{config:t,typed:r,Complex:n}=e;return r(\"sqrt\",{number:i,Complex:function(e){return e.sqrt()},BigNumber:function(e){return!e.isNegative()||t.predictable?e.sqrt():i(e.toNumber())},Unit:function(e){return e.pow(.5)}});function i(e){return isNaN(e)?NaN:0<=e||t.predictable?Math.sqrt(e):new n(e,0).sqrt()}}),lo=s(\"square\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"square\",{number:oa,Complex:function(e){return e.mul(e)},BigNumber:function(e){return e.times(e)},bigint:function(e){return e*e},Fraction:function(e){return e.mul(e)},Unit:function(e){return e.pow(2)}})}),co=\"subtract\",fo=s(co,[\"typed\",\"matrix\",\"equalScalar\",\"subtractScalar\",\"unaryMinus\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,subtractScalar:i,DenseMatrix:a,concat:o}=e;const s=Ha({typed:t}),u=Pa({typed:t}),l=Ua({typed:t,equalScalar:n}),c=Va({typed:t,DenseMatrix:a}),f=x({typed:t,DenseMatrix:a}),p=C({typed:t,matrix:r,concat:o});return t(co,{\"any, any\":i},p({elop:i,SS:l,DS:s,SD:u,Ss:f,sS:c}))}),po=s(\"xgcd\",[\"typed\",\"config\",\"matrix\",\"BigNumber\"],e=>{let{typed:t,config:p,matrix:m,BigNumber:h}=e;return t(\"xgcd\",{\"number, number\":function(e,t){e=sa(e,t);return\"Array\"===p.matrix?e:m(e)},\"BigNumber, BigNumber\":function(e,t){let r,n,i;var a=new h(0),o=new h(1);let s,u=a,l=o,c=o,f=a;if(!e.isInt()||!t.isInt())throw new Error(\"Parameters in function xgcd must be integer numbers\");for(;!t.isZero();)n=e.div(t).floor(),i=e.mod(t),r=u,u=l.minus(n.times(u)),l=r,r=c,c=f.minus(n.times(c)),f=r,e=t,t=i;return s=e.lt(a)?[e.neg(),l.neg(),f.neg()]:[e,e.isZero()?0:l,f],\"Array\"===p.matrix?s:m(s)}})}),mo=s(\"invmod\",[\"typed\",\"config\",\"BigNumber\",\"xgcd\",\"equal\",\"smaller\",\"mod\",\"add\",\"isInteger\"],e=>{let{typed:t,BigNumber:a,xgcd:o,equal:s,smaller:u,mod:l,add:c,isInteger:f}=e;return t(\"invmod\",{\"number, number\":r,\"BigNumber, BigNumber\":r});function r(e,t){if(!f(e)||!f(t))throw new Error(\"Parameters in function invmod must be integer numbers\");if(e=l(e,t),s(t,0))throw new Error(\"Divisor must be non zero\");let r=o(e,t),[n,i]=r=r.valueOf();return s(n,a(1))?(i=l(i,t),i=u(i,a(0))?c(i,t):i):NaN}}),ho=s(\"matAlgo09xS0Sf\",[\"typed\",\"equalScalar\"],e=>{let{typed:T,equalScalar:B}=e;return function(e,t,r){var n=e._values,i=e._index,a=e._ptr,o=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=t._values,l=t._index,c=t._ptr,f=t._size,p=t._datatype||void 0===t._data?t._datatype:t.getDataType();if(o.length!==f.length)throw new z(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+o+\") must match Matrix B (\"+f+\")\");var f=o[0],m=o[1];let h,d=B,g=0,y=r;\"string\"==typeof s&&s===p&&\"mixed\"!==s&&(h=s,d=T.find(B,[h,h]),g=T.convert(0,h),y=T.find(r,[h,h]));const x=n&&u?[]:void 0,b=[],v=[],w=x?[]:void 0,N=[];let A,E,S,M,C;for(E=0;E{let{typed:t,matrix:r,equalScalar:n,multiplyScalar:i,concat:a}=e;const o=Ra({typed:t,equalScalar:n}),s=ho({typed:t,equalScalar:n}),u=Aa({typed:t,equalScalar:n}),l=C({typed:t,matrix:r,concat:a});return t(go,l({elop:i,SS:s,DS:o,Ss:u}))});function xo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error(\"Integers expected in function bitAnd\");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero()||t.eq(-1)||e.eq(t))return e;if(t.isZero()||e.eq(-1))return t;if(!e.isFinite()||!t.isFinite()){if(!e.isFinite()&&!t.isFinite())return e.isNegative()===t.isNegative()?e:new r(0);if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t;if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e}return wo(e,t,function(e,t){return e&t})}function bo(e){if(e.isFinite()&&!e.isInteger())throw new Error(\"Integer expected in function bitNot\");const t=e.constructor,r=t.precision,n=(t.config({precision:1e9}),e.plus(new t(1)));return n.s=-n.s||null,t.config({precision:r}),n}function vo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error(\"Integers expected in function bitOr\");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);var n=new r(-1);return e.isZero()||t.eq(n)||e.eq(t)?t:t.isZero()||e.eq(n)?e:e.isFinite()&&t.isFinite()?wo(e,t,function(e,t){return e|t}):!e.isFinite()&&!e.isNegative()&&t.isNegative()||e.isNegative()&&!t.isNegative()&&!t.isFinite()?n:e.isNegative()&&t.isNegative()?e.isFinite()?e:t:e.isFinite()?t:e}function wo(e,t,r){const n=e.constructor;let i,a;var o=+(e.s<0),s=+(t.s<0);if(o){i=No(bo(e));for(let e=0;ee)for(i-=e;i--;)a+=\"0\";else i>1,o[e]&=1)}return o.reverse()}function Ao(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error(\"Integers expected in function bitXor\");const r=e.constructor;if(e.isNaN()||t.isNaN())return new r(NaN);if(e.isZero())return t;if(t.isZero())return e;if(e.eq(t))return new r(0);var n=new r(-1);return e.eq(n)?bo(t):t.eq(n)?bo(e):e.isFinite()&&t.isFinite()?wo(e,t,function(e,t){return e^t}):e.isFinite()||t.isFinite()?new r(e.isNegative()===t.isNegative()?1/0:-1/0):n}function Eo(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error(\"Integers expected in function leftShift\");const r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:e.isFinite()||t.isFinite()?t.lt(55)?e.times(Math.pow(2,t.toNumber())+\"\"):e.times(new r(2).pow(t)):new r(NaN)}function So(e,t){if(e.isFinite()&&!e.isInteger()||t.isFinite()&&!t.isInteger())throw new Error(\"Integers expected in function rightArithShift\");const r=e.constructor;return e.isNaN()||t.isNaN()||t.isNegative()&&!t.isZero()?new r(NaN):e.isZero()||t.isZero()?e:t.isFinite()?(t.lt(55)?e.div(Math.pow(2,t.toNumber())+\"\"):e.div(new r(2).pow(t))).floor():e.isNegative()?new r(-1):e.isFinite()?new r(0):new r(NaN)}var Mo=\"number, number\";function Co(e,t){if(v(e)&&v(t))return e&t;throw new Error(\"Integers expected in function bitAnd\")}function To(e){if(v(e))return~e;throw new Error(\"Integer expected in function bitNot\")}function Bo(e,t){if(v(e)&&v(t))return e|t;throw new Error(\"Integers expected in function bitOr\")}function Fo(e,t){if(v(e)&&v(t))return e^t;throw new Error(\"Integers expected in function bitXor\")}function Do(e,t){if(v(e)&&v(t))return e<>t;throw new Error(\"Integers expected in function rightArithShift\")}function _o(e,t){if(v(e)&&v(t))return e>>>t;throw new Error(\"Integers expected in function rightLogShift\")}Co.signature=Mo,To.signature=\"number\",_o.signature=Oo.signature=Do.signature=Fo.signature=Bo.signature=Mo;const zo=s(\"bitAnd\",[\"typed\",\"matrix\",\"equalScalar\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,concat:i}=e;const a=Ra({typed:t,equalScalar:n}),o=Ja({typed:t,equalScalar:n}),s=Aa({typed:t,equalScalar:n}),u=C({typed:t,matrix:r,concat:i});return t(\"bitAnd\",{\"number, number\":Co,\"BigNumber, BigNumber\":xo,\"bigint, bigint\":(e,t)=>e&t},u({SS:o,DS:a,Ss:s}))}),qo=s(\"bitNot\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"bitNot\",{number:To,BigNumber:bo,bigint:e=>~e,\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Io=s(\"bitOr\",[\"typed\",\"matrix\",\"equalScalar\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e;const o=Ha({typed:t}),s=Ga({typed:t,equalScalar:n}),u=Va({typed:t,DenseMatrix:i}),l=C({typed:t,matrix:r,concat:a});return t(\"bitOr\",{\"number, number\":Bo,\"BigNumber, BigNumber\":vo,\"bigint, bigint\":(e,t)=>e|t},l({SS:s,DS:o,Ss:u}))}),ko=s(\"matAlgo07xSSf\",[\"typed\",\"SparseMatrix\"],e=>{let{typed:b,SparseMatrix:v}=e;return function(r,n,e){var t=r._size,i=r._datatype||void 0===r._data?r._datatype:r.getDataType(),a=n._size,o=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(t.length!==a.length)throw new z(t.length,a.length);if(t[0]!==a[0]||t[1]!==a[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+t+\") must match Matrix B (\"+a+\")\");var s=t[0],u=t[1];let l,c=0,f=e;\"string\"==typeof i&&i===o&&\"mixed\"!==i&&(l=i,c=b.convert(0,l),f=b.find(e,[l,l]));const p=[],m=[],h=new Array(u+1).fill(0),d=[],g=[],y=[],x=[];for(let e=0;e{let{typed:t,matrix:r,DenseMatrix:n,concat:i,SparseMatrix:a}=e;const o=Pa({typed:t}),s=ko({typed:t,SparseMatrix:a}),u=x({typed:t,DenseMatrix:n}),l=C({typed:t,matrix:r,concat:i});return t(\"bitXor\",{\"number, number\":Fo,\"BigNumber, BigNumber\":Ao,\"bigint, bigint\":(e,t)=>e^t},l({SS:s,DS:o,Ss:u}))}),Po=s(\"arg\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"arg\",{number:function(e){return Math.atan2(0,e)},BigNumber:function(e){return e.constructor.atan2(0,e)},Complex:function(e){return e.arg()},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Uo=s(\"conj\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"conj\",{\"number | BigNumber | Fraction\":e=>e,Complex:e=>e.conjugate(),Unit:t.referToSelf(t=>e=>new e.constructor(t(e.toNumeric()),e.formatUnits())),\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),jo=s(\"im\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"im\",{number:()=>0,\"BigNumber | Fraction\":e=>e.mul(0),Complex:e=>e.im,\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Lo=s(\"re\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"re\",{\"number | BigNumber | Fraction\":e=>e,Complex:e=>e.re,\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),$o=\"number, number\";function Ho(e){return!e}function Go(e,t){return!(!e&&!t)}function Vo(e,t){return!!e!=!!t}function Zo(e,t){return!(!e||!t)}Ho.signature=\"number\",Zo.signature=Vo.signature=Go.signature=$o;const Wo=s(\"not\",[\"typed\"],e=>{let r=e[\"typed\"];return r(\"not\",{\"null | undefined\":()=>!0,number:Ho,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},bigint:e=>!e,Unit:r.referToSelf(t=>e=>r.find(t,e.valueType())(e.value)),\"Array | Matrix\":r.referToSelf(t=>e=>le(e,t))})}),Yo=\"nullish\",Jo=s(Yo,[\"typed\",\"matrix\",\"size\",\"flatten\",\"deepEqual\"],e=>{let{typed:t,matrix:n,size:i,flatten:a,deepEqual:o}=e;const s=Pa({typed:t}),u=Ea({typed:t}),l=ja({typed:t});return t(Yo,{\"number|bigint|Complex|BigNumber|Fraction|Unit|string|boolean|SparseMatrix, any\":(e,t)=>e,\"null, any\":(e,t)=>t,\"undefined, any\":(e,t)=>t,\"SparseMatrix, Array | Matrix\":(e,t)=>{var r=a(i(e).valueOf()),t=a(i(t).valueOf());if(o(r,t))return e;throw new z(r,t)},\"DenseMatrix, DenseMatrix\":t.referToSelf(r=>(e,t)=>l(e,t,r)),\"DenseMatrix, SparseMatrix\":t.referToSelf(r=>(e,t)=>s(e,t,r,!1)),\"DenseMatrix, Array\":t.referToSelf(r=>(e,t)=>l(e,n(t),r)),\"DenseMatrix, any\":t.referToSelf(r=>(e,t)=>u(e,t,r,!1)),\"Array, Array\":t.referToSelf(r=>(e,t)=>l(n(e),n(t),r).valueOf()),\"Array, DenseMatrix\":t.referToSelf(r=>(e,t)=>l(n(e),t,r)),\"Array, SparseMatrix\":t.referToSelf(r=>(e,t)=>s(n(e),t,r,!1)),\"Array, any\":t.referToSelf(r=>(e,t)=>u(n(e),t,r,!1).valueOf())})}),Xo=s(\"or\",[\"typed\",\"matrix\",\"equalScalar\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e;const o=Pa({typed:t}),s=Ua({typed:t,equalScalar:n}),u=x({typed:t,DenseMatrix:i}),l=C({typed:t,matrix:r,concat:a});return t(\"or\",{\"number, number\":Go,\"Complex, Complex\":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},\"BigNumber, BigNumber\":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},\"bigint, bigint\":Go,\"Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e.value||0,t.value||0))},l({SS:s,DS:o,Ss:u}))}),Qo=s(\"xor\",[\"typed\",\"matrix\",\"DenseMatrix\",\"concat\",\"SparseMatrix\"],e=>{let{typed:t,matrix:r,DenseMatrix:n,concat:i,SparseMatrix:a}=e;const o=Pa({typed:t}),s=ko({typed:t,SparseMatrix:a}),u=x({typed:t,DenseMatrix:n}),l=C({typed:t,matrix:r,concat:i});return t(\"xor\",{\"number, number\":Vo,\"Complex, Complex\":function(e,t){return(0!==e.re||0!==e.im)!=(0!==t.re||0!==t.im)},\"bigint, bigint\":Vo,\"BigNumber, BigNumber\":function(e,t){return(!e.isZero()&&!e.isNaN())!=(!t.isZero()&&!t.isNaN())},\"Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e.value||0,t.value||0))},l({SS:s,DS:o,Ss:u}))}),Ko=s(\"concat\",[\"typed\",\"matrix\",\"isInteger\"],e=>{let{typed:t,matrix:u,isInteger:l}=e;return t(\"concat\",{\"...Array | Matrix | number | BigNumber\":function(e){let t;var r=e.length;let n,i=-1,a=!1;const o=[];for(t=0;tn)throw new En(i,n+1)}else{const e=ee(u).valueOf(),l=T(e);if(o[t]=e,n=i,i=l.length-1,0{let{typed:t,Index:n,matrix:i,range:a}=e;return t(\"column\",{\"Matrix, number\":r,\"Array, number\":function(e,t){return r(i(ee(e)),t).valueOf()}});function r(e,t){if(2!==e.size().length)throw new Error(\"Only two dimensional matrix is supported\");M(t,e.size()[1]);var r=a(0,e.size()[0]),r=new n(r,t),t=e.subset(r);return _(t)?t:i([[t]])}}),ts=s(\"count\",[\"typed\",\"size\",\"prod\"],e=>{let{typed:t,size:r,prod:n}=e;return t(\"count\",{string:function(e){return e.length},\"Matrix | Array\":function(e){return n(r(e))}})}),rs=s(\"cross\",[\"typed\",\"matrix\",\"subtract\",\"multiply\"],e=>{let{typed:t,matrix:r,subtract:a,multiply:o}=e;return t(\"cross\",{\"Matrix, Matrix\":function(e,t){return r(n(e.toArray(),t.toArray()))},\"Matrix, Array\":function(e,t){return r(n(e.toArray(),t))},\"Array, Matrix\":function(e,t){return r(n(e,t.toArray()))},\"Array, Array\":n});function n(e,t){var r=Math.max(T(e).length,T(t).length);e=On(e),t=On(t);const n=T(e),i=T(t);if(1!==n.length||1!==i.length||3!==n[0]||3!==i[0])throw new RangeError(\"Vectors with length 3 expected (Size A = [\"+n.join(\", \")+\"], B = [\"+i.join(\", \")+\"])\");e=[a(o(e[1],t[2]),o(e[2],t[1])),a(o(e[2],t[0]),o(e[0],t[2])),a(o(e[0],t[1]),o(e[1],t[0]))];return 1{let{typed:t,matrix:y,DenseMatrix:x,SparseMatrix:b}=e;return t(\"diag\",{Array:function(e){return n(e,0,T(e),null)},\"Array, number\":function(e,t){return n(e,t,T(e),null)},\"Array, BigNumber\":function(e,t){return n(e,t.toNumber(),T(e),null)},\"Array, string\":function(e,t){return n(e,0,T(e),t)},\"Array, number, string\":function(e,t,r){return n(e,t,T(e),r)},\"Array, BigNumber, string\":function(e,t,r){return n(e,t.toNumber(),T(e),r)},Matrix:function(e){return n(e,0,e.size(),e.storage())},\"Matrix, number\":function(e,t){return n(e,t,e.size(),e.storage())},\"Matrix, BigNumber\":function(e,t){return n(e,t.toNumber(),e.size(),e.storage())},\"Matrix, string\":function(e,t){return n(e,0,e.size(),t)},\"Matrix, number, string\":function(e,t,r){return n(e,t,e.size(),r)},\"Matrix, BigNumber, string\":function(e,t,r){return n(e,t.toNumber(),e.size(),r)}});function n(e,t,r,n){if(!v(t))throw new TypeError(\"Second parameter in function diag must be an integer\");var i=0{let t=e[\"typed\"];return t(\"filter\",{\"Array, function\":as,\"Matrix, function\":function(e,t){return e.create(as(e.valueOf(),t),e.datatype())},\"Array, RegExp\":kn,\"Matrix, RegExp\":function(e,t){return e.create(kn(e.valueOf(),t),e.datatype())}})});function as(e,t){const n=Yn(t,e,\"filter\");return n.isUnary?In(e,n.fn):In(e,function(e,t,r){return n.fn(e,[t],r)})}const os=\"flatten\",ss=s(os,[\"typed\"],e=>{let t=e[\"typed\"];return t(os,{Array:function(e){return E(e)},Matrix:function(e){return e.create(E(e.valueOf(),!0),e.datatype())}})}),us=\"forEach\",ls=s(us,[\"typed\"],e=>{let t=e[\"typed\"];return t(us,{\"Array, function\":cs,\"Matrix, function\":function(e,t){e.forEach(t)}})});function cs(e,t){t=Yn(t,e,us);Wn(e,t.fn,t.isUnary)}const fs=\"getMatrixDataType\",ps=s(fs,[\"typed\"],e=>{let t=e[\"typed\"];return t(fs,{Array:function(e){return jn(e,K)},Matrix:function(e){return e.getDataType()}})}),ms=\"identity\",hs=s(ms,[\"typed\",\"config\",\"matrix\",\"BigNumber\",\"DenseMatrix\",\"SparseMatrix\"],e=>{let{typed:t,config:r,matrix:n,BigNumber:l,DenseMatrix:c,SparseMatrix:f}=e;return t(ms,{\"\":function(){return\"Matrix\"===r.matrix?n([]):[]},string:function(e){return n(e)},\"number | BigNumber\":function(e){return a(e,e,\"Matrix\"===r.matrix?\"dense\":void 0)},\"number | BigNumber, string\":function(e,t){return a(e,e,t)},\"number | BigNumber, number | BigNumber\":function(e,t){return a(e,t,\"Matrix\"===r.matrix?\"dense\":void 0)},\"number | BigNumber, number | BigNumber, string\":a,Array:function(e){return i(e)},\"Array, string\":i,Matrix:function(e){return i(e.valueOf(),e.storage())},\"Matrix, string\":function(e,t){return i(e.valueOf(),t)}});function i(e,t){switch(e.length){case 0:return t?n(t):[];case 1:return a(e[0],e[0],t);case 2:return a(e[0],e[1],t);default:throw new Error(\"Vector containing two values expected\")}}function a(e,t,r){const n=Q(e)||Q(t)?l:null;if(Q(e)&&(e=e.toNumber()),Q(t)&&(t=t.toNumber()),!v(e)||e<1)throw new Error(\"Parameters in function identity must be positive integers\");if(!v(t)||t<1)throw new Error(\"Parameters in function identity must be positive integers\");var i=n?new l(1):1,a=n?new n(0):0,o=[e,t];if(r){if(\"sparse\"===r)return f.diagonal(o,i,0,a);if(\"dense\"===r)return c.diagonal(o,i,0,a);throw new TypeError(`Unknown matrix type \"${r}\"`)}const s=Tn([],o,a),u=e{let{typed:t,matrix:r,multiplyScalar:a}=e;return t(\"kron\",{\"Matrix, Matrix\":function(e,t){return r(n(e.toArray(),t.toArray()))},\"Matrix, Array\":function(e,t){return r(n(e.toArray(),t))},\"Array, Matrix\":function(e,t){return r(n(e,t.toArray()))},\"Array, Array\":n});function n(e,r){if(1===T(e).length&&(e=[e]),1===T(r).length&&(r=[r]),2{let h=e[\"typed\"];return h(\"map\",{\"Array, function\":d,\"Matrix, function\":function(e,t){return e.map(t)},\"Array|Matrix, Array|Matrix, ...Array|Matrix|function\":(e,t,n)=>{{var i=[e,t,...n.slice(0,n.length-1)],a=n[n.length-1];if(\"function\"!=typeof a)throw new Error(\"Last argument must be a callback function\");const c=i[0].isMatrix,f=$n(...i.map(e=>e.isMatrix?e.size():T(e))),p=c?(e,t)=>e.get(t):Vn,m=c?i.map(e=>e.isMatrix?e.create(Gn(e.toArray(),f),e.datatype()):i[0].create(Gn(e.valueOf(),f))):i.map(e=>e.isMatrix?Gn(e.toArray(),f):Gn(e,f));let r;if(h.isTypedFunction(a)){const i=f.map(()=>0),d=m.map(e=>p(e,i)),c=(u=a,e=d,o=i,s=m,null!==h.resolve(u,[...e,o,...s])?2:null!==h.resolve(u,[...e,o])?1:(h.resolve(u,e),0));r=l(c)}else{const h=i.length,d=(s=h,(o=a).length>s+1?2:o.length===s+1?1:0);r=l(d)}var o,s,u=(e,t)=>r([e,...m.slice(1).map(e=>p(e,t))],t);return c?m[0].map(u):d(m[0],u);function l(e){switch(e){case 0:return e=>a(...e);case 1:return(e,t)=>a(...e,t);case 2:return(e,t)=>a(...e,t,...m)}}}}});function d(e,t){t=Yn(t,e,\"map\");return Zn(e,t.fn,t.isUnary)}}),ys=s(\"diff\",[\"typed\",\"matrix\",\"subtract\",\"number\"],e=>{let{typed:t,matrix:r,subtract:i,number:n}=e;return t(\"diff\",{\"Array | Matrix\":function(e){return _(e)?r(o(e.toArray())):o(e)},\"Array | Matrix, number\":function(e,t){if(v(t))return _(e)?r(a(e.toArray(),t)):a(e,t);throw new RangeError(\"Dimension must be a whole number\")},\"Array, BigNumber\":t.referTo(\"Array,number\",r=>(e,t)=>r(e,n(t))),\"Matrix, BigNumber\":t.referTo(\"Matrix,number\",r=>(e,t)=>r(e,n(t)))});function a(e,t){if(_(e)&&(e=e.toArray()),!Array.isArray(e))throw RangeError(\"Array/Matrix does not have that many dimensions\");if(0{r.push(a(e,t-1))}),r}if(0===t)return o(e);throw RangeError(\"Cannot have negative dimension\")}function o(t){const r=[],n=t.length;for(let e=1;e{let{typed:t,config:r,matrix:i,BigNumber:a}=e;return t(\"ones\",{\"\":function(){return\"Array\"===r.matrix?n([]):n([],\"default\")},\"...number | BigNumber | string\":function(e){var t;return\"string\"==typeof e[e.length-1]?(t=e.pop(),n(e,t)):\"Array\"===r.matrix?n(e):n(e,\"default\")},Array:n,Matrix:function(e){var t=e.storage();return n(e.valueOf(),t)},\"Array | Matrix, string\":function(e,t){return n(e.valueOf(),t)}});function n(e,t){const r=function(){let n=!1;return e.forEach(function(e,t,r){Q(e)&&(n=!0,r[t]=e.toNumber())}),n}(),n=r?new a(1):1;if(e.forEach(function(e){if(\"number\"!=typeof e||!v(e)||e<0)throw new Error(\"Parameters in function ones must be positive integers\")}),t){const r=i(t);return 0{let{typed:t,config:n,matrix:r,bignumber:i,smaller:s,smallerEq:u,larger:l,largerEq:c,add:f,isPositive:p}=e;return t(\"range\",{string:o,\"string, boolean\":o,number:function(e){throw new TypeError(\"Too few arguments to function range(): \"+e)},boolean:function(e){throw new TypeError(`Unexpected type of argument 1 to function range(): ${e}, number|bigint|BigNumber|Fraction`)},\"number, number\":function(e,t){return a(m(e,t,1,!1))},\"number, number, number\":function(e,t,r){return a(m(e,t,r,!1))},\"number, number, boolean\":function(e,t,r){return a(m(e,t,1,r))},\"number, number, number, boolean\":function(e,t,r,n){return a(m(e,t,r,n))},\"bigint, bigint|number\":function(e,t){return a(m(e,t,1n,!1))},\"number, bigint\":function(e,t){return a(m(BigInt(e),t,1n,!1))},\"bigint, bigint|number, bigint|number\":function(e,t,r){return a(m(e,t,BigInt(r),!1))},\"number, bigint, bigint|number\":function(e,t,r){return a(m(BigInt(e),t,BigInt(r),!1))},\"bigint, bigint|number, boolean\":function(e,t,r){return a(m(e,t,1n,r))},\"number, bigint, boolean\":function(e,t,r){return a(m(BigInt(e),t,1n,r))},\"bigint, bigint|number, bigint|number, boolean\":function(e,t,r,n){return a(m(e,t,BigInt(r),n))},\"number, bigint, bigint|number, boolean\":function(e,t,r,n){return a(m(BigInt(e),t,BigInt(r),n))},\"BigNumber, BigNumber\":function(e,t){return a(m(e,t,new e.constructor(1),!1))},\"BigNumber, BigNumber, BigNumber\":function(e,t,r){return a(m(e,t,r,!1))},\"BigNumber, BigNumber, boolean\":function(e,t,r){return a(m(e,t,new e.constructor(1),r))},\"BigNumber, BigNumber, BigNumber, boolean\":function(e,t,r,n){return a(m(e,t,r,n))},\"Fraction, Fraction\":function(e,t){return a(m(e,t,1,!1))},\"Fraction, Fraction, Fraction\":function(e,t,r){return a(m(e,t,r,!1))},\"Fraction, Fraction, boolean\":function(e,t,r){return a(m(e,t,1,r))},\"Fraction, Fraction, Fraction, boolean\":function(e,t,r,n){return a(m(e,t,r,n))},\"Unit, Unit, Unit\":function(e,t,r){return a(m(e,t,r,!1))},\"Unit, Unit, Unit, boolean\":function(e,t,r,n){return a(m(e,t,r,n))}});function a(e){return\"Matrix\"===n.matrix?r?r(e):ws():e}function o(t,e){var r=function(){const e=t.split(\":\").map(function(e){return Number(e)});if(e.some(function(e){return isNaN(e)}))return null;switch(e.length){case 2:return{start:e[0],end:e[1],step:1};case 3:return{start:e[0],end:e[2],step:e[1]};default:return null}}();if(r)return\"BigNumber\"===n.number?(void 0===i&&bs(),a(m(i(r.start),i(r.end),i(r.step)))):a(m(r.start,r.end,r.step,e));throw new SyntaxError('String \"'+t+'\" is no valid range')}function m(e,t,r,n){const i=[],a=p(r)?n?u:s:n?c:l;let o=e;for(;a(o,t);)i.push(o),o=f(o,r);return i}}),As=\"reshape\",Es=s(As,[\"typed\",\"isInteger\",\"matrix\"],e=>{let{typed:t,isInteger:r}=e;return t(As,{\"Matrix, Array\":function(e,t){return e.reshape(t,!0)},\"Array, Array\":function(e,t){return t.forEach(function(e){if(!r(e))throw new TypeError(\"Invalid size for dimension: \"+e)}),Bn(e,t)}})}),Ss=s(\"resize\",[\"config\",\"matrix\"],e=>{let{config:s,matrix:u}=e;return function(e,t,r){if(2!==arguments.length&&3!==arguments.length)throw new Za(\"resize\",arguments.length,2,3);if(Q((t=_(t)?t.valueOf():t)[0])&&(t=t.map(function(e){return Q(e)?e.toNumber():e})),_(e))return e.resize(t,r,!0);if(\"string\"==typeof e){var n=e,i=t,a=r;if(void 0!==a){if(\"string\"!=typeof a||1!==a.length)throw new TypeError(\"Single character expected as defaultValue\")}else a=\" \";if(1!==i.length)throw new z(i.length,1);var o=i[0];if(\"number\"!=typeof o||!v(o))throw new TypeError(\"Invalid size, must contain positive integers (size: \"+S(i)+\")\");if(n.length>o)return n.substring(0,o);if(n.length{let{typed:t,multiply:n,rotationMatrix:i}=e;return t(\"rotate\",{\"Array , number | BigNumber | Complex | Unit\":function(e,t){return a(e,2),n(i(t),e).toArray()},\"Matrix , number | BigNumber | Complex | Unit\":function(e,t){return a(e,2),n(i(t),e)},\"Array, number | BigNumber | Complex | Unit, Array | Matrix\":function(e,t,r){return a(e,3),n(i(t,r),e)},\"Matrix, number | BigNumber | Complex | Unit, Array | Matrix\":function(e,t,r){return a(e,3),n(i(t,r),e)}});function a(e,t){e=Array.isArray(e)?T(e):e.size();if(2{let{typed:t,config:n,multiplyScalar:i,addScalar:m,unaryMinus:h,norm:d,BigNumber:g,matrix:a,DenseMatrix:r,SparseMatrix:o,cos:y,sin:x}=e;return t(Cs,{\"\":function(){return\"Matrix\"===n.matrix?a([]):[]},string:function(e){return a(e)},\"number | BigNumber | Complex | Unit\":function(e){return s(e,\"Matrix\"===n.matrix?\"dense\":void 0)},\"number | BigNumber | Complex | Unit, string\":s,\"number | BigNumber | Complex | Unit, Array\":function(e,t){t=a(t);return u(t),l(e,t,void 0)},\"number | BigNumber | Complex | Unit, Matrix\":function(e,t){u(t);var r=t.storage()||(\"Matrix\"===n.matrix?\"dense\":void 0);return l(e,t,r)},\"number | BigNumber | Complex | Unit, Array, string\":function(e,t,r){t=a(t);return u(t),l(e,t,r)},\"number | BigNumber | Complex | Unit, Matrix, string\":function(e,t,r){return u(t),l(e,t,r)}});function s(e,t){var r=Q(e)?new g(-1):-1,n=y(e),e=x(e);return v([[n,i(r,e)],[e,n]],t)}function u(e){e=e.size();if(e.length<1||3!==e[0])throw new RangeError(\"Vector must be of dimensions 1x3\")}function b(e){return e.reduce((e,t)=>i(e,t))}function v(e,t){if(t){if(\"sparse\"===t)return new o(e);if(\"dense\"===t)return new r(e);throw new TypeError(`Unknown matrix type \"${t}\"`)}return e}function l(e,t,r){var n=d(t);if(0===n)throw new RangeError(\"Rotation around zero vector\");const i=Q(e)?g:null,a=i?new i(1):1,o=i?new i(-1):-1,s=i?new i(t.get([0])/n):t.get([0])/n,u=i?new i(t.get([1])/n):t.get([1])/n,l=i?new i(t.get([2])/n):t.get([2])/n,c=y(e),f=m(a,h(c)),p=x(e);return v([[m(c,b([s,s,f])),m(b([s,u,f]),b([o,l,p])),m(b([s,l,f]),b([u,p]))],[m(b([s,u,f]),b([l,p])),m(c,b([u,u,f])),m(b([u,l,f]),b([o,s,p]))],[m(b([s,l,f]),b([o,u,p])),m(b([u,l,f]),b([s,p])),m(c,b([l,l,f]))]],r)}}),Bs=s(\"row\",[\"typed\",\"Index\",\"matrix\",\"range\"],e=>{let{typed:t,Index:n,matrix:i,range:a}=e;return t(\"row\",{\"Matrix, number\":r,\"Array, number\":function(e,t){return r(i(ee(e)),t).valueOf()}});function r(e,t){if(2!==e.size().length)throw new Error(\"Only two dimensional matrix is supported\");M(t,e.size()[0]);var r=a(0,e.size()[1]),t=new n(t,r),r=e.subset(t);return _(r)?r:i([[r]])}}),Fs=s(\"size\",[\"typed\",\"config\",\"?matrix\"],e=>{let{typed:t,config:r,matrix:n}=e;return t(\"size\",{Matrix:function(e){return e.create(e.size(),\"number\")},Array:T,string:function(e){return\"Array\"===r.matrix?[e.length]:n([e.length],\"dense\",\"number\")},\"number | Complex | BigNumber | Unit | boolean | null\":function(e){return\"Array\"===r.matrix?[]:n?n([],\"dense\",\"number\"):ws()}})}),Ds=\"squeeze\",Os=s(Ds,[\"typed\"],e=>{let t=e[\"typed\"];return t(Ds,{Array:function(e){return On(ee(e))},Matrix:function(e){var t=On(e.toArray());return Array.isArray(t)?e.create(t,e.datatype()):t},any:ee})}),_s=s(\"subset\",[\"typed\",\"matrix\",\"zeros\",\"add\"],e=>{let{typed:t,matrix:o,zeros:i,add:a}=e;return t(\"subset\",{\"Matrix, Index\":function(e,t){return Cn(t)?o():(Mn(e,t),e.subset(t))},\"Array, Index\":t.referTo(\"Matrix, Index\",function(n){return function(e,t){const r=n(o(e),t);return t.isScalar()?r:r.valueOf()}}),\"Object, Index\":Is,\"string, Index\":zs,\"Matrix, Index, any, any\":function(e,t,r,n){return Cn(t)?e:(Mn(e,t),e.clone().subset(t,function(e,t){if(\"string\"==typeof e)throw new Error(\"can't boradcast a string\");if(t._isScalar)return e;const r=t.size();if(!r.every(e=>0a)for(let e=a-1,t=o.length;e{let{typed:t,matrix:r}=e;return t(Rs,{Array:e=>n(r(e)).valueOf(),Matrix:n,any:ee});function n(e){var t=e.size();let r;switch(t.length){case 1:r=e.clone();break;case 2:var n=t[0],i=t[1];if(0===i)throw new RangeError(\"Cannot transpose a 2D matrix with no columns (size: \"+S(t)+\")\");switch(e.storage()){case\"dense\":r=function(e,r,n){const i=e._data,a=[];let o;for(let t=0;t{let{typed:t,transpose:r,conj:n}=e;return t(Us,{any:function(e){return n(r(e))}})}),Ls=s(\"zeros\",[\"typed\",\"config\",\"matrix\",\"BigNumber\"],e=>{let{typed:t,config:r,matrix:i,BigNumber:a}=e;return t(\"zeros\",{\"\":function(){return\"Array\"===r.matrix?n([]):n([],\"default\")},\"...number | BigNumber | string\":function(e){var t;return\"string\"==typeof e[e.length-1]?(t=e.pop(),n(e,t)):\"Array\"===r.matrix?n(e):n(e,\"default\")},Array:n,Matrix:function(e){var t=e.storage();return n(e.valueOf(),t)},\"Array | Matrix, string\":function(e,t){return n(e.valueOf(),t)}});function n(e,t){const r=function(){let n=!1;return e.forEach(function(e,t,r){Q(e)&&(n=!0,r[t]=e.toNumber())}),n}(),n=r?new a(0):0;if(e.forEach(function(e){if(\"number\"!=typeof e||!v(e)||e<0)throw new Error(\"Parameters in function zeros must be positive integers\")}),t){const r=i(t);return 0{let{typed:t,addScalar:d,multiplyScalar:g,divideScalar:y,exp:x,tau:b,i:v,dotDivide:w,conj:N,pow:A,ceil:E,log2:S}=e;return t(\"fft\",{Array:M,Matrix:function(e){return e.create(M(e.valueOf()),e.datatype())}});function M(e){const t=T(e);return 1===t.length?C(e,t[0]):function r(n,i){const e=T(n);if(0!==i)return new Array(e[0]).fill(0).map((e,t)=>r(n[t],i-1));if(1===e.length)return C(n);function t(n){const t=T(n);return new Array(t[1]).fill(0).map((e,r)=>new Array(t[0]).fill(0).map((e,t)=>n[t][r]))}return t(r(t(n),1))}(e.map(e=>M(e,t.slice(1))),0)}function C(e){var t=e.length;if(1===t)return[e[0]];if(t%2!=0){var r=e;const n=r.length,i=x(y(g(-1,g(v,b)),n)),a=[];for(let e=1-n;eg(r[t],a[n-1+t])),...new Array(o-n).fill(0)],u=[...new Array(n+n-1).fill(0).map((e,t)=>y(1,a[t])),...new Array(o-(n+n-1)).fill(0)],l=C(s),c=C(u),f=new Array(o).fill(0).map((e,t)=>g(l[t],c[t])),p=w(N(M(N(f))),o),m=[];for(let e=n-1;et%2==0)),...C(e.filter((e,t)=>t%2==1))];for(let e=0;e{let{typed:t,fft:r,dotDivide:n,conj:i}=e;return t(\"ifft\",{\"Array | Matrix\":function(e){const t=_(e)?e.size():T(e);return n(i(r(i(e))),t.reduce((e,t)=>e*t,1))}})}),Gs=s(\"solveODE\",[\"typed\",\"add\",\"subtract\",\"multiply\",\"divide\",\"max\",\"map\",\"abs\",\"isPositive\",\"isNegative\",\"larger\",\"smaller\",\"matrix\",\"bignumber\",\"unaryMinus\"],e=>{let{typed:t,add:T,subtract:B,multiply:F,divide:D,max:O,map:_,abs:z,isPositive:q,isNegative:I,larger:k,smaller:R,matrix:a,bignumber:P,unaryMinus:U}=e;function i(C){return function(t,e,r,n){if(2!==e.length||!e.every(j)&&!e.every(L))throw new Error('\"tspan\" must be an Array of two numeric values or two units [tStart, tEnd]');const i=e[0],a=e[1],o=k(a,i),s=n.firstStep;if(void 0!==s&&!q(s))throw new Error('\"firstStep\" must be positive');const u=n.maxStep;if(void 0!==u&&!q(u))throw new Error('\"maxStep\" must be positive');const l=n.minStep;if(l&&I(l))throw new Error('\"minStep\" must be positive or zero');const c=[i,a,s,l,u].filter(e=>void 0!==e);if(!c.every(j)&&!c.every(L))throw new Error('Inconsistent type of \"t\" dependant variables');var f=n.tol||1e-4,p=n.minDelta||.2,m=n.maxDelta||5,h=n.maxIter||1e4,d=[i,a,...r,u,l].some(Q),[g,y,x,e]=d?[P(C.a),P(C.c),P(C.b),P(C.bp)]:[C.a,C.c,C.b,C.bp];let b=s?o?s:U(s):D(B(a,i),1);const v=[i],w=[r],N=B(x,e);let A=0,E=0;const S=o?R:k,M=function(){const i=o?k:R;return function(e,t,r){var n=T(e,r);return i(n,t)?B(t,e):r}}();for(;S(v[A],a);){const C=[];b=M(v[A],a,b),C.push(t(v[A],w[A]));for(let e=1;eL(e)?e.value:e)));Bh)throw new Error(\"Maximum number of iterations reached, try changing options\")}return{t:v,y:w}}}function s(e,t,r,n){return i({a:[[],[.5],[0,.75],[2/9,1/3,4/9]],c:[null,.5,.75,1],b:[2/9,1/3,4/9,0],bp:[7/24,.25,1/3,1/8]})(e,t,r,n)}function u(e,t,r,n){return i({a:[[],[.2],[.075,.225],[44/45,-56/15,32/9],[19372/6561,-25360/2187,64448/6561,-212/729],[9017/3168,-355/33,46732/5247,49/176,-5103/18656],[35/384,0,500/1113,125/192,-2187/6784,11/84]],c:[null,.2,.3,.8,8/9,1,1],b:[35/384,0,500/1113,125/192,-2187/6784,11/84,0],bp:[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,.025]})(e,t,r,n)}function o(e,t,r,n){const i=n.method||\"RK45\",a={RK23:s,RK45:u};if(i.toUpperCase()in a){const o={...n};return delete o.method,a[i.toUpperCase()](e,t,r,o)}{const e=Object.keys(a).map(e=>`\"${e}\"`),t=e.slice(0,-1).join(\", \")+\" and \"+e.slice(-1);throw new Error(`Unavailable method \"${i}\". Available methods are `+t)}}function j(e){return Q(e)||A(e)}function n(e,t,r,n){e=o(e,t.toArray(),r.toArray(),n);return{t:a(e.t),y:a(e.y)}}return t(\"solveODE\",{\"function, Array, Array, Object\":o,\"function, Matrix, Matrix, Object\":n,\"function, Array, Array\":(e,t,r)=>o(e,t,r,{}),\"function, Matrix, Matrix\":(e,t,r)=>n(e,t,r,{}),\"function, Array, number | BigNumber | Unit\":(e,t,r)=>{const n=o(e,t,[r],{});return{t:n.t,y:n.y.map(e=>e[0])}},\"function, Matrix, number | BigNumber | Unit\":(e,t,r)=>{const n=o(e,t.toArray(),[r],{});return{t:a(n.t),y:a(n.y.map(e=>e[0]))}},\"function, Array, number | BigNumber | Unit, Object\":(e,t,r,n)=>{const i=o(e,t,[r],n);return{t:i.t,y:i.y.map(e=>e[0])}},\"function, Matrix, number | BigNumber | Unit, Object\":(e,t,r,n)=>{const i=o(e,t.toArray(),[r],n);return{t:a(i.t),y:a(i.y.map(e=>e[0]))}}})}),Vs=s(\"erf\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"name\",{number:function(e){var t=Math.abs(e);return t>=Xs?ke(e):t<=Zs?ke(e)*function(e){var t=e*e;let r,n=Ys[0][4]*t,i=t;for(r=0;r<3;r+=1)n=(n+Ys[0][r])*t,i=(i+Js[0][r])*t;return e*(n+Ys[0][3])/(i+Js[0][3])}(t):t<=4?ke(e)*(1-function(e){let t,r=Ys[1][8]*e,n=e;for(t=0;t<7;t+=1)r=(r+Ys[1][t])*e,n=(n+Js[1][t])*e;var i=(r+Ys[1][7])/(n+Js[1][7]),a=parseInt(16*e)/16,o=(e-a)*(e+a);return Math.exp(-a*a)*Math.exp(-o)*i}(t)):ke(e)*(1-function(e){let t,r=1/(e*e),n=Ys[2][5]*r,i=r;for(t=0;t<4;t+=1)n=(n+Ys[2][t])*r,i=(i+Js[2][t])*r;var a=r*(n+Ys[2][4])/(i+Js[2][4]),a=(Ws-a)/e,e=(e-(r=parseInt(16*e)/16))*(e+r);return Math.exp(-r*r)*Math.exp(-e)*a}(t))},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Zs=.46875,Ws=.5641895835477563,Ys=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,2.1531153547440383e-8],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Js=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],Xs=Math.pow(2,53),Qs=s(\"zeta\",[\"typed\",\"config\",\"multiply\",\"pow\",\"divide\",\"factorial\",\"equal\",\"smallerEq\",\"isNegative\",\"gamma\",\"sin\",\"subtract\",\"add\",\"?Complex\",\"?BigNumber\",\"pi\"],e=>{let{typed:t,config:r,multiply:u,pow:l,divide:c,factorial:i,equal:n,smallerEq:f,isNegative:a,gamma:p,sin:m,subtract:h,add:d,Complex:o,BigNumber:s,pi:g}=e;return t(\"zeta\",{number:e=>y(e,e=>e,()=>20),BigNumber:e=>y(e,e=>new s(e),()=>Math.abs(Math.log10(r.relTol))),Complex:function(e){return 0===e.re&&0===e.im?new o(-.5):1===e.re?new o(NaN,NaN):e.re===1/0&&0===e.im?new o(1):e.im===1/0||e.re===-1/0?new o(NaN,NaN):x(e,e=>e,e=>Math.round(19.5+.9*Math.abs(e.im)),e=>e.re)}});function y(e,t,r){return n(e,0)?t(-.5):n(e,1)?t(NaN):isFinite(e)?x(e,t,r,e=>e):a(e)?t(NaN):t(1)}function x(e,r,t,n){var i=t(e);{if(n(e)>-(i-1)/2){var a=e,o=r(i),i=r,s=c(1,u(b(i(0),o),h(1,l(2,h(1,a)))));let t=i(0);for(let e=i(1);f(e,o);e=d(e,1))t=d(t,c(u((-1)**(e-1),b(e,o)),l(e,a)));return u(s,t)}return i=u(l(2,e),l(r(g),h(e,1))),i=u(i,m(u(c(r(g),2),e))),i=u(i,p(h(1,e))),u(i,x(h(1,e),r,t,n))}}function b(t,r){let n=t;for(let e=t;f(e,r);e=d(e,1)){const t=c(u(i(d(r,h(e,1))),l(4,e)),u(i(h(r,e)),i(u(2,e))));n=d(n,t)}return u(r,n)}}),Ks=s(\"mode\",[\"typed\",\"isNaN\",\"isNumeric\"],e=>{let{typed:t,isNaN:o,isNumeric:s}=e;return t(\"mode\",{\"Array | Matrix\":r,\"...\":r});function r(t){if(0===(t=E(t.valueOf())).length)throw new Error(\"Cannot calculate mode of an empty array\");const r={};let n=[],i=0;for(let e=0;ei&&(i=r[a],n=[a])}return n}});function eu(e,t,r){let n;return String(e).includes(\"Unexpected type\")?(n=2{let{typed:t,config:n,multiplyScalar:i,numeric:a}=e;return t(\"prod\",{\"Array | Matrix\":r,\"Array | Matrix, number | BigNumber\":function(e,t){throw new Error(\"prod(A, dim) is not yet supported\")},\"...\":r});function r(e){let r;if(ti(e,function(t){try{r=void 0===r?t:i(r,t)}catch(e){throw eu(e,\"prod\",t)}}),void 0===(r=\"string\"==typeof r?a(r,Ie(r,n)):r))throw new Error(\"Cannot calculate prod of an empty array\");return r}}),ru=s(\"format\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"format\",{any:S,\"any, Object | function | number | BigNumber\":S})}),nu=s(\"bin\",[\"typed\",\"format\"],e=>{let{typed:t,format:r}=e;return t(\"bin\",{\"number | BigNumber\":function(e){return r(e,{notation:\"bin\"})},\"number | BigNumber, number | BigNumber\":function(e,t){return r(e,{notation:\"bin\",wordSize:t})}})}),iu=s(\"oct\",[\"typed\",\"format\"],e=>{let{typed:t,format:r}=e;return t(\"oct\",{\"number | BigNumber\":function(e){return r(e,{notation:\"oct\"})},\"number | BigNumber, number | BigNumber\":function(e,t){return r(e,{notation:\"oct\",wordSize:t})}})}),au=s(\"hex\",[\"typed\",\"format\"],e=>{let{typed:t,format:r}=e;return t(\"hex\",{\"number | BigNumber\":function(e){return r(e,{notation:\"hex\"})},\"number | BigNumber, number | BigNumber\":function(e,t){return r(e,{notation:\"hex\",wordSize:t})}})}),ou=/\\$([\\w.]+)/g,su=s(\"print\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"print\",{\"string, Object | Array\":uu,\"string, Object | Array, number | Object\":uu})});function uu(e,i,a){return e.replace(ou,function(e,t){const r=t.split(\".\");let n=i[r.shift()];for(void 0!==n&&n.isMatrix&&(n=n.toArray());r.length&&void 0!==n;){const e=r.shift();n=e?n[e]:n+\".\"}return void 0!==n?j(n)?n:S(n,a):e})}const lu=s(\"to\",[\"typed\",\"matrix\",\"concat\"],e=>{let{typed:t,matrix:r,concat:n}=e;return t(\"to\",{\"Unit, Unit | string\":(e,t)=>e.to(t)},C({typed:t,matrix:r,concat:n})({Ds:!0}))}),cu=s(\"toBest\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"toBest\",{Unit:e=>e.toBest(),\"Unit, string\":(e,t)=>e.toBest(t.split(\",\")),\"Unit, string, Object\":(e,t,r)=>e.toBest(t.split(\",\"),r),\"Unit, Array\":(e,t)=>e.toBest(t),\"Unit, Array, Object\":(e,t,r)=>e.toBest(t,r)})}),fu=\"isPrime\",pu=s(fu,[\"typed\"],e=>{let t=e[\"typed\"];return t(fu,{number:function(t){if(t<=3)return 1ee=>le(e,t))})}),mu=s(\"numeric\",[\"number\",\"?bignumber\",\"?fraction\"],e=>{let{number:t,bignumber:r,fraction:n}=e;const i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:e=>t(e),BigNumber:r?e=>r(e):bs,bigint:e=>BigInt(e),Fraction:n?e=>n(e):vs};return function(e){var t=1{let t=e[\"typed\"];return t(hu,{\"number, number\":function(e,t){return e/t},\"Complex, Complex\":function(e,t){return e.div(t)},\"BigNumber, BigNumber\":function(e,t){return e.div(t)},\"bigint, bigint\":function(e,t){return e/t},\"Fraction, Fraction\":function(e,t){return e.div(t)},\"Unit, number | Complex | Fraction | BigNumber | Unit\":(e,t)=>e.divide(t),\"number | Fraction | Complex | BigNumber, Unit\":(e,t)=>t.divideInto(e)})}),gu=s(\"pow\",[\"typed\",\"config\",\"identity\",\"multiply\",\"matrix\",\"inv\",\"fraction\",\"number\",\"Complex\"],e=>{let{typed:t,config:n,identity:a,multiply:o,matrix:r,inv:s,number:i,fraction:u,Complex:l}=e;return t(\"pow\",{\"number, number\":c,\"Complex, Complex\":function(e,t){return e.pow(t)},\"BigNumber, BigNumber\":function(e,t){return t.isInteger()||0<=e||n.predictable?e.pow(t):new l(e.toNumber(),0).pow(t.toNumber(),0)},\"bigint, bigint\":(e,t)=>e**t,\"Fraction, Fraction\":function(e,t){var r=e.pow(t);if(null!=r)return r;if(n.predictable)throw new Error(\"Result of pow is non-rational and cannot be expressed as a fraction\");return c(e.valueOf(),t.valueOf())},\"Array, number\":f,\"Array, BigNumber\":function(e,t){return f(e,t.toNumber())},\"Matrix, number\":p,\"Matrix, BigNumber\":function(e,t){return p(e,t.toNumber())},\"Unit, number | BigNumber\":function(e,t){return e.pow(t)}});function c(e,t){if(n.predictable&&!v(t)&&e<0)try{const n=u(t),r=i(n);if((t===r||Math.abs((t-r)/t)<1e-14)&&n.d%2n===1n)return(n.n%2n===0n?1:-1)*Math.pow(-e,t)}catch(e){}return n.predictable&&(e<-1&&t===1/0||-1>=1,i=o(i,i);return n}function p(e,t){return r(f(e.valueOf(),t))}}),yu=\"Number of decimals in function round must be an integer\",xu=s(\"round\",[\"typed\",\"config\",\"matrix\",\"equalScalar\",\"zeros\",\"BigNumber\",\"DenseMatrix\"],e=>{let{typed:t,config:i,matrix:n,equalScalar:a,zeros:o,BigNumber:r,DenseMatrix:s}=e;const u=Aa({typed:t,equalScalar:a}),l=x({typed:t,DenseMatrix:s}),c=Ea({typed:t});function f(e){return Math.abs(Ve(e).exponent)}return t(\"round\",{number:function(e){var t=la(e,f(i.relTol));return la(Xe(e,t,i.relTol,i.absTol)?t:e)},\"number, number\":function(e,t){var r=f(i.relTol);if(r<=t)return la(e,t);r=la(e,r);return la(Xe(e,r,i.relTol,i.absTol)?r:e,t)},\"number, BigNumber\":function(e,t){if(t.isInteger())return new r(e).toDecimalPlaces(t.toNumber());throw new TypeError(yu)},Complex:function(e){return e.round()},\"Complex, number\":function(e,t){if(t%1)throw new TypeError(yu);return e.round(t)},\"Complex, BigNumber\":function(e,t){if(!t.isInteger())throw new TypeError(yu);t=t.toNumber();return e.round(t)},BigNumber:function(e){const t=new r(e).toDecimalPlaces(f(i.relTol));return(li(e,t,i.relTol,i.absTol)?t:e).toDecimalPlaces(0)},\"BigNumber, BigNumber\":function(e,t){if(!t.isInteger())throw new TypeError(yu);var r=f(i.relTol);if(r<=t)return e.toDecimalPlaces(t.toNumber());const n=e.toDecimalPlaces(r);return(li(e,n,i.relTol,i.absTol)?n:e).toDecimalPlaces(t.toNumber())},bigint:e=>e,\"bigint, number\":(e,t)=>e,\"bigint, BigNumber\":(e,t)=>e,Fraction:function(e){return e.round()},\"Fraction, number\":function(e,t){if(t%1)throw new TypeError(yu);return e.round(t)},\"Fraction, BigNumber\":function(e,t){if(t.isInteger())return e.round(t.toNumber());throw new TypeError(yu)},\"Unit, number, Unit\":t.referToSelf(n=>function(e,t,r){e=e.toNumeric(r);return r.multiply(n(e,t))}),\"Unit, BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>n(e,t.toNumber(),r)),\"Array | Matrix, number | BigNumber, Unit\":t.referToSelf(n=>(e,t,r)=>le(e,e=>n(e,t,r),!0)),\"Array | Matrix | Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e,0,t)),\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t,!0)),\"SparseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>u(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>c(e,t,r,!1)),\"Array, number | BigNumber\":t.referToSelf(r=>(e,t)=>c(n(e),t,r,!1).valueOf()),\"number | Complex | BigNumber | Fraction, SparseMatrix\":t.referToSelf(r=>(e,t)=>a(e,0)?o(t.size(),t.storage()):l(t,e,r,!0)),\"number | Complex | BigNumber | Fraction, DenseMatrix\":t.referToSelf(r=>(e,t)=>a(e,0)?o(t.size(),t.storage()):c(t,e,r,!0)),\"number | Complex | BigNumber | Fraction, Array\":t.referToSelf(r=>(e,t)=>c(n(t),e,r,!0).valueOf())})}),bu=Math.log(16),vu=s(\"log\",[\"config\",\"typed\",\"typeOf\",\"divideScalar\",\"Complex\"],e=>{let{typed:t,typeOf:n,config:r,divideScalar:i,Complex:a}=e;function o(e){return e.log()}function s(e){return o(new a(e,0))}return t(\"log\",{number:function(e){return(0<=e||r.predictable?ta:s)(e)},bigint:Qa(bu,ta,r,s),Complex:o,BigNumber:function(e){return!e.isNegative()||r.predictable?e.ln():s(e.toNumber())},\"any, any\":t.referToSelf(r=>(e,t)=>{if(\"Fraction\"===n(e)&&\"Fraction\"===n(t)){const r=e.log(t);if(null!==r)return r}return i(r(e),r(t))})})}),wu=s(\"log1p\",[\"typed\",\"config\",\"divideScalar\",\"log\",\"Complex\"],e=>{let{typed:t,config:r,divideScalar:n,log:i,Complex:a}=e;return t(\"log1p\",{number:function(e){return-1<=e||r.predictable?Ue(e):o(new a(e,0))},Complex:o,BigNumber:function(e){const t=e.plus(1);return!t.isNegative()||r.predictable?t.ln():o(new a(e.toNumber(),0))},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t)),\"any, any\":t.referToSelf(r=>(e,t)=>n(r(e),i(t)))});function o(e){var t=e.re+1;return new a(Math.log(Math.sqrt(t*t+e.im*e.im)),Math.atan2(e.im,t))}}),Nu=\"nthRoots\",Au=s(Nu,[\"config\",\"typed\",\"divideScalar\",\"Complex\"],e=>{let{typed:t,Complex:u}=e;const l=[function(e){return new u(e,0)},function(e){return new u(0,e)},function(e){return new u(-e,0)},function(e){return new u(0,-e)}];function r(e,t){if(t<0)throw new Error(\"Root must be greater than zero\");if(0===t)throw new Error(\"Root must be non-zero\");if(t%1!=0)throw new Error(\"Root must be an integer\");if(0===e||0===e.abs())return[new u(0,0)];const r=\"number\"==typeof e;let n;!r&&0!==e.re&&0!==e.im||(n=r?2*(e<0):0===e.im?2*(e.re<0):2*(e.im<0)+1);const i=e.arg(),a=e.abs(),o=[],s=Math.pow(a,1/t);for(let e=0;e{let{typed:t,equalScalar:r,matrix:n,pow:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e;const u=Pa({typed:t}),l=ko({typed:t,SparseMatrix:s}),c=Aa({typed:t,equalScalar:r}),f=x({typed:t,DenseMatrix:a}),p=C({typed:t,matrix:n,concat:o}),m={};for(const e in i.signatures)!Object.prototype.hasOwnProperty.call(i.signatures,e)||e.includes(\"Matrix\")||e.includes(\"Array\")||(m[e]=i.signatures[e]);e=t(m);return t(\"dotPow\",p({elop:e,SS:l,DS:u,Ss:c,sS:f}))}),Su=\"dotDivide\",Mu=s(Su,[\"typed\",\"matrix\",\"equalScalar\",\"divideScalar\",\"DenseMatrix\",\"concat\",\"SparseMatrix\"],e=>{let{typed:t,matrix:r,equalScalar:n,divideScalar:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e;const u=Ra({typed:t,equalScalar:n}),l=Pa({typed:t}),c=ko({typed:t,SparseMatrix:s}),f=Aa({typed:t,equalScalar:n}),p=x({typed:t,DenseMatrix:a}),m=C({typed:t,matrix:r,concat:o});return t(Su,m({elop:i,SS:c,DS:l,SD:u,Ss:f,sS:p}))});function Cu(e){let s=e[\"DenseMatrix\"];return function(r,t,n){const i=r.size();if(2!==i.length)throw new RangeError(\"Matrix must be two dimensional (size: \"+S(i)+\")\");var a=i[0];if(a!==i[1])throw new RangeError(\"Matrix must be square (size: \"+S(i)+\")\");let o=[];if(_(t)){const r=t.size(),i=t._data;if(1===r.length){if(r[0]!==a)throw new RangeError(\"Dimension mismatch. Matrix columns must match vector length.\");for(let e=0;e{let{typed:t,matrix:r,divideScalar:m,multiplyScalar:h,subtractScalar:d,equalScalar:g,DenseMatrix:y}=e;const x=Cu({DenseMatrix:y});return t(\"lsolve\",{\"SparseMatrix, Array | Matrix\":function(e,t){{var n=t;const a=(n=x(e,n,!0))._data,o=e._size[0],s=e._size[1],u=e._values,l=e._index,c=e._ptr,f=[];for(let r=0;rr&&(x.push(u[e]),o.push(a))}if(g(t,0))throw new Error(\"Linear system cannot be solved since matrix is singular\");var i=m(n,t);for(let e=0,t=o.length;e{let{typed:t,matrix:r,divideScalar:p,multiplyScalar:m,subtractScalar:h,equalScalar:d,DenseMatrix:g}=e;const y=Cu({DenseMatrix:g});return t(\"usolve\",{\"SparseMatrix, Array | Matrix\":function(e,t){{var n=t;const a=(n=y(e,n,!0))._data,o=e._size[0],s=e._size[1],u=e._values,l=e._index,c=e._ptr,f=[];for(let r=s-1;0<=r;r--){const n=a[r][0]||0;if(d(n,0))f[r]=[0];else{let t=0;const y=[],o=[],s=c[r];for(let e=c[r+1]-1;e>=s;e--){const a=l[e];a===r?t=u[e]:a{let{typed:t,matrix:r,divideScalar:m,multiplyScalar:h,subtractScalar:d,equalScalar:g,DenseMatrix:y}=e;const x=Cu({DenseMatrix:y});return t(Fu,{\"SparseMatrix, Array | Matrix\":function(e,t){{var i=t;const a=[x(e,i,!0)._data.map(e=>e[0])],o=e._size[0],s=e._size[1],u=e._values,l=e._index,c=e._ptr;for(let n=0;nn&&(o.push(u[e]),s.push(a))}if(g(t,0))if(g(x[n],0)){if(0===e){const i=[...x];i[n]=1;for(let e=0,t=s.length;enew y({data:e.map(e=>[e]),size:[o,1]}))}},\"DenseMatrix, Array | Matrix\":n,\"Array, Array | Matrix\":function(e,t){return n(r(e),t).map(e=>e.valueOf())}});function n(e,n){const i=[x(e,n,!0)._data.map(e=>e[0])],a=e._data,t=e._size[0],o=e._size[1];for(let r=0;rnew y({data:e.map(e=>[e]),size:[t,1]}))}}),Ou=\"usolveAll\",_u=s(Ou,[\"typed\",\"matrix\",\"divideScalar\",\"multiplyScalar\",\"subtractScalar\",\"equalScalar\",\"DenseMatrix\"],e=>{let{typed:t,matrix:r,divideScalar:p,multiplyScalar:m,subtractScalar:h,equalScalar:d,DenseMatrix:g}=e;const y=Cu({DenseMatrix:g});return t(Ou,{\"SparseMatrix, Array | Matrix\":function(e,t){{var i=t;const a=[y(e,i,!0)._data.map(e=>e[0])],o=e._size[0],s=e._size[1],u=e._values,l=e._index,c=e._ptr;for(let n=s-1;0<=n;n--){let r=a.length;for(let e=0;e=f;e--){const a=l[e];a===n?t=u[e]:anew g({data:e.map(e=>[e]),size:[o,1]}))}},\"DenseMatrix, Array | Matrix\":n,\"Array, Array | Matrix\":function(e,t){return n(r(e),t).map(e=>e.valueOf())}});function n(n,e){const i=[y(n,e,!0)._data.map(e=>e[0])],a=n._data,t=n._size[0];for(let r=n._size[1]-1;0<=r;r--){let t=i.length;for(let e=0;enew g({data:e.map(e=>[e]),size:[t,1]}))}}),zu=s(\"matAlgo08xS0Sid\",[\"typed\",\"equalScalar\"],e=>{let{typed:C,equalScalar:T}=e;return function(t,e,r){var n=t._values,i=t._index,a=t._ptr,o=t._size,s=t._datatype||void 0===t._data?t._datatype:t.getDataType(),u=e._values,l=e._index,c=e._ptr,f=e._size,p=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(o.length!==f.length)throw new z(o.length,f.length);if(o[0]!==f[0]||o[1]!==f[1])throw new RangeError(\"Dimension mismatch. Matrix A (\"+o+\") must match Matrix B (\"+f+\")\");if(!n||!u)throw new Error(\"Cannot perform operation on Pattern Sparse Matrices\");var f=o[0],m=o[1];let h,d=T,g=0,y=r;\"string\"==typeof s&&s===p&&\"mixed\"!==s&&(h=s,d=C.find(T,[h,h]),g=C.convert(0,h),y=C.find(r,[h,h]));const x=[],b=[],v=[],w=[],N=[];let A,E,S,M;for(let e=0;e{let{typed:t,matrix:n}=e;return{\"Array, number\":t.referTo(\"DenseMatrix, number\",r=>(e,t)=>r(n(e),t).valueOf()),\"Array, BigNumber\":t.referTo(\"DenseMatrix, BigNumber\",r=>(e,t)=>r(n(e),t).valueOf()),\"number, Array\":t.referTo(\"number, DenseMatrix\",r=>(e,t)=>r(e,n(t)).valueOf()),\"BigNumber, Array\":t.referTo(\"BigNumber, DenseMatrix\",r=>(e,t)=>r(e,n(t)).valueOf())}}),Iu=\"leftShift\",ku=s(Iu,[\"typed\",\"matrix\",\"equalScalar\",\"zeros\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e;const s=Ha({typed:t}),u=Ra({typed:t,equalScalar:n}),l=zu({typed:t,equalScalar:n}),c=Va({typed:t,DenseMatrix:a}),f=Aa({typed:t,equalScalar:n}),p=Ea({typed:t}),m=C({typed:t,matrix:r,concat:o}),h=qu({typed:t,matrix:r});return t(Iu,{\"number, number\":Do,\"BigNumber, BigNumber\":Eo,\"bigint, bigint\":(e,t)=>e<(e,t)=>n(t,0)?e.clone():f(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>n(t,0)?e.clone():p(e,t,r,!1)),\"number | BigNumber, SparseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):c(t,e,r,!0)),\"number | BigNumber, DenseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):p(t,e,r,!0))},h,m({SS:l,DS:s,SD:u}))}),Ru=\"rightArithShift\",Pu=s(Ru,[\"typed\",\"matrix\",\"equalScalar\",\"zeros\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e;const s=Ha({typed:t}),u=Ra({typed:t,equalScalar:n}),l=zu({typed:t,equalScalar:n}),c=Va({typed:t,DenseMatrix:a}),f=Aa({typed:t,equalScalar:n}),p=Ea({typed:t}),m=C({typed:t,matrix:r,concat:o}),h=qu({typed:t,matrix:r});return t(Ru,{\"number, number\":Oo,\"BigNumber, BigNumber\":So,\"bigint, bigint\":(e,t)=>e>>t,\"SparseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>n(t,0)?e.clone():f(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>n(t,0)?e.clone():p(e,t,r,!1)),\"number | BigNumber, SparseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):c(t,e,r,!0)),\"number | BigNumber, DenseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):p(t,e,r,!0))},h,m({SS:l,DS:s,SD:u}))}),Uu=\"rightLogShift\",ju=s(Uu,[\"typed\",\"matrix\",\"equalScalar\",\"zeros\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,zeros:i,DenseMatrix:a,concat:o}=e;const s=Ha({typed:t}),u=Ra({typed:t,equalScalar:n}),l=zu({typed:t,equalScalar:n}),c=Va({typed:t,DenseMatrix:a}),f=Aa({typed:t,equalScalar:n}),p=Ea({typed:t}),m=C({typed:t,matrix:r,concat:o}),h=qu({typed:t,matrix:r});return t(Uu,{\"number, number\":_o,\"SparseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>n(t,0)?e.clone():f(e,t,r,!1)),\"DenseMatrix, number | BigNumber\":t.referToSelf(r=>(e,t)=>n(t,0)?e.clone():p(e,t,r,!1)),\"number | BigNumber, SparseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):c(t,e,r,!0)),\"number | BigNumber, DenseMatrix\":t.referToSelf(r=>(e,t)=>n(e,0)?i(t.size(),t.storage()):p(t,e,r,!0))},h,m({SS:l,DS:s,SD:u}))}),Lu=s(\"and\",[\"typed\",\"matrix\",\"equalScalar\",\"zeros\",\"not\",\"concat\"],e=>{let{typed:t,matrix:n,equalScalar:r,zeros:i,not:a,concat:o}=e;const s=Ra({typed:t,equalScalar:r}),u=Ja({typed:t,equalScalar:r}),l=Aa({typed:t,equalScalar:r}),c=Ea({typed:t}),f=C({typed:t,matrix:n,concat:o});return t(\"and\",{\"number, number\":Zo,\"Complex, Complex\":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},\"BigNumber, BigNumber\":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},\"bigint, bigint\":Zo,\"Unit, Unit\":t.referToSelf(r=>(e,t)=>r(e.value||0,t.value||0)),\"SparseMatrix, any\":t.referToSelf(r=>(e,t)=>a(t)?i(e.size(),e.storage()):l(e,t,r,!1)),\"DenseMatrix, any\":t.referToSelf(r=>(e,t)=>a(t)?i(e.size(),e.storage()):c(e,t,r,!1)),\"any, SparseMatrix\":t.referToSelf(r=>(e,t)=>a(e)?i(e.size(),e.storage()):l(t,e,r,!0)),\"any, DenseMatrix\":t.referToSelf(r=>(e,t)=>a(e)?i(e.size(),e.storage()):c(t,e,r,!0)),\"Array, any\":t.referToSelf(r=>(e,t)=>r(n(e),t).valueOf()),\"any, Array\":t.referToSelf(r=>(e,t)=>r(e,n(t)).valueOf())},f({SS:u,DS:s}))}),$u=\"compare\",Hu=s($u,[\"typed\",\"config\",\"matrix\",\"equalScalar\",\"BigNumber\",\"Fraction\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,config:r,equalScalar:n,matrix:i,BigNumber:a,Fraction:o,DenseMatrix:s,concat:u}=e;const l=Pa({typed:t}),c=Ua({typed:t,equalScalar:n}),f=x({typed:t,DenseMatrix:s}),p=C({typed:t,matrix:i,concat:u}),m=wi({typed:t});return t($u,Gu({typed:t,config:r}),{\"boolean, boolean\":function(e,t){return e===t?0:t{let{typed:t,config:r}=e;return t($u,{\"number, number\":function(e,t){return Xe(e,t,r.relTol,r.absTol)?0:t{let{typed:t,compare:m}=e;const h=m.signatures[\"boolean,boolean\"];return t(Zu,{\"any, any\":function e(t,r){var n=K(t),i=K(r);let a;if(!(\"number\"!==n&&\"BigNumber\"!==n&&\"Fraction\"!==n||\"number\"!==i&&\"BigNumber\"!==i&&\"Fraction\"!==i))return\"0\"!==(a=m(t,r)).toString()?0r.re?1:t.rer.im?1:t.imi.length?1:n.length{let{typed:t,matrix:r,concat:n}=e;const i=C({typed:t,matrix:r,concat:n});return t(Yu,An,i({elop:An,Ds:!0}))})),Xu=\"equal\",Qu=s(Xu,[\"typed\",\"matrix\",\"equalScalar\",\"DenseMatrix\",\"concat\",\"SparseMatrix\"],e=>{let{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e;const s=Pa({typed:t}),u=ko({typed:t,SparseMatrix:o}),l=x({typed:t,DenseMatrix:i}),c=C({typed:t,matrix:r,concat:a});return t(Xu,Ku({typed:t,equalScalar:n}),c({elop:n,SS:u,DS:s,Ss:l}))}),Ku=s(Xu,[\"typed\",\"equalScalar\"],e=>{let{typed:t,equalScalar:r}=e;return t(Xu,{\"any, any\":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)}})}),el=\"equalText\",tl=s(el,[\"typed\",\"compareText\",\"isZero\"],e=>{let{typed:t,compareText:r,isZero:n}=e;return t(el,{\"any, any\":function(e,t){return n(r(e,t))}})}),rl=\"smaller\",nl=s(rl,[\"typed\",\"config\",\"bignumber\",\"matrix\",\"DenseMatrix\",\"concat\",\"SparseMatrix\"],e=>{let{typed:t,config:r,bignumber:n,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e;const u=Pa({typed:t}),l=ko({typed:t,SparseMatrix:s}),c=x({typed:t,DenseMatrix:a}),f=C({typed:t,matrix:i,concat:o}),p=wi({typed:t});function m(e,t){return e.lt(t)&&!li(e,t,r.relTol,r.absTol)}return t(rl,il({typed:t,config:r}),{\"boolean, boolean\":(e,t)=>ee-1===e.compare(t),\"Fraction, BigNumber\":function(e,t){return m(n(e),t)},\"BigNumber, Fraction\":function(e,t){return m(e,n(t))},\"Complex, Complex\":function(e,t){throw new TypeError(\"No ordering relation is defined for complex numbers\")}},p,f({SS:l,DS:u,Ss:c}))}),il=s(rl,[\"typed\",\"config\"],e=>{let{typed:t,config:r}=e;return t(rl,{\"number, number\":function(e,t){return e{let{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e;const s=Pa({typed:t}),u=ko({typed:t,SparseMatrix:o}),l=x({typed:t,DenseMatrix:i}),c=C({typed:t,matrix:n,concat:a}),f=wi({typed:t});return t(al,sl({typed:t,config:r}),{\"boolean, boolean\":(e,t)=>e<=t,\"BigNumber, BigNumber\":function(e,t){return e.lte(t)||li(e,t,r.relTol,r.absTol)},\"bigint, bigint\":(e,t)=>e<=t,\"Fraction, Fraction\":(e,t)=>1!==e.compare(t),\"Complex, Complex\":function(){throw new TypeError(\"No ordering relation is defined for complex numbers\")}},f,c({SS:u,DS:s,Ss:l}))}),sl=s(al,[\"typed\",\"config\"],e=>{let{typed:t,config:r}=e;return t(al,{\"number, number\":function(e,t){return e<=t||Xe(e,t,r.relTol,r.absTol)}})}),ul=\"larger\",ll=s(ul,[\"typed\",\"config\",\"bignumber\",\"matrix\",\"DenseMatrix\",\"concat\",\"SparseMatrix\"],e=>{let{typed:t,config:r,bignumber:n,matrix:i,DenseMatrix:a,concat:o,SparseMatrix:s}=e;const u=Pa({typed:t}),l=ko({typed:t,SparseMatrix:s}),c=x({typed:t,DenseMatrix:a}),f=C({typed:t,matrix:i,concat:o}),p=wi({typed:t});function m(e,t){return e.gt(t)&&!li(e,t,r.relTol,r.absTol)}return t(ul,cl({typed:t,config:r}),{\"boolean, boolean\":(e,t)=>tt1===e.compare(t),\"Fraction, BigNumber\":function(e,t){return m(n(e),t)},\"BigNumber, Fraction\":function(e,t){return m(e,n(t))},\"Complex, Complex\":function(){throw new TypeError(\"No ordering relation is defined for complex numbers\")}},p,f({SS:l,DS:u,Ss:c}))}),cl=s(ul,[\"typed\",\"config\"],e=>{let{typed:t,config:r}=e;return t(ul,{\"number, number\":function(e,t){return t{let{typed:t,config:r,matrix:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e;const s=Pa({typed:t}),u=ko({typed:t,SparseMatrix:o}),l=x({typed:t,DenseMatrix:i}),c=C({typed:t,matrix:n,concat:a}),f=wi({typed:t});return t(fl,ml({typed:t,config:r}),{\"boolean, boolean\":(e,t)=>t<=e,\"BigNumber, BigNumber\":function(e,t){return e.gte(t)||li(e,t,r.relTol,r.absTol)},\"bigint, bigint\":function(e,t){return t<=e},\"Fraction, Fraction\":(e,t)=>-1!==e.compare(t),\"Complex, Complex\":function(){throw new TypeError(\"No ordering relation is defined for complex numbers\")}},f,c({SS:u,DS:s,Ss:l}))}),ml=s(fl,[\"typed\",\"config\"],e=>{let{typed:t,config:r}=e;return t(fl,{\"number, number\":function(e,t){return t<=e||Xe(e,t,r.relTol,r.absTol)}})}),hl=\"deepEqual\",dl=s(hl,[\"typed\",\"equal\"],e=>{let{typed:t,equal:i}=e;return t(hl,{\"any, any\":function(e,t){return function t(r,n){if(Array.isArray(r)){if(Array.isArray(n)){const i=r.length;if(i!==n.length)return!1;for(let e=0;e{let{typed:t,equalScalar:r,matrix:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e;const s=Pa({typed:t}),u=ko({typed:t,SparseMatrix:o}),l=x({typed:t,DenseMatrix:i}),c=C({typed:t,matrix:n,concat:a});return t(gl,xl({typed:t,equalScalar:r}),c({elop:function(e,t){return!r(e,t)},SS:u,DS:s,Ss:l}))}),xl=s(gl,[\"typed\",\"equalScalar\"],e=>{let{typed:t,equalScalar:r}=e;return t(gl,{\"any, any\":function(e,t){return null===e?null!==t:null===t?null!==e:void 0===e?void 0!==t:void 0===t?void 0!==e:!r(e,t)}})}),bl=\"partitionSelect\",vl=s(bl,[\"typed\",\"isNumeric\",\"isNaN\",\"compare\"],e=>{let{typed:t,isNumeric:u,isNaN:l,compare:r}=e;const n=r,i=(e,t)=>-r(e,t);return t(bl,{\"Array | Matrix, number\":function(e,t){return a(e,t,n)},\"Array | Matrix, number, string\":function(e,t,r){if(\"asc\"===r)return a(e,t,n);if(\"desc\"===r)return a(e,t,i);throw new Error('Compare string must be \"asc\" or \"desc\"')},\"Array | Matrix, number, function\":a});function a(e,t,r){if(!v(t)||t<0)throw new Error(\"k must be a non-negative integer\");if(_(e)){if(1=r.length)throw new Error(\"k out of bounds\");for(let e=0;e{let{typed:t,matrix:r,compare:n,compareNatural:i}=e;const a=n,o=(e,t)=>-n(e,t);return t(\"sort\",{Array:function(e){return u(e),e.sort(a)},Matrix:function(e){return l(e),r(e.toArray().sort(a),e.storage())},\"Array, function\":function(e,t){return u(e),e.sort(t)},\"Matrix, function\":function(e,t){return l(e),r(e.toArray().sort(t),e.storage())},\"Array, string\":function(e,t){return u(e),e.sort(s(t))},\"Matrix, string\":function(e,t){return l(e),r(e.toArray().sort(s(t)),e.storage())}});function s(e){if(\"asc\"===e)return a;if(\"desc\"===e)return o;if(\"natural\"===e)return i;throw new Error('String \"asc\", \"desc\", or \"natural\" expected')}function u(e){if(1!==T(e).length)throw new Error(\"One dimensional array expected\")}function l(e){if(1!==e.size().length)throw new Error(\"One dimensional matrix expected\")}}),Nl=s(\"max\",[\"typed\",\"config\",\"numeric\",\"larger\",\"isNaN\"],e=>{let{typed:t,config:n,numeric:i,larger:a,isNaN:o}=e;return t(\"max\",{\"Array | Matrix\":s,\"Array | Matrix, number | BigNumber\":function(e,t){return ri(e,t.valueOf(),r)},\"...\":function(e){if(ei(e))throw new TypeError(\"Scalar values expected in function max\");return s(e)}});function r(e,t){try{return a(e,t)?e:t}catch(e){throw eu(e,\"max\",t)}}function s(e){let r;if(ti(e,function(t){try{(o(t)||void 0===r||a(t,r))&&(r=t)}catch(e){throw eu(e,\"max\",t)}}),void 0===r)throw new Error(\"Cannot calculate max of an empty array\");return r=\"string\"==typeof r?i(r,Ie(r,n)):r}}),Al=s(\"min\",[\"typed\",\"config\",\"numeric\",\"smaller\",\"isNaN\"],e=>{let{typed:t,config:n,numeric:i,smaller:a,isNaN:o}=e;return t(\"min\",{\"Array | Matrix\":s,\"Array | Matrix, number | BigNumber\":function(e,t){return ri(e,t.valueOf(),r)},\"...\":function(e){if(ei(e))throw new TypeError(\"Scalar values expected in function min\");return s(e)}});function r(e,t){try{return a(e,t)?e:t}catch(e){throw eu(e,\"min\",t)}}function s(e){let r;if(ti(e,function(t){try{(o(t)||void 0===r||a(t,r))&&(r=t)}catch(e){throw eu(e,\"min\",t)}}),void 0===r)throw new Error(\"Cannot calculate min of an empty array\");return r=\"string\"==typeof r?i(r,Ie(r,n)):r}}),El=s(\"ImmutableDenseMatrix\",[\"smaller\",\"DenseMatrix\"],e=>{let{smaller:r,DenseMatrix:n}=e;function i(e,t){if(!(this instanceof i))throw new SyntaxError(\"Constructor must be called with the new operator\");if(t&&!j(t))throw new Error(\"Invalid datatype: \"+t);if(_(e)||b(e)){const i=new n(e,t);this._data=i._data,this._size=i._size,this._datatype=i._datatype,this._min=null,this._max=null}else if(e&&b(e.data)&&b(e.size))this._data=e.data,this._size=e.size,this._datatype=e.datatype,this._min=void 0!==e.min?e.min:null,this._max=void 0!==e.max?e.max:null;else{if(e)throw new TypeError(\"Unsupported type of data (\"+K(e)+\")\");this._data=[],this._size=[0],this._datatype=t,this._min=null,this._max=null}}return i.prototype=new n,i.prototype.type=\"ImmutableDenseMatrix\",i.prototype.isImmutableDenseMatrix=!0,i.prototype.subset=function(e){switch(arguments.length){case 1:var t=n.prototype.subset.call(this,e);return _(t)?new i({data:t._data,size:t._size,datatype:t._datatype}):t;case 2:case 3:throw new Error(\"Cannot invoke set subset on an Immutable Matrix instance\");default:throw new SyntaxError(\"Wrong number of arguments\")}},i.prototype.set=function(){throw new Error(\"Cannot invoke set on an Immutable Matrix instance\")},i.prototype.resize=function(){throw new Error(\"Cannot invoke resize on an Immutable Matrix instance\")},i.prototype.reshape=function(){throw new Error(\"Cannot invoke reshape on an Immutable Matrix instance\")},i.prototype.clone=function(){return new i({data:ee(this._data),size:ee(this._size),datatype:this._datatype})},i.prototype.toJSON=function(){return{mathjs:\"ImmutableDenseMatrix\",data:this._data,size:this._size,datatype:this._datatype}},i.fromJSON=function(e){return new i(e)},i.prototype.swapRows=function(){throw new Error(\"Cannot invoke swapRows on an Immutable Matrix instance\")},i.prototype.min=function(){if(null===this._min){let t=null;this.forEach(function(e){null!==t&&!r(e,t)||(t=e)}),this._min=null!==t?t:void 0}return this._min},i.prototype.max=function(){if(null===this._max){let t=null;this.forEach(function(e){null!==t&&!r(t,e)||(t=e)}),this._max=null!==t?t:void 0}return this._max},i},{isClass:!0}),Sl=s(\"Index\",[\"ImmutableDenseMatrix\",\"getMatrixDataType\"],e=>{let{ImmutableDenseMatrix:t,getMatrixDataType:o}=e;function s(e){if(!(this instanceof s))throw new SyntaxError(\"Constructor must be called with the new operator\");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(let e=0,t=arguments.length;e{e&&r.push(t)}),r}const Cl=s(\"FibonacciHeap\",[\"smaller\",\"larger\"],e=>{let{smaller:s,larger:u}=e;const l=1/Math.log((1+Math.sqrt(5))/2);function t(){if(!(this instanceof t))throw new SyntaxError(\"Constructor must be called with the new operator\");this._minimum=null,this._size=0}function i(e,t,r){t.left.right=t.right,t.right.left=t.left,r.degree--,r.child===t&&(r.child=t.right),0===r.degree&&(r.child=null),t.left=e,t.right=e.right,((e.right=t).right.left=t).parent=null,t.mark=!1}t.prototype.type=\"FibonacciHeap\",t.prototype.isFibonacciHeap=!0,t.prototype.insert=function(e,t){const r={key:e,value:t,degree:0};if(this._minimum){const t=this._minimum;r.left=t,r.right=t.right,(t.right=r).right.left=r,s(e,t.key)&&(this._minimum=r)}else(r.left=r).right=r,this._minimum=r;return this._size++,r},t.prototype.size=function(){return this._size},t.prototype.clear=function(){this._minimum=null,this._size=0},t.prototype.isEmpty=function(){return 0===this._size},t.prototype.extractMinimum=function(){const e=this._minimum;if(null===e)return e;let t=this._minimum,r=e.degree,n=e.child;for(;0{let{addScalar:n,equalScalar:s,FibonacciHeap:t}=e;function r(){if(!(this instanceof r))throw new SyntaxError(\"Constructor must be called with the new operator\");this._values=[],this._heap=new t}return r.prototype.type=\"Spa\",r.prototype.isSpa=!0,r.prototype.set=function(e,t){this._values[e]?this._values[e].value=t:(t=this._heap.insert(e,t),this._values[e]=t)},r.prototype.get=function(e){e=this._values[e];return e?e.value:0},r.prototype.accumulate=function(e,t){let r=this._values[e];r?r.value=n(r.value,t):(r=this._heap.insert(e,t),this._values[e]=r)},r.prototype.forEach=function(e,t,r){const n=this._heap,i=this._values,a=[];let o=n.extractMinimum();for(o&&a.push(o);o&&o.key<=t;)o.key>=e&&(s(o.value,0)||r(o.key,o.value,this)),(o=n.extractMinimum())&&a.push(o);for(let e=0;e{let{on:t,config:c,addScalar:l,subtractScalar:f,multiplyScalar:p,divideScalar:o,pow:s,abs:u,fix:m,round:I,equal:h,isNumeric:k,format:R,number:r,Complex:P,BigNumber:d,Fraction:g}=e;const U=r;function y(e,t){if(!(this instanceof y))throw new Error(\"Constructor must be called with the new operator\");if(null!=e&&!k(e)&&!te(e))throw new TypeError(\"First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined\");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,void 0===t)this.units=[],this.dimensions=B.map(e=>0);else if(\"string\"==typeof t){const e=y.parse(t);this.units=e.units,this.dimensions=e.dimensions}else{if(!L(t)||null!==t.value)throw new TypeError(\"Second parameter in Unit constructor must be a string or valueless Unit\");this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map(e=>gn({},e))}this.value=this._normalize(e)}let x,b,v;function w(){for(;\" \"===v||\"\\t\"===v;)A()}function N(e){return\"0\"<=e&&e<=\"9\"}function A(){b++,v=x.charAt(b)}function n(e){b=e,v=x.charAt(b)}function E(){let t=\"\";var e=b;if(\"+\"===v?A():\"-\"===v&&(t+=v,A()),!(\"0\"<=(r=v)&&r<=\"9\"||\".\"===r))return n(e),null;if(\".\"===v){if(t+=v,A(),!N(v))return n(e),null}else{for(;N(v);)t+=v,A();\".\"===v&&(t+=v,A())}for(;N(v);)t+=v,A();if(\"E\"===v||\"e\"===v){let e=\"\";var r=b;if(e+=v,A(),\"+\"!==v&&\"-\"!==v||(e+=v,A()),!N(v))return n(r),t;for(t+=e;N(v);)t+=v,A()}return t}function S(e){return v===e&&(A(),e)}Object.defineProperty(y,\"name\",{value:\"Unit\"}),(y.prototype.constructor=y).prototype.type=\"Unit\",y.prototype.isUnit=!0,y.parse=function(e,r){if(r=r||{},x=e,b=-1,v=\"\",\"string\"!=typeof x)throw new TypeError(\"Invalid argument in Unit.parse, string expected\");const n=new y;let i=1,a=!(n.units=[]);A(),w();var o,t=E();let s=null;if(t){if(\"BigNumber\"===c.number)s=new d(t);else if(\"Fraction\"===c.number)try{s=new g(t)}catch(e){s=parseFloat(t)}else s=parseFloat(t);w(),S(\"*\")?(i=1,a=!0):S(\"/\")&&(i=-1,a=!0)}const u=[];let l=1;for(;;){for(w();\"(\"===v;)u.push(i),l*=i,i=1,A(),w();if(!v)break;{const e=v;if(null===(o=function(){let e=\"\";for(;N(v)||y.isValidAlpha(v);)e+=v,A();var t=e.charAt(0);return y.isValidAlpha(t)?e:null}()))throw new SyntaxError('Unexpected \"'+e+'\" in \"'+x+'\" at index '+b.toString())}const c=M(o);if(null===c)throw new SyntaxError('Unit \"'+o+'\" not found.');let t=i*l;if(w(),S(\"^\")){w();const r=E();if(null===r)throw new SyntaxError('In \"'+e+'\", \"^\" must be followed by a floating-point number');t*=r}n.units.push({unit:c.unit,prefix:c.prefix,power:t});for(let e=0;e{var t;if(ue(D,e))return{unit:t=D[e],prefix:t.prefixes[\"\"]};for(const o in D)if(ue(D,o)&&(r=e,a=o,n=void 0,i=void 0,n=r.length-a.length,i=r.length,r.substring(n,i)===a)){var r=D[o],n=e.length-o.length,i=e.substring(0,n),a=ue(r.prefixes,i)?r.prefixes[i]:void 0;if(void 0!==a)return{unit:r,prefix:a}}return null},{hasher:e=>e[0],limit:100});function a(e){return e.equalBase(F.NONE)&&null!==e.value&&!c.predictable?e.value:e}function C(e){return y._getNumberConverter(K(e))(1)}function i(e,t){t=1{let t=null;if(\"string\"==typeof e){if(!(t=y.parse(e)))throw new Error(\"Invalid unit type. Expected compatible string or Unit.\")}else if(!L(e))throw new Error(\"Invalid unit type. Expected compatible string or Unit.\");null===t&&(t=e.clone());try{return this.to(t.formatUnits()),t}catch(e){throw new Error(\"Invalid unit type. Expected compatible string or Unit.\")}}).map(e=>e.units[0].prefix);this.units[0].unit.prefixes=t.reduce((e,t)=>(e[t.name]=t,e),{}),this.units[0].prefix=t[0]}const n=i(this,t).simp;return this.units[0].unit.prefixes=r,n.fixPrefix=!0,n},y.prototype.format=function(e){var{simp:e,valueStr:t,unitStr:r}=i(this,e);let n=t;return e.value&&te(e.value)&&(n=\"(\"+n+\")\"),00)},D={meter:{name:\"meter\",base:F.LENGTH,prefixes:T.LONG,value:1,offset:0},inch:{name:\"inch\",base:F.LENGTH,prefixes:T.NONE,value:.0254,offset:0},foot:{name:\"foot\",base:F.LENGTH,prefixes:T.NONE,value:.3048,offset:0},yard:{name:\"yard\",base:F.LENGTH,prefixes:T.NONE,value:.9144,offset:0},mile:{name:\"mile\",base:F.LENGTH,prefixes:T.NONE,value:1609.344,offset:0},link:{name:\"link\",base:F.LENGTH,prefixes:T.NONE,value:.201168,offset:0},rod:{name:\"rod\",base:F.LENGTH,prefixes:T.NONE,value:5.0292,offset:0},chain:{name:\"chain\",base:F.LENGTH,prefixes:T.NONE,value:20.1168,offset:0},angstrom:{name:\"angstrom\",base:F.LENGTH,prefixes:T.NONE,value:1e-10,offset:0},m:{name:\"m\",base:F.LENGTH,prefixes:T.SHORT,value:1,offset:0},in:{name:\"in\",base:F.LENGTH,prefixes:T.NONE,value:.0254,offset:0},ft:{name:\"ft\",base:F.LENGTH,prefixes:T.NONE,value:.3048,offset:0},yd:{name:\"yd\",base:F.LENGTH,prefixes:T.NONE,value:.9144,offset:0},mi:{name:\"mi\",base:F.LENGTH,prefixes:T.NONE,value:1609.344,offset:0},li:{name:\"li\",base:F.LENGTH,prefixes:T.NONE,value:.201168,offset:0},rd:{name:\"rd\",base:F.LENGTH,prefixes:T.NONE,value:5.02921,offset:0},ch:{name:\"ch\",base:F.LENGTH,prefixes:T.NONE,value:20.1168,offset:0},mil:{name:\"mil\",base:F.LENGTH,prefixes:T.NONE,value:254e-7,offset:0},m2:{name:\"m2\",base:F.SURFACE,prefixes:T.SQUARED,value:1,offset:0},sqin:{name:\"sqin\",base:F.SURFACE,prefixes:T.NONE,value:64516e-8,offset:0},sqft:{name:\"sqft\",base:F.SURFACE,prefixes:T.NONE,value:.09290304,offset:0},sqyd:{name:\"sqyd\",base:F.SURFACE,prefixes:T.NONE,value:.83612736,offset:0},sqmi:{name:\"sqmi\",base:F.SURFACE,prefixes:T.NONE,value:2589988.110336,offset:0},sqrd:{name:\"sqrd\",base:F.SURFACE,prefixes:T.NONE,value:25.29295,offset:0},sqch:{name:\"sqch\",base:F.SURFACE,prefixes:T.NONE,value:404.6873,offset:0},sqmil:{name:\"sqmil\",base:F.SURFACE,prefixes:T.NONE,value:6.4516e-10,offset:0},acre:{name:\"acre\",base:F.SURFACE,prefixes:T.NONE,value:4046.86,offset:0},hectare:{name:\"hectare\",base:F.SURFACE,prefixes:T.NONE,value:1e4,offset:0},m3:{name:\"m3\",base:F.VOLUME,prefixes:T.CUBIC,value:1,offset:0},L:{name:\"L\",base:F.VOLUME,prefixes:T.SHORT,value:.001,offset:0},l:{name:\"l\",base:F.VOLUME,prefixes:T.SHORT,value:.001,offset:0},litre:{name:\"litre\",base:F.VOLUME,prefixes:T.LONG,value:.001,offset:0},cuin:{name:\"cuin\",base:F.VOLUME,prefixes:T.NONE,value:16387064e-12,offset:0},cuft:{name:\"cuft\",base:F.VOLUME,prefixes:T.NONE,value:.028316846592,offset:0},cuyd:{name:\"cuyd\",base:F.VOLUME,prefixes:T.NONE,value:.764554857984,offset:0},teaspoon:{name:\"teaspoon\",base:F.VOLUME,prefixes:T.NONE,value:5e-6,offset:0},tablespoon:{name:\"tablespoon\",base:F.VOLUME,prefixes:T.NONE,value:15e-6,offset:0},drop:{name:\"drop\",base:F.VOLUME,prefixes:T.NONE,value:5e-8,offset:0},gtt:{name:\"gtt\",base:F.VOLUME,prefixes:T.NONE,value:5e-8,offset:0},minim:{name:\"minim\",base:F.VOLUME,prefixes:T.NONE,value:6.1611519921875e-8,offset:0},fluiddram:{name:\"fluiddram\",base:F.VOLUME,prefixes:T.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:\"fluidounce\",base:F.VOLUME,prefixes:T.NONE,value:295735295625e-16,offset:0},gill:{name:\"gill\",base:F.VOLUME,prefixes:T.NONE,value:.00011829411825,offset:0},cc:{name:\"cc\",base:F.VOLUME,prefixes:T.NONE,value:1e-6,offset:0},cup:{name:\"cup\",base:F.VOLUME,prefixes:T.NONE,value:.0002365882365,offset:0},pint:{name:\"pint\",base:F.VOLUME,prefixes:T.NONE,value:.000473176473,offset:0},quart:{name:\"quart\",base:F.VOLUME,prefixes:T.NONE,value:.000946352946,offset:0},gallon:{name:\"gallon\",base:F.VOLUME,prefixes:T.NONE,value:.003785411784,offset:0},beerbarrel:{name:\"beerbarrel\",base:F.VOLUME,prefixes:T.NONE,value:.117347765304,offset:0},oilbarrel:{name:\"oilbarrel\",base:F.VOLUME,prefixes:T.NONE,value:.158987294928,offset:0},hogshead:{name:\"hogshead\",base:F.VOLUME,prefixes:T.NONE,value:.238480942392,offset:0},g:{name:\"g\",base:F.MASS,prefixes:T.SHORT,value:.001,offset:0},gram:{name:\"gram\",base:F.MASS,prefixes:T.LONG,value:.001,offset:0},ton:{name:\"ton\",base:F.MASS,prefixes:T.SHORT,value:907.18474,offset:0},t:{name:\"t\",base:F.MASS,prefixes:T.SHORT,value:1e3,offset:0},tonne:{name:\"tonne\",base:F.MASS,prefixes:T.LONG,value:1e3,offset:0},grain:{name:\"grain\",base:F.MASS,prefixes:T.NONE,value:6479891e-11,offset:0},dram:{name:\"dram\",base:F.MASS,prefixes:T.NONE,value:.0017718451953125,offset:0},ounce:{name:\"ounce\",base:F.MASS,prefixes:T.NONE,value:.028349523125,offset:0},poundmass:{name:\"poundmass\",base:F.MASS,prefixes:T.NONE,value:.45359237,offset:0},hundredweight:{name:\"hundredweight\",base:F.MASS,prefixes:T.NONE,value:45.359237,offset:0},stick:{name:\"stick\",base:F.MASS,prefixes:T.NONE,value:.115,offset:0},stone:{name:\"stone\",base:F.MASS,prefixes:T.NONE,value:6.35029318,offset:0},gr:{name:\"gr\",base:F.MASS,prefixes:T.NONE,value:6479891e-11,offset:0},dr:{name:\"dr\",base:F.MASS,prefixes:T.NONE,value:.0017718451953125,offset:0},oz:{name:\"oz\",base:F.MASS,prefixes:T.NONE,value:.028349523125,offset:0},lbm:{name:\"lbm\",base:F.MASS,prefixes:T.NONE,value:.45359237,offset:0},cwt:{name:\"cwt\",base:F.MASS,prefixes:T.NONE,value:45.359237,offset:0},s:{name:\"s\",base:F.TIME,prefixes:T.SHORT,value:1,offset:0},min:{name:\"min\",base:F.TIME,prefixes:T.NONE,value:60,offset:0},h:{name:\"h\",base:F.TIME,prefixes:T.NONE,value:3600,offset:0},second:{name:\"second\",base:F.TIME,prefixes:T.LONG,value:1,offset:0},sec:{name:\"sec\",base:F.TIME,prefixes:T.LONG,value:1,offset:0},minute:{name:\"minute\",base:F.TIME,prefixes:T.NONE,value:60,offset:0},hour:{name:\"hour\",base:F.TIME,prefixes:T.NONE,value:3600,offset:0},day:{name:\"day\",base:F.TIME,prefixes:T.NONE,value:86400,offset:0},week:{name:\"week\",base:F.TIME,prefixes:T.NONE,value:604800,offset:0},month:{name:\"month\",base:F.TIME,prefixes:T.NONE,value:2629800,offset:0},year:{name:\"year\",base:F.TIME,prefixes:T.NONE,value:31557600,offset:0},decade:{name:\"decade\",base:F.TIME,prefixes:T.NONE,value:315576e3,offset:0},century:{name:\"century\",base:F.TIME,prefixes:T.NONE,value:315576e4,offset:0},millennium:{name:\"millennium\",base:F.TIME,prefixes:T.NONE,value:315576e5,offset:0},hertz:{name:\"Hertz\",base:F.FREQUENCY,prefixes:T.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:\"Hz\",base:F.FREQUENCY,prefixes:T.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:\"rad\",base:F.ANGLE,prefixes:T.SHORT,value:1,offset:0},radian:{name:\"radian\",base:F.ANGLE,prefixes:T.LONG,value:1,offset:0},deg:{name:\"deg\",base:F.ANGLE,prefixes:T.SHORT,value:null,offset:0},degree:{name:\"degree\",base:F.ANGLE,prefixes:T.LONG,value:null,offset:0},grad:{name:\"grad\",base:F.ANGLE,prefixes:T.SHORT,value:null,offset:0},gradian:{name:\"gradian\",base:F.ANGLE,prefixes:T.LONG,value:null,offset:0},cycle:{name:\"cycle\",base:F.ANGLE,prefixes:T.NONE,value:null,offset:0},arcsec:{name:\"arcsec\",base:F.ANGLE,prefixes:T.NONE,value:null,offset:0},arcmin:{name:\"arcmin\",base:F.ANGLE,prefixes:T.NONE,value:null,offset:0},A:{name:\"A\",base:F.CURRENT,prefixes:T.SHORT,value:1,offset:0},ampere:{name:\"ampere\",base:F.CURRENT,prefixes:T.LONG,value:1,offset:0},K:{name:\"K\",base:F.TEMPERATURE,prefixes:T.SHORT,value:1,offset:0},degC:{name:\"degC\",base:F.TEMPERATURE,prefixes:T.SHORT,value:1,offset:273.15},degF:{name:\"degF\",base:F.TEMPERATURE,prefixes:T.SHORT,value:new g(5,9),offset:459.67},degR:{name:\"degR\",base:F.TEMPERATURE,prefixes:T.SHORT,value:new g(5,9),offset:0},kelvin:{name:\"kelvin\",base:F.TEMPERATURE,prefixes:T.LONG,value:1,offset:0},celsius:{name:\"celsius\",base:F.TEMPERATURE,prefixes:T.LONG,value:1,offset:273.15},fahrenheit:{name:\"fahrenheit\",base:F.TEMPERATURE,prefixes:T.LONG,value:new g(5,9),offset:459.67},rankine:{name:\"rankine\",base:F.TEMPERATURE,prefixes:T.LONG,value:new g(5,9),offset:0},mol:{name:\"mol\",base:F.AMOUNT_OF_SUBSTANCE,prefixes:T.SHORT,value:1,offset:0},mole:{name:\"mole\",base:F.AMOUNT_OF_SUBSTANCE,prefixes:T.LONG,value:1,offset:0},cd:{name:\"cd\",base:F.LUMINOUS_INTENSITY,prefixes:T.SHORT,value:1,offset:0},candela:{name:\"candela\",base:F.LUMINOUS_INTENSITY,prefixes:T.LONG,value:1,offset:0},N:{name:\"N\",base:F.FORCE,prefixes:T.SHORT,value:1,offset:0},newton:{name:\"newton\",base:F.FORCE,prefixes:T.LONG,value:1,offset:0},dyn:{name:\"dyn\",base:F.FORCE,prefixes:T.SHORT,value:1e-5,offset:0},dyne:{name:\"dyne\",base:F.FORCE,prefixes:T.LONG,value:1e-5,offset:0},lbf:{name:\"lbf\",base:F.FORCE,prefixes:T.NONE,value:4.4482216152605,offset:0},poundforce:{name:\"poundforce\",base:F.FORCE,prefixes:T.NONE,value:4.4482216152605,offset:0},kip:{name:\"kip\",base:F.FORCE,prefixes:T.LONG,value:4448.2216,offset:0},kilogramforce:{name:\"kilogramforce\",base:F.FORCE,prefixes:T.NONE,value:9.80665,offset:0},J:{name:\"J\",base:F.ENERGY,prefixes:T.SHORT,value:1,offset:0},joule:{name:\"joule\",base:F.ENERGY,prefixes:T.LONG,value:1,offset:0},erg:{name:\"erg\",base:F.ENERGY,prefixes:T.SHORTLONG,value:1e-7,offset:0},Wh:{name:\"Wh\",base:F.ENERGY,prefixes:T.SHORT,value:3600,offset:0},BTU:{name:\"BTU\",base:F.ENERGY,prefixes:T.BTU,value:1055.05585262,offset:0},eV:{name:\"eV\",base:F.ENERGY,prefixes:T.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:\"electronvolt\",base:F.ENERGY,prefixes:T.LONG,value:1602176565e-28,offset:0},W:{name:\"W\",base:F.POWER,prefixes:T.SHORT,value:1,offset:0},watt:{name:\"watt\",base:F.POWER,prefixes:T.LONG,value:1,offset:0},hp:{name:\"hp\",base:F.POWER,prefixes:T.NONE,value:745.6998715386,offset:0},VAR:{name:\"VAR\",base:F.POWER,prefixes:T.SHORT,value:P.I,offset:0},VA:{name:\"VA\",base:F.POWER,prefixes:T.SHORT,value:1,offset:0},Pa:{name:\"Pa\",base:F.PRESSURE,prefixes:T.SHORT,value:1,offset:0},psi:{name:\"psi\",base:F.PRESSURE,prefixes:T.NONE,value:6894.75729276459,offset:0},atm:{name:\"atm\",base:F.PRESSURE,prefixes:T.NONE,value:101325,offset:0},bar:{name:\"bar\",base:F.PRESSURE,prefixes:T.SHORTLONG,value:1e5,offset:0},torr:{name:\"torr\",base:F.PRESSURE,prefixes:T.NONE,value:133.322,offset:0},mmHg:{name:\"mmHg\",base:F.PRESSURE,prefixes:T.NONE,value:133.322,offset:0},mmH2O:{name:\"mmH2O\",base:F.PRESSURE,prefixes:T.NONE,value:9.80665,offset:0},cmH2O:{name:\"cmH2O\",base:F.PRESSURE,prefixes:T.NONE,value:98.0665,offset:0},coulomb:{name:\"coulomb\",base:F.ELECTRIC_CHARGE,prefixes:T.LONG,value:1,offset:0},C:{name:\"C\",base:F.ELECTRIC_CHARGE,prefixes:T.SHORT,value:1,offset:0},farad:{name:\"farad\",base:F.ELECTRIC_CAPACITANCE,prefixes:T.LONG,value:1,offset:0},F:{name:\"F\",base:F.ELECTRIC_CAPACITANCE,prefixes:T.SHORT,value:1,offset:0},volt:{name:\"volt\",base:F.ELECTRIC_POTENTIAL,prefixes:T.LONG,value:1,offset:0},V:{name:\"V\",base:F.ELECTRIC_POTENTIAL,prefixes:T.SHORT,value:1,offset:0},ohm:{name:\"ohm\",base:F.ELECTRIC_RESISTANCE,prefixes:T.SHORTLONG,value:1,offset:0},henry:{name:\"henry\",base:F.ELECTRIC_INDUCTANCE,prefixes:T.LONG,value:1,offset:0},H:{name:\"H\",base:F.ELECTRIC_INDUCTANCE,prefixes:T.SHORT,value:1,offset:0},siemens:{name:\"siemens\",base:F.ELECTRIC_CONDUCTANCE,prefixes:T.LONG,value:1,offset:0},S:{name:\"S\",base:F.ELECTRIC_CONDUCTANCE,prefixes:T.SHORT,value:1,offset:0},weber:{name:\"weber\",base:F.MAGNETIC_FLUX,prefixes:T.LONG,value:1,offset:0},Wb:{name:\"Wb\",base:F.MAGNETIC_FLUX,prefixes:T.SHORT,value:1,offset:0},tesla:{name:\"tesla\",base:F.MAGNETIC_FLUX_DENSITY,prefixes:T.LONG,value:1,offset:0},T:{name:\"T\",base:F.MAGNETIC_FLUX_DENSITY,prefixes:T.SHORT,value:1,offset:0},b:{name:\"b\",base:F.BIT,prefixes:T.BINARY_SHORT,value:1,offset:0},bits:{name:\"bits\",base:F.BIT,prefixes:T.BINARY_LONG,value:1,offset:0},B:{name:\"B\",base:F.BIT,prefixes:T.BINARY_SHORT,value:8,offset:0},bytes:{name:\"bytes\",base:F.BIT,prefixes:T.BINARY_LONG,value:8,offset:0}},O={meters:\"meter\",inches:\"inch\",feet:\"foot\",yards:\"yard\",miles:\"mile\",links:\"link\",rods:\"rod\",chains:\"chain\",angstroms:\"angstrom\",lt:\"l\",litres:\"litre\",liter:\"litre\",liters:\"litre\",teaspoons:\"teaspoon\",tablespoons:\"tablespoon\",minims:\"minim\",fldr:\"fluiddram\",fluiddrams:\"fluiddram\",floz:\"fluidounce\",fluidounces:\"fluidounce\",gi:\"gill\",gills:\"gill\",cp:\"cup\",cups:\"cup\",pt:\"pint\",pints:\"pint\",qt:\"quart\",quarts:\"quart\",gal:\"gallon\",gallons:\"gallon\",bbl:\"beerbarrel\",beerbarrels:\"beerbarrel\",obl:\"oilbarrel\",oilbarrels:\"oilbarrel\",hogsheads:\"hogshead\",gtts:\"gtt\",grams:\"gram\",tons:\"ton\",tonnes:\"tonne\",grains:\"grain\",drams:\"dram\",ounces:\"ounce\",poundmasses:\"poundmass\",hundredweights:\"hundredweight\",sticks:\"stick\",lb:\"lbm\",lbs:\"lbm\",kips:\"kip\",kgf:\"kilogramforce\",acres:\"acre\",hectares:\"hectare\",sqfeet:\"sqft\",sqyard:\"sqyd\",sqmile:\"sqmi\",sqmiles:\"sqmi\",mmhg:\"mmHg\",mmh2o:\"mmH2O\",cmh2o:\"cmH2O\",seconds:\"second\",secs:\"second\",minutes:\"minute\",mins:\"minute\",hours:\"hour\",hr:\"hour\",hrs:\"hour\",days:\"day\",weeks:\"week\",months:\"month\",years:\"year\",decades:\"decade\",centuries:\"century\",millennia:\"millennium\",hertz:\"hertz\",radians:\"radian\",degrees:\"degree\",gradians:\"gradian\",cycles:\"cycle\",arcsecond:\"arcsec\",arcseconds:\"arcsec\",arcminute:\"arcmin\",arcminutes:\"arcmin\",BTUs:\"BTU\",watts:\"watt\",joules:\"joule\",amperes:\"ampere\",amps:\"ampere\",amp:\"ampere\",coulombs:\"coulomb\",volts:\"volt\",ohms:\"ohm\",farads:\"farad\",webers:\"weber\",teslas:\"tesla\",electronvolts:\"electronvolt\",moles:\"mole\",bit:\"bits\",byte:\"bytes\"};function _(e){if(\"BigNumber\"===e.number){const e=_l(d);D.rad.value=new d(1),D.deg.value=e.div(180),D.grad.value=e.div(200),D.cycle.value=e.times(2),D.arcsec.value=e.div(648e3),D.arcmin.value=e.div(10800)}else D.rad.value=1,D.deg.value=Math.PI/180,D.grad.value=Math.PI/200,D.cycle.value=2*Math.PI,D.arcsec.value=Math.PI/648e3,D.arcmin.value=Math.PI/10800;D.radian.value=D.rad.value,D.degree.value=D.deg.value,D.gradian.value=D.grad.value}_(c),t&&t(\"config\",function(e,t){e.number!==t.number&&_(e)});const z={si:{NONE:{unit:j,prefix:T.NONE[\"\"]},LENGTH:{unit:D.m,prefix:T.SHORT[\"\"]},MASS:{unit:D.g,prefix:T.SHORT.k},TIME:{unit:D.s,prefix:T.SHORT[\"\"]},CURRENT:{unit:D.A,prefix:T.SHORT[\"\"]},TEMPERATURE:{unit:D.K,prefix:T.SHORT[\"\"]},LUMINOUS_INTENSITY:{unit:D.cd,prefix:T.SHORT[\"\"]},AMOUNT_OF_SUBSTANCE:{unit:D.mol,prefix:T.SHORT[\"\"]},ANGLE:{unit:D.rad,prefix:T.SHORT[\"\"]},BIT:{unit:D.bits,prefix:T.SHORT[\"\"]},FORCE:{unit:D.N,prefix:T.SHORT[\"\"]},ENERGY:{unit:D.J,prefix:T.SHORT[\"\"]},POWER:{unit:D.W,prefix:T.SHORT[\"\"]},PRESSURE:{unit:D.Pa,prefix:T.SHORT[\"\"]},ELECTRIC_CHARGE:{unit:D.C,prefix:T.SHORT[\"\"]},ELECTRIC_CAPACITANCE:{unit:D.F,prefix:T.SHORT[\"\"]},ELECTRIC_POTENTIAL:{unit:D.V,prefix:T.SHORT[\"\"]},ELECTRIC_RESISTANCE:{unit:D.ohm,prefix:T.SHORT[\"\"]},ELECTRIC_INDUCTANCE:{unit:D.H,prefix:T.SHORT[\"\"]},ELECTRIC_CONDUCTANCE:{unit:D.S,prefix:T.SHORT[\"\"]},MAGNETIC_FLUX:{unit:D.Wb,prefix:T.SHORT[\"\"]},MAGNETIC_FLUX_DENSITY:{unit:D.T,prefix:T.SHORT[\"\"]},FREQUENCY:{unit:D.Hz,prefix:T.SHORT[\"\"]}}};z.cgs=JSON.parse(JSON.stringify(z.si)),z.cgs.LENGTH={unit:D.m,prefix:T.SHORT.c},z.cgs.MASS={unit:D.g,prefix:T.SHORT[\"\"]},z.cgs.FORCE={unit:D.dyn,prefix:T.SHORT[\"\"]},z.cgs.ENERGY={unit:D.erg,prefix:T.NONE[\"\"]},z.us=JSON.parse(JSON.stringify(z.si)),z.us.LENGTH={unit:D.ft,prefix:T.NONE[\"\"]},z.us.MASS={unit:D.lbm,prefix:T.NONE[\"\"]},z.us.TEMPERATURE={unit:D.degF,prefix:T.NONE[\"\"]},z.us.FORCE={unit:D.lbf,prefix:T.NONE[\"\"]},z.us.ENERGY={unit:D.BTU,prefix:T.BTU[\"\"]},z.us.POWER={unit:D.hp,prefix:T.NONE[\"\"]},z.us.PRESSURE={unit:D.psi,prefix:T.NONE[\"\"]},z.auto=JSON.parse(JSON.stringify(z.si));let q=z.auto;y.setUnitSystem=function(e){if(!ue(z,e))throw new Error(\"Unit system \"+e+\" does not exist. Choices are: \"+Object.keys(z).join(\", \"));q=z[e]},y.getUnitSystem=function(){for(const e in z)if(ue(z,e)&&z[e]===q)return e},y.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new d(String(e.n)).div(String(e.d)).times(String(e.s)):new d(e+\"\")},Fraction:function(e){return new g(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?r(e):e}},y.prototype._numberConverter=function(){var e=y.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type \"'+this.valueType()+'\"')},y._getNumberConverter=function(e){if(y.typeConverters[e])return y.typeConverters[e];throw new TypeError('Unsupported type \"'+e+'\"')};for(const e in D)if(ue(D,e)){const t=D[e];t.dimensions=t.base.dimensions}for(const e in O)if(ue(O,e)){const t=D[O[e]],c={};for(const e in t)ue(t,e)&&(c[e]=t[e]);c.name=e,D[e]=c}return y.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},y.createUnit=function(t,r){if(\"object\"!=typeof t)throw new TypeError(\"createUnit expects first parameter to be of type 'Object'\");if(r&&r.override)for(const r in t)if(ue(t,r)&&y.deleteUnit(r),t[r].aliases)for(let e=0;e{let{typed:t,Unit:r}=e;return t(\"unit\",{Unit:function(e){return e.clone()},string:function(e){return r.isValuelessUnit(e)?new r(null,e):r.parse(e,{allowNoUnits:!0})},\"number | BigNumber | Fraction | Complex, string | Unit\":function(e,t){return new r(e,t)},\"number | BigNumber | Fraction\":function(e){return new r(e)},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),Rl=s(\"sparse\",[\"typed\",\"SparseMatrix\"],e=>{let{typed:t,SparseMatrix:r}=e;return t(\"sparse\",{\"\":function(){return new r([])},string:function(e){return new r([],e)},\"Array | Matrix\":function(e){return new r(e)},\"Array | Matrix, string\":function(e,t){return new r(e,t)}})}),Pl=\"createUnit\",Ul=s(Pl,[\"typed\",\"Unit\"],e=>{let{typed:t,Unit:i}=e;return t(Pl,{\"Object, Object\":function(e,t){return i.createUnit(e,t)},Object:function(e){return i.createUnit(e,{})},\"string, Unit | string | Object, Object\":function(e,t,r){const n={};return n[e]=t,i.createUnit(n,r)},\"string, Unit | string | Object\":function(e,t){const r={};return r[e]=t,i.createUnit(r,{})},string:function(e){const t={};return t[e]={},i.createUnit(t,{})}})}),jl=s(\"acos\",[\"typed\",\"config\",\"Complex\"],e=>{let{typed:t,config:r,Complex:n}=e;return t(\"acos\",{number:function(e){return-1<=e&&e<=1||r.predictable?Math.acos(e):new n(e,0).acos()},Complex:function(e){return e.acos()},BigNumber:function(e){return e.acos()}})}),Ll=\"number\";function $l(e){return Qe(e)}function Hl(e){return Math.atan(1/e)}function Gl(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}function Vl(e){return Math.asin(1/e)}function Zl(e){e=1/e;return Math.log(e+Math.sqrt(e*e+1))}function Wl(e){return Math.acos(1/e)}function Yl(e){var e=1/e,t=Math.sqrt(e*e-1);return Math.log(t+e)}function Jl(e){return Ke(e)}function Xl(e){return et(e)}function Ql(e){return 1/Math.tan(e)}function Kl(e){e=Math.exp(2*e);return(e+1)/(e-1)}function ec(e){return 1/Math.sin(e)}function tc(e){return 0===e?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*ke(e)}function rc(e){return 1/Math.cos(e)}function nc(e){return 2/(Math.exp(e)+Math.exp(-e))}function ic(e){return rt(e)}ic.signature=nc.signature=rc.signature=tc.signature=ec.signature=Kl.signature=Ql.signature=Xl.signature=Jl.signature=Yl.signature=Wl.signature=Zl.signature=Vl.signature=Gl.signature=Hl.signature=$l.signature=Ll;const ac=s(\"acosh\",[\"typed\",\"config\",\"Complex\"],e=>{let{typed:t,config:r,Complex:n}=e;return t(\"acosh\",{number:function(e){return 1<=e||r.predictable?$l(e):e<=-1?new n(Math.log(Math.sqrt(e*e-1)-e),Math.PI):new n(e,0).acosh()},Complex:function(e){return e.acosh()},BigNumber:function(e){return e.acosh()}})}),oc=s(\"acot\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"acot\",{number:Hl,Complex:function(e){return e.acot()},BigNumber:function(e){return new r(1).div(e).atan()}})}),sc=s(\"acoth\",[\"typed\",\"config\",\"Complex\",\"BigNumber\"],e=>{let{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(\"acoth\",{number:function(e){return 1<=e||e<=-1||r.predictable?Gl(e):new n(e,0).acoth()},Complex:function(e){return e.acoth()},BigNumber:function(e){return new i(1).div(e).atanh()}})}),uc=s(\"acsc\",[\"typed\",\"config\",\"Complex\",\"BigNumber\"],e=>{let{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(\"acsc\",{number:function(e){return e<=-1||1<=e||r.predictable?Vl(e):new n(e,0).acsc()},Complex:function(e){return e.acsc()},BigNumber:function(e){return new i(1).div(e).asin()}})}),lc=s(\"acsch\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"acsch\",{number:Zl,Complex:function(e){return e.acsch()},BigNumber:function(e){return new r(1).div(e).asinh()}})}),cc=s(\"asec\",[\"typed\",\"config\",\"Complex\",\"BigNumber\"],e=>{let{typed:t,config:r,Complex:n,BigNumber:i}=e;return t(\"asec\",{number:function(e){return e<=-1||1<=e||r.predictable?Wl(e):new n(e,0).asec()},Complex:function(e){return e.asec()},BigNumber:function(e){return new i(1).div(e).acos()}})}),fc=s(\"asech\",[\"typed\",\"config\",\"Complex\",\"BigNumber\"],e=>{let{typed:t,config:n,Complex:i,BigNumber:r}=e;return t(\"asech\",{number:function(e){if(e<=1&&-1<=e||n.predictable){var t=1/e;if(0{let{typed:t,config:r,Complex:n}=e;return t(\"asin\",{number:function(e){return-1<=e&&e<=1||r.predictable?Math.asin(e):new n(e,0).asin()},Complex:function(e){return e.asin()},BigNumber:function(e){return e.asin()}})}),mc=s(\"asinh\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"asinh\",{number:Jl,Complex:function(e){return e.asinh()},BigNumber:function(e){return e.asinh()}})}),hc=s(\"atan\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"atan\",{number:function(e){return Math.atan(e)},Complex:function(e){return e.atan()},BigNumber:function(e){return e.atan()}})}),dc=s(\"atan2\",[\"typed\",\"matrix\",\"equalScalar\",\"BigNumber\",\"DenseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,equalScalar:n,BigNumber:i,DenseMatrix:a,concat:o}=e;const s=Ra({typed:t,equalScalar:n}),u=Pa({typed:t}),l=ho({typed:t,equalScalar:n}),c=Aa({typed:t,equalScalar:n}),f=x({typed:t,DenseMatrix:a}),p=C({typed:t,matrix:r,concat:o});return t(\"atan2\",{\"number, number\":Math.atan2,\"BigNumber, BigNumber\":(e,t)=>i.atan2(e,t)},p({scalar:\"number | BigNumber\",SS:l,DS:u,SD:s,Ss:c,sS:f}))}),gc=s(\"atanh\",[\"typed\",\"config\",\"Complex\"],e=>{let{typed:t,config:r,Complex:n}=e;return t(\"atanh\",{number:function(e){return e<=1&&-1<=e||r.predictable?Xl(e):new n(e,0).atanh()},Complex:function(e){return e.atanh()},BigNumber:function(e){return e.atanh()}})}),yc=s(\"trigUnit\",[\"typed\"],e=>{let r=e[\"typed\"];return{Unit:r.referToSelf(t=>e=>{if(e.hasBase(e.constructor.BASE_UNITS.ANGLE))return r.find(t,e.valueType())(e.value);throw new TypeError(\"Unit in function cot is no angle\")})}}),xc=s(\"cos\",[\"typed\"],e=>{let t=e[\"typed\"];e=yc({typed:t});return t(\"cos\",{number:Math.cos,\"Complex | BigNumber\":e=>e.cos()},e)}),bc=s(\"cosh\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"cosh\",{number:tt,\"Complex | BigNumber\":e=>e.cosh()})}),vc=s(\"cot\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"cot\",{number:Ql,Complex:e=>e.cot(),BigNumber:e=>new r(1).div(e.tan())},yc({typed:t}))}),wc=s(\"coth\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"coth\",{number:Kl,Complex:e=>e.coth(),BigNumber:e=>new r(1).div(e.tanh())})}),Nc=s(\"csc\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"csc\",{number:ec,Complex:e=>e.csc(),BigNumber:e=>new r(1).div(e.sin())},yc({typed:t}))}),Ac=s(\"csch\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"csch\",{number:tc,Complex:e=>e.csch(),BigNumber:e=>new r(1).div(e.sinh())})}),Ec=s(\"sec\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"sec\",{number:rc,Complex:e=>e.sec(),BigNumber:e=>new r(1).div(e.cos())},yc({typed:t}))}),Sc=s(\"sech\",[\"typed\",\"BigNumber\"],e=>{let{typed:t,BigNumber:r}=e;return t(\"sech\",{number:nc,Complex:e=>e.sech(),BigNumber:e=>new r(1).div(e.cosh())})}),Mc=s(\"sin\",[\"typed\"],e=>{let t=e[\"typed\"];e=yc({typed:t});return t(\"sin\",{number:Math.sin,\"Complex | BigNumber\":e=>e.sin()},e)}),Cc=s(\"sinh\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"sinh\",{number:ic,\"Complex | BigNumber\":e=>e.sinh()})}),Tc=s(\"tan\",[\"typed\"],e=>{let t=e[\"typed\"];e=yc({typed:t});return t(\"tan\",{number:Math.tan,\"Complex | BigNumber\":e=>e.tan()},e)}),Bc=s(\"tanh\",[\"typed\"],e=>{let t=e[\"typed\"];return t(\"tanh\",{number:nt,\"Complex | BigNumber\":e=>e.tanh()})}),Fc=\"setCartesian\",Dc=s(Fc,[\"typed\",\"size\",\"subset\",\"compareNatural\",\"Index\",\"DenseMatrix\"],e=>{let{typed:t,size:n,subset:i,compareNatural:a,Index:o,DenseMatrix:s}=e;return t(Fc,{\"Array | Matrix, Array | Matrix\":function(e,t){let r=[];if(0!==i(n(e),new o(0))&&0!==i(n(t),new o(0))){const n=E(Array.isArray(e)?e:e.toArray()).sort(a),i=E(Array.isArray(t)?t:t.toArray()).sort(a);r=[];for(let t=0;t{let{typed:t,size:i,subset:a,compareNatural:o,Index:r,DenseMatrix:s}=e;return t(Oc,{\"Array | Matrix, Array | Matrix\":function(e,t){let n;if(0===a(i(e),new r(0)))n=[];else{if(0===a(i(t),new r(0)))return E(e.toArray());{const i=Pn(E(Array.isArray(e)?e:e.toArray()).sort(o)),a=Pn(E(Array.isArray(t)?t:t.toArray()).sort(o));let r;n=[];for(let t=0;t{let{typed:t,size:r,subset:n,compareNatural:i,Index:a,DenseMatrix:o}=e;return t(zc,{\"Array | Matrix\":function(e){let t;if(0===n(r(e),new a(0)))t=[];else{const r=E(Array.isArray(e)?e:e.toArray()).sort(i);(t=[]).push(r[0]);for(let e=1;e{let{typed:t,size:n,subset:i,compareNatural:a,Index:o,DenseMatrix:s}=e;return t(Ic,{\"Array | Matrix, Array | Matrix\":function(e,t){let r;if(0===i(n(e),new o(0))||0===i(n(t),new o(0)))r=[];else{const n=Pn(E(Array.isArray(e)?e:e.toArray()).sort(a)),i=Pn(E(Array.isArray(t)?t:t.toArray()).sort(a));r=[];for(let t=0;t{let{typed:t,size:a,subset:o,compareNatural:s,Index:u}=e;return t(Rc,{\"Array | Matrix, Array | Matrix\":function(e,t){if(0===o(a(e),new u(0)))return!0;if(0===o(a(t),new u(0)))return!1;var r=Pn(E(Array.isArray(e)?e:e.toArray()).sort(s)),n=Pn(E(Array.isArray(t)?t:t.toArray()).sort(s));let i;for(let t=0;t{let{typed:t,size:i,subset:a,compareNatural:o,Index:s}=e;return t(Uc,{\"number | BigNumber | Fraction | Complex, Array | Matrix\":function(t,e){if(0===a(i(e),new s(0)))return 0;var r=E(Array.isArray(e)?e:e.toArray());let n=0;for(let e=0;e{let{typed:t,size:o,subset:s,compareNatural:u,Index:l}=e;return t(Lc,{\"Array | Matrix\":function(e){if(0===s(o(e),new l(0)))return[];const t=E(Array.isArray(e)?e:e.toArray()).sort(u),r=[];let n=0;for(;n.toString(2).length<=t.length;)r.push(function(t,r){const n=[];for(let e=0;ea[e+1].length&&(i=a[e],a[e]=a[e+1],a[e+1]=i);return a}})}),Hc=\"setSize\",Gc=s(Hc,[\"typed\",\"compareNatural\"],e=>{let{typed:t,compareNatural:n}=e;return t(Hc,{\"Array | Matrix\":function(e){return(Array.isArray(e)?E(e):E(e.toArray())).length},\"Array | Matrix, boolean\":function(e,r){if(!1===r||0===e.length)return(Array.isArray(e)?E(e):E(e.toArray())).length;{const r=E(Array.isArray(e)?e:e.toArray()).sort(n);let t=1;for(let e=1;e{let{typed:t,size:r,concat:n,subset:i,setDifference:a,Index:o}=e;return t(Vc,{\"Array | Matrix, Array | Matrix\":function(e,t){if(0===i(r(e),new o(0)))return E(t);if(0===i(r(t),new o(0)))return E(e);e=E(e),t=E(t);return n(a(e,t),a(t,e))}})}),Wc=\"setUnion\",Yc=s(Wc,[\"typed\",\"size\",\"concat\",\"subset\",\"setIntersect\",\"setSymDifference\",\"Index\"],e=>{let{typed:t,size:r,concat:n,subset:i,setIntersect:a,setSymDifference:o,Index:s}=e;return t(Wc,{\"Array | Matrix, Array | Matrix\":function(e,t){if(0===i(r(e),new s(0)))return E(t);if(0===i(r(t),new s(0)))return E(e);e=E(e),t=E(t);return n(o(e,t),a(e,t))}})}),Jc=s(\"add\",[\"typed\",\"matrix\",\"addScalar\",\"equalScalar\",\"DenseMatrix\",\"SparseMatrix\",\"concat\"],e=>{let{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:a,concat:o}=e;const s=Ha({typed:t}),u=Ga({typed:t,equalScalar:i}),l=Va({typed:t,DenseMatrix:a}),c=C({typed:t,matrix:r,concat:o});return t(\"add\",{\"any, any\":n,\"any, any, ...any\":t.referToSelf(i=>(e,t,r)=>{let n=i(e,t);for(let e=0;e{let{typed:t,abs:a,addScalar:o,divideScalar:s,multiplyScalar:u,sqrt:l,smaller:c,isPositive:f}=e;return t(\"hypot\",{\"... number | BigNumber\":r,Array:r,Matrix:e=>r(E(e.toArray(),!0))});function r(t){let r=0,n=0;for(let e=0;e{let{typed:t,abs:s,add:u,pow:l,conj:c,sqrt:f,multiply:p,equalScalar:m,larger:h,smaller:d,matrix:r,ctranspose:g,eigs:y}=e;return t(\"norm\",{number:Math.abs,Complex:function(e){return e.abs()},BigNumber:function(e){return e.abs()},boolean:function(e){return Math.abs(e)},Array:function(e){return x(r(e),2)},Matrix:function(e){return x(e,2)},\"Array, number | BigNumber | string\":function(e,t){return x(r(e),t)},\"Matrix, number | BigNumber | string\":x});function x(e,t){var r=e.size();if(1===r.length){var n=e,i=t;if(i===Number.POSITIVE_INFINITY||\"inf\"===i){let t=0;return n.forEach(function(e){e=s(e);h(e,t)&&(t=e)},!0),t}if(i===Number.NEGATIVE_INFINITY||\"-inf\"===i){let t;return n.forEach(function(e){e=s(e);t&&!d(e,t)||(t=e)},!0),t||0}if(\"fro\"===i)return x(n,2);if(\"number\"!=typeof i||isNaN(i))throw new Error(\"Unsupported parameter value\");if(m(i,0))return Number.POSITIVE_INFINITY;{let t=0;return n.forEach(function(e){t=u(l(s(e),i),t)},!0),l(t,1/i)}}if(2===r.length){if(r[0]&&r[1]){n=e,r=t;if(1===r){const a=[];let r=0;return n.forEach(function(e,t){t=t[1],e=u(a[t]||0,s(e));h(e,r)&&(r=e),a[t]=e},!0),r}if(r===Number.POSITIVE_INFINITY||\"inf\"===r){const o=[];let r=0;return n.forEach(function(e,t){t=t[0],e=u(o[t]||0,s(e));h(e,r)&&(r=e),o[t]=e},!0),r}if(\"fro\"===r){let r=0;return n.forEach(function(e,t){r=u(r,p(e,c(e)))}),s(f(r))}if(2!==r)throw new Error(\"Unsupported parameter value \"+r);if((n=(r=n).size())[0]!==n[1])throw new RangeError(\"Invalid matrix dimensions\");return n=g(r),n=p(n,r),r=y(n).values.toArray(),n=r[r.length-1],s(f(n))}throw new RangeError(\"Invalid matrix dimensions\")}}}),Kc=s(\"dot\",[\"typed\",\"addScalar\",\"multiplyScalar\",\"conj\",\"size\"],e=>{let{typed:l,addScalar:f,multiplyScalar:p,conj:c,size:t}=e;return l(\"dot\",{\"Array | DenseMatrix, Array | DenseMatrix\":function(e,t){var r=m(e,t),n=_(e)?e._data:e,i=_(e)?e._datatype||e.getDataType():void 0,a=_(t)?t._data:t,o=_(t)?t._datatype||t.getDataType():void 0,e=2===h(e).length,t=2===h(t).length;let s=f,u=p;if(i&&o&&i===o&&\"string\"==typeof i&&\"mixed\"!==i){const e=i;s=l.find(f,[e,e]),u=l.find(p,[e,e])}if(!e&&!t){let t=u(c(n[0]),a[0]);for(let e=1;et?c++:e===t&&(o=s(o,u(n[l],a[c])),l++,c++)}return o}});function m(e,t){const r=h(e),n=h(t);let i,a;if(1===r.length)i=r[0];else{if(2!==r.length||1!==r[1])throw new RangeError(\"Expected a column vector, instead got a matrix of size (\"+r.join(\", \")+\")\");i=r[0]}if(1===n.length)a=n[0];else{if(2!==n.length||1!==n[1])throw new RangeError(\"Expected a column vector, instead got a matrix of size (\"+n.join(\", \")+\")\");a=n[0]}if(i!==a)throw new RangeError(\"Vectors must have equal length (\"+i+\" != \"+a+\")\");if(0===i)throw new RangeError(\"Cannot calculate the dot product of empty vectors\");return i}function h(e){return _(e)?e.size():t(e)}}),ef=s(\"trace\",[\"typed\",\"matrix\",\"add\"],e=>{let{typed:t,matrix:r,add:u}=e;return t(\"trace\",{Array:function(e){return n(r(e))},SparseMatrix:function(e){const n=e._values,i=e._index,a=e._ptr,t=e._size,o=t[0],s=t[1];if(o!==s)throw new RangeError(\"Matrix must be square (size: \"+S(t)+\")\");{let r=0;if(0t)break}}return r}},DenseMatrix:n,any:ee});function n(r){var e=r._size,n=r._data;switch(e.length){case 1:if(1===e[0])return ee(n[0]);throw new RangeError(\"Matrix must be square (size: \"+S(e)+\")\");case 2:{const r=e[0];if(r!==e[1])throw new RangeError(\"Matrix must be square (size: \"+S(e)+\")\");{let t=0;for(let e=0;e{let{typed:t,Index:r}=e;return t(\"index\",{\"...number | string | BigNumber | Range | Array | Matrix\":function(e){var e=e.map(function(e){return Q(e)?e.toNumber():b(e)||_(e)?e.map(function(e){return Q(e)?e.toNumber():e}):e}),t=new r;return r.apply(t,e),t}})}),rf=new Set([\"end\"]),nf=s(\"Node\",[\"mathWithTransform\"],e=>{let t=e[\"mathWithTransform\"];return class{get type(){return\"Node\"}get isNode(){return!0}evaluate(e){return this.compile().evaluate(e)}compile(){const n=this._compile(t,{}),i={};return{evaluate:function(e){var e=U(e),t=e;for(const r of[...rf])if(t.has(r))throw new Error('Scope contains an illegal symbol, \"'+r+'\" is a reserved keyword');return n(e,i,null)}}}_compile(e,t){throw new Error(\"Method _compile must be implemented by type \"+this.type)}forEach(e){throw new Error(\"Cannot run forEach on a Node interface\")}map(e){throw new Error(\"Cannot run map on a Node interface\")}_ifNode(e){if(O(e))return e;throw new TypeError(\"Callback function must return a Node\")}traverse(e){e(this,null,null),function n(e,i){e.forEach(function(e,t,r){i(e,t,r),n(e,i)})}(this,e)}transform(i){return function e(t,r,n){r=i(t,r,n);return r!==t?r:t.map(e)}(this,null,null)}filter(n){const i=[];return this.traverse(function(e,t,r){n(e,t,r)&&i.push(e)}),i}clone(){throw new Error(\"Cannot clone a Node interface\")}cloneDeep(){return this.map(function(e){return e.cloneDeep()})}equals(e){return!!e&&this.type===e.type&&De(this,e)}toString(e){var t=this._getCustomString(e);return void 0!==t?t:this._toString(e)}_toString(){throw new Error(\"_toString not implemented for \"+this.type)}toJSON(){throw new Error(\"Cannot serialize object: toJSON not implemented by \"+this.type)}toHTML(e){var t=this._getCustomString(e);return void 0!==t?t:this._toHTML(e)}_toHTML(){throw new Error(\"_toHTML not implemented for \"+this.type)}toTex(e){var t=this._getCustomString(e);return void 0!==t?t:this._toTex(e)}_toTex(e){throw new Error(\"_toTex not implemented for \"+this.type)}_getCustomString(e){if(e&&\"object\"==typeof e)switch(typeof e.handler){case\"object\":case\"undefined\":return;case\"function\":return e.handler(this,e);default:throw new TypeError(\"Object or function expected as callback\")}}getIdentifier(){return this.type}getContent(){return this}}},{isClass:!0,isNode:!0});function af(e){return(af=\"function\"==typeof Symbol&&\"symbol\"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&\"function\"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?\"symbol\":typeof e})(e)}function of(e,t,r){var n;n=function(e){if(\"object\"!=af(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,\"string\");if(\"object\"!=af(t))return t;throw new TypeError(\"@@toPrimitive must return a primitive value.\")}(t),(t=\"symbol\"==af(n)?n:n+\"\")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r}function sf(e){return e&&e.isIndexError?new En(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function uf(e){let r=e[\"subset\"];return function(e,t){try{if(Array.isArray(e))return r(e,t);if(e&&\"function\"==typeof e.subset)return e.subset(t);if(\"string\"==typeof e)return r(e,t);if(\"object\"!=typeof e)throw new TypeError(\"Cannot apply index: unsupported type of object\");if(t.isObjectProperty())return h(e,t.getObjectProperty());throw new TypeError(\"Cannot apply a numeric index as object property\")}catch(e){throw sf(e)}}}const lf=\"AccessorNode\",cf=s(lf,[\"subset\",\"Node\"],e=>{var{subset:e,Node:t}=e;const o=uf({subset:e});function r(e){return!(ge(e)||ye(e)||ae(e)||Ae(e)||Se(e)||Me(e)||se(e))}class n extends t{constructor(e,t){if(super(),!O(e))throw new TypeError('Node expected for parameter \"object\"');if(!Ee(t))throw new TypeError('IndexNode expected for parameter \"index\"');this.object=e,this.index=t}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():\"\":this.object.name||\"\"}get type(){return lf}get isAccessorNode(){return!0}_compile(n,e){const i=this.object._compile(n,e),a=this.index._compile(n,e);if(this.index.isObjectProperty()){const n=this.index.getObjectProperty();return function(e,t,r){return h(i(e,t,r),n)}}return function(e,t,r){r=i(e,t,r),e=a(e,t,r);return o(r,e)}}forEach(e){e(this.object,\"object\",this),e(this.index,\"index\",this)}map(e){return new n(this._ifNode(e(this.object,\"object\",this)),this._ifNode(e(this.index,\"index\",this)))}clone(){return new n(this.object,this.index)}_toString(e){let t=this.object.toString(e);return(t=r(this.object)?\"(\"+t+\")\":t)+this.index.toString(e)}_toHTML(e){let t=this.object.toHTML(e);return(t=r(this.object)?'('+t+')':t)+this.index.toHTML(e)}_toTex(e){let t=this.object.toTex(e);return(t=r(this.object)?\"\\\\left(' + object + '\\\\right)\":t)+this.index.toTex(e)}toJSON(){return{mathjs:lf,object:this.object,index:this.index}}static fromJSON(e){return new n(e.object,e.index)}}return of(n,\"name\",lf),n},{isClass:!0,isNode:!0}),ff=\"ArrayNode\",pf=s(ff,[\"Node\"],e=>{e=e.Node;class n extends e{constructor(e){if(super(),this.items=e||[],!Array.isArray(this.items)||!this.items.every(O))throw new TypeError(\"Array containing Nodes expected\")}get type(){return ff}get isArrayNode(){return!0}_compile(t,i){const e=zn(this.items,function(e){return e._compile(t,i)});if(\"Array\"===t.config.matrix)return function(t,r,n){return zn(e,function(e){return e(t,r,n)})};{const i=t.matrix;return function(t,r,n){return i(zn(e,function(e){return e(t,r,n)}))}}}forEach(t){for(let e=0;e['+this.items.map(function(e){return e.toHTML(t)}).join(',')+']'}_toTex(o){return function t(e,r){var n=e.some(ye)&&!e.every(ye),i=r||n,a=i?\"&\":\"\\\\\\\\\",e=e.map(function(e){return e.items?t(e.items,!r):e.toTex(o)}).join(a);return n||!i||i&&!r?\"\\\\begin{bmatrix}\"+e+\"\\\\end{bmatrix}\":e}(this.items,!1)}}return of(n,\"name\",ff),n},{isClass:!0,isNode:!0}),mf=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{\"OperatorNode:or\":{op:\"or\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:xor\":{op:\"xor\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:and\":{op:\"and\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:bitOr\":{op:\"|\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:bitXor\":{op:\"^|\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:bitAnd\":{op:\"&\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:equal\":{op:\"==\",associativity:\"left\",associativeWith:[]},\"OperatorNode:unequal\":{op:\"!=\",associativity:\"left\",associativeWith:[]},\"OperatorNode:smaller\":{op:\"<\",associativity:\"left\",associativeWith:[]},\"OperatorNode:larger\":{op:\">\",associativity:\"left\",associativeWith:[]},\"OperatorNode:smallerEq\":{op:\"<=\",associativity:\"left\",associativeWith:[]},\"OperatorNode:largerEq\":{op:\">=\",associativity:\"left\",associativeWith:[]},RelationalNode:{associativity:\"left\",associativeWith:[]}},{\"OperatorNode:leftShift\":{op:\"<<\",associativity:\"left\",associativeWith:[]},\"OperatorNode:rightArithShift\":{op:\">>\",associativity:\"left\",associativeWith:[]},\"OperatorNode:rightLogShift\":{op:\">>>\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:to\":{op:\"to\",associativity:\"left\",associativeWith:[]}},{RangeNode:{}},{\"OperatorNode:add\":{op:\"+\",associativity:\"left\",associativeWith:[\"OperatorNode:add\",\"OperatorNode:subtract\"]},\"OperatorNode:subtract\":{op:\"-\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:multiply\":{op:\"*\",associativity:\"left\",associativeWith:[\"OperatorNode:multiply\",\"OperatorNode:divide\",\"Operator:dotMultiply\",\"Operator:dotDivide\"]},\"OperatorNode:divide\":{op:\"/\",associativity:\"left\",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},\"OperatorNode:dotMultiply\":{op:\".*\",associativity:\"left\",associativeWith:[\"OperatorNode:multiply\",\"OperatorNode:divide\",\"OperatorNode:dotMultiply\",\"OperatorNode:doDivide\"]},\"OperatorNode:dotDivide\":{op:\"./\",associativity:\"left\",associativeWith:[]},\"OperatorNode:mod\":{op:\"mod\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:multiply\":{associativity:\"left\",associativeWith:[\"OperatorNode:multiply\",\"OperatorNode:divide\",\"Operator:dotMultiply\",\"Operator:dotDivide\"]}},{\"OperatorNode:unaryPlus\":{op:\"+\",associativity:\"right\"},\"OperatorNode:unaryMinus\":{op:\"-\",associativity:\"right\"},\"OperatorNode:bitNot\":{op:\"~\",associativity:\"right\"},\"OperatorNode:not\":{op:\"not\",associativity:\"right\"}},{\"OperatorNode:pow\":{op:\"^\",associativity:\"right\",associativeWith:[],latexRightParens:!1},\"OperatorNode:dotPow\":{op:\".^\",associativity:\"right\",associativeWith:[]}},{\"OperatorNode:nullish\":{op:\"??\",associativity:\"left\",associativeWith:[]}},{\"OperatorNode:factorial\":{op:\"!\",associativity:\"left\"}},{\"OperatorNode:ctranspose\":{op:\"'\",associativity:\"left\"}}];function hf(e,t){if(!t||\"auto\"!==t)return e;let r=e;for(;Me(r);)r=r.content;return r}function F(e,t,r,n){let i=e;var a=(i=\"keep\"!==t?e.getContent():i).getIdentifier();let o=null;for(let e=0;e{var{subset:t,matrix:r,Node:e}=e;const c=uf({subset:t}),f=function(){let{subset:n,matrix:i}={subset:t,matrix:r};return function(r,e,t){try{if(Array.isArray(r))return i(r).subset(e,t).valueOf().forEach((e,t)=>{r[t]=e}),r;if(r&&\"function\"==typeof r.subset)return r.subset(e,t);if(\"string\"==typeof r)return n(r,e,t);if(\"object\"!=typeof r)throw new TypeError(\"Cannot apply index: unsupported type of object\");if(e.isObjectProperty())return D(r,e.getObjectProperty(),t),r;throw TypeError(\"Cannot apply a numeric index as object property\")}catch(r){throw sf(r)}}}();function i(e,t,r){var n=F(e,t=t||\"keep\",r),e=F(e.value,t,r);return\"all\"===t||null!==e&&e<=n}class n extends e{constructor(e,t,r){if(super(),this.object=e,this.index=r?t:null,this.value=r||t,!se(e)&&!ge(e))throw new TypeError('SymbolNode or AccessorNode expected as \"object\"');if(se(e)&&\"end\"===e.name)throw new Error('Cannot assign to symbol \"end\"');if(this.index&&!Ee(this.index))throw new TypeError('IndexNode expected as \"index\"');if(!O(this.value))throw new TypeError('Node expected as \"value\"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():\"\":this.object.name||\"\"}get type(){return yf}get isAssignmentNode(){return!0}_compile(o,e){const s=this.object._compile(o,e),u=this.index?this.index._compile(o,e):null,l=this.value._compile(o,e),i=this.object.name;if(this.index){if(this.index.isObjectProperty()){const o=this.index.getObjectProperty();return function(e,t,r){var n=s(e,t,r),e=l(e,t,r);return D(n,o,e),e}}if(se(this.object))return function(e,t,r){var n=s(e,t,r),r=l(e,t,r),t=u(e,t,n);return e.set(i,f(n,t,r)),r};{const s=this.object.object._compile(o,e);if(this.object.index.isObjectProperty()){const o=this.object.index.getObjectProperty();return function(e,t,r){var n=s(e,t,r),i=h(n,o),a=u(e,t,i),e=l(e,t,r);return D(n,o,f(i,a,e)),e}}{const h=this.object.index._compile(o,e);return function(e,t,r){var n=s(e,t,r),i=h(e,t,n),a=c(n,i),o=u(e,t,a),e=l(e,t,r);return f(n,i,f(a,o,e)),e}}}}if(se(this.object))return function(e,t,r){t=l(e,t,r);return e.set(i,t),t};throw new TypeError(\"SymbolNode expected as object\")}forEach(e){e(this.object,\"object\",this),this.index&&e(this.index,\"index\",this),e(this.value,\"value\",this)}map(e){var t=this._ifNode(e(this.object,\"object\",this)),r=this.index?this._ifNode(e(this.index,\"index\",this)):null,e=this._ifNode(e(this.value,\"value\",this));return new n(t,r,e)}clone(){return new n(this.object,this.index,this.value)}_toString(e){var t=this.object.toString(e),r=this.index?this.index.toString(e):\"\";let n=this.value.toString(e);return t+r+\" = \"+(n=i(this,e&&e.parenthesis,e&&e.implicit)?\"(\"+n+\")\":n)}toJSON(){return{mathjs:yf,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new n(e.object,e.index,e.value)}_toHTML(e){var t=this.object.toHTML(e),r=this.index?this.index.toHTML(e):\"\";let n=this.value.toHTML(e);return t+r+'='+(n=i(this,e&&e.parenthesis,e&&e.implicit)?'('+n+')':n)}_toTex(e){var t=this.object.toTex(e),r=this.index?this.index.toTex(e):\"\";let n=this.value.toTex(e);return t+r+\"=\"+(n=i(this,e&&e.parenthesis,e&&e.implicit)?`\\\\left(${n}\\\\right)`:n)}}return of(n,\"name\",yf),n},{isClass:!0,isNode:!0}),bf=\"BlockNode\",vf=s(bf,[\"ResultSet\",\"Node\"],e=>{let{ResultSet:o,Node:t}=e;class i extends t{constructor(e){if(super(),!Array.isArray(e))throw new Error(\"Array expected\");this.blocks=e.map(function(e){var t=e&&e.node,e=!e||void 0===e.visible||e.visible;if(!O(t))throw new TypeError('Property \"node\" must be a Node');if(\"boolean\"!=typeof e)throw new TypeError('Property \"visible\" must be a boolean');return{node:t,visible:e}})}get type(){return bf}get isBlockNode(){return!0}_compile(t,r){const e=zn(this.blocks,function(e){return{evaluate:e.node._compile(t,r),visible:e.visible}});return function(r,n,i){const a=[];return qn(e,function(e){var t=e.evaluate(r,n,i);e.visible&&a.push(t)}),new o(a)}}forEach(t){for(let e=0;e;')}).join('
')}_toTex(t){return this.blocks.map(function(e){return e.node.toTex(t)+(e.visible?\"\":\";\")}).join(\"\\\\;\\\\;\\n\")}}return of(i,\"name\",bf),i},{isClass:!0,isNode:!0}),wf=\"ConditionalNode\",Nf=s(wf,[\"Node\"],e=>{e=e.Node;class t extends e{constructor(e,t,r){if(super(),!O(e))throw new TypeError(\"Parameter condition must be a Node\");if(!O(t))throw new TypeError(\"Parameter trueExpr must be a Node\");if(!O(r))throw new TypeError(\"Parameter falseExpr must be a Node\");this.condition=e,this.trueExpr=t,this.falseExpr=r}get type(){return wf}get isConditionalNode(){return!0}_compile(e,t){const n=this.condition._compile(e,t),i=this.trueExpr._compile(e,t),a=this.falseExpr._compile(e,t);return function(e,t,r){return(function(e){if(\"number\"==typeof e||\"boolean\"==typeof e||\"string\"==typeof e)return e;if(e){if(Q(e))return!e.isZero();if(te(e))return e.re||e.im;if(L(e))return e.value}if(null!=e)throw new TypeError('Unsupported type of condition \"'+K(e)+'\"')}(n(e,t,r))?i:a)(e,t,r)}}forEach(e){e(this.condition,\"condition\",this),e(this.trueExpr,\"trueExpr\",this),e(this.falseExpr,\"falseExpr\",this)}map(e){return new t(this._ifNode(e(this.condition,\"condition\",this)),this._ifNode(e(this.trueExpr,\"trueExpr\",this)),this._ifNode(e(this.falseExpr,\"falseExpr\",this)))}clone(){return new t(this.condition,this.trueExpr,this.falseExpr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:\"keep\",r=F(this,t,e&&e.implicit);let n=this.condition.toString(e);var i=F(this.condition,t,e&&e.implicit);(\"all\"===t||\"OperatorNode\"===this.condition.type||null!==i&&i<=r)&&(n=\"(\"+n+\")\");let a=this.trueExpr.toString(e);i=F(this.trueExpr,t,e&&e.implicit);(\"all\"===t||\"OperatorNode\"===this.trueExpr.type||null!==i&&i<=r)&&(a=\"(\"+a+\")\");let o=this.falseExpr.toString(e);i=F(this.falseExpr,t,e&&e.implicit);return(\"all\"===t||\"OperatorNode\"===this.falseExpr.type||null!==i&&i<=r)&&(o=\"(\"+o+\")\"),n+\" ? \"+a+\" : \"+o}toJSON(){return{mathjs:wf,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new t(e.condition,e.trueExpr,e.falseExpr)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:\"keep\",r=F(this,t,e&&e.implicit);let n=this.condition.toHTML(e);var i=F(this.condition,t,e&&e.implicit);(\"all\"===t||\"OperatorNode\"===this.condition.type||null!==i&&i<=r)&&(n='('+n+')');let a=this.trueExpr.toHTML(e);i=F(this.trueExpr,t,e&&e.implicit);(\"all\"===t||\"OperatorNode\"===this.trueExpr.type||null!==i&&i<=r)&&(a='('+a+')');let o=this.falseExpr.toHTML(e);i=F(this.falseExpr,t,e&&e.implicit);return(\"all\"===t||\"OperatorNode\"===this.falseExpr.type||null!==i&&i<=r)&&(o='('+o+')'),n+'?'+a+':'+o}_toTex(e){return\"\\\\begin{cases} {\"+this.trueExpr.toTex(e)+\"}, &\\\\quad{\\\\text{if }\\\\;\"+this.condition.toTex(e)+\"}\\\\\\\\{\"+this.falseExpr.toTex(e)+\"}, &\\\\quad{\\\\text{otherwise}}\\\\end{cases}\"}}return of(t,\"name\",wf),t},{isClass:!0,isNode:!0});var Af=fd(144);const Ef={Alpha:\"A\",alpha:\"\\\\alpha\",Beta:\"B\",beta:\"\\\\beta\",Gamma:\"\\\\Gamma\",gamma:\"\\\\gamma\",Delta:\"\\\\Delta\",delta:\"\\\\delta\",Epsilon:\"E\",epsilon:\"\\\\epsilon\",varepsilon:\"\\\\varepsilon\",Zeta:\"Z\",zeta:\"\\\\zeta\",Eta:\"H\",eta:\"\\\\eta\",Theta:\"\\\\Theta\",theta:\"\\\\theta\",vartheta:\"\\\\vartheta\",Iota:\"I\",iota:\"\\\\iota\",Kappa:\"K\",kappa:\"\\\\kappa\",varkappa:\"\\\\varkappa\",Lambda:\"\\\\Lambda\",lambda:\"\\\\lambda\",Mu:\"M\",mu:\"\\\\mu\",Nu:\"N\",nu:\"\\\\nu\",Xi:\"\\\\Xi\",xi:\"\\\\xi\",Omicron:\"O\",omicron:\"o\",Pi:\"\\\\Pi\",pi:\"\\\\pi\",varpi:\"\\\\varpi\",Rho:\"P\",rho:\"\\\\rho\",varrho:\"\\\\varrho\",Sigma:\"\\\\Sigma\",sigma:\"\\\\sigma\",varsigma:\"\\\\varsigma\",Tau:\"T\",tau:\"\\\\tau\",Upsilon:\"\\\\Upsilon\",upsilon:\"\\\\upsilon\",Phi:\"\\\\Phi\",phi:\"\\\\phi\",varphi:\"\\\\varphi\",Chi:\"X\",chi:\"\\\\chi\",Psi:\"\\\\Psi\",psi:\"\\\\psi\",Omega:\"\\\\Omega\",omega:\"\\\\omega\",true:\"\\\\mathrm{True}\",false:\"\\\\mathrm{False}\",i:\"i\",inf:\"\\\\infty\",Inf:\"\\\\infty\",infinity:\"\\\\infty\",Infinity:\"\\\\infty\",oo:\"\\\\infty\",lim:\"\\\\lim\",undefined:\"\\\\mathbf{?}\"},c={transpose:\"^\\\\top\",ctranspose:\"^H\",factorial:\"!\",pow:\"^\",dotPow:\".^\\\\wedge\",unaryPlus:\"+\",unaryMinus:\"-\",bitNot:\"\\\\~\",not:\"\\\\neg\",multiply:\"\\\\cdot\",divide:\"\\\\frac\",dotMultiply:\".\\\\cdot\",dotDivide:\".:\",mod:\"\\\\mod\",add:\"+\",subtract:\"-\",to:\"\\\\rightarrow\",leftShift:\"<<\",rightArithShift:\">>\",rightLogShift:\">>>\",equal:\"=\",unequal:\"\\\\neq\",smaller:\"<\",larger:\">\",smallerEq:\"\\\\leq\",largerEq:\"\\\\geq\",bitAnd:\"\\\\&\",bitXor:\"\\\\underline{|}\",bitOr:\"|\",and:\"\\\\wedge\",xor:\"\\\\veebar\",or:\"\\\\vee\"},Sf={abs:{1:\"\\\\left|${args[0]}\\\\right|\"},add:{2:`\\\\left(\\${args[0]}${c.add}\\${args[1]}\\\\right)`},cbrt:{1:\"\\\\sqrt[3]{${args[0]}}\"},ceil:{1:\"\\\\left\\\\lceil${args[0]}\\\\right\\\\rceil\"},cube:{1:\"\\\\left(${args[0]}\\\\right)^3\"},divide:{2:\"\\\\frac{${args[0]}}{${args[1]}}\"},dotDivide:{2:`\\\\left(\\${args[0]}${c.dotDivide}\\${args[1]}\\\\right)`},dotMultiply:{2:`\\\\left(\\${args[0]}${c.dotMultiply}\\${args[1]}\\\\right)`},dotPow:{2:`\\\\left(\\${args[0]}${c.dotPow}\\${args[1]}\\\\right)`},exp:{1:\"\\\\exp\\\\left(${args[0]}\\\\right)\"},expm1:`\\\\left(e${c.pow}{\\${args[0]}}-1\\\\right)`,fix:{1:\"\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)\"},floor:{1:\"\\\\left\\\\lfloor${args[0]}\\\\right\\\\rfloor\"},fraction:{2:\"\\\\frac{${args[0]}}{${args[1]}}\"},gcd:\"\\\\gcd\\\\left(${args}\\\\right)\",hypot:\"\\\\hypot\\\\left(${args}\\\\right)\",log:{1:\"\\\\ln\\\\left(${args[0]}\\\\right)\",2:\"\\\\log_{${args[1]}}\\\\left(${args[0]}\\\\right)\"},log10:{1:\"\\\\log_{10}\\\\left(${args[0]}\\\\right)\"},log1p:{1:\"\\\\ln\\\\left(${args[0]}+1\\\\right)\",2:\"\\\\log_{${args[1]}}\\\\left(${args[0]}+1\\\\right)\"},log2:\"\\\\log_{2}\\\\left(${args[0]}\\\\right)\",mod:{2:`\\\\left(\\${args[0]}${c.mod}\\${args[1]}\\\\right)`},multiply:{2:`\\\\left(\\${args[0]}${c.multiply}\\${args[1]}\\\\right)`},norm:{1:\"\\\\left\\\\|${args[0]}\\\\right\\\\|\",2:void 0},nthRoot:{2:\"\\\\sqrt[${args[1]}]{${args[0]}}\"},nthRoots:{2:\"\\\\{y : y^${args[1]} = {${args[0]}}\\\\}\"},pow:{2:`\\\\left(\\${args[0]}\\\\right)${c.pow}{\\${args[1]}}`},round:{1:\"\\\\left\\\\lfloor${args[0]}\\\\right\\\\rceil\",2:void 0},sign:{1:\"\\\\mathrm{${name}}\\\\left(${args[0]}\\\\right)\"},sqrt:{1:\"\\\\sqrt{${args[0]}}\"},square:{1:\"\\\\left(${args[0]}\\\\right)^2\"},subtract:{2:`\\\\left(\\${args[0]}${c.subtract}\\${args[1]}\\\\right)`},unaryMinus:{1:c.unaryMinus+\"\\\\left(${args[0]}\\\\right)\"},unaryPlus:{1:c.unaryPlus+\"\\\\left(${args[0]}\\\\right)\"},bitAnd:{2:`\\\\left(\\${args[0]}${c.bitAnd}\\${args[1]}\\\\right)`},bitNot:{1:c.bitNot+\"\\\\left(${args[0]}\\\\right)\"},bitOr:{2:`\\\\left(\\${args[0]}${c.bitOr}\\${args[1]}\\\\right)`},bitXor:{2:`\\\\left(\\${args[0]}${c.bitXor}\\${args[1]}\\\\right)`},leftShift:{2:`\\\\left(\\${args[0]}${c.leftShift}\\${args[1]}\\\\right)`},rightArithShift:{2:`\\\\left(\\${args[0]}${c.rightArithShift}\\${args[1]}\\\\right)`},rightLogShift:{2:`\\\\left(\\${args[0]}${c.rightLogShift}\\${args[1]}\\\\right)`},bellNumbers:{1:\"\\\\mathrm{B}_{${args[0]}}\"},catalan:{1:\"\\\\mathrm{C}_{${args[0]}}\"},stirlingS2:{2:\"\\\\mathrm{S}\\\\left(${args}\\\\right)\"},arg:{1:\"\\\\arg\\\\left(${args[0]}\\\\right)\"},conj:{1:\"\\\\left(${args[0]}\\\\right)^*\"},im:{1:\"\\\\Im\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace\"},re:{1:\"\\\\Re\\\\left\\\\lbrace${args[0]}\\\\right\\\\rbrace\"},and:{2:`\\\\left(\\${args[0]}${c.and}\\${args[1]}\\\\right)`},not:{1:c.not+\"\\\\left(${args[0]}\\\\right)\"},or:{2:`\\\\left(\\${args[0]}${c.or}\\${args[1]}\\\\right)`},xor:{2:`\\\\left(\\${args[0]}${c.xor}\\${args[1]}\\\\right)`},cross:{2:\"\\\\left(${args[0]}\\\\right)\\\\times\\\\left(${args[1]}\\\\right)\"},ctranspose:{1:\"\\\\left(${args[0]}\\\\right)\"+c.ctranspose},det:{1:\"\\\\det\\\\left(${args[0]}\\\\right)\"},dot:{2:\"\\\\left(${args[0]}\\\\cdot${args[1]}\\\\right)\"},expm:{1:\"\\\\exp\\\\left(${args[0]}\\\\right)\"},inv:{1:\"\\\\left(${args[0]}\\\\right)^{-1}\"},pinv:{1:\"\\\\left(${args[0]}\\\\right)^{+}\"},sqrtm:{1:`{\\${args[0]}}${c.pow}{\\\\frac{1}{2}}`},trace:{1:\"\\\\mathrm{tr}\\\\left(${args[0]}\\\\right)\"},transpose:{1:\"\\\\left(${args[0]}\\\\right)\"+c.transpose},combinations:{2:\"\\\\binom{${args[0]}}{${args[1]}}\"},combinationsWithRep:{2:\"\\\\left(\\\\!\\\\!{\\\\binom{${args[0]}}{${args[1]}}}\\\\!\\\\!\\\\right)\"},factorial:{1:\"\\\\left(${args[0]}\\\\right)\"+c.factorial},gamma:{1:\"\\\\Gamma\\\\left(${args[0]}\\\\right)\"},lgamma:{1:\"\\\\ln\\\\Gamma\\\\left(${args[0]}\\\\right)\"},equal:{2:`\\\\left(\\${args[0]}${c.equal}\\${args[1]}\\\\right)`},larger:{2:`\\\\left(\\${args[0]}${c.larger}\\${args[1]}\\\\right)`},largerEq:{2:`\\\\left(\\${args[0]}${c.largerEq}\\${args[1]}\\\\right)`},smaller:{2:`\\\\left(\\${args[0]}${c.smaller}\\${args[1]}\\\\right)`},smallerEq:{2:`\\\\left(\\${args[0]}${c.smallerEq}\\${args[1]}\\\\right)`},unequal:{2:`\\\\left(\\${args[0]}${c.unequal}\\${args[1]}\\\\right)`},erf:{1:\"erf\\\\left(${args[0]}\\\\right)\"},max:\"\\\\max\\\\left(${args}\\\\right)\",min:\"\\\\min\\\\left(${args}\\\\right)\",variance:\"\\\\mathrm{Var}\\\\left(${args}\\\\right)\",acos:{1:\"\\\\cos^{-1}\\\\left(${args[0]}\\\\right)\"},acosh:{1:\"\\\\cosh^{-1}\\\\left(${args[0]}\\\\right)\"},acot:{1:\"\\\\cot^{-1}\\\\left(${args[0]}\\\\right)\"},acoth:{1:\"\\\\coth^{-1}\\\\left(${args[0]}\\\\right)\"},acsc:{1:\"\\\\csc^{-1}\\\\left(${args[0]}\\\\right)\"},acsch:{1:\"\\\\mathrm{csch}^{-1}\\\\left(${args[0]}\\\\right)\"},asec:{1:\"\\\\sec^{-1}\\\\left(${args[0]}\\\\right)\"},asech:{1:\"\\\\mathrm{sech}^{-1}\\\\left(${args[0]}\\\\right)\"},asin:{1:\"\\\\sin^{-1}\\\\left(${args[0]}\\\\right)\"},asinh:{1:\"\\\\sinh^{-1}\\\\left(${args[0]}\\\\right)\"},atan:{1:\"\\\\tan^{-1}\\\\left(${args[0]}\\\\right)\"},atan2:{2:\"\\\\mathrm{atan2}\\\\left(${args}\\\\right)\"},atanh:{1:\"\\\\tanh^{-1}\\\\left(${args[0]}\\\\right)\"},cos:{1:\"\\\\cos\\\\left(${args[0]}\\\\right)\"},cosh:{1:\"\\\\cosh\\\\left(${args[0]}\\\\right)\"},cot:{1:\"\\\\cot\\\\left(${args[0]}\\\\right)\"},coth:{1:\"\\\\coth\\\\left(${args[0]}\\\\right)\"},csc:{1:\"\\\\csc\\\\left(${args[0]}\\\\right)\"},csch:{1:\"\\\\mathrm{csch}\\\\left(${args[0]}\\\\right)\"},sec:{1:\"\\\\sec\\\\left(${args[0]}\\\\right)\"},sech:{1:\"\\\\mathrm{sech}\\\\left(${args[0]}\\\\right)\"},sin:{1:\"\\\\sin\\\\left(${args[0]}\\\\right)\"},sinh:{1:\"\\\\sinh\\\\left(${args[0]}\\\\right)\"},tan:{1:\"\\\\tan\\\\left(${args[0]}\\\\right)\"},tanh:{1:\"\\\\tanh\\\\left(${args[0]}\\\\right)\"},to:{2:`\\\\left(\\${args[0]}${c.to}\\${args[1]}\\\\right)`},numeric:function(e,t){return e.args[0].toTex()},number:{0:\"0\",1:\"\\\\left(${args[0]}\\\\right)\",2:\"\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)\"},string:{0:'\\\\mathtt{\"\"}',1:\"\\\\mathrm{string}\\\\left(${args[0]}\\\\right)\"},bignumber:{0:\"0\",1:\"\\\\left(${args[0]}\\\\right)\"},bigint:{0:\"0\",1:\"\\\\left(${args[0]}\\\\right)\"},complex:{0:\"0\",1:\"\\\\left(${args[0]}\\\\right)\",2:`\\\\left(\\\\left(\\${args[0]}\\\\right)+${Ef.i}\\\\cdot\\\\left(\\${args[1]}\\\\right)\\\\right)`},matrix:{0:\"\\\\begin{bmatrix}\\\\end{bmatrix}\",1:\"\\\\left(${args[0]}\\\\right)\",2:\"\\\\left(${args[0]}\\\\right)\"},sparse:{0:\"\\\\begin{bsparse}\\\\end{bsparse}\",1:\"\\\\left(${args[0]}\\\\right)\"},unit:{1:\"\\\\left(${args[0]}\\\\right)\",2:\"\\\\left(\\\\left(${args[0]}\\\\right)${args[1]}\\\\right)\"}},Mf={deg:\"^\\\\circ\"};function Cf(e){return Af(e,{preserveFormatting:!0})}function Tf(e,t){return(t=void 0!==t&&t)?ue(Mf,e)?Mf[e]:\"\\\\mathrm{\"+Cf(e)+\"}\":ue(Ef,e)?Ef[e]:Cf(e)}const Bf=\"ConstantNode\",Ff=s(Bf,[\"Node\"],e=>{e=e.Node;class t extends e{constructor(e){super(),this.value=e}get type(){return Bf}get isConstantNode(){return!0}_compile(e,t){const r=this.value;return function(){return r}}forEach(e){}map(e){return this.clone()}clone(){return new t(this.value)}_toString(e){return S(this.value,e)}_toHTML(e){var t=this._toString(e);switch(K(this.value)){case\"number\":case\"bigint\":case\"BigNumber\":case\"Fraction\":return''+t+\"\";case\"string\":return''+t+\"\";case\"boolean\":return''+t+\"\";case\"null\":return''+t+\"\";case\"undefined\":return''+t+\"\";default:return''+t+\"\"}}toJSON(){return{mathjs:Bf,value:this.value}}static fromJSON(e){return new t(e.value)}_toTex(e){const t=this._toString(e),r=K(this.value);switch(r){case\"string\":return\"\\\\mathtt{\"+Cf(t)+\"}\";case\"number\":case\"BigNumber\":{if(!(\"BigNumber\"===r?this.value.isFinite():isFinite(this.value)))return this.value.valueOf()<0?\"-\\\\infty\":\"\\\\infty\";const e=t.toLowerCase().indexOf(\"e\");return-1!==e?t.substring(0,e)+\"\\\\cdot10^{\"+t.substring(e+1)+\"}\":t}case\"bigint\":return t.toString();case\"Fraction\":return this.value.toLatex();default:return t}}}return of(t,\"name\",Bf),t},{isClass:!0,isNode:!0}),Df=\"FunctionAssignmentNode\",Of=s(Df,[\"typed\",\"Node\"],e=>{let{typed:f,Node:t}=e;function i(e,t,r){var n=F(e,t,r),e=F(e.expr,t,r);return\"all\"===t||null!==e&&e<=n}class r extends t{constructor(e,t,r){if(super(),\"string\"!=typeof e)throw new TypeError('String expected for parameter \"name\"');if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter \"params\"');if(!O(r))throw new TypeError('Node expected for parameter \"expr\"');if(rf.has(e))throw new Error('Illegal function name, \"'+e+'\" is a reserved keyword');const n=new Set;for(const e of t){const t=\"string\"==typeof e?e:e.name;if(n.has(t))throw new Error(`Duplicate parameter name \"${t}\"`);n.add(t)}this.name=e,this.params=t.map(function(e){return e&&e.name||e}),this.types=t.map(function(e){return e&&e.type||\"any\"}),this.expr=r}get type(){return Df}get isFunctionAssignmentNode(){return!0}_compile(e,t){const r=Object.create(t),a=(qn(this.params,function(e){r[e]=!0}),this.expr),o=a._compile(e,r),s=this.name,u=this.params,l=Rn(this.types,\",\"),c=s+\"(\"+Rn(this.params,\", \")+\")\";return function(e,r,n){const t={},i=(t[l]=function(){const t=Object.create(r);for(let e=0;e'+Nn(this.params[e])+\"\");let n=this.expr.toHTML(e);return i(this,t,e&&e.implicit)&&(n='('+n+')'),''+Nn(this.name)+'('+r.join(',')+')='+n}_toTex(e){var t=e&&e.parenthesis?e.parenthesis:\"keep\";let r=this.expr.toTex(e);return i(this,t,e&&e.implicit)&&(r=`\\\\left(${r}\\\\right)`),\"\\\\mathrm{\"+this.name+\"}\\\\left(\"+this.params.map(Tf).join(\",\")+\"\\\\right)=\"+r}}return of(r,\"name\",Df),r},{isClass:!0,isNode:!0}),_f=\"IndexNode\",zf=s(_f,[\"Node\",\"size\"],e=>{let{Node:t,size:s}=e;class n extends t{constructor(e,t){if(super(),this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(O))throw new TypeError('Array containing Nodes expected for parameter \"dimensions\"');if(this.dotNotation&&!this.isObjectProperty())throw new Error(\"dotNotation only applicable for object properties\")}get type(){return _f}get isIndexNode(){return!0}_compile(r,n){const i=zn(this.dimensions,function(e,a){if(0e.isSymbolNode&&\"end\"===e.name).length){const t=Object.create(n),o=(t.end=!0,e._compile(r,t));return function(e,t,r){if(!_(r)&&!b(r)&&!j(r))throw new TypeError('Cannot resolve \"end\": context must be a Matrix, Array, or string but is '+K(r));const n=s(r).valueOf(),i=Object.create(t);return i.end=n[a],o(e,i,r)}}return e._compile(r,n)}),a=h(r,\"index\");return function(t,r,n){var e=zn(i,function(e){return e(t,r,n)});return a(...e)}}forEach(t){for(let e=0;e.'+Nn(this.getObjectProperty())+\"\":'['+t.join(',')+']'}_toTex(t){const e=this.dimensions.map(function(e){return e.toTex(t)});return this.dotNotation?\".\"+this.getObjectProperty():\"_{\"+e.join(\",\")+\"}\"}}return of(n,\"name\",_f),n},{isClass:!0,isNode:!0}),qf=\"ObjectNode\",If=s(qf,[\"Node\"],e=>{e=e.Node;class r extends e{constructor(t){if(super(),this.properties=t||{},t&&(\"object\"!=typeof t||!Object.keys(t).every(function(e){return O(t[e])})))throw new TypeError(\"Object containing Nodes expected\")}get type(){return qf}get isObjectNode(){return!0}_compile(e,t){const a={};for(const r in this.properties)if(ue(this.properties,r)){const n=vn(r),i=JSON.parse(n),o=h(this.properties,r);a[i]=o._compile(e,t)}return function(e,t,r){const n={};for(const i in a)ue(a,i)&&(n[i]=a[i](e,t,r));return n}}forEach(e){for(const t in this.properties)ue(this.properties,t)&&e(this.properties[t],\"properties[\"+vn(t)+\"]\",this)}map(e){const t={};for(const r in this.properties)ue(this.properties,r)&&(t[r]=this._ifNode(e(this.properties[r],\"properties[\"+vn(r)+\"]\",this)));return new r(t)}clone(){const e={};for(const t in this.properties)ue(this.properties,t)&&(e[t]=this.properties[t]);return new r(e)}_toString(e){const t=[];for(const r in this.properties)ue(this.properties,r)&&t.push(vn(r)+\": \"+this.properties[r].toString(e));return\"{\"+t.join(\", \")+\"}\"}toJSON(){return{mathjs:qf,properties:this.properties}}static fromJSON(e){return new r(e.properties)}_toHTML(e){const t=[];for(const r in this.properties)ue(this.properties,r)&&t.push(''+Nn(r)+':'+this.properties[r].toHTML(e));return'{'+t.join(',')+'}'}_toTex(e){const t=[];for(const r in this.properties)ue(this.properties,r)&&t.push(\"\\\\mathbf{\"+r+\":} & \"+this.properties[r].toTex(e)+\"\\\\\\\\\");return\"\\\\left\\\\{\\\\begin{array}{ll}\"+t.join(\"\\n\")+\"\\\\end{array}\\\\right\\\\}\"}}return of(r,\"name\",qf),r},{isClass:!0,isNode:!0});function kf(e,t){return new k(e,new I(t),new Set(Object.keys(t)))}const Rf=\"OperatorNode\",Pf=s(Rf,[\"Node\"],e=>{e=e.Node;function l(a,o,s,r,e){const u=F(a,o,s),l=df(a,o);if(\"all\"===o||2)'),\"right\"===n?''+Nn(this.op)+\"\"+e:e+''+Nn(this.op)+\"\"}if(2===i.length){let e=i[0].toHTML(r),t=i[1].toHTML(r);return a[0]&&(e='('+e+')'),a[1]&&(t='('+t+')'),this.implicit&&\"OperatorNode:multiply\"===this.getIdentifier()&&\"hide\"===n?e+''+t:e+''+Nn(this.op)+\"\"+t}{const t=i.map(function(e,t){return e=e.toHTML(r),e=a[t]?'('+e+')':e});return 2'):t.join(''+Nn(this.op)+\"\"):''+Nn(this.fn)+'('+t.join(',')+')'}}_toTex(n){const i=n&&n.parenthesis?n.parenthesis:\"keep\",a=n&&n.implicit?n.implicit:\"hide\",o=this.args,s=l(this,i,a,o,!0);let u=c[this.fn];if(u=void 0===u?this.op:u,1===o.length){const a=df(this,i);let e=o[0].toTex(n);return s[0]&&(e=`\\\\left(${e}\\\\right)`),\"right\"===a?u+e:e+u}if(2===o.length){const l=o[0];let e=l.toTex(n);s[0]&&(e=`\\\\left(${e}\\\\right)`);let t,r=o[1].toTex(n);switch(s[1]&&(r=`\\\\left(${r}\\\\right)`),t=(\"keep\"===i?l:l.getContent()).getIdentifier(),this.getIdentifier()){case\"OperatorNode:divide\":return u+\"{\"+e+\"}{\"+r+\"}\";case\"OperatorNode:pow\":switch(e=\"{\"+e+\"}\",r=\"{\"+r+\"}\",t){case\"ConditionalNode\":case\"OperatorNode:divide\":e=`\\\\left(${e}\\\\right)`}break;case\"OperatorNode:multiply\":if(this.implicit&&\"hide\"===a)return e+\"~\"+r}return e+u+r}if(2{e=e.Node;class t extends e{constructor(e){if(super(),!O(e))throw new TypeError('Node expected for parameter \"content\"');this.content=e}get type(){return Uf}get isParenthesisNode(){return!0}_compile(e,t){return this.content._compile(e,t)}getContent(){return this.content.getContent()}forEach(e){e(this.content,\"content\",this)}map(e){e=e(this.content,\"content\",this);return new t(e)}clone(){return new t(this.content)}_toString(e){return!e||!e.parenthesis||e&&\"keep\"===e.parenthesis?\"(\"+this.content.toString(e)+\")\":this.content.toString(e)}toJSON(){return{mathjs:Uf,content:this.content}}static fromJSON(e){return new t(e.content)}_toHTML(e){return!e||!e.parenthesis||e&&\"keep\"===e.parenthesis?'('+this.content.toHTML(e)+')':this.content.toHTML(e)}_toTex(e){return!e||!e.parenthesis||e&&\"keep\"===e.parenthesis?`\\\\left(${this.content.toTex(e)}\\\\right)`:this.content.toTex(e)}}return of(t,\"name\",Uf),t},{isClass:!0,isNode:!0}),Lf=\"RangeNode\",$f=s(Lf,[\"Node\"],e=>{e=e.Node;function a(e,t,r){const n=F(e,t,r),i={},a=F(e.start,t,r);if(i.start=null!==a&&a<=n||\"all\"===t,e.step){const a=F(e.step,t,r);i.step=null!==a&&a<=n||\"all\"===t}e=F(e.end,t,r);return i.end=null!==e&&e<=n||\"all\"===t,i}class t extends e{constructor(e,t,r){if(super(),!O(e))throw new TypeError(\"Node expected\");if(!O(t))throw new TypeError(\"Node expected\");if(r&&!O(r))throw new TypeError(\"Node expected\");if(3('+e+')'),n=e,this.step){let e=this.step.toHTML(t);r.step&&(e='('+e+')'),n+=':'+e}let i=this.end.toHTML(t);return r.end&&(i='('+i+')'),n+=':'+i}_toTex(t){var r=a(this,t&&t.parenthesis?t.parenthesis:\"keep\",t&&t.implicit);let n=this.start.toTex(t);if(r.start&&(n=`\\\\left(${n}\\\\right)`),this.step){let e=this.step.toTex(t);r.step&&(e=`\\\\left(${e}\\\\right)`),n+=\":\"+e}let e=this.end.toTex(t);return r.end&&(e=`\\\\left(${e}\\\\right)`),n+=\":\"+e}}return of(t,\"name\",Lf),t},{isClass:!0,isNode:!0}),Hf=\"RelationalNode\",Gf=s(Hf,[\"Node\"],e=>{e=e.Node;const o={equal:\"==\",unequal:\"!=\",smaller:\"<\",larger:\">\",smallerEq:\"<=\",largerEq:\">=\"};class t extends e{constructor(e,t){if(super(),!Array.isArray(e))throw new TypeError(\"Parameter conditionals must be an array\");if(!Array.isArray(t))throw new TypeError(\"Parameter params must be an array\");if(e.length!==t.length-1)throw new TypeError(\"Parameter params must contain exactly one more element than parameter conditionals\");this.conditionals=e,this.params=t}get type(){return Hf}get isRelationalNode(){return!0}_compile(o,t){const s=this,u=this.params.map(e=>e._compile(o,t));return function(t,r,n){let i,a=u[0](t,r,n);for(let e=0;er(e,\"params[\"+t+\"]\",this),this)}map(r){return new t(this.conditionals.slice(),this.params.map((e,t)=>this._ifNode(r(e,\"params[\"+t+\"]\",this)),this))}clone(){return new t(this.conditionals,this.params)}_toString(n){const i=n&&n.parenthesis?n.parenthesis:\"keep\",a=F(this,i,n&&n.implicit),t=this.params.map(function(e,t){var r=F(e,i,n&&n.implicit);return\"all\"===i||null!==r&&r<=a?\"(\"+e.toString(n)+\")\":e.toString(n)});let r=t[0];for(let e=0;e('+e.toHTML(n)+')':e.toHTML(n)});let r=t[0];for(let e=0;e'+Nn(o[this.conditionals[e]])+\"\"+t[e+1];return r}_toTex(n){const i=n&&n.parenthesis?n.parenthesis:\"keep\",a=F(this,i,n&&n.implicit),t=this.params.map(function(e,t){var r=F(e,i,n&&n.implicit);return\"all\"===i||null!==r&&r<=a?\"\\\\left(\"+e.toTex(n)+\"\\right)\":e.toTex(n)});let r=t[0];for(let e=0;e{let{math:n,Unit:a,Node:t}=e;function o(e){return!!a&&a.isValuelessUnit(e)}class s extends t{constructor(e){if(super(),\"string\"!=typeof e)throw new TypeError('String expected for parameter \"name\"');this.name=e}get type(){return\"SymbolNode\"}get isSymbolNode(){return!0}_compile(n,e){const i=this.name;if(!0===e[i])return function(e,t,r){return h(t,i)};if(i in n)return function(e,t,r){return e.has(i)?e.get(i):h(n,i)};{const n=o(i);return function(e,t,r){return e.has(i)?e.get(i):n?new a(null,i):s.onUndefinedSymbol(i)}}}forEach(e){}map(e){return this.clone()}static onUndefinedSymbol(e){throw new Error(\"Undefined symbol \"+e)}clone(){return new s(this.name)}_toString(e){return this.name}_toHTML(e){var t=Nn(this.name);return\"true\"===t||\"false\"===t?''+t+\"\":\"i\"===t?''+t+\"\":\"Infinity\"===t?''+t+\"\":\"NaN\"===t?''+t+\"\":\"null\"===t?''+t+\"\":\"undefined\"===t?''+t+\"\":''+t+\"\"}toJSON(){return{mathjs:\"SymbolNode\",name:this.name}}static fromJSON(e){return new s(e.name)}_toTex(e){let t=!1;void 0===n[this.name]&&o(this.name)&&(t=!0);var r=Tf(this.name,t);return\"\\\\\"===r[0]?r:\" \"+r}}return s},{isClass:!0,isNode:!0}),Zf=\"FunctionNode\",Wf=s(Zf,[\"math\",\"Node\",\"SymbolNode\"],e=>{var t;let{math:i,Node:r,SymbolNode:n}=e;const p=e=>S(e,{truncate:78});function a(e,t,r){let n=\"\";const i=/\\$(?:\\{([a-z_][a-z_0-9]*)(?:\\[([0-9]+)\\])?\\}|\\$)/gi;let a,o=0;for(;null!==(a=i.exec(e));)if(n+=e.substring(o,a.index),o=a.index,\"$$\"===a[0])n+=\"$\",o++;else{o+=a[0].length;const e=t[a[1]];if(!e)throw new ReferenceError(\"Template: Property \"+a[1]+\" does not exist.\");if(void 0===a[2])switch(typeof e){case\"string\":n+=e;break;case\"object\":if(O(e))n+=e.toTex(r);else{if(!Array.isArray(e))throw new TypeError(\"Template: \"+a[1]+\" has to be a Node, String or array of Nodes\");n+=e.map(function(e,t){if(O(e))return e.toTex(r);throw new TypeError(\"Template: \"+a[1]+\"[\"+t+\"] is not a Node.\")}).join(\",\")}break;default:throw new TypeError(\"Template: \"+a[1]+\" has to be a Node, String or array of Nodes\")}else{if(!O(e[a[2]]&&e[a[2]]))throw new TypeError(\"Template: \"+a[1]+\"[\"+a[2]+\"] is not a Node.\");n+=e[a[2]].toTex(r)}}return n+=e.slice(o)}class m extends r{constructor(e,t){if(super(),!O(e=\"string\"==typeof e?new n(e):e))throw new TypeError('Node expected as parameter \"fn\"');if(!Array.isArray(t)||!t.every(O))throw new TypeError('Array containing Nodes expected for parameter \"args\"');this.fn=e,this.args=t||[]}get name(){return this.fn.name||\"\"}get type(){return Zf}get isFunctionNode(){return!0}_compile(a,i){const o=this.args.map(e=>e._compile(a,i));if(!se(this.fn)){if(ge(this.fn)&&Ee(this.fn.index)&&this.fn.index.isObjectProperty()){const s=this.fn.object._compile(a,i),h=this.fn.index.getObjectProperty(),u=this.args;return function(t,r,n){const e=s(t,r,n),i=function(e,t){if(q(e,t))return e[t];throw new Error('No access to method \"'+t+'\"')}(e,h);if(null!=i&&i.rawArgs)return i(u,a,kf(t,r));{const a=o.map(e=>e(t,r,n));return i.apply(e,a)}}}{const l=this.fn.toString(),h=this.fn._compile(a,i),c=this.args;return function(t,r,n){const e=h(t,r,n);if(\"function\"!=typeof e)throw new TypeError(`Expression '${l}' did not evaluate to a function; value is:\n `+p(e));if(e.rawArgs)return e(c,a,kf(t,r));{const a=o.map(e=>e(t,r,n));return e.apply(e,a)}}}}{const f=this.fn.name;if(i[f]){const i=this.args;return function(t,r,n){const e=h(r,f);if(\"function\"!=typeof e)throw new TypeError(`Argument '${f}' was not a function; received: `+p(e));if(e.rawArgs)return e(i,a,kf(t,r));{const a=o.map(e=>e(t,r,n));return e.apply(e,a)}}}{const i=f in a?h(a,f):void 0,e=\"function\"==typeof i&&!0===i.rawArgs,q=e=>{let t;if(e.has(f))t=e.get(f);else{if(!(f in a))return m.onUndefinedFunction(f);t=h(a,f)}if(\"function\"==typeof t)return t;throw new TypeError(`'${f}' is not a function; its value is:\n `+p(t))};if(e){const i=this.args;return function(t,r,n){const e=q(t);return!0===e.rawArgs?e(i,a,kf(t,r)):e(...o.map(e=>e(t,r,n)))}}switch(o.length){case 0:return function(e,t,r){return q(e)()};case 1:return function(e,t,r){return q(e)((0,o[0])(e,t,r))};case 2:return function(e,t,r){const n=q(e),i=o[0],a=o[1];return n(i(e,t,r),a(e,t,r))};default:return function(t,r,n){return q(t)(...o.map(e=>e(t,r,n)))}}}}}forEach(t){t(this.fn,\"fn\",this);for(let e=0;e'+Nn(this.fn)+'('+e.join(',')+')'}toTex(e){let t;return void 0!==(t=e&&\"object\"==typeof e.handler&&ue(e.handler,this.name)?e.handler[this.name](this,e):t)?t:super.toTex(e)}_toTex(t){var e=this.args.map(function(e){return e.toTex(t)});let r,n;switch(Sf[this.name]&&(r=Sf[this.name]),typeof(r=!i[this.name]||\"function\"!=typeof i[this.name].toTex&&\"object\"!=typeof i[this.name].toTex&&\"string\"!=typeof i[this.name].toTex?r:i[this.name].toTex)){case\"function\":n=r(this,t);break;case\"string\":n=a(r,this,t);break;case\"object\":switch(typeof r[e.length]){case\"function\":n=r[e.length](this,t);break;case\"string\":n=a(r[e.length],this,t)}}return void 0!==n?n:a(\"\\\\mathrm{${name}}\\\\left(${args}\\\\right)\",this,t)}getIdentifier(){return this.type+\":\"+this.name}}return of(t=m,\"name\",Zf),of(m,\"onUndefinedFunction\",function(e){throw new Error(\"Undefined function \"+e)}),of(m,\"fromJSON\",function(e){return new t(e.fn,e.args)}),m},{isClass:!0,isNode:!0}),Yf=s(\"parse\",[\"typed\",\"numeric\",\"config\",\"AccessorNode\",\"ArrayNode\",\"AssignmentNode\",\"BlockNode\",\"ConditionalNode\",\"ConstantNode\",\"FunctionAssignmentNode\",\"FunctionNode\",\"IndexNode\",\"ObjectNode\",\"OperatorNode\",\"ParenthesisNode\",\"RangeNode\",\"RelationalNode\",\"SymbolNode\"],I=>{let{typed:e,numeric:c,config:k,AccessorNode:i,ArrayNode:f,AssignmentNode:o,BlockNode:R,ConditionalNode:P,ConstantNode:p,FunctionAssignmentNode:U,FunctionNode:j,IndexNode:a,ObjectNode:L,OperatorNode:s,ParenthesisNode:$,RangeNode:n,RelationalNode:H,SymbolNode:m}=I;const u=e(\"parse\",{string:function(e){return M(e,{})},\"Array | Matrix\":function(e){return t(e,{})},\"string, Object\":function(e,t){return M(e,void 0!==t.nodes?t.nodes:{})},\"Array | Matrix, Object\":t});function t(e){var t=1\":!0,\"<=\":!0,\">=\":!0,\"<<\":!0,\">>\":!0,\">>>\":!0},d={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},g={true:!0,false:!1,null:null,undefined:void 0},G=[\"NaN\",\"Infinity\"],V={'\"':'\"',\"'\":\"'\",\"\\\\\":\"\\\\\",\"/\":\"/\",b:\"\\b\",f:\"\\f\",n:\"\\n\",r:\"\\r\",t:\"\\t\"};function y(e,t){return e.expression.substr(e.index,t)}function x(e){return y(e,1)}function b(e){e.index++}function v(e){return e.expression.charAt(e.index-1)}function w(e){return e.expression.charAt(e.index+1)}function N(e){for(e.tokenType=h.NULL,e.token=\"\",e.comment=\"\";;){if(\"#\"===x(e))for(;\"\\n\"!==x(e)&&\"\"!==x(e);)e.comment+=x(e),b(e);if(!u.isWhitespace(x(e),e.nestingLevel))break;b(e)}if(\"\"===x(e))return e.tokenType=h.DELIMITER;if(\"\\n\"===x(e)&&!e.nestingLevel)return e.tokenType=h.DELIMITER,e.token=x(e),b(e);const t=x(e),r=y(e,2),n=y(e,3);if(3===n.length&&l[n])return e.tokenType=h.DELIMITER,e.token=n,b(e),b(e),b(e);if(2===r.length&&l[r])return e.tokenType=h.DELIMITER,e.token=r,b(e),b(e);if(l[t])return e.tokenType=h.DELIMITER,e.token=t,b(e);if(u.isDigitDot(t)){e.tokenType=h.NUMBER;const t=y(e,2);if(\"0b\"===t||\"0o\"===t||\"0x\"===t){for(e.token+=x(e),b(e),e.token+=x(e),b(e);u.isHexDigit(x(e));)e.token+=x(e),b(e);if(\".\"===x(e))for(e.token+=\".\",b(e);u.isHexDigit(x(e));)e.token+=x(e),b(e);else if(\"i\"===x(e))for(e.token+=\"i\",b(e);u.isDigit(x(e));)e.token+=x(e),b(e)}else{if(\".\"===x(e)){if(e.token+=x(e),b(e),!u.isDigit(x(e)))return e.tokenType=h.DELIMITER}else{for(;u.isDigit(x(e));)e.token+=x(e),b(e);u.isDecimalMark(x(e),w(e))&&(e.token+=x(e),b(e))}for(;u.isDigit(x(e));)e.token+=x(e),b(e);if(\"E\"===x(e)||\"e\"===x(e))if(u.isDigit(w(e))||\"-\"===w(e)||\"+\"===w(e)){if(e.token+=x(e),b(e),\"+\"!==x(e)&&\"-\"!==x(e)||(e.token+=x(e),b(e)),!u.isDigit(x(e)))throw q(e,'Digit expected, got \"'+x(e)+'\"');for(;u.isDigit(x(e));)e.token+=x(e),b(e);if(u.isDecimalMark(x(e),w(e)))throw q(e,'Digit expected, got \"'+x(e)+'\"')}else if(u.isDecimalMark(w(e),e.expression.charAt(e.index+2)))throw b(e),q(e,'Digit expected, got \"'+x(e)+'\"')}}else{if(!u.isAlpha(x(e),v(e),w(e))){for(e.tokenType=h.UNKNOWN;\"\"!==x(e);)e.token+=x(e),b(e);throw q(e,'Syntax error in part \"'+e.token+'\"')}for(;u.isAlpha(x(e),v(e),w(e))||u.isDigit(x(e));)e.token+=x(e),b(e);ue(d,e.token)?e.tokenType=h.DELIMITER:e.tokenType=h.SYMBOL}}function A(e){for(;N(e),\"\\n\"===e.token;);}function E(e){e.nestingLevel++}function S(e){e.nestingLevel--}function M(e,t){var r={extraNodes:{},expression:\"\",comment:\"\",index:0,token:\"\",tokenType:h.NULL,nestingLevel:0,conditionalLevel:null},e=(gn(r,{expression:e,extraNodes:t}),N(r),function(e){let t;const r=[];let n;for(\"\"!==e.token&&\"\\n\"!==e.token&&\";\"!==e.token&&(t=C(e),e.comment&&(t.comment=e.comment));\"\\n\"===e.token||\";\"===e.token;)0===r.length&&t&&(n=\";\"!==e.token,r.push({node:t,visible:n})),N(e),\"\\n\"!==e.token&&\";\"!==e.token&&\"\"!==e.token&&(t=C(e),e.comment&&(t.comment=e.comment),n=\";\"!==e.token,r.push({node:t,visible:n}));return 0\":\"larger\",\"<=\":\"smallerEq\",\">=\":\"largerEq\"};for(;ue(n,e.token);){var i={name:e.token,fn:n[e.token]};r.push(i),A(e),t.push(W(e))}return 1===t.length?t[0]:2===t.length?new s(r[0].name,r[0].fn,t):new H(r.map(e=>e.fn),t)}function W(e){let t,r,n,i;t=Y(e);for(var a={\"<<\":\"leftShift\",\">>\":\"rightArithShift\",\">>>\":\"rightLogShift\"};ue(a,e.token);)n=a[r=e.token],A(e),i=[t,Y(e)],t=new s(r,n,i);return t}function Y(e){let t,r,n,i;t=J(e);for(var a={to:\"to\",in:\"to\"};ue(a,e.token);)n=a[r=e.token],A(e),t=\"in\"===r&&\"])},;\".includes(e.token)?new s(\"*\",\"multiply\",[t,new m(\"in\")],!0):(i=[t,J(e)],new s(r,n,i));return t}function J(e){let t;const r=[];if(t=\":\"===e.token?new p(1):X(e),\":\"===e.token&&e.conditionalLevel!==e.nestingLevel){for(r.push(t);\":\"===e.token&&r.length<3;)A(e),\")\"===e.token||\"]\"===e.token||\",\"===e.token||\"\"===e.token?r.push(new m(\"end\")):r.push(X(e));t=3===r.length?new n(r[0],r[2],r[1]):new n(r[0],r[1])}return t}function X(e){let t,r,n,i;t=Q(e);for(var a={\"+\":\"add\",\"-\":\"subtract\"};ue(a,e.token);){n=a[r=e.token],A(e);var o=Q(e);i=o.isPercentage?[t,new s(\"*\",\"multiply\",[t,o])]:[t,o],t=new s(r,n,i)}return t}function Q(e){let t,r,n,i;t=O(e),r=t;for(var a,o={\"*\":\"multiply\",\".*\":\"dotMultiply\",\"/\":\"divide\",\"./\":\"dotDivide\",\"%\":\"mod\",mod:\"mod\"};ue(o,e.token);)n=e.token,i=o[n],A(e),t=\"%\"===n&&e.tokenType===h.DELIMITER&&\"(\"!==e.token?\"\"!==e.token&&o[e.token]?(a=new s(\"/\",\"divide\",[t,new p(100)],!1,!0),n=e.token,i=o[n],A(e),r=O(e),new s(n,i,[a,r])):new s(\"/\",\"divide\",[t,new p(100)],!1,!0):(r=O(e),new s(n,i,[t,r]));return t}function O(e){let t,r;for(t=K(e),r=t;e.tokenType===h.SYMBOL||\"in\"===e.token&&ae(t)||\"in\"===e.token&&oe(t)&&\"unaryMinus\"===t.fn&&ae(t.args[0])||!(e.tokenType!==h.NUMBER||ae(r)||oe(r)&&\"!\"!==r.op)||\"(\"===e.token;)r=K(e),t=new s(\"*\",\"multiply\",[t,r],!0);return t}function K(e){let t=_(e),r=t;const n=[];for(;\"/\"===e.token&&we(r);){if(n.push(gn({},e)),A(e),e.tokenType!==h.NUMBER){gn(e,n.pop());break}if(n.push(gn({},e)),A(e),e.tokenType!==h.SYMBOL&&\"(\"!==e.token&&\"in\"!==e.token){n.pop(),gn(e,n.pop());break}gn(e,n.pop()),n.pop(),r=_(e),t=new s(\"/\",\"divide\",[t,r])}return t}function _(i){var e,t={\"-\":\"unaryMinus\",\"+\":\"unaryPlus\",\"~\":\"bitNot\",not:\"not\"};if(ue(t,i.token))return t=t[i.token],a=i.token,A(i),e=[_(i)],new s(a,t,e);{var a=i;let e,t,r,n;return e=function(e){let t=ee(e);for(;\"??\"===e.token;)A(e),t=new s(\"??\",\"nullish\",[t,ee(e)]);return t}(a),\"^\"!==a.token&&\".^\"!==a.token||(r=\"^\"===(t=a.token)?\"pow\":\"dotPow\",A(a),n=[e,_(a)],e=new s(t,r,n)),e}}function ee(e){let t,r,n,i;t=function(e){let t=[];if(e.tokenType===h.SYMBOL&&ue(e.extraNodes,e.token)){const c=e.extraNodes[e.token];if(N(e),\"(\"===e.token){if(t=[],E(e),N(e),\")\"!==e.token)for(t.push(C(e));\",\"===e.token;)N(e),t.push(C(e));if(\")\"!==e.token)throw q(e,\"Parenthesis ) expected\");S(e),N(e)}return new c(t)}var r=e;if(r.tokenType===h.SYMBOL||r.tokenType===h.DELIMITER&&r.token in d)return i=r.token,N(r),z(r,ue(g,i)?new p(g[i]):G.includes(i)?new p(c(i,\"number\")):new m(i));var i=r;if('\"'===i.token||\"'\"===i.token)return u=te(i,i.token),z(i,new p(u));{var a=i;let e,t,r,n;if(\"[\"!==a.token){var o=a;if(\"{\"!==o.token){var s,u=o;if(u.tokenType===h.NUMBER)return i=u.token,N(u),l=Ie(i,k),i=c(i,l),new p(i);var l=u;if(\"(\"!==l.token)throw\"\"===(s=l).token?q(s,\"Unexpected end of expression\"):q(s,\"Value expected\");if(E(l),N(l),s=C(l),\")\"!==l.token)throw q(l,\"Parenthesis ) expected\");return S(l),N(l),z(l,new $(s))}{let e;E(o);const c={};do{if(N(o),\"}\"!==o.token){if('\"'===o.token||\"'\"===o.token)e=te(o,o.token);else{if(!(o.tokenType===h.SYMBOL||o.tokenType===h.DELIMITER&&o.token in d))throw q(o,\"Symbol or string expected as object key\");e=o.token,N(o)}if(\":\"!==o.token)throw q(o,\"Colon : expected after object key\");N(o),c[e]=C(o)}}while(\",\"===o.token);if(\"}\"!==o.token)throw q(o,\"Comma , or bracket } expected after object value\");return S(o),N(o),z(o,new L(c))}}if(E(a),N(a),\"]\"!==a.token){const c=re(a);if(\";\"===a.token){for(r=1,t=[c];\";\"===a.token;)N(a),\"]\"!==a.token&&(t[r]=re(a),r++);if(\"]\"!==a.token)throw q(a,\"End of matrix ] expected\");S(a),N(a),n=t[0].items.length;for(let e=1;e{let{typed:t,parse:r}=e;return t(Jf,{string:function(e){return r(e).compile()},\"Array | Matrix\":function(e){return le(e,function(e){return r(e).compile()})}})}),Qf=\"evaluate\",Kf=s(Qf,[\"typed\",\"parse\"],e=>{let{typed:t,parse:r}=e;return t(Qf,{string:function(e){var t=P();return r(e).compile().evaluate(t)},\"string, Map | Object\":function(e,t){return r(e).compile().evaluate(t)},\"Array | Matrix\":function(e){const t=P();return le(e,function(e){return r(e).compile().evaluate(t)})},\"Array | Matrix, Map | Object\":function(e,t){return le(e,function(e){return r(e).compile().evaluate(t)})}})}),ep=s(\"Parser\",[\"evaluate\",\"parse\"],e=>{let{evaluate:t,parse:a}=e;function n(){if(!(this instanceof n))throw new SyntaxError(\"Constructor must be called with the new operator\");Object.defineProperty(this,\"scope\",{value:P(),writable:!1})}return n.prototype.type=\"Parser\",n.prototype.isParser=!0,n.prototype.evaluate=function(e){return t(e,this.scope)},n.prototype.get=function(e){if(this.scope.has(e))return this.scope.get(e)},n.prototype.getAll=function(){var e=this.scope;if(e instanceof I)return e.wrappedObject;var t={};for(const r of e.keys())D(t,r,e.get(r));return t},n.prototype.getAllAsMap=function(){return this.scope},n.prototype.set=function(e,t){if(function(t){if(0!==t.length){for(let e=0;e{var[e,t]=e;return r.set(e,t)}),Object.entries(e.functions).forEach(e=>{var[,e]=e;return r.evaluate(e)}),r},n},{isClass:!0});const tp=s(\"parser\",[\"typed\",\"Parser\"],e=>{let{typed:t,Parser:r}=e;return t(\"parser\",{\"\":function(){return new r}})}),rp=s(\"lup\",[\"typed\",\"matrix\",\"abs\",\"addScalar\",\"divideScalar\",\"multiplyScalar\",\"subtractScalar\",\"larger\",\"equalScalar\",\"unaryMinus\",\"DenseMatrix\",\"SparseMatrix\",\"Spa\"],e=>{let{typed:t,matrix:r,abs:C,addScalar:g,divideScalar:T,multiplyScalar:B,subtractScalar:y,larger:F,equalScalar:D,unaryMinus:O,DenseMatrix:x,SparseMatrix:_,Spa:z}=e;return t(\"lup\",{DenseMatrix:n,SparseMatrix:function(n){{var o=n,s,u,l,c;const f=o._size[0],p=o._size[1],m=Math.min(f,p),h=o._values,d=o._index,g=o._ptr,y=[],x=[],b=[],v=[f,m],w=[],N=[],A=[],E=[m,p];let e,r,t;const S=[],M=[];for(e=0;e{let{typed:t,matrix:r,zeros:f,identity:p,isZero:m,equal:h,sign:d,sqrt:g,conj:y,unaryMinus:x,addScalar:b,divideScalar:v,multiplyScalar:w,subtractScalar:N,complex:i}=e;return gn(t(\"qr\",{DenseMatrix:n,SparseMatrix:function(e){throw new Error(\"qr not implemented for sparse matrices yet\")},Array:function(e){const t=n(r(e));return{Q:t.Q.valueOf(),R:t.R.valueOf()}}}),{_denseQRimpl:a});function a(t){const r=t._size[0],n=t._size[1],e=p([r],\"dense\"),i=e._data,a=t.clone(),o=a._data;let s,u,l;const c=f([r],\"\");for(l=0;l{let{add:H,multiply:G,transpose:V}=e;return function(i,e){if(!e||i<=0||3a))for(const i=H[t+1];ei?(N=v,j=r,l[0+v]-i):(N=s[r++],j=u[N],l[0+N]),U=1;U<=A;U++)x=s[j++],(E=l[c+x])<=0||(t+=E,l[c+x]=-E,s[n++]=x,-1!==l[f+x]&&(y[l[f+x]]=y[x]),-1!==y[x]?l[f+y[x]]=l[f+x]:l[p+l[h+x]]=l[f+x]);N!==v&&(u[N]=-v-2,l[d+N]=0)}for(0!==i&&(P=n),l[h+v]=t,u[v]=W,l[0+v]=n-W,l[m+v]=-2,D=Z(D,o,l,d,a),S=W;S=D?l[d+N]-=E:0!==l[d+N]&&(l[d+N]=l[h+N]+i)}for(S=W;S{let S=e[\"transpose\"];return function(e,t,r,n){if(!e||!t||!r)return null;var i=e._size,a=i[0],o=i[1];let s,u,l,c,f,p,m;const h=4*o+(n?o+a+1:0),d=[],g=o,y=2*o,x=3*o,b=4*o,v=5*o+1;for(l=0;l{var{add:e,multiply:t,transpose:r}=e;const s=ap({add:e,multiply:t,transpose:r}),u=op({transpose:r});return function(e,t,r){const n=t._ptr,i=t._size[1];let a;const o={};if(o.q=s(e,t),e&&!o.q)return null;if(r){const r=e?function(n,t){n._values;const i=n._index,a=n._ptr,e=n._size,r=n._datatype,o=e[0],s=e[1],u=[],l=[];let c=0;for(let e=0;e{let{divideScalar:x,multiply:b,subtract:v}=e;return function(t,r,p,n,i,a,o){var s=t._values,u=t._index,l=t._ptr,c=t._size[1],e=r._values,f=r._index,m=r._ptr;let h,d,g,y;t=function(e,t,r,n){var i=e._ptr,a=e._size,o=t._index,t=t._ptr,s=a[1];let u,l,c,f=s;for(l=t[p],c=t[p+1],u=l;u{let{abs:A,divideScalar:E,multiply:S,subtract:t,larger:M,largerEq:C,SparseMatrix:T}=e;const B=cp({divideScalar:E,multiply:S,subtract:t});return function(n,e,i){if(!n)return null;var a=n._size[1];let o,s=100,u=100;e&&(o=e.q,s=e.lnz||s,u=e.unz||u);const l=[],c=[],f=[],p=new T({values:l,index:c,ptr:f,size:[a,a]}),m=[],h=[],d=[],g=new T({values:m,index:h,ptr:d,size:[a,a]}),y=[];let x,b;const v=[],w=[];for(x=0;x{let{typed:t,abs:r,add:n,multiply:i,transpose:a,divideScalar:o,subtract:s,larger:u,largerEq:l,SparseMatrix:c}=e;const f=sp({add:n,multiply:i,transpose:a}),p=fp({abs:r,divideScalar:o,multiply:i,subtract:s,larger:u,largerEq:l,SparseMatrix:c});return t(\"slu\",{\"SparseMatrix, number, number\":function(e,t,r){if(!v(t)||t<0||3{let{typed:t,matrix:r,lup:n,slu:i,usolve:s,lsolve:u,DenseMatrix:a}=e;const l=Cu({DenseMatrix:a});return t(hp,{\"Array, Array | Matrix\":function(e,t){e=r(e);e=n(e);return o(e.L,e.U,e.p,null,t).valueOf()},\"DenseMatrix, Array | Matrix\":function(e,t){e=n(e);return o(e.L,e.U,e.p,null,t)},\"SparseMatrix, Array | Matrix\":function(e,t){e=n(e);return o(e.L,e.U,e.p,null,t)},\"SparseMatrix, Array | Matrix, number, number\":function(e,t,r,n){e=i(e,r,n);return o(e.L,e.U,e.p,e.q,t)},\"Object, Array | Matrix\":function(e,t){return o(e.L,e.U,e.p,e.q,t)}});function c(e){if(_(e))return e;if(b(e))return r(e);throw new TypeError(\"Invalid Matrix LU decomposition\")}function o(e,t,r,n,i){e=c(e),t=c(t),r&&((i=l(e,i,!0))._data=mp(r,i._data));const a=u(e,i),o=s(t,a);return n&&(o._data=mp(n,o._data)),o}}),gp=\"polynomialRoot\",yp=s(gp,[\"typed\",\"isZero\",\"equalScalar\",\"add\",\"subtract\",\"multiply\",\"divide\",\"sqrt\",\"unaryMinus\",\"cbrt\",\"typeOf\",\"im\",\"re\"],e=>{let{typed:t,isZero:h,equalScalar:d,add:g,subtract:y,multiply:x,divide:b,sqrt:v,unaryMinus:w,cbrt:N,typeOf:A,im:E,re:S}=e;return t(gp,{\"number|Complex, ...number|Complex\":(e,t)=>{const r=[e,...t];for(;0b(g(h,e,b(c,e)),a)).map(e=>\"Complex\"===A(e)&&d(S(e),S(e)+E(e))?S(e):e));var n}default:throw new RangeError(\"only implemented for cubic or lower-order polynomials, not \"+r)}}})}),xp=s(\"Help\",[\"evaluate\"],e=>{let o=e[\"evaluate\"];function n(e){if(!(this instanceof n))throw new SyntaxError(\"Constructor must be called with the new operator\");if(!e)throw new Error('Argument \"doc\" missing');this.doc=e}return n.prototype.type=\"Help\",n.prototype.isHelp=!0,n.prototype.toString=function(){const r=this.doc||{};let n=\"\\n\";if(r.name&&(n+=\"Name: \"+r.name+\"\\n\\n\"),r.category&&(n+=\"Category: \"+r.category+\"\\n\\n\"),r.description&&(n+=\"Description:\\n \"+r.description+\"\\n\\n\"),r.syntax&&(n+=\"Syntax:\\n \"+r.syntax.join(\"\\n \")+\"\\n\\n\"),r.examples){n+=\"Examples:\\n\";let t=!1;var e=o(\"config()\"),i={config:e=>(t=!0,o(\"config(newConfig)\",{newConfig:e}))};for(let t=0;t\"mathjs\"!==e).forEach(e=>{r[e]=t[e]}),new n(r)},n.prototype.valueOf=n.prototype.toString,n},{isClass:!0}),bp=s(\"Chain\",[\"?on\",\"math\",\"typed\"],e=>{let{on:t,math:r,typed:n}=e;function i(e){if(!(this instanceof i))throw new SyntaxError(\"Constructor must be called with the new operator\");Be(e)?this.value=e.value:this.value=e}function a(e,t){_e(i.prototype,e,function(){var e=t();if(\"function\"==typeof e)return o(e)})}function o(r){return function(){if(0===arguments.length)return new i(r(this.value));const t=[this.value];for(let e=0;ee[t])})(r),t&&t(\"import\",function(e,t,r){r||a(e,t)}),i},{isClass:!0}),vp={name:\"e\",category:\"Constants\",syntax:[\"e\"],description:\"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828\",examples:[\"e\",\"e ^ 2\",\"exp(2)\",\"log(e)\"],seealso:[\"exp\"]},wp={name:\"pi\",category:\"Constants\",syntax:[\"pi\"],description:\"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159\",examples:[\"pi\",\"sin(pi/2)\"],seealso:[\"tau\"]},Np={bignumber:{name:\"bignumber\",category:\"Construction\",syntax:[\"bignumber(x)\"],description:\"Create a big number from a number or string.\",examples:[\"0.1 + 0.2\",\"bignumber(0.1) + bignumber(0.2)\",'bignumber(\"7.2\")','bignumber(\"7.2e500\")',\"bignumber([0.1, 0.2, 0.3])\"],seealso:[\"boolean\",\"bigint\",\"complex\",\"fraction\",\"index\",\"matrix\",\"string\",\"unit\"]},bigint:{name:\"bigint\",category:\"Construction\",syntax:[\"bigint(x)\"],description:\"Create a bigint, an integer with an arbitrary number of digits, from a number or string.\",examples:[\"123123123123123123 # a large number will lose digits\",'bigint(\"123123123123123123\")','bignumber([\"1\", \"3\", \"5\"])'],seealso:[\"boolean\",\"bignumber\",\"number\",\"complex\",\"fraction\",\"index\",\"matrix\",\"string\",\"unit\"]},boolean:{name:\"boolean\",category:\"Construction\",syntax:[\"x\",\"boolean(x)\"],description:\"Convert a string or number into a boolean.\",examples:[\"boolean(0)\",\"boolean(1)\",\"boolean(3)\",'boolean(\"true\")','boolean(\"false\")',\"boolean([1, 0, 1, 1])\"],seealso:[\"bignumber\",\"complex\",\"index\",\"matrix\",\"number\",\"string\",\"unit\"]},complex:{name:\"complex\",category:\"Construction\",syntax:[\"complex()\",\"complex(re, im)\",\"complex(string)\"],description:\"Create a complex number.\",examples:[\"complex()\",\"complex(2, 3)\",'complex(\"7 - 2i\")'],seealso:[\"bignumber\",\"boolean\",\"index\",\"matrix\",\"number\",\"string\",\"unit\"]},createUnit:{name:\"createUnit\",category:\"Construction\",syntax:[\"createUnit(definitions)\",\"createUnit(name, definition)\"],description:\"Create a user-defined unit and register it with the Unit type.\",examples:['createUnit(\"foo\")','createUnit(\"knot\", {definition: \"0.514444444 m/s\", aliases: [\"knots\", \"kt\", \"kts\"]})','createUnit(\"mph\", \"1 mile/hour\")'],seealso:[\"unit\",\"splitUnit\"]},fraction:{name:\"fraction\",category:\"Construction\",syntax:[\"fraction(num)\",\"fraction(matrix)\",\"fraction(num,den)\",\"fraction({n: num, d: den})\"],description:\"Create a fraction from a number or from integer numerator and denominator.\",examples:[\"fraction(0.125)\",\"fraction(1, 3) + fraction(2, 5)\",\"fraction({n: 333, d: 53})\",\"fraction([sqrt(9), sqrt(10), sqrt(11)])\"],seealso:[\"bignumber\",\"boolean\",\"complex\",\"index\",\"matrix\",\"string\",\"unit\"]},index:{name:\"index\",category:\"Construction\",syntax:[\"[start]\",\"[start:end]\",\"[start:step:end]\",\"[start1, start 2, ...]\",\"[start1:end1, start2:end2, ...]\",\"[start1:step1:end1, start2:step2:end2, ...]\"],description:\"Create an index to get or replace a subset of a matrix\",examples:[\"A = [1, 2, 3; 4, 5, 6]\",\"A[1, :]\",\"A[1, 2] = 50\",\"A[1:2, 1:2] = 1\",\"B = [1, 2, 3]\",\"B[B>1 and B<3]\"],seealso:[\"bignumber\",\"boolean\",\"complex\",\"matrix\",\"number\",\"range\",\"string\",\"unit\"]},matrix:{name:\"matrix\",category:\"Construction\",syntax:[\"[]\",\"[a1, b1, ...; a2, b2, ...]\",\"matrix()\",'matrix(\"dense\")',\"matrix([...])\"],description:\"Create a matrix.\",examples:[\"[]\",\"[1, 2, 3]\",\"[1, 2, 3; 4, 5, 6]\",\"matrix()\",\"matrix([3, 4])\",'matrix([3, 4; 5, 6], \"sparse\")','matrix([3, 4; 5, 6], \"sparse\", \"number\")'],seealso:[\"bignumber\",\"boolean\",\"complex\",\"index\",\"number\",\"string\",\"unit\",\"sparse\"]},number:{name:\"number\",category:\"Construction\",syntax:[\"x\",\"number(x)\",\"number(unit, valuelessUnit)\"],description:\"Create a number or convert a string or boolean into a number.\",examples:[\"2\",\"2e3\",\"4.05\",\"number(2)\",'number(\"7.2\")',\"number(true)\",\"number([true, false, true, true])\",'number(unit(\"52cm\"), \"m\")'],seealso:[\"bignumber\",\"bigint\",\"boolean\",\"complex\",\"fraction\",\"index\",\"matrix\",\"string\",\"unit\"]},sparse:{name:\"sparse\",category:\"Construction\",syntax:[\"sparse()\",\"sparse([a1, b1, ...; a1, b2, ...])\",'sparse([a1, b1, ...; a1, b2, ...], \"number\")'],description:\"Create a sparse matrix.\",examples:[\"sparse()\",\"sparse([3, 4; 5, 6])\",'sparse([3, 0; 5, 0], \"number\")'],seealso:[\"bignumber\",\"boolean\",\"complex\",\"index\",\"number\",\"string\",\"unit\",\"matrix\"]},splitUnit:{name:\"splitUnit\",category:\"Construction\",syntax:[\"splitUnit(unit: Unit, parts: Unit[])\"],description:\"Split a unit in an array of units whose sum is equal to the original unit.\",examples:['splitUnit(1 m, [\"feet\", \"inch\"])'],seealso:[\"unit\",\"createUnit\"]},string:{name:\"string\",category:\"Construction\",syntax:['\"text\"',\"string(x)\"],description:\"Create a string or convert a value to a string\",examples:['\"Hello World!\"',\"string(4.2)\",\"string(3 + 2i)\"],seealso:[\"bignumber\",\"boolean\",\"complex\",\"index\",\"matrix\",\"number\",\"unit\"]},unit:{name:\"unit\",category:\"Construction\",syntax:[\"value unit\",\"unit(value, unit)\",\"unit(string)\"],description:\"Create a unit.\",examples:[\"5.5 mm\",\"3 inch\",'unit(7.1, \"kilogram\")','unit(\"23 deg\")'],seealso:[\"bignumber\",\"boolean\",\"complex\",\"index\",\"matrix\",\"number\",\"string\"]},e:vp,E:vp,false:{name:\"false\",category:\"Constants\",syntax:[\"false\"],description:\"Boolean value false\",examples:[\"false\"],seealso:[\"true\"]},i:{name:\"i\",category:\"Constants\",syntax:[\"i\"],description:\"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.\",examples:[\"i\",\"i * i\",\"sqrt(-1)\"],seealso:[]},Infinity:{name:\"Infinity\",category:\"Constants\",syntax:[\"Infinity\"],description:\"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.\",examples:[\"Infinity\",\"1 / 0\"],seealso:[]},LN2:{name:\"LN2\",category:\"Constants\",syntax:[\"LN2\"],description:\"Returns the natural logarithm of 2, approximately equal to 0.693\",examples:[\"LN2\",\"log(2)\"],seealso:[]},LN10:{name:\"LN10\",category:\"Constants\",syntax:[\"LN10\"],description:\"Returns the natural logarithm of 10, approximately equal to 2.302\",examples:[\"LN10\",\"log(10)\"],seealso:[]},LOG2E:{name:\"LOG2E\",category:\"Constants\",syntax:[\"LOG2E\"],description:\"Returns the base-2 logarithm of E, approximately equal to 1.442\",examples:[\"LOG2E\",\"log(e, 2)\"],seealso:[]},LOG10E:{name:\"LOG10E\",category:\"Constants\",syntax:[\"LOG10E\"],description:\"Returns the base-10 logarithm of E, approximately equal to 0.434\",examples:[\"LOG10E\",\"log(e, 10)\"],seealso:[]},NaN:{name:\"NaN\",category:\"Constants\",syntax:[\"NaN\"],description:\"Not a number\",examples:[\"NaN\",\"0 / 0\"],seealso:[]},null:{name:\"null\",category:\"Constants\",syntax:[\"null\"],description:\"Value null\",examples:[\"null\"],seealso:[\"true\",\"false\"]},pi:wp,PI:wp,phi:{name:\"phi\",category:\"Constants\",syntax:[\"phi\"],description:\"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...\",examples:[\"phi\"],seealso:[]},SQRT1_2:{name:\"SQRT1_2\",category:\"Constants\",syntax:[\"SQRT1_2\"],description:\"Returns the square root of 1/2, approximately equal to 0.707\",examples:[\"SQRT1_2\",\"sqrt(1/2)\"],seealso:[]},SQRT2:{name:\"SQRT2\",category:\"Constants\",syntax:[\"SQRT2\"],description:\"Returns the square root of 2, approximately equal to 1.414\",examples:[\"SQRT2\",\"sqrt(2)\"],seealso:[]},tau:{name:\"tau\",category:\"Constants\",syntax:[\"tau\"],description:\"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.\",examples:[\"tau\",\"2 * pi\"],seealso:[\"pi\"]},true:{name:\"true\",category:\"Constants\",syntax:[\"true\"],description:\"Boolean value true\",examples:[\"true\"],seealso:[\"false\"]},version:{name:\"version\",category:\"Constants\",syntax:[\"version\"],description:\"A string with the version number of math.js\",examples:[\"version\"],seealso:[]},speedOfLight:{description:\"Speed of light in vacuum\",examples:[\"speedOfLight\"]},gravitationConstant:{description:\"Newtonian constant of gravitation\",examples:[\"gravitationConstant\"]},planckConstant:{description:\"Planck constant\",examples:[\"planckConstant\"]},reducedPlanckConstant:{description:\"Reduced Planck constant\",examples:[\"reducedPlanckConstant\"]},magneticConstant:{description:\"Magnetic constant (vacuum permeability)\",examples:[\"magneticConstant\"]},electricConstant:{description:\"Electric constant (vacuum permeability)\",examples:[\"electricConstant\"]},vacuumImpedance:{description:\"Characteristic impedance of vacuum\",examples:[\"vacuumImpedance\"]},coulomb:{description:\"Coulomb's constant. Deprecated in favor of coulombConstant\",examples:[\"coulombConstant\"]},coulombConstant:{description:\"Coulomb's constant\",examples:[\"coulombConstant\"]},elementaryCharge:{description:\"Elementary charge\",examples:[\"elementaryCharge\"]},bohrMagneton:{description:\"Bohr magneton\",examples:[\"bohrMagneton\"]},conductanceQuantum:{description:\"Conductance quantum\",examples:[\"conductanceQuantum\"]},inverseConductanceQuantum:{description:\"Inverse conductance quantum\",examples:[\"inverseConductanceQuantum\"]},magneticFluxQuantum:{description:\"Magnetic flux quantum\",examples:[\"magneticFluxQuantum\"]},nuclearMagneton:{description:\"Nuclear magneton\",examples:[\"nuclearMagneton\"]},klitzing:{description:\"Von Klitzing constant\",examples:[\"klitzing\"]},bohrRadius:{description:\"Bohr radius\",examples:[\"bohrRadius\"]},classicalElectronRadius:{description:\"Classical electron radius\",examples:[\"classicalElectronRadius\"]},electronMass:{description:\"Electron mass\",examples:[\"electronMass\"]},fermiCoupling:{description:\"Fermi coupling constant\",examples:[\"fermiCoupling\"]},fineStructure:{description:\"Fine-structure constant\",examples:[\"fineStructure\"]},hartreeEnergy:{description:\"Hartree energy\",examples:[\"hartreeEnergy\"]},protonMass:{description:\"Proton mass\",examples:[\"protonMass\"]},deuteronMass:{description:\"Deuteron Mass\",examples:[\"deuteronMass\"]},neutronMass:{description:\"Neutron mass\",examples:[\"neutronMass\"]},quantumOfCirculation:{description:\"Quantum of circulation\",examples:[\"quantumOfCirculation\"]},rydberg:{description:\"Rydberg constant\",examples:[\"rydberg\"]},thomsonCrossSection:{description:\"Thomson cross section\",examples:[\"thomsonCrossSection\"]},weakMixingAngle:{description:\"Weak mixing angle\",examples:[\"weakMixingAngle\"]},efimovFactor:{description:\"Efimov factor\",examples:[\"efimovFactor\"]},atomicMass:{description:\"Atomic mass constant\",examples:[\"atomicMass\"]},avogadro:{description:\"Avogadro's number\",examples:[\"avogadro\"]},boltzmann:{description:\"Boltzmann constant\",examples:[\"boltzmann\"]},faraday:{description:\"Faraday constant\",examples:[\"faraday\"]},firstRadiation:{description:\"First radiation constant\",examples:[\"firstRadiation\"]},loschmidt:{description:\"Loschmidt constant at T=273.15 K and p=101.325 kPa\",examples:[\"loschmidt\"]},gasConstant:{description:\"Gas constant\",examples:[\"gasConstant\"]},molarPlanckConstant:{description:\"Molar Planck constant\",examples:[\"molarPlanckConstant\"]},molarVolume:{description:\"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa\",examples:[\"molarVolume\"]},sackurTetrode:{description:\"Sackur-Tetrode constant at T=1 K and p=101.325 kPa\",examples:[\"sackurTetrode\"]},secondRadiation:{description:\"Second radiation constant\",examples:[\"secondRadiation\"]},stefanBoltzmann:{description:\"Stefan-Boltzmann constant\",examples:[\"stefanBoltzmann\"]},wienDisplacement:{description:\"Wien displacement law constant\",examples:[\"wienDisplacement\"]},molarMass:{description:\"Molar mass constant\",examples:[\"molarMass\"]},molarMassC12:{description:\"Molar mass constant of carbon-12\",examples:[\"molarMassC12\"]},gravity:{description:\"Standard acceleration of gravity (standard acceleration of free-fall on Earth)\",examples:[\"gravity\"]},planckLength:{description:\"Planck length\",examples:[\"planckLength\"]},planckMass:{description:\"Planck mass\",examples:[\"planckMass\"]},planckTime:{description:\"Planck time\",examples:[\"planckTime\"]},planckCharge:{description:\"Planck charge\",examples:[\"planckCharge\"]},planckTemperature:{description:\"Planck temperature\",examples:[\"planckTemperature\"]},derivative:{name:\"derivative\",category:\"Algebra\",syntax:[\"derivative(expr, variable)\",\"derivative(expr, variable, {simplify: boolean})\"],description:\"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.\",examples:['derivative(\"2x^3\", \"x\")','derivative(\"2x^3\", \"x\", {simplify: false})','derivative(\"2x^2 + 3x + 4\", \"x\")','derivative(\"sin(2x)\", \"x\")','f = parse(\"x^2 + x\")','x = parse(\"x\")',\"df = derivative(f, x)\",\"df.evaluate({x: 3})\"],seealso:[\"simplify\",\"parse\",\"evaluate\"]},lsolve:{name:\"lsolve\",category:\"Algebra\",syntax:[\"x=lsolve(L, b)\"],description:\"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.\",examples:[\"a = [-2, 3; 2, 1]\",\"b = [11, 9]\",\"x = lsolve(a, b)\"],seealso:[\"lsolveAll\",\"lup\",\"lusolve\",\"usolve\",\"matrix\",\"sparse\"]},lsolveAll:{name:\"lsolveAll\",category:\"Algebra\",syntax:[\"x=lsolveAll(L, b)\"],description:\"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.\",examples:[\"a = [-2, 3; 2, 1]\",\"b = [11, 9]\",\"x = lsolve(a, b)\"],seealso:[\"lsolve\",\"lup\",\"lusolve\",\"usolve\",\"matrix\",\"sparse\"]},lup:{name:\"lup\",category:\"Algebra\",syntax:[\"lup(m)\"],description:\"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U\",examples:[\"lup([[2, 1], [1, 4]])\",\"lup(matrix([[2, 1], [1, 4]]))\",\"lup(sparse([[2, 1], [1, 4]]))\"],seealso:[\"lusolve\",\"lsolve\",\"usolve\",\"matrix\",\"sparse\",\"slu\",\"qr\"]},lusolve:{name:\"lusolve\",category:\"Algebra\",syntax:[\"x=lusolve(A, b)\",\"x=lusolve(lu, b)\"],description:\"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.\",examples:[\"a = [-2, 3; 2, 1]\",\"b = [11, 9]\",\"x = lusolve(a, b)\"],seealso:[\"lup\",\"slu\",\"lsolve\",\"usolve\",\"matrix\",\"sparse\"]},leafCount:{name:\"leafCount\",category:\"Algebra\",syntax:[\"leafCount(expr)\"],description:\"Computes the number of leaves in the parse tree of the given expression\",examples:['leafCount(\"e^(i*pi)-1\")','leafCount(parse(\"{a: 22/7, b: 10^(1/2)}\"))'],seealso:[\"simplify\"]},polynomialRoot:{name:\"polynomialRoot\",category:\"Algebra\",syntax:[\"x=polynomialRoot(-6, 3)\",\"x=polynomialRoot(4, -4, 1)\",\"x=polynomialRoot(-8, 12, -6, 1)\"],description:\"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.\",examples:[\"a = polynomialRoot(-6, 11, -6, 1)\"],seealso:[\"cbrt\",\"sqrt\"]},resolve:{name:\"resolve\",category:\"Algebra\",syntax:[\"resolve(node, scope)\"],description:\"Recursively substitute variables in an expression tree.\",examples:['resolve(parse(\"1 + x\"), { x: 7 })','resolve(parse(\"size(text)\"), { text: \"Hello World\" })','resolve(parse(\"x + y\"), { x: parse(\"3z\") })','resolve(parse(\"3x\"), { x: parse(\"y+z\"), z: parse(\"w^y\") })'],seealso:[\"simplify\",\"evaluate\"],mayThrow:[\"ReferenceError\"]},simplify:{name:\"simplify\",category:\"Algebra\",syntax:[\"simplify(expr)\",\"simplify(expr, rules)\"],description:\"Simplify an expression tree.\",examples:['simplify(\"3 + 2 / 4\")','simplify(\"2x + x\")','f = parse(\"x * (x + 2 + x)\")',\"simplified = simplify(f)\",\"simplified.evaluate({x: 2})\"],seealso:[\"simplifyCore\",\"derivative\",\"evaluate\",\"parse\",\"rationalize\",\"resolve\"]},simplifyConstant:{name:\"simplifyConstant\",category:\"Algebra\",syntax:[\"simplifyConstant(expr)\",\"simplifyConstant(expr, options)\"],description:\"Replace constant subexpressions of node with their values.\",examples:['simplifyConstant(\"(3-3)*x\")','simplifyConstant(parse(\"z-cos(tau/8)\"))'],seealso:[\"simplify\",\"simplifyCore\",\"evaluate\"]},simplifyCore:{name:\"simplifyCore\",category:\"Algebra\",syntax:[\"simplifyCore(node)\"],description:\"Perform simple one-pass simplifications on an expression tree.\",examples:['simplifyCore(parse(\"0*x\"))','simplifyCore(parse(\"(x+0)*2\"))'],seealso:[\"simplify\",\"simplifyConstant\",\"evaluate\"]},symbolicEqual:{name:\"symbolicEqual\",category:\"Algebra\",syntax:[\"symbolicEqual(expr1, expr2)\",\"symbolicEqual(expr1, expr2, options)\"],description:\"Returns true if the difference of the expressions simplifies to 0\",examples:['symbolicEqual(\"x*y\",\"y*x\")','symbolicEqual(\"abs(x^2)\", \"x^2\")','symbolicEqual(\"abs(x)\", \"x\", {context: {abs: {trivial: true}}})'],seealso:[\"simplify\",\"evaluate\"]},rationalize:{name:\"rationalize\",category:\"Algebra\",syntax:[\"rationalize(expr)\",\"rationalize(expr, scope)\",\"rationalize(expr, scope, detailed)\"],description:\"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.\",examples:['rationalize(\"2x/y - y/(x+1)\")','rationalize(\"2x/y - y/(x+1)\", true)'],seealso:[\"simplify\"]},slu:{name:\"slu\",category:\"Algebra\",syntax:[\"slu(A, order, threshold)\"],description:\"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U\",examples:[\"slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)\"],seealso:[\"lusolve\",\"lsolve\",\"usolve\",\"matrix\",\"sparse\",\"lup\",\"qr\"]},usolve:{name:\"usolve\",category:\"Algebra\",syntax:[\"x=usolve(U, b)\"],description:\"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.\",examples:[\"x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])\"],seealso:[\"usolveAll\",\"lup\",\"lusolve\",\"lsolve\",\"matrix\",\"sparse\"]},usolveAll:{name:\"usolveAll\",category:\"Algebra\",syntax:[\"x=usolve(U, b)\"],description:\"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.\",examples:[\"x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])\"],seealso:[\"usolve\",\"lup\",\"lusolve\",\"lsolve\",\"matrix\",\"sparse\"]},qr:{name:\"qr\",category:\"Algebra\",syntax:[\"qr(A)\"],description:\"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.\",examples:[\"qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])\"],seealso:[\"lup\",\"slu\",\"matrix\"]},abs:{name:\"abs\",category:\"Arithmetic\",syntax:[\"abs(x)\"],description:\"Compute the absolute value.\",examples:[\"abs(3.5)\",\"abs(-4.2)\"],seealso:[\"sign\"]},add:{name:\"add\",category:\"Operators\",syntax:[\"x + y\",\"add(x, y)\"],description:\"Add two values.\",examples:[\"a = 2.1 + 3.6\",\"a - 3.6\",\"3 + 2i\",\"3 cm + 2 inch\",'\"2.3\" + \"4\"'],seealso:[\"subtract\"]},cbrt:{name:\"cbrt\",category:\"Arithmetic\",syntax:[\"cbrt(x)\",\"cbrt(x, allRoots)\"],description:\"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned\",examples:[\"cbrt(64)\",\"cube(4)\",\"cbrt(-8)\",\"cbrt(2 + 3i)\",\"cbrt(8i)\",\"cbrt(8i, true)\",\"cbrt(27 m^3)\"],seealso:[\"square\",\"sqrt\",\"cube\",\"multiply\"]},ceil:{name:\"ceil\",category:\"Arithmetic\",syntax:[\"ceil(x)\",\"ceil(x, n)\",\"ceil(unit, valuelessUnit)\",\"ceil(unit, n, valuelessUnit)\"],description:\"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.\",examples:[\"ceil(3.2)\",\"ceil(3.8)\",\"ceil(-4.2)\",\"ceil(3.241cm, cm)\",\"ceil(3.241cm, 2, cm)\"],seealso:[\"floor\",\"fix\",\"round\"]},cube:{name:\"cube\",category:\"Arithmetic\",syntax:[\"cube(x)\"],description:\"Compute the cube of a value. The cube of x is x * x * x.\",examples:[\"cube(2)\",\"2^3\",\"2 * 2 * 2\"],seealso:[\"multiply\",\"square\",\"pow\"]},divide:{name:\"divide\",category:\"Operators\",syntax:[\"x / y\",\"divide(x, y)\"],description:\"Divide two values.\",examples:[\"a = 2 / 3\",\"a * 3\",\"4.5 / 2\",\"3 + 4 / 2\",\"(3 + 4) / 2\",\"18 km / 4.5\"],seealso:[\"multiply\"]},dotDivide:{name:\"dotDivide\",category:\"Operators\",syntax:[\"x ./ y\",\"dotDivide(x, y)\"],description:\"Divide two values element wise.\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"b = [2, 1, 1; 3, 2, 5]\",\"a ./ b\"],seealso:[\"multiply\",\"dotMultiply\",\"divide\"]},dotMultiply:{name:\"dotMultiply\",category:\"Operators\",syntax:[\"x .* y\",\"dotMultiply(x, y)\"],description:\"Multiply two values element wise.\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"b = [2, 1, 1; 3, 2, 5]\",\"a .* b\"],seealso:[\"multiply\",\"divide\",\"dotDivide\"]},dotPow:{name:\"dotPow\",category:\"Operators\",syntax:[\"x .^ y\",\"dotPow(x, y)\"],description:\"Calculates the power of x to y element wise.\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"a .^ 2\"],seealso:[\"pow\"]},exp:{name:\"exp\",category:\"Arithmetic\",syntax:[\"exp(x)\"],description:\"Calculate the exponent of a value.\",examples:[\"exp(1.3)\",\"e ^ 1.3\",\"log(exp(1.3))\",\"x = 2.4\",\"(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula\"],seealso:[\"expm\",\"expm1\",\"pow\",\"log\"]},expm:{name:\"expm\",category:\"Arithmetic\",syntax:[\"exp(x)\"],description:\"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.\",examples:[\"expm([[0,2],[0,0]])\"],seealso:[\"exp\"]},expm1:{name:\"expm1\",category:\"Arithmetic\",syntax:[\"expm1(x)\"],description:\"Calculate the value of subtracting 1 from the exponential value.\",examples:[\"expm1(2)\",\"pow(e, 2) - 1\",\"log(expm1(2) + 1)\"],seealso:[\"exp\",\"pow\",\"log\"]},fix:{name:\"fix\",category:\"Arithmetic\",syntax:[\"fix(x)\",\"fix(x, n)\",\"fix(unit, valuelessUnit)\",\"fix(unit, n, valuelessUnit)\"],description:\"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.\",examples:[\"fix(3.2)\",\"fix(3.8)\",\"fix(-4.2)\",\"fix(-4.8)\",\"fix(3.241cm, cm)\",\"fix(3.241cm, 2, cm)\"],seealso:[\"ceil\",\"floor\",\"round\"]},floor:{name:\"floor\",category:\"Arithmetic\",syntax:[\"floor(x)\",\"floor(x, n)\",\"floor(unit, valuelessUnit)\",\"floor(unit, n, valuelessUnit)\"],description:\"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.\",examples:[\"floor(3.2)\",\"floor(3.8)\",\"floor(-4.2)\",\"floor(3.241cm, cm)\",\"floor(3.241cm, 2, cm)\"],seealso:[\"ceil\",\"fix\",\"round\"]},gcd:{name:\"gcd\",category:\"Arithmetic\",syntax:[\"gcd(a, b)\",\"gcd(a, b, c, ...)\"],description:\"Compute the greatest common divisor.\",examples:[\"gcd(8, 12)\",\"gcd(-4, 6)\",\"gcd(25, 15, -10)\"],seealso:[\"lcm\",\"xgcd\"]},hypot:{name:\"hypot\",category:\"Arithmetic\",syntax:[\"hypot(a, b, c, ...)\",\"hypot([a, b, c, ...])\"],description:\"Calculate the hypotenuse of a list with values.\",examples:[\"hypot(3, 4)\",\"sqrt(3^2 + 4^2)\",\"hypot(-2)\",\"hypot([3, 4, 5])\"],seealso:[\"abs\",\"norm\"]},lcm:{name:\"lcm\",category:\"Arithmetic\",syntax:[\"lcm(x, y)\"],description:\"Compute the least common multiple.\",examples:[\"lcm(4, 6)\",\"lcm(6, 21)\",\"lcm(6, 21, 5)\"],seealso:[\"gcd\"]},log:{name:\"log\",category:\"Arithmetic\",syntax:[\"log(x)\",\"log(x, base)\"],description:\"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).\",examples:[\"log(3.5)\",\"a = log(2.4)\",\"exp(a)\",\"10 ^ 4\",\"log(10000, 10)\",\"log(10000) / log(10)\",\"b = log(1024, 2)\",\"2 ^ b\"],seealso:[\"exp\",\"log1p\",\"log2\",\"log10\"]},log2:{name:\"log2\",category:\"Arithmetic\",syntax:[\"log2(x)\"],description:\"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.\",examples:[\"log2(0.03125)\",\"log2(16)\",\"log2(16) / log2(2)\",\"pow(2, 4)\"],seealso:[\"exp\",\"log1p\",\"log\",\"log10\"]},log1p:{name:\"log1p\",category:\"Arithmetic\",syntax:[\"log1p(x)\",\"log1p(x, base)\"],description:\"Calculate the logarithm of a `value+1`\",examples:[\"log1p(2.5)\",\"exp(log1p(1.4))\",\"pow(10, 4)\",\"log1p(9999, 10)\",\"log1p(9999) / log(10)\"],seealso:[\"exp\",\"log\",\"log2\",\"log10\"]},log10:{name:\"log10\",category:\"Arithmetic\",syntax:[\"log10(x)\"],description:\"Compute the 10-base logarithm of a value.\",examples:[\"log10(0.00001)\",\"log10(10000)\",\"10 ^ 4\",\"log(10000) / log(10)\",\"log(10000, 10)\"],seealso:[\"exp\",\"log\"]},mod:{name:\"mod\",category:\"Operators\",syntax:[\"x % y\",\"x mod y\",\"mod(x, y)\"],description:\"Calculates the modulus, the remainder of an integer division.\",examples:[\"7 % 3\",\"11 % 2\",\"10 mod 4\",\"isOdd(x) = x % 2\",\"isOdd(2)\",\"isOdd(3)\"],seealso:[\"divide\"]},multiply:{name:\"multiply\",category:\"Operators\",syntax:[\"x * y\",\"multiply(x, y)\"],description:\"multiply two values.\",examples:[\"a = 2.1 * 3.4\",\"a / 3.4\",\"2 * 3 + 4\",\"2 * (3 + 4)\",\"3 * 2.1 km\"],seealso:[\"divide\"]},norm:{name:\"norm\",category:\"Arithmetic\",syntax:[\"norm(x)\",\"norm(x, p)\"],description:\"Calculate the norm of a number, vector or matrix.\",examples:[\"abs(-3.5)\",\"norm(-3.5)\",\"norm(3 - 4i)\",\"norm([1, 2, -3], Infinity)\",\"norm([1, 2, -3], -Infinity)\",\"norm([3, 4], 2)\",\"norm([[1, 2], [3, 4]], 1)\",'norm([[1, 2], [3, 4]], \"inf\")','norm([[1, 2], [3, 4]], \"fro\")']},nthRoot:{name:\"nthRoot\",category:\"Arithmetic\",syntax:[\"nthRoot(a)\",\"nthRoot(a, root)\"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation \"x^root = A\".',examples:[\"4 ^ 3\",\"nthRoot(64, 3)\",\"nthRoot(9, 2)\",\"sqrt(9)\"],seealso:[\"nthRoots\",\"pow\",\"sqrt\"]},nthRoots:{name:\"nthRoots\",category:\"Arithmetic\",syntax:[\"nthRoots(A)\",\"nthRoots(A, root)\"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation \"x^root = A\". This function returns an array of complex values.',examples:[\"nthRoots(1)\",\"nthRoots(1, 3)\"],seealso:[\"sqrt\",\"pow\",\"nthRoot\"]},pow:{name:\"pow\",category:\"Operators\",syntax:[\"x ^ y\",\"pow(x, y)\"],description:\"Calculates the power of x to y, x^y.\",examples:[\"2^3\",\"2*2*2\",\"1 + e ^ (pi * i)\",\"pow([[1, 2], [4, 3]], 2)\",\"pow([[1, 2], [4, 3]], -1)\"],seealso:[\"multiply\",\"nthRoot\",\"nthRoots\",\"sqrt\"]},round:{name:\"round\",category:\"Arithmetic\",syntax:[\"round(x)\",\"round(x, n)\",\"round(unit, valuelessUnit)\",\"round(unit, n, valuelessUnit)\"],description:\"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.\",examples:[\"round(3.2)\",\"round(3.8)\",\"round(-4.2)\",\"round(-4.8)\",\"round(pi, 3)\",\"round(123.45678, 2)\",\"round(3.241cm, 2, cm)\",\"round([3.2, 3.8, -4.7])\"],seealso:[\"ceil\",\"floor\",\"fix\"]},sign:{name:\"sign\",category:\"Arithmetic\",syntax:[\"sign(x)\"],description:\"Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.\",examples:[\"sign(3.5)\",\"sign(-4.2)\",\"sign(0)\"],seealso:[\"abs\"]},sqrt:{name:\"sqrt\",category:\"Arithmetic\",syntax:[\"sqrt(x)\"],description:\"Compute the square root value. If x = y * y, then y is the square root of x.\",examples:[\"sqrt(25)\",\"5 * 5\",\"sqrt(-1)\"],seealso:[\"square\",\"sqrtm\",\"multiply\",\"nthRoot\",\"nthRoots\",\"pow\"]},sqrtm:{name:\"sqrtm\",category:\"Arithmetic\",syntax:[\"sqrtm(x)\"],description:\"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.\",examples:[\"sqrtm([[33, 24], [48, 57]])\"],seealso:[\"sqrt\",\"abs\",\"square\",\"multiply\"]},square:{name:\"square\",category:\"Arithmetic\",syntax:[\"square(x)\"],description:\"Compute the square of a value. The square of x is x * x.\",examples:[\"square(3)\",\"sqrt(9)\",\"3^2\",\"3 * 3\"],seealso:[\"multiply\",\"pow\",\"sqrt\",\"cube\"]},subtract:{name:\"subtract\",category:\"Operators\",syntax:[\"x - y\",\"subtract(x, y)\"],description:\"subtract two values.\",examples:[\"a = 5.3 - 2\",\"a + 2\",\"2/3 - 1/6\",\"2 * 3 - 3\",\"2.1 km - 500m\"],seealso:[\"add\"]},unaryMinus:{name:\"unaryMinus\",category:\"Operators\",syntax:[\"-x\",\"unaryMinus(x)\"],description:\"Inverse the sign of a value. Converts booleans and strings to numbers.\",examples:[\"-4.5\",\"-(-5.6)\",'-\"22\"'],seealso:[\"add\",\"subtract\",\"unaryPlus\"]},unaryPlus:{name:\"unaryPlus\",category:\"Operators\",syntax:[\"+x\",\"unaryPlus(x)\"],description:\"Converts booleans and strings to numbers.\",examples:[\"+true\",'+\"2\"'],seealso:[\"add\",\"subtract\",\"unaryMinus\"]},xgcd:{name:\"xgcd\",category:\"Arithmetic\",syntax:[\"xgcd(a, b)\"],description:\"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.\",examples:[\"xgcd(8, 12)\",\"gcd(8, 12)\",\"xgcd(36163, 21199)\"],seealso:[\"gcd\",\"lcm\"]},invmod:{name:\"invmod\",category:\"Arithmetic\",syntax:[\"invmod(a, b)\"],description:\"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)\",examples:[\"invmod(8, 12)\",\"invmod(7, 13)\",\"invmod(15151, 15122)\"],seealso:[\"gcd\",\"xgcd\"]},bitAnd:{name:\"bitAnd\",category:\"Bitwise\",syntax:[\"x & y\",\"bitAnd(x, y)\"],description:\"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0\",examples:[\"5 & 3\",\"bitAnd(53, 131)\",\"[1, 12, 31] & 42\"],seealso:[\"bitNot\",\"bitOr\",\"bitXor\",\"leftShift\",\"rightArithShift\",\"rightLogShift\"]},bitNot:{name:\"bitNot\",category:\"Bitwise\",syntax:[\"~x\",\"bitNot(x)\"],description:\"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.\",examples:[\"~1\",\"~2\",\"bitNot([2, -3, 4])\"],seealso:[\"bitAnd\",\"bitOr\",\"bitXor\",\"leftShift\",\"rightArithShift\",\"rightLogShift\"]},bitOr:{name:\"bitOr\",category:\"Bitwise\",syntax:[\"x | y\",\"bitOr(x, y)\"],description:\"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.\",examples:[\"5 | 3\",\"bitOr([1, 2, 3], 4)\"],seealso:[\"bitAnd\",\"bitNot\",\"bitXor\",\"leftShift\",\"rightArithShift\",\"rightLogShift\"]},bitXor:{name:\"bitXor\",category:\"Bitwise\",syntax:[\"bitXor(x, y)\"],description:\"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.\",examples:[\"bitOr(1, 2)\",\"bitXor([2, 3, 4], 4)\"],seealso:[\"bitAnd\",\"bitNot\",\"bitOr\",\"leftShift\",\"rightArithShift\",\"rightLogShift\"]},leftShift:{name:\"leftShift\",category:\"Bitwise\",syntax:[\"x << y\",\"leftShift(x, y)\"],description:\"Bitwise left logical shift of a value x by y number of bits.\",examples:[\"4 << 1\",\"8 >> 1\"],seealso:[\"bitAnd\",\"bitNot\",\"bitOr\",\"bitXor\",\"rightArithShift\",\"rightLogShift\"]},rightArithShift:{name:\"rightArithShift\",category:\"Bitwise\",syntax:[\"x >> y\",\"rightArithShift(x, y)\"],description:\"Bitwise right arithmetic shift of a value x by y number of bits.\",examples:[\"8 >> 1\",\"4 << 1\",\"-12 >> 2\"],seealso:[\"bitAnd\",\"bitNot\",\"bitOr\",\"bitXor\",\"leftShift\",\"rightLogShift\"]},rightLogShift:{name:\"rightLogShift\",category:\"Bitwise\",syntax:[\"x >>> y\",\"rightLogShift(x, y)\"],description:\"Bitwise right logical shift of a value x by y number of bits.\",examples:[\"8 >>> 1\",\"4 << 1\",\"-12 >>> 2\"],seealso:[\"bitAnd\",\"bitNot\",\"bitOr\",\"bitXor\",\"leftShift\",\"rightArithShift\"]},bellNumbers:{name:\"bellNumbers\",category:\"Combinatorics\",syntax:[\"bellNumbers(n)\"],description:\"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.\",examples:[\"bellNumbers(3)\",\"bellNumbers(8)\"],seealso:[\"stirlingS2\"]},catalan:{name:\"catalan\",category:\"Combinatorics\",syntax:[\"catalan(n)\"],description:\"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.\",examples:[\"catalan(3)\",\"catalan(8)\"],seealso:[\"bellNumbers\"]},composition:{name:\"composition\",category:\"Combinatorics\",syntax:[\"composition(n, k)\"],description:\"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.\",examples:[\"composition(5, 3)\"],seealso:[\"combinations\"]},stirlingS2:{name:\"stirlingS2\",category:\"Combinatorics\",syntax:[\"stirlingS2(n, k)\"],description:\"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.\",examples:[\"stirlingS2(5, 3)\"],seealso:[\"bellNumbers\"]},config:{name:\"config\",category:\"Core\",syntax:[\"config()\",\"config(options)\"],description:\"Get configuration or change configuration.\",examples:[\"config()\",\"1/3 + 1/4\",'config({number: \"Fraction\"})',\"1/3 + 1/4\"],seealso:[]},import:{name:\"import\",category:\"Core\",syntax:[\"import(functions)\",\"import(functions, options)\"],description:\"Import functions or constants from an object.\",examples:[\"import({myFn: f(x)=x^2, myConstant: 32 })\",\"myFn(2)\",\"myConstant\"],seealso:[]},typed:{name:\"typed\",category:\"Core\",syntax:[\"typed(signatures)\",\"typed(name, signatures)\"],description:\"Create a typed function.\",examples:['double = typed({ \"number\": f(x)=x+x, \"string\": f(x)=concat(x,x) })',\"double(2)\",'double(\"hello\")'],seealso:[]},arg:{name:\"arg\",category:\"Complex\",syntax:[\"arg(x)\"],description:\"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).\",examples:[\"arg(2 + 2i)\",\"atan2(3, 2)\",\"arg(2 + 3i)\"],seealso:[\"re\",\"im\",\"conj\",\"abs\"]},conj:{name:\"conj\",category:\"Complex\",syntax:[\"conj(x)\"],description:\"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.\",examples:[\"conj(2 + 3i)\",\"conj(2 - 3i)\",\"conj(-5.2i)\"],seealso:[\"re\",\"im\",\"abs\",\"arg\"]},re:{name:\"re\",category:\"Complex\",syntax:[\"re(x)\"],description:\"Get the real part of a complex number.\",examples:[\"re(2 + 3i)\",\"im(2 + 3i)\",\"re(-5.2i)\",\"re(2.4)\"],seealso:[\"im\",\"conj\",\"abs\",\"arg\"]},im:{name:\"im\",category:\"Complex\",syntax:[\"im(x)\"],description:\"Get the imaginary part of a complex number.\",examples:[\"im(2 + 3i)\",\"re(2 + 3i)\",\"im(-5.2i)\",\"im(2.4)\"],seealso:[\"re\",\"conj\",\"abs\",\"arg\"]},evaluate:{name:\"evaluate\",category:\"Expression\",syntax:[\"evaluate(expression)\",\"evaluate(expression, scope)\",\"evaluate([expr1, expr2, expr3, ...])\",\"evaluate([expr1, expr2, expr3, ...], scope)\"],description:\"Evaluate an expression or an array with expressions.\",examples:['evaluate(\"2 + 3\")','evaluate(\"sqrt(16)\")','evaluate(\"2 inch to cm\")','evaluate(\"sin(x * pi)\", { \"x\": 1/2 })','evaluate([\"width=2\", \"height=4\",\"width*height\"])'],seealso:[\"parser\",\"parse\",\"compile\"]},help:{name:\"help\",category:\"Expression\",syntax:[\"help(object)\",\"help(string)\"],description:\"Display documentation on a function or data type.\",examples:[\"help(sqrt)\",'help(\"complex\")'],seealso:[]},parse:{name:\"parse\",category:\"Expression\",syntax:[\"parse(expr)\",\"parse(expr, options)\",\"parse([expr1, expr2, expr3, ...])\",\"parse([expr1, expr2, expr3, ...], options)\"],description:\"Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().\",examples:['node1 = parse(\"sqrt(3^2 + 4^2)\")',\"node1.evaluate()\",\"code1 = node1.compile()\",\"code1.evaluate()\",\"scope = {a: 3, b: 4}\",'node2 = parse(\"a * b\")',\"node2.evaluate(scope)\",\"code2 = node2.compile()\",\"code2.evaluate(scope)\"],seealso:[\"parser\",\"evaluate\",\"compile\"]},parser:{name:\"parser\",category:\"Expression\",syntax:[\"parser()\"],description:\"Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.\",examples:[\"myParser = parser()\",'myParser.evaluate(\"sqrt(3^2 + 4^2)\")','myParser.set(\"x\", 3)','myParser.evaluate(\"y = x + 3\")','myParser.evaluate([\"y = x + 3\", \"y = y + 1\"])','myParser.get(\"y\")'],seealso:[\"evaluate\",\"parse\",\"compile\"]},compile:{name:\"compile\",category:\"Expression\",syntax:[\"compile(expr) \",\"compile([expr1, expr2, expr3, ...])\"],description:\"Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.\",examples:['code1 = compile(\"sqrt(3^2 + 4^2)\")',\"code1.evaluate() \",'code2 = compile(\"a * b\")',\"code2.evaluate({a: 3, b: 4})\"],seealso:[\"parser\",\"parse\",\"evaluate\"]},distance:{name:\"distance\",category:\"Geometry\",syntax:[\"distance([x1, y1], [x2, y2])\",\"distance([[x1, y1], [x2, y2]])\"],description:\"Calculates the Euclidean distance between two points.\",examples:[\"distance([0,0], [4,4])\",\"distance([[0,0], [4,4]])\"],seealso:[]},intersect:{name:\"intersect\",category:\"Geometry\",syntax:[\"intersect(expr1, expr2, expr3, expr4)\",\"intersect(expr1, expr2, expr3)\"],description:\"Computes the intersection point of lines and/or planes.\",examples:[\"intersect([0, 0], [10, 10], [10, 0], [0, 10])\",\"intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])\"],seealso:[]},and:{name:\"and\",category:\"Logical\",syntax:[\"x and y\",\"and(x, y)\"],description:\"Logical and. Test whether two values are both defined with a nonzero/nonempty value.\",examples:[\"true and false\",\"true and true\",\"2 and 4\"],seealso:[\"not\",\"or\",\"xor\"]},not:{name:\"not\",category:\"Logical\",syntax:[\"not x\",\"not(x)\"],description:\"Logical not. Flips the boolean value of given argument.\",examples:[\"not true\",\"not false\",\"not 2\",\"not 0\"],seealso:[\"and\",\"or\",\"xor\"]},nullish:{name:\"nullish\",category:\"Logical\",syntax:[\"x ?? y\",\"nullish(x, y)\"],description:\"Nullish coalescing operator. Returns the right-hand operand when the left-hand operand is null or undefined, and otherwise returns the left-hand operand.\",examples:[\"null ?? 42\",\"undefined ?? 42\",\"0 ?? 42\",\"false ?? 42\",\"null ?? undefined ?? 42\"],seealso:[\"and\",\"or\",\"not\"]},or:{name:\"or\",category:\"Logical\",syntax:[\"x or y\",\"or(x, y)\"],description:\"Logical or. Test if at least one value is defined with a nonzero/nonempty value.\",examples:[\"true or false\",\"false or false\",\"0 or 4\"],seealso:[\"not\",\"and\",\"xor\"]},xor:{name:\"xor\",category:\"Logical\",syntax:[\"x xor y\",\"xor(x, y)\"],description:\"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.\",examples:[\"true xor false\",\"false xor false\",\"true xor true\",\"0 xor 4\"],seealso:[\"not\",\"and\",\"or\"]},mapSlices:{name:\"mapSlices\",category:\"Matrix\",syntax:[\"mapSlices(A, dim, callback)\"],description:\"Generate a matrix one dimension less than A by applying callback to each slice of A along dimension dim.\",examples:[\"A = [[1, 2], [3, 4]]\",\"mapSlices(A, 1, sum)\",\"mapSlices(A, 2, prod)\"],seealso:[\"map\",\"forEach\"]},concat:{name:\"concat\",category:\"Matrix\",syntax:[\"concat(A, B, C, ...)\",\"concat(A, B, C, ..., dim)\"],description:\"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.\",examples:[\"A = [1, 2; 5, 6]\",\"B = [3, 4; 7, 8]\",\"concat(A, B)\",\"concat(A, B, 1)\",\"concat(A, B, 2)\"],seealso:[\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},count:{name:\"count\",category:\"Matrix\",syntax:[\"count(x)\"],description:\"Count the number of elements of a matrix, array or string.\",examples:[\"a = [1, 2; 3, 4; 5, 6]\",\"count(a)\",\"size(a)\",'count(\"hello world\")'],seealso:[\"size\"]},cross:{name:\"cross\",category:\"Matrix\",syntax:[\"cross(A, B)\"],description:\"Calculate the cross product for two vectors in three dimensional space.\",examples:[\"cross([1, 1, 0], [0, 1, 1])\",\"cross([3, -3, 1], [4, 9, 2])\",\"cross([2, 3, 4], [5, 6, 7])\"],seealso:[\"multiply\",\"dot\"]},column:{name:\"column\",category:\"Matrix\",syntax:[\"column(x, index)\"],description:\"Return a column from a matrix or array.\",examples:[\"A = [[1, 2], [3, 4]]\",\"column(A, 1)\",\"column(A, 2)\"],seealso:[\"row\",\"matrixFromColumns\"]},ctranspose:{name:\"ctranspose\",category:\"Matrix\",syntax:[\"x'\",\"ctranspose(x)\"],description:\"Complex Conjugate and Transpose a matrix\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"a'\",\"ctranspose(a)\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"zeros\"]},det:{name:\"det\",category:\"Matrix\",syntax:[\"det(x)\"],description:\"Calculate the determinant of a matrix\",examples:[\"det([1, 2; 3, 4])\",\"det([-2, 2, 3; -1, 1, 3; 2, 0, -1])\"],seealso:[\"concat\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},diag:{name:\"diag\",category:\"Matrix\",syntax:[\"diag(x)\",\"diag(x, k)\"],description:\"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.\",examples:[\"diag(1:3)\",\"diag(1:3, 1)\",\"a = [1, 2, 3; 4, 5, 6; 7, 8, 9]\",\"diag(a)\"],seealso:[\"concat\",\"det\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},diff:{name:\"diff\",category:\"Matrix\",syntax:[\"diff(arr)\",\"diff(arr, dim)\"],description:[\"Create a new matrix or array with the difference of the passed matrix or array.\",\"Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference\",\"If no dimension parameter is passed it is assumed as dimension 0\",\"Dimension is zero-based in javascript and one-based in the parser\",\"Arrays must be 'rectangular' meaning arrays like [1, 2]\",\"If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays\"],examples:[\"A = [1, 2, 4, 7, 0]\",\"diff(A)\",\"diff(A, 1)\",\"B = [[1, 2], [3, 4]]\",\"diff(B)\",\"diff(B, 1)\",\"diff(B, 2)\",\"diff(B, bignumber(2))\",\"diff([[1, 2], matrix([3, 4])], 2)\"],seealso:[\"subtract\",\"partitionSelect\"]},dot:{name:\"dot\",category:\"Matrix\",syntax:[\"dot(A, B)\",\"A * B\"],description:\"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn\",examples:[\"dot([2, 4, 1], [2, 2, 3])\",\"[2, 4, 1] * [2, 2, 3]\"],seealso:[\"multiply\",\"cross\"]},getMatrixDataType:{name:\"getMatrixDataType\",category:\"Matrix\",syntax:[\"getMatrixDataType(x)\"],description:'Find the data type of all elements in a matrix or array, for example \"number\" if all items are a number and \"Complex\" if all values are complex numbers. If a matrix contains more than one data type, it will return \"mixed\".',examples:[\"getMatrixDataType([1, 2, 3])\",\"getMatrixDataType([[5 cm], [2 inch]])\",'getMatrixDataType([1, \"text\"])',\"getMatrixDataType([1, bignumber(4)])\"],seealso:[\"matrix\",\"sparse\",\"typeOf\"]},identity:{name:\"identity\",category:\"Matrix\",syntax:[\"identity(n)\",\"identity(m, n)\",\"identity([m, n])\"],description:\"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.\",examples:[\"identity(3)\",\"identity(3, 5)\",\"a = [1, 2, 3; 4, 5, 6]\",\"identity(size(a))\"],seealso:[\"concat\",\"det\",\"diag\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},filter:{name:\"filter\",category:\"Matrix\",syntax:[\"filter(x, test)\"],description:\"Filter items in a matrix.\",examples:[\"isPositive(x) = x > 0\",\"filter([6, -2, -1, 4, 3], isPositive)\",\"filter([6, -2, 0, 1, 0], x != 0)\"],seealso:[\"sort\",\"map\",\"forEach\"]},flatten:{name:\"flatten\",category:\"Matrix\",syntax:[\"flatten(x)\"],description:\"Flatten a multi dimensional matrix into a single dimensional matrix.\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"size(a)\",\"b = flatten(a)\",\"size(b)\"],seealso:[\"concat\",\"resize\",\"size\",\"squeeze\"]},forEach:{name:\"forEach\",category:\"Matrix\",syntax:[\"forEach(x, callback)\"],description:\"Iterates over all elements of a matrix/array, and executes the given callback function.\",examples:[\"numberOfPets = {}\",\"addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;\",'forEach([\"Dog\",\"Cat\",\"Cat\"], addPet)',\"numberOfPets\"],seealso:[\"map\",\"sort\",\"filter\"]},inv:{name:\"inv\",category:\"Matrix\",syntax:[\"inv(x)\"],description:\"Calculate the inverse of a matrix\",examples:[\"inv([1, 2; 3, 4])\",\"inv(4)\",\"1 / 4\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},pinv:{name:\"pinv\",category:\"Matrix\",syntax:[\"pinv(x)\"],description:\"Calculate the Moore\u2013Penrose inverse of a matrix\",examples:[\"pinv([1, 2; 3, 4])\",\"pinv([[1, 0], [0, 1], [0, 1]])\",\"pinv(4)\"],seealso:[\"inv\"]},eigs:{name:\"eigs\",category:\"Matrix\",syntax:[\"eigs(x)\"],description:\"Calculate the eigenvalues and optionally eigenvectors of a square matrix\",examples:[\"eigs([[5, 2.3], [2.3, 1]])\",\"eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })\"],seealso:[\"inv\"]},kron:{name:\"kron\",category:\"Matrix\",syntax:[\"kron(x, y)\"],description:\"Calculates the Kronecker product of 2 matrices or vectors.\",examples:[\"kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])\",\"kron([1,1], [2,3,4])\"],seealso:[\"multiply\",\"dot\",\"cross\"]},matrixFromFunction:{name:\"matrixFromFunction\",category:\"Matrix\",syntax:[\"matrixFromFunction(size, fn)\",\"matrixFromFunction(size, fn, format)\",\"matrixFromFunction(size, fn, format, datatype)\",\"matrixFromFunction(size, format, fn)\",\"matrixFromFunction(size, format, datatype, fn)\"],description:\"Create a matrix by evaluating a generating function at each index.\",examples:[\"f(I) = I[1] - I[2]\",\"matrixFromFunction([3,3], f)\",\"g(I) = I[1] - I[2] == 1 ? 4 : 0\",'matrixFromFunction([100, 100], \"sparse\", g)',\"matrixFromFunction([5], random)\"],seealso:[\"matrix\",\"matrixFromRows\",\"matrixFromColumns\",\"zeros\"]},matrixFromRows:{name:\"matrixFromRows\",category:\"Matrix\",syntax:[\"matrixFromRows(...arr)\",\"matrixFromRows(row1, row2)\",\"matrixFromRows(row1, row2, row3)\"],description:\"Create a dense matrix from vectors as individual rows.\",examples:[\"matrixFromRows([1, 2, 3], [[4],[5],[6]])\"],seealso:[\"matrix\",\"matrixFromColumns\",\"matrixFromFunction\",\"zeros\"]},matrixFromColumns:{name:\"matrixFromColumns\",category:\"Matrix\",syntax:[\"matrixFromColumns(...arr)\",\"matrixFromColumns(row1, row2)\",\"matrixFromColumns(row1, row2, row3)\"],description:\"Create a dense matrix from vectors as individual columns.\",examples:[\"matrixFromColumns([1, 2, 3], [[4],[5],[6]])\"],seealso:[\"matrix\",\"matrixFromRows\",\"matrixFromFunction\",\"zeros\"]},map:{name:\"map\",category:\"Matrix\",syntax:[\"map(x, callback)\",\"map(x, y, ..., callback)\"],description:\"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.\",examples:[\"map([1, 2, 3], square)\",\"map([1, 2], [3, 4], f(a,b) = a + b)\"],seealso:[\"filter\",\"forEach\"]},ones:{name:\"ones\",category:\"Matrix\",syntax:[\"ones(m)\",\"ones(m, n)\",\"ones(m, n, p, ...)\",\"ones([m])\",\"ones([m, n])\",\"ones([m, n, p, ...])\"],description:\"Create a matrix containing ones.\",examples:[\"ones(3)\",\"ones(3, 5)\",\"ones([2,3]) * 4.5\",\"a = [1, 2, 3; 4, 5, 6]\",\"ones(size(a))\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},partitionSelect:{name:\"partitionSelect\",category:\"Matrix\",syntax:[\"partitionSelect(x, k)\",\"partitionSelect(x, k, compare)\"],description:\"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.\",examples:[\"partitionSelect([5, 10, 1], 2)\",'partitionSelect([\"C\", \"B\", \"A\", \"D\"], 1, compareText)',\"arr = [5, 2, 1]\",\"partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]\",\"arr\",\"partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]\",\"arr\"],seealso:[\"sort\"]},range:{name:\"range\",category:\"Type\",syntax:[\"start:end\",\"start:step:end\",\"range(start, end)\",\"range(start, end, step)\",\"range(string)\"],description:\"Create a range. Lower bound of the range is included, upper bound is excluded.\",examples:[\"1:5\",\"3:-1:-3\",\"range(3, 7)\",\"range(0, 12, 2)\",'range(\"4:10\")',\"range(1m, 1m, 3m)\",\"a = [1, 2, 3, 4; 5, 6, 7, 8]\",\"a[1:2, 1:2]\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},resize:{name:\"resize\",category:\"Matrix\",syntax:[\"resize(x, size)\",\"resize(x, size, defaultValue)\"],description:\"Resize a matrix.\",examples:[\"resize([1,2,3,4,5], [3])\",\"resize([1,2,3], [5])\",\"resize([1,2,3], [5], -1)\",\"resize(2, [2, 3])\",'resize(\"hello\", [8], \"!\")'],seealso:[\"size\",\"subset\",\"squeeze\",\"reshape\"]},reshape:{name:\"reshape\",category:\"Matrix\",syntax:[\"reshape(x, sizes)\"],description:\"Reshape a multi dimensional array to fit the specified dimensions.\",examples:[\"reshape([1, 2, 3, 4, 5, 6], [2, 3])\",\"reshape([[1, 2], [3, 4]], [1, 4])\",\"reshape([[1, 2], [3, 4]], [4])\",\"reshape([1, 2, 3, 4], [-1, 2])\"],seealso:[\"size\",\"squeeze\",\"resize\"]},rotate:{name:\"rotate\",category:\"Matrix\",syntax:[\"rotate(w, theta)\",\"rotate(w, theta, v)\"],description:\"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.\",examples:[\"rotate([1, 0], pi / 2)\",'rotate(matrix([1, 0]), unit(\"35deg\"))','rotate([1, 0, 0], unit(\"90deg\"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit(\"90deg\"), matrix([0, 0, 1]))'],seealso:[\"matrix\",\"rotationMatrix\"]},rotationMatrix:{name:\"rotationMatrix\",category:\"Matrix\",syntax:[\"rotationMatrix(theta)\",\"rotationMatrix(theta, v)\",\"rotationMatrix(theta, v, format)\"],description:\"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.\",examples:[\"rotationMatrix(pi / 2)\",'rotationMatrix(unit(\"45deg\"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), \"sparse\")'],seealso:[\"cos\",\"sin\"]},row:{name:\"row\",category:\"Matrix\",syntax:[\"row(x, index)\"],description:\"Return a row from a matrix or array.\",examples:[\"A = [[1, 2], [3, 4]]\",\"row(A, 1)\",\"row(A, 2)\"],seealso:[\"column\",\"matrixFromRows\"]},size:{name:\"size\",category:\"Matrix\",syntax:[\"size(x)\"],description:\"Calculate the size of a matrix.\",examples:[\"size(2.3)\",'size(\"hello world\")',\"a = [1, 2; 3, 4; 5, 6]\",\"size(a)\",\"size(1:6)\"],seealso:[\"concat\",\"count\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"squeeze\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},sort:{name:\"sort\",category:\"Matrix\",syntax:[\"sort(x)\",\"sort(x, compare)\"],description:'Sort the items in a matrix. Compare can be a string \"asc\", \"desc\", \"natural\", or a custom sort function.',examples:[\"sort([5, 10, 1])\",'sort([\"C\", \"B\", \"A\", \"D\"], \"natural\")',\"sortByLength(a, b) = size(a)[1] - size(b)[1]\",'sort([\"Langdon\", \"Tom\", \"Sara\"], sortByLength)','sort([\"10\", \"1\", \"2\"], \"natural\")'],seealso:[\"map\",\"filter\",\"forEach\"]},squeeze:{name:\"squeeze\",category:\"Matrix\",syntax:[\"squeeze(x)\"],description:\"Remove inner and outer singleton dimensions from a matrix.\",examples:[\"a = zeros(3,2,1)\",\"size(squeeze(a))\",\"b = zeros(1,1,3)\",\"size(squeeze(b))\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"subset\",\"trace\",\"transpose\",\"zeros\"]},subset:{name:\"subset\",category:\"Matrix\",syntax:[\"value(index)\",\"value(index) = replacement\",\"subset(value, [index])\",\"subset(value, [index], replacement)\"],description:\"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.\",examples:[\"d = [1, 2; 3, 4]\",\"e = []\",\"e[1, 1:2] = [5, 6]\",\"e[2, :] = [7, 8]\",\"f = d * e\",\"f[2, 1]\",\"f[:, 1]\",\"f[[1,2], [1,3]] = [9, 10; 11, 12]\",\"f\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"trace\",\"transpose\",\"zeros\"]},trace:{name:\"trace\",category:\"Matrix\",syntax:[\"trace(A)\"],description:\"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.\",examples:[\"A = [1, 2, 3; -1, 2, 3; 2, 0, 3]\",\"trace(A)\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"transpose\",\"zeros\"]},transpose:{name:\"transpose\",category:\"Matrix\",syntax:[\"x'\",\"transpose(x)\"],description:\"Transpose a matrix\",examples:[\"a = [1, 2, 3; 4, 5, 6]\",\"a'\",\"transpose(a)\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"zeros\"]},zeros:{name:\"zeros\",category:\"Matrix\",syntax:[\"zeros(m)\",\"zeros(m, n)\",\"zeros(m, n, p, ...)\",\"zeros([m])\",\"zeros([m, n])\",\"zeros([m, n, p, ...])\"],description:\"Create a matrix containing zeros.\",examples:[\"zeros(3)\",\"zeros(3, 5)\",\"a = [1, 2, 3; 4, 5, 6]\",\"zeros(size(a))\"],seealso:[\"concat\",\"det\",\"diag\",\"identity\",\"inv\",\"ones\",\"range\",\"size\",\"squeeze\",\"subset\",\"trace\",\"transpose\"]},fft:{name:\"fft\",category:\"Matrix\",syntax:[\"fft(x)\"],description:\"Calculate N-dimensional Fourier transform\",examples:[\"fft([[1, 0], [1, 0]])\"],seealso:[\"ifft\"]},ifft:{name:\"ifft\",category:\"Matrix\",syntax:[\"ifft(x)\"],description:\"Calculate N-dimensional inverse Fourier transform\",examples:[\"ifft([[2, 2], [0, 0]])\"],seealso:[\"fft\"]},sylvester:{name:\"sylvester\",category:\"Algebra\",syntax:[\"sylvester(A,B,C)\"],description:\"Solves the real-valued Sylvester equation AX+XB=C for X\",examples:[\"sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])\",\"A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]\",\"sylvester(A, B, C)\"],seealso:[\"schur\",\"lyap\"]},schur:{name:\"schur\",category:\"Algebra\",syntax:[\"schur(A)\"],description:\"Performs a real Schur decomposition of the real matrix A = UTU'\",examples:[\"schur([[1, 0], [-4, 3]])\",\"A = [[1, 0], [-4, 3]]\",\"schur(A)\"],seealso:[\"lyap\",\"sylvester\"]},lyap:{name:\"lyap\",category:\"Algebra\",syntax:[\"lyap(A,Q)\"],description:\"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P\",examples:[\"lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])\",\"A = [[-2, 0], [1, -4]]\",\"Q = [[3, 1], [1, 3]]\",\"lyap(A,Q)\"],seealso:[\"schur\",\"sylvester\"]},solveODE:{name:\"solveODE\",category:\"Numeric\",syntax:[\"solveODE(func, tspan, y0)\",\"solveODE(func, tspan, y0, options)\"],description:\"Numerical Integration of Ordinary Differential Equations.\",examples:[\"f(t,y) = y\",\"tspan = [0, 4]\",\"solveODE(f, tspan, 1)\",\"solveODE(f, tspan, [1, 2])\",'solveODE(f, tspan, 1, { method:\"RK23\", maxStep:0.1 })'],seealso:[\"derivative\",\"simplifyCore\"]},combinations:{name:\"combinations\",category:\"Probability\",syntax:[\"combinations(n, k)\"],description:\"Compute the number of combinations of n items taken k at a time\",examples:[\"combinations(7, 5)\"],seealso:[\"combinationsWithRep\",\"permutations\",\"factorial\"]},combinationsWithRep:{name:\"combinationsWithRep\",category:\"Probability\",syntax:[\"combinationsWithRep(n, k)\"],description:\"Compute the number of combinations of n items taken k at a time with replacements.\",examples:[\"combinationsWithRep(7, 5)\"],seealso:[\"combinations\",\"permutations\",\"factorial\"]},factorial:{name:\"factorial\",category:\"Probability\",syntax:[\"n!\",\"factorial(n)\"],description:\"Compute the factorial of a value\",examples:[\"5!\",\"5 * 4 * 3 * 2 * 1\",\"3!\"],seealso:[\"combinations\",\"combinationsWithRep\",\"permutations\",\"gamma\"]},gamma:{name:\"gamma\",category:\"Probability\",syntax:[\"gamma(n)\"],description:\"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.\",examples:[\"gamma(4)\",\"3!\",\"gamma(1/2)\",\"sqrt(pi)\"],seealso:[\"factorial\"]},kldivergence:{name:\"kldivergence\",category:\"Probability\",syntax:[\"kldivergence(x, y)\"],description:\"Calculate the Kullback-Leibler (KL) divergence between two distributions.\",examples:[\"kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])\"],seealso:[]},lgamma:{name:\"lgamma\",category:\"Probability\",syntax:[\"lgamma(n)\"],description:\"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.\",examples:[\"lgamma(4)\",\"lgamma(1/2)\",\"lgamma(i)\",\"lgamma(complex(1.1, 2))\"],seealso:[\"gamma\"]},multinomial:{name:\"multinomial\",category:\"Probability\",syntax:[\"multinomial(A)\"],description:\"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.\",examples:[\"multinomial([1, 2, 1])\"],seealso:[\"combinations\",\"factorial\"]},permutations:{name:\"permutations\",category:\"Probability\",syntax:[\"permutations(n)\",\"permutations(n, k)\"],description:\"Compute the number of permutations of n items taken k at a time\",examples:[\"permutations(5)\",\"permutations(5, 3)\"],seealso:[\"combinations\",\"combinationsWithRep\",\"factorial\"]},pickRandom:{name:\"pickRandom\",category:\"Probability\",syntax:[\"pickRandom(array)\",\"pickRandom(array, number)\",\"pickRandom(array, weights)\",\"pickRandom(array, number, weights)\",\"pickRandom(array, weights, number)\"],description:\"Pick a random entry from a given array.\",examples:[\"pickRandom(0:10)\",\"pickRandom([1, 3, 1, 6])\",\"pickRandom([1, 3, 1, 6], 2)\",\"pickRandom([1, 3, 1, 6], [2, 3, 2, 1])\",\"pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])\",\"pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)\"],seealso:[\"random\",\"randomInt\"]},random:{name:\"random\",category:\"Probability\",syntax:[\"random()\",\"random(max)\",\"random(min, max)\",\"random(size)\",\"random(size, max)\",\"random(size, min, max)\"],description:\"Return a random number.\",examples:[\"random()\",\"random(10, 20)\",\"random([2, 3])\"],seealso:[\"pickRandom\",\"randomInt\"]},randomInt:{name:\"randomInt\",category:\"Probability\",syntax:[\"randomInt(max)\",\"randomInt(min, max)\",\"randomInt(size)\",\"randomInt(size, max)\",\"randomInt(size, min, max)\"],description:\"Return a random integer number\",examples:[\"randomInt(10, 20)\",\"randomInt([2, 3], 10)\"],seealso:[\"pickRandom\",\"random\"]},compare:{name:\"compare\",category:\"Relational\",syntax:[\"compare(x, y)\"],description:\"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\",examples:[\"compare(2, 3)\",\"compare(3, 2)\",\"compare(2, 2)\",\"compare(5cm, 40mm)\",\"compare(2, [1, 2, 3])\"],seealso:[\"equal\",\"unequal\",\"smaller\",\"smallerEq\",\"largerEq\",\"compareNatural\",\"compareText\"]},compareNatural:{name:\"compareNatural\",category:\"Relational\",syntax:[\"compareNatural(x, y)\"],description:\"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\",examples:[\"compareNatural(2, 3)\",\"compareNatural(3, 2)\",\"compareNatural(2, 2)\",\"compareNatural(5cm, 40mm)\",'compareNatural(\"2\", \"10\")',\"compareNatural(2 + 3i, 2 + 4i)\",\"compareNatural([1, 2, 4], [1, 2, 3])\",\"compareNatural([1, 5], [1, 2, 3])\",\"compareNatural([1, 2], [1, 2])\",\"compareNatural({a: 2}, {a: 4})\"],seealso:[\"equal\",\"unequal\",\"smaller\",\"smallerEq\",\"largerEq\",\"compare\",\"compareText\"]},compareText:{name:\"compareText\",category:\"Relational\",syntax:[\"compareText(x, y)\"],description:\"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.\",examples:['compareText(\"B\", \"A\")','compareText(\"A\", \"B\")','compareText(\"A\", \"A\")','compareText(\"2\", \"10\")','compare(\"2\", \"10\")',\"compare(2, 10)\",'compareNatural(\"2\", \"10\")','compareText(\"B\", [\"A\", \"B\", \"C\"])'],seealso:[\"compare\",\"compareNatural\"]},deepEqual:{name:\"deepEqual\",category:\"Relational\",syntax:[\"deepEqual(x, y)\"],description:\"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.\",examples:[\"deepEqual([1,3,4], [1,3,4])\",\"deepEqual([1,3,4], [1,3])\"],seealso:[\"equal\",\"unequal\",\"smaller\",\"larger\",\"smallerEq\",\"largerEq\",\"compare\"]},equal:{name:\"equal\",category:\"Relational\",syntax:[\"x == y\",\"equal(x, y)\"],description:\"Check equality of two values. Returns true if the values are equal, and false if not.\",examples:[\"2+2 == 3\",\"2+2 == 4\",\"a = 3.2\",\"b = 6-2.8\",\"a == b\",\"50cm == 0.5m\"],seealso:[\"unequal\",\"smaller\",\"larger\",\"smallerEq\",\"largerEq\",\"compare\",\"deepEqual\",\"equalText\"]},equalText:{name:\"equalText\",category:\"Relational\",syntax:[\"equalText(x, y)\"],description:\"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.\",examples:['equalText(\"Hello\", \"Hello\")','equalText(\"a\", \"A\")','equal(\"2e3\", \"2000\")','equalText(\"2e3\", \"2000\")','equalText(\"B\", [\"A\", \"B\", \"C\"])'],seealso:[\"compare\",\"compareNatural\",\"compareText\",\"equal\"]},larger:{name:\"larger\",category:\"Relational\",syntax:[\"x > y\",\"larger(x, y)\"],description:\"Check if value x is larger than y. Returns true if x is larger than y, and false if not. Comparing a value with NaN returns false.\",examples:[\"2 > 3\",\"5 > 2*2\",\"a = 3.3\",\"b = 6-2.8\",\"(a > b)\",\"(b < a)\",\"5 cm > 2 inch\"],seealso:[\"equal\",\"unequal\",\"smaller\",\"smallerEq\",\"largerEq\",\"compare\"]},largerEq:{name:\"largerEq\",category:\"Relational\",syntax:[\"x >= y\",\"largerEq(x, y)\"],description:\"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.\",examples:[\"2 >= 1+1\",\"2 > 1+1\",\"a = 3.2\",\"b = 6-2.8\",\"(a >= b)\"],seealso:[\"equal\",\"unequal\",\"smallerEq\",\"smaller\",\"compare\"]},smaller:{name:\"smaller\",category:\"Relational\",syntax:[\"x < y\",\"smaller(x, y)\"],description:\"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not. Comparing a value with NaN returns false.\",examples:[\"2 < 3\",\"5 < 2*2\",\"a = 3.3\",\"b = 6-2.8\",\"(a < b)\",\"5 cm < 2 inch\"],seealso:[\"equal\",\"unequal\",\"larger\",\"smallerEq\",\"largerEq\",\"compare\"]},smallerEq:{name:\"smallerEq\",category:\"Relational\",syntax:[\"x <= y\",\"smallerEq(x, y)\"],description:\"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.\",examples:[\"2 <= 1+1\",\"2 < 1+1\",\"a = 3.2\",\"b = 6-2.8\",\"(a <= b)\"],seealso:[\"equal\",\"unequal\",\"larger\",\"smaller\",\"largerEq\",\"compare\"]},unequal:{name:\"unequal\",category:\"Relational\",syntax:[\"x != y\",\"unequal(x, y)\"],description:\"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.\",examples:[\"2+2 != 3\",\"2+2 != 4\",\"a = 3.2\",\"b = 6-2.8\",\"a != b\",\"50cm != 0.5m\",\"5 cm != 2 inch\"],seealso:[\"equal\",\"smaller\",\"larger\",\"smallerEq\",\"largerEq\",\"compare\",\"deepEqual\"]},setCartesian:{name:\"setCartesian\",category:\"Set\",syntax:[\"setCartesian(set1, set2)\"],description:\"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.\",examples:[\"setCartesian([1, 2], [3, 4])\"],seealso:[\"setUnion\",\"setIntersect\",\"setDifference\",\"setPowerset\"]},setDifference:{name:\"setDifference\",category:\"Set\",syntax:[\"setDifference(set1, set2)\"],description:\"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.\",examples:[\"setDifference([1, 2, 3, 4], [3, 4, 5, 6])\",\"setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])\"],seealso:[\"setUnion\",\"setIntersect\",\"setSymDifference\"]},setDistinct:{name:\"setDistinct\",category:\"Set\",syntax:[\"setDistinct(set)\"],description:\"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.\",examples:[\"setDistinct([1, 1, 1, 2, 2, 3])\"],seealso:[\"setMultiplicity\"]},setIntersect:{name:\"setIntersect\",category:\"Set\",syntax:[\"setIntersect(set1, set2)\"],description:\"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.\",examples:[\"setIntersect([1, 2, 3, 4], [3, 4, 5, 6])\",\"setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])\"],seealso:[\"setUnion\",\"setDifference\"]},setIsSubset:{name:\"setIsSubset\",category:\"Set\",syntax:[\"setIsSubset(set1, set2)\"],description:\"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.\",examples:[\"setIsSubset([1, 2], [3, 4, 5, 6])\",\"setIsSubset([3, 4], [3, 4, 5, 6])\"],seealso:[\"setUnion\",\"setIntersect\",\"setDifference\"]},setMultiplicity:{name:\"setMultiplicity\",category:\"Set\",syntax:[\"setMultiplicity(element, set)\"],description:\"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.\",examples:[\"setMultiplicity(1, [1, 2, 2, 4])\",\"setMultiplicity(2, [1, 2, 2, 4])\"],seealso:[\"setDistinct\",\"setSize\"]},setPowerset:{name:\"setPowerset\",category:\"Set\",syntax:[\"setPowerset(set)\"],description:\"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.\",examples:[\"setPowerset([1, 2, 3])\"],seealso:[\"setCartesian\"]},setSize:{name:\"setSize\",category:\"Set\",syntax:[\"setSize(set)\",\"setSize(set, unique)\"],description:'Count the number of elements of a (multi)set. When the second parameter \"unique\" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:[\"setSize([1, 2, 2, 4])\",\"setSize([1, 2, 2, 4], true)\"],seealso:[\"setUnion\",\"setIntersect\",\"setDifference\"]},setSymDifference:{name:\"setSymDifference\",category:\"Set\",syntax:[\"setSymDifference(set1, set2)\"],description:\"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.\",examples:[\"setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])\",\"setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])\"],seealso:[\"setUnion\",\"setIntersect\",\"setDifference\"]},setUnion:{name:\"setUnion\",category:\"Set\",syntax:[\"setUnion(set1, set2)\"],description:\"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.\",examples:[\"setUnion([1, 2, 3, 4], [3, 4, 5, 6])\",\"setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])\"],seealso:[\"setIntersect\",\"setDifference\"]},zpk2tf:{name:\"zpk2tf\",category:\"Signal\",syntax:[\"zpk2tf(z, p, k)\"],description:\"Compute the transfer function of a zero-pole-gain model.\",examples:[\"zpk2tf([1, 2], [-1, -2], 1)\",\"zpk2tf([1, 2], [-1, -2])\",\"zpk2tf([1 - 3i, 2 + 2i], [-1, -2])\"],seealso:[]},freqz:{name:\"freqz\",category:\"Signal\",syntax:[\"freqz(b, a)\",\"freqz(b, a, w)\"],description:\"Calculates the frequency response of a filter given its numerator and denominator coefficients.\",examples:[\"freqz([1, 2], [1, 2, 3])\",\"freqz([1, 2], [1, 2, 3], [0, 1])\",\"freqz([1, 2], [1, 2, 3], 512)\"],seealso:[]},erf:{name:\"erf\",category:\"Special\",syntax:[\"erf(x)\"],description:\"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x\",examples:[\"erf(0.2)\",\"erf(-0.5)\",\"erf(4)\"],seealso:[]},zeta:{name:\"zeta\",category:\"Special\",syntax:[\"zeta(s)\"],description:\"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane\",examples:[\"zeta(0.2)\",\"zeta(-0.5)\",\"zeta(4)\"],seealso:[]},cumsum:{name:\"cumsum\",category:\"Statistics\",syntax:[\"cumsum(a, b, c, ...)\",\"cumsum(A)\"],description:\"Compute the cumulative sum of all values.\",examples:[\"cumsum(2, 3, 4, 1)\",\"cumsum([2, 3, 4, 1])\",\"cumsum([1, 2; 3, 4])\",\"cumsum([1, 2; 3, 4], 1)\",\"cumsum([1, 2; 3, 4], 2)\"],seealso:[\"max\",\"mean\",\"median\",\"min\",\"prod\",\"std\",\"sum\",\"variance\"]},mad:{name:\"mad\",category:\"Statistics\",syntax:[\"mad(a, b, c, ...)\",\"mad(A)\"],description:\"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.\",examples:[\"mad(10, 20, 30)\",\"mad([1, 2, 3])\"],seealso:[\"mean\",\"median\",\"std\",\"abs\"]},max:{name:\"max\",category:\"Statistics\",syntax:[\"max(a, b, c, ...)\",\"max(A)\",\"max(A, dimension)\"],description:\"Compute the maximum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.\",examples:[\"max(2, 3, 4, 1)\",\"max([2, 3, 4, 1])\",\"max([2, 5; 4, 3])\",\"max([2, 5; 4, 3], 1)\",\"max([2, 5; 4, 3], 2)\",\"max(2.7, 7.1, -4.5, 2.0, 4.1)\",\"min(2.7, 7.1, -4.5, 2.0, 4.1)\"],seealso:[\"mean\",\"median\",\"min\",\"prod\",\"std\",\"sum\",\"variance\"]},mean:{name:\"mean\",category:\"Statistics\",syntax:[\"mean(a, b, c, ...)\",\"mean(A)\",\"mean(A, dimension)\"],description:\"Compute the arithmetic mean of a list of values.\",examples:[\"mean(2, 3, 4, 1)\",\"mean([2, 3, 4, 1])\",\"mean([2, 5; 4, 3])\",\"mean([2, 5; 4, 3], 1)\",\"mean([2, 5; 4, 3], 2)\",\"mean([1.0, 2.7, 3.2, 4.0])\"],seealso:[\"max\",\"median\",\"min\",\"prod\",\"std\",\"sum\",\"variance\"]},median:{name:\"median\",category:\"Statistics\",syntax:[\"median(a, b, c, ...)\",\"median(A)\"],description:\"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.\",examples:[\"median(5, 2, 7)\",\"median([3, -1, 5, 7])\"],seealso:[\"max\",\"mean\",\"min\",\"prod\",\"std\",\"sum\",\"variance\",\"quantileSeq\"]},min:{name:\"min\",category:\"Statistics\",syntax:[\"min(a, b, c, ...)\",\"min(A)\",\"min(A, dimension)\"],description:\"Compute the minimum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.\",examples:[\"min(2, 3, 4, 1)\",\"min([2, 3, 4, 1])\",\"min([2, 5; 4, 3])\",\"min([2, 5; 4, 3], 1)\",\"min([2, 5; 4, 3], 2)\",\"min(2.7, 7.1, -4.5, 2.0, 4.1)\",\"max(2.7, 7.1, -4.5, 2.0, 4.1)\"],seealso:[\"max\",\"mean\",\"median\",\"prod\",\"std\",\"sum\",\"variance\"]},mode:{name:\"mode\",category:\"Statistics\",syntax:[\"mode(a, b, c, ...)\",\"mode(A)\",\"mode(A, a, b, B, c, ...)\"],description:\"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.\",examples:[\"mode(2, 1, 4, 3, 1)\",\"mode([1, 2.7, 3.2, 4, 2.7])\",\"mode(1, 4, 6, 1, 6)\"],seealso:[\"max\",\"mean\",\"min\",\"median\",\"prod\",\"std\",\"sum\",\"variance\"]},prod:{name:\"prod\",category:\"Statistics\",syntax:[\"prod(a, b, c, ...)\",\"prod(A)\"],description:\"Compute the product of all values.\",examples:[\"prod(2, 3, 4)\",\"prod([2, 3, 4])\",\"prod([2, 5; 4, 3])\"],seealso:[\"max\",\"mean\",\"min\",\"median\",\"min\",\"std\",\"sum\",\"variance\"]},quantileSeq:{name:\"quantileSeq\",category:\"Statistics\",syntax:[\"quantileSeq(A, prob[, sorted])\",\"quantileSeq(A, [prob1, prob2, ...][, sorted])\",\"quantileSeq(A, N[, sorted])\"],description:\"Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. \\n\\nIn case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.\",examples:[\"quantileSeq([3, -1, 5, 7], 0.5)\",\"quantileSeq([3, -1, 5, 7], [1/3, 2/3])\",\"quantileSeq([3, -1, 5, 7], 2)\",\"quantileSeq([-1, 3, 5, 7], 0.5, true)\"],seealso:[\"mean\",\"median\",\"min\",\"max\",\"prod\",\"std\",\"sum\",\"variance\"]},std:{name:\"std\",category:\"Statistics\",syntax:[\"std(a, b, c, ...)\",\"std(A)\",\"std(A, dimension)\",\"std(A, normalization)\",\"std(A, dimension, normalization)\"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',examples:[\"std(2, 4, 6)\",\"std([2, 4, 6, 8])\",'std([2, 4, 6, 8], \"uncorrected\")','std([2, 4, 6, 8], \"biased\")',\"std([1, 2, 3; 4, 5, 6])\"],seealso:[\"max\",\"mean\",\"min\",\"median\",\"prod\",\"sum\",\"variance\"]},sum:{name:\"sum\",category:\"Statistics\",syntax:[\"sum(a, b, c, ...)\",\"sum(A)\",\"sum(A, dimension)\"],description:\"Compute the sum of all values.\",examples:[\"sum(2, 3, 4, 1)\",\"sum([2, 3, 4, 1])\",\"sum([2, 5; 4, 3])\"],seealso:[\"max\",\"mean\",\"median\",\"min\",\"prod\",\"std\",\"variance\"]},variance:{name:\"variance\",category:\"Statistics\",syntax:[\"variance(a, b, c, ...)\",\"variance(A)\",\"variance(A, dimension)\",\"variance(A, normalization)\",\"variance(A, dimension, normalization)\"],description:'Compute the variance of all values. Optional parameter normalization can be \"unbiased\" (default), \"uncorrected\", or \"biased\".',examples:[\"variance(2, 4, 6)\",\"variance([2, 4, 6, 8])\",'variance([2, 4, 6, 8], \"uncorrected\")','variance([2, 4, 6, 8], \"biased\")',\"variance([1, 2, 3; 4, 5, 6])\"],seealso:[\"max\",\"mean\",\"min\",\"median\",\"min\",\"prod\",\"std\",\"sum\"]},corr:{name:\"corr\",category:\"Statistics\",syntax:[\"corr(A,B)\"],description:\"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.\",examples:[\"corr([2, 4, 6, 8],[1, 2, 3, 6])\",\"corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))\"],seealso:[\"max\",\"mean\",\"min\",\"median\",\"min\",\"prod\",\"std\",\"sum\"]},acos:{name:\"acos\",category:\"Trigonometry\",syntax:[\"acos(x)\"],description:\"Compute the inverse cosine of a value in radians.\",examples:[\"acos(0.5)\",\"acos(cos(2.3))\"],seealso:[\"cos\",\"atan\",\"asin\"]},acosh:{name:\"acosh\",category:\"Trigonometry\",syntax:[\"acosh(x)\"],description:\"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.\",examples:[\"acosh(1.5)\"],seealso:[\"cosh\",\"asinh\",\"atanh\"]},acot:{name:\"acot\",category:\"Trigonometry\",syntax:[\"acot(x)\"],description:\"Calculate the inverse cotangent of a value.\",examples:[\"acot(0.5)\",\"acot(cot(0.5))\",\"acot(2)\"],seealso:[\"cot\",\"atan\"]},acoth:{name:\"acoth\",category:\"Trigonometry\",syntax:[\"acoth(x)\"],description:\"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.\",examples:[\"acoth(2)\",\"acoth(0.5)\"],seealso:[\"acsch\",\"asech\"]},acsc:{name:\"acsc\",category:\"Trigonometry\",syntax:[\"acsc(x)\"],description:\"Calculate the inverse cotangent of a value.\",examples:[\"acsc(2)\",\"acsc(csc(0.5))\",\"acsc(0.5)\"],seealso:[\"csc\",\"asin\",\"asec\"]},acsch:{name:\"acsch\",category:\"Trigonometry\",syntax:[\"acsch(x)\"],description:\"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.\",examples:[\"acsch(0.5)\"],seealso:[\"asech\",\"acoth\"]},asec:{name:\"asec\",category:\"Trigonometry\",syntax:[\"asec(x)\"],description:\"Calculate the inverse secant of a value.\",examples:[\"asec(0.5)\",\"asec(sec(0.5))\",\"asec(2)\"],seealso:[\"acos\",\"acot\",\"acsc\"]},asech:{name:\"asech\",category:\"Trigonometry\",syntax:[\"asech(x)\"],description:\"Calculate the inverse secant of a value.\",examples:[\"asech(0.5)\"],seealso:[\"acsch\",\"acoth\"]},asin:{name:\"asin\",category:\"Trigonometry\",syntax:[\"asin(x)\"],description:\"Compute the inverse sine of a value in radians.\",examples:[\"asin(0.5)\",\"asin(sin(0.5))\"],seealso:[\"sin\",\"acos\",\"atan\"]},asinh:{name:\"asinh\",category:\"Trigonometry\",syntax:[\"asinh(x)\"],description:\"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.\",examples:[\"asinh(0.5)\"],seealso:[\"acosh\",\"atanh\"]},atan:{name:\"atan\",category:\"Trigonometry\",syntax:[\"atan(x)\"],description:\"Compute the inverse tangent of a value in radians.\",examples:[\"atan(0.5)\",\"atan(tan(0.5))\"],seealso:[\"tan\",\"acos\",\"asin\"]},atanh:{name:\"atanh\",category:\"Trigonometry\",syntax:[\"atanh(x)\"],description:\"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.\",examples:[\"atanh(0.5)\"],seealso:[\"acosh\",\"asinh\"]},atan2:{name:\"atan2\",category:\"Trigonometry\",syntax:[\"atan2(y, x)\"],description:\"Computes the principal value of the arc tangent of y/x in radians.\",examples:[\"atan2(2, 2) / pi\",\"angle = 60 deg in rad\",\"x = cos(angle)\",\"y = sin(angle)\",\"atan2(y, x)\"],seealso:[\"sin\",\"cos\",\"tan\"]},cos:{name:\"cos\",category:\"Trigonometry\",syntax:[\"cos(x)\"],description:\"Compute the cosine of x in radians.\",examples:[\"cos(2)\",\"cos(pi / 4) ^ 2\",\"cos(180 deg)\",\"cos(60 deg)\",\"sin(0.2)^2 + cos(0.2)^2\"],seealso:[\"acos\",\"sin\",\"tan\"]},cosh:{name:\"cosh\",category:\"Trigonometry\",syntax:[\"cosh(x)\"],description:\"Compute the hyperbolic cosine of x in radians.\",examples:[\"cosh(0.5)\"],seealso:[\"sinh\",\"tanh\",\"coth\"]},cot:{name:\"cot\",category:\"Trigonometry\",syntax:[\"cot(x)\"],description:\"Compute the cotangent of x in radians. Defined as 1/tan(x)\",examples:[\"cot(2)\",\"1 / tan(2)\"],seealso:[\"sec\",\"csc\",\"tan\"]},coth:{name:\"coth\",category:\"Trigonometry\",syntax:[\"coth(x)\"],description:\"Compute the hyperbolic cotangent of x in radians.\",examples:[\"coth(2)\",\"1 / tanh(2)\"],seealso:[\"sech\",\"csch\",\"tanh\"]},csc:{name:\"csc\",category:\"Trigonometry\",syntax:[\"csc(x)\"],description:\"Compute the cosecant of x in radians. Defined as 1/sin(x)\",examples:[\"csc(2)\",\"1 / sin(2)\"],seealso:[\"sec\",\"cot\",\"sin\"]},csch:{name:\"csch\",category:\"Trigonometry\",syntax:[\"csch(x)\"],description:\"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)\",examples:[\"csch(2)\",\"1 / sinh(2)\"],seealso:[\"sech\",\"coth\",\"sinh\"]},sec:{name:\"sec\",category:\"Trigonometry\",syntax:[\"sec(x)\"],description:\"Compute the secant of x in radians. Defined as 1/cos(x)\",examples:[\"sec(2)\",\"1 / cos(2)\"],seealso:[\"cot\",\"csc\",\"cos\"]},sech:{name:\"sech\",category:\"Trigonometry\",syntax:[\"sech(x)\"],description:\"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)\",examples:[\"sech(2)\",\"1 / cosh(2)\"],seealso:[\"coth\",\"csch\",\"cosh\"]},sin:{name:\"sin\",category:\"Trigonometry\",syntax:[\"sin(x)\"],description:\"Compute the sine of x in radians.\",examples:[\"sin(2)\",\"sin(pi / 4) ^ 2\",\"sin(90 deg)\",\"sin(30 deg)\",\"sin(0.2)^2 + cos(0.2)^2\"],seealso:[\"asin\",\"cos\",\"tan\"]},sinh:{name:\"sinh\",category:\"Trigonometry\",syntax:[\"sinh(x)\"],description:\"Compute the hyperbolic sine of x in radians.\",examples:[\"sinh(0.5)\"],seealso:[\"cosh\",\"tanh\"]},tan:{name:\"tan\",category:\"Trigonometry\",syntax:[\"tan(x)\"],description:\"Compute the tangent of x in radians.\",examples:[\"tan(0.5)\",\"sin(0.5) / cos(0.5)\",\"tan(pi / 4)\",\"tan(45 deg)\"],seealso:[\"atan\",\"sin\",\"cos\"]},tanh:{name:\"tanh\",category:\"Trigonometry\",syntax:[\"tanh(x)\"],description:\"Compute the hyperbolic tangent of x in radians.\",examples:[\"tanh(0.5)\",\"sinh(0.5) / cosh(0.5)\"],seealso:[\"sinh\",\"cosh\"]},to:{name:\"to\",category:\"Units\",syntax:[\"x to unit\",\"to(x, unit)\"],description:\"Change the unit of a value.\",examples:[\"5 inch to cm\",\"3.2kg to g\",\"16 bytes in bits\"],seealso:[]},toBest:{name:\"toBest\",category:\"Units\",syntax:[\"toBest(x)\",\"toBest(x, unitList)\",\"toBest(x, unitList, options)\"],description:\"Converts to the most appropriate display unit.\",examples:['toBest(unit(5000, \"m\"))','toBest(unit(3500000, \"W\"))','toBest(unit(0.000000123, \"A\"))','toBest(unit(10, \"m\"), \"cm\")','toBest(unit(10, \"m\"), \"mm,km\", {offset: 1.5})'],seealso:[]},clone:{name:\"clone\",category:\"Utils\",syntax:[\"clone(x)\"],description:\"Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices\",examples:[\"clone(3.5)\",\"clone(2 - 4i)\",\"clone(45 deg)\",\"clone([1, 2; 3, 4])\",'clone(\"hello world\")'],seealso:[]},format:{name:\"format\",category:\"Utils\",syntax:[\"format(value)\",\"format(value, precision)\"],description:\"Format a value of any type as string.\",examples:[\"format(2.3)\",\"format(3 - 4i)\",\"format([])\",\"format(pi, 3)\"],seealso:[\"print\"]},bin:{name:\"bin\",category:\"Utils\",syntax:[\"bin(value)\"],description:\"Format a number as binary\",examples:[\"bin(2)\"],seealso:[\"oct\",\"hex\"]},oct:{name:\"oct\",category:\"Utils\",syntax:[\"oct(value)\"],description:\"Format a number as octal\",examples:[\"oct(56)\"],seealso:[\"bin\",\"hex\"]},hex:{name:\"hex\",category:\"Utils\",syntax:[\"hex(value)\"],description:\"Format a number as hexadecimal\",examples:[\"hex(240)\"],seealso:[\"bin\",\"oct\"]},isNaN:{name:\"isNaN\",category:\"Utils\",syntax:[\"isNaN(x)\"],description:\"Test whether a value is NaN (not a number)\",examples:[\"isNaN(2)\",\"isNaN(0 / 0)\",\"isNaN(NaN)\",\"isNaN(Infinity)\"],seealso:[\"isNegative\",\"isNumeric\",\"isPositive\",\"isZero\"]},isInteger:{name:\"isInteger\",category:\"Utils\",syntax:[\"isInteger(x)\"],description:\"Test whether a value is an integer number.\",examples:[\"isInteger(2)\",\"isInteger(3.5)\",\"isInteger([3, 0.5, -2])\"],seealso:[\"isNegative\",\"isNumeric\",\"isPositive\",\"isZero\"]},isNegative:{name:\"isNegative\",category:\"Utils\",syntax:[\"isNegative(x)\"],description:\"Test whether a value is negative: smaller than zero.\",examples:[\"isNegative(2)\",\"isNegative(0)\",\"isNegative(-4)\",\"isNegative([3, 0.5, -2])\"],seealso:[\"isInteger\",\"isNumeric\",\"isPositive\",\"isZero\"]},isNumeric:{name:\"isNumeric\",category:\"Utils\",syntax:[\"isNumeric(x)\"],description:\"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.\",examples:[\"isNumeric(2)\",'isNumeric(\"2\")','hasNumericValue(\"2\")',\"isNumeric(0)\",\"isNumeric(bignumber(500))\",\"isNumeric(fraction(0.125))\",\"isNumeric(2 + 3i)\",'isNumeric([2.3, \"foo\", false])'],seealso:[\"isInteger\",\"isZero\",\"isNegative\",\"isPositive\",\"isNaN\",\"hasNumericValue\"]},hasNumericValue:{name:\"hasNumericValue\",category:\"Utils\",syntax:[\"hasNumericValue(x)\"],description:\"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.\",examples:[\"hasNumericValue(2)\",'hasNumericValue(\"2\")','isNumeric(\"2\")',\"hasNumericValue(0)\",\"hasNumericValue(bignumber(500))\",\"hasNumericValue(fraction(0.125))\",\"hasNumericValue(2 + 3i)\",'hasNumericValue([2.3, \"foo\", false])'],seealso:[\"isInteger\",\"isZero\",\"isNegative\",\"isPositive\",\"isNaN\",\"isNumeric\"]},isPositive:{name:\"isPositive\",category:\"Utils\",syntax:[\"isPositive(x)\"],description:\"Test whether a value is positive: larger than zero.\",examples:[\"isPositive(2)\",\"isPositive(0)\",\"isPositive(-4)\",\"isPositive([3, 0.5, -2])\"],seealso:[\"isInteger\",\"isNumeric\",\"isNegative\",\"isZero\"]},isPrime:{name:\"isPrime\",category:\"Utils\",syntax:[\"isPrime(x)\"],description:\"Test whether a value is prime: has no divisors other than itself and one.\",examples:[\"isPrime(3)\",\"isPrime(-2)\",\"isPrime([2, 17, 100])\"],seealso:[\"isInteger\",\"isNumeric\",\"isNegative\",\"isZero\"]},isZero:{name:\"isZero\",category:\"Utils\",syntax:[\"isZero(x)\"],description:\"Test whether a value is zero.\",examples:[\"isZero(2)\",\"isZero(0)\",\"isZero(-4)\",\"isZero([3, 0, -2, 0])\"],seealso:[\"isInteger\",\"isNumeric\",\"isNegative\",\"isPositive\"]},print:{name:\"print\",category:\"Utils\",syntax:[\"print(template, values)\",\"print(template, values, precision)\"],description:\"Interpolate values into a string template.\",examples:['print(\"Lucy is $age years old\", {age: 5})','print(\"The value of pi is $pi\", {pi: pi}, 3)','print(\"Hello, $user.name!\", {user: {name: \"John\"}})','print(\"Values: $1, $2, $3\", [6, 9, 4])'],seealso:[\"format\"]},typeOf:{name:\"typeOf\",category:\"Utils\",syntax:[\"typeOf(x)\"],description:\"Get the type of a variable.\",examples:[\"typeOf(3.5)\",\"typeOf(2 - 4i)\",\"typeOf(45 deg)\",'typeOf(\"hello world\")'],seealso:[\"getMatrixDataType\"]},numeric:{name:\"numeric\",category:\"Utils\",syntax:[\"numeric(x)\"],description:\"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.\",examples:['numeric(\"4\")','numeric(\"4\", \"number\")','numeric(\"4\", \"bigint\")','numeric(\"4\", \"BigNumber\")','numeric(\"4\", \"Fraction\")','numeric(4, \"Fraction\")','numeric(fraction(2, 5), \"number\")'],seealso:[\"number\",\"bigint\",\"fraction\",\"bignumber\",\"string\",\"format\"]}},Ap=s(\"help\",[\"typed\",\"mathWithTransform\",\"Help\"],e=>{let{typed:t,mathWithTransform:i,Help:a}=e;return t(\"help\",{any:function(e){let t,r=e;if(\"string\"!=typeof e)for(t in i)if(ue(i,t)&&e===i[t]){r=t;break}var n=h(Np,r);if(n)return new a(n);{const e=\"function\"==typeof r?r.name:r;throw new Error('No documentation found on \"'+e+'\"')}}})}),Ep=s(\"chain\",[\"typed\",\"Chain\"],e=>{let{typed:t,Chain:r}=e;return t(\"chain\",{\"\":function(){return new r},any:function(e){return new r(e)}})}),Sp=s(\"det\",[\"typed\",\"matrix\",\"subtractScalar\",\"multiply\",\"divideScalar\",\"isZero\",\"unaryMinus\"],e=>{let{typed:t,matrix:l,subtractScalar:c,multiply:f,divideScalar:p,isZero:m,unaryMinus:h}=e;return t(\"det\",{any:ee,\"Array | Matrix\":function(e){var t=_(e)?e.size():Array.isArray(e)?(e=l(e)).size():[];switch(t.length){case 0:return ee(e);case 1:if(1===t[0])return ee(e.valueOf()[0]);if(0===t[0])return 1;throw new RangeError(\"Matrix must be square (size: \"+S(t)+\")\");case 2:{const l=t[0],n=t[1];if(l===n){var i=e.clone().valueOf();var a=l;if(1===a)return ee(i[0][0]);if(2===a)return c(f(i[0][0],i[1][1]),f(i[1][0],i[0][1]));{let n=!1;const u=new Array(a).fill(0).map((e,t)=>t);for(let r=0;r{let{typed:t,matrix:n,divideScalar:p,addScalar:m,multiply:h,unaryMinus:d,det:g,identity:y,abs:x}=e;return t(\"inv\",{\"Array | Matrix\":function(e){var t=_(e)?e.size():T(e);switch(t.length){case 1:if(1===t[0])return _(e)?n([p(1,e.valueOf()[0])]):[p(1,e[0])];throw new RangeError(\"Matrix must be square (size: \"+S(t)+\")\");case 2:{const p=t[0],r=t[1];if(p===r)return _(e)?n(i(e.valueOf(),p,r),e.storage()):i(e,p,r);throw new RangeError(\"Matrix must be square (size: \"+S(t)+\")\")}default:throw new RangeError(\"Matrix must be two dimensional (size: \"+S(t)+\")\")}},any:function(e){return p(1,e)}});function i(e,n,i){let a,o,s,u,l;if(1===n){if(0===(u=e[0][0]))throw Error(\"Cannot calculate inverse, determinant is zero\");return[[p(1,u)]]}if(2===n){const n=g(e);if(0===n)throw Error(\"Cannot calculate inverse, determinant is zero\");return[[p(e[1][1],n),p(d(e[0][1]),n)],[p(d(e[1][0]),n),p(e[0][0],n)]]}{const g=e.concat();for(a=0;ae&&(e=x(g[a][r]),t=a),a++;if(0===e)throw Error(\"Cannot calculate inverse, determinant is zero\");(a=t)!==r&&(l=g[r],g[r]=g[a],g[a]=l,l=u[r],u[r]=u[a],u[a]=l);var c=g[r],f=u[r];for(a=0;a{let{typed:t,matrix:i,inv:a,deepEqual:r,equal:n,dotDivide:u,dot:o,ctranspose:s,divideScalar:l,multiply:c,add:f,Complex:p}=e;return t(\"pinv\",{\"Array | Matrix\":function(e){var t=_(e)?e.size():T(e);switch(t.length){case 1:return d(e)?s(e):1===t[0]?a(e):u(s(e),o(e,e));case 2:if(d(e))return s(e);var r=t[0],n=t[1];if(r===n)try{return a(e)}catch(e){if(!(e instanceof Error&&e.message.match(/Cannot calculate inverse, determinant is zero/)))throw e}return _(e)?i(m(e.valueOf(),r,n),e.storage()):m(e,r,n);default:throw new RangeError(\"Matrix must be two dimensional (size: \"+S(t)+\")\")}},any:function(e){return n(e,0)?ee(e):l(1,e)}});function m(e,t,i){var{C:e,F:t}=function(e,r){const n=function(i,a){const o=ee(e);let s=0;for(let n=0;ne.filter((e,t)=>t!h(o(n[t],n[t])))}}(e,t),e=c(a(c(s(e),e)),s(e)),t=c(s(t),a(c(t,s(t))));return c(t,e)}function h(e){return n(f(e,p(1,1)),f(0,p(1,1)))}function d(e){return r(f(e,p(1,1)),f(c(e,0),p(1,1)))}}),Tp=s(\"eigs\",[\"config\",\"typed\",\"matrix\",\"addScalar\",\"equal\",\"subtract\",\"abs\",\"atan\",\"cos\",\"sin\",\"multiplyScalar\",\"divideScalar\",\"inv\",\"bignumber\",\"multiply\",\"add\",\"larger\",\"column\",\"flatten\",\"number\",\"complex\",\"sqrt\",\"diag\",\"size\",\"reshape\",\"qr\",\"usolve\",\"usolveAll\",\"im\",\"re\",\"smaller\",\"matrixFromColumns\",\"dot\"],e=>{let{config:s,typed:t,matrix:i,addScalar:r,subtract:p,equal:n,abs:m,atan:a,cos:o,sin:u,multiplyScalar:h,divideScalar:y,inv:x,bignumber:P,multiply:U,add:l,larger:k,column:c,flatten:j,number:f,complex:L,sqrt:R,diag:$,size:H,reshape:G,qr:V,usolve:Z,usolveAll:W,im:d,re:g,smaller:Y,matrixFromColumns:J,dot:X}=e;const w=function(){let{config:E,addScalar:S,subtract:M,abs:C,atan:T,cos:B,sin:F,multiplyScalar:D,inv:O,bignumber:_,multiply:z,add:q}={config:s,addScalar:r,subtract:p,column:c,flatten:j,equal:n,abs:m,atan:a,cos:o,sin:u,multiplyScalar:h,inv:x,bignumber:P,complex:L,multiply:U,add:l};function I(r){var n=r.length;let i=0,a=[0,1];for(let t=0;t({value:s[t],vector:e}));return{values:s,eigenvectors:t}}return function(n,e){var i,a,o,s,u,l,c=2=Math.abs(b);){const m=r[0][0],x=r[0][1];i=p[m][m],a=p[x][x],o=p[m][x],p=function(t,e,r,n){const i=t.length,a=Math.cos(e),o=Math.sin(e),s=a*a,u=o*o,l=Array(i).fill(0),c=Array(i).fill(0),f=s*t[r][r]-2*a*o*t[r][n]+u*t[n][n],p=u*t[r][r]+2*a*o*t[r][n]+s*t[n][n];for(let e=0;e=C(N);){const g=r[0][0],w=r[0][1];s=d[g][g],u=d[w][w],l=d[g][w],u=M(u,s),d=function(t,e,r,n){const i=t.length,a=_(B(e)),o=_(F(e)),s=D(a,a),u=D(o,o),l=Array(i).fill(_(0)),c=Array(i).fill(_(0)),f=z(_(2),a,o,t[r][n]),p=S(M(D(s,t[r][r]),f),D(u,t[n][n])),m=q(D(u,t[r][r]),f,D(s,t[n][n]));for(let e=0;e2*Math.random()-1);return n&&(a=a.map(e=>M(e))),f(a=l(a=i?a.map(e=>O(e)):a,t),r)}(t,r,i);try{o=u(e,o)}catch(e){continue}if(g(c(o),a))break}if(5<=s)return null;for(s=0;;){const t=u(e,o);if(_(c(l(o,[t])),n))break;if(10<=++s)return null;o=f(t)}return o}function l(e,t){var r,n=i(e);for(r of t)r=a(r,n),e=w(e,N(d(o(r,e),o(r,r)),r));return e}function c(e){return S(E(o(e,e)))}function f(e,t){var r=\"Complex\"===t,t=\"BigNumber\"===t?M(1):r?O(1):1;return N(d(t,c(e)),e)}return function(e,t,r,n){var i=!(4+w(S(e),S(t))),100N(l,e)),d.push(...e.map(e=>({value:o,vector:b(e)})))}return d}(e,t,f,a,p,r,n);return{values:p,eigenvectors:v}}return{values:p}}}();return t(\"eigs\",{Array:function(e){return b(i(e))},\"Array, number|BigNumber\":function(e,t){return b(i(e),{precision:t})},\"Array, Object\":(e,t)=>b(i(e),t),Matrix:function(e){return b(e,{matricize:!0})},\"Matrix, number|BigNumber\":function(e,t){return b(e,{precision:t,matricize:!0})},\"Matrix, Object\":function(e,t){var r={matricize:!0};return gn(r,t),b(e,r)}});function b(e,t){t=1{var{value:e,vector:t}=e;return{value:e,vector:i(t)}}))),r&&Object.defineProperty(n,\"vectors\",{enumerable:!1,get:()=>{throw new Error(\"eigs(M).vectors replaced with eigs(M).eigenvectors\")}}),n}function v(e,r,n){e=e.datatype();if(\"number\"===e||\"BigNumber\"===e||\"Complex\"===e)return e;let i=!1,a=!1,o=!1;for(let t=0;t{let{typed:t,abs:p,add:m,identity:h,inv:d,multiply:g}=e;return t(\"expm\",{Matrix:function(e){var t=e.size();if(2!==t.length||t[0]!==t[1])throw new RangeError(\"Matrix must be square (size: \"+S(t)+\")\");var t=t[0],r=function(r){for(let t=0;t<30;t++)for(let e=0;e<=t;e++){var n=t-e;if(function(e,t,r){let n=1;for(let e=2;e<=t;e++)n*=e;let i=n;for(let e=t+1;e<=2*t;e++)i*=e;var a=i*(2*t+1);return 8*Math.pow(e/Math.pow(2,r),2*t)*n*n/(i*a)}(r,e,n)<1e-15)return{q:e,j:n}}throw new Error(\"Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)\")}(function(n){var i=n.size()[0];let e=0;for(let r=0;r{let{typed:t,abs:o,add:s,multiply:u,map:r,sqrt:n,subtract:l,inv:c,size:f,max:p,identity:m}=e;return t(\"sqrtm\",{\"Array | Matrix\":function(i){var e=_(i)?i.size():T(i);switch(e.length){case 1:if(1===e[0])return r(i,n);throw new RangeError(\"Matrix must be square (size: \"+S(e)+\")\");case 2:if(e[0]!==e[1])throw new RangeError(\"Matrix must be square (size: \"+S(e)+\")\");{var a=i;let e,t=0,r=a,n=m(f(a));do{const a=r;if(r=u(.5,s(a,c(n))),n=u(.5,s(n,c(a))),1e-6<(e=p(o(l(r,a))))&&1e3<++t)throw new Error(\"computing square root of matrix: iterative method could not converge\")}while(1e-6{let{typed:t,schur:g,matrixFromColumns:y,matrix:x,multiply:b,range:v,concat:w,transpose:N,index:A,subset:E,add:S,subtract:M,identity:C,lusolve:T,abs:B}=e;return t(Dp,{\"Matrix, Matrix, Matrix\":n,\"Array, Matrix, Matrix\":function(e,t,r){return n(x(e),t,r)},\"Array, Array, Matrix\":function(e,t,r){return n(x(e),x(t),r)},\"Array, Matrix, Array\":function(e,t,r){return n(x(e),t,x(r))},\"Matrix, Array, Matrix\":function(e,t,r){return n(e,x(t),r)},\"Matrix, Array, Array\":function(e,t,r){return n(e,x(t),x(r))},\"Matrix, Matrix, Array\":function(e,t,r){return n(e,t,x(r))},\"Array, Array, Array\":function(e,t,r){return n(x(e),x(t),x(r)).toArray()}});function n(e,t,r){const n=t.size()[0],i=e.size()[0],a=g(e),o=a.T,s=a.U,u=g(b(-1,t)),l=u.T,c=u.U,f=b(b(N(s),r),c),p=v(0,i),m=[],h=(e,t)=>w(e,t,1),d=(e,t)=>w(e,t,0);for(let r=0;r{let{typed:t,matrix:r,identity:o,multiply:s,qr:u,norm:l,subtract:c}=e;return t(\"schur\",{Array:function(e){const t=n(r(e));return{U:t.U.valueOf(),T:t.T.valueOf()}},Matrix:n});function n(e){const t=e.size()[0];let r,n=e,i=o(t),a=0;do{r=n;const e=u(n),t=e.Q,o=e.R;if(n=s(o,t),i=s(i,t),100{let{typed:t,matrix:r,sylvester:n,multiply:i,transpose:a}=e;return t(\"lyap\",{\"Matrix, Matrix\":function(e,t){return n(e,a(e),i(-1,t))},\"Array, Matrix\":function(e,t){return n(r(e),a(r(e)),i(-1,t))},\"Matrix, Array\":function(e,t){return n(e,a(r(e)),r(i(-1,t)))},\"Array, Array\":function(e,t){return n(r(e),a(r(e)),r(i(-1,t))).toArray()}})}),qp=s(\"divide\",[\"typed\",\"matrix\",\"multiply\",\"equalScalar\",\"divideScalar\",\"inv\"],e=>{let{typed:t,matrix:r,multiply:n,equalScalar:i,divideScalar:a,inv:o}=e;const s=Aa({typed:t,equalScalar:i}),u=Ea({typed:t});return t(\"divide\",Fe({\"Array | Matrix, Array | Matrix\":function(e,t){return n(e,o(t))},\"DenseMatrix, any\":function(e,t){return u(e,t,a,!1)},\"SparseMatrix, any\":function(e,t){return s(e,t,a,!1)},\"Array, any\":function(e,t){return u(r(e),t,a,!1).valueOf()},\"any, Array | Matrix\":function(e,t){return n(e,o(t))}},a.signatures))}),Ip=\"distance\",kp=s(Ip,[\"typed\",\"addScalar\",\"subtractScalar\",\"divideScalar\",\"multiplyScalar\",\"deepEqual\",\"sqrt\",\"abs\"],e=>{let{typed:t,addScalar:l,subtractScalar:c,multiplyScalar:f,divideScalar:p,deepEqual:a,sqrt:m,abs:o}=e;return t(Ip,{\"Array, Array, Array\":function(e,t,r){if(2!==e.length||2!==t.length||2!==r.length)throw new TypeError(\"Invalid Arguments: Try again\");if(!s(e))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for first argument\");if(!s(t))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for second argument\");if(!s(r))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for third argument\");if(a(t,r))throw new TypeError(\"LinePoint1 should not be same with LinePoint2\");var n=c(r[1],t[1]),i=c(t[0],r[0]),t=c(f(r[0],t[1]),f(t[0],r[1]));return d(e[0],e[1],n,i,t)},\"Object, Object, Object\":function(e,t,r){if(2!==Object.keys(e).length||2!==Object.keys(t).length||2!==Object.keys(r).length)throw new TypeError(\"Invalid Arguments: Try again\");if(!s(e))throw new TypeError(\"Values of pointX and pointY should be numbers or BigNumbers\");if(!s(t))throw new TypeError(\"Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers\");if(!s(r))throw new TypeError(\"Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers\");if(a(h(t),h(r)))throw new TypeError(\"LinePoint1 should not be same with LinePoint2\");if(\"pointX\"in e&&\"pointY\"in e&&\"lineOnePtX\"in t&&\"lineOnePtY\"in t&&\"lineTwoPtX\"in r&&\"lineTwoPtY\"in r){const n=c(r.lineTwoPtY,t.lineOnePtY),a=c(t.lineOnePtX,r.lineTwoPtX),i=c(f(r.lineTwoPtX,t.lineOnePtY),f(t.lineOnePtX,r.lineTwoPtY));return d(e.pointX,e.pointY,n,a,i)}throw new TypeError(\"Key names do not match\")},\"Array, Array\":function(e,t){if(2===e.length&&3===t.length){if(!s(e))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for first argument\");if(n(t))return d(e[0],e[1],t[0],t[1],t[2]);throw new TypeError(\"Array with 3 numbers or BigNumbers expected for second argument\")}if(3===e.length&&6===t.length){if(!n(e))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for first argument\");if(u(t))return g(e[0],e[1],e[2],t[0],t[1],t[2],t[3],t[4],t[5]);throw new TypeError(\"Array with 6 numbers or BigNumbers expected for second argument\")}if(e.length===t.length&&02!==e.length||!r(e[0])||!r(e[1])))return}else{if(!(3===e[0].length&&r(e[0][0])&&r(e[0][1])&&r(e[0][2])))return;if(e.some(e=>3!==e.length||!r(e[0])||!r(e[1])||!r(e[2])))return}return 1}(e)){var i=e;const a=[];let r=[],n=[];for(let t=0;t{let{typed:t,config:y,abs:x,add:b,addScalar:v,matrix:i,multiply:w,multiplyScalar:N,divideScalar:A,subtract:E,smaller:S,equalScalar:M,flatten:r,isZero:C,isNumeric:m}=e;return t(\"intersect\",{\"Array, Array, Array\":n,\"Array, Array, Array, Array\":a,\"Matrix, Matrix, Matrix\":function(e,t,r){e=n(e.valueOf(),t.valueOf(),r.valueOf());return null===e?null:i(e)},\"Matrix, Matrix, Matrix, Matrix\":function(e,t,r,n){e=a(e.valueOf(),t.valueOf(),r.valueOf(),n.valueOf());return null===e?null:i(e)}});function n(e,t,r){if(e=T(e),t=T(t),r=T(r),!F(e))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for first argument\");if(!F(t))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for second argument\");if(4===(n=r).length&&m(n[0])&&m(n[1])&&m(n[2])&&m(n[3]))return n=e[0],i=e[1],e=e[2],a=t[0],o=t[1],t=t[2],s=r[0],u=r[1],l=r[2],r=r[3],c=N(n,s),s=N(a,s),f=N(i,u),u=N(o,u),p=N(e,l),l=N(t,l),r=E(E(E(r,c),f),p),s=E(E(E(v(v(s,u),l),c),f),p),u=A(r,s),[v(n,N(u,E(a,n))),v(i,N(u,E(o,i))),v(e,N(u,E(t,e)))];var n,i,a,o,s,u,l,c,f,p;throw new TypeError(\"Array with 4 numbers expected as third argument\")}function a(e,t,r,n){if(e=T(e),t=T(t),r=T(r),n=T(n),2===e.length){if(!B(e))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for first argument\");if(!B(t))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for second argument\");if(!B(r))throw new TypeError(\"Array with 2 numbers or BigNumbers expected for third argument\");if(B(n)){var i=t;var a=n;var o=e,s=r,i=E(o,i),a=E(s,a),u=E(N(i[0],a[1]),N(a[0],i[1]));if(C(u))return null;if(S(x(u),y.relTol))return null;var l=N(a[0],o[1]),c=N(a[1],o[0]),f=N(a[0],s[1]),a=N(a[1],s[0]),s=A(v(E(E(l,c),f),a),u);return b(w(i,s),o);return}throw new TypeError(\"Array with 2 numbers or BigNumbers expected for fourth argument\")}if(3!==e.length)throw new TypeError(\"Arrays with two or thee dimensional points expected\");if(!F(e))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for first argument\");if(!F(t))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for second argument\");if(!F(r))throw new TypeError(\"Array with 3 numbers or BigNumbers expected for third argument\");var p,m,h,d,g;{if(F(n))return l=e[0],c=e[1],f=e[2],a=t[0],u=t[1],i=t[2],s=r[0],o=r[1],e=r[2],t=n[0],r=n[1],n=n[2],p=D(l,s,t,s,c,o,r,o,f,e,n,e),m=D(t,s,a,l,r,o,u,c,n,e,i,f),d=D(l,s,a,l,c,o,u,c,f,e,i,f),h=D(t,s,t,s,r,o,r,o,n,e,n,e),g=D(a,l,a,l,u,c,u,c,i,f,i,f),d=E(N(p,m),N(d,h)),g=E(N(g,h),N(m,m)),C(g)?null:(d=A(d,g),g=A(v(p,N(d,m)),h),p=v(l,N(d,E(a,l))),m=v(c,N(d,E(u,c))),h=v(f,N(d,E(i,f))),a=v(s,N(g,E(t,s))),l=v(o,N(g,E(r,o))),u=v(e,N(g,E(n,e))),M(p,a)&&M(m,l)&&M(h,u)?[p,m,h]:null);throw new TypeError(\"Array with 3 numbers or BigNumbers expected for fourth argument\")}}function T(e){return 1===e.length?e[0]:1Array.isArray(e)&&1===e.length)?r(e):e}function B(e){return 2===e.length&&m(e[0])&&m(e[1])}function F(e){return 3===e.length&&m(e[0])&&m(e[1])&&m(e[2])}function D(e,t,r,n,i,a,o,s,u,l,c,f){e=N(E(e,t),E(r,n)),t=N(E(i,a),E(o,s)),r=N(E(u,l),E(c,f));return v(v(e,t),r)}}),Pp=s(\"sum\",[\"typed\",\"config\",\"add\",\"numeric\"],e=>{let{typed:t,config:n,add:i,numeric:a}=e;return t(\"sum\",{\"Array | Matrix\":r,\"Array | Matrix, number | BigNumber\":function(e,t){try{return ri(e,t,i)}catch(e){throw eu(e,\"sum\")}},\"...\":function(e){if(ei(e))throw new TypeError(\"Scalar values expected in function sum\");return r(e)}});function r(e){let r;return ti(e,function(t){try{r=void 0===r?t:i(r,t)}catch(e){throw eu(e,\"sum\",t)}}),r=\"string\"==typeof(r=void 0===r?a(0,n.number):r)?a(r,Ie(r,n)):r}}),Up=\"cumsum\",jp=s(Up,[\"typed\",\"add\",\"unaryPlus\"],e=>{let{typed:t,add:n,unaryPlus:i}=e;return t(Up,{Array:r,Matrix:function(e){return e.create(r(e.valueOf(),e.datatype()))},\"Array, number | BigNumber\":a,\"Matrix, number | BigNumber\":function(e,t){return e.create(a(e.valueOf(),t),e.datatype())},\"...\":function(e){if(ei(e))throw new TypeError(\"All values expected to be scalar in function cumsum\");return r(e)}});function r(e){try{return s(e)}catch(e){throw eu(e,Up)}}function s(t){if(0===t.length)return[];const r=[i(t[0])];for(let e=1;e=r.length)throw new En(t,r.length);try{return function e(t,r){let n,i,a;if(r<=0){const o=t[0][0];if(Array.isArray(o)){for(a=Kn(t),i=[],n=0;n{let{typed:t,add:i,divide:a}=e;return t(\"mean\",{\"Array | Matrix\":r,\"Array | Matrix, number | BigNumber\":function(e,t){try{var r=ri(e,t,i),n=Array.isArray(e)?T(e):e.size();return a(r,n[t])}catch(e){throw eu(e,\"mean\")}},\"...\":function(e){if(ei(e))throw new TypeError(\"Scalar values expected in function mean\");return r(e)}});function r(e){let r,n=0;if(ti(e,function(t){try{r=void 0===r?t:i(r,t),n++}catch(e){throw eu(e,\"mean\",t)}}),0===n)throw new Error(\"Cannot calculate the mean of an empty array\");return a(r,n)}}),$p=s(\"median\",[\"typed\",\"add\",\"divide\",\"compare\",\"partitionSelect\"],e=>{let{typed:t,add:r,divide:n,compare:a,partitionSelect:o}=e;function i(r){try{var e=(r=E(r.valueOf())).length;if(0===e)throw new Error(\"Cannot calculate median of an empty array\");if(e%2==0){var n=e/2-1,i=o(r,1+n);let t=r[n];for(let e=0;e{let{typed:t,abs:r,map:n,median:i,subtract:a}=e;return t(\"mad\",{\"Array | Matrix\":o,\"...\":o});function o(e){if(0===(e=E(e.valueOf())).length)throw new Error(\"Cannot calculate median absolute deviation (mad) of an empty array\");try{const t=i(e);return i(n(e,function(e){return r(a(e,t))}))}catch(e){throw e instanceof TypeError&&e.message.includes(\"median\")?new TypeError(e.message.replace(\"median\",\"mad\")):eu(e,\"mad\")}}}),Gp=\"unbiased\",Vp=\"variance\",Zp=s(Vp,[\"typed\",\"add\",\"subtract\",\"multiply\",\"divide\",\"mapSlices\",\"isNaN\"],e=>{let{typed:t,add:a,subtract:o,multiply:s,divide:u,mapSlices:n,isNaN:l}=e;return t(Vp,{\"Array | Matrix\":function(e){return i(e,Gp)},\"Array | Matrix, string\":i,\"Array | Matrix, number | BigNumber\":function(e,t){return r(e,t,Gp)},\"Array | Matrix, number | BigNumber, string\":r,\"...\":function(e){return i(e,Gp)}});function i(e,t){let r,n=0;if(0===e.length)throw new SyntaxError(\"Function variance requires one or more parameters (0 provided)\");if(ti(e,function(t){try{r=void 0===r?t:a(r,t),n++}catch(e){throw eu(e,\"variance\",t)}}),0===n)throw new Error(\"Cannot calculate variance of an empty array\");const i=u(r,n);if(r=void 0,ti(e,function(e){e=o(e,i);r=void 0===r?s(e,e):a(r,s(e,e))}),l(r))return r;switch(t){case\"uncorrected\":return u(r,n);case\"biased\":return u(r,n+1);case\"unbiased\":{const e=Q(r)?r.mul(0):0;return 1===n?e:u(r,n-1)}default:throw new Error('Unknown normalization \"'+t+'\". Choose \"unbiased\" (default), \"uncorrected\", or \"biased\".')}}function r(e,t,r){try{if(0===e.length)throw new SyntaxError(\"Function variance requires one or more parameters (0 provided)\");return n(e,t,e=>i(e,r))}catch(e){throw eu(e,\"variance\")}}}),Wp=\"quantileSeq\",Yp=s(Wp,[\"typed\",\"?bignumber\",\"add\",\"subtract\",\"divide\",\"multiply\",\"partitionSelect\",\"compare\",\"isInteger\",\"smaller\",\"smallerEq\",\"larger\",\"mapSlices\"],e=>{let{typed:t,bignumber:o,add:l,subtract:c,divide:s,multiply:f,partitionSelect:p,compare:m,isInteger:h,smaller:u,smallerEq:d,larger:g,mapSlices:a}=e;return t(Wp,{\"Array | Matrix, number | BigNumber\":(e,t)=>y(e,t,!1),\"Array | Matrix, number | BigNumber, number\":(e,t,r)=>i(e,t,!1,r,y),\"Array | Matrix, number | BigNumber, boolean\":y,\"Array | Matrix, number | BigNumber, boolean, number\":(e,t,r,n)=>i(e,t,r,n,y),\"Array | Matrix, Array | Matrix\":(e,t)=>x(e,t,!1),\"Array | Matrix, Array | Matrix, number\":(e,t,r)=>i(e,t,!1,r,x),\"Array | Matrix, Array | Matrix, boolean\":x,\"Array | Matrix, Array | Matrix, boolean, number\":(e,t,r,n)=>i(e,t,r,n,x)});function i(e,t,r,n,i){return a(e,n,e=>i(e,t,r))}function y(t,r,n){let i;var a=t.valueOf();if(u(r,0))throw new Error(\"N/prob must be non-negative\");if(d(r,1))return A(r)?b(a,r,n):o(b(a,r,n));if(g(r,1)){if(!h(r))throw new Error(\"N must be a positive integer\");if(g(r,4294967295))throw new Error(\"N must be less than or equal to 2^32-1, as that is the maximum length of an Array\");const t=l(r,1);i=[];for(let e=0;u(e,r);e++){const r=s(e+1,t);i.push(b(a,r,n))}return A(r)?i:o(i)}}function x(e,t,r){const n=e.valueOf(),i=t.valueOf(),a=[];for(let e=0;e{let{typed:t,map:r,sqrt:n,variance:i}=e;return t(\"std\",{\"Array | Matrix\":a,\"Array | Matrix, string\":a,\"Array | Matrix, number | BigNumber\":a,\"Array | Matrix, number | BigNumber, string\":a,\"...\":function(e){return a(e)}});function a(e,t){if(0===e.length)throw new SyntaxError(\"Function std requires one or more parameters (0 provided)\");try{const e=i.apply(null,arguments);return $(e)?r(e,n):n(e)}catch(e){throw e instanceof TypeError&&e.message.includes(\" variance\")?new TypeError(e.message.replace(\" variance\",\" std\")):e}}}),Xp=s(\"corr\",[\"typed\",\"matrix\",\"mean\",\"sqrt\",\"sum\",\"add\",\"subtract\",\"multiply\",\"pow\",\"divide\"],e=>{let{typed:t,matrix:r,sqrt:s,sum:u,add:l,subtract:c,multiply:f,pow:p,divide:m}=e;return t(\"corr\",{\"Array, Array\":n,\"Matrix, Matrix\":function(e,t){e=n(e.toArray(),t.toArray());return Array.isArray(e)?r(e):e}});function n(t,r){const n=[];if(Array.isArray(t[0])&&Array.isArray(r[0])){if(t.length!==r.length)throw new SyntaxError(\"Dimension mismatch. Array A and B must have the same length.\");for(let e=0;el(e,f(t,n[r])),0),e=u(e.map(e=>p(e,2))),o=u(n.map(e=>p(e,2))),a=c(f(t,a),f(r,i)),e=s(f(c(f(t,e),p(r,2)),c(f(t,o),p(i,2))));return m(a,e)}});function Qp(e,t){if(t>1;return Qp(e,r)*Qp(1+r,t)}function Kp(t,r){if(!v(t)||t<0)throw new TypeError(\"Positive integer value expected in function combinations\");if(!v(r)||r<0)throw new TypeError(\"Positive integer value expected in function combinations\");if(t{let t=e[\"typed\"];return t(em,{\"number, number\":Kp,\"BigNumber, BigNumber\":function(e,t){const r=e.constructor;let n,i;const a=e.minus(t),o=new r(1);if(!rm(e)||!rm(t))throw new TypeError(\"Positive integer value expected in function combinations\");if(t.gt(e))throw new TypeError(\"k must be less than n in function combinations\");if(n=o,t.lt(a))for(i=o;i.lte(a);i=i.plus(o))n=n.times(t.plus(i)).dividedBy(i);else for(i=o;i.lte(t);i=i.plus(o))n=n.times(a.plus(i)).dividedBy(i);return n}})});function rm(e){return e.isInteger()&&e.gte(0)}const nm=\"combinationsWithRep\",im=s(nm,[\"typed\"],e=>{let t=e[\"typed\"];return t(nm,{\"number, number\":function(e,t){if(!v(e)||e<0)throw new TypeError(\"Positive integer value expected in function combinationsWithRep\");if(!v(t)||t<0)throw new TypeError(\"Positive integer value expected in function combinationsWithRep\");if(e<1)throw new TypeError(\"k must be less than or equal to n + k - 1\");return t{let{typed:t,config:s,BigNumber:u,Complex:l}=e;return t(\"gamma\",{number:om,Complex:function e(t){if(0===t.im)return om(t.re);if(t.re<.5){const r=new l(1-t.re,-t.im),n=new l(Math.PI*t.re,Math.PI*t.im);return new l(Math.PI).div(n.sin()).div(e(r))}t=new l(t.re-1,t.im);let r=new l(um[0],0);for(let e=1;e{let{Complex:u,typed:t}=e;const l=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t(\"lgamma\",{number:fm,Complex:function e(t){if(t.isNaN())return new u(NaN,NaN);if(0===t.im)return new u(fm(t.re),0);if(7<=t.re||7<=Math.abs(t.im))return a(t);if(t.re<=.1){r=6.283185307179586;const a=(!0^(0<(n=t.im)||!(n<0)&&1/n==1/0)?-r:r)*Math.floor(.5*t.re+.25),o=t.mul(Math.PI).sin().log(),i=e(new u(1-t.re,-t.im));return new u(1.1447298858494002,a).sub(o).sub(i)}return 0<=t.im?o(t):o(t.conjugate()).conjugate();var r,n},BigNumber:function(){throw new Error(\"mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber\")}});function a(e){const t=e.sub(.5).mul(e.log()).sub(e).add(lm),r=new u(1,0).div(e),n=r.div(e);let i=l[0],a=l[1];var o=2*n.re,s=n.re*n.re+n.im*n.im;for(let e=2;e<8;e++){const u=a;a=-s*i+l[e],i=o*i+u}e=r.mul(n.mul(i).add(a));return t.add(e)}function o(e){let t=0,r=0,n=e;for(e=e.add(1);e.re<=7;){const u=(n=n.mul(e)).im<0?1:0;0!=u&&0===r&&t++,r=u,e=e.add(1)}return a(e).sub(n.log()).sub(new u(0,2*t*Math.PI*1))}}),hm=\"factorial\",dm=s(hm,[\"typed\",\"gamma\"],e=>{let{typed:t,gamma:r}=e;return t(hm,{number:function(e){if(e<0)throw new Error(\"Value must be non-negative\");return r(e+1)},BigNumber:function(e){if(e.isNegative())throw new Error(\"Value must be non-negative\");return r(e.plus(1))},\"Array | Matrix\":t.referToSelf(t=>e=>le(e,t))})}),gm=\"kldivergence\",ym=s(gm,[\"typed\",\"matrix\",\"divide\",\"sum\",\"multiply\",\"map\",\"dotDivide\",\"log\",\"isNumeric\"],e=>{let{typed:t,matrix:r,divide:i,sum:a,multiply:o,map:s,dotDivide:u,log:l,isNumeric:c}=e;return t(gm,{\"Array, Array\":function(e,t){return n(r(e),r(t))},\"Matrix, Array\":function(e,t){return n(e,r(t))},\"Array, Matrix\":function(e,t){return n(r(e),t)},\"Matrix, Matrix\":n});function n(e,t){var r=t.size().length,n=e.size().length;if(1l(e))));return c(e)?e:Number.NaN}}),xm=\"multinomial\",bm=s(xm,[\"typed\",\"add\",\"divide\",\"multiply\",\"factorial\",\"isInteger\",\"isPositive\"],e=>{let{typed:t,add:n,divide:i,multiply:a,factorial:o,isInteger:s,isPositive:u}=e;return t(xm,{\"Array | Matrix\":function(e){let t=0,r=1;return ti(e,function(e){if(!s(e)||!u(e))throw new TypeError(\"Positive integer value expected in function multinomial\");t=n(t,e),r=a(r,o(e))}),i(o(t),r)}})}),vm=\"permutations\",wm=s(vm,[\"typed\",\"factorial\"],e=>{let{typed:t,factorial:r}=e;return t(vm,{\"number | BigNumber\":r,\"number, number\":function(e,t){if(!v(e)||e<0)throw new TypeError(\"Positive integer value expected in function permutations\");if(!v(t)||t<0)throw new TypeError(\"Positive integer value expected in function permutations\");if(e{let{typed:t,config:r,on:n}=e,c=Sm(r.randomSeed);return n&&n(\"config\",function(e,t){e.randomSeed!==t.randomSeed&&(c=Sm(e.randomSeed))}),t(Mm,{\"Array | Matrix\":function(e){return i(e,{})},\"Array | Matrix, Object\":i,\"Array | Matrix, number\":function(e,t){return i(e,{number:t})},\"Array | Matrix, Array | Matrix\":function(e,t){return i(e,{weights:t})},\"Array | Matrix, Array | Matrix, number\":function(e,t,r){return i(e,{number:r,weights:t})},\"Array | Matrix, number, Array | Matrix\":function(e,t,r){return i(e,{number:t,weights:r})}});function i(n,e){let{number:t,weights:i,elementWise:r=!0}=e;e=void 0===t;e&&(t=1);const a=_(n)?n.create:_(i)?i.create:null;n=n.valueOf(),i=i&&i.valueOf(),!0===r&&(n=E(n),i=E(i));let o=0;if(void 0!==i){if(i.length!==n.length)throw new Error(\"Weights must have the same length as possibles\");for(let e=0,t=i.length;e{let{typed:t,config:r,on:n}=e,i=Sm(r.randomSeed);return n&&n(\"config\",function(e,t){e.randomSeed!==t.randomSeed&&(i=Sm(e.randomSeed))}),t(\"random\",{\"\":()=>o(0,1),number:e=>o(0,e),\"number, number\":(e,t)=>o(e,t),\"Array | Matrix\":e=>a(e,0,1),\"Array | Matrix, number\":(e,t)=>a(e,0,t),\"Array | Matrix, number, number\":(e,t,r)=>a(e,t,r)});function a(e,t,r){var n=Tm(e.valueOf(),()=>o(t,r));return _(e)?e.create(n,\"number\"):n}function o(e,t){return e+i()*(t-e)}}),Fm=\"randomInt\",Dm=s(Fm,[\"typed\",\"config\",\"log2\",\"?on\"],e=>{let{typed:t,config:r,log2:a,on:n}=e,o=Sm(r.randomSeed);return n&&n(\"config\",function(e,t){e.randomSeed!==t.randomSeed&&(o=Sm(e.randomSeed))}),t(Fm,{\"\":()=>s(0,2),number:e=>s(0,e),\"number, number\":(e,t)=>s(e,t),bigint:e=>u(0n,e),\"bigint, bigint\":u,\"Array | Matrix\":e=>i(e,0,1),\"Array | Matrix, number\":(e,t)=>i(e,0,t),\"Array | Matrix, number, number\":(e,t,r)=>i(e,t,r)});function i(e,t,r){var n=Tm(e.valueOf(),()=>s(t,r));return _(e)?e.create(n,\"number\"):n}function s(e,t){return Math.floor(e+o()*(t-e))}function u(e,t){var r=t-e;if(r<=2n**30n)return e+BigInt(s(0,Number(r)));var n=a(r);let i=r;for(;i>=r;){i=0n;for(let e=0;e{let{typed:t,addScalar:u,multiplyScalar:l,isNegative:c,isInteger:f,number:p,bignumber:m,larger:h}=e;const d=[],g=[];return t(Om,{\"number | BigNumber, number | BigNumber\":function(e,r){if(!f(e)||c(e)||!f(r)||c(r))throw new TypeError(\"Non-negative integer value expected in function stirlingS2\");if(h(r,e))throw new TypeError(\"k must be less than or equal to n in function stirlingS2\");const n=!(A(e)&&A(r)),i=n?g:d,a=n?m:p,o=p(e),s=p(r);if(i[o]&&i[o].length>s)return i[o][s];for(let t=0;t<=o;++t)if(i[t]||(i[t]=[a(0===t?1:0)]),0!==t){const r=i[t],n=i[t-1];for(let e=r.length;e<=t&&e<=s;++e)r[e]=e===t?1:u(l(a(e),n[e]),n[e-1])}return i[o][s]}})}),zm=\"bellNumbers\",qm=s(zm,[\"typed\",\"addScalar\",\"isNegative\",\"isInteger\",\"stirlingS2\"],e=>{let{typed:t,addScalar:n,isNegative:i,isInteger:a,stirlingS2:o}=e;return t(zm,{\"number | BigNumber\":function(t){if(!a(t)||i(t))throw new TypeError(\"Non-negative integer value expected in function bellNumbers\");let r=0;for(let e=0;e<=t;e++)r=n(r,o(t,e));return r}})}),Im=\"catalan\",km=s(Im,[\"typed\",\"addScalar\",\"divideScalar\",\"multiplyScalar\",\"combinations\",\"isNegative\",\"isInteger\"],e=>{let{typed:t,addScalar:r,divideScalar:n,multiplyScalar:i,combinations:a,isNegative:o,isInteger:s}=e;return t(Im,{\"number | BigNumber\":function(e){if(!s(e)||o(e))throw new TypeError(\"Non-negative integer value expected in function catalan\");return n(a(i(e,2),e),r(e,1))}})}),Rm=\"composition\",Pm=s(Rm,[\"typed\",\"addScalar\",\"combinations\",\"isNegative\",\"isPositive\",\"isInteger\",\"larger\"],e=>{let{typed:t,addScalar:r,combinations:n,isPositive:i,isInteger:a,larger:o}=e;return t(Rm,{\"number | BigNumber, number | BigNumber\":function(e,t){if(!(a(e)&&i(e)&&a(t)&&i(t)))throw new TypeError(\"Positive integer value expected in function composition\");if(o(t,e))throw new TypeError(\"k must be less than or equal to n in function composition\");return n(r(e,-1),r(t,-1))}})}),Um=\"leafCount\",jm=s(Um,[\"parse\",\"typed\"],e=>{let t=e[\"typed\"];return t(Um,{Node:function t(e){let r=0;return e.forEach(e=>{r+=t(e)}),r||1}})});function Lm(e){return ae(e)||oe(e)&&e.isUnary()&&ae(e.args[0])}function $m(e){return!!ae(e)||!(!Ae(e)&&!oe(e)||!e.args.every($m))||!(!Me(e)||!$m(e.content))}const Hm=s(\"simplifyUtil\",[\"FunctionNode\",\"OperatorNode\",\"SymbolNode\"],e=>{let{FunctionNode:r,OperatorNode:n,SymbolNode:i}=e;const a=\"defaultF\",o={add:{trivial:!0,total:!0,commutative:!0,associative:!0},unaryPlus:{trivial:!0,total:!0,commutative:!0,associative:!0},subtract:{trivial:!1,total:!0,commutative:!1,associative:!1},multiply:{trivial:!0,total:!0,commutative:!0,associative:!0},divide:{trivial:!1,total:!0,commutative:!1,associative:!1},paren:{trivial:!0,total:!0,commutative:!0,associative:!1},defaultF:{trivial:!1,total:!0,commutative:!1,associative:!1}};function t(e,t){let r=2{let{typed:t,parse:l,equal:o,resolve:r,simplifyConstant:n,simplifyCore:i,AccessorNode:s,ArrayNode:u,ConstantNode:c,FunctionNode:f,IndexNode:p,ObjectNode:m,OperatorNode:h,ParenthesisNode:d,SymbolNode:g,replacer:y}=e;const{hasProperty:x,isCommutative:b,isAssociative:v,mergeContext:w,flatten:N,unflattenr:A,unflattenl:E,createMakeNodeFunction:S,defaultContext:a,realContext:M,positiveContext:C}=Hm({FunctionNode:f,OperatorNode:h,SymbolNode:g}),T=(t.addConversion({from:\"Object\",to:\"Map\",convert:U}),t(\"simplify\",{Node:O,\"Node, Map\":(e,t)=>O(e,!1,t),\"Node, Map, Object\":(e,t,r)=>O(e,!1,t,r),\"Node, Array\":O,\"Node, Array, Map\":O,\"Node, Array, Map, Object\":O}));function B(e){return e.transform(function(e){return Me(e)?B(e.content):e})}t.removeConversion({from:\"Object\",to:\"Map\",convert:U}),T.defaultContext=a,T.realContext=M,T.positiveContext=C;const I={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};T.rules=[i,{l:\"log(e)\",r:\"1\"},{s:\"n-n1 -> n+-n1\",assuming:{subtract:{total:!0}}},{s:\"n-n -> 0\",assuming:{subtract:{total:!1}}},{s:\"-(cl*v) -> v * (-cl)\",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:\"-(cl*v) -> (-cl) * v\",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:\"-(v*cl) -> v * (-cl)\",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:\"-(n1/n2)\",r:\"-n1/n2\"},{l:\"-v\",r:\"v * (-1)\"},{l:\"(n1 + n2)*(-1)\",r:\"n1*(-1) + n2*(-1)\",repeat:!0},{l:\"n/n1^n2\",r:\"n*n1^-n2\"},{l:\"n/n1\",r:\"n*n1^-1\"},{s:\"(n1*n2)^n3 -> n1^n3 * n2^n3\",assuming:{multiply:{commutative:!0}}},{s:\"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)\",assuming:{multiply:{commutative:!1}}},{s:\"(n ^ n1) ^ n2 -> n ^ (n1 * n2)\",assuming:{divide:{total:!0}}},{l:\" vd * ( vd * n1 + n2)\",r:\"vd^2 * n1 + vd * n2\"},{s:\" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2\",assuming:{divide:{total:!0}}},{s:\"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2\",assuming:{divide:{total:!0}}},{s:\"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2\",assuming:{divide:{total:!0}}},{l:\"n*n\",r:\"n^2\"},{s:\"n * n^n1 -> n^(n1+1)\",assuming:{divide:{total:!0}}},{s:\"n^n1 * n^n2 -> n^(n1+n2)\",assuming:{divide:{total:!0}}},n,{s:\"n+n -> 2*n\",assuming:{add:{total:!0}}},{l:\"n+-n\",r:\"0\"},{l:\"vd*n + vd\",r:\"vd*(n+1)\"},{l:\"n3*n1 + n3*n2\",r:\"n3*(n1+n2)\"},{l:\"n3^(-n4)*n1 + n3 * n2\",r:\"n3^(-n4)*(n1 + n3^(n4+1) *n2)\"},{l:\"n3^(-n4)*n1 + n3^n5 * n2\",r:\"n3^(-n4)*(n1 + n3^(n4+n5)*n2)\"},{s:\"n*vd + vd -> (n+1)*vd\",assuming:{multiply:{commutative:!1}}},{s:\"vd + n*vd -> (1+n)*vd\",assuming:{multiply:{commutative:!1}}},{s:\"n1*n3 + n2*n3 -> (n1+n2)*n3\",assuming:{multiply:{commutative:!1}}},{s:\"n^n1 * n -> n^(n1+1)\",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:\"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)\",assuming:{multiply:{commutative:!1}}},{s:\"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)\",assuming:{multiply:{commutative:!1}}},{l:\"n*cd + cd\",r:\"(n+1)*cd\"},{s:\"cd*n + cd -> cd*(n+1)\",assuming:{multiply:{commutative:!1}}},{s:\"cd + cd*n -> cd*(1+n)\",assuming:{multiply:{commutative:!1}}},n,{s:\"(-n)*n1 -> -(n*n1)\",assuming:{subtract:{total:!0}}},{s:\"n1*(-n) -> -(n1*n)\",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:\"ce+ve -> ve+ce\",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:\"vd*cd -> cd*vd\",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:\"n+-n1\",r:\"n-n1\"},{l:\"n+-(n1)\",r:\"n-(n1)\"},{s:\"n*(n1^-1) -> n/n1\",assuming:{multiply:{commutative:!0}}},{s:\"n*n1^-n2 -> n/n1^n2\",assuming:{multiply:{commutative:!0}}},{s:\"n^-1 -> 1/n\",assuming:{multiply:{commutative:!0}}},{l:\"n^1\",r:\"n\"},{s:\"n*(n1/n2) -> (n*n1)/n2\",assuming:{multiply:{associative:!0}}},{s:\"n-(n1+n2) -> n-n1-n2\",assuming:{addition:{associative:!0,commutative:!0}}},{l:\"1*n\",r:\"n\",imposeContext:{multiply:{commutative:!0}}},{s:\"n1/(n2/n3) -> (n1*n3)/n2\",assuming:{multiply:{associative:!0}}},{l:\"n1/(-n2)\",r:\"-n1/n2\"}];let F=0;function D(){return new g(\"_p\"+F++)}function O(e,n){var t=2\");if(2!==r.length)throw SyntaxError(\"Could not parse rule: \"+t.s);n.l=r[0],n.r=r[1]}else n.l=t.l,n.r=t.r;n.l=B(l(n.l)),n.r=B(l(n.r));for(const r of[\"imposeContext\",\"repeat\",\"assuming\"])r in t&&(n[r]=t[r]);if(t.evaluate&&(n.evaluate=l(t.evaluate)),v(n.l,r)){const t=!b(n.l,r);let e;t&&(e=D());const i=S(n.l),a=D();n.expanded={},n.expanded.l=i([n.l,a]),N(n.expanded.l,r),A(n.expanded.l,r),n.expanded.r=i([n.r,a]),t&&(n.expandedNC1={},n.expandedNC1.l=i([e,n.l]),n.expandedNC1.r=i([e,n.r]),n.expandedNC2={},n.expandedNC2.l=i([e,n.expanded.l]),n.expandedNC2.r=i([e,n.expanded.r]))}return n}(t,i);break;case\"function\":e=t;break;default:throw TypeError(\"Unsupported type of rule: \"+o)}a.push(e)}return a}(n||T.rules,i.context);let o=r(e,t);const s={};let u=(o=B(o)).toString({parenthesis:\"all\"});for(;!s[u];){s[u]=!0,F=0;let r=u;a&&console.log(\"Working on: \",u);for(let t=0;t \"+n[t].r.toString())),a){const n=o.toString({parenthesis:\"all\"});n!==r&&(console.log(\"Applying\",e,\"produced\",n),r=n)}E(o,i.context)}u=o.toString({parenthesis:\"all\"})}return o}function _(t,r,n){let i=t;if(t)for(let e=0;e2 commutative non-associative rule arguments not yet implemented\");const e=q(r.args[0],n.args[1],i);if(0===e.length)return[];const a=q(r.args[1],n.args[0],i);if(0===a.length)return[];t=[e,a]}a=function(e){if(0===e.length)return e;const t=e.reduce(R),r=[],n={};for(let e=0;e{let{typed:t,config:n,mathWithTransform:h,matrix:d,fraction:i,bignumber:a,AccessorNode:g,ArrayNode:y,ConstantNode:x,FunctionNode:b,IndexNode:v,ObjectNode:w,OperatorNode:o,SymbolNode:r}=e;const{isCommutative:N,isAssociative:A,allChildren:E,createMakeNodeFunction:S}=Hm({FunctionNode:b,OperatorNode:o,SymbolNode:r}),M=t(\"simplifyConstant\",{Node:e=>T(D(e,{})),\"Node, Object\":function(e,t){return T(D(e,t))}});function s(e){return re(e)?e.valueOf():e instanceof Array?e.map(s):_(e)?d(s(e.valueOf())):e}function C(t,r,n){try{return h[t].apply(null,r)}catch(e){return r=r.map(s),B(h[t].apply(null,r),n)}}const u=t({Fraction:function(e){var t=e=>(\"BigNumber\"===n.number&&a?a:Number)(e),r=e.s*e.n,r=r<0n?new o(\"-\",\"unaryMinus\",[new x(-t(r))]):new x(t(r));return 1n===e.d?r:new o(\"/\",\"divide\",[r,new x(t(e.d))])},number:function(e){return e<0?c(new x(-e)):new x(e)},BigNumber:function(e){return e<0?c(new x(-e)):new x(e)},bigint:function(e){return e<0n?c(new x(-e)):new x(e)},Complex:function(e){throw new Error(\"Cannot convert Complex number to Node\")},string:function(e){return new x(e)},Matrix:function(e){return new y(e.valueOf().map(e=>u(e)))}});function T(e){return O(e)?e:u(e)}function l(e,t){if(t&&!1!==t.exactFractions&&isFinite(e)&&i){const r=i(e),n=t&&\"number\"==typeof t.fractionsLimit?t.fractionsLimit:1/0;if(r.valueOf()===e&&r.n{if(!O(e)){const n=t.pop();if(O(n))return[n,e];try{return t.push(C(r,[n,e],i)),t}catch(e){t.push(n)}}t.push(T(t.pop()));t=1===t.length?t[0]:n(t);return[n([t,T(e)])]},[t]);return 1===e.length?e[0]:n([e[0],u(e[1])])}function D(r,n){switch(r.type){case\"SymbolNode\":return r;case\"ConstantNode\":switch(typeof r.value){case\"number\":case\"bigint\":return B(r.value,n);case\"string\":return r.value;default:if(!isNaN(r.value))return B(r.value,n)}return r;case\"FunctionNode\":if(h[r.name]&&h[r.name].rawArgs)return r;if(![\"add\",\"multiply\"].includes(r.name)){const o=r.args.map(e=>D(e,n));if(!o.some(O))try{return C(r.name,o,n)}catch(r){}if(\"size\"===r.name&&1===o.length&&ye(o[0])){const r=[];let e=o[0];for(;ye(e);)r.push(e.items.length),e=e.items[0];return d(r)}return new b(r.name,o.map(T))}case\"OperatorNode\":{var i=r.fn.toString();let t,e;const s=S(r);if(oe(r)&&r.isUnary())t=[D(r.args[0],n)],e=O(t[0])?s(t):C(i,t,n);else if(A(r,n.context))if(t=(t=E(r,n.context)).map(e=>D(e,n)),N(i,n.context)){const r=[],u=[];for(let e=0;eD(e,n)),e=F(i,t,s,n);return e}case\"ParenthesisNode\":return D(r.content,n);case\"AccessorNode\":var e=D(r.object,n),t=D(r.index,n),a=n;if(!Ee(t))return new g(T(e),T(t));if(ye(e)||_(e)){const l=Array.from(t.dimensions);for(;0D(e,n));return p.some(O)?new y(p.map(T)):d(p)}case\"IndexNode\":return new v(r.dimensions.map(e=>M(e,n)));case\"ObjectNode\":{const m={};for(const h in r.properties)m[h]=M(r.properties[h],n);return new w(m)}default:throw new Error(\"Unimplemented node type in simplifyConstant: \"+r.type)}}return M}),Zm=\"simplifyCore\",Wm=s(Zm,[\"typed\",\"parse\",\"equal\",\"isZero\",\"add\",\"subtract\",\"multiply\",\"divide\",\"pow\",\"AccessorNode\",\"ArrayNode\",\"ConstantNode\",\"FunctionNode\",\"IndexNode\",\"ObjectNode\",\"OperatorNode\",\"ParenthesisNode\",\"SymbolNode\"],e=>{let{typed:t,equal:a,isZero:o,AccessorNode:s,ArrayNode:u,ConstantNode:r,FunctionNode:l,IndexNode:c,ObjectNode:f,OperatorNode:p,SymbolNode:n}=e;const m=new r(0),h=new r(1),d=new r(!0),g=new r(!1);function y(e){return oe(e)&&[\"and\",\"not\",\"or\"].includes(e.op)}const{hasProperty:x,isCommutative:b}=Hm({FunctionNode:l,OperatorNode:p,SymbolNode:n});function v(n){let i=1{1===++r&&(t=v(e,i))}),1===r)return t}let r=n;if(Ae(r)){const n=function(e){var t=\"OperatorNode:\"+e;for(const e of mf)if(t in e)return e[t].op;return null}(r.name);if(!n)return new l(v(r.fn),r.args.map(e=>v(e,i)));if(2v(e,i)));if(ye(r))return new u(r.items.map(e=>v(e,i)));if(ge(r))return new s(v(r.object,i),v(r.index,i));if(Ee(r))return new c(r.dimensions.map(e=>v(e,i)));if(Se(r)){const n={};for(const t in r.properties)n[t]=v(r.properties[t],i);return new f(n)}return r}return t(Zm,{Node:v,\"Node,Object\":v})}),Ym=s(\"resolve\",[\"typed\",\"parse\",\"ConstantNode\",\"FunctionNode\",\"OperatorNode\",\"ParenthesisNode\"],e=>{let{typed:t,parse:n,ConstantNode:i,FunctionNode:a,OperatorNode:o,ParenthesisNode:s}=e;function u(e,t){let r=2u(e,t,r))}return t(\"resolve\",{Node:u,\"Node, Map | null | undefined\":u,\"Node, Object\":(e,t)=>u(e,U(t)),\"Array | Matrix\":t.referToSelf(t=>e=>e.map(e=>t(e))),\"Array | Matrix, null | undefined\":t.referToSelf(t=>e=>e.map(e=>t(e))),\"Array, Object\":t.referTo(\"Array,Map\",r=>(e,t)=>r(e,U(t))),\"Matrix, Object\":t.referTo(\"Matrix,Map\",r=>(e,t)=>r(e,U(t))),\"Array | Matrix, Map\":t.referToSelf(r=>(e,t)=>e.map(e=>r(e,t)))})}),Jm=\"symbolicEqual\",Xm=s(Jm,[\"parse\",\"simplify\",\"typed\",\"OperatorNode\"],e=>{let{simplify:n,typed:t,OperatorNode:i}=e;function r(e,t){var r=2{let{typed:t,config:r,parse:n,simplify:o,equal:l,isZero:c,numeric:i,ConstantNode:a,FunctionNode:f,OperatorNode:p,ParenthesisNode:s,SymbolNode:m}=e;function u(e,t){var r=2u(e,h(t)),\"Node, string, Object\":(e,t,r)=>u(e,h(t),r)}),g=(d._simplify=!0,d.toTex=function(e){return g.apply(null,e.args)},t(\"_derivTex\",{\"Node, SymbolNode\":function(e,t){return ae(e)&&\"string\"===K(e.value)?g(n(e.value).toString(),t.toString(),1):g(e.toTex(),t.toString(),1)},\"Node, ConstantNode\":function(e,t){if(\"string\"===K(t.value))return g(e,n(t.value));throw new Error(\"The second parameter to 'derivative' is a non-string constant\")},\"Node, SymbolNode, ConstantNode\":function(e,t,r){return g(e.toString(),t.name,r.value)},\"string, string, number\":function(e,t,r){return(1===r?\"{d\\\\over d\"+t+\"}\":\"{d^{\"+r+\"}\\\\over d\"+t+\"^{\"+r+\"}}\")+`\\\\left[${e}\\\\right]`}})),y=t(\"_isConst\",{\"function, ConstantNode, string\":function(){return!0},\"function, SymbolNode, string\":function(e,t,r){return t.name!==r},\"function, ParenthesisNode, string\":function(e,t,r){return e(t.content,r)},\"function, FunctionAssignmentNode, string\":function(e,t,r){return!t.params.includes(r)||e(t.expr,r)},\"function, FunctionNode | OperatorNode, string\":function(t,e,r){return e.args.every(e=>t(e,r))}}),x=t(\"_derivative\",{\"ConstantNode, function\":function(){return b(0)},\"SymbolNode, function\":function(e,t){return t(e)?b(0):b(1)},\"ParenthesisNode, function\":function(e,t){return new s(x(e.content,t))},\"FunctionAssignmentNode, function\":function(e,t){return t(e)?b(0):x(e.expr,t)},\"FunctionNode, function\":function(e,t){if(t(e))return b(0);const r=e.args[0];let n,i,a,o,s=!1,u=!1;switch(e.name){case\"cbrt\":s=!0,i=new p(\"*\",\"multiply\",[b(3),new p(\"^\",\"pow\",[r,new p(\"/\",\"divide\",[b(2),b(3)])])]);break;case\"sqrt\":case\"nthRoot\":if(1===e.args.length)s=!0,i=new p(\"*\",\"multiply\",[b(2),new f(\"sqrt\",[r])]);else if(2===e.args.length)return n=new p(\"/\",\"divide\",[b(1),e.args[1]]),x(new p(\"^\",\"pow\",[r,n]),t);break;case\"log10\":n=b(10);case\"log\":if(n||1!==e.args.length){if(1===e.args.length&&n||2===e.args.length&&t(e.args[1]))i=new p(\"*\",\"multiply\",[r.clone(),new f(\"log\",[n||e.args[1]])]),s=!0;else if(2===e.args.length)return x(new p(\"/\",\"divide\",[new f(\"log\",[r]),new f(\"log\",[e.args[1]])]),t)}else i=r.clone(),s=!0;break;case\"pow\":if(2===e.args.length)return x(new p(\"^\",\"pow\",[r,e.args[1]]),t);break;case\"exp\":i=new f(\"exp\",[r.clone()]);break;case\"sin\":i=new f(\"cos\",[r.clone()]);break;case\"cos\":i=new p(\"-\",\"unaryMinus\",[new f(\"sin\",[r.clone()])]);break;case\"tan\":i=new p(\"^\",\"pow\",[new f(\"sec\",[r.clone()]),b(2)]);break;case\"sec\":i=new p(\"*\",\"multiply\",[e,new f(\"tan\",[r.clone()])]);break;case\"csc\":u=!0,i=new p(\"*\",\"multiply\",[e,new f(\"cot\",[r.clone()])]);break;case\"cot\":u=!0,i=new p(\"^\",\"pow\",[new f(\"csc\",[r.clone()]),b(2)]);break;case\"asin\":s=!0,i=new f(\"sqrt\",[new p(\"-\",\"subtract\",[b(1),new p(\"^\",\"pow\",[r.clone(),b(2)])])]);break;case\"acos\":s=!0,u=!0,i=new f(\"sqrt\",[new p(\"-\",\"subtract\",[b(1),new p(\"^\",\"pow\",[r.clone(),b(2)])])]);break;case\"atan\":s=!0,i=new p(\"+\",\"add\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)]);break;case\"asec\":s=!0,i=new p(\"*\",\"multiply\",[new f(\"abs\",[r.clone()]),new f(\"sqrt\",[new p(\"-\",\"subtract\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)])])]);break;case\"acsc\":s=!0,u=!0,i=new p(\"*\",\"multiply\",[new f(\"abs\",[r.clone()]),new f(\"sqrt\",[new p(\"-\",\"subtract\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)])])]);break;case\"acot\":s=!0,u=!0,i=new p(\"+\",\"add\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)]);break;case\"sinh\":i=new f(\"cosh\",[r.clone()]);break;case\"cosh\":i=new f(\"sinh\",[r.clone()]);break;case\"tanh\":i=new p(\"^\",\"pow\",[new f(\"sech\",[r.clone()]),b(2)]);break;case\"sech\":u=!0,i=new p(\"*\",\"multiply\",[e,new f(\"tanh\",[r.clone()])]);break;case\"csch\":u=!0,i=new p(\"*\",\"multiply\",[e,new f(\"coth\",[r.clone()])]);break;case\"coth\":u=!0,i=new p(\"^\",\"pow\",[new f(\"csch\",[r.clone()]),b(2)]);break;case\"asinh\":s=!0,i=new f(\"sqrt\",[new p(\"+\",\"add\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)])]);break;case\"acosh\":s=!0,i=new f(\"sqrt\",[new p(\"-\",\"subtract\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)])]);break;case\"atanh\":s=!0,i=new p(\"-\",\"subtract\",[b(1),new p(\"^\",\"pow\",[r.clone(),b(2)])]);break;case\"asech\":s=!0,u=!0,i=new p(\"*\",\"multiply\",[r.clone(),new f(\"sqrt\",[new p(\"-\",\"subtract\",[b(1),new p(\"^\",\"pow\",[r.clone(),b(2)])])])]);break;case\"acsch\":s=!0,u=!0,i=new p(\"*\",\"multiply\",[new f(\"abs\",[r.clone()]),new f(\"sqrt\",[new p(\"+\",\"add\",[new p(\"^\",\"pow\",[r.clone(),b(2)]),b(1)])])]);break;case\"acoth\":s=!0,u=!0,i=new p(\"-\",\"subtract\",[b(1),new p(\"^\",\"pow\",[r.clone(),b(2)])]);break;case\"abs\":i=new p(\"/\",\"divide\",[new f(new m(\"abs\"),[r.clone()]),r.clone()]);break;default:throw new Error('Cannot process function \"'+e.name+'\" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}o=s?(a=\"/\",\"divide\"):(a=\"*\",\"multiply\");let l=x(r,t);return u&&(l=new p(\"-\",\"unaryMinus\",[l])),new p(a,o,[l,i])},\"OperatorNode, function\":function(e,r){if(r(e))return b(0);if(\"+\"===e.op)return new p(e.op,e.fn,e.args.map(function(e){return x(e,r)}));if(\"-\"===e.op){if(e.isUnary())return new p(e.op,e.fn,[x(e.args[0],r)]);if(e.isBinary())return new p(e.op,e.fn,[x(e.args[0],r),x(e.args[1],r)])}if(\"*\"===e.op){const t=e.args.filter(function(e){return r(e)});if(0{let{typed:t,simplifyConstant:l,simplifyCore:c,simplify:f,ConstantNode:p,OperatorNode:m,SymbolNode:h}=e;function r(a){var e=1r(e,{},t),\"Node, Object\":r,\"Node, Object, boolean\":r});function d(e,a){let o=(a=void 0===a?[]:a)[0]=0,s=\"\";!function t(r,e,n){var i=r.type;if(\"FunctionNode\"===i)throw new Error(\"There is an unsolved function call\");if(\"OperatorNode\"===i){if(!\"+-*^\".includes(r.op))throw new Error(\"Operator \"+r.op+\" invalid\");if(null!==e){if((\"unaryMinus\"===r.fn||\"pow\"===r.fn)&&\"add\"!==e.fn&&\"subtract\"!==e.fn&&\"multiply\"!==e.fn)throw new Error(\"Invalid \"+r.op+\" placing\");if((\"subtract\"===r.fn||\"add\"===r.fn||\"multiply\"===r.fn)&&\"add\"!==e.fn&&\"subtract\"!==e.fn)throw new Error(\"Invalid \"+r.op+\" placing\");if((\"subtract\"===r.fn||\"add\"===r.fn||\"unaryMinus\"===r.fn)&&0!==n.noFil)throw new Error(\"Invalid \"+r.op+\" placing\")}\"^\"!==r.op&&\"*\"!==r.op||(n.fire=r.op);for(let e=0;eo&&(a[t]=0),a[t]+=n.cte*(\"+\"===n.oper?1:-1),o=Math.max(t,o),0}n.cte=t,\"\"===n.fire&&(a[0]+=n.cte*(\"+\"===n.oper?1:-1))}}}(e,null,{cte:1,oper:\"+\",fire:\"\"});let n,i=!0;for(let r=o=a.length-1;0<=r;r--)if(0!==a[r]){let t=new p(i?a[r]:Math.abs(a[r]));var u=a[r]<0?\"-\":\"+\";if(0{let{typed:t,add:a,multiply:o,Complex:s,number:u}=e;return t(\"zpk2tf\",{\"Array,Array,number\":n,\"Array,Array\":function(e,t){return n(e,t,1)},\"Matrix,Matrix,number\":function(e,t,r){return n(e.valueOf(),t.valueOf(),r)},\"Matrix,Matrix\":function(e,t){return n(e.valueOf(),t.valueOf(),1)}});function n(r,n,t){r.some(e=>\"BigNumber\"===e.type)&&(r=r.map(e=>u(e))),n.some(e=>\"BigNumber\"===e.type)&&(n=n.map(e=>u(e)));let i=[s(1,0)],a=[s(1,0)];for(let t=0;t{let{typed:t,add:l,multiply:c,Complex:f,divide:r,matrix:n}=e;return t(\"freqz\",{\"Array, Array\":function(e,t){return i(e,t,a(512))},\"Array, Array, Array\":i,\"Array, Array, number\":function(e,t,r){if(r<0)throw new Error(\"w must be a positive number\");return i(e,t,a(r))},\"Matrix, Matrix\":function(e,t){var r=a(512),{w:e,h:t}=i(e.valueOf(),t.valueOf(),r);return{w:n(e),h:n(t)}},\"Matrix, Matrix, Matrix\":function(e,t,r){e=i(e.valueOf(),t.valueOf(),r.valueOf()).h;return{h:n(e),w:n(r)}},\"Matrix, Matrix, number\":function(e,t,r){if(r<0)throw new Error(\"w must be a positive number\");r=a(r),e=i(e.valueOf(),t.valueOf(),r).h;return{h:n(e),w:n(r)}}});function i(i,a,o){const s=[],u=[];for(let n=0;n{let n=e[\"classes\"];return function(e,t){const r=n[t&&t.mathjs];return r&&\"function\"==typeof r.fromJSON?r.fromJSON(t):t}}),a0=s(\"replacer\",[],()=>function(e,t){return\"number\"!=typeof t||isFinite(t)&&!isNaN(t)?\"bigint\"==typeof t?{mathjs:\"bigint\",value:String(t)}:t:{mathjs:\"number\",value:String(t)}}),o0=Math.PI,s0=2*Math.PI,u0=Math.E,l0=s(\"true\",[],()=>!0),c0=s(\"false\",[],()=>!1),f0=s(\"null\",[],()=>null),p0=T0(\"Infinity\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(1/0):1/0}),m0=T0(\"NaN\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(NaN):NaN}),h0=T0(\"pi\",[\"config\",\"?BigNumber\"],e=>{var{config:e,BigNumber:t}=e;return\"BigNumber\"===e.number?_l(t):o0}),d0=T0(\"tau\",[\"config\",\"?BigNumber\"],e=>{var{config:e,BigNumber:t}=e;return\"BigNumber\"===e.number?zl(t):s0}),g0=T0(\"e\",[\"config\",\"?BigNumber\"],e=>{var{config:e,BigNumber:t}=e;return\"BigNumber\"===e.number?Dl(t):u0}),y0=T0(\"phi\",[\"config\",\"?BigNumber\"],e=>{var{config:e,BigNumber:t}=e;return\"BigNumber\"===e.number?Ol(t):1.618033988749895}),x0=T0(\"LN2\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(2).ln():Math.LN2}),b0=T0(\"LN10\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(10).ln():Math.LN10}),v0=T0(\"LOG2E\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(1).div(new r(2).ln()):Math.LOG2E}),w0=T0(\"LOG10E\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(1).div(new r(10).ln()):Math.LOG10E}),N0=T0(\"SQRT1_2\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(\"0.5\").sqrt():Math.SQRT1_2}),A0=T0(\"SQRT2\",[\"config\",\"?BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(2).sqrt():Math.SQRT2}),E0=T0(\"i\",[\"Complex\"],e=>{e=e.Complex;return e.I}),S0=s(\"PI\",[\"pi\"],e=>{e=e.pi;return e}),M0=s(\"E\",[\"e\"],e=>{e=e.e;return e}),C0=s(\"version\",[],()=>\"14.8.1\");function T0(e,t,r){return s(e,t,r,{recreateOnConfigChange:!0})}const B0=e(\"speedOfLight\",\"299792458\",\"m s^-1\"),F0=e(\"gravitationConstant\",\"6.67430e-11\",\"m^3 kg^-1 s^-2\"),D0=e(\"planckConstant\",\"6.62607015e-34\",\"J s\"),O0=e(\"reducedPlanckConstant\",\"1.0545718176461565e-34\",\"J s\"),_0=e(\"magneticConstant\",\"1.25663706212e-6\",\"N A^-2\"),z0=e(\"electricConstant\",\"8.8541878128e-12\",\"F m^-1\"),q0=e(\"vacuumImpedance\",\"376.730313667\",\"ohm\"),I0=e(\"coulomb\",\"8.987551792261171e9\",\"N m^2 C^-2\"),k0=e(\"coulombConstant\",\"8.987551792261171e9\",\"N m^2 C^-2\"),R0=e(\"elementaryCharge\",\"1.602176634e-19\",\"C\"),P0=e(\"bohrMagneton\",\"9.2740100783e-24\",\"J T^-1\"),U0=e(\"conductanceQuantum\",\"7.748091729863649e-5\",\"S\"),j0=e(\"inverseConductanceQuantum\",\"12906.403729652257\",\"ohm\"),L0=e(\"magneticFluxQuantum\",\"2.0678338484619295e-15\",\"Wb\"),$0=e(\"nuclearMagneton\",\"5.0507837461e-27\",\"J T^-1\"),H0=e(\"klitzing\",\"25812.807459304513\",\"ohm\"),G0=e(\"bohrRadius\",\"5.29177210903e-11\",\"m\"),V0=e(\"classicalElectronRadius\",\"2.8179403262e-15\",\"m\"),Z0=e(\"electronMass\",\"9.1093837015e-31\",\"kg\"),W0=e(\"fermiCoupling\",\"1.1663787e-5\",\"GeV^-2\"),Y0=Mh(\"fineStructure\",.0072973525693),J0=e(\"hartreeEnergy\",\"4.3597447222071e-18\",\"J\"),X0=e(\"protonMass\",\"1.67262192369e-27\",\"kg\"),Q0=e(\"deuteronMass\",\"3.3435830926e-27\",\"kg\"),K0=e(\"neutronMass\",\"1.6749271613e-27\",\"kg\"),eh=e(\"quantumOfCirculation\",\"3.6369475516e-4\",\"m^2 s^-1\"),th=e(\"rydberg\",\"10973731.568160\",\"m^-1\"),rh=e(\"thomsonCrossSection\",\"6.6524587321e-29\",\"m^2\"),nh=Mh(\"weakMixingAngle\",.2229),ih=Mh(\"efimovFactor\",22.7),ah=e(\"atomicMass\",\"1.66053906660e-27\",\"kg\"),oh=e(\"avogadro\",\"6.02214076e23\",\"mol^-1\"),sh=e(\"boltzmann\",\"1.380649e-23\",\"J K^-1\"),uh=e(\"faraday\",\"96485.33212331001\",\"C mol^-1\"),lh=e(\"firstRadiation\",\"3.7417718521927573e-16\",\"W m^2\"),ch=e(\"loschmidt\",\"2.686780111798444e25\",\"m^-3\"),fh=e(\"gasConstant\",\"8.31446261815324\",\"J K^-1 mol^-1\"),ph=e(\"molarPlanckConstant\",\"3.990312712893431e-10\",\"J s mol^-1\"),mh=e(\"molarVolume\",\"0.022413969545014137\",\"m^3 mol^-1\"),hh=Mh(\"sackurTetrode\",-1.16487052358),dh=e(\"secondRadiation\",\"0.014387768775039337\",\"m K\"),gh=e(\"stefanBoltzmann\",\"5.67037441918443e-8\",\"W m^-2 K^-4\"),yh=e(\"wienDisplacement\",\"2.897771955e-3\",\"m K\"),xh=e(\"molarMass\",\"0.99999999965e-3\",\"kg mol^-1\"),bh=e(\"molarMassC12\",\"11.9999999958e-3\",\"kg mol^-1\"),vh=e(\"gravity\",\"9.80665\",\"m s^-2\"),wh=e(\"planckLength\",\"1.616255e-35\",\"m\"),Nh=e(\"planckMass\",\"2.176435e-8\",\"kg\"),Ah=e(\"planckTime\",\"5.391245e-44\",\"s\"),Eh=e(\"planckCharge\",\"1.87554603778e-18\",\"C\"),Sh=e(\"planckTemperature\",\"1.416785e+32\",\"K\");function e(e,a,o){return s(e,[\"config\",\"Unit\",\"BigNumber\"],e=>{let{config:t,Unit:r,BigNumber:n}=e;const i=new r(\"BigNumber\"===t.number?new n(a):parseFloat(a),o);return i.fixPrefix=!0,i})}function Mh(e,n){return s(e,[\"config\",\"BigNumber\"],e=>{let{config:t,BigNumber:r}=e;return\"BigNumber\"===t.number?new r(n):n})}const Ch=s(\"mapSlices\",[\"typed\",\"isInteger\"],e=>{let{typed:t,isInteger:r}=e;const n=ga({typed:t,isInteger:r});return t(\"mapSlices\",{\"...any\":function(e){const t=e[1];A(t)?e[1]=t-1:Q(t)&&(e[1]=t.minus(1));try{return n.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0,...ga.meta}),Th=s(\"column\",[\"typed\",\"Index\",\"matrix\",\"range\"],e=>{let{typed:t,Index:r,matrix:n,range:i}=e;const a=es({typed:t,Index:r,matrix:n,range:i});return t(\"column\",{\"...any\":function(e){var t=e.length-1,r=e[t];A(r)&&(e[t]=r-1);try{return a.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0});function Bh(e,t,r){var n=e.filter(function(e){return se(e)&&!(e.name in t)&&!r.has(e.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression \"'+e+'\"');const i=n.name,a=new Map,o=new k(r,a,new Set([i])),s=e.compile();return function(e){return a.set(i,e),s.evaluate(o)}}const Fh=s(\"transformCallback\",[\"typed\"],e=>{let o=e[\"typed\"];return function(e,t){return o.isTypedFunction(e)?function i(e,a){const t=Object.fromEntries(Object.entries(e.signatures).map(e=>{let[t,r]=e;const n=t.split(\",\").length;return o.isTypedFunction(r)?[t,i(r,a)]:[t,Dh(r,n,a)]}));return\"string\"==typeof e.name?o(e.name,t):o(t)}(e,t):Dh(e,e.length,t)}});function Dh(o,e,s){return e===s?o:e===s+1?function(){for(var e=arguments.length,t=new Array(e),r=0;re+1)}const _h=s(\"filter\",[\"typed\"],e=>{let u=e[\"typed\"];function t(e,t,r){const n=is({typed:u}),i=Fh({typed:u});if(0===e.length)return n();let a=e[0];if(1===e.length)return n(a);var o=e.length-1;let s=e[o];return a=a&&l(a,r),s=s&&(se(s)||Ne(s)?l(s,r):Bh(s,t,r)),n(a,i(s,o))}function l(e,t){return e.compile().evaluate(t)}return t.rawArgs=!0,t},{isTransformFunction:!0}),zh=s(\"forEach\",[\"typed\"],e=>{e=e.typed;const o=ls({typed:e}),s=Fh({typed:e});function t(e,t,r){if(0===e.length)return o();let n=e[0];if(1===e.length)return o(n);var i=e.length-1;let a=e[i];return n=n&&u(n,r),a=a&&(se(a)||Ne(a)?u(a,r):Bh(a,t,r)),o(n,s(a,i))}function u(e,t){return e.compile().evaluate(t)}return t.rawArgs=!0,t},{isTransformFunction:!0}),qh=s(\"index\",[\"Index\",\"getMatrixDataType\"],e=>{let{Index:t,getMatrixDataType:n}=e;return function(){const r=[];for(let t=0,e=arguments.length;t{e=e.typed;const s=gs({typed:e}),u=Fh({typed:e});function t(e,t,r){if(0===e.length)return s();if(1===e.length)return s(e[0]);var n=e.length-1;let i=e.slice(0,n),a=e[n];return i=i.map(e=>o(e,r)),a=a&&(se(a)||Ne(a)?o(a,r):Bh(a,t,r)),s(...i,u(a,n));function o(e,t){return e.compile().evaluate(t)}}return t.rawArgs=!0,t},{isTransformFunction:!0});function kh(e){var t,r;return 2===e.length&&$(e[0])&&(A(r=t=(e=e.slice())[1])||Q(r))&&(e[1]=A(r=t)?r-1:Q(r)?r.minus(1):r),e}const Rh=s(\"max\",[\"typed\",\"config\",\"numeric\",\"larger\",\"isNaN\"],e=>{let{typed:t,config:r,numeric:n,larger:i,isNaN:a}=e;const o=Nl({typed:t,config:r,numeric:n,larger:i,isNaN:a});return t(\"max\",{\"...any\":function(e){e=kh(e);try{return o.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Ph=s(\"mean\",[\"typed\",\"add\",\"divide\"],e=>{let{typed:t,add:r,divide:n}=e;const i=Lp({typed:t,add:r,divide:n});return t(\"mean\",{\"...any\":function(e){e=kh(e);try{return i.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Uh=s(\"min\",[\"typed\",\"config\",\"numeric\",\"smaller\",\"isNaN\"],e=>{let{typed:t,config:r,numeric:n,smaller:i,isNaN:a}=e;const o=Al({typed:t,config:r,numeric:n,smaller:i,isNaN:a});return t(\"min\",{\"...any\":function(e){e=kh(e);try{return o.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),jh=s(\"range\",[\"typed\",\"config\",\"?matrix\",\"?bignumber\",\"smaller\",\"smallerEq\",\"larger\",\"largerEq\",\"add\",\"isPositive\"],e=>{let{typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u,add:l,isPositive:c}=e;const f=Ns({typed:t,config:r,matrix:n,bignumber:i,smaller:a,smallerEq:o,larger:s,largerEq:u,add:l,isPositive:c});return t(\"range\",{\"...any\":function(e){return\"boolean\"!=typeof e[e.length-1]&&e.push(!0),f.apply(null,e)}})},{isTransformFunction:!0}),Lh=s(\"row\",[\"typed\",\"Index\",\"matrix\",\"range\"],e=>{let{typed:t,Index:r,matrix:n,range:i}=e;const a=Bs({typed:t,Index:r,matrix:n,range:i});return t(\"row\",{\"...any\":function(e){var t=e.length-1,r=e[t];A(r)&&(e[t]=r-1);try{return a.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),$h=s(\"subset\",[\"typed\",\"matrix\",\"zeros\",\"add\"],e=>{let{typed:t,matrix:r,zeros:n,add:i}=e;const a=_s({typed:t,matrix:r,zeros:n,add:i});return t(\"subset\",{\"...any\":function(e){try{return a.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Hh=s(\"concat\",[\"typed\",\"matrix\",\"isInteger\"],e=>{let{typed:t,matrix:r,isInteger:n}=e;const i=Ko({typed:t,matrix:r,isInteger:n});return t(\"concat\",{\"...any\":function(e){const t=e.length-1,r=e[t];A(r)?e[t]=r-1:Q(r)&&(e[t]=r.minus(1));try{return i.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Gh=s(\"diff\",[\"typed\",\"matrix\",\"subtract\",\"number\",\"bignumber\"],e=>{let{typed:t,matrix:r,subtract:n,number:i,bignumber:a}=e;const o=ys({typed:t,matrix:r,subtract:n,number:i,bignumber:a});return t(\"diff\",{\"...any\":function(e){e=kh(e);try{return o.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Vh=s(\"std\",[\"typed\",\"map\",\"sqrt\",\"variance\"],e=>{let{typed:t,map:r,sqrt:n,variance:i}=e;const a=Jp({typed:t,map:r,sqrt:n,variance:i});return t(\"std\",{\"...any\":function(e){e=kh(e);try{return a.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Zh=s(\"sum\",[\"typed\",\"config\",\"add\",\"numeric\"],e=>{let{typed:t,config:r,add:n,numeric:i}=e;const a=Pp({typed:t,config:r,add:n,numeric:i});return t(\"sum\",{\"...any\":function(e){e=kh(e);try{return a.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Wh=s(\"quantileSeq\",[\"typed\",\"bignumber\",\"add\",\"subtract\",\"divide\",\"multiply\",\"partitionSelect\",\"compare\",\"isInteger\",\"smaller\",\"smallerEq\",\"larger\",\"mapSlices\"],e=>{let{typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:s,compare:u,isInteger:l,smaller:c,smallerEq:f,larger:p,mapSlices:m}=e;const h=Yp({typed:t,bignumber:r,add:n,subtract:i,divide:a,multiply:o,partitionSelect:s,compare:u,isInteger:l,smaller:c,smallerEq:f,larger:p,mapSlices:m});return t(\"quantileSeq\",{\"Array | Matrix, number | BigNumber\":h,\"Array | Matrix, number | BigNumber, number\":(e,t,r)=>h(e,t,d(r)),\"Array | Matrix, number | BigNumber, boolean\":h,\"Array | Matrix, number | BigNumber, boolean, number\":(e,t,r,n)=>h(e,t,r,d(n)),\"Array | Matrix, Array | Matrix\":h,\"Array | Matrix, Array | Matrix, number\":(e,t,r)=>h(e,t,d(r)),\"Array | Matrix, Array | Matrix, boolean\":h,\"Array | Matrix, Array | Matrix, boolean, number\":(e,t,r,n)=>h(e,t,r,d(n))});function d(e){return kh([[],e])[1]}},{isTransformFunction:!0}),Yh=s(\"cumsum\",[\"typed\",\"add\",\"unaryPlus\"],e=>{let{typed:t,add:r,unaryPlus:n}=e;const i=jp({typed:t,add:r,unaryPlus:n});return t(\"cumsum\",{\"...any\":function(e){if(2===e.length&&$(e[0])){const t=e[1];A(t)?e[1]=t-1:Q(t)&&(e[1]=t.minus(1))}try{return i.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Jh=\"variance\",Xh=s(Jh,[\"typed\",\"add\",\"subtract\",\"multiply\",\"divide\",\"mapSlices\",\"isNaN\"],e=>{let{typed:t,add:r,subtract:n,multiply:i,divide:a,mapSlices:o,isNaN:s}=e;const u=Zp({typed:t,add:r,subtract:n,multiply:i,divide:a,mapSlices:o,isNaN:s});return t(Jh,{\"...any\":function(e){e=kh(e);try{return u.apply(null,e)}catch(e){throw sf(e)}}})},{isTransformFunction:!0}),Qh=s(\"print\",[\"typed\",\"matrix\",\"zeros\",\"add\"],e=>{let{typed:t,matrix:r,zeros:n,add:i}=e;const a=su({typed:t,matrix:r,zeros:n,add:i});return t(\"print\",{\"string, Object | Array\":function(e,t){return a(o(e),t)},\"string, Object | Array, number | Object\":function(e,t,r){return a(o(e),t,r)}});function o(e){return e.replace(ou,e=>\"$\"+e.slice(1).split(\".\").map(function(e){return!isNaN(e)&&0{var{typed:e,matrix:t,equalScalar:r,zeros:n,not:i,concat:a}=e;const o=Lu({typed:e,matrix:t,equalScalar:r,zeros:n,not:i,concat:a});function s(e,t,r){var n=e[0].compile().evaluate(r);if(!$(n)&&!o(n,!0))return!1;e=e[1].compile().evaluate(r);return o(n,e)}return s.rawArgs=!0,s},{isTransformFunction:!0}),ed=s(\"or\",[\"typed\",\"matrix\",\"equalScalar\",\"DenseMatrix\",\"concat\"],e=>{var{typed:e,matrix:t,equalScalar:r,DenseMatrix:n,concat:i}=e;const a=Xo({typed:e,matrix:t,equalScalar:r,DenseMatrix:n,concat:i});function o(e,t,r){var n=e[0].compile().evaluate(r);if(!$(n)&&a(n,!1))return!0;e=e[1].compile().evaluate(r);return a(n,e)}return o.rawArgs=!0,o},{isTransformFunction:!0}),td=s(\"nullish\",[\"typed\",\"matrix\",\"size\",\"flatten\",\"deepEqual\"],e=>{var{typed:e,matrix:t,size:r,flatten:n,deepEqual:i}=e;const a=Jo({typed:e,matrix:t,size:r,flatten:n,deepEqual:i});function o(e,t,r){var n=e[0].compile().evaluate(r);if(!$(n)&&null!=n&&void 0!==n)return n;e=e[1].compile().evaluate(r);return a(n,e)}return o.rawArgs=!0,o},{isTransformFunction:!0}),rd=s(\"bitAnd\",[\"typed\",\"matrix\",\"zeros\",\"add\",\"equalScalar\",\"not\",\"concat\"],e=>{var{typed:e,matrix:t,equalScalar:r,zeros:n,not:i,concat:a}=e;const o=zo({typed:e,matrix:t,equalScalar:r,zeros:n,not:i,concat:a});function s(e,t,r){var n=e[0].compile().evaluate(r);if(!$(n)){if(isNaN(n))return NaN;if(0===n||!1===n)return 0}e=e[1].compile().evaluate(r);return o(n,e)}return s.rawArgs=!0,s},{isTransformFunction:!0}),nd=s(\"bitOr\",[\"typed\",\"matrix\",\"equalScalar\",\"DenseMatrix\",\"concat\"],e=>{var{typed:e,matrix:t,equalScalar:r,DenseMatrix:n,concat:i}=e;const a=Io({typed:e,matrix:t,equalScalar:r,DenseMatrix:n,concat:i});function o(e,t,r){var n=e[0].compile().evaluate(r);if(!$(n)){if(isNaN(n))return NaN;if(-1===n)return-1;if(!0===n)return 1}e=e[1].compile().evaluate(r);return a(n,e)}return o.rawArgs=!0,o},{isTransformFunction:!0});var id=fd(504);const ad={relTol:1e-12,absTol:1e-15,matrix:\"Matrix\",number:\"number\",numberFallback:\"number\",precision:64,predictable:!1,randomSeed:null},od=[\"Matrix\",\"Array\"],sd=[\"number\",\"BigNumber\",\"bigint\",\"Fraction\"];function ud(n,i){function a(e){if(e){if(void 0!==e.epsilon){console.warn('Warning: The configuration option \"epsilon\" is deprecated. Use \"relTol\" and \"absTol\" instead.');const n=ee(e);return n.relTol=e.epsilon,n.absTol=.001*e.epsilon,delete n.epsilon,a(n)}var t=ee(n),r=(ld(e,\"matrix\",od),ld(e,\"number\",sd),function e(t,r){if(Array.isArray(r))throw new TypeError(\"Arrays are not supported by deepExtend\");for(const n in r)if(ue(r,n)&&!(n in Object.prototype)&&!(n in Function.prototype))if(r[n]&&r[n].constructor===Object)void 0===t[n]&&(t[n]={}),t[n]&&t[n].constructor===Object?e(t[n],r[n]):t[n]=r[n];else{if(Array.isArray(r[n]))throw new TypeError(\"Arrays are not supported by deepExtend\");t[n]=r[n]}}(n,e),ee(n)),e=ee(e);return i(\"config\",r,t,e),r}return ee(n)}return a.MATRIX_OPTIONS=od,a.NUMBER_OPTIONS=sd,Object.keys(ad).forEach(e=>{Object.defineProperty(a,e,{get:()=>n[e],enumerable:!0,configurable:!0})}),a}function ld(e,t,r){void 0===e[t]||r.includes(e[t])||console.warn('Warning: Unknown value \"'+e[t]+'\" for configuration option \"'+t+'\". Available options: '+r.map(e=>JSON.stringify(e)).join(\", \")+\".\")}const cd=function e(t,r){r=gn({},ad,r);if(\"function\"!=typeof Object.create)throw new Error(\"ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.\");const n=function(e){const t=new id;return e.on=t.on.bind(t),e.off=t.off.bind(t),e.once=t.once.bind(t),e.emit=t.emit.bind(t),e}({isNumber:A,isComplex:te,isBigNumber:Q,isBigInt:R,isFraction:re,isUnit:L,isString:j,isArray:b,isMatrix:_,isCollection:$,isDenseMatrix:H,isSparseMatrix:G,isRange:V,isIndex:Z,isBoolean:W,isResultSet:Y,isHelp:J,isFunction:X,isDate:ne,isRegExp:ie,isObject:ce,isMap:fe,isPartitionedMap:pe,isObjectWrappingMap:me,isNull:he,isUndefined:de,isAccessorNode:ge,isArrayNode:ye,isAssignmentNode:xe,isBlockNode:be,isConditionalNode:ve,isConstantNode:ae,isFunctionAssignmentNode:Ne,isFunctionNode:Ae,isIndexNode:Ee,isNode:O,isObjectNode:Se,isOperatorNode:oe,isParenthesisNode:Me,isRangeNode:Ce,isRelationalNode:Te,isSymbolNode:se,isChain:Be}),i=(n.config=ud(r,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}},{});function a(){for(var e=arguments.length,t=new Array(e),r=0;r{if(e.includes(\".\"))throw new Error(\"Factory dependency should not contain a nested path. Name: \"+JSON.stringify(e));\"math\"===e?t.math=p:\"mathWithTransform\"===e?t.mathWithTransform=p.expression.mathWithTransform:\"classes\"===e?t.classes=p:t[e]=p[e]});var e=r(t);if(e&&\"function\"==typeof e.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = \"expression.transform\"');if(void 0===s||n.override)return e;if(f.isTypedFunction(s)&&f.isTypedFunction(e))return f(s,e);if(n.silent)return s;throw new Error('Cannot import \"'+i+'\": already exists')}const a=d(r)?p.expression.transform:p,o=i in p.expression.transform,s=ue(a,i)?a[i]:void 0,u=null!=(e=null==(e=r.meta)?void 0:e.formerly)?e:\"\",l=d(r)||!((e=r).fn.includes(\".\")||ue(g,e.fn)||e.meta&&e.meta.isClass),c=p.expression.mathWithTransform;r.meta&&!1===r.meta.lazy?(a[i]=t(),u&&(a[u]=a[i])):(_e(a,i,t),u&&_e(a,u,t)),s&&o?(h(i),u&&h(u)):l&&(_e(c,i,()=>a[i]),u&&_e(c,u,()=>a[i])),m[i]=r,p.emit(\"import\",i,t)}function r(e){return!ue(g,e)}function d(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}const g={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(e,i){const t=arguments.length;if(1!==t&&2!==t)throw new Za(\"import\",t,1,2);i=i||{};var r,n={};!function t(r,e,n){if(Array.isArray(e))e.forEach(e=>t(r,e));else if(ce(e)||\"object\"==typeof e&&\"Module\"===e[Symbol.toStringTag])for(const i in e)ue(e,i)&&t(r,e[i],i);else if(ze(e)||void 0!==n){const t=ze(e)?d(e)?e.fn+\".transform\":e.fn:n;if(ue(r,t)&&r[t]!==e&&!i.silent)throw new Error('Cannot import \"'+t+'\" twice');r[t]=e}else if(!i.silent)throw new TypeError(\"Factory, Object, or Array expected\")}(n,e);for(const e in n)if(ue(n,e)){const t=n[e];if(ze(t))o(t,i);else if(\"function\"==typeof(r=t)||\"number\"==typeof r||\"string\"==typeof r||\"boolean\"==typeof r||null===r||L(r)||te(r)||Q(r)||re(r)||_(r)||Array.isArray(r))a(e,t,i);else if(!i.silent)throw new TypeError(\"Factory, Object, or Array expected\")}}}(a,n,i);return n.import=o,n.on(\"config\",()=>{Object.values(i).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&o(e,{override:!0})})}),n.create=e.bind(null,t),n.factory=s,n.import(Object.values(Oe(t))),n.ArgumentsError=Za,n.DimensionError=z,n.IndexError=En,n}(t)})(),pd.default});", "/*! markdown-it 14.1.1 https://github.com/markdown-it/markdown-it @license MIT */\n(function(global, factory) {\n typeof exports === \"object\" && typeof module !== \"undefined\" ? module.exports = factory() : typeof define === \"function\" && define.amd ? define(factory) : (global = typeof globalThis !== \"undefined\" ? globalThis : global || self,\n global.markdownit = factory());\n})(this, function() {\n \"use strict\";\n /* eslint-disable no-bitwise */ const decodeCache = {};\n function getDecodeCache(exclude) {\n let cache = decodeCache[exclude];\n if (cache) {\n return cache;\n }\n cache = decodeCache[exclude] = [];\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i);\n cache.push(ch);\n }\n for (let i = 0; i < exclude.length; i++) {\n const ch = exclude.charCodeAt(i);\n cache[ch] = \"%\" + (\"0\" + ch.toString(16).toUpperCase()).slice(-2);\n }\n return cache;\n }\n // Decode percent-encoded string.\n\n function decode$1(string, exclude) {\n if (typeof exclude !== \"string\") {\n exclude = decode$1.defaultChars;\n }\n const cache = getDecodeCache(exclude);\n return string.replace(/(%[a-f0-9]{2})+/gi, function(seq) {\n let result = \"\";\n for (let i = 0, l = seq.length; i < l; i += 3) {\n const b1 = parseInt(seq.slice(i + 1, i + 3), 16);\n if (b1 < 128) {\n result += cache[b1];\n continue;\n }\n if ((b1 & 224) === 192 && i + 3 < l) {\n // 110xxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16);\n if ((b2 & 192) === 128) {\n const chr = b1 << 6 & 1984 | b2 & 63;\n if (chr < 128) {\n result += \"\\ufffd\\ufffd\";\n } else {\n result += String.fromCharCode(chr);\n }\n i += 3;\n continue;\n }\n }\n if ((b1 & 240) === 224 && i + 6 < l) {\n // 1110xxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16);\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16);\n if ((b2 & 192) === 128 && (b3 & 192) === 128) {\n const chr = b1 << 12 & 61440 | b2 << 6 & 4032 | b3 & 63;\n if (chr < 2048 || chr >= 55296 && chr <= 57343) {\n result += \"\\ufffd\\ufffd\\ufffd\";\n } else {\n result += String.fromCharCode(chr);\n }\n i += 6;\n continue;\n }\n }\n if ((b1 & 248) === 240 && i + 9 < l) {\n // 111110xx 10xxxxxx 10xxxxxx 10xxxxxx\n const b2 = parseInt(seq.slice(i + 4, i + 6), 16);\n const b3 = parseInt(seq.slice(i + 7, i + 9), 16);\n const b4 = parseInt(seq.slice(i + 10, i + 12), 16);\n if ((b2 & 192) === 128 && (b3 & 192) === 128 && (b4 & 192) === 128) {\n let chr = b1 << 18 & 1835008 | b2 << 12 & 258048 | b3 << 6 & 4032 | b4 & 63;\n if (chr < 65536 || chr > 1114111) {\n result += \"\\ufffd\\ufffd\\ufffd\\ufffd\";\n } else {\n chr -= 65536;\n result += String.fromCharCode(55296 + (chr >> 10), 56320 + (chr & 1023));\n }\n i += 9;\n continue;\n }\n }\n result += \"\\ufffd\";\n }\n return result;\n });\n }\n decode$1.defaultChars = \";/?:@&=+$,#\";\n decode$1.componentChars = \"\";\n const encodeCache = {};\n // Create a lookup array where anything but characters in `chars` string\n // and alphanumeric chars is percent-encoded.\n\n function getEncodeCache(exclude) {\n let cache = encodeCache[exclude];\n if (cache) {\n return cache;\n }\n cache = encodeCache[exclude] = [];\n for (let i = 0; i < 128; i++) {\n const ch = String.fromCharCode(i);\n if (/^[0-9a-z]$/i.test(ch)) {\n // always allow unencoded alphanumeric characters\n cache.push(ch);\n } else {\n cache.push(\"%\" + (\"0\" + i.toString(16).toUpperCase()).slice(-2));\n }\n }\n for (let i = 0; i < exclude.length; i++) {\n cache[exclude.charCodeAt(i)] = exclude[i];\n }\n return cache;\n }\n // Encode unsafe characters with percent-encoding, skipping already\n // encoded sequences.\n\n // - string - string to encode\n // - exclude - list of characters to ignore (in addition to a-zA-Z0-9)\n // - keepEscaped - don't encode '%' in a correct escape sequence (default: true)\n\n function encode$1(string, exclude, keepEscaped) {\n if (typeof exclude !== \"string\") {\n // encode(string, keepEscaped)\n keepEscaped = exclude;\n exclude = encode$1.defaultChars;\n }\n if (typeof keepEscaped === \"undefined\") {\n keepEscaped = true;\n }\n const cache = getEncodeCache(exclude);\n let result = \"\";\n for (let i = 0, l = string.length; i < l; i++) {\n const code = string.charCodeAt(i);\n if (keepEscaped && code === 37 /* % */ && i + 2 < l) {\n if (/^[0-9a-f]{2}$/i.test(string.slice(i + 1, i + 3))) {\n result += string.slice(i, i + 3);\n i += 2;\n continue;\n }\n }\n if (code < 128) {\n result += cache[code];\n continue;\n }\n if (code >= 55296 && code <= 57343) {\n if (code >= 55296 && code <= 56319 && i + 1 < l) {\n const nextCode = string.charCodeAt(i + 1);\n if (nextCode >= 56320 && nextCode <= 57343) {\n result += encodeURIComponent(string[i] + string[i + 1]);\n i++;\n continue;\n }\n }\n result += \"%EF%BF%BD\";\n continue;\n }\n result += encodeURIComponent(string[i]);\n }\n return result;\n }\n encode$1.defaultChars = \";/?:@&=+$,-_.!~*'()#\";\n encode$1.componentChars = \"-_.!~*'()\";\n function format(url) {\n let result = \"\";\n result += url.protocol || \"\";\n result += url.slashes ? \"//\" : \"\";\n result += url.auth ? url.auth + \"@\" : \"\";\n if (url.hostname && url.hostname.indexOf(\":\") !== -1) {\n // ipv6 address\n result += \"[\" + url.hostname + \"]\";\n } else {\n result += url.hostname || \"\";\n }\n result += url.port ? \":\" + url.port : \"\";\n result += url.pathname || \"\";\n result += url.search || \"\";\n result += url.hash || \"\";\n return result;\n }\n // Copyright Joyent, Inc. and other Node contributors.\n\n // Permission is hereby granted, free of charge, to any person obtaining a\n // copy of this software and associated documentation files (the\n // \"Software\"), to deal in the Software without restriction, including\n // without limitation the rights to use, copy, modify, merge, publish,\n // distribute, sublicense, and/or sell copies of the Software, and to permit\n // persons to whom the Software is furnished to do so, subject to the\n // following conditions:\n\n // The above copyright notice and this permission notice shall be included\n // in all copies or substantial portions of the Software.\n\n // THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n // USE OR OTHER DEALINGS IN THE SOFTWARE.\n\n // Changes from joyent/node:\n\n // 1. No leading slash in paths,\n // e.g. in `url.parse('http://foo?bar')` pathname is ``, not `/`\n\n // 2. Backslashes are not replaced with slashes,\n // so `http:\\\\example.org\\` is treated like a relative path\n\n // 3. Trailing colon is treated like a part of the path,\n // i.e. in `http://example.org:foo` pathname is `:foo`\n\n // 4. Nothing is URL-encoded in the resulting object,\n // (in joyent/node some chars in auth and paths are encoded)\n\n // 5. `url.parse()` does not have `parseQueryString` argument\n\n // 6. Removed extraneous result properties: `host`, `path`, `query`, etc.,\n // which can be constructed using other parts of the url.\n\n function Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.pathname = null;\n }\n // Reference: RFC 3986, RFC 1808, RFC 2396\n // define these here so at least they only have to be\n // compiled once on the first module load.\n const protocolPattern = /^([a-z0-9.+-]+:)/i;\n const portPattern = /:[0-9]*$/;\n // Special case for a simple path URL\n /* eslint-disable-next-line no-useless-escape */ const simplePathPattern = /^(\\/\\/?(?!\\/)[^\\?\\s]*)(\\?[^\\s]*)?$/;\n // RFC 2396: characters reserved for delimiting URLs.\n // We actually just auto-escape these.\n const delims = [ \"<\", \">\", '\"', \"`\", \" \", \"\\r\", \"\\n\", \"\\t\" ];\n // RFC 2396: characters not allowed for various reasons.\n const unwise = [ \"{\", \"}\", \"|\", \"\\\\\", \"^\", \"`\" ].concat(delims);\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n const autoEscape = [ \"'\" ].concat(unwise);\n // Characters that are never ever allowed in a hostname.\n // Note that any invalid chars are also handled, but these\n // are the ones that are *expected* to be seen, so we fast-path\n // them.\n const nonHostChars = [ \"%\", \"/\", \"?\", \";\", \"#\" ].concat(autoEscape);\n const hostEndingChars = [ \"/\", \"?\", \"#\" ];\n const hostnameMaxLen = 255;\n const hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/;\n const hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/;\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n // protocols that never have a hostname.\n const hostlessProtocol = {\n javascript: true,\n \"javascript:\": true\n };\n // protocols that always contain a // bit.\n const slashedProtocol = {\n http: true,\n https: true,\n ftp: true,\n gopher: true,\n file: true,\n \"http:\": true,\n \"https:\": true,\n \"ftp:\": true,\n \"gopher:\": true,\n \"file:\": true\n };\n function urlParse(url, slashesDenoteHost) {\n if (url && url instanceof Url) return url;\n const u = new Url;\n u.parse(url, slashesDenoteHost);\n return u;\n }\n Url.prototype.parse = function(url, slashesDenoteHost) {\n let lowerProto, hec, slashes;\n let rest = url;\n // trim before proceeding.\n // This is to support parse stuff like \" http://foo.com \\n\"\n rest = rest.trim();\n if (!slashesDenoteHost && url.split(\"#\").length === 1) {\n // Try fast path regexp\n const simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n }\n return this;\n }\n }\n let proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n lowerProto = proto.toLowerCase();\n this.protocol = proto;\n rest = rest.substr(proto.length);\n }\n // figure out if it's got a host\n // user@server is *always* interpreted as a hostname, and url\n // resolution will treat //foo/bar as host=foo,path=bar because that's\n // how the browser resolves relative URLs.\n /* eslint-disable-next-line no-useless-escape */ if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@\\/]+@[^@\\/]+/)) {\n slashes = rest.substr(0, 2) === \"//\";\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n if (!hostlessProtocol[proto] && (slashes || proto && !slashedProtocol[proto])) {\n // there's a hostname.\n // the first instance of /, ?, ;, or # ends the host.\n // If there is an @ in the hostname, then non-host chars *are* allowed\n // to the left of the last @ sign, unless some host-ending character\n // comes *before* the @-sign.\n // URLs are obnoxious.\n // ex:\n // http://a@b@c/ => user:a@b host:c\n // http://a@b?@c => user:a host:c path:/?@c\n // v0.12 TODO(isaacs): This is not quite how Chrome does things.\n // Review our test case against browsers more comprehensively.\n // find the first instance of any hostEndingChars\n let hostEnd = -1;\n for (let i = 0; i < hostEndingChars.length; i++) {\n hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec;\n }\n }\n // at this point, either we have an explicit point where the\n // auth portion cannot go past, or the last @ char is the decider.\n let auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf(\"@\");\n } else {\n // atSign must be in auth portion.\n // http://a@b/c@d => host:b auth:a path:/c@d\n atSign = rest.lastIndexOf(\"@\", hostEnd);\n }\n // Now we have a portion which is definitely the auth.\n // Pull that off.\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = auth;\n }\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (let i = 0; i < nonHostChars.length; i++) {\n hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) {\n hostEnd = hec;\n }\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1) {\n hostEnd = rest.length;\n }\n if (rest[hostEnd - 1] === \":\") {\n hostEnd--;\n }\n const host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n // pull out port.\n this.parseHost(host);\n // we've indicated that there is a hostname,\n // so even if it's empty, it has to be present.\n this.hostname = this.hostname || \"\";\n // if hostname begins with [ and ends with ]\n // assume that it's an IPv6 address.\n const ipv6Hostname = this.hostname[0] === \"[\" && this.hostname[this.hostname.length - 1] === \"]\";\n // validate a little.\n if (!ipv6Hostname) {\n const hostparts = this.hostname.split(/\\./);\n for (let i = 0, l = hostparts.length; i < l; i++) {\n const part = hostparts[i];\n if (!part) {\n continue;\n }\n if (!part.match(hostnamePartPattern)) {\n let newpart = \"\";\n for (let j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n // we replace non-ASCII char with a temporary placeholder\n // we need this to make sure size of hostname is not\n // broken by replacing non-ASCII by nothing\n newpart += \"x\";\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n const validParts = hostparts.slice(0, i);\n const notHost = hostparts.slice(i + 1);\n const bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = notHost.join(\".\") + rest;\n }\n this.hostname = validParts.join(\".\");\n break;\n }\n }\n }\n }\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = \"\";\n }\n // strip [ and ] from the hostname\n // the host field still retains them, though\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n }\n }\n // chop off from the tail first.\n const hash = rest.indexOf(\"#\");\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n const qm = rest.indexOf(\"?\");\n if (qm !== -1) {\n this.search = rest.substr(qm);\n rest = rest.slice(0, qm);\n }\n if (rest) {\n this.pathname = rest;\n }\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {\n this.pathname = \"\";\n }\n return this;\n };\n Url.prototype.parseHost = function(host) {\n let port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== \":\") {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) {\n this.hostname = host;\n }\n };\n var mdurl = Object.freeze({\n __proto__: null,\n decode: decode$1,\n encode: encode$1,\n format: format,\n parse: urlParse\n });\n var Any = /[\\0-\\uD7FF\\uE000-\\uFFFF]|[\\uD800-\\uDBFF][\\uDC00-\\uDFFF]|[\\uD800-\\uDBFF](?![\\uDC00-\\uDFFF])|(?:[^\\uD800-\\uDBFF]|^)[\\uDC00-\\uDFFF]/;\n var Cc = /[\\0-\\x1F\\x7F-\\x9F]/;\n var regex$1 = /[\\xAD\\u0600-\\u0605\\u061C\\u06DD\\u070F\\u0890\\u0891\\u08E2\\u180E\\u200B-\\u200F\\u202A-\\u202E\\u2060-\\u2064\\u2066-\\u206F\\uFEFF\\uFFF9-\\uFFFB]|\\uD804[\\uDCBD\\uDCCD]|\\uD80D[\\uDC30-\\uDC3F]|\\uD82F[\\uDCA0-\\uDCA3]|\\uD834[\\uDD73-\\uDD7A]|\\uDB40[\\uDC01\\uDC20-\\uDC7F]/;\n var P = /[!-#%-\\*,-\\/:;\\?@\\[-\\]_\\{\\}\\xA1\\xA7\\xAB\\xB6\\xB7\\xBB\\xBF\\u037E\\u0387\\u055A-\\u055F\\u0589\\u058A\\u05BE\\u05C0\\u05C3\\u05C6\\u05F3\\u05F4\\u0609\\u060A\\u060C\\u060D\\u061B\\u061D-\\u061F\\u066A-\\u066D\\u06D4\\u0700-\\u070D\\u07F7-\\u07F9\\u0830-\\u083E\\u085E\\u0964\\u0965\\u0970\\u09FD\\u0A76\\u0AF0\\u0C77\\u0C84\\u0DF4\\u0E4F\\u0E5A\\u0E5B\\u0F04-\\u0F12\\u0F14\\u0F3A-\\u0F3D\\u0F85\\u0FD0-\\u0FD4\\u0FD9\\u0FDA\\u104A-\\u104F\\u10FB\\u1360-\\u1368\\u1400\\u166E\\u169B\\u169C\\u16EB-\\u16ED\\u1735\\u1736\\u17D4-\\u17D6\\u17D8-\\u17DA\\u1800-\\u180A\\u1944\\u1945\\u1A1E\\u1A1F\\u1AA0-\\u1AA6\\u1AA8-\\u1AAD\\u1B5A-\\u1B60\\u1B7D\\u1B7E\\u1BFC-\\u1BFF\\u1C3B-\\u1C3F\\u1C7E\\u1C7F\\u1CC0-\\u1CC7\\u1CD3\\u2010-\\u2027\\u2030-\\u2043\\u2045-\\u2051\\u2053-\\u205E\\u207D\\u207E\\u208D\\u208E\\u2308-\\u230B\\u2329\\u232A\\u2768-\\u2775\\u27C5\\u27C6\\u27E6-\\u27EF\\u2983-\\u2998\\u29D8-\\u29DB\\u29FC\\u29FD\\u2CF9-\\u2CFC\\u2CFE\\u2CFF\\u2D70\\u2E00-\\u2E2E\\u2E30-\\u2E4F\\u2E52-\\u2E5D\\u3001-\\u3003\\u3008-\\u3011\\u3014-\\u301F\\u3030\\u303D\\u30A0\\u30FB\\uA4FE\\uA4FF\\uA60D-\\uA60F\\uA673\\uA67E\\uA6F2-\\uA6F7\\uA874-\\uA877\\uA8CE\\uA8CF\\uA8F8-\\uA8FA\\uA8FC\\uA92E\\uA92F\\uA95F\\uA9C1-\\uA9CD\\uA9DE\\uA9DF\\uAA5C-\\uAA5F\\uAADE\\uAADF\\uAAF0\\uAAF1\\uABEB\\uFD3E\\uFD3F\\uFE10-\\uFE19\\uFE30-\\uFE52\\uFE54-\\uFE61\\uFE63\\uFE68\\uFE6A\\uFE6B\\uFF01-\\uFF03\\uFF05-\\uFF0A\\uFF0C-\\uFF0F\\uFF1A\\uFF1B\\uFF1F\\uFF20\\uFF3B-\\uFF3D\\uFF3F\\uFF5B\\uFF5D\\uFF5F-\\uFF65]|\\uD800[\\uDD00-\\uDD02\\uDF9F\\uDFD0]|\\uD801\\uDD6F|\\uD802[\\uDC57\\uDD1F\\uDD3F\\uDE50-\\uDE58\\uDE7F\\uDEF0-\\uDEF6\\uDF39-\\uDF3F\\uDF99-\\uDF9C]|\\uD803[\\uDEAD\\uDF55-\\uDF59\\uDF86-\\uDF89]|\\uD804[\\uDC47-\\uDC4D\\uDCBB\\uDCBC\\uDCBE-\\uDCC1\\uDD40-\\uDD43\\uDD74\\uDD75\\uDDC5-\\uDDC8\\uDDCD\\uDDDB\\uDDDD-\\uDDDF\\uDE38-\\uDE3D\\uDEA9]|\\uD805[\\uDC4B-\\uDC4F\\uDC5A\\uDC5B\\uDC5D\\uDCC6\\uDDC1-\\uDDD7\\uDE41-\\uDE43\\uDE60-\\uDE6C\\uDEB9\\uDF3C-\\uDF3E]|\\uD806[\\uDC3B\\uDD44-\\uDD46\\uDDE2\\uDE3F-\\uDE46\\uDE9A-\\uDE9C\\uDE9E-\\uDEA2\\uDF00-\\uDF09]|\\uD807[\\uDC41-\\uDC45\\uDC70\\uDC71\\uDEF7\\uDEF8\\uDF43-\\uDF4F\\uDFFF]|\\uD809[\\uDC70-\\uDC74]|\\uD80B[\\uDFF1\\uDFF2]|\\uD81A[\\uDE6E\\uDE6F\\uDEF5\\uDF37-\\uDF3B\\uDF44]|\\uD81B[\\uDE97-\\uDE9A\\uDFE2]|\\uD82F\\uDC9F|\\uD836[\\uDE87-\\uDE8B]|\\uD83A[\\uDD5E\\uDD5F]/;\n var regex = /[\\$\\+<->\\^`\\|~\\xA2-\\xA6\\xA8\\xA9\\xAC\\xAE-\\xB1\\xB4\\xB8\\xD7\\xF7\\u02C2-\\u02C5\\u02D2-\\u02DF\\u02E5-\\u02EB\\u02ED\\u02EF-\\u02FF\\u0375\\u0384\\u0385\\u03F6\\u0482\\u058D-\\u058F\\u0606-\\u0608\\u060B\\u060E\\u060F\\u06DE\\u06E9\\u06FD\\u06FE\\u07F6\\u07FE\\u07FF\\u0888\\u09F2\\u09F3\\u09FA\\u09FB\\u0AF1\\u0B70\\u0BF3-\\u0BFA\\u0C7F\\u0D4F\\u0D79\\u0E3F\\u0F01-\\u0F03\\u0F13\\u0F15-\\u0F17\\u0F1A-\\u0F1F\\u0F34\\u0F36\\u0F38\\u0FBE-\\u0FC5\\u0FC7-\\u0FCC\\u0FCE\\u0FCF\\u0FD5-\\u0FD8\\u109E\\u109F\\u1390-\\u1399\\u166D\\u17DB\\u1940\\u19DE-\\u19FF\\u1B61-\\u1B6A\\u1B74-\\u1B7C\\u1FBD\\u1FBF-\\u1FC1\\u1FCD-\\u1FCF\\u1FDD-\\u1FDF\\u1FED-\\u1FEF\\u1FFD\\u1FFE\\u2044\\u2052\\u207A-\\u207C\\u208A-\\u208C\\u20A0-\\u20C0\\u2100\\u2101\\u2103-\\u2106\\u2108\\u2109\\u2114\\u2116-\\u2118\\u211E-\\u2123\\u2125\\u2127\\u2129\\u212E\\u213A\\u213B\\u2140-\\u2144\\u214A-\\u214D\\u214F\\u218A\\u218B\\u2190-\\u2307\\u230C-\\u2328\\u232B-\\u2426\\u2440-\\u244A\\u249C-\\u24E9\\u2500-\\u2767\\u2794-\\u27C4\\u27C7-\\u27E5\\u27F0-\\u2982\\u2999-\\u29D7\\u29DC-\\u29FB\\u29FE-\\u2B73\\u2B76-\\u2B95\\u2B97-\\u2BFF\\u2CE5-\\u2CEA\\u2E50\\u2E51\\u2E80-\\u2E99\\u2E9B-\\u2EF3\\u2F00-\\u2FD5\\u2FF0-\\u2FFF\\u3004\\u3012\\u3013\\u3020\\u3036\\u3037\\u303E\\u303F\\u309B\\u309C\\u3190\\u3191\\u3196-\\u319F\\u31C0-\\u31E3\\u31EF\\u3200-\\u321E\\u322A-\\u3247\\u3250\\u3260-\\u327F\\u328A-\\u32B0\\u32C0-\\u33FF\\u4DC0-\\u4DFF\\uA490-\\uA4C6\\uA700-\\uA716\\uA720\\uA721\\uA789\\uA78A\\uA828-\\uA82B\\uA836-\\uA839\\uAA77-\\uAA79\\uAB5B\\uAB6A\\uAB6B\\uFB29\\uFBB2-\\uFBC2\\uFD40-\\uFD4F\\uFDCF\\uFDFC-\\uFDFF\\uFE62\\uFE64-\\uFE66\\uFE69\\uFF04\\uFF0B\\uFF1C-\\uFF1E\\uFF3E\\uFF40\\uFF5C\\uFF5E\\uFFE0-\\uFFE6\\uFFE8-\\uFFEE\\uFFFC\\uFFFD]|\\uD800[\\uDD37-\\uDD3F\\uDD79-\\uDD89\\uDD8C-\\uDD8E\\uDD90-\\uDD9C\\uDDA0\\uDDD0-\\uDDFC]|\\uD802[\\uDC77\\uDC78\\uDEC8]|\\uD805\\uDF3F|\\uD807[\\uDFD5-\\uDFF1]|\\uD81A[\\uDF3C-\\uDF3F\\uDF45]|\\uD82F\\uDC9C|\\uD833[\\uDF50-\\uDFC3]|\\uD834[\\uDC00-\\uDCF5\\uDD00-\\uDD26\\uDD29-\\uDD64\\uDD6A-\\uDD6C\\uDD83\\uDD84\\uDD8C-\\uDDA9\\uDDAE-\\uDDEA\\uDE00-\\uDE41\\uDE45\\uDF00-\\uDF56]|\\uD835[\\uDEC1\\uDEDB\\uDEFB\\uDF15\\uDF35\\uDF4F\\uDF6F\\uDF89\\uDFA9\\uDFC3]|\\uD836[\\uDC00-\\uDDFF\\uDE37-\\uDE3A\\uDE6D-\\uDE74\\uDE76-\\uDE83\\uDE85\\uDE86]|\\uD838[\\uDD4F\\uDEFF]|\\uD83B[\\uDCAC\\uDCB0\\uDD2E\\uDEF0\\uDEF1]|\\uD83C[\\uDC00-\\uDC2B\\uDC30-\\uDC93\\uDCA0-\\uDCAE\\uDCB1-\\uDCBF\\uDCC1-\\uDCCF\\uDCD1-\\uDCF5\\uDD0D-\\uDDAD\\uDDE6-\\uDE02\\uDE10-\\uDE3B\\uDE40-\\uDE48\\uDE50\\uDE51\\uDE60-\\uDE65\\uDF00-\\uDFFF]|\\uD83D[\\uDC00-\\uDED7\\uDEDC-\\uDEEC\\uDEF0-\\uDEFC\\uDF00-\\uDF76\\uDF7B-\\uDFD9\\uDFE0-\\uDFEB\\uDFF0]|\\uD83E[\\uDC00-\\uDC0B\\uDC10-\\uDC47\\uDC50-\\uDC59\\uDC60-\\uDC87\\uDC90-\\uDCAD\\uDCB0\\uDCB1\\uDD00-\\uDE53\\uDE60-\\uDE6D\\uDE70-\\uDE7C\\uDE80-\\uDE88\\uDE90-\\uDEBD\\uDEBF-\\uDEC5\\uDECE-\\uDEDB\\uDEE0-\\uDEE8\\uDEF0-\\uDEF8\\uDF00-\\uDF92\\uDF94-\\uDFCA]/;\n var Z = /[ \\xA0\\u1680\\u2000-\\u200A\\u2028\\u2029\\u202F\\u205F\\u3000]/;\n var ucmicro = Object.freeze({\n __proto__: null,\n Any: Any,\n Cc: Cc,\n Cf: regex$1,\n P: P,\n S: regex,\n Z: Z\n });\n // Generated using scripts/write-decode-map.ts\n var htmlDecodeTree = new Uint16Array(\n // prettier-ignore\n '\\u1d41<\\xd5\\u0131\\u028a\\u049d\\u057b\\u05d0\\u0675\\u06de\\u07a2\\u07d6\\u080f\\u0a4a\\u0a91\\u0da1\\u0e6d\\u0f09\\u0f26\\u10ca\\u1228\\u12e1\\u1415\\u149d\\u14c3\\u14df\\u1525\\0\\0\\0\\0\\0\\0\\u156b\\u16cd\\u198d\\u1c12\\u1ddd\\u1f7e\\u2060\\u21b0\\u228d\\u23c0\\u23fb\\u2442\\u2824\\u2912\\u2d08\\u2e48\\u2fce\\u3016\\u32ba\\u3639\\u37ac\\u38fe\\u3a28\\u3a71\\u3ae0\\u3b2e\\u0800EMabcfglmnoprstu\\\\bfms\\x7f\\x84\\x8b\\x90\\x95\\x98\\xa6\\xb3\\xb9\\xc8\\xcflig\\u803b\\xc6\\u40c6P\\u803b&\\u4026cute\\u803b\\xc1\\u40c1reve;\\u4102\\u0100iyx}rc\\u803b\\xc2\\u40c2;\\u4410r;\\uc000\\ud835\\udd04rave\\u803b\\xc0\\u40c0pha;\\u4391acr;\\u4100d;\\u6a53\\u0100gp\\x9d\\xa1on;\\u4104f;\\uc000\\ud835\\udd38plyFunction;\\u6061ing\\u803b\\xc5\\u40c5\\u0100cs\\xbe\\xc3r;\\uc000\\ud835\\udc9cign;\\u6254ilde\\u803b\\xc3\\u40c3ml\\u803b\\xc4\\u40c4\\u0400aceforsu\\xe5\\xfb\\xfe\\u0117\\u011c\\u0122\\u0127\\u012a\\u0100cr\\xea\\xf2kslash;\\u6216\\u0176\\xf6\\xf8;\\u6ae7ed;\\u6306y;\\u4411\\u0180crt\\u0105\\u010b\\u0114ause;\\u6235noullis;\\u612ca;\\u4392r;\\uc000\\ud835\\udd05pf;\\uc000\\ud835\\udd39eve;\\u42d8c\\xf2\\u0113mpeq;\\u624e\\u0700HOacdefhilorsu\\u014d\\u0151\\u0156\\u0180\\u019e\\u01a2\\u01b5\\u01b7\\u01ba\\u01dc\\u0215\\u0273\\u0278\\u027ecy;\\u4427PY\\u803b\\xa9\\u40a9\\u0180cpy\\u015d\\u0162\\u017aute;\\u4106\\u0100;i\\u0167\\u0168\\u62d2talDifferentialD;\\u6145leys;\\u612d\\u0200aeio\\u0189\\u018e\\u0194\\u0198ron;\\u410cdil\\u803b\\xc7\\u40c7rc;\\u4108nint;\\u6230ot;\\u410a\\u0100dn\\u01a7\\u01adilla;\\u40b8terDot;\\u40b7\\xf2\\u017fi;\\u43a7rcle\\u0200DMPT\\u01c7\\u01cb\\u01d1\\u01d6ot;\\u6299inus;\\u6296lus;\\u6295imes;\\u6297o\\u0100cs\\u01e2\\u01f8kwiseContourIntegral;\\u6232eCurly\\u0100DQ\\u0203\\u020foubleQuote;\\u601duote;\\u6019\\u0200lnpu\\u021e\\u0228\\u0247\\u0255on\\u0100;e\\u0225\\u0226\\u6237;\\u6a74\\u0180git\\u022f\\u0236\\u023aruent;\\u6261nt;\\u622fourIntegral;\\u622e\\u0100fr\\u024c\\u024e;\\u6102oduct;\\u6210nterClockwiseContourIntegral;\\u6233oss;\\u6a2fcr;\\uc000\\ud835\\udc9ep\\u0100;C\\u0284\\u0285\\u62d3ap;\\u624d\\u0580DJSZacefios\\u02a0\\u02ac\\u02b0\\u02b4\\u02b8\\u02cb\\u02d7\\u02e1\\u02e6\\u0333\\u048d\\u0100;o\\u0179\\u02a5trahd;\\u6911cy;\\u4402cy;\\u4405cy;\\u440f\\u0180grs\\u02bf\\u02c4\\u02c7ger;\\u6021r;\\u61a1hv;\\u6ae4\\u0100ay\\u02d0\\u02d5ron;\\u410e;\\u4414l\\u0100;t\\u02dd\\u02de\\u6207a;\\u4394r;\\uc000\\ud835\\udd07\\u0100af\\u02eb\\u0327\\u0100cm\\u02f0\\u0322ritical\\u0200ADGT\\u0300\\u0306\\u0316\\u031ccute;\\u40b4o\\u0174\\u030b\\u030d;\\u42d9bleAcute;\\u42ddrave;\\u4060ilde;\\u42dcond;\\u62c4ferentialD;\\u6146\\u0470\\u033d\\0\\0\\0\\u0342\\u0354\\0\\u0405f;\\uc000\\ud835\\udd3b\\u0180;DE\\u0348\\u0349\\u034d\\u40a8ot;\\u60dcqual;\\u6250ble\\u0300CDLRUV\\u0363\\u0372\\u0382\\u03cf\\u03e2\\u03f8ontourIntegra\\xec\\u0239o\\u0274\\u0379\\0\\0\\u037b\\xbb\\u0349nArrow;\\u61d3\\u0100eo\\u0387\\u03a4ft\\u0180ART\\u0390\\u0396\\u03a1rrow;\\u61d0ightArrow;\\u61d4e\\xe5\\u02cang\\u0100LR\\u03ab\\u03c4eft\\u0100AR\\u03b3\\u03b9rrow;\\u67f8ightArrow;\\u67faightArrow;\\u67f9ight\\u0100AT\\u03d8\\u03derrow;\\u61d2ee;\\u62a8p\\u0241\\u03e9\\0\\0\\u03efrrow;\\u61d1ownArrow;\\u61d5erticalBar;\\u6225n\\u0300ABLRTa\\u0412\\u042a\\u0430\\u045e\\u047f\\u037crrow\\u0180;BU\\u041d\\u041e\\u0422\\u6193ar;\\u6913pArrow;\\u61f5reve;\\u4311eft\\u02d2\\u043a\\0\\u0446\\0\\u0450ightVector;\\u6950eeVector;\\u695eector\\u0100;B\\u0459\\u045a\\u61bdar;\\u6956ight\\u01d4\\u0467\\0\\u0471eeVector;\\u695fector\\u0100;B\\u047a\\u047b\\u61c1ar;\\u6957ee\\u0100;A\\u0486\\u0487\\u62a4rrow;\\u61a7\\u0100ct\\u0492\\u0497r;\\uc000\\ud835\\udc9frok;\\u4110\\u0800NTacdfglmopqstux\\u04bd\\u04c0\\u04c4\\u04cb\\u04de\\u04e2\\u04e7\\u04ee\\u04f5\\u0521\\u052f\\u0536\\u0552\\u055d\\u0560\\u0565G;\\u414aH\\u803b\\xd0\\u40d0cute\\u803b\\xc9\\u40c9\\u0180aiy\\u04d2\\u04d7\\u04dcron;\\u411arc\\u803b\\xca\\u40ca;\\u442dot;\\u4116r;\\uc000\\ud835\\udd08rave\\u803b\\xc8\\u40c8ement;\\u6208\\u0100ap\\u04fa\\u04fecr;\\u4112ty\\u0253\\u0506\\0\\0\\u0512mallSquare;\\u65fberySmallSquare;\\u65ab\\u0100gp\\u0526\\u052aon;\\u4118f;\\uc000\\ud835\\udd3csilon;\\u4395u\\u0100ai\\u053c\\u0549l\\u0100;T\\u0542\\u0543\\u6a75ilde;\\u6242librium;\\u61cc\\u0100ci\\u0557\\u055ar;\\u6130m;\\u6a73a;\\u4397ml\\u803b\\xcb\\u40cb\\u0100ip\\u056a\\u056fsts;\\u6203onentialE;\\u6147\\u0280cfios\\u0585\\u0588\\u058d\\u05b2\\u05ccy;\\u4424r;\\uc000\\ud835\\udd09lled\\u0253\\u0597\\0\\0\\u05a3mallSquare;\\u65fcerySmallSquare;\\u65aa\\u0370\\u05ba\\0\\u05bf\\0\\0\\u05c4f;\\uc000\\ud835\\udd3dAll;\\u6200riertrf;\\u6131c\\xf2\\u05cb\\u0600JTabcdfgorst\\u05e8\\u05ec\\u05ef\\u05fa\\u0600\\u0612\\u0616\\u061b\\u061d\\u0623\\u066c\\u0672cy;\\u4403\\u803b>\\u403emma\\u0100;d\\u05f7\\u05f8\\u4393;\\u43dcreve;\\u411e\\u0180eiy\\u0607\\u060c\\u0610dil;\\u4122rc;\\u411c;\\u4413ot;\\u4120r;\\uc000\\ud835\\udd0a;\\u62d9pf;\\uc000\\ud835\\udd3eeater\\u0300EFGLST\\u0635\\u0644\\u064e\\u0656\\u065b\\u0666qual\\u0100;L\\u063e\\u063f\\u6265ess;\\u62dbullEqual;\\u6267reater;\\u6aa2ess;\\u6277lantEqual;\\u6a7eilde;\\u6273cr;\\uc000\\ud835\\udca2;\\u626b\\u0400Aacfiosu\\u0685\\u068b\\u0696\\u069b\\u069e\\u06aa\\u06be\\u06caRDcy;\\u442a\\u0100ct\\u0690\\u0694ek;\\u42c7;\\u405eirc;\\u4124r;\\u610clbertSpace;\\u610b\\u01f0\\u06af\\0\\u06b2f;\\u610dizontalLine;\\u6500\\u0100ct\\u06c3\\u06c5\\xf2\\u06a9rok;\\u4126mp\\u0144\\u06d0\\u06d8ownHum\\xf0\\u012fqual;\\u624f\\u0700EJOacdfgmnostu\\u06fa\\u06fe\\u0703\\u0707\\u070e\\u071a\\u071e\\u0721\\u0728\\u0744\\u0778\\u078b\\u078f\\u0795cy;\\u4415lig;\\u4132cy;\\u4401cute\\u803b\\xcd\\u40cd\\u0100iy\\u0713\\u0718rc\\u803b\\xce\\u40ce;\\u4418ot;\\u4130r;\\u6111rave\\u803b\\xcc\\u40cc\\u0180;ap\\u0720\\u072f\\u073f\\u0100cg\\u0734\\u0737r;\\u412ainaryI;\\u6148lie\\xf3\\u03dd\\u01f4\\u0749\\0\\u0762\\u0100;e\\u074d\\u074e\\u622c\\u0100gr\\u0753\\u0758ral;\\u622bsection;\\u62c2isible\\u0100CT\\u076c\\u0772omma;\\u6063imes;\\u6062\\u0180gpt\\u077f\\u0783\\u0788on;\\u412ef;\\uc000\\ud835\\udd40a;\\u4399cr;\\u6110ilde;\\u4128\\u01eb\\u079a\\0\\u079ecy;\\u4406l\\u803b\\xcf\\u40cf\\u0280cfosu\\u07ac\\u07b7\\u07bc\\u07c2\\u07d0\\u0100iy\\u07b1\\u07b5rc;\\u4134;\\u4419r;\\uc000\\ud835\\udd0dpf;\\uc000\\ud835\\udd41\\u01e3\\u07c7\\0\\u07ccr;\\uc000\\ud835\\udca5rcy;\\u4408kcy;\\u4404\\u0380HJacfos\\u07e4\\u07e8\\u07ec\\u07f1\\u07fd\\u0802\\u0808cy;\\u4425cy;\\u440cppa;\\u439a\\u0100ey\\u07f6\\u07fbdil;\\u4136;\\u441ar;\\uc000\\ud835\\udd0epf;\\uc000\\ud835\\udd42cr;\\uc000\\ud835\\udca6\\u0580JTaceflmost\\u0825\\u0829\\u082c\\u0850\\u0863\\u09b3\\u09b8\\u09c7\\u09cd\\u0a37\\u0a47cy;\\u4409\\u803b<\\u403c\\u0280cmnpr\\u0837\\u083c\\u0841\\u0844\\u084dute;\\u4139bda;\\u439bg;\\u67ealacetrf;\\u6112r;\\u619e\\u0180aey\\u0857\\u085c\\u0861ron;\\u413ddil;\\u413b;\\u441b\\u0100fs\\u0868\\u0970t\\u0500ACDFRTUVar\\u087e\\u08a9\\u08b1\\u08e0\\u08e6\\u08fc\\u092f\\u095b\\u0390\\u096a\\u0100nr\\u0883\\u088fgleBracket;\\u67e8row\\u0180;BR\\u0899\\u089a\\u089e\\u6190ar;\\u61e4ightArrow;\\u61c6eiling;\\u6308o\\u01f5\\u08b7\\0\\u08c3bleBracket;\\u67e6n\\u01d4\\u08c8\\0\\u08d2eeVector;\\u6961ector\\u0100;B\\u08db\\u08dc\\u61c3ar;\\u6959loor;\\u630aight\\u0100AV\\u08ef\\u08f5rrow;\\u6194ector;\\u694e\\u0100er\\u0901\\u0917e\\u0180;AV\\u0909\\u090a\\u0910\\u62a3rrow;\\u61a4ector;\\u695aiangle\\u0180;BE\\u0924\\u0925\\u0929\\u62b2ar;\\u69cfqual;\\u62b4p\\u0180DTV\\u0937\\u0942\\u094cownVector;\\u6951eeVector;\\u6960ector\\u0100;B\\u0956\\u0957\\u61bfar;\\u6958ector\\u0100;B\\u0965\\u0966\\u61bcar;\\u6952ight\\xe1\\u039cs\\u0300EFGLST\\u097e\\u098b\\u0995\\u099d\\u09a2\\u09adqualGreater;\\u62daullEqual;\\u6266reater;\\u6276ess;\\u6aa1lantEqual;\\u6a7dilde;\\u6272r;\\uc000\\ud835\\udd0f\\u0100;e\\u09bd\\u09be\\u62d8ftarrow;\\u61daidot;\\u413f\\u0180npw\\u09d4\\u0a16\\u0a1bg\\u0200LRlr\\u09de\\u09f7\\u0a02\\u0a10eft\\u0100AR\\u09e6\\u09ecrrow;\\u67f5ightArrow;\\u67f7ightArrow;\\u67f6eft\\u0100ar\\u03b3\\u0a0aight\\xe1\\u03bfight\\xe1\\u03caf;\\uc000\\ud835\\udd43er\\u0100LR\\u0a22\\u0a2ceftArrow;\\u6199ightArrow;\\u6198\\u0180cht\\u0a3e\\u0a40\\u0a42\\xf2\\u084c;\\u61b0rok;\\u4141;\\u626a\\u0400acefiosu\\u0a5a\\u0a5d\\u0a60\\u0a77\\u0a7c\\u0a85\\u0a8b\\u0a8ep;\\u6905y;\\u441c\\u0100dl\\u0a65\\u0a6fiumSpace;\\u605flintrf;\\u6133r;\\uc000\\ud835\\udd10nusPlus;\\u6213pf;\\uc000\\ud835\\udd44c\\xf2\\u0a76;\\u439c\\u0480Jacefostu\\u0aa3\\u0aa7\\u0aad\\u0ac0\\u0b14\\u0b19\\u0d91\\u0d97\\u0d9ecy;\\u440acute;\\u4143\\u0180aey\\u0ab4\\u0ab9\\u0aberon;\\u4147dil;\\u4145;\\u441d\\u0180gsw\\u0ac7\\u0af0\\u0b0eative\\u0180MTV\\u0ad3\\u0adf\\u0ae8ediumSpace;\\u600bhi\\u0100cn\\u0ae6\\u0ad8\\xeb\\u0ad9eryThi\\xee\\u0ad9ted\\u0100GL\\u0af8\\u0b06reaterGreate\\xf2\\u0673essLes\\xf3\\u0a48Line;\\u400ar;\\uc000\\ud835\\udd11\\u0200Bnpt\\u0b22\\u0b28\\u0b37\\u0b3areak;\\u6060BreakingSpace;\\u40a0f;\\u6115\\u0680;CDEGHLNPRSTV\\u0b55\\u0b56\\u0b6a\\u0b7c\\u0ba1\\u0beb\\u0c04\\u0c5e\\u0c84\\u0ca6\\u0cd8\\u0d61\\u0d85\\u6aec\\u0100ou\\u0b5b\\u0b64ngruent;\\u6262pCap;\\u626doubleVerticalBar;\\u6226\\u0180lqx\\u0b83\\u0b8a\\u0b9bement;\\u6209ual\\u0100;T\\u0b92\\u0b93\\u6260ilde;\\uc000\\u2242\\u0338ists;\\u6204reater\\u0380;EFGLST\\u0bb6\\u0bb7\\u0bbd\\u0bc9\\u0bd3\\u0bd8\\u0be5\\u626fqual;\\u6271ullEqual;\\uc000\\u2267\\u0338reater;\\uc000\\u226b\\u0338ess;\\u6279lantEqual;\\uc000\\u2a7e\\u0338ilde;\\u6275ump\\u0144\\u0bf2\\u0bfdownHump;\\uc000\\u224e\\u0338qual;\\uc000\\u224f\\u0338e\\u0100fs\\u0c0a\\u0c27tTriangle\\u0180;BE\\u0c1a\\u0c1b\\u0c21\\u62eaar;\\uc000\\u29cf\\u0338qual;\\u62ecs\\u0300;EGLST\\u0c35\\u0c36\\u0c3c\\u0c44\\u0c4b\\u0c58\\u626equal;\\u6270reater;\\u6278ess;\\uc000\\u226a\\u0338lantEqual;\\uc000\\u2a7d\\u0338ilde;\\u6274ested\\u0100GL\\u0c68\\u0c79reaterGreater;\\uc000\\u2aa2\\u0338essLess;\\uc000\\u2aa1\\u0338recedes\\u0180;ES\\u0c92\\u0c93\\u0c9b\\u6280qual;\\uc000\\u2aaf\\u0338lantEqual;\\u62e0\\u0100ei\\u0cab\\u0cb9verseElement;\\u620cghtTriangle\\u0180;BE\\u0ccb\\u0ccc\\u0cd2\\u62ebar;\\uc000\\u29d0\\u0338qual;\\u62ed\\u0100qu\\u0cdd\\u0d0cuareSu\\u0100bp\\u0ce8\\u0cf9set\\u0100;E\\u0cf0\\u0cf3\\uc000\\u228f\\u0338qual;\\u62e2erset\\u0100;E\\u0d03\\u0d06\\uc000\\u2290\\u0338qual;\\u62e3\\u0180bcp\\u0d13\\u0d24\\u0d4eset\\u0100;E\\u0d1b\\u0d1e\\uc000\\u2282\\u20d2qual;\\u6288ceeds\\u0200;EST\\u0d32\\u0d33\\u0d3b\\u0d46\\u6281qual;\\uc000\\u2ab0\\u0338lantEqual;\\u62e1ilde;\\uc000\\u227f\\u0338erset\\u0100;E\\u0d58\\u0d5b\\uc000\\u2283\\u20d2qual;\\u6289ilde\\u0200;EFT\\u0d6e\\u0d6f\\u0d75\\u0d7f\\u6241qual;\\u6244ullEqual;\\u6247ilde;\\u6249erticalBar;\\u6224cr;\\uc000\\ud835\\udca9ilde\\u803b\\xd1\\u40d1;\\u439d\\u0700Eacdfgmoprstuv\\u0dbd\\u0dc2\\u0dc9\\u0dd5\\u0ddb\\u0de0\\u0de7\\u0dfc\\u0e02\\u0e20\\u0e22\\u0e32\\u0e3f\\u0e44lig;\\u4152cute\\u803b\\xd3\\u40d3\\u0100iy\\u0dce\\u0dd3rc\\u803b\\xd4\\u40d4;\\u441eblac;\\u4150r;\\uc000\\ud835\\udd12rave\\u803b\\xd2\\u40d2\\u0180aei\\u0dee\\u0df2\\u0df6cr;\\u414cga;\\u43a9cron;\\u439fpf;\\uc000\\ud835\\udd46enCurly\\u0100DQ\\u0e0e\\u0e1aoubleQuote;\\u601cuote;\\u6018;\\u6a54\\u0100cl\\u0e27\\u0e2cr;\\uc000\\ud835\\udcaaash\\u803b\\xd8\\u40d8i\\u016c\\u0e37\\u0e3cde\\u803b\\xd5\\u40d5es;\\u6a37ml\\u803b\\xd6\\u40d6er\\u0100BP\\u0e4b\\u0e60\\u0100ar\\u0e50\\u0e53r;\\u603eac\\u0100ek\\u0e5a\\u0e5c;\\u63deet;\\u63b4arenthesis;\\u63dc\\u0480acfhilors\\u0e7f\\u0e87\\u0e8a\\u0e8f\\u0e92\\u0e94\\u0e9d\\u0eb0\\u0efcrtialD;\\u6202y;\\u441fr;\\uc000\\ud835\\udd13i;\\u43a6;\\u43a0usMinus;\\u40b1\\u0100ip\\u0ea2\\u0eadncareplan\\xe5\\u069df;\\u6119\\u0200;eio\\u0eb9\\u0eba\\u0ee0\\u0ee4\\u6abbcedes\\u0200;EST\\u0ec8\\u0ec9\\u0ecf\\u0eda\\u627aqual;\\u6aaflantEqual;\\u627cilde;\\u627eme;\\u6033\\u0100dp\\u0ee9\\u0eeeuct;\\u620fortion\\u0100;a\\u0225\\u0ef9l;\\u621d\\u0100ci\\u0f01\\u0f06r;\\uc000\\ud835\\udcab;\\u43a8\\u0200Ufos\\u0f11\\u0f16\\u0f1b\\u0f1fOT\\u803b\"\\u4022r;\\uc000\\ud835\\udd14pf;\\u611acr;\\uc000\\ud835\\udcac\\u0600BEacefhiorsu\\u0f3e\\u0f43\\u0f47\\u0f60\\u0f73\\u0fa7\\u0faa\\u0fad\\u1096\\u10a9\\u10b4\\u10bearr;\\u6910G\\u803b\\xae\\u40ae\\u0180cnr\\u0f4e\\u0f53\\u0f56ute;\\u4154g;\\u67ebr\\u0100;t\\u0f5c\\u0f5d\\u61a0l;\\u6916\\u0180aey\\u0f67\\u0f6c\\u0f71ron;\\u4158dil;\\u4156;\\u4420\\u0100;v\\u0f78\\u0f79\\u611cerse\\u0100EU\\u0f82\\u0f99\\u0100lq\\u0f87\\u0f8eement;\\u620builibrium;\\u61cbpEquilibrium;\\u696fr\\xbb\\u0f79o;\\u43a1ght\\u0400ACDFTUVa\\u0fc1\\u0feb\\u0ff3\\u1022\\u1028\\u105b\\u1087\\u03d8\\u0100nr\\u0fc6\\u0fd2gleBracket;\\u67e9row\\u0180;BL\\u0fdc\\u0fdd\\u0fe1\\u6192ar;\\u61e5eftArrow;\\u61c4eiling;\\u6309o\\u01f5\\u0ff9\\0\\u1005bleBracket;\\u67e7n\\u01d4\\u100a\\0\\u1014eeVector;\\u695dector\\u0100;B\\u101d\\u101e\\u61c2ar;\\u6955loor;\\u630b\\u0100er\\u102d\\u1043e\\u0180;AV\\u1035\\u1036\\u103c\\u62a2rrow;\\u61a6ector;\\u695biangle\\u0180;BE\\u1050\\u1051\\u1055\\u62b3ar;\\u69d0qual;\\u62b5p\\u0180DTV\\u1063\\u106e\\u1078ownVector;\\u694feeVector;\\u695cector\\u0100;B\\u1082\\u1083\\u61bear;\\u6954ector\\u0100;B\\u1091\\u1092\\u61c0ar;\\u6953\\u0100pu\\u109b\\u109ef;\\u611dndImplies;\\u6970ightarrow;\\u61db\\u0100ch\\u10b9\\u10bcr;\\u611b;\\u61b1leDelayed;\\u69f4\\u0680HOacfhimoqstu\\u10e4\\u10f1\\u10f7\\u10fd\\u1119\\u111e\\u1151\\u1156\\u1161\\u1167\\u11b5\\u11bb\\u11bf\\u0100Cc\\u10e9\\u10eeHcy;\\u4429y;\\u4428FTcy;\\u442ccute;\\u415a\\u0280;aeiy\\u1108\\u1109\\u110e\\u1113\\u1117\\u6abcron;\\u4160dil;\\u415erc;\\u415c;\\u4421r;\\uc000\\ud835\\udd16ort\\u0200DLRU\\u112a\\u1134\\u113e\\u1149ownArrow\\xbb\\u041eeftArrow\\xbb\\u089aightArrow\\xbb\\u0fddpArrow;\\u6191gma;\\u43a3allCircle;\\u6218pf;\\uc000\\ud835\\udd4a\\u0272\\u116d\\0\\0\\u1170t;\\u621aare\\u0200;ISU\\u117b\\u117c\\u1189\\u11af\\u65a1ntersection;\\u6293u\\u0100bp\\u118f\\u119eset\\u0100;E\\u1197\\u1198\\u628fqual;\\u6291erset\\u0100;E\\u11a8\\u11a9\\u6290qual;\\u6292nion;\\u6294cr;\\uc000\\ud835\\udcaear;\\u62c6\\u0200bcmp\\u11c8\\u11db\\u1209\\u120b\\u0100;s\\u11cd\\u11ce\\u62d0et\\u0100;E\\u11cd\\u11d5qual;\\u6286\\u0100ch\\u11e0\\u1205eeds\\u0200;EST\\u11ed\\u11ee\\u11f4\\u11ff\\u627bqual;\\u6ab0lantEqual;\\u627dilde;\\u627fTh\\xe1\\u0f8c;\\u6211\\u0180;es\\u1212\\u1213\\u1223\\u62d1rset\\u0100;E\\u121c\\u121d\\u6283qual;\\u6287et\\xbb\\u1213\\u0580HRSacfhiors\\u123e\\u1244\\u1249\\u1255\\u125e\\u1271\\u1276\\u129f\\u12c2\\u12c8\\u12d1ORN\\u803b\\xde\\u40deADE;\\u6122\\u0100Hc\\u124e\\u1252cy;\\u440by;\\u4426\\u0100bu\\u125a\\u125c;\\u4009;\\u43a4\\u0180aey\\u1265\\u126a\\u126fron;\\u4164dil;\\u4162;\\u4422r;\\uc000\\ud835\\udd17\\u0100ei\\u127b\\u1289\\u01f2\\u1280\\0\\u1287efore;\\u6234a;\\u4398\\u0100cn\\u128e\\u1298kSpace;\\uc000\\u205f\\u200aSpace;\\u6009lde\\u0200;EFT\\u12ab\\u12ac\\u12b2\\u12bc\\u623cqual;\\u6243ullEqual;\\u6245ilde;\\u6248pf;\\uc000\\ud835\\udd4bipleDot;\\u60db\\u0100ct\\u12d6\\u12dbr;\\uc000\\ud835\\udcafrok;\\u4166\\u0ae1\\u12f7\\u130e\\u131a\\u1326\\0\\u132c\\u1331\\0\\0\\0\\0\\0\\u1338\\u133d\\u1377\\u1385\\0\\u13ff\\u1404\\u140a\\u1410\\u0100cr\\u12fb\\u1301ute\\u803b\\xda\\u40dar\\u0100;o\\u1307\\u1308\\u619fcir;\\u6949r\\u01e3\\u1313\\0\\u1316y;\\u440eve;\\u416c\\u0100iy\\u131e\\u1323rc\\u803b\\xdb\\u40db;\\u4423blac;\\u4170r;\\uc000\\ud835\\udd18rave\\u803b\\xd9\\u40d9acr;\\u416a\\u0100di\\u1341\\u1369er\\u0100BP\\u1348\\u135d\\u0100ar\\u134d\\u1350r;\\u405fac\\u0100ek\\u1357\\u1359;\\u63dfet;\\u63b5arenthesis;\\u63ddon\\u0100;P\\u1370\\u1371\\u62c3lus;\\u628e\\u0100gp\\u137b\\u137fon;\\u4172f;\\uc000\\ud835\\udd4c\\u0400ADETadps\\u1395\\u13ae\\u13b8\\u13c4\\u03e8\\u13d2\\u13d7\\u13f3rrow\\u0180;BD\\u1150\\u13a0\\u13a4ar;\\u6912ownArrow;\\u61c5ownArrow;\\u6195quilibrium;\\u696eee\\u0100;A\\u13cb\\u13cc\\u62a5rrow;\\u61a5own\\xe1\\u03f3er\\u0100LR\\u13de\\u13e8eftArrow;\\u6196ightArrow;\\u6197i\\u0100;l\\u13f9\\u13fa\\u43d2on;\\u43a5ing;\\u416ecr;\\uc000\\ud835\\udcb0ilde;\\u4168ml\\u803b\\xdc\\u40dc\\u0480Dbcdefosv\\u1427\\u142c\\u1430\\u1433\\u143e\\u1485\\u148a\\u1490\\u1496ash;\\u62abar;\\u6aeby;\\u4412ash\\u0100;l\\u143b\\u143c\\u62a9;\\u6ae6\\u0100er\\u1443\\u1445;\\u62c1\\u0180bty\\u144c\\u1450\\u147aar;\\u6016\\u0100;i\\u144f\\u1455cal\\u0200BLST\\u1461\\u1465\\u146a\\u1474ar;\\u6223ine;\\u407ceparator;\\u6758ilde;\\u6240ThinSpace;\\u600ar;\\uc000\\ud835\\udd19pf;\\uc000\\ud835\\udd4dcr;\\uc000\\ud835\\udcb1dash;\\u62aa\\u0280cefos\\u14a7\\u14ac\\u14b1\\u14b6\\u14bcirc;\\u4174dge;\\u62c0r;\\uc000\\ud835\\udd1apf;\\uc000\\ud835\\udd4ecr;\\uc000\\ud835\\udcb2\\u0200fios\\u14cb\\u14d0\\u14d2\\u14d8r;\\uc000\\ud835\\udd1b;\\u439epf;\\uc000\\ud835\\udd4fcr;\\uc000\\ud835\\udcb3\\u0480AIUacfosu\\u14f1\\u14f5\\u14f9\\u14fd\\u1504\\u150f\\u1514\\u151a\\u1520cy;\\u442fcy;\\u4407cy;\\u442ecute\\u803b\\xdd\\u40dd\\u0100iy\\u1509\\u150drc;\\u4176;\\u442br;\\uc000\\ud835\\udd1cpf;\\uc000\\ud835\\udd50cr;\\uc000\\ud835\\udcb4ml;\\u4178\\u0400Hacdefos\\u1535\\u1539\\u153f\\u154b\\u154f\\u155d\\u1560\\u1564cy;\\u4416cute;\\u4179\\u0100ay\\u1544\\u1549ron;\\u417d;\\u4417ot;\\u417b\\u01f2\\u1554\\0\\u155boWidt\\xe8\\u0ad9a;\\u4396r;\\u6128pf;\\u6124cr;\\uc000\\ud835\\udcb5\\u0be1\\u1583\\u158a\\u1590\\0\\u15b0\\u15b6\\u15bf\\0\\0\\0\\0\\u15c6\\u15db\\u15eb\\u165f\\u166d\\0\\u1695\\u169b\\u16b2\\u16b9\\0\\u16becute\\u803b\\xe1\\u40e1reve;\\u4103\\u0300;Ediuy\\u159c\\u159d\\u15a1\\u15a3\\u15a8\\u15ad\\u623e;\\uc000\\u223e\\u0333;\\u623frc\\u803b\\xe2\\u40e2te\\u80bb\\xb4\\u0306;\\u4430lig\\u803b\\xe6\\u40e6\\u0100;r\\xb2\\u15ba;\\uc000\\ud835\\udd1erave\\u803b\\xe0\\u40e0\\u0100ep\\u15ca\\u15d6\\u0100fp\\u15cf\\u15d4sym;\\u6135\\xe8\\u15d3ha;\\u43b1\\u0100ap\\u15dfc\\u0100cl\\u15e4\\u15e7r;\\u4101g;\\u6a3f\\u0264\\u15f0\\0\\0\\u160a\\u0280;adsv\\u15fa\\u15fb\\u15ff\\u1601\\u1607\\u6227nd;\\u6a55;\\u6a5clope;\\u6a58;\\u6a5a\\u0380;elmrsz\\u1618\\u1619\\u161b\\u161e\\u163f\\u164f\\u1659\\u6220;\\u69a4e\\xbb\\u1619sd\\u0100;a\\u1625\\u1626\\u6221\\u0461\\u1630\\u1632\\u1634\\u1636\\u1638\\u163a\\u163c\\u163e;\\u69a8;\\u69a9;\\u69aa;\\u69ab;\\u69ac;\\u69ad;\\u69ae;\\u69aft\\u0100;v\\u1645\\u1646\\u621fb\\u0100;d\\u164c\\u164d\\u62be;\\u699d\\u0100pt\\u1654\\u1657h;\\u6222\\xbb\\xb9arr;\\u637c\\u0100gp\\u1663\\u1667on;\\u4105f;\\uc000\\ud835\\udd52\\u0380;Eaeiop\\u12c1\\u167b\\u167d\\u1682\\u1684\\u1687\\u168a;\\u6a70cir;\\u6a6f;\\u624ad;\\u624bs;\\u4027rox\\u0100;e\\u12c1\\u1692\\xf1\\u1683ing\\u803b\\xe5\\u40e5\\u0180cty\\u16a1\\u16a6\\u16a8r;\\uc000\\ud835\\udcb6;\\u402amp\\u0100;e\\u12c1\\u16af\\xf1\\u0288ilde\\u803b\\xe3\\u40e3ml\\u803b\\xe4\\u40e4\\u0100ci\\u16c2\\u16c8onin\\xf4\\u0272nt;\\u6a11\\u0800Nabcdefiklnoprsu\\u16ed\\u16f1\\u1730\\u173c\\u1743\\u1748\\u1778\\u177d\\u17e0\\u17e6\\u1839\\u1850\\u170d\\u193d\\u1948\\u1970ot;\\u6aed\\u0100cr\\u16f6\\u171ek\\u0200ceps\\u1700\\u1705\\u170d\\u1713ong;\\u624cpsilon;\\u43f6rime;\\u6035im\\u0100;e\\u171a\\u171b\\u623dq;\\u62cd\\u0176\\u1722\\u1726ee;\\u62bded\\u0100;g\\u172c\\u172d\\u6305e\\xbb\\u172drk\\u0100;t\\u135c\\u1737brk;\\u63b6\\u0100oy\\u1701\\u1741;\\u4431quo;\\u601e\\u0280cmprt\\u1753\\u175b\\u1761\\u1764\\u1768aus\\u0100;e\\u010a\\u0109ptyv;\\u69b0s\\xe9\\u170cno\\xf5\\u0113\\u0180ahw\\u176f\\u1771\\u1773;\\u43b2;\\u6136een;\\u626cr;\\uc000\\ud835\\udd1fg\\u0380costuvw\\u178d\\u179d\\u17b3\\u17c1\\u17d5\\u17db\\u17de\\u0180aiu\\u1794\\u1796\\u179a\\xf0\\u0760rc;\\u65efp\\xbb\\u1371\\u0180dpt\\u17a4\\u17a8\\u17adot;\\u6a00lus;\\u6a01imes;\\u6a02\\u0271\\u17b9\\0\\0\\u17becup;\\u6a06ar;\\u6605riangle\\u0100du\\u17cd\\u17d2own;\\u65bdp;\\u65b3plus;\\u6a04e\\xe5\\u1444\\xe5\\u14adarow;\\u690d\\u0180ako\\u17ed\\u1826\\u1835\\u0100cn\\u17f2\\u1823k\\u0180lst\\u17fa\\u05ab\\u1802ozenge;\\u69ebriangle\\u0200;dlr\\u1812\\u1813\\u1818\\u181d\\u65b4own;\\u65beeft;\\u65c2ight;\\u65b8k;\\u6423\\u01b1\\u182b\\0\\u1833\\u01b2\\u182f\\0\\u1831;\\u6592;\\u65914;\\u6593ck;\\u6588\\u0100eo\\u183e\\u184d\\u0100;q\\u1843\\u1846\\uc000=\\u20e5uiv;\\uc000\\u2261\\u20e5t;\\u6310\\u0200ptwx\\u1859\\u185e\\u1867\\u186cf;\\uc000\\ud835\\udd53\\u0100;t\\u13cb\\u1863om\\xbb\\u13cctie;\\u62c8\\u0600DHUVbdhmptuv\\u1885\\u1896\\u18aa\\u18bb\\u18d7\\u18db\\u18ec\\u18ff\\u1905\\u190a\\u1910\\u1921\\u0200LRlr\\u188e\\u1890\\u1892\\u1894;\\u6557;\\u6554;\\u6556;\\u6553\\u0280;DUdu\\u18a1\\u18a2\\u18a4\\u18a6\\u18a8\\u6550;\\u6566;\\u6569;\\u6564;\\u6567\\u0200LRlr\\u18b3\\u18b5\\u18b7\\u18b9;\\u655d;\\u655a;\\u655c;\\u6559\\u0380;HLRhlr\\u18ca\\u18cb\\u18cd\\u18cf\\u18d1\\u18d3\\u18d5\\u6551;\\u656c;\\u6563;\\u6560;\\u656b;\\u6562;\\u655fox;\\u69c9\\u0200LRlr\\u18e4\\u18e6\\u18e8\\u18ea;\\u6555;\\u6552;\\u6510;\\u650c\\u0280;DUdu\\u06bd\\u18f7\\u18f9\\u18fb\\u18fd;\\u6565;\\u6568;\\u652c;\\u6534inus;\\u629flus;\\u629eimes;\\u62a0\\u0200LRlr\\u1919\\u191b\\u191d\\u191f;\\u655b;\\u6558;\\u6518;\\u6514\\u0380;HLRhlr\\u1930\\u1931\\u1933\\u1935\\u1937\\u1939\\u193b\\u6502;\\u656a;\\u6561;\\u655e;\\u653c;\\u6524;\\u651c\\u0100ev\\u0123\\u1942bar\\u803b\\xa6\\u40a6\\u0200ceio\\u1951\\u1956\\u195a\\u1960r;\\uc000\\ud835\\udcb7mi;\\u604fm\\u0100;e\\u171a\\u171cl\\u0180;bh\\u1968\\u1969\\u196b\\u405c;\\u69c5sub;\\u67c8\\u016c\\u1974\\u197el\\u0100;e\\u1979\\u197a\\u6022t\\xbb\\u197ap\\u0180;Ee\\u012f\\u1985\\u1987;\\u6aae\\u0100;q\\u06dc\\u06db\\u0ce1\\u19a7\\0\\u19e8\\u1a11\\u1a15\\u1a32\\0\\u1a37\\u1a50\\0\\0\\u1ab4\\0\\0\\u1ac1\\0\\0\\u1b21\\u1b2e\\u1b4d\\u1b52\\0\\u1bfd\\0\\u1c0c\\u0180cpr\\u19ad\\u19b2\\u19ddute;\\u4107\\u0300;abcds\\u19bf\\u19c0\\u19c4\\u19ca\\u19d5\\u19d9\\u6229nd;\\u6a44rcup;\\u6a49\\u0100au\\u19cf\\u19d2p;\\u6a4bp;\\u6a47ot;\\u6a40;\\uc000\\u2229\\ufe00\\u0100eo\\u19e2\\u19e5t;\\u6041\\xee\\u0693\\u0200aeiu\\u19f0\\u19fb\\u1a01\\u1a05\\u01f0\\u19f5\\0\\u19f8s;\\u6a4don;\\u410ddil\\u803b\\xe7\\u40e7rc;\\u4109ps\\u0100;s\\u1a0c\\u1a0d\\u6a4cm;\\u6a50ot;\\u410b\\u0180dmn\\u1a1b\\u1a20\\u1a26il\\u80bb\\xb8\\u01adptyv;\\u69b2t\\u8100\\xa2;e\\u1a2d\\u1a2e\\u40a2r\\xe4\\u01b2r;\\uc000\\ud835\\udd20\\u0180cei\\u1a3d\\u1a40\\u1a4dy;\\u4447ck\\u0100;m\\u1a47\\u1a48\\u6713ark\\xbb\\u1a48;\\u43c7r\\u0380;Ecefms\\u1a5f\\u1a60\\u1a62\\u1a6b\\u1aa4\\u1aaa\\u1aae\\u65cb;\\u69c3\\u0180;el\\u1a69\\u1a6a\\u1a6d\\u42c6q;\\u6257e\\u0261\\u1a74\\0\\0\\u1a88rrow\\u0100lr\\u1a7c\\u1a81eft;\\u61baight;\\u61bb\\u0280RSacd\\u1a92\\u1a94\\u1a96\\u1a9a\\u1a9f\\xbb\\u0f47;\\u64c8st;\\u629birc;\\u629aash;\\u629dnint;\\u6a10id;\\u6aefcir;\\u69c2ubs\\u0100;u\\u1abb\\u1abc\\u6663it\\xbb\\u1abc\\u02ec\\u1ac7\\u1ad4\\u1afa\\0\\u1b0aon\\u0100;e\\u1acd\\u1ace\\u403a\\u0100;q\\xc7\\xc6\\u026d\\u1ad9\\0\\0\\u1ae2a\\u0100;t\\u1ade\\u1adf\\u402c;\\u4040\\u0180;fl\\u1ae8\\u1ae9\\u1aeb\\u6201\\xee\\u1160e\\u0100mx\\u1af1\\u1af6ent\\xbb\\u1ae9e\\xf3\\u024d\\u01e7\\u1afe\\0\\u1b07\\u0100;d\\u12bb\\u1b02ot;\\u6a6dn\\xf4\\u0246\\u0180fry\\u1b10\\u1b14\\u1b17;\\uc000\\ud835\\udd54o\\xe4\\u0254\\u8100\\xa9;s\\u0155\\u1b1dr;\\u6117\\u0100ao\\u1b25\\u1b29rr;\\u61b5ss;\\u6717\\u0100cu\\u1b32\\u1b37r;\\uc000\\ud835\\udcb8\\u0100bp\\u1b3c\\u1b44\\u0100;e\\u1b41\\u1b42\\u6acf;\\u6ad1\\u0100;e\\u1b49\\u1b4a\\u6ad0;\\u6ad2dot;\\u62ef\\u0380delprvw\\u1b60\\u1b6c\\u1b77\\u1b82\\u1bac\\u1bd4\\u1bf9arr\\u0100lr\\u1b68\\u1b6a;\\u6938;\\u6935\\u0270\\u1b72\\0\\0\\u1b75r;\\u62dec;\\u62dfarr\\u0100;p\\u1b7f\\u1b80\\u61b6;\\u693d\\u0300;bcdos\\u1b8f\\u1b90\\u1b96\\u1ba1\\u1ba5\\u1ba8\\u622arcap;\\u6a48\\u0100au\\u1b9b\\u1b9ep;\\u6a46p;\\u6a4aot;\\u628dr;\\u6a45;\\uc000\\u222a\\ufe00\\u0200alrv\\u1bb5\\u1bbf\\u1bde\\u1be3rr\\u0100;m\\u1bbc\\u1bbd\\u61b7;\\u693cy\\u0180evw\\u1bc7\\u1bd4\\u1bd8q\\u0270\\u1bce\\0\\0\\u1bd2re\\xe3\\u1b73u\\xe3\\u1b75ee;\\u62ceedge;\\u62cfen\\u803b\\xa4\\u40a4earrow\\u0100lr\\u1bee\\u1bf3eft\\xbb\\u1b80ight\\xbb\\u1bbde\\xe4\\u1bdd\\u0100ci\\u1c01\\u1c07onin\\xf4\\u01f7nt;\\u6231lcty;\\u632d\\u0980AHabcdefhijlorstuwz\\u1c38\\u1c3b\\u1c3f\\u1c5d\\u1c69\\u1c75\\u1c8a\\u1c9e\\u1cac\\u1cb7\\u1cfb\\u1cff\\u1d0d\\u1d7b\\u1d91\\u1dab\\u1dbb\\u1dc6\\u1dcdr\\xf2\\u0381ar;\\u6965\\u0200glrs\\u1c48\\u1c4d\\u1c52\\u1c54ger;\\u6020eth;\\u6138\\xf2\\u1133h\\u0100;v\\u1c5a\\u1c5b\\u6010\\xbb\\u090a\\u016b\\u1c61\\u1c67arow;\\u690fa\\xe3\\u0315\\u0100ay\\u1c6e\\u1c73ron;\\u410f;\\u4434\\u0180;ao\\u0332\\u1c7c\\u1c84\\u0100gr\\u02bf\\u1c81r;\\u61catseq;\\u6a77\\u0180glm\\u1c91\\u1c94\\u1c98\\u803b\\xb0\\u40b0ta;\\u43b4ptyv;\\u69b1\\u0100ir\\u1ca3\\u1ca8sht;\\u697f;\\uc000\\ud835\\udd21ar\\u0100lr\\u1cb3\\u1cb5\\xbb\\u08dc\\xbb\\u101e\\u0280aegsv\\u1cc2\\u0378\\u1cd6\\u1cdc\\u1ce0m\\u0180;os\\u0326\\u1cca\\u1cd4nd\\u0100;s\\u0326\\u1cd1uit;\\u6666amma;\\u43ddin;\\u62f2\\u0180;io\\u1ce7\\u1ce8\\u1cf8\\u40f7de\\u8100\\xf7;o\\u1ce7\\u1cf0ntimes;\\u62c7n\\xf8\\u1cf7cy;\\u4452c\\u026f\\u1d06\\0\\0\\u1d0arn;\\u631eop;\\u630d\\u0280lptuw\\u1d18\\u1d1d\\u1d22\\u1d49\\u1d55lar;\\u4024f;\\uc000\\ud835\\udd55\\u0280;emps\\u030b\\u1d2d\\u1d37\\u1d3d\\u1d42q\\u0100;d\\u0352\\u1d33ot;\\u6251inus;\\u6238lus;\\u6214quare;\\u62a1blebarwedg\\xe5\\xfan\\u0180adh\\u112e\\u1d5d\\u1d67ownarrow\\xf3\\u1c83arpoon\\u0100lr\\u1d72\\u1d76ef\\xf4\\u1cb4igh\\xf4\\u1cb6\\u0162\\u1d7f\\u1d85karo\\xf7\\u0f42\\u026f\\u1d8a\\0\\0\\u1d8ern;\\u631fop;\\u630c\\u0180cot\\u1d98\\u1da3\\u1da6\\u0100ry\\u1d9d\\u1da1;\\uc000\\ud835\\udcb9;\\u4455l;\\u69f6rok;\\u4111\\u0100dr\\u1db0\\u1db4ot;\\u62f1i\\u0100;f\\u1dba\\u1816\\u65bf\\u0100ah\\u1dc0\\u1dc3r\\xf2\\u0429a\\xf2\\u0fa6angle;\\u69a6\\u0100ci\\u1dd2\\u1dd5y;\\u445fgrarr;\\u67ff\\u0900Dacdefglmnopqrstux\\u1e01\\u1e09\\u1e19\\u1e38\\u0578\\u1e3c\\u1e49\\u1e61\\u1e7e\\u1ea5\\u1eaf\\u1ebd\\u1ee1\\u1f2a\\u1f37\\u1f44\\u1f4e\\u1f5a\\u0100Do\\u1e06\\u1d34o\\xf4\\u1c89\\u0100cs\\u1e0e\\u1e14ute\\u803b\\xe9\\u40e9ter;\\u6a6e\\u0200aioy\\u1e22\\u1e27\\u1e31\\u1e36ron;\\u411br\\u0100;c\\u1e2d\\u1e2e\\u6256\\u803b\\xea\\u40ealon;\\u6255;\\u444dot;\\u4117\\u0100Dr\\u1e41\\u1e45ot;\\u6252;\\uc000\\ud835\\udd22\\u0180;rs\\u1e50\\u1e51\\u1e57\\u6a9aave\\u803b\\xe8\\u40e8\\u0100;d\\u1e5c\\u1e5d\\u6a96ot;\\u6a98\\u0200;ils\\u1e6a\\u1e6b\\u1e72\\u1e74\\u6a99nters;\\u63e7;\\u6113\\u0100;d\\u1e79\\u1e7a\\u6a95ot;\\u6a97\\u0180aps\\u1e85\\u1e89\\u1e97cr;\\u4113ty\\u0180;sv\\u1e92\\u1e93\\u1e95\\u6205et\\xbb\\u1e93p\\u01001;\\u1e9d\\u1ea4\\u0133\\u1ea1\\u1ea3;\\u6004;\\u6005\\u6003\\u0100gs\\u1eaa\\u1eac;\\u414bp;\\u6002\\u0100gp\\u1eb4\\u1eb8on;\\u4119f;\\uc000\\ud835\\udd56\\u0180als\\u1ec4\\u1ece\\u1ed2r\\u0100;s\\u1eca\\u1ecb\\u62d5l;\\u69e3us;\\u6a71i\\u0180;lv\\u1eda\\u1edb\\u1edf\\u43b5on\\xbb\\u1edb;\\u43f5\\u0200csuv\\u1eea\\u1ef3\\u1f0b\\u1f23\\u0100io\\u1eef\\u1e31rc\\xbb\\u1e2e\\u0269\\u1ef9\\0\\0\\u1efb\\xed\\u0548ant\\u0100gl\\u1f02\\u1f06tr\\xbb\\u1e5dess\\xbb\\u1e7a\\u0180aei\\u1f12\\u1f16\\u1f1als;\\u403dst;\\u625fv\\u0100;D\\u0235\\u1f20D;\\u6a78parsl;\\u69e5\\u0100Da\\u1f2f\\u1f33ot;\\u6253rr;\\u6971\\u0180cdi\\u1f3e\\u1f41\\u1ef8r;\\u612fo\\xf4\\u0352\\u0100ah\\u1f49\\u1f4b;\\u43b7\\u803b\\xf0\\u40f0\\u0100mr\\u1f53\\u1f57l\\u803b\\xeb\\u40ebo;\\u60ac\\u0180cip\\u1f61\\u1f64\\u1f67l;\\u4021s\\xf4\\u056e\\u0100eo\\u1f6c\\u1f74ctatio\\xee\\u0559nential\\xe5\\u0579\\u09e1\\u1f92\\0\\u1f9e\\0\\u1fa1\\u1fa7\\0\\0\\u1fc6\\u1fcc\\0\\u1fd3\\0\\u1fe6\\u1fea\\u2000\\0\\u2008\\u205allingdotse\\xf1\\u1e44y;\\u4444male;\\u6640\\u0180ilr\\u1fad\\u1fb3\\u1fc1lig;\\u8000\\ufb03\\u0269\\u1fb9\\0\\0\\u1fbdg;\\u8000\\ufb00ig;\\u8000\\ufb04;\\uc000\\ud835\\udd23lig;\\u8000\\ufb01lig;\\uc000fj\\u0180alt\\u1fd9\\u1fdc\\u1fe1t;\\u666dig;\\u8000\\ufb02ns;\\u65b1of;\\u4192\\u01f0\\u1fee\\0\\u1ff3f;\\uc000\\ud835\\udd57\\u0100ak\\u05bf\\u1ff7\\u0100;v\\u1ffc\\u1ffd\\u62d4;\\u6ad9artint;\\u6a0d\\u0100ao\\u200c\\u2055\\u0100cs\\u2011\\u2052\\u03b1\\u201a\\u2030\\u2038\\u2045\\u2048\\0\\u2050\\u03b2\\u2022\\u2025\\u2027\\u202a\\u202c\\0\\u202e\\u803b\\xbd\\u40bd;\\u6153\\u803b\\xbc\\u40bc;\\u6155;\\u6159;\\u615b\\u01b3\\u2034\\0\\u2036;\\u6154;\\u6156\\u02b4\\u203e\\u2041\\0\\0\\u2043\\u803b\\xbe\\u40be;\\u6157;\\u615c5;\\u6158\\u01b6\\u204c\\0\\u204e;\\u615a;\\u615d8;\\u615el;\\u6044wn;\\u6322cr;\\uc000\\ud835\\udcbb\\u0880Eabcdefgijlnorstv\\u2082\\u2089\\u209f\\u20a5\\u20b0\\u20b4\\u20f0\\u20f5\\u20fa\\u20ff\\u2103\\u2112\\u2138\\u0317\\u213e\\u2152\\u219e\\u0100;l\\u064d\\u2087;\\u6a8c\\u0180cmp\\u2090\\u2095\\u209dute;\\u41f5ma\\u0100;d\\u209c\\u1cda\\u43b3;\\u6a86reve;\\u411f\\u0100iy\\u20aa\\u20aerc;\\u411d;\\u4433ot;\\u4121\\u0200;lqs\\u063e\\u0642\\u20bd\\u20c9\\u0180;qs\\u063e\\u064c\\u20c4lan\\xf4\\u0665\\u0200;cdl\\u0665\\u20d2\\u20d5\\u20e5c;\\u6aa9ot\\u0100;o\\u20dc\\u20dd\\u6a80\\u0100;l\\u20e2\\u20e3\\u6a82;\\u6a84\\u0100;e\\u20ea\\u20ed\\uc000\\u22db\\ufe00s;\\u6a94r;\\uc000\\ud835\\udd24\\u0100;g\\u0673\\u061bmel;\\u6137cy;\\u4453\\u0200;Eaj\\u065a\\u210c\\u210e\\u2110;\\u6a92;\\u6aa5;\\u6aa4\\u0200Eaes\\u211b\\u211d\\u2129\\u2134;\\u6269p\\u0100;p\\u2123\\u2124\\u6a8arox\\xbb\\u2124\\u0100;q\\u212e\\u212f\\u6a88\\u0100;q\\u212e\\u211bim;\\u62e7pf;\\uc000\\ud835\\udd58\\u0100ci\\u2143\\u2146r;\\u610am\\u0180;el\\u066b\\u214e\\u2150;\\u6a8e;\\u6a90\\u8300>;cdlqr\\u05ee\\u2160\\u216a\\u216e\\u2173\\u2179\\u0100ci\\u2165\\u2167;\\u6aa7r;\\u6a7aot;\\u62d7Par;\\u6995uest;\\u6a7c\\u0280adels\\u2184\\u216a\\u2190\\u0656\\u219b\\u01f0\\u2189\\0\\u218epro\\xf8\\u209er;\\u6978q\\u0100lq\\u063f\\u2196les\\xf3\\u2088i\\xed\\u066b\\u0100en\\u21a3\\u21adrtneqq;\\uc000\\u2269\\ufe00\\xc5\\u21aa\\u0500Aabcefkosy\\u21c4\\u21c7\\u21f1\\u21f5\\u21fa\\u2218\\u221d\\u222f\\u2268\\u227dr\\xf2\\u03a0\\u0200ilmr\\u21d0\\u21d4\\u21d7\\u21dbrs\\xf0\\u1484f\\xbb\\u2024il\\xf4\\u06a9\\u0100dr\\u21e0\\u21e4cy;\\u444a\\u0180;cw\\u08f4\\u21eb\\u21efir;\\u6948;\\u61adar;\\u610firc;\\u4125\\u0180alr\\u2201\\u220e\\u2213rts\\u0100;u\\u2209\\u220a\\u6665it\\xbb\\u220alip;\\u6026con;\\u62b9r;\\uc000\\ud835\\udd25s\\u0100ew\\u2223\\u2229arow;\\u6925arow;\\u6926\\u0280amopr\\u223a\\u223e\\u2243\\u225e\\u2263rr;\\u61fftht;\\u623bk\\u0100lr\\u2249\\u2253eftarrow;\\u61a9ightarrow;\\u61aaf;\\uc000\\ud835\\udd59bar;\\u6015\\u0180clt\\u226f\\u2274\\u2278r;\\uc000\\ud835\\udcbdas\\xe8\\u21f4rok;\\u4127\\u0100bp\\u2282\\u2287ull;\\u6043hen\\xbb\\u1c5b\\u0ae1\\u22a3\\0\\u22aa\\0\\u22b8\\u22c5\\u22ce\\0\\u22d5\\u22f3\\0\\0\\u22f8\\u2322\\u2367\\u2362\\u237f\\0\\u2386\\u23aa\\u23b4cute\\u803b\\xed\\u40ed\\u0180;iy\\u0771\\u22b0\\u22b5rc\\u803b\\xee\\u40ee;\\u4438\\u0100cx\\u22bc\\u22bfy;\\u4435cl\\u803b\\xa1\\u40a1\\u0100fr\\u039f\\u22c9;\\uc000\\ud835\\udd26rave\\u803b\\xec\\u40ec\\u0200;ino\\u073e\\u22dd\\u22e9\\u22ee\\u0100in\\u22e2\\u22e6nt;\\u6a0ct;\\u622dfin;\\u69dcta;\\u6129lig;\\u4133\\u0180aop\\u22fe\\u231a\\u231d\\u0180cgt\\u2305\\u2308\\u2317r;\\u412b\\u0180elp\\u071f\\u230f\\u2313in\\xe5\\u078ear\\xf4\\u0720h;\\u4131f;\\u62b7ed;\\u41b5\\u0280;cfot\\u04f4\\u232c\\u2331\\u233d\\u2341are;\\u6105in\\u0100;t\\u2338\\u2339\\u621eie;\\u69dddo\\xf4\\u2319\\u0280;celp\\u0757\\u234c\\u2350\\u235b\\u2361al;\\u62ba\\u0100gr\\u2355\\u2359er\\xf3\\u1563\\xe3\\u234darhk;\\u6a17rod;\\u6a3c\\u0200cgpt\\u236f\\u2372\\u2376\\u237by;\\u4451on;\\u412ff;\\uc000\\ud835\\udd5aa;\\u43b9uest\\u803b\\xbf\\u40bf\\u0100ci\\u238a\\u238fr;\\uc000\\ud835\\udcben\\u0280;Edsv\\u04f4\\u239b\\u239d\\u23a1\\u04f3;\\u62f9ot;\\u62f5\\u0100;v\\u23a6\\u23a7\\u62f4;\\u62f3\\u0100;i\\u0777\\u23aelde;\\u4129\\u01eb\\u23b8\\0\\u23bccy;\\u4456l\\u803b\\xef\\u40ef\\u0300cfmosu\\u23cc\\u23d7\\u23dc\\u23e1\\u23e7\\u23f5\\u0100iy\\u23d1\\u23d5rc;\\u4135;\\u4439r;\\uc000\\ud835\\udd27ath;\\u4237pf;\\uc000\\ud835\\udd5b\\u01e3\\u23ec\\0\\u23f1r;\\uc000\\ud835\\udcbfrcy;\\u4458kcy;\\u4454\\u0400acfghjos\\u240b\\u2416\\u2422\\u2427\\u242d\\u2431\\u2435\\u243bppa\\u0100;v\\u2413\\u2414\\u43ba;\\u43f0\\u0100ey\\u241b\\u2420dil;\\u4137;\\u443ar;\\uc000\\ud835\\udd28reen;\\u4138cy;\\u4445cy;\\u445cpf;\\uc000\\ud835\\udd5ccr;\\uc000\\ud835\\udcc0\\u0b80ABEHabcdefghjlmnoprstuv\\u2470\\u2481\\u2486\\u248d\\u2491\\u250e\\u253d\\u255a\\u2580\\u264e\\u265e\\u2665\\u2679\\u267d\\u269a\\u26b2\\u26d8\\u275d\\u2768\\u278b\\u27c0\\u2801\\u2812\\u0180art\\u2477\\u247a\\u247cr\\xf2\\u09c6\\xf2\\u0395ail;\\u691barr;\\u690e\\u0100;g\\u0994\\u248b;\\u6a8bar;\\u6962\\u0963\\u24a5\\0\\u24aa\\0\\u24b1\\0\\0\\0\\0\\0\\u24b5\\u24ba\\0\\u24c6\\u24c8\\u24cd\\0\\u24f9ute;\\u413amptyv;\\u69b4ra\\xee\\u084cbda;\\u43bbg\\u0180;dl\\u088e\\u24c1\\u24c3;\\u6991\\xe5\\u088e;\\u6a85uo\\u803b\\xab\\u40abr\\u0400;bfhlpst\\u0899\\u24de\\u24e6\\u24e9\\u24eb\\u24ee\\u24f1\\u24f5\\u0100;f\\u089d\\u24e3s;\\u691fs;\\u691d\\xeb\\u2252p;\\u61abl;\\u6939im;\\u6973l;\\u61a2\\u0180;ae\\u24ff\\u2500\\u2504\\u6aabil;\\u6919\\u0100;s\\u2509\\u250a\\u6aad;\\uc000\\u2aad\\ufe00\\u0180abr\\u2515\\u2519\\u251drr;\\u690crk;\\u6772\\u0100ak\\u2522\\u252cc\\u0100ek\\u2528\\u252a;\\u407b;\\u405b\\u0100es\\u2531\\u2533;\\u698bl\\u0100du\\u2539\\u253b;\\u698f;\\u698d\\u0200aeuy\\u2546\\u254b\\u2556\\u2558ron;\\u413e\\u0100di\\u2550\\u2554il;\\u413c\\xec\\u08b0\\xe2\\u2529;\\u443b\\u0200cqrs\\u2563\\u2566\\u256d\\u257da;\\u6936uo\\u0100;r\\u0e19\\u1746\\u0100du\\u2572\\u2577har;\\u6967shar;\\u694bh;\\u61b2\\u0280;fgqs\\u258b\\u258c\\u0989\\u25f3\\u25ff\\u6264t\\u0280ahlrt\\u2598\\u25a4\\u25b7\\u25c2\\u25e8rrow\\u0100;t\\u0899\\u25a1a\\xe9\\u24f6arpoon\\u0100du\\u25af\\u25b4own\\xbb\\u045ap\\xbb\\u0966eftarrows;\\u61c7ight\\u0180ahs\\u25cd\\u25d6\\u25derrow\\u0100;s\\u08f4\\u08a7arpoon\\xf3\\u0f98quigarro\\xf7\\u21f0hreetimes;\\u62cb\\u0180;qs\\u258b\\u0993\\u25falan\\xf4\\u09ac\\u0280;cdgs\\u09ac\\u260a\\u260d\\u261d\\u2628c;\\u6aa8ot\\u0100;o\\u2614\\u2615\\u6a7f\\u0100;r\\u261a\\u261b\\u6a81;\\u6a83\\u0100;e\\u2622\\u2625\\uc000\\u22da\\ufe00s;\\u6a93\\u0280adegs\\u2633\\u2639\\u263d\\u2649\\u264bppro\\xf8\\u24c6ot;\\u62d6q\\u0100gq\\u2643\\u2645\\xf4\\u0989gt\\xf2\\u248c\\xf4\\u099bi\\xed\\u09b2\\u0180ilr\\u2655\\u08e1\\u265asht;\\u697c;\\uc000\\ud835\\udd29\\u0100;E\\u099c\\u2663;\\u6a91\\u0161\\u2669\\u2676r\\u0100du\\u25b2\\u266e\\u0100;l\\u0965\\u2673;\\u696alk;\\u6584cy;\\u4459\\u0280;acht\\u0a48\\u2688\\u268b\\u2691\\u2696r\\xf2\\u25c1orne\\xf2\\u1d08ard;\\u696bri;\\u65fa\\u0100io\\u269f\\u26a4dot;\\u4140ust\\u0100;a\\u26ac\\u26ad\\u63b0che\\xbb\\u26ad\\u0200Eaes\\u26bb\\u26bd\\u26c9\\u26d4;\\u6268p\\u0100;p\\u26c3\\u26c4\\u6a89rox\\xbb\\u26c4\\u0100;q\\u26ce\\u26cf\\u6a87\\u0100;q\\u26ce\\u26bbim;\\u62e6\\u0400abnoptwz\\u26e9\\u26f4\\u26f7\\u271a\\u272f\\u2741\\u2747\\u2750\\u0100nr\\u26ee\\u26f1g;\\u67ecr;\\u61fdr\\xeb\\u08c1g\\u0180lmr\\u26ff\\u270d\\u2714eft\\u0100ar\\u09e6\\u2707ight\\xe1\\u09f2apsto;\\u67fcight\\xe1\\u09fdparrow\\u0100lr\\u2725\\u2729ef\\xf4\\u24edight;\\u61ac\\u0180afl\\u2736\\u2739\\u273dr;\\u6985;\\uc000\\ud835\\udd5dus;\\u6a2dimes;\\u6a34\\u0161\\u274b\\u274fst;\\u6217\\xe1\\u134e\\u0180;ef\\u2757\\u2758\\u1800\\u65cange\\xbb\\u2758ar\\u0100;l\\u2764\\u2765\\u4028t;\\u6993\\u0280achmt\\u2773\\u2776\\u277c\\u2785\\u2787r\\xf2\\u08a8orne\\xf2\\u1d8car\\u0100;d\\u0f98\\u2783;\\u696d;\\u600eri;\\u62bf\\u0300achiqt\\u2798\\u279d\\u0a40\\u27a2\\u27ae\\u27bbquo;\\u6039r;\\uc000\\ud835\\udcc1m\\u0180;eg\\u09b2\\u27aa\\u27ac;\\u6a8d;\\u6a8f\\u0100bu\\u252a\\u27b3o\\u0100;r\\u0e1f\\u27b9;\\u601arok;\\u4142\\u8400<;cdhilqr\\u082b\\u27d2\\u2639\\u27dc\\u27e0\\u27e5\\u27ea\\u27f0\\u0100ci\\u27d7\\u27d9;\\u6aa6r;\\u6a79re\\xe5\\u25f2mes;\\u62c9arr;\\u6976uest;\\u6a7b\\u0100Pi\\u27f5\\u27f9ar;\\u6996\\u0180;ef\\u2800\\u092d\\u181b\\u65c3r\\u0100du\\u2807\\u280dshar;\\u694ahar;\\u6966\\u0100en\\u2817\\u2821rtneqq;\\uc000\\u2268\\ufe00\\xc5\\u281e\\u0700Dacdefhilnopsu\\u2840\\u2845\\u2882\\u288e\\u2893\\u28a0\\u28a5\\u28a8\\u28da\\u28e2\\u28e4\\u0a83\\u28f3\\u2902Dot;\\u623a\\u0200clpr\\u284e\\u2852\\u2863\\u287dr\\u803b\\xaf\\u40af\\u0100et\\u2857\\u2859;\\u6642\\u0100;e\\u285e\\u285f\\u6720se\\xbb\\u285f\\u0100;s\\u103b\\u2868to\\u0200;dlu\\u103b\\u2873\\u2877\\u287bow\\xee\\u048cef\\xf4\\u090f\\xf0\\u13d1ker;\\u65ae\\u0100oy\\u2887\\u288cmma;\\u6a29;\\u443cash;\\u6014asuredangle\\xbb\\u1626r;\\uc000\\ud835\\udd2ao;\\u6127\\u0180cdn\\u28af\\u28b4\\u28c9ro\\u803b\\xb5\\u40b5\\u0200;acd\\u1464\\u28bd\\u28c0\\u28c4s\\xf4\\u16a7ir;\\u6af0ot\\u80bb\\xb7\\u01b5us\\u0180;bd\\u28d2\\u1903\\u28d3\\u6212\\u0100;u\\u1d3c\\u28d8;\\u6a2a\\u0163\\u28de\\u28e1p;\\u6adb\\xf2\\u2212\\xf0\\u0a81\\u0100dp\\u28e9\\u28eeels;\\u62a7f;\\uc000\\ud835\\udd5e\\u0100ct\\u28f8\\u28fdr;\\uc000\\ud835\\udcc2pos\\xbb\\u159d\\u0180;lm\\u2909\\u290a\\u290d\\u43bctimap;\\u62b8\\u0c00GLRVabcdefghijlmoprstuvw\\u2942\\u2953\\u297e\\u2989\\u2998\\u29da\\u29e9\\u2a15\\u2a1a\\u2a58\\u2a5d\\u2a83\\u2a95\\u2aa4\\u2aa8\\u2b04\\u2b07\\u2b44\\u2b7f\\u2bae\\u2c34\\u2c67\\u2c7c\\u2ce9\\u0100gt\\u2947\\u294b;\\uc000\\u22d9\\u0338\\u0100;v\\u2950\\u0bcf\\uc000\\u226b\\u20d2\\u0180elt\\u295a\\u2972\\u2976ft\\u0100ar\\u2961\\u2967rrow;\\u61cdightarrow;\\u61ce;\\uc000\\u22d8\\u0338\\u0100;v\\u297b\\u0c47\\uc000\\u226a\\u20d2ightarrow;\\u61cf\\u0100Dd\\u298e\\u2993ash;\\u62afash;\\u62ae\\u0280bcnpt\\u29a3\\u29a7\\u29ac\\u29b1\\u29ccla\\xbb\\u02deute;\\u4144g;\\uc000\\u2220\\u20d2\\u0280;Eiop\\u0d84\\u29bc\\u29c0\\u29c5\\u29c8;\\uc000\\u2a70\\u0338d;\\uc000\\u224b\\u0338s;\\u4149ro\\xf8\\u0d84ur\\u0100;a\\u29d3\\u29d4\\u666el\\u0100;s\\u29d3\\u0b38\\u01f3\\u29df\\0\\u29e3p\\u80bb\\xa0\\u0b37mp\\u0100;e\\u0bf9\\u0c00\\u0280aeouy\\u29f4\\u29fe\\u2a03\\u2a10\\u2a13\\u01f0\\u29f9\\0\\u29fb;\\u6a43on;\\u4148dil;\\u4146ng\\u0100;d\\u0d7e\\u2a0aot;\\uc000\\u2a6d\\u0338p;\\u6a42;\\u443dash;\\u6013\\u0380;Aadqsx\\u0b92\\u2a29\\u2a2d\\u2a3b\\u2a41\\u2a45\\u2a50rr;\\u61d7r\\u0100hr\\u2a33\\u2a36k;\\u6924\\u0100;o\\u13f2\\u13f0ot;\\uc000\\u2250\\u0338ui\\xf6\\u0b63\\u0100ei\\u2a4a\\u2a4ear;\\u6928\\xed\\u0b98ist\\u0100;s\\u0ba0\\u0b9fr;\\uc000\\ud835\\udd2b\\u0200Eest\\u0bc5\\u2a66\\u2a79\\u2a7c\\u0180;qs\\u0bbc\\u2a6d\\u0be1\\u0180;qs\\u0bbc\\u0bc5\\u2a74lan\\xf4\\u0be2i\\xed\\u0bea\\u0100;r\\u0bb6\\u2a81\\xbb\\u0bb7\\u0180Aap\\u2a8a\\u2a8d\\u2a91r\\xf2\\u2971rr;\\u61aear;\\u6af2\\u0180;sv\\u0f8d\\u2a9c\\u0f8c\\u0100;d\\u2aa1\\u2aa2\\u62fc;\\u62facy;\\u445a\\u0380AEadest\\u2ab7\\u2aba\\u2abe\\u2ac2\\u2ac5\\u2af6\\u2af9r\\xf2\\u2966;\\uc000\\u2266\\u0338rr;\\u619ar;\\u6025\\u0200;fqs\\u0c3b\\u2ace\\u2ae3\\u2aeft\\u0100ar\\u2ad4\\u2ad9rro\\xf7\\u2ac1ightarro\\xf7\\u2a90\\u0180;qs\\u0c3b\\u2aba\\u2aealan\\xf4\\u0c55\\u0100;s\\u0c55\\u2af4\\xbb\\u0c36i\\xed\\u0c5d\\u0100;r\\u0c35\\u2afei\\u0100;e\\u0c1a\\u0c25i\\xe4\\u0d90\\u0100pt\\u2b0c\\u2b11f;\\uc000\\ud835\\udd5f\\u8180\\xac;in\\u2b19\\u2b1a\\u2b36\\u40acn\\u0200;Edv\\u0b89\\u2b24\\u2b28\\u2b2e;\\uc000\\u22f9\\u0338ot;\\uc000\\u22f5\\u0338\\u01e1\\u0b89\\u2b33\\u2b35;\\u62f7;\\u62f6i\\u0100;v\\u0cb8\\u2b3c\\u01e1\\u0cb8\\u2b41\\u2b43;\\u62fe;\\u62fd\\u0180aor\\u2b4b\\u2b63\\u2b69r\\u0200;ast\\u0b7b\\u2b55\\u2b5a\\u2b5flle\\xec\\u0b7bl;\\uc000\\u2afd\\u20e5;\\uc000\\u2202\\u0338lint;\\u6a14\\u0180;ce\\u0c92\\u2b70\\u2b73u\\xe5\\u0ca5\\u0100;c\\u0c98\\u2b78\\u0100;e\\u0c92\\u2b7d\\xf1\\u0c98\\u0200Aait\\u2b88\\u2b8b\\u2b9d\\u2ba7r\\xf2\\u2988rr\\u0180;cw\\u2b94\\u2b95\\u2b99\\u619b;\\uc000\\u2933\\u0338;\\uc000\\u219d\\u0338ghtarrow\\xbb\\u2b95ri\\u0100;e\\u0ccb\\u0cd6\\u0380chimpqu\\u2bbd\\u2bcd\\u2bd9\\u2b04\\u0b78\\u2be4\\u2bef\\u0200;cer\\u0d32\\u2bc6\\u0d37\\u2bc9u\\xe5\\u0d45;\\uc000\\ud835\\udcc3ort\\u026d\\u2b05\\0\\0\\u2bd6ar\\xe1\\u2b56m\\u0100;e\\u0d6e\\u2bdf\\u0100;q\\u0d74\\u0d73su\\u0100bp\\u2beb\\u2bed\\xe5\\u0cf8\\xe5\\u0d0b\\u0180bcp\\u2bf6\\u2c11\\u2c19\\u0200;Ees\\u2bff\\u2c00\\u0d22\\u2c04\\u6284;\\uc000\\u2ac5\\u0338et\\u0100;e\\u0d1b\\u2c0bq\\u0100;q\\u0d23\\u2c00c\\u0100;e\\u0d32\\u2c17\\xf1\\u0d38\\u0200;Ees\\u2c22\\u2c23\\u0d5f\\u2c27\\u6285;\\uc000\\u2ac6\\u0338et\\u0100;e\\u0d58\\u2c2eq\\u0100;q\\u0d60\\u2c23\\u0200gilr\\u2c3d\\u2c3f\\u2c45\\u2c47\\xec\\u0bd7lde\\u803b\\xf1\\u40f1\\xe7\\u0c43iangle\\u0100lr\\u2c52\\u2c5ceft\\u0100;e\\u0c1a\\u2c5a\\xf1\\u0c26ight\\u0100;e\\u0ccb\\u2c65\\xf1\\u0cd7\\u0100;m\\u2c6c\\u2c6d\\u43bd\\u0180;es\\u2c74\\u2c75\\u2c79\\u4023ro;\\u6116p;\\u6007\\u0480DHadgilrs\\u2c8f\\u2c94\\u2c99\\u2c9e\\u2ca3\\u2cb0\\u2cb6\\u2cd3\\u2ce3ash;\\u62adarr;\\u6904p;\\uc000\\u224d\\u20d2ash;\\u62ac\\u0100et\\u2ca8\\u2cac;\\uc000\\u2265\\u20d2;\\uc000>\\u20d2nfin;\\u69de\\u0180Aet\\u2cbd\\u2cc1\\u2cc5rr;\\u6902;\\uc000\\u2264\\u20d2\\u0100;r\\u2cca\\u2ccd\\uc000<\\u20d2ie;\\uc000\\u22b4\\u20d2\\u0100At\\u2cd8\\u2cdcrr;\\u6903rie;\\uc000\\u22b5\\u20d2im;\\uc000\\u223c\\u20d2\\u0180Aan\\u2cf0\\u2cf4\\u2d02rr;\\u61d6r\\u0100hr\\u2cfa\\u2cfdk;\\u6923\\u0100;o\\u13e7\\u13e5ear;\\u6927\\u1253\\u1a95\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\0\\u2d2d\\0\\u2d38\\u2d48\\u2d60\\u2d65\\u2d72\\u2d84\\u1b07\\0\\0\\u2d8d\\u2dab\\0\\u2dc8\\u2dce\\0\\u2ddc\\u2e19\\u2e2b\\u2e3e\\u2e43\\u0100cs\\u2d31\\u1a97ute\\u803b\\xf3\\u40f3\\u0100iy\\u2d3c\\u2d45r\\u0100;c\\u1a9e\\u2d42\\u803b\\xf4\\u40f4;\\u443e\\u0280abios\\u1aa0\\u2d52\\u2d57\\u01c8\\u2d5alac;\\u4151v;\\u6a38old;\\u69bclig;\\u4153\\u0100cr\\u2d69\\u2d6dir;\\u69bf;\\uc000\\ud835\\udd2c\\u036f\\u2d79\\0\\0\\u2d7c\\0\\u2d82n;\\u42dbave\\u803b\\xf2\\u40f2;\\u69c1\\u0100bm\\u2d88\\u0df4ar;\\u69b5\\u0200acit\\u2d95\\u2d98\\u2da5\\u2da8r\\xf2\\u1a80\\u0100ir\\u2d9d\\u2da0r;\\u69beoss;\\u69bbn\\xe5\\u0e52;\\u69c0\\u0180aei\\u2db1\\u2db5\\u2db9cr;\\u414dga;\\u43c9\\u0180cdn\\u2dc0\\u2dc5\\u01cdron;\\u43bf;\\u69b6pf;\\uc000\\ud835\\udd60\\u0180ael\\u2dd4\\u2dd7\\u01d2r;\\u69b7rp;\\u69b9\\u0380;adiosv\\u2dea\\u2deb\\u2dee\\u2e08\\u2e0d\\u2e10\\u2e16\\u6228r\\xf2\\u1a86\\u0200;efm\\u2df7\\u2df8\\u2e02\\u2e05\\u6a5dr\\u0100;o\\u2dfe\\u2dff\\u6134f\\xbb\\u2dff\\u803b\\xaa\\u40aa\\u803b\\xba\\u40bagof;\\u62b6r;\\u6a56lope;\\u6a57;\\u6a5b\\u0180clo\\u2e1f\\u2e21\\u2e27\\xf2\\u2e01ash\\u803b\\xf8\\u40f8l;\\u6298i\\u016c\\u2e2f\\u2e34de\\u803b\\xf5\\u40f5es\\u0100;a\\u01db\\u2e3as;\\u6a36ml\\u803b\\xf6\\u40f6bar;\\u633d\\u0ae1\\u2e5e\\0\\u2e7d\\0\\u2e80\\u2e9d\\0\\u2ea2\\u2eb9\\0\\0\\u2ecb\\u0e9c\\0\\u2f13\\0\\0\\u2f2b\\u2fbc\\0\\u2fc8r\\u0200;ast\\u0403\\u2e67\\u2e72\\u0e85\\u8100\\xb6;l\\u2e6d\\u2e6e\\u40b6le\\xec\\u0403\\u0269\\u2e78\\0\\0\\u2e7bm;\\u6af3;\\u6afdy;\\u443fr\\u0280cimpt\\u2e8b\\u2e8f\\u2e93\\u1865\\u2e97nt;\\u4025od;\\u402eil;\\u6030enk;\\u6031r;\\uc000\\ud835\\udd2d\\u0180imo\\u2ea8\\u2eb0\\u2eb4\\u0100;v\\u2ead\\u2eae\\u43c6;\\u43d5ma\\xf4\\u0a76ne;\\u660e\\u0180;tv\\u2ebf\\u2ec0\\u2ec8\\u43c0chfork\\xbb\\u1ffd;\\u43d6\\u0100au\\u2ecf\\u2edfn\\u0100ck\\u2ed5\\u2eddk\\u0100;h\\u21f4\\u2edb;\\u610e\\xf6\\u21f4s\\u0480;abcdemst\\u2ef3\\u2ef4\\u1908\\u2ef9\\u2efd\\u2f04\\u2f06\\u2f0a\\u2f0e\\u402bcir;\\u6a23ir;\\u6a22\\u0100ou\\u1d40\\u2f02;\\u6a25;\\u6a72n\\u80bb\\xb1\\u0e9dim;\\u6a26wo;\\u6a27\\u0180ipu\\u2f19\\u2f20\\u2f25ntint;\\u6a15f;\\uc000\\ud835\\udd61nd\\u803b\\xa3\\u40a3\\u0500;Eaceinosu\\u0ec8\\u2f3f\\u2f41\\u2f44\\u2f47\\u2f81\\u2f89\\u2f92\\u2f7e\\u2fb6;\\u6ab3p;\\u6ab7u\\xe5\\u0ed9\\u0100;c\\u0ece\\u2f4c\\u0300;acens\\u0ec8\\u2f59\\u2f5f\\u2f66\\u2f68\\u2f7eppro\\xf8\\u2f43urlye\\xf1\\u0ed9\\xf1\\u0ece\\u0180aes\\u2f6f\\u2f76\\u2f7approx;\\u6ab9qq;\\u6ab5im;\\u62e8i\\xed\\u0edfme\\u0100;s\\u2f88\\u0eae\\u6032\\u0180Eas\\u2f78\\u2f90\\u2f7a\\xf0\\u2f75\\u0180dfp\\u0eec\\u2f99\\u2faf\\u0180als\\u2fa0\\u2fa5\\u2faalar;\\u632eine;\\u6312urf;\\u6313\\u0100;t\\u0efb\\u2fb4\\xef\\u0efbrel;\\u62b0\\u0100ci\\u2fc0\\u2fc5r;\\uc000\\ud835\\udcc5;\\u43c8ncsp;\\u6008\\u0300fiopsu\\u2fda\\u22e2\\u2fdf\\u2fe5\\u2feb\\u2ff1r;\\uc000\\ud835\\udd2epf;\\uc000\\ud835\\udd62rime;\\u6057cr;\\uc000\\ud835\\udcc6\\u0180aeo\\u2ff8\\u3009\\u3013t\\u0100ei\\u2ffe\\u3005rnion\\xf3\\u06b0nt;\\u6a16st\\u0100;e\\u3010\\u3011\\u403f\\xf1\\u1f19\\xf4\\u0f14\\u0a80ABHabcdefhilmnoprstux\\u3040\\u3051\\u3055\\u3059\\u30e0\\u310e\\u312b\\u3147\\u3162\\u3172\\u318e\\u3206\\u3215\\u3224\\u3229\\u3258\\u326e\\u3272\\u3290\\u32b0\\u32b7\\u0180art\\u3047\\u304a\\u304cr\\xf2\\u10b3\\xf2\\u03ddail;\\u691car\\xf2\\u1c65ar;\\u6964\\u0380cdenqrt\\u3068\\u3075\\u3078\\u307f\\u308f\\u3094\\u30cc\\u0100eu\\u306d\\u3071;\\uc000\\u223d\\u0331te;\\u4155i\\xe3\\u116emptyv;\\u69b3g\\u0200;del\\u0fd1\\u3089\\u308b\\u308d;\\u6992;\\u69a5\\xe5\\u0fd1uo\\u803b\\xbb\\u40bbr\\u0580;abcfhlpstw\\u0fdc\\u30ac\\u30af\\u30b7\\u30b9\\u30bc\\u30be\\u30c0\\u30c3\\u30c7\\u30cap;\\u6975\\u0100;f\\u0fe0\\u30b4s;\\u6920;\\u6933s;\\u691e\\xeb\\u225d\\xf0\\u272el;\\u6945im;\\u6974l;\\u61a3;\\u619d\\u0100ai\\u30d1\\u30d5il;\\u691ao\\u0100;n\\u30db\\u30dc\\u6236al\\xf3\\u0f1e\\u0180abr\\u30e7\\u30ea\\u30eer\\xf2\\u17e5rk;\\u6773\\u0100ak\\u30f3\\u30fdc\\u0100ek\\u30f9\\u30fb;\\u407d;\\u405d\\u0100es\\u3102\\u3104;\\u698cl\\u0100du\\u310a\\u310c;\\u698e;\\u6990\\u0200aeuy\\u3117\\u311c\\u3127\\u3129ron;\\u4159\\u0100di\\u3121\\u3125il;\\u4157\\xec\\u0ff2\\xe2\\u30fa;\\u4440\\u0200clqs\\u3134\\u3137\\u313d\\u3144a;\\u6937dhar;\\u6969uo\\u0100;r\\u020e\\u020dh;\\u61b3\\u0180acg\\u314e\\u315f\\u0f44l\\u0200;ips\\u0f78\\u3158\\u315b\\u109cn\\xe5\\u10bbar\\xf4\\u0fa9t;\\u65ad\\u0180ilr\\u3169\\u1023\\u316esht;\\u697d;\\uc000\\ud835\\udd2f\\u0100ao\\u3177\\u3186r\\u0100du\\u317d\\u317f\\xbb\\u047b\\u0100;l\\u1091\\u3184;\\u696c\\u0100;v\\u318b\\u318c\\u43c1;\\u43f1\\u0180gns\\u3195\\u31f9\\u31fcht\\u0300ahlrst\\u31a4\\u31b0\\u31c2\\u31d8\\u31e4\\u31eerrow\\u0100;t\\u0fdc\\u31ada\\xe9\\u30c8arpoon\\u0100du\\u31bb\\u31bfow\\xee\\u317ep\\xbb\\u1092eft\\u0100ah\\u31ca\\u31d0rrow\\xf3\\u0feaarpoon\\xf3\\u0551ightarrows;\\u61c9quigarro\\xf7\\u30cbhreetimes;\\u62ccg;\\u42daingdotse\\xf1\\u1f32\\u0180ahm\\u320d\\u3210\\u3213r\\xf2\\u0feaa\\xf2\\u0551;\\u600foust\\u0100;a\\u321e\\u321f\\u63b1che\\xbb\\u321fmid;\\u6aee\\u0200abpt\\u3232\\u323d\\u3240\\u3252\\u0100nr\\u3237\\u323ag;\\u67edr;\\u61fer\\xeb\\u1003\\u0180afl\\u3247\\u324a\\u324er;\\u6986;\\uc000\\ud835\\udd63us;\\u6a2eimes;\\u6a35\\u0100ap\\u325d\\u3267r\\u0100;g\\u3263\\u3264\\u4029t;\\u6994olint;\\u6a12ar\\xf2\\u31e3\\u0200achq\\u327b\\u3280\\u10bc\\u3285quo;\\u603ar;\\uc000\\ud835\\udcc7\\u0100bu\\u30fb\\u328ao\\u0100;r\\u0214\\u0213\\u0180hir\\u3297\\u329b\\u32a0re\\xe5\\u31f8mes;\\u62cai\\u0200;efl\\u32aa\\u1059\\u1821\\u32ab\\u65b9tri;\\u69celuhar;\\u6968;\\u611e\\u0d61\\u32d5\\u32db\\u32df\\u332c\\u3338\\u3371\\0\\u337a\\u33a4\\0\\0\\u33ec\\u33f0\\0\\u3428\\u3448\\u345a\\u34ad\\u34b1\\u34ca\\u34f1\\0\\u3616\\0\\0\\u3633cute;\\u415bqu\\xef\\u27ba\\u0500;Eaceinpsy\\u11ed\\u32f3\\u32f5\\u32ff\\u3302\\u330b\\u330f\\u331f\\u3326\\u3329;\\u6ab4\\u01f0\\u32fa\\0\\u32fc;\\u6ab8on;\\u4161u\\xe5\\u11fe\\u0100;d\\u11f3\\u3307il;\\u415frc;\\u415d\\u0180Eas\\u3316\\u3318\\u331b;\\u6ab6p;\\u6abaim;\\u62e9olint;\\u6a13i\\xed\\u1204;\\u4441ot\\u0180;be\\u3334\\u1d47\\u3335\\u62c5;\\u6a66\\u0380Aacmstx\\u3346\\u334a\\u3357\\u335b\\u335e\\u3363\\u336drr;\\u61d8r\\u0100hr\\u3350\\u3352\\xeb\\u2228\\u0100;o\\u0a36\\u0a34t\\u803b\\xa7\\u40a7i;\\u403bwar;\\u6929m\\u0100in\\u3369\\xf0nu\\xf3\\xf1t;\\u6736r\\u0100;o\\u3376\\u2055\\uc000\\ud835\\udd30\\u0200acoy\\u3382\\u3386\\u3391\\u33a0rp;\\u666f\\u0100hy\\u338b\\u338fcy;\\u4449;\\u4448rt\\u026d\\u3399\\0\\0\\u339ci\\xe4\\u1464ara\\xec\\u2e6f\\u803b\\xad\\u40ad\\u0100gm\\u33a8\\u33b4ma\\u0180;fv\\u33b1\\u33b2\\u33b2\\u43c3;\\u43c2\\u0400;deglnpr\\u12ab\\u33c5\\u33c9\\u33ce\\u33d6\\u33de\\u33e1\\u33e6ot;\\u6a6a\\u0100;q\\u12b1\\u12b0\\u0100;E\\u33d3\\u33d4\\u6a9e;\\u6aa0\\u0100;E\\u33db\\u33dc\\u6a9d;\\u6a9fe;\\u6246lus;\\u6a24arr;\\u6972ar\\xf2\\u113d\\u0200aeit\\u33f8\\u3408\\u340f\\u3417\\u0100ls\\u33fd\\u3404lsetm\\xe9\\u336ahp;\\u6a33parsl;\\u69e4\\u0100dl\\u1463\\u3414e;\\u6323\\u0100;e\\u341c\\u341d\\u6aaa\\u0100;s\\u3422\\u3423\\u6aac;\\uc000\\u2aac\\ufe00\\u0180flp\\u342e\\u3433\\u3442tcy;\\u444c\\u0100;b\\u3438\\u3439\\u402f\\u0100;a\\u343e\\u343f\\u69c4r;\\u633ff;\\uc000\\ud835\\udd64a\\u0100dr\\u344d\\u0402es\\u0100;u\\u3454\\u3455\\u6660it\\xbb\\u3455\\u0180csu\\u3460\\u3479\\u349f\\u0100au\\u3465\\u346fp\\u0100;s\\u1188\\u346b;\\uc000\\u2293\\ufe00p\\u0100;s\\u11b4\\u3475;\\uc000\\u2294\\ufe00u\\u0100bp\\u347f\\u348f\\u0180;es\\u1197\\u119c\\u3486et\\u0100;e\\u1197\\u348d\\xf1\\u119d\\u0180;es\\u11a8\\u11ad\\u3496et\\u0100;e\\u11a8\\u349d\\xf1\\u11ae\\u0180;af\\u117b\\u34a6\\u05b0r\\u0165\\u34ab\\u05b1\\xbb\\u117car\\xf2\\u1148\\u0200cemt\\u34b9\\u34be\\u34c2\\u34c5r;\\uc000\\ud835\\udcc8tm\\xee\\xf1i\\xec\\u3415ar\\xe6\\u11be\\u0100ar\\u34ce\\u34d5r\\u0100;f\\u34d4\\u17bf\\u6606\\u0100an\\u34da\\u34edight\\u0100ep\\u34e3\\u34eapsilo\\xee\\u1ee0h\\xe9\\u2eafs\\xbb\\u2852\\u0280bcmnp\\u34fb\\u355e\\u1209\\u358b\\u358e\\u0480;Edemnprs\\u350e\\u350f\\u3511\\u3515\\u351e\\u3523\\u352c\\u3531\\u3536\\u6282;\\u6ac5ot;\\u6abd\\u0100;d\\u11da\\u351aot;\\u6ac3ult;\\u6ac1\\u0100Ee\\u3528\\u352a;\\u6acb;\\u628alus;\\u6abfarr;\\u6979\\u0180eiu\\u353d\\u3552\\u3555t\\u0180;en\\u350e\\u3545\\u354bq\\u0100;q\\u11da\\u350feq\\u0100;q\\u352b\\u3528m;\\u6ac7\\u0100bp\\u355a\\u355c;\\u6ad5;\\u6ad3c\\u0300;acens\\u11ed\\u356c\\u3572\\u3579\\u357b\\u3326ppro\\xf8\\u32faurlye\\xf1\\u11fe\\xf1\\u11f3\\u0180aes\\u3582\\u3588\\u331bppro\\xf8\\u331aq\\xf1\\u3317g;\\u666a\\u0680123;Edehlmnps\\u35a9\\u35ac\\u35af\\u121c\\u35b2\\u35b4\\u35c0\\u35c9\\u35d5\\u35da\\u35df\\u35e8\\u35ed\\u803b\\xb9\\u40b9\\u803b\\xb2\\u40b2\\u803b\\xb3\\u40b3;\\u6ac6\\u0100os\\u35b9\\u35bct;\\u6abeub;\\u6ad8\\u0100;d\\u1222\\u35c5ot;\\u6ac4s\\u0100ou\\u35cf\\u35d2l;\\u67c9b;\\u6ad7arr;\\u697bult;\\u6ac2\\u0100Ee\\u35e4\\u35e6;\\u6acc;\\u628blus;\\u6ac0\\u0180eiu\\u35f4\\u3609\\u360ct\\u0180;en\\u121c\\u35fc\\u3602q\\u0100;q\\u1222\\u35b2eq\\u0100;q\\u35e7\\u35e4m;\\u6ac8\\u0100bp\\u3611\\u3613;\\u6ad4;\\u6ad6\\u0180Aan\\u361c\\u3620\\u362drr;\\u61d9r\\u0100hr\\u3626\\u3628\\xeb\\u222e\\u0100;o\\u0a2b\\u0a29war;\\u692alig\\u803b\\xdf\\u40df\\u0be1\\u3651\\u365d\\u3660\\u12ce\\u3673\\u3679\\0\\u367e\\u36c2\\0\\0\\0\\0\\0\\u36db\\u3703\\0\\u3709\\u376c\\0\\0\\0\\u3787\\u0272\\u3656\\0\\0\\u365bget;\\u6316;\\u43c4r\\xeb\\u0e5f\\u0180aey\\u3666\\u366b\\u3670ron;\\u4165dil;\\u4163;\\u4442lrec;\\u6315r;\\uc000\\ud835\\udd31\\u0200eiko\\u3686\\u369d\\u36b5\\u36bc\\u01f2\\u368b\\0\\u3691e\\u01004f\\u1284\\u1281a\\u0180;sv\\u3698\\u3699\\u369b\\u43b8ym;\\u43d1\\u0100cn\\u36a2\\u36b2k\\u0100as\\u36a8\\u36aeppro\\xf8\\u12c1im\\xbb\\u12acs\\xf0\\u129e\\u0100as\\u36ba\\u36ae\\xf0\\u12c1rn\\u803b\\xfe\\u40fe\\u01ec\\u031f\\u36c6\\u22e7es\\u8180\\xd7;bd\\u36cf\\u36d0\\u36d8\\u40d7\\u0100;a\\u190f\\u36d5r;\\u6a31;\\u6a30\\u0180eps\\u36e1\\u36e3\\u3700\\xe1\\u2a4d\\u0200;bcf\\u0486\\u36ec\\u36f0\\u36f4ot;\\u6336ir;\\u6af1\\u0100;o\\u36f9\\u36fc\\uc000\\ud835\\udd65rk;\\u6ada\\xe1\\u3362rime;\\u6034\\u0180aip\\u370f\\u3712\\u3764d\\xe5\\u1248\\u0380adempst\\u3721\\u374d\\u3740\\u3751\\u3757\\u375c\\u375fngle\\u0280;dlqr\\u3730\\u3731\\u3736\\u3740\\u3742\\u65b5own\\xbb\\u1dbbeft\\u0100;e\\u2800\\u373e\\xf1\\u092e;\\u625cight\\u0100;e\\u32aa\\u374b\\xf1\\u105aot;\\u65ecinus;\\u6a3alus;\\u6a39b;\\u69cdime;\\u6a3bezium;\\u63e2\\u0180cht\\u3772\\u377d\\u3781\\u0100ry\\u3777\\u377b;\\uc000\\ud835\\udcc9;\\u4446cy;\\u445brok;\\u4167\\u0100io\\u378b\\u378ex\\xf4\\u1777head\\u0100lr\\u3797\\u37a0eftarro\\xf7\\u084fightarrow\\xbb\\u0f5d\\u0900AHabcdfghlmoprstuw\\u37d0\\u37d3\\u37d7\\u37e4\\u37f0\\u37fc\\u380e\\u381c\\u3823\\u3834\\u3851\\u385d\\u386b\\u38a9\\u38cc\\u38d2\\u38ea\\u38f6r\\xf2\\u03edar;\\u6963\\u0100cr\\u37dc\\u37e2ute\\u803b\\xfa\\u40fa\\xf2\\u1150r\\u01e3\\u37ea\\0\\u37edy;\\u445eve;\\u416d\\u0100iy\\u37f5\\u37farc\\u803b\\xfb\\u40fb;\\u4443\\u0180abh\\u3803\\u3806\\u380br\\xf2\\u13adlac;\\u4171a\\xf2\\u13c3\\u0100ir\\u3813\\u3818sht;\\u697e;\\uc000\\ud835\\udd32rave\\u803b\\xf9\\u40f9\\u0161\\u3827\\u3831r\\u0100lr\\u382c\\u382e\\xbb\\u0957\\xbb\\u1083lk;\\u6580\\u0100ct\\u3839\\u384d\\u026f\\u383f\\0\\0\\u384arn\\u0100;e\\u3845\\u3846\\u631cr\\xbb\\u3846op;\\u630fri;\\u65f8\\u0100al\\u3856\\u385acr;\\u416b\\u80bb\\xa8\\u0349\\u0100gp\\u3862\\u3866on;\\u4173f;\\uc000\\ud835\\udd66\\u0300adhlsu\\u114b\\u3878\\u387d\\u1372\\u3891\\u38a0own\\xe1\\u13b3arpoon\\u0100lr\\u3888\\u388cef\\xf4\\u382digh\\xf4\\u382fi\\u0180;hl\\u3899\\u389a\\u389c\\u43c5\\xbb\\u13faon\\xbb\\u389aparrows;\\u61c8\\u0180cit\\u38b0\\u38c4\\u38c8\\u026f\\u38b6\\0\\0\\u38c1rn\\u0100;e\\u38bc\\u38bd\\u631dr\\xbb\\u38bdop;\\u630eng;\\u416fri;\\u65f9cr;\\uc000\\ud835\\udcca\\u0180dir\\u38d9\\u38dd\\u38e2ot;\\u62f0lde;\\u4169i\\u0100;f\\u3730\\u38e8\\xbb\\u1813\\u0100am\\u38ef\\u38f2r\\xf2\\u38a8l\\u803b\\xfc\\u40fcangle;\\u69a7\\u0780ABDacdeflnoprsz\\u391c\\u391f\\u3929\\u392d\\u39b5\\u39b8\\u39bd\\u39df\\u39e4\\u39e8\\u39f3\\u39f9\\u39fd\\u3a01\\u3a20r\\xf2\\u03f7ar\\u0100;v\\u3926\\u3927\\u6ae8;\\u6ae9as\\xe8\\u03e1\\u0100nr\\u3932\\u3937grt;\\u699c\\u0380eknprst\\u34e3\\u3946\\u394b\\u3952\\u395d\\u3964\\u3996app\\xe1\\u2415othin\\xe7\\u1e96\\u0180hir\\u34eb\\u2ec8\\u3959op\\xf4\\u2fb5\\u0100;h\\u13b7\\u3962\\xef\\u318d\\u0100iu\\u3969\\u396dgm\\xe1\\u33b3\\u0100bp\\u3972\\u3984setneq\\u0100;q\\u397d\\u3980\\uc000\\u228a\\ufe00;\\uc000\\u2acb\\ufe00setneq\\u0100;q\\u398f\\u3992\\uc000\\u228b\\ufe00;\\uc000\\u2acc\\ufe00\\u0100hr\\u399b\\u399fet\\xe1\\u369ciangle\\u0100lr\\u39aa\\u39afeft\\xbb\\u0925ight\\xbb\\u1051y;\\u4432ash\\xbb\\u1036\\u0180elr\\u39c4\\u39d2\\u39d7\\u0180;be\\u2dea\\u39cb\\u39cfar;\\u62bbq;\\u625alip;\\u62ee\\u0100bt\\u39dc\\u1468a\\xf2\\u1469r;\\uc000\\ud835\\udd33tr\\xe9\\u39aesu\\u0100bp\\u39ef\\u39f1\\xbb\\u0d1c\\xbb\\u0d59pf;\\uc000\\ud835\\udd67ro\\xf0\\u0efbtr\\xe9\\u39b4\\u0100cu\\u3a06\\u3a0br;\\uc000\\ud835\\udccb\\u0100bp\\u3a10\\u3a18n\\u0100Ee\\u3980\\u3a16\\xbb\\u397en\\u0100Ee\\u3992\\u3a1e\\xbb\\u3990igzag;\\u699a\\u0380cefoprs\\u3a36\\u3a3b\\u3a56\\u3a5b\\u3a54\\u3a61\\u3a6airc;\\u4175\\u0100di\\u3a40\\u3a51\\u0100bg\\u3a45\\u3a49ar;\\u6a5fe\\u0100;q\\u15fa\\u3a4f;\\u6259erp;\\u6118r;\\uc000\\ud835\\udd34pf;\\uc000\\ud835\\udd68\\u0100;e\\u1479\\u3a66at\\xe8\\u1479cr;\\uc000\\ud835\\udccc\\u0ae3\\u178e\\u3a87\\0\\u3a8b\\0\\u3a90\\u3a9b\\0\\0\\u3a9d\\u3aa8\\u3aab\\u3aaf\\0\\0\\u3ac3\\u3ace\\0\\u3ad8\\u17dc\\u17dftr\\xe9\\u17d1r;\\uc000\\ud835\\udd35\\u0100Aa\\u3a94\\u3a97r\\xf2\\u03c3r\\xf2\\u09f6;\\u43be\\u0100Aa\\u3aa1\\u3aa4r\\xf2\\u03b8r\\xf2\\u09eba\\xf0\\u2713is;\\u62fb\\u0180dpt\\u17a4\\u3ab5\\u3abe\\u0100fl\\u3aba\\u17a9;\\uc000\\ud835\\udd69im\\xe5\\u17b2\\u0100Aa\\u3ac7\\u3acar\\xf2\\u03cer\\xf2\\u0a01\\u0100cq\\u3ad2\\u17b8r;\\uc000\\ud835\\udccd\\u0100pt\\u17d6\\u3adcr\\xe9\\u17d4\\u0400acefiosu\\u3af0\\u3afd\\u3b08\\u3b0c\\u3b11\\u3b15\\u3b1b\\u3b21c\\u0100uy\\u3af6\\u3afbte\\u803b\\xfd\\u40fd;\\u444f\\u0100iy\\u3b02\\u3b06rc;\\u4177;\\u444bn\\u803b\\xa5\\u40a5r;\\uc000\\ud835\\udd36cy;\\u4457pf;\\uc000\\ud835\\udd6acr;\\uc000\\ud835\\udcce\\u0100cm\\u3b26\\u3b29y;\\u444el\\u803b\\xff\\u40ff\\u0500acdefhiosw\\u3b42\\u3b48\\u3b54\\u3b58\\u3b64\\u3b69\\u3b6d\\u3b74\\u3b7a\\u3b80cute;\\u417a\\u0100ay\\u3b4d\\u3b52ron;\\u417e;\\u4437ot;\\u417c\\u0100et\\u3b5d\\u3b61tr\\xe6\\u155fa;\\u43b6r;\\uc000\\ud835\\udd37cy;\\u4436grarr;\\u61ddpf;\\uc000\\ud835\\udd6bcr;\\uc000\\ud835\\udccf\\u0100jn\\u3b85\\u3b87;\\u600dj;\\u600c'.split(\"\").map(c => c.charCodeAt(0)));\n // Generated using scripts/write-decode-map.ts\n var xmlDecodeTree = new Uint16Array(\n // prettier-ignore\n \"\\u0200aglq\\t\\x15\\x18\\x1b\\u026d\\x0f\\0\\0\\x12p;\\u4026os;\\u4027t;\\u403et;\\u403cuot;\\u4022\".split(\"\").map(c => c.charCodeAt(0)));\n // Adapted from https://github.com/mathiasbynens/he/blob/36afe179392226cf1b6ccdb16ebbb7a5a844d93a/src/he.js#L106-L134\n var _a;\n const decodeMap = new Map([ [ 0, 65533 ],\n // C1 Unicode control character reference replacements\n [ 128, 8364 ], [ 130, 8218 ], [ 131, 402 ], [ 132, 8222 ], [ 133, 8230 ], [ 134, 8224 ], [ 135, 8225 ], [ 136, 710 ], [ 137, 8240 ], [ 138, 352 ], [ 139, 8249 ], [ 140, 338 ], [ 142, 381 ], [ 145, 8216 ], [ 146, 8217 ], [ 147, 8220 ], [ 148, 8221 ], [ 149, 8226 ], [ 150, 8211 ], [ 151, 8212 ], [ 152, 732 ], [ 153, 8482 ], [ 154, 353 ], [ 155, 8250 ], [ 156, 339 ], [ 158, 382 ], [ 159, 376 ] ]);\n /**\n * Polyfill for `String.fromCodePoint`. It is used to create a string from a Unicode code point.\n */ const fromCodePoint$1 =\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition, node/no-unsupported-features/es-builtins\n (_a = String.fromCodePoint) !== null && _a !== void 0 ? _a : function(codePoint) {\n let output = \"\";\n if (codePoint > 65535) {\n codePoint -= 65536;\n output += String.fromCharCode(codePoint >>> 10 & 1023 | 55296);\n codePoint = 56320 | codePoint & 1023;\n }\n output += String.fromCharCode(codePoint);\n return output;\n };\n /**\n * Replace the given code point with a replacement character if it is a\n * surrogate or is outside the valid range. Otherwise return the code\n * point unchanged.\n */ function replaceCodePoint(codePoint) {\n var _a;\n if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) {\n return 65533;\n }\n return (_a = decodeMap.get(codePoint)) !== null && _a !== void 0 ? _a : codePoint;\n }\n var CharCodes;\n (function(CharCodes) {\n CharCodes[CharCodes[\"NUM\"] = 35] = \"NUM\";\n CharCodes[CharCodes[\"SEMI\"] = 59] = \"SEMI\";\n CharCodes[CharCodes[\"EQUALS\"] = 61] = \"EQUALS\";\n CharCodes[CharCodes[\"ZERO\"] = 48] = \"ZERO\";\n CharCodes[CharCodes[\"NINE\"] = 57] = \"NINE\";\n CharCodes[CharCodes[\"LOWER_A\"] = 97] = \"LOWER_A\";\n CharCodes[CharCodes[\"LOWER_F\"] = 102] = \"LOWER_F\";\n CharCodes[CharCodes[\"LOWER_X\"] = 120] = \"LOWER_X\";\n CharCodes[CharCodes[\"LOWER_Z\"] = 122] = \"LOWER_Z\";\n CharCodes[CharCodes[\"UPPER_A\"] = 65] = \"UPPER_A\";\n CharCodes[CharCodes[\"UPPER_F\"] = 70] = \"UPPER_F\";\n CharCodes[CharCodes[\"UPPER_Z\"] = 90] = \"UPPER_Z\";\n })(CharCodes || (CharCodes = {}));\n /** Bit that needs to be set to convert an upper case ASCII character to lower case */ const TO_LOWER_BIT = 32;\n var BinTrieFlags;\n (function(BinTrieFlags) {\n BinTrieFlags[BinTrieFlags[\"VALUE_LENGTH\"] = 49152] = \"VALUE_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"BRANCH_LENGTH\"] = 16256] = \"BRANCH_LENGTH\";\n BinTrieFlags[BinTrieFlags[\"JUMP_TABLE\"] = 127] = \"JUMP_TABLE\";\n })(BinTrieFlags || (BinTrieFlags = {}));\n function isNumber(code) {\n return code >= CharCodes.ZERO && code <= CharCodes.NINE;\n }\n function isHexadecimalCharacter(code) {\n return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F;\n }\n function isAsciiAlphaNumeric(code) {\n return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code);\n }\n /**\n * Checks if the given character is a valid end character for an entity in an attribute.\n *\n * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.\n * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state\n */ function isEntityInAttributeInvalidEnd(code) {\n return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);\n }\n var EntityDecoderState;\n (function(EntityDecoderState) {\n EntityDecoderState[EntityDecoderState[\"EntityStart\"] = 0] = \"EntityStart\";\n EntityDecoderState[EntityDecoderState[\"NumericStart\"] = 1] = \"NumericStart\";\n EntityDecoderState[EntityDecoderState[\"NumericDecimal\"] = 2] = \"NumericDecimal\";\n EntityDecoderState[EntityDecoderState[\"NumericHex\"] = 3] = \"NumericHex\";\n EntityDecoderState[EntityDecoderState[\"NamedEntity\"] = 4] = \"NamedEntity\";\n })(EntityDecoderState || (EntityDecoderState = {}));\n var DecodingMode;\n (function(DecodingMode) {\n /** Entities in text nodes that can end with any character. */\n DecodingMode[DecodingMode[\"Legacy\"] = 0] = \"Legacy\";\n /** Only allow entities terminated with a semicolon. */ DecodingMode[DecodingMode[\"Strict\"] = 1] = \"Strict\";\n /** Entities in attributes have limitations on ending characters. */ DecodingMode[DecodingMode[\"Attribute\"] = 2] = \"Attribute\";\n })(DecodingMode || (DecodingMode = {}));\n /**\n * Token decoder with support of writing partial entities.\n */ class EntityDecoder {\n constructor(/** The tree used to decode entities. */\n decodeTree,\n /**\n * The function that is called when a codepoint is decoded.\n *\n * For multi-byte named entities, this will be called multiple times,\n * with the second codepoint, and the same `consumed` value.\n *\n * @param codepoint The decoded codepoint.\n * @param consumed The number of bytes consumed by the decoder.\n */\n emitCodePoint, /** An object that is used to produce errors. */\n errors) {\n this.decodeTree = decodeTree;\n this.emitCodePoint = emitCodePoint;\n this.errors = errors;\n /** The current state of the decoder. */ this.state = EntityDecoderState.EntityStart;\n /** Characters that were consumed while parsing an entity. */ this.consumed = 1;\n /**\n * The result of the entity.\n *\n * Either the result index of a numeric entity, or the codepoint of a\n * numeric entity.\n */ this.result = 0;\n /** The current index in the decode tree. */ this.treeIndex = 0;\n /** The number of characters that were consumed in excess. */ this.excess = 1;\n /** The mode in which the decoder is operating. */ this.decodeMode = DecodingMode.Strict;\n }\n /** Resets the instance to make it reusable. */ startEntity(decodeMode) {\n this.decodeMode = decodeMode;\n this.state = EntityDecoderState.EntityStart;\n this.result = 0;\n this.treeIndex = 0;\n this.excess = 1;\n this.consumed = 1;\n }\n /**\n * Write an entity to the decoder. This can be called multiple times with partial entities.\n * If the entity is incomplete, the decoder will return -1.\n *\n * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the\n * entity is incomplete, and resume when the next string is written.\n *\n * @param string The string containing the entity (or a continuation of the entity).\n * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */ write(str, offset) {\n switch (this.state) {\n case EntityDecoderState.EntityStart:\n {\n if (str.charCodeAt(offset) === CharCodes.NUM) {\n this.state = EntityDecoderState.NumericStart;\n this.consumed += 1;\n return this.stateNumericStart(str, offset + 1);\n }\n this.state = EntityDecoderState.NamedEntity;\n return this.stateNamedEntity(str, offset);\n }\n\n case EntityDecoderState.NumericStart:\n {\n return this.stateNumericStart(str, offset);\n }\n\n case EntityDecoderState.NumericDecimal:\n {\n return this.stateNumericDecimal(str, offset);\n }\n\n case EntityDecoderState.NumericHex:\n {\n return this.stateNumericHex(str, offset);\n }\n\n case EntityDecoderState.NamedEntity:\n {\n return this.stateNamedEntity(str, offset);\n }\n }\n }\n /**\n * Switches between the numeric decimal and hexadecimal states.\n *\n * Equivalent to the `Numeric character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */ stateNumericStart(str, offset) {\n if (offset >= str.length) {\n return -1;\n }\n if ((str.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {\n this.state = EntityDecoderState.NumericHex;\n this.consumed += 1;\n return this.stateNumericHex(str, offset + 1);\n }\n this.state = EntityDecoderState.NumericDecimal;\n return this.stateNumericDecimal(str, offset);\n }\n addToNumericResult(str, start, end, base) {\n if (start !== end) {\n const digitCount = end - start;\n this.result = this.result * Math.pow(base, digitCount) + parseInt(str.substr(start, digitCount), base);\n this.consumed += digitCount;\n }\n }\n /**\n * Parses a hexadecimal numeric entity.\n *\n * Equivalent to the `Hexademical character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */ stateNumericHex(str, offset) {\n const startIdx = offset;\n while (offset < str.length) {\n const char = str.charCodeAt(offset);\n if (isNumber(char) || isHexadecimalCharacter(char)) {\n offset += 1;\n } else {\n this.addToNumericResult(str, startIdx, offset, 16);\n return this.emitNumericEntity(char, 3);\n }\n }\n this.addToNumericResult(str, startIdx, offset, 16);\n return -1;\n }\n /**\n * Parses a decimal numeric entity.\n *\n * Equivalent to the `Decimal character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */ stateNumericDecimal(str, offset) {\n const startIdx = offset;\n while (offset < str.length) {\n const char = str.charCodeAt(offset);\n if (isNumber(char)) {\n offset += 1;\n } else {\n this.addToNumericResult(str, startIdx, offset, 10);\n return this.emitNumericEntity(char, 2);\n }\n }\n this.addToNumericResult(str, startIdx, offset, 10);\n return -1;\n }\n /**\n * Validate and emit a numeric entity.\n *\n * Implements the logic from the `Hexademical character reference start\n * state` and `Numeric character reference end state` in the HTML spec.\n *\n * @param lastCp The last code point of the entity. Used to see if the\n * entity was terminated with a semicolon.\n * @param expectedLength The minimum number of characters that should be\n * consumed. Used to validate that at least one digit\n * was consumed.\n * @returns The number of characters that were consumed.\n */ emitNumericEntity(lastCp, expectedLength) {\n var _a;\n // Ensure we consumed at least one digit.\n if (this.consumed <= expectedLength) {\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n // Figure out if this is a legit end of the entity\n if (lastCp === CharCodes.SEMI) {\n this.consumed += 1;\n } else if (this.decodeMode === DecodingMode.Strict) {\n return 0;\n }\n this.emitCodePoint(replaceCodePoint(this.result), this.consumed);\n if (this.errors) {\n if (lastCp !== CharCodes.SEMI) {\n this.errors.missingSemicolonAfterCharacterReference();\n }\n this.errors.validateNumericCharacterReference(this.result);\n }\n return this.consumed;\n }\n /**\n * Parses a named entity.\n *\n * Equivalent to the `Named character reference state` in the HTML spec.\n *\n * @param str The string containing the entity (or a continuation of the entity).\n * @param offset The current offset.\n * @returns The number of characters that were consumed, or -1 if the entity is incomplete.\n */ stateNamedEntity(str, offset) {\n const {decodeTree: decodeTree} = this;\n let current = decodeTree[this.treeIndex];\n // The mask is the number of bytes of the value, including the current byte.\n let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n for (;offset < str.length; offset++, this.excess++) {\n const char = str.charCodeAt(offset);\n this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);\n if (this.treeIndex < 0) {\n return this.result === 0 ||\n // If we are parsing an attribute\n this.decodeMode === DecodingMode.Attribute && (\n // We shouldn't have consumed any characters after the entity,\n valueLength === 0 ||\n // And there should be no invalid characters.\n isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();\n }\n current = decodeTree[this.treeIndex];\n valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;\n // If the branch is a value, store it and continue\n if (valueLength !== 0) {\n // If the entity is terminated by a semicolon, we are done.\n if (char === CharCodes.SEMI) {\n return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);\n }\n // If we encounter a non-terminated (legacy) entity while parsing strictly, then ignore it.\n if (this.decodeMode !== DecodingMode.Strict) {\n this.result = this.treeIndex;\n this.consumed += this.excess;\n this.excess = 0;\n }\n }\n }\n return -1;\n }\n /**\n * Emit a named entity that was not terminated with a semicolon.\n *\n * @returns The number of characters consumed.\n */ emitNotTerminatedNamedEntity() {\n var _a;\n const {result: result, decodeTree: decodeTree} = this;\n const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;\n this.emitNamedEntityData(result, valueLength, this.consumed);\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.missingSemicolonAfterCharacterReference();\n return this.consumed;\n }\n /**\n * Emit a named entity.\n *\n * @param result The index of the entity in the decode tree.\n * @param valueLength The number of bytes in the entity.\n * @param consumed The number of characters consumed.\n *\n * @returns The number of characters consumed.\n */ emitNamedEntityData(result, valueLength, consumed) {\n const {decodeTree: decodeTree} = this;\n this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~BinTrieFlags.VALUE_LENGTH : decodeTree[result + 1], consumed);\n if (valueLength === 3) {\n // For multi-byte values, we need to emit the second byte.\n this.emitCodePoint(decodeTree[result + 2], consumed);\n }\n return consumed;\n }\n /**\n * Signal to the parser that the end of the input was reached.\n *\n * Remaining data will be emitted and relevant errors will be produced.\n *\n * @returns The number of characters consumed.\n */ end() {\n var _a;\n switch (this.state) {\n case EntityDecoderState.NamedEntity:\n {\n // Emit a named entity if we have one.\n return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;\n }\n\n // Otherwise, emit a numeric entity if we have one.\n case EntityDecoderState.NumericDecimal:\n {\n return this.emitNumericEntity(0, 2);\n }\n\n case EntityDecoderState.NumericHex:\n {\n return this.emitNumericEntity(0, 3);\n }\n\n case EntityDecoderState.NumericStart:\n {\n (_a = this.errors) === null || _a === void 0 ? void 0 : _a.absenceOfDigitsInNumericCharacterReference(this.consumed);\n return 0;\n }\n\n case EntityDecoderState.EntityStart:\n {\n // Return 0 if we have no entity.\n return 0;\n }\n }\n }\n }\n /**\n * Creates a function that decodes entities in a string.\n *\n * @param decodeTree The decode tree.\n * @returns A function that decodes entities in a string.\n */ function getDecoder(decodeTree) {\n let ret = \"\";\n const decoder = new EntityDecoder(decodeTree, str => ret += fromCodePoint$1(str));\n return function decodeWithTrie(str, decodeMode) {\n let lastIndex = 0;\n let offset = 0;\n while ((offset = str.indexOf(\"&\", offset)) >= 0) {\n ret += str.slice(lastIndex, offset);\n decoder.startEntity(decodeMode);\n const len = decoder.write(str,\n // Skip the \"&\"\n offset + 1);\n if (len < 0) {\n lastIndex = offset + decoder.end();\n break;\n }\n lastIndex = offset + len;\n // If `len` is 0, skip the current `&` and continue.\n offset = len === 0 ? lastIndex + 1 : lastIndex;\n }\n const result = ret + str.slice(lastIndex);\n // Make sure we don't keep a reference to the final string.\n ret = \"\";\n return result;\n };\n }\n /**\n * Determines the branch of the current node that is taken given the current\n * character. This function is used to traverse the trie.\n *\n * @param decodeTree The trie.\n * @param current The current node.\n * @param nodeIdx The index right after the current node and its value.\n * @param char The current character.\n * @returns The index of the next node, or -1 if no branch is taken.\n */ function determineBranch(decodeTree, current, nodeIdx, char) {\n const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;\n const jumpOffset = current & BinTrieFlags.JUMP_TABLE;\n // Case 1: Single branch encoded in jump offset\n if (branchCount === 0) {\n return jumpOffset !== 0 && char === jumpOffset ? nodeIdx : -1;\n }\n // Case 2: Multiple branches encoded in jump table\n if (jumpOffset) {\n const value = char - jumpOffset;\n return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIdx + value] - 1;\n }\n // Case 3: Multiple branches encoded in dictionary\n // Binary search for the character.\n let lo = nodeIdx;\n let hi = lo + branchCount - 1;\n while (lo <= hi) {\n const mid = lo + hi >>> 1;\n const midVal = decodeTree[mid];\n if (midVal < char) {\n lo = mid + 1;\n } else if (midVal > char) {\n hi = mid - 1;\n } else {\n return decodeTree[mid + branchCount];\n }\n }\n return -1;\n }\n const htmlDecoder = getDecoder(htmlDecodeTree);\n getDecoder(xmlDecodeTree);\n /**\n * Decodes an HTML string.\n *\n * @param str The string to decode.\n * @param mode The decoding mode.\n * @returns The decoded string.\n */ function decodeHTML(str, mode = DecodingMode.Legacy) {\n return htmlDecoder(str, mode);\n }\n // Utilities\n\n function _class$1(obj) {\n return Object.prototype.toString.call(obj);\n }\n function isString$1(obj) {\n return _class$1(obj) === \"[object String]\";\n }\n const _hasOwnProperty = Object.prototype.hasOwnProperty;\n function has(object, key) {\n return _hasOwnProperty.call(object, key);\n }\n // Merge objects\n\n function assign$1(obj /* from1, from2, from3, ... */) {\n const sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n if (!source) {\n return;\n }\n if (typeof source !== \"object\") {\n throw new TypeError(source + \"must be object\");\n }\n Object.keys(source).forEach(function(key) {\n obj[key] = source[key];\n });\n });\n return obj;\n }\n // Remove element from array and put another array at those position.\n // Useful for some operations with tokens\n function arrayReplaceAt(src, pos, newElements) {\n return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));\n }\n function isValidEntityCode(c) {\n /* eslint no-bitwise:0 */\n // broken sequence\n if (c >= 55296 && c <= 57343) {\n return false;\n }\n // never used\n if (c >= 64976 && c <= 65007) {\n return false;\n }\n if ((c & 65535) === 65535 || (c & 65535) === 65534) {\n return false;\n }\n // control codes\n if (c >= 0 && c <= 8) {\n return false;\n }\n if (c === 11) {\n return false;\n }\n if (c >= 14 && c <= 31) {\n return false;\n }\n if (c >= 127 && c <= 159) {\n return false;\n }\n // out of range\n if (c > 1114111) {\n return false;\n }\n return true;\n }\n function fromCodePoint(c) {\n /* eslint no-bitwise:0 */\n if (c > 65535) {\n c -= 65536;\n const surrogate1 = 55296 + (c >> 10);\n const surrogate2 = 56320 + (c & 1023);\n return String.fromCharCode(surrogate1, surrogate2);\n }\n return String.fromCharCode(c);\n }\n const UNESCAPE_MD_RE = /\\\\([!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_`{|}~])/g;\n const ENTITY_RE = /&([a-z#][a-z0-9]{1,31});/gi;\n const UNESCAPE_ALL_RE = new RegExp(UNESCAPE_MD_RE.source + \"|\" + ENTITY_RE.source, \"gi\");\n const DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;\n function replaceEntityPattern(match, name) {\n if (name.charCodeAt(0) === 35 /* # */ && DIGITAL_ENTITY_TEST_RE.test(name)) {\n const code = name[1].toLowerCase() === \"x\" ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10);\n if (isValidEntityCode(code)) {\n return fromCodePoint(code);\n }\n return match;\n }\n const decoded = decodeHTML(match);\n if (decoded !== match) {\n return decoded;\n }\n return match;\n }\n /* function replaceEntities(str) {\n if (str.indexOf('&') < 0) { return str; }\n\n return str.replace(ENTITY_RE, replaceEntityPattern);\n } */ function unescapeMd(str) {\n if (str.indexOf(\"\\\\\") < 0) {\n return str;\n }\n return str.replace(UNESCAPE_MD_RE, \"$1\");\n }\n function unescapeAll(str) {\n if (str.indexOf(\"\\\\\") < 0 && str.indexOf(\"&\") < 0) {\n return str;\n }\n return str.replace(UNESCAPE_ALL_RE, function(match, escaped, entity) {\n if (escaped) {\n return escaped;\n }\n return replaceEntityPattern(match, entity);\n });\n }\n const HTML_ESCAPE_TEST_RE = /[&<>\"]/;\n const HTML_ESCAPE_REPLACE_RE = /[&<>\"]/g;\n const HTML_REPLACEMENTS = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\"\n };\n function replaceUnsafeChar(ch) {\n return HTML_REPLACEMENTS[ch];\n }\n function escapeHtml(str) {\n if (HTML_ESCAPE_TEST_RE.test(str)) {\n return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);\n }\n return str;\n }\n const REGEXP_ESCAPE_RE = /[.?*+^$[\\]\\\\(){}|-]/g;\n function escapeRE$1(str) {\n return str.replace(REGEXP_ESCAPE_RE, \"\\\\$&\");\n }\n function isSpace(code) {\n switch (code) {\n case 9:\n case 32:\n return true;\n }\n return false;\n }\n // Zs (unicode class) || [\\t\\f\\v\\r\\n]\n function isWhiteSpace(code) {\n if (code >= 8192 && code <= 8202) {\n return true;\n }\n switch (code) {\n case 9:\n // \\t\n case 10:\n // \\n\n case 11:\n // \\v\n case 12:\n // \\f\n case 13:\n // \\r\n case 32:\n case 160:\n case 5760:\n case 8239:\n case 8287:\n case 12288:\n return true;\n }\n return false;\n }\n /* eslint-disable max-len */\n // Currently without astral characters support.\n function isPunctChar(ch) {\n return P.test(ch) || regex.test(ch);\n }\n // Markdown ASCII punctuation characters.\n\n // !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n // http://spec.commonmark.org/0.15/#ascii-punctuation-character\n\n // Don't confuse with unicode punctuation !!! It lacks some chars in ascii range.\n\n function isMdAsciiPunct(ch) {\n switch (ch) {\n case 33 /* ! */ :\n case 34 /* \" */ :\n case 35 /* # */ :\n case 36 /* $ */ :\n case 37 /* % */ :\n case 38 /* & */ :\n case 39 /* ' */ :\n case 40 /* ( */ :\n case 41 /* ) */ :\n case 42 /* * */ :\n case 43 /* + */ :\n case 44 /* , */ :\n case 45 /* - */ :\n case 46 /* . */ :\n case 47 /* / */ :\n case 58 /* : */ :\n case 59 /* ; */ :\n case 60 /* < */ :\n case 61 /* = */ :\n case 62 /* > */ :\n case 63 /* ? */ :\n case 64 /* @ */ :\n case 91 /* [ */ :\n case 92 /* \\ */ :\n case 93 /* ] */ :\n case 94 /* ^ */ :\n case 95 /* _ */ :\n case 96 /* ` */ :\n case 123 /* { */ :\n case 124 /* | */ :\n case 125 /* } */ :\n case 126 /* ~ */ :\n return true;\n\n default:\n return false;\n }\n }\n // Hepler to unify [reference labels].\n\n function normalizeReference(str) {\n // Trim and collapse whitespace\n str = str.trim().replace(/\\s+/g, \" \");\n // In node v10 '\u1E9E'.toLowerCase() === '\u1E7E', which is presumed to be a bug\n // fixed in v12 (couldn't find any details).\n\n // So treat this one as a special case\n // (remove this when node v10 is no longer supported).\n\n if (\"\\u1e9e\".toLowerCase() === \"\\u1e7e\") {\n str = str.replace(/\\u1e9e/g, \"\\xdf\");\n }\n // .toLowerCase().toUpperCase() should get rid of all differences\n // between letter variants.\n\n // Simple .toLowerCase() doesn't normalize 125 code points correctly,\n // and .toUpperCase doesn't normalize 6 of them (list of exceptions:\n // \u0130, \u03F4, \u1E9E, \u2126, \u212A, \u212B - those are already uppercased, but have differently\n // uppercased versions).\n\n // Here's an example showing how it happens. Lets take greek letter omega:\n // uppercase U+0398 (\u0398), U+03f4 (\u03F4) and lowercase U+03b8 (\u03B8), U+03d1 (\u03D1)\n\n // Unicode entries:\n // 0398;GREEK CAPITAL LETTER THETA;Lu;0;L;;;;;N;;;;03B8;\n // 03B8;GREEK SMALL LETTER THETA;Ll;0;L;;;;;N;;;0398;;0398\n // 03D1;GREEK THETA SYMBOL;Ll;0;L; 03B8;;;;N;GREEK SMALL LETTER SCRIPT THETA;;0398;;0398\n // 03F4;GREEK CAPITAL THETA SYMBOL;Lu;0;L; 0398;;;;N;;;;03B8;\n\n // Case-insensitive comparison should treat all of them as equivalent.\n\n // But .toLowerCase() doesn't change \u03D1 (it's already lowercase),\n // and .toUpperCase() doesn't change \u03F4 (already uppercase).\n\n // Applying first lower then upper case normalizes any character:\n // '\\u0398\\u03f4\\u03b8\\u03d1'.toLowerCase().toUpperCase() === '\\u0398\\u0398\\u0398\\u0398'\n\n // Note: this is equivalent to unicode case folding; unicode normalization\n // is a different step that is not required here.\n\n // Final result should be uppercased, because it's later stored in an object\n // (this avoid a conflict with Object.prototype members,\n // most notably, `__proto__`)\n\n return str.toLowerCase().toUpperCase();\n }\n // Re-export libraries commonly used in both markdown-it and its plugins,\n // so plugins won't have to depend on them explicitly, which reduces their\n // bundled size (e.g. a browser build).\n\n const lib = {\n mdurl: mdurl,\n ucmicro: ucmicro\n };\n var utils = Object.freeze({\n __proto__: null,\n arrayReplaceAt: arrayReplaceAt,\n assign: assign$1,\n escapeHtml: escapeHtml,\n escapeRE: escapeRE$1,\n fromCodePoint: fromCodePoint,\n has: has,\n isMdAsciiPunct: isMdAsciiPunct,\n isPunctChar: isPunctChar,\n isSpace: isSpace,\n isString: isString$1,\n isValidEntityCode: isValidEntityCode,\n isWhiteSpace: isWhiteSpace,\n lib: lib,\n normalizeReference: normalizeReference,\n unescapeAll: unescapeAll,\n unescapeMd: unescapeMd\n });\n // Parse link label\n\n // this function assumes that first character (\"[\") already matches;\n // returns the end of the label\n\n function parseLinkLabel(state, start, disableNested) {\n let level, found, marker, prevPos;\n const max = state.posMax;\n const oldPos = state.pos;\n state.pos = start + 1;\n level = 1;\n while (state.pos < max) {\n marker = state.src.charCodeAt(state.pos);\n if (marker === 93 /* ] */) {\n level--;\n if (level === 0) {\n found = true;\n break;\n }\n }\n prevPos = state.pos;\n state.md.inline.skipToken(state);\n if (marker === 91 /* [ */) {\n if (prevPos === state.pos - 1) {\n // increase level if we find text `[`, which is not a part of any token\n level++;\n } else if (disableNested) {\n state.pos = oldPos;\n return -1;\n }\n }\n }\n let labelEnd = -1;\n if (found) {\n labelEnd = state.pos;\n }\n // restore old state\n state.pos = oldPos;\n return labelEnd;\n }\n // Parse link destination\n\n function parseLinkDestination(str, start, max) {\n let code;\n let pos = start;\n const result = {\n ok: false,\n pos: 0,\n str: \"\"\n };\n if (str.charCodeAt(pos) === 60 /* < */) {\n pos++;\n while (pos < max) {\n code = str.charCodeAt(pos);\n if (code === 10 /* \\n */) {\n return result;\n }\n if (code === 60 /* < */) {\n return result;\n }\n if (code === 62 /* > */) {\n result.pos = pos + 1;\n result.str = unescapeAll(str.slice(start + 1, pos));\n result.ok = true;\n return result;\n }\n if (code === 92 /* \\ */ && pos + 1 < max) {\n pos += 2;\n continue;\n }\n pos++;\n }\n // no closing '>'\n return result;\n }\n // this should be ... } else { ... branch\n let level = 0;\n while (pos < max) {\n code = str.charCodeAt(pos);\n if (code === 32) {\n break;\n }\n // ascii control characters\n if (code < 32 || code === 127) {\n break;\n }\n if (code === 92 /* \\ */ && pos + 1 < max) {\n if (str.charCodeAt(pos + 1) === 32) {\n break;\n }\n pos += 2;\n continue;\n }\n if (code === 40 /* ( */) {\n level++;\n if (level > 32) {\n return result;\n }\n }\n if (code === 41 /* ) */) {\n if (level === 0) {\n break;\n }\n level--;\n }\n pos++;\n }\n if (start === pos) {\n return result;\n }\n if (level !== 0) {\n return result;\n }\n result.str = unescapeAll(str.slice(start, pos));\n result.pos = pos;\n result.ok = true;\n return result;\n }\n // Parse link title\n\n // Parse link title within `str` in [start, max] range,\n // or continue previous parsing if `prev_state` is defined (equal to result of last execution).\n\n function parseLinkTitle(str, start, max, prev_state) {\n let code;\n let pos = start;\n const state = {\n // if `true`, this is a valid link title\n ok: false,\n // if `true`, this link can be continued on the next line\n can_continue: false,\n // if `ok`, it's the position of the first character after the closing marker\n pos: 0,\n // if `ok`, it's the unescaped title\n str: \"\",\n // expected closing marker character code\n marker: 0\n };\n if (prev_state) {\n // this is a continuation of a previous parseLinkTitle call on the next line,\n // used in reference links only\n state.str = prev_state.str;\n state.marker = prev_state.marker;\n } else {\n if (pos >= max) {\n return state;\n }\n let marker = str.charCodeAt(pos);\n if (marker !== 34 /* \" */ && marker !== 39 /* ' */ && marker !== 40 /* ( */) {\n return state;\n }\n start++;\n pos++;\n // if opening marker is \"(\", switch it to closing marker \")\"\n if (marker === 40) {\n marker = 41;\n }\n state.marker = marker;\n }\n while (pos < max) {\n code = str.charCodeAt(pos);\n if (code === state.marker) {\n state.pos = pos + 1;\n state.str += unescapeAll(str.slice(start, pos));\n state.ok = true;\n return state;\n } else if (code === 40 /* ( */ && state.marker === 41 /* ) */) {\n return state;\n } else if (code === 92 /* \\ */ && pos + 1 < max) {\n pos++;\n }\n pos++;\n }\n // no closing marker found, but this link title may continue on the next line (for references)\n state.can_continue = true;\n state.str += unescapeAll(str.slice(start, pos));\n return state;\n }\n // Just a shortcut for bulk export\n var helpers = Object.freeze({\n __proto__: null,\n parseLinkDestination: parseLinkDestination,\n parseLinkLabel: parseLinkLabel,\n parseLinkTitle: parseLinkTitle\n });\n /**\n * class Renderer\n *\n * Generates HTML from parsed token stream. Each instance has independent\n * copy of rules. Those can be rewritten with ease. Also, you can add new\n * rules if you create plugin and adds new token types.\n **/ const default_rules = {};\n default_rules.code_inline = function(tokens, idx, options, env, slf) {\n const token = tokens[idx];\n return \"\" + escapeHtml(token.content) + \"
\";\n };\n default_rules.code_block = function(tokens, idx, options, env, slf) {\n const token = tokens[idx];\n return \"\" + escapeHtml(tokens[idx].content) + \"\\n\";\n };\n default_rules.fence = function(tokens, idx, options, env, slf) {\n const token = tokens[idx];\n const info = token.info ? unescapeAll(token.info).trim() : \"\";\n let langName = \"\";\n let langAttrs = \"\";\n if (info) {\n const arr = info.split(/(\\s+)/g);\n langName = arr[0];\n langAttrs = arr.slice(2).join(\"\");\n }\n let highlighted;\n if (options.highlight) {\n highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content);\n } else {\n highlighted = escapeHtml(token.content);\n }\n if (highlighted.indexOf(\"${highlighted}\\n`;\n }\n return `
${highlighted}
\\n`;\n };\n default_rules.image = function(tokens, idx, options, env, slf) {\n const token = tokens[idx];\n // \"alt\" attr MUST be set, even if empty. Because it's mandatory and\n // should be placed on proper position for tests.\n\n // Replace content with actual value\n token.attrs[token.attrIndex(\"alt\")][1] = slf.renderInlineAsText(token.children, options, env);\n return slf.renderToken(tokens, idx, options);\n };\n default_rules.hardbreak = function(tokens, idx, options /*, env */) {\n return options.xhtmlOut ? \"
\\n\" : \"
\\n\";\n };\n default_rules.softbreak = function(tokens, idx, options /*, env */) {\n return options.breaks ? options.xhtmlOut ? \"
\\n\" : \"
\\n\" : \"\\n\";\n };\n default_rules.text = function(tokens, idx /*, options, env */) {\n return escapeHtml(tokens[idx].content);\n };\n default_rules.html_block = function(tokens, idx /*, options, env */) {\n return tokens[idx].content;\n };\n default_rules.html_inline = function(tokens, idx /*, options, env */) {\n return tokens[idx].content;\n };\n /**\n * new Renderer()\n *\n * Creates new [[Renderer]] instance and fill [[Renderer#rules]] with defaults.\n **/ function Renderer() {\n /**\n * Renderer#rules -> Object\n *\n * Contains render rules for tokens. Can be updated and extended.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.renderer.rules.strong_open = function () { return ''; };\n * md.renderer.rules.strong_close = function () { return ''; };\n *\n * var result = md.renderInline(...);\n * ```\n *\n * Each rule is called as independent static function with fixed signature:\n *\n * ```javascript\n * function my_token_render(tokens, idx, options, env, renderer) {\n * // ...\n * return renderedHTML;\n * }\n * ```\n *\n * See [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs)\n * for more details and examples.\n **/\n this.rules = assign$1({}, default_rules);\n }\n /**\n * Renderer.renderAttrs(token) -> String\n *\n * Render token attributes to string.\n **/ Renderer.prototype.renderAttrs = function renderAttrs(token) {\n let i, l, result;\n if (!token.attrs) {\n return \"\";\n }\n result = \"\";\n for (i = 0, l = token.attrs.length; i < l; i++) {\n result += \" \" + escapeHtml(token.attrs[i][0]) + '=\"' + escapeHtml(token.attrs[i][1]) + '\"';\n }\n return result;\n };\n /**\n * Renderer.renderToken(tokens, idx, options) -> String\n * - tokens (Array): list of tokens\n * - idx (Numbed): token index to render\n * - options (Object): params of parser instance\n *\n * Default token renderer. Can be overriden by custom function\n * in [[Renderer#rules]].\n **/ Renderer.prototype.renderToken = function renderToken(tokens, idx, options) {\n const token = tokens[idx];\n let result = \"\";\n // Tight list paragraphs\n if (token.hidden) {\n return \"\";\n }\n // Insert a newline between hidden paragraph and subsequent opening\n // block-level tag.\n\n // For example, here we should insert a newline before blockquote:\n // - a\n // >\n\n if (token.block && token.nesting !== -1 && idx && tokens[idx - 1].hidden) {\n result += \"\\n\";\n }\n // Add token name, e.g. ``.\n needLf = false;\n }\n }\n }\n }\n result += needLf ? \">\\n\" : \">\";\n return result;\n };\n /**\n * Renderer.renderInline(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * The same as [[Renderer.render]], but for single token of `inline` type.\n **/ Renderer.prototype.renderInline = function(tokens, options, env) {\n let result = \"\";\n const rules = this.rules;\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type;\n if (typeof rules[type] !== \"undefined\") {\n result += rules[type](tokens, i, options, env, this);\n } else {\n result += this.renderToken(tokens, i, options);\n }\n }\n return result;\n };\n /** internal\n * Renderer.renderInlineAsText(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * Special kludge for image `alt` attributes to conform CommonMark spec.\n * Don't try to use it! Spec requires to show `alt` content with stripped markup,\n * instead of simple escaping.\n **/ Renderer.prototype.renderInlineAsText = function(tokens, options, env) {\n let result = \"\";\n for (let i = 0, len = tokens.length; i < len; i++) {\n switch (tokens[i].type) {\n case \"text\":\n result += tokens[i].content;\n break;\n\n case \"image\":\n result += this.renderInlineAsText(tokens[i].children, options, env);\n break;\n\n case \"html_inline\":\n case \"html_block\":\n result += tokens[i].content;\n break;\n\n case \"softbreak\":\n case \"hardbreak\":\n result += \"\\n\";\n break;\n // all other tokens are skipped\n }\n }\n return result;\n };\n /**\n * Renderer.render(tokens, options, env) -> String\n * - tokens (Array): list on block tokens to render\n * - options (Object): params of parser instance\n * - env (Object): additional data from parsed input (references, for example)\n *\n * Takes token stream and generates HTML. Probably, you will never need to call\n * this method directly.\n **/ Renderer.prototype.render = function(tokens, options, env) {\n let result = \"\";\n const rules = this.rules;\n for (let i = 0, len = tokens.length; i < len; i++) {\n const type = tokens[i].type;\n if (type === \"inline\") {\n result += this.renderInline(tokens[i].children, options, env);\n } else if (typeof rules[type] !== \"undefined\") {\n result += rules[type](tokens, i, options, env, this);\n } else {\n result += this.renderToken(tokens, i, options, env);\n }\n }\n return result;\n };\n /**\n * class Ruler\n *\n * Helper class, used by [[MarkdownIt#core]], [[MarkdownIt#block]] and\n * [[MarkdownIt#inline]] to manage sequences of functions (rules):\n *\n * - keep rules in defined order\n * - assign the name to each rule\n * - enable/disable rules\n * - add/replace rules\n * - allow assign rules to additional named chains (in the same)\n * - cacheing lists of active rules\n *\n * You will not need use this class directly until write plugins. For simple\n * rules control use [[MarkdownIt.disable]], [[MarkdownIt.enable]] and\n * [[MarkdownIt.use]].\n **/\n /**\n * new Ruler()\n **/ function Ruler() {\n // List of added rules. Each element is:\n // {\n // name: XXX,\n // enabled: Boolean,\n // fn: Function(),\n // alt: [ name2, name3 ]\n // }\n this.__rules__ = [];\n // Cached rule chains.\n\n // First level - chain name, '' for default.\n // Second level - diginal anchor for fast filtering by charcodes.\n\n this.__cache__ = null;\n }\n // Helper methods, should not be used directly\n // Find rule index by name\n\n Ruler.prototype.__find__ = function(name) {\n for (let i = 0; i < this.__rules__.length; i++) {\n if (this.__rules__[i].name === name) {\n return i;\n }\n }\n return -1;\n };\n // Build rules lookup cache\n\n Ruler.prototype.__compile__ = function() {\n const self = this;\n const chains = [ \"\" ];\n // collect unique names\n self.__rules__.forEach(function(rule) {\n if (!rule.enabled) {\n return;\n }\n rule.alt.forEach(function(altName) {\n if (chains.indexOf(altName) < 0) {\n chains.push(altName);\n }\n });\n });\n self.__cache__ = {};\n chains.forEach(function(chain) {\n self.__cache__[chain] = [];\n self.__rules__.forEach(function(rule) {\n if (!rule.enabled) {\n return;\n }\n if (chain && rule.alt.indexOf(chain) < 0) {\n return;\n }\n self.__cache__[chain].push(rule.fn);\n });\n });\n };\n /**\n * Ruler.at(name, fn [, options])\n * - name (String): rule name to replace.\n * - fn (Function): new rule function.\n * - options (Object): new rule options (not mandatory).\n *\n * Replace rule by name with new function & options. Throws error if name not\n * found.\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * Replace existing typographer replacement rule with new one:\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.core.ruler.at('replacements', function replace(state) {\n * //...\n * });\n * ```\n **/ Ruler.prototype.at = function(name, fn, options) {\n const index = this.__find__(name);\n const opt = options || {};\n if (index === -1) {\n throw new Error(\"Parser rule not found: \" + name);\n }\n this.__rules__[index].fn = fn;\n this.__rules__[index].alt = opt.alt || [];\n this.__cache__ = null;\n };\n /**\n * Ruler.before(beforeName, ruleName, fn [, options])\n * - beforeName (String): new rule will be added before this one.\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Add new rule to chain before one with given name. See also\n * [[Ruler.after]], [[Ruler.push]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/ Ruler.prototype.before = function(beforeName, ruleName, fn, options) {\n const index = this.__find__(beforeName);\n const opt = options || {};\n if (index === -1) {\n throw new Error(\"Parser rule not found: \" + beforeName);\n }\n this.__rules__.splice(index, 0, {\n name: ruleName,\n enabled: true,\n fn: fn,\n alt: opt.alt || []\n });\n this.__cache__ = null;\n };\n /**\n * Ruler.after(afterName, ruleName, fn [, options])\n * - afterName (String): new rule will be added after this one.\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Add new rule to chain after one with given name. See also\n * [[Ruler.before]], [[Ruler.push]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.inline.ruler.after('text', 'my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/ Ruler.prototype.after = function(afterName, ruleName, fn, options) {\n const index = this.__find__(afterName);\n const opt = options || {};\n if (index === -1) {\n throw new Error(\"Parser rule not found: \" + afterName);\n }\n this.__rules__.splice(index + 1, 0, {\n name: ruleName,\n enabled: true,\n fn: fn,\n alt: opt.alt || []\n });\n this.__cache__ = null;\n };\n /**\n * Ruler.push(ruleName, fn [, options])\n * - ruleName (String): name of added rule.\n * - fn (Function): rule function.\n * - options (Object): rule options (not mandatory).\n *\n * Push new rule to the end of chain. See also\n * [[Ruler.before]], [[Ruler.after]].\n *\n * ##### Options:\n *\n * - __alt__ - array with names of \"alternate\" chains.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * md.core.ruler.push('my_rule', function replace(state) {\n * //...\n * });\n * ```\n **/ Ruler.prototype.push = function(ruleName, fn, options) {\n const opt = options || {};\n this.__rules__.push({\n name: ruleName,\n enabled: true,\n fn: fn,\n alt: opt.alt || []\n });\n this.__cache__ = null;\n };\n /**\n * Ruler.enable(list [, ignoreInvalid]) -> Array\n * - list (String|Array): list of rule names to enable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * Returns list of found rule names (if no exception happened).\n *\n * See also [[Ruler.disable]], [[Ruler.enableOnly]].\n **/ Ruler.prototype.enable = function(list, ignoreInvalid) {\n if (!Array.isArray(list)) {\n list = [ list ];\n }\n const result = [];\n // Search by name and enable\n list.forEach(function(name) {\n const idx = this.__find__(name);\n if (idx < 0) {\n if (ignoreInvalid) {\n return;\n }\n throw new Error(\"Rules manager: invalid rule name \" + name);\n }\n this.__rules__[idx].enabled = true;\n result.push(name);\n }, this);\n this.__cache__ = null;\n return result;\n };\n /**\n * Ruler.enableOnly(list [, ignoreInvalid])\n * - list (String|Array): list of rule names to enable (whitelist).\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable rules with given names, and disable everything else. If any rule name\n * not found - throw Error. Errors can be disabled by second param.\n *\n * See also [[Ruler.disable]], [[Ruler.enable]].\n **/ Ruler.prototype.enableOnly = function(list, ignoreInvalid) {\n if (!Array.isArray(list)) {\n list = [ list ];\n }\n this.__rules__.forEach(function(rule) {\n rule.enabled = false;\n });\n this.enable(list, ignoreInvalid);\n };\n /**\n * Ruler.disable(list [, ignoreInvalid]) -> Array\n * - list (String|Array): list of rule names to disable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Disable rules with given names. If any rule name not found - throw Error.\n * Errors can be disabled by second param.\n *\n * Returns list of found rule names (if no exception happened).\n *\n * See also [[Ruler.enable]], [[Ruler.enableOnly]].\n **/ Ruler.prototype.disable = function(list, ignoreInvalid) {\n if (!Array.isArray(list)) {\n list = [ list ];\n }\n const result = [];\n // Search by name and disable\n list.forEach(function(name) {\n const idx = this.__find__(name);\n if (idx < 0) {\n if (ignoreInvalid) {\n return;\n }\n throw new Error(\"Rules manager: invalid rule name \" + name);\n }\n this.__rules__[idx].enabled = false;\n result.push(name);\n }, this);\n this.__cache__ = null;\n return result;\n };\n /**\n * Ruler.getRules(chainName) -> Array\n *\n * Return array of active functions (rules) for given chain name. It analyzes\n * rules configuration, compiles caches if not exists and returns result.\n *\n * Default chain name is `''` (empty string). It can't be skipped. That's\n * done intentionally, to keep signature monomorphic for high speed.\n **/ Ruler.prototype.getRules = function(chainName) {\n if (this.__cache__ === null) {\n this.__compile__();\n }\n // Chain can be empty, if rules disabled. But we still have to return Array.\n return this.__cache__[chainName] || [];\n };\n // Token class\n /**\n * class Token\n **/\n /**\n * new Token(type, tag, nesting)\n *\n * Create new token and fill passed properties.\n **/ function Token(type, tag, nesting) {\n /**\n * Token#type -> String\n *\n * Type of the token (string, e.g. \"paragraph_open\")\n **/\n this.type = type;\n /**\n * Token#tag -> String\n *\n * html tag name, e.g. \"p\"\n **/ this.tag = tag;\n /**\n * Token#attrs -> Array\n *\n * Html attributes. Format: `[ [ name1, value1 ], [ name2, value2 ] ]`\n **/ this.attrs = null;\n /**\n * Token#map -> Array\n *\n * Source map info. Format: `[ line_begin, line_end ]`\n **/ this.map = null;\n /**\n * Token#nesting -> Number\n *\n * Level change (number in {-1, 0, 1} set), where:\n *\n * - `1` means the tag is opening\n * - `0` means the tag is self-closing\n * - `-1` means the tag is closing\n **/ this.nesting = nesting;\n /**\n * Token#level -> Number\n *\n * nesting level, the same as `state.level`\n **/ this.level = 0;\n /**\n * Token#children -> Array\n *\n * An array of child nodes (inline and img tokens)\n **/ this.children = null;\n /**\n * Token#content -> String\n *\n * In a case of self-closing tag (code, html, fence, etc.),\n * it has contents of this tag.\n **/ this.content = \"\";\n /**\n * Token#markup -> String\n *\n * '*' or '_' for emphasis, fence string for fence, etc.\n **/ this.markup = \"\";\n /**\n * Token#info -> String\n *\n * Additional information:\n *\n * - Info string for \"fence\" tokens\n * - The value \"auto\" for autolink \"link_open\" and \"link_close\" tokens\n * - The string value of the item marker for ordered-list \"list_item_open\" tokens\n **/ this.info = \"\";\n /**\n * Token#meta -> Object\n *\n * A place for plugins to store an arbitrary data\n **/ this.meta = null;\n /**\n * Token#block -> Boolean\n *\n * True for block-level tokens, false for inline tokens.\n * Used in renderer to calculate line breaks\n **/ this.block = false;\n /**\n * Token#hidden -> Boolean\n *\n * If it's true, ignore this element when rendering. Used for tight lists\n * to hide paragraphs.\n **/ this.hidden = false;\n }\n /**\n * Token.attrIndex(name) -> Number\n *\n * Search attribute index by name.\n **/ Token.prototype.attrIndex = function attrIndex(name) {\n if (!this.attrs) {\n return -1;\n }\n const attrs = this.attrs;\n for (let i = 0, len = attrs.length; i < len; i++) {\n if (attrs[i][0] === name) {\n return i;\n }\n }\n return -1;\n };\n /**\n * Token.attrPush(attrData)\n *\n * Add `[ name, value ]` attribute to list. Init attrs if necessary\n **/ Token.prototype.attrPush = function attrPush(attrData) {\n if (this.attrs) {\n this.attrs.push(attrData);\n } else {\n this.attrs = [ attrData ];\n }\n };\n /**\n * Token.attrSet(name, value)\n *\n * Set `name` attribute to `value`. Override old value if exists.\n **/ Token.prototype.attrSet = function attrSet(name, value) {\n const idx = this.attrIndex(name);\n const attrData = [ name, value ];\n if (idx < 0) {\n this.attrPush(attrData);\n } else {\n this.attrs[idx] = attrData;\n }\n };\n /**\n * Token.attrGet(name)\n *\n * Get the value of attribute `name`, or null if it does not exist.\n **/ Token.prototype.attrGet = function attrGet(name) {\n const idx = this.attrIndex(name);\n let value = null;\n if (idx >= 0) {\n value = this.attrs[idx][1];\n }\n return value;\n };\n /**\n * Token.attrJoin(name, value)\n *\n * Join value to existing attribute via space. Or create new attribute if not\n * exists. Useful to operate with token classes.\n **/ Token.prototype.attrJoin = function attrJoin(name, value) {\n const idx = this.attrIndex(name);\n if (idx < 0) {\n this.attrPush([ name, value ]);\n } else {\n this.attrs[idx][1] = this.attrs[idx][1] + \" \" + value;\n }\n };\n // Core state object\n\n function StateCore(src, md, env) {\n this.src = src;\n this.env = env;\n this.tokens = [];\n this.inlineMode = false;\n this.md = md;\n // link to parser instance\n }\n // re-export Token class to use in core rules\n StateCore.prototype.Token = Token;\n // Normalize input string\n // https://spec.commonmark.org/0.29/#line-ending\n const NEWLINES_RE = /\\r\\n?|\\n/g;\n const NULL_RE = /\\0/g;\n function normalize(state) {\n let str;\n // Normalize newlines\n str = state.src.replace(NEWLINES_RE, \"\\n\");\n // Replace NULL characters\n str = str.replace(NULL_RE, \"\\ufffd\");\n state.src = str;\n }\n function block(state) {\n let token;\n if (state.inlineMode) {\n token = new state.Token(\"inline\", \"\", 0);\n token.content = state.src;\n token.map = [ 0, 1 ];\n token.children = [];\n state.tokens.push(token);\n } else {\n state.md.block.parse(state.src, state.md, state.env, state.tokens);\n }\n }\n function inline(state) {\n const tokens = state.tokens;\n // Parse inlines\n for (let i = 0, l = tokens.length; i < l; i++) {\n const tok = tokens[i];\n if (tok.type === \"inline\") {\n state.md.inline.parse(tok.content, state.md, state.env, tok.children);\n }\n }\n }\n // Replace link-like texts with link nodes.\n\n // Currently restricted by `md.validateLink()` to http/https/ftp\n\n function isLinkOpen$1(str) {\n return /^\\s]/i.test(str);\n }\n function isLinkClose$1(str) {\n return /^<\\/a\\s*>/i.test(str);\n }\n function linkify$1(state) {\n const blockTokens = state.tokens;\n if (!state.md.options.linkify) {\n return;\n }\n for (let j = 0, l = blockTokens.length; j < l; j++) {\n if (blockTokens[j].type !== \"inline\" || !state.md.linkify.pretest(blockTokens[j].content)) {\n continue;\n }\n let tokens = blockTokens[j].children;\n let htmlLinkLevel = 0;\n // We scan from the end, to keep position when new tags added.\n // Use reversed logic in links start/end match\n for (let i = tokens.length - 1; i >= 0; i--) {\n const currentToken = tokens[i];\n // Skip content of markdown links\n if (currentToken.type === \"link_close\") {\n i--;\n while (tokens[i].level !== currentToken.level && tokens[i].type !== \"link_open\") {\n i--;\n }\n continue;\n }\n // Skip content of html tag links\n if (currentToken.type === \"html_inline\") {\n if (isLinkOpen$1(currentToken.content) && htmlLinkLevel > 0) {\n htmlLinkLevel--;\n }\n if (isLinkClose$1(currentToken.content)) {\n htmlLinkLevel++;\n }\n }\n if (htmlLinkLevel > 0) {\n continue;\n }\n if (currentToken.type === \"text\" && state.md.linkify.test(currentToken.content)) {\n const text = currentToken.content;\n let links = state.md.linkify.match(text);\n // Now split string to nodes\n const nodes = [];\n let level = currentToken.level;\n let lastPos = 0;\n // forbid escape sequence at the start of the string,\n // this avoids http\\://example.com/ from being linkified as\n // http:
//example.com/\n if (links.length > 0 && links[0].index === 0 && i > 0 && tokens[i - 1].type === \"text_special\") {\n links = links.slice(1);\n }\n for (let ln = 0; ln < links.length; ln++) {\n const url = links[ln].url;\n const fullUrl = state.md.normalizeLink(url);\n if (!state.md.validateLink(fullUrl)) {\n continue;\n }\n let urlText = links[ln].text;\n // Linkifier might send raw hostnames like \"example.com\", where url\n // starts with domain name. So we prepend http:// in those cases,\n // and remove it afterwards.\n\n if (!links[ln].schema) {\n urlText = state.md.normalizeLinkText(\"http://\" + urlText).replace(/^http:\\/\\//, \"\");\n } else if (links[ln].schema === \"mailto:\" && !/^mailto:/i.test(urlText)) {\n urlText = state.md.normalizeLinkText(\"mailto:\" + urlText).replace(/^mailto:/, \"\");\n } else {\n urlText = state.md.normalizeLinkText(urlText);\n }\n const pos = links[ln].index;\n if (pos > lastPos) {\n const token = new state.Token(\"text\", \"\", 0);\n token.content = text.slice(lastPos, pos);\n token.level = level;\n nodes.push(token);\n }\n const token_o = new state.Token(\"link_open\", \"a\", 1);\n token_o.attrs = [ [ \"href\", fullUrl ] ];\n token_o.level = level++;\n token_o.markup = \"linkify\";\n token_o.info = \"auto\";\n nodes.push(token_o);\n const token_t = new state.Token(\"text\", \"\", 0);\n token_t.content = urlText;\n token_t.level = level;\n nodes.push(token_t);\n const token_c = new state.Token(\"link_close\", \"a\", -1);\n token_c.level = --level;\n token_c.markup = \"linkify\";\n token_c.info = \"auto\";\n nodes.push(token_c);\n lastPos = links[ln].lastIndex;\n }\n if (lastPos < text.length) {\n const token = new state.Token(\"text\", \"\", 0);\n token.content = text.slice(lastPos);\n token.level = level;\n nodes.push(token);\n }\n // replace current node\n blockTokens[j].children = tokens = arrayReplaceAt(tokens, i, nodes);\n }\n }\n }\n }\n // Simple typographic replacements\n\n // (c) (C) \u2192 \u00A9\n // (tm) (TM) \u2192 \u2122\n // (r) (R) \u2192 \u00AE\n // +- \u2192 \u00B1\n // ... \u2192 \u2026 (also ?.... \u2192 ?.., !.... \u2192 !..)\n // ???????? \u2192 ???, !!!!! \u2192 !!!, `,,` \u2192 `,`\n // -- \u2192 –, --- \u2192 —\n\n // TODO:\n // - fractionals 1/2, 1/4, 3/4 -> \u00BD, \u00BC, \u00BE\n // - multiplications 2 x 4 -> 2 \u00D7 4\n const RARE_RE = /\\+-|\\.\\.|\\?\\?\\?\\?|!!!!|,,|--/;\n // Workaround for phantomjs - need regex without /g flag,\n // or root check will fail every second time\n const SCOPED_ABBR_TEST_RE = /\\((c|tm|r)\\)/i;\n const SCOPED_ABBR_RE = /\\((c|tm|r)\\)/gi;\n const SCOPED_ABBR = {\n c: \"\\xa9\",\n r: \"\\xae\",\n tm: \"\\u2122\"\n };\n function replaceFn(match, name) {\n return SCOPED_ABBR[name.toLowerCase()];\n }\n function replace_scoped(inlineTokens) {\n let inside_autolink = 0;\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i];\n if (token.type === \"text\" && !inside_autolink) {\n token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);\n }\n if (token.type === \"link_open\" && token.info === \"auto\") {\n inside_autolink--;\n }\n if (token.type === \"link_close\" && token.info === \"auto\") {\n inside_autolink++;\n }\n }\n }\n function replace_rare(inlineTokens) {\n let inside_autolink = 0;\n for (let i = inlineTokens.length - 1; i >= 0; i--) {\n const token = inlineTokens[i];\n if (token.type === \"text\" && !inside_autolink) {\n if (RARE_RE.test(token.content)) {\n token.content = token.content.replace(/\\+-/g, \"\\xb1\").replace(/\\.{2,}/g, \"\\u2026\").replace(/([?!])\\u2026/g, \"$1..\").replace(/([?!]){4,}/g, \"$1$1$1\").replace(/,{2,}/g, \",\").replace(/(^|[^-])---(?=[^-]|$)/gm, \"$1\\u2014\").replace(/(^|\\s)--(?=\\s|$)/gm, \"$1\\u2013\").replace(/(^|[^-\\s])--(?=[^-\\s]|$)/gm, \"$1\\u2013\");\n }\n }\n if (token.type === \"link_open\" && token.info === \"auto\") {\n inside_autolink--;\n }\n if (token.type === \"link_close\" && token.info === \"auto\") {\n inside_autolink++;\n }\n }\n }\n function replace(state) {\n let blkIdx;\n if (!state.md.options.typographer) {\n return;\n }\n for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== \"inline\") {\n continue;\n }\n if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {\n replace_scoped(state.tokens[blkIdx].children);\n }\n if (RARE_RE.test(state.tokens[blkIdx].content)) {\n replace_rare(state.tokens[blkIdx].children);\n }\n }\n }\n // Convert straight quotation marks to typographic ones\n\n const QUOTE_TEST_RE = /['\"]/;\n const QUOTE_RE = /['\"]/g;\n const APOSTROPHE = \"\\u2019\";\n /* \u2019 */ function replaceAt(str, index, ch) {\n return str.slice(0, index) + ch + str.slice(index + 1);\n }\n function process_inlines(tokens, state) {\n let j;\n const stack = [];\n for (let i = 0; i < tokens.length; i++) {\n const token = tokens[i];\n const thisLevel = tokens[i].level;\n for (j = stack.length - 1; j >= 0; j--) {\n if (stack[j].level <= thisLevel) {\n break;\n }\n }\n stack.length = j + 1;\n if (token.type !== \"text\") {\n continue;\n }\n let text = token.content;\n let pos = 0;\n let max = text.length;\n /* eslint no-labels:0,block-scoped-var:0 */ OUTER: while (pos < max) {\n QUOTE_RE.lastIndex = pos;\n const t = QUOTE_RE.exec(text);\n if (!t) {\n break;\n }\n let canOpen = true;\n let canClose = true;\n pos = t.index + 1;\n const isSingle = t[0] === \"'\";\n // Find previous character,\n // default to space if it's the beginning of the line\n\n let lastChar = 32;\n if (t.index - 1 >= 0) {\n lastChar = text.charCodeAt(t.index - 1);\n } else {\n for (j = i - 1; j >= 0; j--) {\n if (tokens[j].type === \"softbreak\" || tokens[j].type === \"hardbreak\") break;\n // lastChar defaults to 0x20\n if (!tokens[j].content) continue;\n // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);\n break;\n }\n }\n // Find next character,\n // default to space if it's the end of the line\n\n let nextChar = 32;\n if (pos < max) {\n nextChar = text.charCodeAt(pos);\n } else {\n for (j = i + 1; j < tokens.length; j++) {\n if (tokens[j].type === \"softbreak\" || tokens[j].type === \"hardbreak\") break;\n // nextChar defaults to 0x20\n if (!tokens[j].content) continue;\n // should skip all tokens except 'text', 'html_inline' or 'code_inline'\n nextChar = tokens[j].content.charCodeAt(0);\n break;\n }\n }\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));\n const isLastWhiteSpace = isWhiteSpace(lastChar);\n const isNextWhiteSpace = isWhiteSpace(nextChar);\n if (isNextWhiteSpace) {\n canOpen = false;\n } else if (isNextPunctChar) {\n if (!(isLastWhiteSpace || isLastPunctChar)) {\n canOpen = false;\n }\n }\n if (isLastWhiteSpace) {\n canClose = false;\n } else if (isLastPunctChar) {\n if (!(isNextWhiteSpace || isNextPunctChar)) {\n canClose = false;\n }\n }\n if (nextChar === 34 /* \" */ && t[0] === '\"') {\n if (lastChar >= 48 /* 0 */ && lastChar <= 57 /* 9 */) {\n // special case: 1\"\" - count first quote as an inch\n canClose = canOpen = false;\n }\n }\n if (canOpen && canClose) {\n // Replace quotes in the middle of punctuation sequence, but not\n // in the middle of the words, i.e.:\n // 1. foo \" bar \" baz - not replaced\n // 2. foo-\"-bar-\"-baz - replaced\n // 3. foo\"bar\"baz - not replaced\n canOpen = isLastPunctChar;\n canClose = isNextPunctChar;\n }\n if (!canOpen && !canClose) {\n // middle of word\n if (isSingle) {\n token.content = replaceAt(token.content, t.index, APOSTROPHE);\n }\n continue;\n }\n if (canClose) {\n // this could be a closing quote, rewind the stack to get a match\n for (j = stack.length - 1; j >= 0; j--) {\n let item = stack[j];\n if (stack[j].level < thisLevel) {\n break;\n }\n if (item.single === isSingle && stack[j].level === thisLevel) {\n item = stack[j];\n let openQuote;\n let closeQuote;\n if (isSingle) {\n openQuote = state.md.options.quotes[2];\n closeQuote = state.md.options.quotes[3];\n } else {\n openQuote = state.md.options.quotes[0];\n closeQuote = state.md.options.quotes[1];\n }\n // replace token.content *before* tokens[item.token].content,\n // because, if they are pointing at the same token, replaceAt\n // could mess up indices when quote length != 1\n token.content = replaceAt(token.content, t.index, closeQuote);\n tokens[item.token].content = replaceAt(tokens[item.token].content, item.pos, openQuote);\n pos += closeQuote.length - 1;\n if (item.token === i) {\n pos += openQuote.length - 1;\n }\n text = token.content;\n max = text.length;\n stack.length = j;\n continue OUTER;\n }\n }\n }\n if (canOpen) {\n stack.push({\n token: i,\n pos: t.index,\n single: isSingle,\n level: thisLevel\n });\n } else if (canClose && isSingle) {\n token.content = replaceAt(token.content, t.index, APOSTROPHE);\n }\n }\n }\n }\n function smartquotes(state) {\n /* eslint max-depth:0 */\n if (!state.md.options.typographer) {\n return;\n }\n for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {\n if (state.tokens[blkIdx].type !== \"inline\" || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {\n continue;\n }\n process_inlines(state.tokens[blkIdx].children, state);\n }\n }\n // Join raw text tokens with the rest of the text\n\n // This is set as a separate rule to provide an opportunity for plugins\n // to run text replacements after text join, but before escape join.\n\n // For example, `\\:)` shouldn't be replaced with an emoji.\n\n function text_join(state) {\n let curr, last;\n const blockTokens = state.tokens;\n const l = blockTokens.length;\n for (let j = 0; j < l; j++) {\n if (blockTokens[j].type !== \"inline\") continue;\n const tokens = blockTokens[j].children;\n const max = tokens.length;\n for (curr = 0; curr < max; curr++) {\n if (tokens[curr].type === \"text_special\") {\n tokens[curr].type = \"text\";\n }\n }\n for (curr = last = 0; curr < max; curr++) {\n if (tokens[curr].type === \"text\" && curr + 1 < max && tokens[curr + 1].type === \"text\") {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;\n } else {\n if (curr !== last) {\n tokens[last] = tokens[curr];\n }\n last++;\n }\n }\n if (curr !== last) {\n tokens.length = last;\n }\n }\n }\n /** internal\n * class Core\n *\n * Top-level rules executor. Glues block/inline parsers and does intermediate\n * transformations.\n **/ const _rules$2 = [ [ \"normalize\", normalize ], [ \"block\", block ], [ \"inline\", inline ], [ \"linkify\", linkify$1 ], [ \"replacements\", replace ], [ \"smartquotes\", smartquotes ],\n // `text_join` finds `text_special` tokens (for escape sequences)\n // and joins them with the rest of the text\n [ \"text_join\", text_join ] ];\n /**\n * new Core()\n **/ function Core() {\n /**\n * Core#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of core rules.\n **/\n this.ruler = new Ruler;\n for (let i = 0; i < _rules$2.length; i++) {\n this.ruler.push(_rules$2[i][0], _rules$2[i][1]);\n }\n }\n /**\n * Core.process(state)\n *\n * Executes core chain rules.\n **/ Core.prototype.process = function(state) {\n const rules = this.ruler.getRules(\"\");\n for (let i = 0, l = rules.length; i < l; i++) {\n rules[i](state);\n }\n };\n Core.prototype.State = StateCore;\n // Parser state class\n function StateBlock(src, md, env, tokens) {\n this.src = src;\n // link to parser instance\n this.md = md;\n this.env = env;\n\n // Internal state vartiables\n\n this.tokens = tokens;\n this.bMarks = [];\n // line begin offsets for fast jumps\n this.eMarks = [];\n // line end offsets for fast jumps\n this.tShift = [];\n // offsets of the first non-space characters (tabs not expanded)\n this.sCount = [];\n // indents for each line (tabs expanded)\n // An amount of virtual spaces (tabs expanded) between beginning\n // of each line (bMarks) and real beginning of that line.\n\n // It exists only as a hack because blockquotes override bMarks\n // losing information in the process.\n\n // It's used only when expanding tabs, you can think about it as\n // an initial tab length, e.g. bsCount=21 applied to string `\\t123`\n // means first tab should be expanded to 4-21%4 === 3 spaces.\n\n this.bsCount = [];\n // block parser variables\n // required block content indent (for example, if we are\n // inside a list, it would be positioned after list marker)\n this.blkIndent = 0;\n this.line = 0;\n // line index in src\n this.lineMax = 0;\n // lines count\n this.tight = false;\n // loose/tight mode for lists\n this.ddIndent = -1;\n // indent of the current dd block (-1 if there isn't any)\n this.listIndent = -1;\n // indent of the current list block (-1 if there isn't any)\n // can be 'blockquote', 'list', 'root', 'paragraph' or 'reference'\n // used in lists to determine if they interrupt a paragraph\n this.parentType = \"root\";\n this.level = 0;\n // Create caches\n // Generate markers.\n const s = this.src;\n for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) {\n const ch = s.charCodeAt(pos);\n if (!indent_found) {\n if (isSpace(ch)) {\n indent++;\n if (ch === 9) {\n offset += 4 - offset % 4;\n } else {\n offset++;\n }\n continue;\n } else {\n indent_found = true;\n }\n }\n if (ch === 10 || pos === len - 1) {\n if (ch !== 10) {\n pos++;\n }\n this.bMarks.push(start);\n this.eMarks.push(pos);\n this.tShift.push(indent);\n this.sCount.push(offset);\n this.bsCount.push(0);\n indent_found = false;\n indent = 0;\n offset = 0;\n start = pos + 1;\n }\n }\n // Push fake entry to simplify cache bounds checks\n this.bMarks.push(s.length);\n this.eMarks.push(s.length);\n this.tShift.push(0);\n this.sCount.push(0);\n this.bsCount.push(0);\n this.lineMax = this.bMarks.length - 1;\n // don't count last fake line\n }\n // Push new token to \"stream\".\n\n StateBlock.prototype.push = function(type, tag, nesting) {\n const token = new Token(type, tag, nesting);\n token.block = true;\n if (nesting < 0) this.level--;\n // closing tag\n token.level = this.level;\n if (nesting > 0) this.level++;\n // opening tag\n this.tokens.push(token);\n return token;\n };\n StateBlock.prototype.isEmpty = function isEmpty(line) {\n return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];\n };\n StateBlock.prototype.skipEmptyLines = function skipEmptyLines(from) {\n for (let max = this.lineMax; from < max; from++) {\n if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) {\n break;\n }\n }\n return from;\n };\n // Skip spaces from given position.\n StateBlock.prototype.skipSpaces = function skipSpaces(pos) {\n for (let max = this.src.length; pos < max; pos++) {\n const ch = this.src.charCodeAt(pos);\n if (!isSpace(ch)) {\n break;\n }\n }\n return pos;\n };\n // Skip spaces from given position in reverse.\n StateBlock.prototype.skipSpacesBack = function skipSpacesBack(pos, min) {\n if (pos <= min) {\n return pos;\n }\n while (pos > min) {\n if (!isSpace(this.src.charCodeAt(--pos))) {\n return pos + 1;\n }\n }\n return pos;\n };\n // Skip char codes from given position\n StateBlock.prototype.skipChars = function skipChars(pos, code) {\n for (let max = this.src.length; pos < max; pos++) {\n if (this.src.charCodeAt(pos) !== code) {\n break;\n }\n }\n return pos;\n };\n // Skip char codes reverse from given position - 1\n StateBlock.prototype.skipCharsBack = function skipCharsBack(pos, code, min) {\n if (pos <= min) {\n return pos;\n }\n while (pos > min) {\n if (code !== this.src.charCodeAt(--pos)) {\n return pos + 1;\n }\n }\n return pos;\n };\n // cut lines range from source.\n StateBlock.prototype.getLines = function getLines(begin, end, indent, keepLastLF) {\n if (begin >= end) {\n return \"\";\n }\n const queue = new Array(end - begin);\n for (let i = 0, line = begin; line < end; line++, i++) {\n let lineIndent = 0;\n const lineStart = this.bMarks[line];\n let first = lineStart;\n let last;\n if (line + 1 < end || keepLastLF) {\n // No need for bounds check because we have fake entry on tail.\n last = this.eMarks[line] + 1;\n } else {\n last = this.eMarks[line];\n }\n while (first < last && lineIndent < indent) {\n const ch = this.src.charCodeAt(first);\n if (isSpace(ch)) {\n if (ch === 9) {\n lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;\n } else {\n lineIndent++;\n }\n } else if (first - lineStart < this.tShift[line]) {\n // patched tShift masked characters to look like spaces (blockquotes, list markers)\n lineIndent++;\n } else {\n break;\n }\n first++;\n }\n if (lineIndent > indent) {\n // partially expanding tabs in code blocks, e.g '\\t\\tfoobar'\n // with indent=2 becomes ' \\tfoobar'\n queue[i] = new Array(lineIndent - indent + 1).join(\" \") + this.src.slice(first, last);\n } else {\n queue[i] = this.src.slice(first, last);\n }\n }\n return queue.join(\"\");\n };\n // re-export Token class to use in block rules\n StateBlock.prototype.Token = Token;\n // GFM table, https://github.github.com/gfm/#tables-extension-\n // Limit the amount of empty autocompleted cells in a table,\n // see https://github.com/markdown-it/markdown-it/issues/1000,\n\n // Both pulldown-cmark and commonmark-hs limit the number of cells this way to ~200k.\n // We set it to 65k, which can expand user input by a factor of x370\n // (256x256 square is 1.8kB expanded into 650kB).\n const MAX_AUTOCOMPLETED_CELLS = 65536;\n function getLine(state, line) {\n const pos = state.bMarks[line] + state.tShift[line];\n const max = state.eMarks[line];\n return state.src.slice(pos, max);\n }\n function escapedSplit(str) {\n const result = [];\n const max = str.length;\n let pos = 0;\n let ch = str.charCodeAt(pos);\n let isEscaped = false;\n let lastPos = 0;\n let current = \"\";\n while (pos < max) {\n if (ch === 124 /* | */) {\n if (!isEscaped) {\n // pipe separating cells, '|'\n result.push(current + str.substring(lastPos, pos));\n current = \"\";\n lastPos = pos + 1;\n } else {\n // escaped pipe, '\\|'\n current += str.substring(lastPos, pos - 1);\n lastPos = pos;\n }\n }\n isEscaped = ch === 92 /* \\ */;\n pos++;\n ch = str.charCodeAt(pos);\n }\n result.push(current + str.substring(lastPos));\n return result;\n }\n function table(state, startLine, endLine, silent) {\n // should have at least two lines\n if (startLine + 2 > endLine) {\n return false;\n }\n let nextLine = startLine + 1;\n if (state.sCount[nextLine] < state.blkIndent) {\n return false;\n }\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n return false;\n }\n // first character of the second line should be '|', '-', ':',\n // and no other characters are allowed but spaces;\n // basically, this is the equivalent of /^[-:|][-:|\\s]*$/ regexp\n let pos = state.bMarks[nextLine] + state.tShift[nextLine];\n if (pos >= state.eMarks[nextLine]) {\n return false;\n }\n const firstCh = state.src.charCodeAt(pos++);\n if (firstCh !== 124 /* | */ && firstCh !== 45 /* - */ && firstCh !== 58 /* : */) {\n return false;\n }\n if (pos >= state.eMarks[nextLine]) {\n return false;\n }\n const secondCh = state.src.charCodeAt(pos++);\n if (secondCh !== 124 /* | */ && secondCh !== 45 /* - */ && secondCh !== 58 /* : */ && !isSpace(secondCh)) {\n return false;\n }\n // if first character is '-', then second character must not be a space\n // (due to parsing ambiguity with list)\n if (firstCh === 45 /* - */ && isSpace(secondCh)) {\n return false;\n }\n while (pos < state.eMarks[nextLine]) {\n const ch = state.src.charCodeAt(pos);\n if (ch !== 124 /* | */ && ch !== 45 /* - */ && ch !== 58 /* : */ && !isSpace(ch)) {\n return false;\n }\n pos++;\n }\n let lineText = getLine(state, startLine + 1);\n let columns = lineText.split(\"|\");\n const aligns = [];\n for (let i = 0; i < columns.length; i++) {\n const t = columns[i].trim();\n if (!t) {\n // allow empty columns before and after table, but not in between columns;\n // e.g. allow ` |---| `, disallow ` ---||--- `\n if (i === 0 || i === columns.length - 1) {\n continue;\n } else {\n return false;\n }\n }\n if (!/^:?-+:?$/.test(t)) {\n return false;\n }\n if (t.charCodeAt(t.length - 1) === 58 /* : */) {\n aligns.push(t.charCodeAt(0) === 58 /* : */ ? \"center\" : \"right\");\n } else if (t.charCodeAt(0) === 58 /* : */) {\n aligns.push(\"left\");\n } else {\n aligns.push(\"\");\n }\n }\n lineText = getLine(state, startLine).trim();\n if (lineText.indexOf(\"|\") === -1) {\n return false;\n }\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n columns = escapedSplit(lineText);\n if (columns.length && columns[0] === \"\") columns.shift();\n if (columns.length && columns[columns.length - 1] === \"\") columns.pop();\n // header row will define an amount of columns in the entire table,\n // and align row should be exactly the same (the rest of the rows can differ)\n const columnCount = columns.length;\n if (columnCount === 0 || columnCount !== aligns.length) {\n return false;\n }\n if (silent) {\n return true;\n }\n const oldParentType = state.parentType;\n state.parentType = \"table\";\n // use 'blockquote' lists for termination because it's\n // the most similar to tables\n const terminatorRules = state.md.block.ruler.getRules(\"blockquote\");\n const token_to = state.push(\"table_open\", \"table\", 1);\n const tableLines = [ startLine, 0 ];\n token_to.map = tableLines;\n const token_tho = state.push(\"thead_open\", \"thead\", 1);\n token_tho.map = [ startLine, startLine + 1 ];\n const token_htro = state.push(\"tr_open\", \"tr\", 1);\n token_htro.map = [ startLine, startLine + 1 ];\n for (let i = 0; i < columns.length; i++) {\n const token_ho = state.push(\"th_open\", \"th\", 1);\n if (aligns[i]) {\n token_ho.attrs = [ [ \"style\", \"text-align:\" + aligns[i] ] ];\n }\n const token_il = state.push(\"inline\", \"\", 0);\n token_il.content = columns[i].trim();\n token_il.children = [];\n state.push(\"th_close\", \"th\", -1);\n }\n state.push(\"tr_close\", \"tr\", -1);\n state.push(\"thead_close\", \"thead\", -1);\n let tbodyLines;\n let autocompletedCells = 0;\n for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) {\n break;\n }\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) {\n break;\n }\n lineText = getLine(state, nextLine).trim();\n if (!lineText) {\n break;\n }\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n break;\n }\n columns = escapedSplit(lineText);\n if (columns.length && columns[0] === \"\") columns.shift();\n if (columns.length && columns[columns.length - 1] === \"\") columns.pop();\n // note: autocomplete count can be negative if user specifies more columns than header,\n // but that does not affect intended use (which is limiting expansion)\n autocompletedCells += columnCount - columns.length;\n if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) {\n break;\n }\n if (nextLine === startLine + 2) {\n const token_tbo = state.push(\"tbody_open\", \"tbody\", 1);\n token_tbo.map = tbodyLines = [ startLine + 2, 0 ];\n }\n const token_tro = state.push(\"tr_open\", \"tr\", 1);\n token_tro.map = [ nextLine, nextLine + 1 ];\n for (let i = 0; i < columnCount; i++) {\n const token_tdo = state.push(\"td_open\", \"td\", 1);\n if (aligns[i]) {\n token_tdo.attrs = [ [ \"style\", \"text-align:\" + aligns[i] ] ];\n }\n const token_il = state.push(\"inline\", \"\", 0);\n token_il.content = columns[i] ? columns[i].trim() : \"\";\n token_il.children = [];\n state.push(\"td_close\", \"td\", -1);\n }\n state.push(\"tr_close\", \"tr\", -1);\n }\n if (tbodyLines) {\n state.push(\"tbody_close\", \"tbody\", -1);\n tbodyLines[1] = nextLine;\n }\n state.push(\"table_close\", \"table\", -1);\n tableLines[1] = nextLine;\n state.parentType = oldParentType;\n state.line = nextLine;\n return true;\n }\n // Code block (4 spaces padded)\n function code(state, startLine, endLine /*, silent */) {\n if (state.sCount[startLine] - state.blkIndent < 4) {\n return false;\n }\n let nextLine = startLine + 1;\n let last = nextLine;\n while (nextLine < endLine) {\n if (state.isEmpty(nextLine)) {\n nextLine++;\n continue;\n }\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n nextLine++;\n last = nextLine;\n continue;\n }\n break;\n }\n state.line = last;\n const token = state.push(\"code_block\", \"code\", 0);\n token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + \"\\n\";\n token.map = [ startLine, state.line ];\n return true;\n }\n // fences (``` lang, ~~~ lang)\n function fence(state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n let max = state.eMarks[startLine];\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n if (pos + 3 > max) {\n return false;\n }\n const marker = state.src.charCodeAt(pos);\n if (marker !== 126 /* ~ */ && marker !== 96 /* ` */) {\n return false;\n }\n // scan marker length\n let mem = pos;\n pos = state.skipChars(pos, marker);\n let len = pos - mem;\n if (len < 3) {\n return false;\n }\n const markup = state.src.slice(mem, pos);\n const params = state.src.slice(pos, max);\n if (marker === 96 /* ` */) {\n if (params.indexOf(String.fromCharCode(marker)) >= 0) {\n return false;\n }\n }\n // Since start is found, we can report success here in validation mode\n if (silent) {\n return true;\n }\n // search end of block\n let nextLine = startLine;\n let haveEndMarker = false;\n for (;;) {\n nextLine++;\n if (nextLine >= endLine) {\n // unclosed block should be autoclosed by end of document.\n // also block seems to be autoclosed by end of parent\n break;\n }\n pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];\n max = state.eMarks[nextLine];\n if (pos < max && state.sCount[nextLine] < state.blkIndent) {\n // non-empty line with negative indent should stop the list:\n // - ```\n // test\n break;\n }\n if (state.src.charCodeAt(pos) !== marker) {\n continue;\n }\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n // closing fence should be indented less than 4 spaces\n continue;\n }\n pos = state.skipChars(pos, marker);\n // closing code fence must be at least as long as the opening one\n if (pos - mem < len) {\n continue;\n }\n // make sure tail has spaces only\n pos = state.skipSpaces(pos);\n if (pos < max) {\n continue;\n }\n haveEndMarker = true;\n // found!\n break;\n }\n // If a fence has heading spaces, they should be removed from its inner block\n len = state.sCount[startLine];\n state.line = nextLine + (haveEndMarker ? 1 : 0);\n const token = state.push(\"fence\", \"code\", 0);\n token.info = params;\n token.content = state.getLines(startLine + 1, nextLine, len, true);\n token.markup = markup;\n token.map = [ startLine, state.line ];\n return true;\n }\n // Block quotes\n function blockquote(state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n let max = state.eMarks[startLine];\n const oldLineMax = state.lineMax;\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n // check the block quote marker\n if (state.src.charCodeAt(pos) !== 62 /* > */) {\n return false;\n }\n // we know that it's going to be a valid blockquote,\n // so no point trying to find the end of it in silent mode\n if (silent) {\n return true;\n }\n const oldBMarks = [];\n const oldBSCount = [];\n const oldSCount = [];\n const oldTShift = [];\n const terminatorRules = state.md.block.ruler.getRules(\"blockquote\");\n const oldParentType = state.parentType;\n state.parentType = \"blockquote\";\n let lastLineEmpty = false;\n let nextLine;\n // Search the end of the block\n\n // Block ends with either:\n // 1. an empty line outside:\n // ```\n // > test\n\n // ```\n // 2. an empty line inside:\n // ```\n // >\n // test\n // ```\n // 3. another tag:\n // ```\n // > test\n // - - -\n // ```\n for (nextLine = startLine; nextLine < endLine; nextLine++) {\n // check if it's outdented, i.e. it's inside list item and indented\n // less than said list item:\n // ```\n // 1. anything\n // > current blockquote\n // 2. checking this line\n // ```\n const isOutdented = state.sCount[nextLine] < state.blkIndent;\n pos = state.bMarks[nextLine] + state.tShift[nextLine];\n max = state.eMarks[nextLine];\n if (pos >= max) {\n // Case 1: line is not inside the blockquote, and this line is empty.\n break;\n }\n if (state.src.charCodeAt(pos++) === 62 /* > */ && !isOutdented) {\n // This line is inside the blockquote.\n // set offset past spaces and \">\"\n let initial = state.sCount[nextLine] + 1;\n let spaceAfterMarker;\n let adjustTab;\n // skip one optional space after '>'\n if (state.src.charCodeAt(pos) === 32 /* space */) {\n // ' > test '\n // ^ -- position start of line here:\n pos++;\n initial++;\n adjustTab = false;\n spaceAfterMarker = true;\n } else if (state.src.charCodeAt(pos) === 9 /* tab */) {\n spaceAfterMarker = true;\n if ((state.bsCount[nextLine] + initial) % 4 === 3) {\n // ' >\\t test '\n // ^ -- position start of line here (tab has width===1)\n pos++;\n initial++;\n adjustTab = false;\n } else {\n // ' >\\t test '\n // ^ -- position start of line here + shift bsCount slightly\n // to make extra space appear\n adjustTab = true;\n }\n } else {\n spaceAfterMarker = false;\n }\n let offset = initial;\n oldBMarks.push(state.bMarks[nextLine]);\n state.bMarks[nextLine] = pos;\n while (pos < max) {\n const ch = state.src.charCodeAt(pos);\n if (isSpace(ch)) {\n if (ch === 9) {\n offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;\n } else {\n offset++;\n }\n } else {\n break;\n }\n pos++;\n }\n lastLineEmpty = pos >= max;\n oldBSCount.push(state.bsCount[nextLine]);\n state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);\n oldSCount.push(state.sCount[nextLine]);\n state.sCount[nextLine] = offset - initial;\n oldTShift.push(state.tShift[nextLine]);\n state.tShift[nextLine] = pos - state.bMarks[nextLine];\n continue;\n }\n // Case 2: line is not inside the blockquote, and the last line was empty.\n if (lastLineEmpty) {\n break;\n }\n // Case 3: another tag found.\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) {\n // Quirk to enforce \"hard termination mode\" for paragraphs;\n // normally if you call `tokenize(state, startLine, nextLine)`,\n // paragraphs will look below nextLine for paragraph continuation,\n // but if blockquote is terminated by another tag, they shouldn't\n state.lineMax = nextLine;\n if (state.blkIndent !== 0) {\n // state.blkIndent was non-zero, we now set it to zero,\n // so we need to re-calculate all offsets to appear as\n // if indent wasn't changed\n oldBMarks.push(state.bMarks[nextLine]);\n oldBSCount.push(state.bsCount[nextLine]);\n oldTShift.push(state.tShift[nextLine]);\n oldSCount.push(state.sCount[nextLine]);\n state.sCount[nextLine] -= state.blkIndent;\n }\n break;\n }\n oldBMarks.push(state.bMarks[nextLine]);\n oldBSCount.push(state.bsCount[nextLine]);\n oldTShift.push(state.tShift[nextLine]);\n oldSCount.push(state.sCount[nextLine]);\n // A negative indentation means that this is a paragraph continuation\n\n state.sCount[nextLine] = -1;\n }\n const oldIndent = state.blkIndent;\n state.blkIndent = 0;\n const token_o = state.push(\"blockquote_open\", \"blockquote\", 1);\n token_o.markup = \">\";\n const lines = [ startLine, 0 ];\n token_o.map = lines;\n state.md.block.tokenize(state, startLine, nextLine);\n const token_c = state.push(\"blockquote_close\", \"blockquote\", -1);\n token_c.markup = \">\";\n state.lineMax = oldLineMax;\n state.parentType = oldParentType;\n lines[1] = state.line;\n // Restore original tShift; this might not be necessary since the parser\n // has already been here, but just to make sure we can do that.\n for (let i = 0; i < oldTShift.length; i++) {\n state.bMarks[i + startLine] = oldBMarks[i];\n state.tShift[i + startLine] = oldTShift[i];\n state.sCount[i + startLine] = oldSCount[i];\n state.bsCount[i + startLine] = oldBSCount[i];\n }\n state.blkIndent = oldIndent;\n return true;\n }\n // Horizontal rule\n function hr(state, startLine, endLine, silent) {\n const max = state.eMarks[startLine];\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n const marker = state.src.charCodeAt(pos++);\n // Check hr marker\n if (marker !== 42 /* * */ && marker !== 45 /* - */ && marker !== 95 /* _ */) {\n return false;\n }\n // markers can be mixed with spaces, but there should be at least 3 of them\n let cnt = 1;\n while (pos < max) {\n const ch = state.src.charCodeAt(pos++);\n if (ch !== marker && !isSpace(ch)) {\n return false;\n }\n if (ch === marker) {\n cnt++;\n }\n }\n if (cnt < 3) {\n return false;\n }\n if (silent) {\n return true;\n }\n state.line = startLine + 1;\n const token = state.push(\"hr\", \"hr\", 0);\n token.map = [ startLine, state.line ];\n token.markup = Array(cnt + 1).join(String.fromCharCode(marker));\n return true;\n }\n // Lists\n // Search `[-+*][\\n ]`, returns next pos after marker on success\n // or -1 on fail.\n function skipBulletListMarker(state, startLine) {\n const max = state.eMarks[startLine];\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n const marker = state.src.charCodeAt(pos++);\n // Check bullet\n if (marker !== 42 /* * */ && marker !== 45 /* - */ && marker !== 43 /* + */) {\n return -1;\n }\n if (pos < max) {\n const ch = state.src.charCodeAt(pos);\n if (!isSpace(ch)) {\n // \" -test \" - is not a list item\n return -1;\n }\n }\n return pos;\n }\n // Search `\\d+[.)][\\n ]`, returns next pos after marker on success\n // or -1 on fail.\n function skipOrderedListMarker(state, startLine) {\n const start = state.bMarks[startLine] + state.tShift[startLine];\n const max = state.eMarks[startLine];\n let pos = start;\n // List marker should have at least 2 chars (digit + dot)\n if (pos + 1 >= max) {\n return -1;\n }\n let ch = state.src.charCodeAt(pos++);\n if (ch < 48 /* 0 */ || ch > 57 /* 9 */) {\n return -1;\n }\n for (;;) {\n // EOL -> fail\n if (pos >= max) {\n return -1;\n }\n ch = state.src.charCodeAt(pos++);\n if (ch >= 48 /* 0 */ && ch <= 57 /* 9 */) {\n // List marker should have no more than 9 digits\n // (prevents integer overflow in browsers)\n if (pos - start >= 10) {\n return -1;\n }\n continue;\n }\n // found valid marker\n if (ch === 41 /* ) */ || ch === 46 /* . */) {\n break;\n }\n return -1;\n }\n if (pos < max) {\n ch = state.src.charCodeAt(pos);\n if (!isSpace(ch)) {\n // \" 1.test \" - is not a list item\n return -1;\n }\n }\n return pos;\n }\n function markTightParagraphs(state, idx) {\n const level = state.level + 2;\n for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) {\n if (state.tokens[i].level === level && state.tokens[i].type === \"paragraph_open\") {\n state.tokens[i + 2].hidden = true;\n state.tokens[i].hidden = true;\n i += 2;\n }\n }\n }\n function list(state, startLine, endLine, silent) {\n let max, pos, start, token;\n let nextLine = startLine;\n let tight = true;\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n return false;\n }\n // Special case:\n // - item 1\n // - item 2\n // - item 3\n // - item 4\n // - this one is a paragraph continuation\n if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) {\n return false;\n }\n let isTerminatingParagraph = false;\n // limit conditions when list can interrupt\n // a paragraph (validation mode only)\n if (silent && state.parentType === \"paragraph\") {\n // Next list item should still terminate previous list item;\n // This code can fail if plugins use blkIndent as well as lists,\n // but I hope the spec gets fixed long before that happens.\n if (state.sCount[nextLine] >= state.blkIndent) {\n isTerminatingParagraph = true;\n }\n }\n // Detect list type and position after marker\n let isOrdered;\n let markerValue;\n let posAfterMarker;\n if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {\n isOrdered = true;\n start = state.bMarks[nextLine] + state.tShift[nextLine];\n markerValue = Number(state.src.slice(start, posAfterMarker - 1));\n // If we're starting a new ordered list right after\n // a paragraph, it should start with 1.\n if (isTerminatingParagraph && markerValue !== 1) return false;\n } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) {\n isOrdered = false;\n } else {\n return false;\n }\n // If we're starting a new unordered list right after\n // a paragraph, first line should not be empty.\n if (isTerminatingParagraph) {\n if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false;\n }\n // For validation mode we can terminate immediately\n if (silent) {\n return true;\n }\n // We should terminate list on style change. Remember first one to compare.\n const markerCharCode = state.src.charCodeAt(posAfterMarker - 1);\n // Start list\n const listTokIdx = state.tokens.length;\n if (isOrdered) {\n token = state.push(\"ordered_list_open\", \"ol\", 1);\n if (markerValue !== 1) {\n token.attrs = [ [ \"start\", markerValue ] ];\n }\n } else {\n token = state.push(\"bullet_list_open\", \"ul\", 1);\n }\n const listLines = [ nextLine, 0 ];\n token.map = listLines;\n token.markup = String.fromCharCode(markerCharCode);\n\n // Iterate list items\n\n let prevEmptyEnd = false;\n const terminatorRules = state.md.block.ruler.getRules(\"list\");\n const oldParentType = state.parentType;\n state.parentType = \"list\";\n while (nextLine < endLine) {\n pos = posAfterMarker;\n max = state.eMarks[nextLine];\n const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]);\n let offset = initial;\n while (pos < max) {\n const ch = state.src.charCodeAt(pos);\n if (ch === 9) {\n offset += 4 - (offset + state.bsCount[nextLine]) % 4;\n } else if (ch === 32) {\n offset++;\n } else {\n break;\n }\n pos++;\n }\n const contentStart = pos;\n let indentAfterMarker;\n if (contentStart >= max) {\n // trimming space in \"- \\n 3\" case, indent is 1 here\n indentAfterMarker = 1;\n } else {\n indentAfterMarker = offset - initial;\n }\n // If we have more than 4 spaces, the indent is 1\n // (the rest is just indented code block)\n if (indentAfterMarker > 4) {\n indentAfterMarker = 1;\n }\n // \" - test\"\n // ^^^^^ - calculating total length of this thing\n const indent = initial + indentAfterMarker;\n // Run subparser & write tokens\n token = state.push(\"list_item_open\", \"li\", 1);\n token.markup = String.fromCharCode(markerCharCode);\n const itemLines = [ nextLine, 0 ];\n token.map = itemLines;\n if (isOrdered) {\n token.info = state.src.slice(start, posAfterMarker - 1);\n }\n // change current state, then restore it after parser subcall\n const oldTight = state.tight;\n const oldTShift = state.tShift[nextLine];\n const oldSCount = state.sCount[nextLine];\n // - example list\n // ^ listIndent position will be here\n // ^ blkIndent position will be here\n\n const oldListIndent = state.listIndent;\n state.listIndent = state.blkIndent;\n state.blkIndent = indent;\n state.tight = true;\n state.tShift[nextLine] = contentStart - state.bMarks[nextLine];\n state.sCount[nextLine] = offset;\n if (contentStart >= max && state.isEmpty(nextLine + 1)) {\n // workaround for this case\n // (list item is empty, list terminates before \"foo\"):\n // ~~~~~~~~\n // -\n // foo\n // ~~~~~~~~\n state.line = Math.min(state.line + 2, endLine);\n } else {\n state.md.block.tokenize(state, nextLine, endLine, true);\n }\n // If any of list item is tight, mark list as tight\n if (!state.tight || prevEmptyEnd) {\n tight = false;\n }\n // Item become loose if finish with empty line,\n // but we should filter last element, because it means list finish\n prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1);\n state.blkIndent = state.listIndent;\n state.listIndent = oldListIndent;\n state.tShift[nextLine] = oldTShift;\n state.sCount[nextLine] = oldSCount;\n state.tight = oldTight;\n token = state.push(\"list_item_close\", \"li\", -1);\n token.markup = String.fromCharCode(markerCharCode);\n nextLine = state.line;\n itemLines[1] = nextLine;\n if (nextLine >= endLine) {\n break;\n }\n\n // Try to check if list is terminated or continued.\n\n if (state.sCount[nextLine] < state.blkIndent) {\n break;\n }\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[nextLine] - state.blkIndent >= 4) {\n break;\n }\n // fail if terminating block found\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) {\n break;\n }\n // fail if list has another type\n if (isOrdered) {\n posAfterMarker = skipOrderedListMarker(state, nextLine);\n if (posAfterMarker < 0) {\n break;\n }\n start = state.bMarks[nextLine] + state.tShift[nextLine];\n } else {\n posAfterMarker = skipBulletListMarker(state, nextLine);\n if (posAfterMarker < 0) {\n break;\n }\n }\n if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) {\n break;\n }\n }\n // Finalize list\n if (isOrdered) {\n token = state.push(\"ordered_list_close\", \"ol\", -1);\n } else {\n token = state.push(\"bullet_list_close\", \"ul\", -1);\n }\n token.markup = String.fromCharCode(markerCharCode);\n listLines[1] = nextLine;\n state.line = nextLine;\n state.parentType = oldParentType;\n // mark paragraphs tight if needed\n if (tight) {\n markTightParagraphs(state, listTokIdx);\n }\n return true;\n }\n function reference(state, startLine, _endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n let max = state.eMarks[startLine];\n let nextLine = startLine + 1;\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n if (state.src.charCodeAt(pos) !== 91 /* [ */) {\n return false;\n }\n function getNextLine(nextLine) {\n const endLine = state.lineMax;\n if (nextLine >= endLine || state.isEmpty(nextLine)) {\n // empty line or end of input\n return null;\n }\n let isContinuation = false;\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) {\n isContinuation = true;\n }\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) {\n isContinuation = true;\n }\n if (!isContinuation) {\n const terminatorRules = state.md.block.ruler.getRules(\"reference\");\n const oldParentType = state.parentType;\n state.parentType = \"reference\";\n // Some tags can terminate paragraph without empty line.\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n state.parentType = oldParentType;\n if (terminate) {\n // terminated by another block\n return null;\n }\n }\n const pos = state.bMarks[nextLine] + state.tShift[nextLine];\n const max = state.eMarks[nextLine];\n // max + 1 explicitly includes the newline\n return state.src.slice(pos, max + 1);\n }\n let str = state.src.slice(pos, max + 1);\n max = str.length;\n let labelEnd = -1;\n for (pos = 1; pos < max; pos++) {\n const ch = str.charCodeAt(pos);\n if (ch === 91 /* [ */) {\n return false;\n } else if (ch === 93 /* ] */) {\n labelEnd = pos;\n break;\n } else if (ch === 10 /* \\n */) {\n const lineContent = getNextLine(nextLine);\n if (lineContent !== null) {\n str += lineContent;\n max = str.length;\n nextLine++;\n }\n } else if (ch === 92 /* \\ */) {\n pos++;\n if (pos < max && str.charCodeAt(pos) === 10) {\n const lineContent = getNextLine(nextLine);\n if (lineContent !== null) {\n str += lineContent;\n max = str.length;\n nextLine++;\n }\n }\n }\n }\n if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58 /* : */) {\n return false;\n }\n // [label]: destination 'title'\n // ^^^ skip optional whitespace here\n for (pos = labelEnd + 2; pos < max; pos++) {\n const ch = str.charCodeAt(pos);\n if (ch === 10) {\n const lineContent = getNextLine(nextLine);\n if (lineContent !== null) {\n str += lineContent;\n max = str.length;\n nextLine++;\n }\n } else if (isSpace(ch)) ; else {\n break;\n }\n }\n // [label]: destination 'title'\n // ^^^^^^^^^^^ parse this\n const destRes = state.md.helpers.parseLinkDestination(str, pos, max);\n if (!destRes.ok) {\n return false;\n }\n const href = state.md.normalizeLink(destRes.str);\n if (!state.md.validateLink(href)) {\n return false;\n }\n pos = destRes.pos;\n // save cursor state, we could require to rollback later\n const destEndPos = pos;\n const destEndLineNo = nextLine;\n // [label]: destination 'title'\n // ^^^ skipping those spaces\n const start = pos;\n for (;pos < max; pos++) {\n const ch = str.charCodeAt(pos);\n if (ch === 10) {\n const lineContent = getNextLine(nextLine);\n if (lineContent !== null) {\n str += lineContent;\n max = str.length;\n nextLine++;\n }\n } else if (isSpace(ch)) ; else {\n break;\n }\n }\n // [label]: destination 'title'\n // ^^^^^^^ parse this\n let titleRes = state.md.helpers.parseLinkTitle(str, pos, max);\n while (titleRes.can_continue) {\n const lineContent = getNextLine(nextLine);\n if (lineContent === null) break;\n str += lineContent;\n pos = max;\n max = str.length;\n nextLine++;\n titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes);\n }\n let title;\n if (pos < max && start !== pos && titleRes.ok) {\n title = titleRes.str;\n pos = titleRes.pos;\n } else {\n title = \"\";\n pos = destEndPos;\n nextLine = destEndLineNo;\n }\n // skip trailing spaces until the rest of the line\n while (pos < max) {\n const ch = str.charCodeAt(pos);\n if (!isSpace(ch)) {\n break;\n }\n pos++;\n }\n if (pos < max && str.charCodeAt(pos) !== 10) {\n if (title) {\n // garbage at the end of the line after title,\n // but it could still be a valid reference if we roll back\n title = \"\";\n pos = destEndPos;\n nextLine = destEndLineNo;\n while (pos < max) {\n const ch = str.charCodeAt(pos);\n if (!isSpace(ch)) {\n break;\n }\n pos++;\n }\n }\n }\n if (pos < max && str.charCodeAt(pos) !== 10) {\n // garbage at the end of the line\n return false;\n }\n const label = normalizeReference(str.slice(1, labelEnd));\n if (!label) {\n // CommonMark 0.20 disallows empty labels\n return false;\n }\n // Reference can not terminate anything. This check is for safety only.\n /* istanbul ignore if */ if (silent) {\n return true;\n }\n if (typeof state.env.references === \"undefined\") {\n state.env.references = {};\n }\n if (typeof state.env.references[label] === \"undefined\") {\n state.env.references[label] = {\n title: title,\n href: href\n };\n }\n state.line = nextLine;\n return true;\n }\n // List of valid html blocks names, according to commonmark spec\n // https://spec.commonmark.org/0.30/#html-blocks\n var block_names = [ \"address\", \"article\", \"aside\", \"base\", \"basefont\", \"blockquote\", \"body\", \"caption\", \"center\", \"col\", \"colgroup\", \"dd\", \"details\", \"dialog\", \"dir\", \"div\", \"dl\", \"dt\", \"fieldset\", \"figcaption\", \"figure\", \"footer\", \"form\", \"frame\", \"frameset\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \"h6\", \"head\", \"header\", \"hr\", \"html\", \"iframe\", \"legend\", \"li\", \"link\", \"main\", \"menu\", \"menuitem\", \"nav\", \"noframes\", \"ol\", \"optgroup\", \"option\", \"p\", \"param\", \"search\", \"section\", \"summary\", \"table\", \"tbody\", \"td\", \"tfoot\", \"th\", \"thead\", \"title\", \"tr\", \"track\", \"ul\" ];\n // Regexps to match html elements\n const attr_name = \"[a-zA-Z_:][a-zA-Z0-9:._-]*\";\n const unquoted = \"[^\\\"'=<>`\\\\x00-\\\\x20]+\";\n const single_quoted = \"'[^']*'\";\n const double_quoted = '\"[^\"]*\"';\n const attr_value = \"(?:\" + unquoted + \"|\" + single_quoted + \"|\" + double_quoted + \")\";\n const attribute = \"(?:\\\\s+\" + attr_name + \"(?:\\\\s*=\\\\s*\" + attr_value + \")?)\";\n const open_tag = \"<[A-Za-z][A-Za-z0-9\\\\-]*\" + attribute + \"*\\\\s*\\\\/?>\";\n const close_tag = \"<\\\\/[A-Za-z][A-Za-z0-9\\\\-]*\\\\s*>\";\n const comment = \"\\x3c!---?>|\\x3c!--(?:[^-]|-[^-]|--[^>])*--\\x3e\";\n const processing = \"<[?][\\\\s\\\\S]*?[?]>\";\n const declaration = \"]*>\";\n const cdata = \"\";\n const HTML_TAG_RE = new RegExp(\"^(?:\" + open_tag + \"|\" + close_tag + \"|\" + comment + \"|\" + processing + \"|\" + declaration + \"|\" + cdata + \")\");\n const HTML_OPEN_CLOSE_TAG_RE = new RegExp(\"^(?:\" + open_tag + \"|\" + close_tag + \")\");\n // HTML block\n // An array of opening and corresponding closing sequences for html tags,\n // last argument defines whether it can terminate a paragraph or not\n\n const HTML_SEQUENCES = [ [ /^<(script|pre|style|textarea)(?=(\\s|>|$))/i, /<\\/(script|pre|style|textarea)>/i, true ], [ /^/, true ], [ /^<\\?/, /\\?>/, true ], [ /^/, true ], [ /^/, true ], [ new RegExp(\"^|$))\", \"i\"), /^$/, true ], [ new RegExp(HTML_OPEN_CLOSE_TAG_RE.source + \"\\\\s*$\"), /^$/, false ] ];\n function html_block(state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n let max = state.eMarks[startLine];\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n if (!state.md.options.html) {\n return false;\n }\n if (state.src.charCodeAt(pos) !== 60 /* < */) {\n return false;\n }\n let lineText = state.src.slice(pos, max);\n let i = 0;\n for (;i < HTML_SEQUENCES.length; i++) {\n if (HTML_SEQUENCES[i][0].test(lineText)) {\n break;\n }\n }\n if (i === HTML_SEQUENCES.length) {\n return false;\n }\n if (silent) {\n // true if this sequence can be a terminator, false otherwise\n return HTML_SEQUENCES[i][2];\n }\n let nextLine = startLine + 1;\n // If we are here - we detected HTML block.\n // Let's roll down till block end.\n if (!HTML_SEQUENCES[i][1].test(lineText)) {\n for (;nextLine < endLine; nextLine++) {\n if (state.sCount[nextLine] < state.blkIndent) {\n break;\n }\n pos = state.bMarks[nextLine] + state.tShift[nextLine];\n max = state.eMarks[nextLine];\n lineText = state.src.slice(pos, max);\n if (HTML_SEQUENCES[i][1].test(lineText)) {\n if (lineText.length !== 0) {\n nextLine++;\n }\n break;\n }\n }\n }\n state.line = nextLine;\n const token = state.push(\"html_block\", \"\", 0);\n token.map = [ startLine, nextLine ];\n token.content = state.getLines(startLine, nextLine, state.blkIndent, true);\n return true;\n }\n // heading (#, ##, ...)\n function heading(state, startLine, endLine, silent) {\n let pos = state.bMarks[startLine] + state.tShift[startLine];\n let max = state.eMarks[startLine];\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n let ch = state.src.charCodeAt(pos);\n if (ch !== 35 /* # */ || pos >= max) {\n return false;\n }\n // count heading level\n let level = 1;\n ch = state.src.charCodeAt(++pos);\n while (ch === 35 /* # */ && pos < max && level <= 6) {\n level++;\n ch = state.src.charCodeAt(++pos);\n }\n if (level > 6 || pos < max && !isSpace(ch)) {\n return false;\n }\n if (silent) {\n return true;\n }\n // Let's cut tails like ' ### ' from the end of string\n max = state.skipSpacesBack(max, pos);\n const tmp = state.skipCharsBack(max, 35, pos);\n // #\n if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) {\n max = tmp;\n }\n state.line = startLine + 1;\n const token_o = state.push(\"heading_open\", \"h\" + String(level), 1);\n token_o.markup = \"########\".slice(0, level);\n token_o.map = [ startLine, state.line ];\n const token_i = state.push(\"inline\", \"\", 0);\n token_i.content = state.src.slice(pos, max).trim();\n token_i.map = [ startLine, state.line ];\n token_i.children = [];\n const token_c = state.push(\"heading_close\", \"h\" + String(level), -1);\n token_c.markup = \"########\".slice(0, level);\n return true;\n }\n // lheading (---, ===)\n function lheading(state, startLine, endLine /*, silent */) {\n const terminatorRules = state.md.block.ruler.getRules(\"paragraph\");\n // if it's indented more than 3 spaces, it should be a code block\n if (state.sCount[startLine] - state.blkIndent >= 4) {\n return false;\n }\n const oldParentType = state.parentType;\n state.parentType = \"paragraph\";\n // use paragraph to match terminatorRules\n // jump line-by-line until empty one or EOF\n let level = 0;\n let marker;\n let nextLine = startLine + 1;\n for (;nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) {\n continue;\n }\n\n // Check for underline in setext header\n\n if (state.sCount[nextLine] >= state.blkIndent) {\n let pos = state.bMarks[nextLine] + state.tShift[nextLine];\n const max = state.eMarks[nextLine];\n if (pos < max) {\n marker = state.src.charCodeAt(pos);\n if (marker === 45 /* - */ || marker === 61 /* = */) {\n pos = state.skipChars(pos, marker);\n pos = state.skipSpaces(pos);\n if (pos >= max) {\n level = marker === 61 /* = */ ? 1 : 2;\n break;\n }\n }\n }\n }\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) {\n continue;\n }\n // Some tags can terminate paragraph without empty line.\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) {\n break;\n }\n }\n if (!level) {\n // Didn't find valid underline\n return false;\n }\n const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();\n state.line = nextLine + 1;\n const token_o = state.push(\"heading_open\", \"h\" + String(level), 1);\n token_o.markup = String.fromCharCode(marker);\n token_o.map = [ startLine, state.line ];\n const token_i = state.push(\"inline\", \"\", 0);\n token_i.content = content;\n token_i.map = [ startLine, state.line - 1 ];\n token_i.children = [];\n const token_c = state.push(\"heading_close\", \"h\" + String(level), -1);\n token_c.markup = String.fromCharCode(marker);\n state.parentType = oldParentType;\n return true;\n }\n // Paragraph\n function paragraph(state, startLine, endLine) {\n const terminatorRules = state.md.block.ruler.getRules(\"paragraph\");\n const oldParentType = state.parentType;\n let nextLine = startLine + 1;\n state.parentType = \"paragraph\";\n // jump line-by-line until empty one or EOF\n for (;nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {\n // this would be a code block normally, but after paragraph\n // it's considered a lazy continuation regardless of what's there\n if (state.sCount[nextLine] - state.blkIndent > 3) {\n continue;\n }\n // quirk for blockquotes, this line should already be checked by that rule\n if (state.sCount[nextLine] < 0) {\n continue;\n }\n // Some tags can terminate paragraph without empty line.\n let terminate = false;\n for (let i = 0, l = terminatorRules.length; i < l; i++) {\n if (terminatorRules[i](state, nextLine, endLine, true)) {\n terminate = true;\n break;\n }\n }\n if (terminate) {\n break;\n }\n }\n const content = state.getLines(startLine, nextLine, state.blkIndent, false).trim();\n state.line = nextLine;\n const token_o = state.push(\"paragraph_open\", \"p\", 1);\n token_o.map = [ startLine, state.line ];\n const token_i = state.push(\"inline\", \"\", 0);\n token_i.content = content;\n token_i.map = [ startLine, state.line ];\n token_i.children = [];\n state.push(\"paragraph_close\", \"p\", -1);\n state.parentType = oldParentType;\n return true;\n }\n /** internal\n * class ParserBlock\n *\n * Block-level tokenizer.\n **/ const _rules$1 = [\n // First 2 params - rule name & source. Secondary array - list of rules,\n // which can be terminated by this one.\n [ \"table\", table, [ \"paragraph\", \"reference\" ] ], [ \"code\", code ], [ \"fence\", fence, [ \"paragraph\", \"reference\", \"blockquote\", \"list\" ] ], [ \"blockquote\", blockquote, [ \"paragraph\", \"reference\", \"blockquote\", \"list\" ] ], [ \"hr\", hr, [ \"paragraph\", \"reference\", \"blockquote\", \"list\" ] ], [ \"list\", list, [ \"paragraph\", \"reference\", \"blockquote\" ] ], [ \"reference\", reference ], [ \"html_block\", html_block, [ \"paragraph\", \"reference\", \"blockquote\" ] ], [ \"heading\", heading, [ \"paragraph\", \"reference\", \"blockquote\" ] ], [ \"lheading\", lheading ], [ \"paragraph\", paragraph ] ];\n /**\n * new ParserBlock()\n **/ function ParserBlock() {\n /**\n * ParserBlock#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of block rules.\n **/\n this.ruler = new Ruler;\n for (let i = 0; i < _rules$1.length; i++) {\n this.ruler.push(_rules$1[i][0], _rules$1[i][1], {\n alt: (_rules$1[i][2] || []).slice()\n });\n }\n }\n // Generate tokens for input range\n\n ParserBlock.prototype.tokenize = function(state, startLine, endLine) {\n const rules = this.ruler.getRules(\"\");\n const len = rules.length;\n const maxNesting = state.md.options.maxNesting;\n let line = startLine;\n let hasEmptyLines = false;\n while (line < endLine) {\n state.line = line = state.skipEmptyLines(line);\n if (line >= endLine) {\n break;\n }\n // Termination condition for nested calls.\n // Nested calls currently used for blockquotes & lists\n if (state.sCount[line] < state.blkIndent) {\n break;\n }\n // If nesting level exceeded - skip tail to the end. That's not ordinary\n // situation and we should not care about content.\n if (state.level >= maxNesting) {\n state.line = endLine;\n break;\n }\n // Try all possible rules.\n // On success, rule should:\n\n // - update `state.line`\n // - update `state.tokens`\n // - return true\n const prevLine = state.line;\n let ok = false;\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, line, endLine, false);\n if (ok) {\n if (prevLine >= state.line) {\n throw new Error(\"block rule didn't increment state.line\");\n }\n break;\n }\n }\n // this can only happen if user disables paragraph rule\n if (!ok) throw new Error(\"none of the block rules matched\");\n // set state.tight if we had an empty line before current tag\n // i.e. latest empty line should not count\n state.tight = !hasEmptyLines;\n // paragraph might \"eat\" one newline after it in nested lists\n if (state.isEmpty(state.line - 1)) {\n hasEmptyLines = true;\n }\n line = state.line;\n if (line < endLine && state.isEmpty(line)) {\n hasEmptyLines = true;\n line++;\n state.line = line;\n }\n }\n };\n /**\n * ParserBlock.parse(str, md, env, outTokens)\n *\n * Process input string and push block tokens into `outTokens`\n **/ ParserBlock.prototype.parse = function(src, md, env, outTokens) {\n if (!src) {\n return;\n }\n const state = new this.State(src, md, env, outTokens);\n this.tokenize(state, state.line, state.lineMax);\n };\n ParserBlock.prototype.State = StateBlock;\n // Inline parser state\n function StateInline(src, md, env, outTokens) {\n this.src = src;\n this.env = env;\n this.md = md;\n this.tokens = outTokens;\n this.tokens_meta = Array(outTokens.length);\n this.pos = 0;\n this.posMax = this.src.length;\n this.level = 0;\n this.pending = \"\";\n this.pendingLevel = 0;\n // Stores { start: end } pairs. Useful for backtrack\n // optimization of pairs parse (emphasis, strikes).\n this.cache = {};\n // List of emphasis-like delimiters for current tag\n this.delimiters = [];\n // Stack of delimiter lists for upper level tags\n this._prev_delimiters = [];\n // backtick length => last seen position\n this.backticks = {};\n this.backticksScanned = false;\n // Counter used to disable inline linkify-it execution\n // inside and markdown links\n this.linkLevel = 0;\n }\n // Flush pending text\n\n StateInline.prototype.pushPending = function() {\n const token = new Token(\"text\", \"\", 0);\n token.content = this.pending;\n token.level = this.pendingLevel;\n this.tokens.push(token);\n this.pending = \"\";\n return token;\n };\n // Push new token to \"stream\".\n // If pending text exists - flush it as text token\n\n StateInline.prototype.push = function(type, tag, nesting) {\n if (this.pending) {\n this.pushPending();\n }\n const token = new Token(type, tag, nesting);\n let token_meta = null;\n if (nesting < 0) {\n // closing tag\n this.level--;\n this.delimiters = this._prev_delimiters.pop();\n }\n token.level = this.level;\n if (nesting > 0) {\n // opening tag\n this.level++;\n this._prev_delimiters.push(this.delimiters);\n this.delimiters = [];\n token_meta = {\n delimiters: this.delimiters\n };\n }\n this.pendingLevel = this.level;\n this.tokens.push(token);\n this.tokens_meta.push(token_meta);\n return token;\n };\n // Scan a sequence of emphasis-like markers, and determine whether\n // it can start an emphasis sequence or end an emphasis sequence.\n\n // - start - position to scan from (it should point at a valid marker);\n // - canSplitWord - determine if these markers can be found inside a word\n\n StateInline.prototype.scanDelims = function(start, canSplitWord) {\n const max = this.posMax;\n const marker = this.src.charCodeAt(start);\n // treat beginning of the line as a whitespace\n const lastChar = start > 0 ? this.src.charCodeAt(start - 1) : 32;\n let pos = start;\n while (pos < max && this.src.charCodeAt(pos) === marker) {\n pos++;\n }\n const count = pos - start;\n // treat end of the line as a whitespace\n const nextChar = pos < max ? this.src.charCodeAt(pos) : 32;\n const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctChar(String.fromCharCode(lastChar));\n const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctChar(String.fromCharCode(nextChar));\n const isLastWhiteSpace = isWhiteSpace(lastChar);\n const isNextWhiteSpace = isWhiteSpace(nextChar);\n const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);\n const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar);\n const can_open = left_flanking && (canSplitWord || !right_flanking || isLastPunctChar);\n const can_close = right_flanking && (canSplitWord || !left_flanking || isNextPunctChar);\n return {\n can_open: can_open,\n can_close: can_close,\n length: count\n };\n };\n // re-export Token class to use in block rules\n StateInline.prototype.Token = Token;\n // Skip text characters for text token, place those to pending buffer\n // and increment current pos\n // Rule to skip pure text\n // '{}$%@~+=:' reserved for extentions\n // !, \", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @, [, \\, ], ^, _, `, {, |, }, or ~\n // !!!! Don't confuse with \"Markdown ASCII Punctuation\" chars\n // http://spec.commonmark.org/0.15/#ascii-punctuation-character\n function isTerminatorChar(ch) {\n switch (ch) {\n case 10 /* \\n */ :\n case 33 /* ! */ :\n case 35 /* # */ :\n case 36 /* $ */ :\n case 37 /* % */ :\n case 38 /* & */ :\n case 42 /* * */ :\n case 43 /* + */ :\n case 45 /* - */ :\n case 58 /* : */ :\n case 60 /* < */ :\n case 61 /* = */ :\n case 62 /* > */ :\n case 64 /* @ */ :\n case 91 /* [ */ :\n case 92 /* \\ */ :\n case 93 /* ] */ :\n case 94 /* ^ */ :\n case 95 /* _ */ :\n case 96 /* ` */ :\n case 123 /* { */ :\n case 125 /* } */ :\n case 126 /* ~ */ :\n return true;\n\n default:\n return false;\n }\n }\n function text(state, silent) {\n let pos = state.pos;\n while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) {\n pos++;\n }\n if (pos === state.pos) {\n return false;\n }\n if (!silent) {\n state.pending += state.src.slice(state.pos, pos);\n }\n state.pos = pos;\n return true;\n }\n // Alternative implementation, for memory.\n\n // It costs 10% of performance, but allows extend terminators list, if place it\n // to `ParserInline` property. Probably, will switch to it sometime, such\n // flexibility required.\n /*\n var TERMINATOR_RE = /[\\n!#$%&*+\\-:<=>@[\\\\\\]^_`{}~]/;\n\n module.exports = function text(state, silent) {\n var pos = state.pos,\n idx = state.src.slice(pos).search(TERMINATOR_RE);\n\n // first char is terminator -> empty text\n if (idx === 0) { return false; }\n\n // no terminator -> text till end of string\n if (idx < 0) {\n if (!silent) { state.pending += state.src.slice(pos); }\n state.pos = state.src.length;\n return true;\n }\n\n if (!silent) { state.pending += state.src.slice(pos, pos + idx); }\n\n state.pos += idx;\n\n return true;\n }; */\n // Process links like https://example.org/\n // RFC3986: scheme = ALPHA *( ALPHA / DIGIT / \"+\" / \"-\" / \".\" )\n const SCHEME_RE = /(?:^|[^a-z0-9.+-])([a-z][a-z0-9.+-]*)$/i;\n function linkify(state, silent) {\n if (!state.md.options.linkify) return false;\n if (state.linkLevel > 0) return false;\n const pos = state.pos;\n const max = state.posMax;\n if (pos + 3 > max) return false;\n if (state.src.charCodeAt(pos) !== 58 /* : */) return false;\n if (state.src.charCodeAt(pos + 1) !== 47 /* / */) return false;\n if (state.src.charCodeAt(pos + 2) !== 47 /* / */) return false;\n const match = state.pending.match(SCHEME_RE);\n if (!match) return false;\n const proto = match[1];\n const link = state.md.linkify.matchAtStart(state.src.slice(pos - proto.length));\n if (!link) return false;\n let url = link.url;\n // invalid link, but still detected by linkify somehow;\n // need to check to prevent infinite loop below\n if (url.length <= proto.length) return false;\n // disallow '*' at the end of the link (conflicts with emphasis)\n // do manual backsearch to avoid perf issues with regex /\\*+$/ on \"****...****a\".\n let urlEnd = url.length;\n while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 42 /* * */) {\n urlEnd--;\n }\n if (urlEnd !== url.length) {\n url = url.slice(0, urlEnd);\n }\n const fullUrl = state.md.normalizeLink(url);\n if (!state.md.validateLink(fullUrl)) return false;\n if (!silent) {\n state.pending = state.pending.slice(0, -proto.length);\n const token_o = state.push(\"link_open\", \"a\", 1);\n token_o.attrs = [ [ \"href\", fullUrl ] ];\n token_o.markup = \"linkify\";\n token_o.info = \"auto\";\n const token_t = state.push(\"text\", \"\", 0);\n token_t.content = state.md.normalizeLinkText(url);\n const token_c = state.push(\"link_close\", \"a\", -1);\n token_c.markup = \"linkify\";\n token_c.info = \"auto\";\n }\n state.pos += url.length - proto.length;\n return true;\n }\n // Proceess '\\n'\n function newline(state, silent) {\n let pos = state.pos;\n if (state.src.charCodeAt(pos) !== 10 /* \\n */) {\n return false;\n }\n const pmax = state.pending.length - 1;\n const max = state.posMax;\n // ' \\n' -> hardbreak\n // Lookup in pending chars is bad practice! Don't copy to other rules!\n // Pending string is stored in concat mode, indexed lookups will cause\n // convertion to flat mode.\n if (!silent) {\n if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) {\n if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {\n // Find whitespaces tail of pending chars.\n let ws = pmax - 1;\n while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32) ws--;\n state.pending = state.pending.slice(0, ws);\n state.push(\"hardbreak\", \"br\", 0);\n } else {\n state.pending = state.pending.slice(0, -1);\n state.push(\"softbreak\", \"br\", 0);\n }\n } else {\n state.push(\"softbreak\", \"br\", 0);\n }\n }\n pos++;\n // skip heading spaces for next line\n while (pos < max && isSpace(state.src.charCodeAt(pos))) {\n pos++;\n }\n state.pos = pos;\n return true;\n }\n // Process escaped chars and hardbreaks\n const ESCAPED = [];\n for (let i = 0; i < 256; i++) {\n ESCAPED.push(0);\n }\n \"\\\\!\\\"#$%&'()*+,./:;<=>?@[]^_`{|}~-\".split(\"\").forEach(function(ch) {\n ESCAPED[ch.charCodeAt(0)] = 1;\n });\n function escape(state, silent) {\n let pos = state.pos;\n const max = state.posMax;\n if (state.src.charCodeAt(pos) !== 92 /* \\ */) return false;\n pos++;\n // '\\' at the end of the inline block\n if (pos >= max) return false;\n let ch1 = state.src.charCodeAt(pos);\n if (ch1 === 10) {\n if (!silent) {\n state.push(\"hardbreak\", \"br\", 0);\n }\n pos++;\n // skip leading whitespaces from next line\n while (pos < max) {\n ch1 = state.src.charCodeAt(pos);\n if (!isSpace(ch1)) break;\n pos++;\n }\n state.pos = pos;\n return true;\n }\n let escapedStr = state.src[pos];\n if (ch1 >= 55296 && ch1 <= 56319 && pos + 1 < max) {\n const ch2 = state.src.charCodeAt(pos + 1);\n if (ch2 >= 56320 && ch2 <= 57343) {\n escapedStr += state.src[pos + 1];\n pos++;\n }\n }\n const origStr = \"\\\\\" + escapedStr;\n if (!silent) {\n const token = state.push(\"text_special\", \"\", 0);\n if (ch1 < 256 && ESCAPED[ch1] !== 0) {\n token.content = escapedStr;\n } else {\n token.content = origStr;\n }\n token.markup = origStr;\n token.info = \"escape\";\n }\n state.pos = pos + 1;\n return true;\n }\n // Parse backticks\n function backtick(state, silent) {\n let pos = state.pos;\n const ch = state.src.charCodeAt(pos);\n if (ch !== 96 /* ` */) {\n return false;\n }\n const start = pos;\n pos++;\n const max = state.posMax;\n // scan marker length\n while (pos < max && state.src.charCodeAt(pos) === 96 /* ` */) {\n pos++;\n }\n const marker = state.src.slice(start, pos);\n const openerLength = marker.length;\n if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {\n if (!silent) state.pending += marker;\n state.pos += openerLength;\n return true;\n }\n let matchEnd = pos;\n let matchStart;\n // Nothing found in the cache, scan until the end of the line (or until marker is found)\n while ((matchStart = state.src.indexOf(\"`\", matchEnd)) !== -1) {\n matchEnd = matchStart + 1;\n // scan marker length\n while (matchEnd < max && state.src.charCodeAt(matchEnd) === 96 /* ` */) {\n matchEnd++;\n }\n const closerLength = matchEnd - matchStart;\n if (closerLength === openerLength) {\n // Found matching closer length.\n if (!silent) {\n const token = state.push(\"code_inline\", \"code\", 0);\n token.markup = marker;\n token.content = state.src.slice(pos, matchStart).replace(/\\n/g, \" \").replace(/^ (.+) $/, \"$1\");\n }\n state.pos = matchEnd;\n return true;\n }\n // Some different length found, put it in cache as upper limit of where closer can be found\n state.backticks[closerLength] = matchStart;\n }\n // Scanned through the end, didn't find anything\n state.backticksScanned = true;\n if (!silent) state.pending += marker;\n state.pos += openerLength;\n return true;\n }\n // ~~strike through~~\n\n // Insert each marker as a separate text token, and add it to delimiter list\n\n function strikethrough_tokenize(state, silent) {\n const start = state.pos;\n const marker = state.src.charCodeAt(start);\n if (silent) {\n return false;\n }\n if (marker !== 126 /* ~ */) {\n return false;\n }\n const scanned = state.scanDelims(state.pos, true);\n let len = scanned.length;\n const ch = String.fromCharCode(marker);\n if (len < 2) {\n return false;\n }\n let token;\n if (len % 2) {\n token = state.push(\"text\", \"\", 0);\n token.content = ch;\n len--;\n }\n for (let i = 0; i < len; i += 2) {\n token = state.push(\"text\", \"\", 0);\n token.content = ch + ch;\n state.delimiters.push({\n marker: marker,\n length: 0,\n // disable \"rule of 3\" length checks meant for emphasis\n token: state.tokens.length - 1,\n end: -1,\n open: scanned.can_open,\n close: scanned.can_close\n });\n }\n state.pos += scanned.length;\n return true;\n }\n function postProcess$1(state, delimiters) {\n let token;\n const loneMarkers = [];\n const max = delimiters.length;\n for (let i = 0; i < max; i++) {\n const startDelim = delimiters[i];\n if (startDelim.marker !== 126 /* ~ */) {\n continue;\n }\n if (startDelim.end === -1) {\n continue;\n }\n const endDelim = delimiters[startDelim.end];\n token = state.tokens[startDelim.token];\n token.type = \"s_open\";\n token.tag = \"s\";\n token.nesting = 1;\n token.markup = \"~~\";\n token.content = \"\";\n token = state.tokens[endDelim.token];\n token.type = \"s_close\";\n token.tag = \"s\";\n token.nesting = -1;\n token.markup = \"~~\";\n token.content = \"\";\n if (state.tokens[endDelim.token - 1].type === \"text\" && state.tokens[endDelim.token - 1].content === \"~\") {\n loneMarkers.push(endDelim.token - 1);\n }\n }\n // If a marker sequence has an odd number of characters, it's splitted\n // like this: `~~~~~` -> `~` + `~~` + `~~`, leaving one marker at the\n // start of the sequence.\n\n // So, we have to move all those markers after subsequent s_close tags.\n\n while (loneMarkers.length) {\n const i = loneMarkers.pop();\n let j = i + 1;\n while (j < state.tokens.length && state.tokens[j].type === \"s_close\") {\n j++;\n }\n j--;\n if (i !== j) {\n token = state.tokens[j];\n state.tokens[j] = state.tokens[i];\n state.tokens[i] = token;\n }\n }\n }\n // Walk through delimiter list and replace text tokens with tags\n\n function strikethrough_postProcess(state) {\n const tokens_meta = state.tokens_meta;\n const max = state.tokens_meta.length;\n postProcess$1(state, state.delimiters);\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n postProcess$1(state, tokens_meta[curr].delimiters);\n }\n }\n }\n var r_strikethrough = {\n tokenize: strikethrough_tokenize,\n postProcess: strikethrough_postProcess\n };\n // Process *this* and _that_\n\n // Insert each marker as a separate text token, and add it to delimiter list\n\n function emphasis_tokenize(state, silent) {\n const start = state.pos;\n const marker = state.src.charCodeAt(start);\n if (silent) {\n return false;\n }\n if (marker !== 95 /* _ */ && marker !== 42 /* * */) {\n return false;\n }\n const scanned = state.scanDelims(state.pos, marker === 42);\n for (let i = 0; i < scanned.length; i++) {\n const token = state.push(\"text\", \"\", 0);\n token.content = String.fromCharCode(marker);\n state.delimiters.push({\n // Char code of the starting marker (number).\n marker: marker,\n // Total length of these series of delimiters.\n length: scanned.length,\n // A position of the token this delimiter corresponds to.\n token: state.tokens.length - 1,\n // If this delimiter is matched as a valid opener, `end` will be\n // equal to its position, otherwise it's `-1`.\n end: -1,\n // Boolean flags that determine if this delimiter could open or close\n // an emphasis.\n open: scanned.can_open,\n close: scanned.can_close\n });\n }\n state.pos += scanned.length;\n return true;\n }\n function postProcess(state, delimiters) {\n const max = delimiters.length;\n for (let i = max - 1; i >= 0; i--) {\n const startDelim = delimiters[i];\n if (startDelim.marker !== 95 /* _ */ && startDelim.marker !== 42 /* * */) {\n continue;\n }\n // Process only opening markers\n if (startDelim.end === -1) {\n continue;\n }\n const endDelim = delimiters[startDelim.end];\n // If the previous delimiter has the same marker and is adjacent to this one,\n // merge those into one strong delimiter.\n\n // `whatever` -> `whatever`\n\n const isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 &&\n // check that first two markers match and adjacent\n delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 &&\n // check that last two markers are adjacent (we can safely assume they match)\n delimiters[startDelim.end + 1].token === endDelim.token + 1;\n const ch = String.fromCharCode(startDelim.marker);\n const token_o = state.tokens[startDelim.token];\n token_o.type = isStrong ? \"strong_open\" : \"em_open\";\n token_o.tag = isStrong ? \"strong\" : \"em\";\n token_o.nesting = 1;\n token_o.markup = isStrong ? ch + ch : ch;\n token_o.content = \"\";\n const token_c = state.tokens[endDelim.token];\n token_c.type = isStrong ? \"strong_close\" : \"em_close\";\n token_c.tag = isStrong ? \"strong\" : \"em\";\n token_c.nesting = -1;\n token_c.markup = isStrong ? ch + ch : ch;\n token_c.content = \"\";\n if (isStrong) {\n state.tokens[delimiters[i - 1].token].content = \"\";\n state.tokens[delimiters[startDelim.end + 1].token].content = \"\";\n i--;\n }\n }\n }\n // Walk through delimiter list and replace text tokens with tags\n\n function emphasis_post_process(state) {\n const tokens_meta = state.tokens_meta;\n const max = state.tokens_meta.length;\n postProcess(state, state.delimiters);\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n postProcess(state, tokens_meta[curr].delimiters);\n }\n }\n }\n var r_emphasis = {\n tokenize: emphasis_tokenize,\n postProcess: emphasis_post_process\n };\n // Process [link]( \"stuff\")\n function link(state, silent) {\n let code, label, res, ref;\n let href = \"\";\n let title = \"\";\n let start = state.pos;\n let parseReference = true;\n if (state.src.charCodeAt(state.pos) !== 91 /* [ */) {\n return false;\n }\n const oldPos = state.pos;\n const max = state.posMax;\n const labelStart = state.pos + 1;\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) {\n return false;\n }\n let pos = labelEnd + 1;\n if (pos < max && state.src.charCodeAt(pos) === 40 /* ( */) {\n // Inline link\n // might have found a valid shortcut link, disable reference parsing\n parseReference = false;\n // [link]( \"title\" )\n // ^^ skipping these spaces\n pos++;\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n if (pos >= max) {\n return false;\n }\n // [link]( \"title\" )\n // ^^^^^^ parsing link destination\n start = pos;\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);\n if (res.ok) {\n href = state.md.normalizeLink(res.str);\n if (state.md.validateLink(href)) {\n pos = res.pos;\n } else {\n href = \"\";\n }\n // [link]( \"title\" )\n // ^^ skipping these spaces\n start = pos;\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n // [link]( \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);\n if (pos < max && start !== pos && res.ok) {\n title = res.str;\n pos = res.pos;\n // [link]( \"title\" )\n // ^^ skipping these spaces\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n }\n }\n if (pos >= max || state.src.charCodeAt(pos) !== 41 /* ) */) {\n // parsing a valid shortcut link failed, fallback to reference\n parseReference = true;\n }\n pos++;\n }\n if (parseReference) {\n // Link reference\n if (typeof state.env.references === \"undefined\") {\n return false;\n }\n if (pos < max && state.src.charCodeAt(pos) === 91 /* [ */) {\n start = pos + 1;\n pos = state.md.helpers.parseLinkLabel(state, pos);\n if (pos >= 0) {\n label = state.src.slice(start, pos++);\n } else {\n pos = labelEnd + 1;\n }\n } else {\n pos = labelEnd + 1;\n }\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) {\n label = state.src.slice(labelStart, labelEnd);\n }\n ref = state.env.references[normalizeReference(label)];\n if (!ref) {\n state.pos = oldPos;\n return false;\n }\n href = ref.href;\n title = ref.title;\n }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n\n if (!silent) {\n state.pos = labelStart;\n state.posMax = labelEnd;\n const token_o = state.push(\"link_open\", \"a\", 1);\n const attrs = [ [ \"href\", href ] ];\n token_o.attrs = attrs;\n if (title) {\n attrs.push([ \"title\", title ]);\n }\n state.linkLevel++;\n state.md.inline.tokenize(state);\n state.linkLevel--;\n state.push(\"link_close\", \"a\", -1);\n }\n state.pos = pos;\n state.posMax = max;\n return true;\n }\n // Process ![image]( \"title\")\n function image(state, silent) {\n let code, content, label, pos, ref, res, title, start;\n let href = \"\";\n const oldPos = state.pos;\n const max = state.posMax;\n if (state.src.charCodeAt(state.pos) !== 33 /* ! */) {\n return false;\n }\n if (state.src.charCodeAt(state.pos + 1) !== 91 /* [ */) {\n return false;\n }\n const labelStart = state.pos + 2;\n const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);\n // parser failed to find ']', so it's not a valid link\n if (labelEnd < 0) {\n return false;\n }\n pos = labelEnd + 1;\n if (pos < max && state.src.charCodeAt(pos) === 40 /* ( */) {\n // Inline link\n // [link]( \"title\" )\n // ^^ skipping these spaces\n pos++;\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n if (pos >= max) {\n return false;\n }\n // [link]( \"title\" )\n // ^^^^^^ parsing link destination\n start = pos;\n res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);\n if (res.ok) {\n href = state.md.normalizeLink(res.str);\n if (state.md.validateLink(href)) {\n pos = res.pos;\n } else {\n href = \"\";\n }\n }\n // [link]( \"title\" )\n // ^^ skipping these spaces\n start = pos;\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n // [link]( \"title\" )\n // ^^^^^^^ parsing link title\n res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);\n if (pos < max && start !== pos && res.ok) {\n title = res.str;\n pos = res.pos;\n // [link]( \"title\" )\n // ^^ skipping these spaces\n for (;pos < max; pos++) {\n code = state.src.charCodeAt(pos);\n if (!isSpace(code) && code !== 10) {\n break;\n }\n }\n } else {\n title = \"\";\n }\n if (pos >= max || state.src.charCodeAt(pos) !== 41 /* ) */) {\n state.pos = oldPos;\n return false;\n }\n pos++;\n } else {\n // Link reference\n if (typeof state.env.references === \"undefined\") {\n return false;\n }\n if (pos < max && state.src.charCodeAt(pos) === 91 /* [ */) {\n start = pos + 1;\n pos = state.md.helpers.parseLinkLabel(state, pos);\n if (pos >= 0) {\n label = state.src.slice(start, pos++);\n } else {\n pos = labelEnd + 1;\n }\n } else {\n pos = labelEnd + 1;\n }\n // covers label === '' and label === undefined\n // (collapsed reference link and shortcut reference link respectively)\n if (!label) {\n label = state.src.slice(labelStart, labelEnd);\n }\n ref = state.env.references[normalizeReference(label)];\n if (!ref) {\n state.pos = oldPos;\n return false;\n }\n href = ref.href;\n title = ref.title;\n }\n\n // We found the end of the link, and know for a fact it's a valid link;\n // so all that's left to do is to call tokenizer.\n\n if (!silent) {\n content = state.src.slice(labelStart, labelEnd);\n const tokens = [];\n state.md.inline.parse(content, state.md, state.env, tokens);\n const token = state.push(\"image\", \"img\", 0);\n const attrs = [ [ \"src\", href ], [ \"alt\", \"\" ] ];\n token.attrs = attrs;\n token.children = tokens;\n token.content = content;\n if (title) {\n attrs.push([ \"title\", title ]);\n }\n }\n state.pos = pos;\n state.posMax = max;\n return true;\n }\n // Process autolinks ''\n /* eslint max-len:0 */ const EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/;\n /* eslint-disable-next-line no-control-regex */ const AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\\x00-\\x20]*)$/;\n function autolink(state, silent) {\n let pos = state.pos;\n if (state.src.charCodeAt(pos) !== 60 /* < */) {\n return false;\n }\n const start = state.pos;\n const max = state.posMax;\n for (;;) {\n if (++pos >= max) return false;\n const ch = state.src.charCodeAt(pos);\n if (ch === 60 /* < */) return false;\n if (ch === 62 /* > */) break;\n }\n const url = state.src.slice(start + 1, pos);\n if (AUTOLINK_RE.test(url)) {\n const fullUrl = state.md.normalizeLink(url);\n if (!state.md.validateLink(fullUrl)) {\n return false;\n }\n if (!silent) {\n const token_o = state.push(\"link_open\", \"a\", 1);\n token_o.attrs = [ [ \"href\", fullUrl ] ];\n token_o.markup = \"autolink\";\n token_o.info = \"auto\";\n const token_t = state.push(\"text\", \"\", 0);\n token_t.content = state.md.normalizeLinkText(url);\n const token_c = state.push(\"link_close\", \"a\", -1);\n token_c.markup = \"autolink\";\n token_c.info = \"auto\";\n }\n state.pos += url.length + 2;\n return true;\n }\n if (EMAIL_RE.test(url)) {\n const fullUrl = state.md.normalizeLink(\"mailto:\" + url);\n if (!state.md.validateLink(fullUrl)) {\n return false;\n }\n if (!silent) {\n const token_o = state.push(\"link_open\", \"a\", 1);\n token_o.attrs = [ [ \"href\", fullUrl ] ];\n token_o.markup = \"autolink\";\n token_o.info = \"auto\";\n const token_t = state.push(\"text\", \"\", 0);\n token_t.content = state.md.normalizeLinkText(url);\n const token_c = state.push(\"link_close\", \"a\", -1);\n token_c.markup = \"autolink\";\n token_c.info = \"auto\";\n }\n state.pos += url.length + 2;\n return true;\n }\n return false;\n }\n // Process html tags\n function isLinkOpen(str) {\n return /^\\s]/i.test(str);\n }\n function isLinkClose(str) {\n return /^<\\/a\\s*>/i.test(str);\n }\n function isLetter(ch) {\n /* eslint no-bitwise:0 */\n const lc = ch | 32;\n // to lower case\n return lc >= 97 /* a */ && lc <= 122 /* z */;\n }\n function html_inline(state, silent) {\n if (!state.md.options.html) {\n return false;\n }\n // Check start\n const max = state.posMax;\n const pos = state.pos;\n if (state.src.charCodeAt(pos) !== 60 /* < */ || pos + 2 >= max) {\n return false;\n }\n // Quick fail on second char\n const ch = state.src.charCodeAt(pos + 1);\n if (ch !== 33 /* ! */ && ch !== 63 /* ? */ && ch !== 47 /* / */ && !isLetter(ch)) {\n return false;\n }\n const match = state.src.slice(pos).match(HTML_TAG_RE);\n if (!match) {\n return false;\n }\n if (!silent) {\n const token = state.push(\"html_inline\", \"\", 0);\n token.content = match[0];\n if (isLinkOpen(token.content)) state.linkLevel++;\n if (isLinkClose(token.content)) state.linkLevel--;\n }\n state.pos += match[0].length;\n return true;\n }\n // Process html entity - {, ¯, ", ...\n const DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;\n const NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;\n function entity(state, silent) {\n const pos = state.pos;\n const max = state.posMax;\n if (state.src.charCodeAt(pos) !== 38 /* & */) return false;\n if (pos + 1 >= max) return false;\n const ch = state.src.charCodeAt(pos + 1);\n if (ch === 35 /* # */) {\n const match = state.src.slice(pos).match(DIGITAL_RE);\n if (match) {\n if (!silent) {\n const code = match[1][0].toLowerCase() === \"x\" ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);\n const token = state.push(\"text_special\", \"\", 0);\n token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(65533);\n token.markup = match[0];\n token.info = \"entity\";\n }\n state.pos += match[0].length;\n return true;\n }\n } else {\n const match = state.src.slice(pos).match(NAMED_RE);\n if (match) {\n const decoded = decodeHTML(match[0]);\n if (decoded !== match[0]) {\n if (!silent) {\n const token = state.push(\"text_special\", \"\", 0);\n token.content = decoded;\n token.markup = match[0];\n token.info = \"entity\";\n }\n state.pos += match[0].length;\n return true;\n }\n }\n }\n return false;\n }\n // For each opening emphasis-like marker find a matching closing one\n\n function processDelimiters(delimiters) {\n const openersBottom = {};\n const max = delimiters.length;\n if (!max) return;\n // headerIdx is the first delimiter of the current (where closer is) delimiter run\n let headerIdx = 0;\n let lastTokenIdx = -2;\n // needs any value lower than -1\n const jumps = [];\n for (let closerIdx = 0; closerIdx < max; closerIdx++) {\n const closer = delimiters[closerIdx];\n jumps.push(0);\n // markers belong to same delimiter run if:\n // - they have adjacent tokens\n // - AND markers are the same\n\n if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {\n headerIdx = closerIdx;\n }\n lastTokenIdx = closer.token;\n // Length is only used for emphasis-specific \"rule of 3\",\n // if it's not defined (in strikethrough or 3rd party plugins),\n // we can default it to 0 to disable those checks.\n\n closer.length = closer.length || 0;\n if (!closer.close) continue;\n // Previously calculated lower bounds (previous fails)\n // for each marker, each delimiter length modulo 3,\n // and for whether this closer can be an opener;\n // https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460\n /* eslint-disable-next-line no-prototype-builtins */ if (!openersBottom.hasOwnProperty(closer.marker)) {\n openersBottom[closer.marker] = [ -1, -1, -1, -1, -1, -1 ];\n }\n const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3];\n let openerIdx = headerIdx - jumps[headerIdx] - 1;\n let newMinOpenerIdx = openerIdx;\n for (;openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {\n const opener = delimiters[openerIdx];\n if (opener.marker !== closer.marker) continue;\n if (opener.open && opener.end < 0) {\n let isOddMatch = false;\n // from spec:\n\n // If one of the delimiters can both open and close emphasis, then the\n // sum of the lengths of the delimiter runs containing the opening and\n // closing delimiters must not be a multiple of 3 unless both lengths\n // are multiples of 3.\n\n if (opener.close || closer.open) {\n if ((opener.length + closer.length) % 3 === 0) {\n if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {\n isOddMatch = true;\n }\n }\n }\n if (!isOddMatch) {\n // If previous delimiter cannot be an opener, we can safely skip\n // the entire sequence in future checks. This is required to make\n // sure algorithm has linear complexity (see *_*_*_*_*_... case).\n const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0;\n jumps[closerIdx] = closerIdx - openerIdx + lastJump;\n jumps[openerIdx] = lastJump;\n closer.open = false;\n opener.end = closerIdx;\n opener.close = false;\n newMinOpenerIdx = -1;\n // treat next token as start of run,\n // it optimizes skips in **<...>**a**<...>** pathological case\n lastTokenIdx = -2;\n break;\n }\n }\n }\n if (newMinOpenerIdx !== -1) {\n // If match for this delimiter run failed, we want to set lower bound for\n // future lookups. This is required to make sure algorithm has linear\n // complexity.\n // See details here:\n // https://github.com/commonmark/cmark/issues/178#issuecomment-270417442\n openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx;\n }\n }\n }\n function link_pairs(state) {\n const tokens_meta = state.tokens_meta;\n const max = state.tokens_meta.length;\n processDelimiters(state.delimiters);\n for (let curr = 0; curr < max; curr++) {\n if (tokens_meta[curr] && tokens_meta[curr].delimiters) {\n processDelimiters(tokens_meta[curr].delimiters);\n }\n }\n }\n // Clean up tokens after emphasis and strikethrough postprocessing:\n // merge adjacent text nodes into one and re-calculate all token levels\n\n // This is necessary because initially emphasis delimiter markers (*, _, ~)\n // are treated as their own separate text tokens. Then emphasis rule either\n // leaves them as text (needed to merge with adjacent text) or turns them\n // into opening/closing tags (which messes up levels inside).\n\n function fragments_join(state) {\n let curr, last;\n let level = 0;\n const tokens = state.tokens;\n const max = state.tokens.length;\n for (curr = last = 0; curr < max; curr++) {\n // re-calculate levels after emphasis/strikethrough turns some text nodes\n // into opening/closing tags\n if (tokens[curr].nesting < 0) level--;\n // closing tag\n tokens[curr].level = level;\n if (tokens[curr].nesting > 0) level++;\n // opening tag\n if (tokens[curr].type === \"text\" && curr + 1 < max && tokens[curr + 1].type === \"text\") {\n // collapse two adjacent text nodes\n tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;\n } else {\n if (curr !== last) {\n tokens[last] = tokens[curr];\n }\n last++;\n }\n }\n if (curr !== last) {\n tokens.length = last;\n }\n }\n /** internal\n * class ParserInline\n *\n * Tokenizes paragraph content.\n **/\n // Parser rules\n const _rules = [ [ \"text\", text ], [ \"linkify\", linkify ], [ \"newline\", newline ], [ \"escape\", escape ], [ \"backticks\", backtick ], [ \"strikethrough\", r_strikethrough.tokenize ], [ \"emphasis\", r_emphasis.tokenize ], [ \"link\", link ], [ \"image\", image ], [ \"autolink\", autolink ], [ \"html_inline\", html_inline ], [ \"entity\", entity ] ];\n // `rule2` ruleset was created specifically for emphasis/strikethrough\n // post-processing and may be changed in the future.\n\n // Don't use this for anything except pairs (plugins working with `balance_pairs`).\n\n const _rules2 = [ [ \"balance_pairs\", link_pairs ], [ \"strikethrough\", r_strikethrough.postProcess ], [ \"emphasis\", r_emphasis.postProcess ],\n // rules for pairs separate '**' into its own text tokens, which may be left unused,\n // rule below merges unused segments back with the rest of the text\n [ \"fragments_join\", fragments_join ] ];\n /**\n * new ParserInline()\n **/ function ParserInline() {\n /**\n * ParserInline#ruler -> Ruler\n *\n * [[Ruler]] instance. Keep configuration of inline rules.\n **/\n this.ruler = new Ruler;\n for (let i = 0; i < _rules.length; i++) {\n this.ruler.push(_rules[i][0], _rules[i][1]);\n }\n /**\n * ParserInline#ruler2 -> Ruler\n *\n * [[Ruler]] instance. Second ruler used for post-processing\n * (e.g. in emphasis-like rules).\n **/ this.ruler2 = new Ruler;\n for (let i = 0; i < _rules2.length; i++) {\n this.ruler2.push(_rules2[i][0], _rules2[i][1]);\n }\n }\n // Skip single token by running all rules in validation mode;\n // returns `true` if any rule reported success\n\n ParserInline.prototype.skipToken = function(state) {\n const pos = state.pos;\n const rules = this.ruler.getRules(\"\");\n const len = rules.length;\n const maxNesting = state.md.options.maxNesting;\n const cache = state.cache;\n if (typeof cache[pos] !== \"undefined\") {\n state.pos = cache[pos];\n return;\n }\n let ok = false;\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n // Increment state.level and decrement it later to limit recursion.\n // It's harmless to do here, because no tokens are created. But ideally,\n // we'd need a separate private state variable for this purpose.\n state.level++;\n ok = rules[i](state, true);\n state.level--;\n if (ok) {\n if (pos >= state.pos) {\n throw new Error(\"inline rule didn't increment state.pos\");\n }\n break;\n }\n }\n } else {\n // Too much nesting, just skip until the end of the paragraph.\n // NOTE: this will cause links to behave incorrectly in the following case,\n // when an amount of `[` is exactly equal to `maxNesting + 1`:\n // [[[[[[[[[[[[[[[[[[[[[foo]()\n // TODO: remove this workaround when CM standard will allow nested links\n // (we can replace it by preventing links from being parsed in\n // validation mode)\n state.pos = state.posMax;\n }\n if (!ok) {\n state.pos++;\n }\n cache[pos] = state.pos;\n };\n // Generate tokens for input range\n\n ParserInline.prototype.tokenize = function(state) {\n const rules = this.ruler.getRules(\"\");\n const len = rules.length;\n const end = state.posMax;\n const maxNesting = state.md.options.maxNesting;\n while (state.pos < end) {\n // Try all possible rules.\n // On success, rule should:\n // - update `state.pos`\n // - update `state.tokens`\n // - return true\n const prevPos = state.pos;\n let ok = false;\n if (state.level < maxNesting) {\n for (let i = 0; i < len; i++) {\n ok = rules[i](state, false);\n if (ok) {\n if (prevPos >= state.pos) {\n throw new Error(\"inline rule didn't increment state.pos\");\n }\n break;\n }\n }\n }\n if (ok) {\n if (state.pos >= end) {\n break;\n }\n continue;\n }\n state.pending += state.src[state.pos++];\n }\n if (state.pending) {\n state.pushPending();\n }\n };\n /**\n * ParserInline.parse(str, md, env, outTokens)\n *\n * Process input string and push inline tokens into `outTokens`\n **/ ParserInline.prototype.parse = function(str, md, env, outTokens) {\n const state = new this.State(str, md, env, outTokens);\n this.tokenize(state);\n const rules = this.ruler2.getRules(\"\");\n const len = rules.length;\n for (let i = 0; i < len; i++) {\n rules[i](state);\n }\n };\n ParserInline.prototype.State = StateInline;\n function reFactory(opts) {\n const re = {};\n opts = opts || {};\n re.src_Any = Any.source;\n re.src_Cc = Cc.source;\n re.src_Z = Z.source;\n re.src_P = P.source;\n // \\p{\\Z\\P\\Cc\\CF} (white spaces + control + format + punctuation)\n re.src_ZPCc = [ re.src_Z, re.src_P, re.src_Cc ].join(\"|\");\n // \\p{\\Z\\Cc} (white spaces + control)\n re.src_ZCc = [ re.src_Z, re.src_Cc ].join(\"|\");\n // Experimental. List of chars, completely prohibited in links\n // because can separate it from other part of text\n const text_separators = \"[><\\uff5c]\";\n // All possible word characters (everything without punctuation, spaces & controls)\n // Defined via punctuation & spaces to save space\n // Should be something like \\p{\\L\\N\\S\\M} (\\w but without `_`)\n re.src_pseudo_letter = \"(?:(?!\" + text_separators + \"|\" + re.src_ZPCc + \")\" + re.src_Any + \")\";\n // The same as abothe but without [0-9]\n // var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';\n re.src_ip4 = \"(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\";\n // Prohibit any of \"@/[]()\" in user/pass to avoid wrong domain fetch.\n re.src_auth = \"(?:(?:(?!\" + re.src_ZCc + \"|[@/\\\\[\\\\]()]).)+@)?\";\n re.src_port = \"(?::(?:6(?:[0-4]\\\\d{3}|5(?:[0-4]\\\\d{2}|5(?:[0-2]\\\\d|3[0-5])))|[1-5]?\\\\d{1,4}))?\";\n re.src_host_terminator = \"(?=$|\" + text_separators + \"|\" + re.src_ZPCc + \")\" + \"(?!\" + (opts[\"---\"] ? \"-(?!--)|\" : \"-|\") + \"_|:\\\\d|\\\\.-|\\\\.(?!$|\" + re.src_ZPCc + \"))\";\n re.src_path = \"(?:\" + \"[/?#]\" + \"(?:\" + \"(?!\" + re.src_ZCc + \"|\" + text_separators + \"|[()[\\\\]{}.,\\\"'?!\\\\-;]).|\" + \"\\\\[(?:(?!\" + re.src_ZCc + \"|\\\\]).)*\\\\]|\" + \"\\\\((?:(?!\" + re.src_ZCc + \"|[)]).)*\\\\)|\" + \"\\\\{(?:(?!\" + re.src_ZCc + \"|[}]).)*\\\\}|\" + '\\\\\"(?:(?!' + re.src_ZCc + '|[\"]).)+\\\\\"|' + \"\\\\'(?:(?!\" + re.src_ZCc + \"|[']).)+\\\\'|\" +\n // allow `I'm_king` if no pair found\n \"\\\\'(?=\" + re.src_pseudo_letter + \"|[-])|\" +\n // google has many dots in \"google search\" links (#66, #81).\n // github has ... in commit range links,\n // Restrict to\n // - english\n // - percent-encoded\n // - parts of file path\n // - params separator\n // until more examples found.\n \"\\\\.{2,}[a-zA-Z0-9%/&]|\" + \"\\\\.(?!\" + re.src_ZCc + \"|[.]|$)|\" + (opts[\"---\"] ? \"\\\\-(?!--(?:[^-]|$))(?:-*)|\" : \"\\\\-+|\") +\n // allow `,,,` in paths\n \",(?!\" + re.src_ZCc + \"|$)|\" +\n // allow `;` if not followed by space-like char\n \";(?!\" + re.src_ZCc + \"|$)|\" +\n // allow `!!!` in paths, but not at the end\n \"\\\\!+(?!\" + re.src_ZCc + \"|[!]|$)|\" + \"\\\\?(?!\" + re.src_ZCc + \"|[?]|$)\" + \")+\" + \"|\\\\/\" + \")?\";\n // Allow anything in markdown spec, forbid quote (\") at the first position\n // because emails enclosed in quotes are far more common\n re.src_email_name = '[\\\\-;:&=\\\\+\\\\$,\\\\.a-zA-Z0-9_][\\\\-;:&=\\\\+\\\\$,\\\\\"\\\\.a-zA-Z0-9_]*';\n re.src_xn = \"xn--[a-z0-9\\\\-]{1,59}\";\n // More to read about domain names\n // http://serverfault.com/questions/638260/\n re.src_domain_root =\n // Allow letters & digits (http://test1)\n \"(?:\" + re.src_xn + \"|\" + re.src_pseudo_letter + \"{1,63}\" + \")\";\n re.src_domain = \"(?:\" + re.src_xn + \"|\" + \"(?:\" + re.src_pseudo_letter + \")\" + \"|\" + \"(?:\" + re.src_pseudo_letter + \"(?:-|\" + re.src_pseudo_letter + \"){0,61}\" + re.src_pseudo_letter + \")\" + \")\";\n re.src_host = \"(?:\" +\n // Don't need IP check, because digits are already allowed in normal domain names\n // src_ip4 +\n // '|' +\n \"(?:(?:(?:\" + re.src_domain + \")\\\\.)*\" + re.src_domain /* _root */ + \")\" + \")\";\n re.tpl_host_fuzzy = \"(?:\" + re.src_ip4 + \"|\" + \"(?:(?:(?:\" + re.src_domain + \")\\\\.)+(?:%TLDS%))\" + \")\";\n re.tpl_host_no_ip_fuzzy = \"(?:(?:(?:\" + re.src_domain + \")\\\\.)+(?:%TLDS%))\";\n re.src_host_strict = re.src_host + re.src_host_terminator;\n re.tpl_host_fuzzy_strict = re.tpl_host_fuzzy + re.src_host_terminator;\n re.src_host_port_strict = re.src_host + re.src_port + re.src_host_terminator;\n re.tpl_host_port_fuzzy_strict = re.tpl_host_fuzzy + re.src_port + re.src_host_terminator;\n re.tpl_host_port_no_ip_fuzzy_strict = re.tpl_host_no_ip_fuzzy + re.src_port + re.src_host_terminator;\n\n // Main rules\n\n // Rude test fuzzy links by host, for quick deny\n re.tpl_host_fuzzy_test = \"localhost|www\\\\.|\\\\.\\\\d{1,3}\\\\.|(?:\\\\.(?:%TLDS%)(?:\" + re.src_ZPCc + \"|>|$))\";\n re.tpl_email_fuzzy = \"(^|\" + text_separators + '|\"|\\\\(|' + re.src_ZCc + \")\" + \"(\" + re.src_email_name + \"@\" + re.tpl_host_fuzzy_strict + \")\";\n re.tpl_link_fuzzy =\n // Fuzzy link can't be prepended with .:/\\- and non punctuation.\n // but can start with > (markdown blockquote)\n \"(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\\uff5c]|\" + re.src_ZPCc + \"))\" + \"((?![$+<=>^`|\\uff5c])\" + re.tpl_host_port_fuzzy_strict + re.src_path + \")\";\n re.tpl_link_no_ip_fuzzy =\n // Fuzzy link can't be prepended with .:/\\- and non punctuation.\n // but can start with > (markdown blockquote)\n \"(^|(?![.:/\\\\-_@])(?:[$+<=>^`|\\uff5c]|\" + re.src_ZPCc + \"))\" + \"((?![$+<=>^`|\\uff5c])\" + re.tpl_host_port_no_ip_fuzzy_strict + re.src_path + \")\";\n return re;\n }\n\n // Helpers\n\n // Merge objects\n\n function assign(obj /* from1, from2, from3, ... */) {\n const sources = Array.prototype.slice.call(arguments, 1);\n sources.forEach(function(source) {\n if (!source) {\n return;\n }\n Object.keys(source).forEach(function(key) {\n obj[key] = source[key];\n });\n });\n return obj;\n }\n function _class(obj) {\n return Object.prototype.toString.call(obj);\n }\n function isString(obj) {\n return _class(obj) === \"[object String]\";\n }\n function isObject(obj) {\n return _class(obj) === \"[object Object]\";\n }\n function isRegExp(obj) {\n return _class(obj) === \"[object RegExp]\";\n }\n function isFunction(obj) {\n return _class(obj) === \"[object Function]\";\n }\n function escapeRE(str) {\n return str.replace(/[.?*+^$[\\]\\\\(){}|-]/g, \"\\\\$&\");\n }\n\n const defaultOptions = {\n fuzzyLink: true,\n fuzzyEmail: true,\n fuzzyIP: false\n };\n function isOptionsObj(obj) {\n return Object.keys(obj || {}).reduce(function(acc, k) {\n /* eslint-disable-next-line no-prototype-builtins */\n return acc || defaultOptions.hasOwnProperty(k);\n }, false);\n }\n const defaultSchemas = {\n \"http:\": {\n validate: function(text, pos, self) {\n const tail = text.slice(pos);\n if (!self.re.http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.http = new RegExp(\"^\\\\/\\\\/\" + self.re.src_auth + self.re.src_host_port_strict + self.re.src_path, \"i\");\n }\n if (self.re.http.test(tail)) {\n return tail.match(self.re.http)[0].length;\n }\n return 0;\n }\n },\n \"https:\": \"http:\",\n \"ftp:\": \"http:\",\n \"//\": {\n validate: function(text, pos, self) {\n const tail = text.slice(pos);\n if (!self.re.no_http) {\n // compile lazily, because \"host\"-containing variables can change on tlds update.\n self.re.no_http = new RegExp(\"^\" + self.re.src_auth +\n // Don't allow single-level domains, because of false positives like '//test'\n // with code comments\n \"(?:localhost|(?:(?:\" + self.re.src_domain + \")\\\\.)+\" + self.re.src_domain_root + \")\" + self.re.src_port + self.re.src_host_terminator + self.re.src_path, \"i\");\n }\n if (self.re.no_http.test(tail)) {\n // should not be `://` & `///`, that protects from errors in protocol name\n if (pos >= 3 && text[pos - 3] === \":\") {\n return 0;\n }\n if (pos >= 3 && text[pos - 3] === \"/\") {\n return 0;\n }\n return tail.match(self.re.no_http)[0].length;\n }\n return 0;\n }\n },\n \"mailto:\": {\n validate: function(text, pos, self) {\n const tail = text.slice(pos);\n if (!self.re.mailto) {\n self.re.mailto = new RegExp(\"^\" + self.re.src_email_name + \"@\" + self.re.src_host_strict, \"i\");\n }\n if (self.re.mailto.test(tail)) {\n return tail.match(self.re.mailto)[0].length;\n }\n return 0;\n }\n }\n };\n // RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)\n /* eslint-disable-next-line max-len */ const tlds_2ch_src_re = \"a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]\";\n // DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead\n const tlds_default = \"biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\\u0440\\u0444\".split(\"|\");\n function resetScanCache(self) {\n self.__index__ = -1;\n self.__text_cache__ = \"\";\n }\n function createValidator(re) {\n return function(text, pos) {\n const tail = text.slice(pos);\n if (re.test(tail)) {\n return tail.match(re)[0].length;\n }\n return 0;\n };\n }\n function createNormalizer() {\n return function(match, self) {\n self.normalize(match);\n };\n }\n // Schemas compiler. Build regexps.\n\n function compile(self) {\n // Load & clone RE patterns.\n const re = self.re = reFactory(self.__opts__);\n // Define dynamic patterns\n const tlds = self.__tlds__.slice();\n self.onCompile();\n if (!self.__tlds_replaced__) {\n tlds.push(tlds_2ch_src_re);\n }\n tlds.push(re.src_xn);\n re.src_tlds = tlds.join(\"|\");\n function untpl(tpl) {\n return tpl.replace(\"%TLDS%\", re.src_tlds);\n }\n re.email_fuzzy = RegExp(untpl(re.tpl_email_fuzzy), \"i\");\n re.link_fuzzy = RegExp(untpl(re.tpl_link_fuzzy), \"i\");\n re.link_no_ip_fuzzy = RegExp(untpl(re.tpl_link_no_ip_fuzzy), \"i\");\n re.host_fuzzy_test = RegExp(untpl(re.tpl_host_fuzzy_test), \"i\");\n\n // Compile each schema\n\n const aliases = [];\n self.__compiled__ = {};\n // Reset compiled data\n function schemaError(name, val) {\n throw new Error('(LinkifyIt) Invalid schema \"' + name + '\": ' + val);\n }\n Object.keys(self.__schemas__).forEach(function(name) {\n const val = self.__schemas__[name];\n // skip disabled methods\n if (val === null) {\n return;\n }\n const compiled = {\n validate: null,\n link: null\n };\n self.__compiled__[name] = compiled;\n if (isObject(val)) {\n if (isRegExp(val.validate)) {\n compiled.validate = createValidator(val.validate);\n } else if (isFunction(val.validate)) {\n compiled.validate = val.validate;\n } else {\n schemaError(name, val);\n }\n if (isFunction(val.normalize)) {\n compiled.normalize = val.normalize;\n } else if (!val.normalize) {\n compiled.normalize = createNormalizer();\n } else {\n schemaError(name, val);\n }\n return;\n }\n if (isString(val)) {\n aliases.push(name);\n return;\n }\n schemaError(name, val);\n });\n\n // Compile postponed aliases\n\n aliases.forEach(function(alias) {\n if (!self.__compiled__[self.__schemas__[alias]]) {\n // Silently fail on missed schemas to avoid errons on disable.\n // schemaError(alias, self.__schemas__[alias]);\n return;\n }\n self.__compiled__[alias].validate = self.__compiled__[self.__schemas__[alias]].validate;\n self.__compiled__[alias].normalize = self.__compiled__[self.__schemas__[alias]].normalize;\n });\n\n // Fake record for guessed links\n\n self.__compiled__[\"\"] = {\n validate: null,\n normalize: createNormalizer()\n };\n\n // Build schema condition\n\n const slist = Object.keys(self.__compiled__).filter(function(name) {\n // Filter disabled & fake schemas\n return name.length > 0 && self.__compiled__[name];\n }).map(escapeRE).join(\"|\");\n // (?!_) cause 1.5x slowdown\n self.re.schema_test = RegExp(\"(^|(?!_)(?:[><\\uff5c]|\" + re.src_ZPCc + \"))(\" + slist + \")\", \"i\");\n self.re.schema_search = RegExp(\"(^|(?!_)(?:[><\\uff5c]|\" + re.src_ZPCc + \"))(\" + slist + \")\", \"ig\");\n self.re.schema_at_start = RegExp(\"^\" + self.re.schema_search.source, \"i\");\n self.re.pretest = RegExp(\"(\" + self.re.schema_test.source + \")|(\" + self.re.host_fuzzy_test.source + \")|@\", \"i\");\n\n // Cleanup\n\n resetScanCache(self);\n }\n /**\n * class Match\n *\n * Match result. Single element of array, returned by [[LinkifyIt#match]]\n **/ function Match(self, shift) {\n const start = self.__index__;\n const end = self.__last_index__;\n const text = self.__text_cache__.slice(start, end);\n /**\n * Match#schema -> String\n *\n * Prefix (protocol) for matched string.\n **/ this.schema = self.__schema__.toLowerCase();\n /**\n * Match#index -> Number\n *\n * First position of matched string.\n **/ this.index = start + shift;\n /**\n * Match#lastIndex -> Number\n *\n * Next position after matched string.\n **/ this.lastIndex = end + shift;\n /**\n * Match#raw -> String\n *\n * Matched string.\n **/ this.raw = text;\n /**\n * Match#text -> String\n *\n * Notmalized text of matched string.\n **/ this.text = text;\n /**\n * Match#url -> String\n *\n * Normalized url of matched string.\n **/ this.url = text;\n }\n function createMatch(self, shift) {\n const match = new Match(self, shift);\n self.__compiled__[match.schema].normalize(match, self);\n return match;\n }\n /**\n * class LinkifyIt\n **/\n /**\n * new LinkifyIt(schemas, options)\n * - schemas (Object): Optional. Additional schemas to validate (prefix/validator)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Creates new linkifier instance with optional additional schemas.\n * Can be called without `new` keyword for convenience.\n *\n * By default understands:\n *\n * - `http(s)://...` , `ftp://...`, `mailto:...` & `//...` links\n * - \"fuzzy\" links and emails (example.com, foo@bar.com).\n *\n * `schemas` is an object, where each key/value describes protocol/rule:\n *\n * - __key__ - link prefix (usually, protocol name with `:` at the end, `skype:`\n * for example). `linkify-it` makes shure that prefix is not preceeded with\n * alphanumeric char and symbols. Only whitespaces and punctuation allowed.\n * - __value__ - rule to check tail after link prefix\n * - _String_ - just alias to existing rule\n * - _Object_\n * - _validate_ - validator function (should return matched length on success),\n * or `RegExp`.\n * - _normalize_ - optional function to normalize text & url of matched result\n * (for example, for @twitter mentions).\n *\n * `options`:\n *\n * - __fuzzyLink__ - recognige URL-s without `http(s):` prefix. Default `true`.\n * - __fuzzyIP__ - allow IPs in fuzzy links above. Can conflict with some texts\n * like version numbers. Default `false`.\n * - __fuzzyEmail__ - recognize emails without `mailto:` prefix.\n *\n **/ function LinkifyIt(schemas, options) {\n if (!(this instanceof LinkifyIt)) {\n return new LinkifyIt(schemas, options);\n }\n if (!options) {\n if (isOptionsObj(schemas)) {\n options = schemas;\n schemas = {};\n }\n }\n this.__opts__ = assign({}, defaultOptions, options);\n // Cache last tested result. Used to skip repeating steps on next `match` call.\n this.__index__ = -1;\n this.__last_index__ = -1;\n // Next scan position\n this.__schema__ = \"\";\n this.__text_cache__ = \"\";\n this.__schemas__ = assign({}, defaultSchemas, schemas);\n this.__compiled__ = {};\n this.__tlds__ = tlds_default;\n this.__tlds_replaced__ = false;\n this.re = {};\n compile(this);\n }\n /** chainable\n * LinkifyIt#add(schema, definition)\n * - schema (String): rule name (fixed pattern prefix)\n * - definition (String|RegExp|Object): schema definition\n *\n * Add new rule definition. See constructor description for details.\n **/ LinkifyIt.prototype.add = function add(schema, definition) {\n this.__schemas__[schema] = definition;\n compile(this);\n return this;\n };\n /** chainable\n * LinkifyIt#set(options)\n * - options (Object): { fuzzyLink|fuzzyEmail|fuzzyIP: true|false }\n *\n * Set recognition options for links without schema.\n **/ LinkifyIt.prototype.set = function set(options) {\n this.__opts__ = assign(this.__opts__, options);\n return this;\n };\n /**\n * LinkifyIt#test(text) -> Boolean\n *\n * Searches linkifiable pattern and returns `true` on success or `false` on fail.\n **/ LinkifyIt.prototype.test = function test(text) {\n // Reset scan cache\n this.__text_cache__ = text;\n this.__index__ = -1;\n if (!text.length) {\n return false;\n }\n let m, ml, me, len, shift, next, re, tld_pos, at_pos;\n // try to scan for link with schema - that's the most simple rule\n if (this.re.schema_test.test(text)) {\n re = this.re.schema_search;\n re.lastIndex = 0;\n while ((m = re.exec(text)) !== null) {\n len = this.testSchemaAt(text, m[2], re.lastIndex);\n if (len) {\n this.__schema__ = m[2];\n this.__index__ = m.index + m[1].length;\n this.__last_index__ = m.index + m[0].length + len;\n break;\n }\n }\n }\n if (this.__opts__.fuzzyLink && this.__compiled__[\"http:\"]) {\n // guess schemaless links\n tld_pos = text.search(this.re.host_fuzzy_test);\n if (tld_pos >= 0) {\n // if tld is located after found link - no need to check fuzzy pattern\n if (this.__index__ < 0 || tld_pos < this.__index__) {\n if ((ml = text.match(this.__opts__.fuzzyIP ? this.re.link_fuzzy : this.re.link_no_ip_fuzzy)) !== null) {\n shift = ml.index + ml[1].length;\n if (this.__index__ < 0 || shift < this.__index__) {\n this.__schema__ = \"\";\n this.__index__ = shift;\n this.__last_index__ = ml.index + ml[0].length;\n }\n }\n }\n }\n }\n if (this.__opts__.fuzzyEmail && this.__compiled__[\"mailto:\"]) {\n // guess schemaless emails\n at_pos = text.indexOf(\"@\");\n if (at_pos >= 0) {\n // We can't skip this check, because this cases are possible:\n // 192.168.1.1@gmail.com, my.in@example.com\n if ((me = text.match(this.re.email_fuzzy)) !== null) {\n shift = me.index + me[1].length;\n next = me.index + me[0].length;\n if (this.__index__ < 0 || shift < this.__index__ || shift === this.__index__ && next > this.__last_index__) {\n this.__schema__ = \"mailto:\";\n this.__index__ = shift;\n this.__last_index__ = next;\n }\n }\n }\n }\n return this.__index__ >= 0;\n };\n /**\n * LinkifyIt#pretest(text) -> Boolean\n *\n * Very quick check, that can give false positives. Returns true if link MAY BE\n * can exists. Can be used for speed optimization, when you need to check that\n * link NOT exists.\n **/ LinkifyIt.prototype.pretest = function pretest(text) {\n return this.re.pretest.test(text);\n };\n /**\n * LinkifyIt#testSchemaAt(text, name, position) -> Number\n * - text (String): text to scan\n * - name (String): rule (schema) name\n * - position (Number): text offset to check from\n *\n * Similar to [[LinkifyIt#test]] but checks only specific protocol tail exactly\n * at given position. Returns length of found pattern (0 on fail).\n **/ LinkifyIt.prototype.testSchemaAt = function testSchemaAt(text, schema, pos) {\n // If not supported schema check requested - terminate\n if (!this.__compiled__[schema.toLowerCase()]) {\n return 0;\n }\n return this.__compiled__[schema.toLowerCase()].validate(text, pos, this);\n };\n /**\n * LinkifyIt#match(text) -> Array|null\n *\n * Returns array of found link descriptions or `null` on fail. We strongly\n * recommend to use [[LinkifyIt#test]] first, for best speed.\n *\n * ##### Result match description\n *\n * - __schema__ - link schema, can be empty for fuzzy links, or `//` for\n * protocol-neutral links.\n * - __index__ - offset of matched text\n * - __lastIndex__ - index of next char after mathch end\n * - __raw__ - matched text\n * - __text__ - normalized text\n * - __url__ - link, generated from matched text\n **/ LinkifyIt.prototype.match = function match(text) {\n const result = [];\n let shift = 0;\n // Try to take previous element from cache, if .test() called before\n if (this.__index__ >= 0 && this.__text_cache__ === text) {\n result.push(createMatch(this, shift));\n shift = this.__last_index__;\n }\n // Cut head if cache was used\n let tail = shift ? text.slice(shift) : text;\n // Scan string until end reached\n while (this.test(tail)) {\n result.push(createMatch(this, shift));\n tail = tail.slice(this.__last_index__);\n shift += this.__last_index__;\n }\n if (result.length) {\n return result;\n }\n return null;\n };\n /**\n * LinkifyIt#matchAtStart(text) -> Match|null\n *\n * Returns fully-formed (not fuzzy) link if it starts at the beginning\n * of the string, and null otherwise.\n **/ LinkifyIt.prototype.matchAtStart = function matchAtStart(text) {\n // Reset scan cache\n this.__text_cache__ = text;\n this.__index__ = -1;\n if (!text.length) return null;\n const m = this.re.schema_at_start.exec(text);\n if (!m) return null;\n const len = this.testSchemaAt(text, m[2], m[0].length);\n if (!len) return null;\n this.__schema__ = m[2];\n this.__index__ = m.index + m[1].length;\n this.__last_index__ = m.index + m[0].length + len;\n return createMatch(this, 0);\n };\n /** chainable\n * LinkifyIt#tlds(list [, keepOld]) -> this\n * - list (Array): list of tlds\n * - keepOld (Boolean): merge with current list if `true` (`false` by default)\n *\n * Load (or merge) new tlds list. Those are user for fuzzy links (without prefix)\n * to avoid false positives. By default this algorythm used:\n *\n * - hostname with any 2-letter root zones are ok.\n * - biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|\u0440\u0444\n * are ok.\n * - encoded (`xn--...`) root zones are ok.\n *\n * If list is replaced, then exact match for 2-chars root zones will be checked.\n **/ LinkifyIt.prototype.tlds = function tlds(list, keepOld) {\n list = Array.isArray(list) ? list : [ list ];\n if (!keepOld) {\n this.__tlds__ = list.slice();\n this.__tlds_replaced__ = true;\n compile(this);\n return this;\n }\n this.__tlds__ = this.__tlds__.concat(list).sort().filter(function(el, idx, arr) {\n return el !== arr[idx - 1];\n }).reverse();\n compile(this);\n return this;\n };\n /**\n * LinkifyIt#normalize(match)\n *\n * Default normalizer (if schema does not define it's own).\n **/ LinkifyIt.prototype.normalize = function normalize(match) {\n // Do minimal possible changes by default. Need to collect feedback prior\n // to move forward https://github.com/markdown-it/linkify-it/issues/1\n if (!match.schema) {\n match.url = \"http://\" + match.url;\n }\n if (match.schema === \"mailto:\" && !/^mailto:/i.test(match.url)) {\n match.url = \"mailto:\" + match.url;\n }\n };\n /**\n * LinkifyIt#onCompile()\n *\n * Override to modify basic RegExp-s.\n **/ LinkifyIt.prototype.onCompile = function onCompile() {};\n /** Highest positive signed 32-bit float value */ const maxInt = 2147483647;\n // aka. 0x7FFFFFFF or 2^31-1\n /** Bootstring parameters */ const base = 36;\n const tMin = 1;\n const tMax = 26;\n const skew = 38;\n const damp = 700;\n const initialBias = 72;\n const initialN = 128;\n // 0x80\n const delimiter = \"-\";\n // '\\x2D'\n /** Regular expressions */ const regexPunycode = /^xn--/;\n const regexNonASCII = /[^\\0-\\x7F]/;\n // Note: U+007F DEL is excluded too.\n const regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g;\n // RFC 3490 separators\n /** Error messages */ const errors = {\n overflow: \"Overflow: input needs wider integers to process\",\n \"not-basic\": \"Illegal input >= 0x80 (not a basic code point)\",\n \"invalid-input\": \"Invalid input\"\n };\n /** Convenience shortcuts */ const baseMinusTMin = base - tMin;\n const floor = Math.floor;\n const stringFromCharCode = String.fromCharCode;\n /*--------------------------------------------------------------------------*/\n /**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */ function error(type) {\n throw new RangeError(errors[type]);\n }\n /**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */ function map(array, callback) {\n const result = [];\n let length = array.length;\n while (length--) {\n result[length] = callback(array[length]);\n }\n return result;\n }\n /**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {String} A new string of characters returned by the callback\n * function.\n */ function mapDomain(domain, callback) {\n const parts = domain.split(\"@\");\n let result = \"\";\n if (parts.length > 1) {\n // In email addresses, only the domain name should be punycoded. Leave\n // the local part (i.e. everything up to `@`) intact.\n result = parts[0] + \"@\";\n domain = parts[1];\n }\n // Avoid `split(regex)` for IE8 compatibility. See #17.\n domain = domain.replace(regexSeparators, \".\");\n const labels = domain.split(\".\");\n const encoded = map(labels, callback).join(\".\");\n return result + encoded;\n }\n /**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see \n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */ function ucs2decode(string) {\n const output = [];\n let counter = 0;\n const length = string.length;\n while (counter < length) {\n const value = string.charCodeAt(counter++);\n if (value >= 55296 && value <= 56319 && counter < length) {\n // It's a high surrogate, and there is a next character.\n const extra = string.charCodeAt(counter++);\n if ((extra & 64512) == 56320) {\n // Low surrogate.\n output.push(((value & 1023) << 10) + (extra & 1023) + 65536);\n } else {\n // It's an unmatched surrogate; only append this code unit, in case the\n // next code unit is the high surrogate of a surrogate pair.\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n }\n /**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */ const ucs2encode = codePoints => String.fromCodePoint(...codePoints);\n /**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */ const basicToDigit = function(codePoint) {\n if (codePoint >= 48 && codePoint < 58) {\n return 26 + (codePoint - 48);\n }\n if (codePoint >= 65 && codePoint < 91) {\n return codePoint - 65;\n }\n if (codePoint >= 97 && codePoint < 123) {\n return codePoint - 97;\n }\n return base;\n };\n /**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */ const digitToBasic = function(digit, flag) {\n // 0..25 map to ASCII a..z or A..Z\n // 26..35 map to ASCII 0..9\n return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n };\n /**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */ const adapt = function(delta, numPoints, firstTime) {\n let k = 0;\n delta = firstTime ? floor(delta / damp) : delta >> 1;\n delta += floor(delta / numPoints);\n for (;delta > baseMinusTMin * tMax >> 1; k += base) {\n delta = floor(delta / baseMinusTMin);\n }\n return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n };\n /**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */ const decode = function(input) {\n // Don't use UCS-2.\n const output = [];\n const inputLength = input.length;\n let i = 0;\n let n = initialN;\n let bias = initialBias;\n // Handle the basic code points: let `basic` be the number of input code\n // points before the last delimiter, or `0` if there is none, then copy\n // the first basic code points to the output.\n let basic = input.lastIndexOf(delimiter);\n if (basic < 0) {\n basic = 0;\n }\n for (let j = 0; j < basic; ++j) {\n // if it's not a basic code point\n if (input.charCodeAt(j) >= 128) {\n error(\"not-basic\");\n }\n output.push(input.charCodeAt(j));\n }\n // Main decoding loop: start just after the last delimiter if any basic code\n // points were copied; start at the beginning otherwise.\n for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; ) {\n // `index` is the index of the next character to be consumed.\n // Decode a generalized variable-length integer into `delta`,\n // which gets added to `i`. The overflow checking is easier\n // if we increase `i` as we go, then subtract off its starting\n // value at the end to obtain `delta`.\n const oldi = i;\n for (let w = 1, k = base; ;k += base) {\n if (index >= inputLength) {\n error(\"invalid-input\");\n }\n const digit = basicToDigit(input.charCodeAt(index++));\n if (digit >= base) {\n error(\"invalid-input\");\n }\n if (digit > floor((maxInt - i) / w)) {\n error(\"overflow\");\n }\n i += digit * w;\n const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n if (digit < t) {\n break;\n }\n const baseMinusT = base - t;\n if (w > floor(maxInt / baseMinusT)) {\n error(\"overflow\");\n }\n w *= baseMinusT;\n }\n const out = output.length + 1;\n bias = adapt(i - oldi, out, oldi == 0);\n // `i` was supposed to wrap around from `out` to `0`,\n // incrementing `n` each time, so we'll fix that now:\n if (floor(i / out) > maxInt - n) {\n error(\"overflow\");\n }\n n += floor(i / out);\n i %= out;\n // Insert `n` at position `i` of the output.\n output.splice(i++, 0, n);\n }\n return String.fromCodePoint(...output);\n };\n /**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */ const encode = function(input) {\n const output = [];\n // Convert the input in UCS-2 to an array of Unicode code points.\n input = ucs2decode(input);\n // Cache the length.\n const inputLength = input.length;\n // Initialize the state.\n let n = initialN;\n let delta = 0;\n let bias = initialBias;\n // Handle the basic code points.\n for (const currentValue of input) {\n if (currentValue < 128) {\n output.push(stringFromCharCode(currentValue));\n }\n }\n const basicLength = output.length;\n let handledCPCount = basicLength;\n // `handledCPCount` is the number of code points that have been handled;\n // `basicLength` is the number of basic code points.\n // Finish the basic string with a delimiter unless it's empty.\n if (basicLength) {\n output.push(delimiter);\n }\n // Main encoding loop:\n while (handledCPCount < inputLength) {\n // All non-basic code points < n have been handled already. Find the next\n // larger one:\n let m = maxInt;\n for (const currentValue of input) {\n if (currentValue >= n && currentValue < m) {\n m = currentValue;\n }\n }\n // Increase `delta` enough to advance the decoder's state to ,\n // but guard against overflow.\n const handledCPCountPlusOne = handledCPCount + 1;\n if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n error(\"overflow\");\n }\n delta += (m - n) * handledCPCountPlusOne;\n n = m;\n for (const currentValue of input) {\n if (currentValue < n && ++delta > maxInt) {\n error(\"overflow\");\n }\n if (currentValue === n) {\n // Represent delta as a generalized variable-length integer.\n let q = delta;\n for (let k = base; ;k += base) {\n const t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;\n if (q < t) {\n break;\n }\n const qMinusT = q - t;\n const baseMinusT = base - t;\n output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));\n q = floor(qMinusT / baseMinusT);\n }\n output.push(stringFromCharCode(digitToBasic(q, 0)));\n bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);\n delta = 0;\n ++handledCPCount;\n }\n }\n ++delta;\n ++n;\n }\n return output.join(\"\");\n };\n /**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */ const toUnicode = function(input) {\n return mapDomain(input, function(string) {\n return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;\n });\n };\n /**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */ const toASCII = function(input) {\n return mapDomain(input, function(string) {\n return regexNonASCII.test(string) ? \"xn--\" + encode(string) : string;\n });\n };\n /*--------------------------------------------------------------------------*/\n /** Define the public API */ const punycode = {\n /**\n * A string representing the current Punycode.js version number.\n * @memberOf punycode\n * @type String\n */\n version: \"2.3.1\",\n /**\n * An object of methods to convert from JavaScript's internal character\n * representation (UCS-2) to Unicode code points, and back.\n * @see \n * @memberOf punycode\n * @type Object\n */\n ucs2: {\n decode: ucs2decode,\n encode: ucs2encode\n },\n decode: decode,\n encode: encode,\n toASCII: toASCII,\n toUnicode: toUnicode\n };\n // markdown-it default options\n var cfg_default = {\n options: {\n // Enable HTML tags in source\n html: false,\n // Use '/' to close single tags (
)\n xhtmlOut: false,\n // Convert '\\n' in paragraphs into
\n breaks: false,\n // CSS language prefix for fenced blocks\n langPrefix: \"language-\",\n // autoconvert URL-like texts to links\n linkify: false,\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n // For example, you can use '\u00AB\u00BB\u201E\u201C' for Russian, '\u201E\u201C\u201A\u2018' for German,\n // and ['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A'] for French (including nbsp).\n quotes: \"\\u201c\\u201d\\u2018\\u2019\",\n /* \u201C\u201D\u2018\u2019 */\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with )\n xhtmlOut: false,\n // Convert '\\n' in paragraphs into
\n breaks: false,\n // CSS language prefix for fenced blocks\n langPrefix: \"language-\",\n // autoconvert URL-like texts to links\n linkify: false,\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n // For example, you can use '\u00AB\u00BB\u201E\u201C' for Russian, '\u201E\u201C\u201A\u2018' for German,\n // and ['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A'] for French (including nbsp).\n quotes: \"\\u201c\\u201d\\u2018\\u2019\",\n /* \u201C\u201D\u2018\u2019 */\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with )\n xhtmlOut: true,\n // Convert '\\n' in paragraphs into
\n breaks: false,\n // CSS language prefix for fenced blocks\n langPrefix: \"language-\",\n // autoconvert URL-like texts to links\n linkify: false,\n // Enable some language-neutral replacements + quotes beautification\n typographer: false,\n // Double + single quotes replacement pairs, when typographer enabled,\n // and smartquotes on. Could be either a String or an Array.\n // For example, you can use '\u00AB\u00BB\u201E\u201C' for Russian, '\u201E\u201C\u201A\u2018' for German,\n // and ['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A'] for French (including nbsp).\n quotes: \"\\u201c\\u201d\\u2018\\u2019\",\n /* \u201C\u201D\u2018\u2019 */\n // Highlighter function. Should return escaped HTML,\n // or '' if the source string is not changed and should be escaped externaly.\n // If result starts with = 0) {\n try {\n parsed.hostname = punycode.toASCII(parsed.hostname);\n } catch (er) {}\n }\n }\n return encode$1(format(parsed));\n }\n function normalizeLinkText(url) {\n const parsed = urlParse(url, true);\n if (parsed.hostname) {\n // Encode hostnames in urls like:\n // `http://host/`, `https://host/`, `mailto:user@host`, `//host/`\n // We don't encode unknown schemas, because it's likely that we encode\n // something we shouldn't (e.g. `skype:name` treated as `skype:host`)\n if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) {\n try {\n parsed.hostname = punycode.toUnicode(parsed.hostname);\n } catch (er) {}\n }\n }\n // add '%' to exclude list because of https://github.com/markdown-it/markdown-it/issues/720\n return decode$1(format(parsed), decode$1.defaultChars + \"%\");\n }\n /**\n * class MarkdownIt\n *\n * Main parser/renderer class.\n *\n * ##### Usage\n *\n * ```javascript\n * // node.js, \"classic\" way:\n * var MarkdownIt = require('markdown-it'),\n * md = new MarkdownIt();\n * var result = md.render('# markdown-it rulezz!');\n *\n * // node.js, the same, but with sugar:\n * var md = require('markdown-it')();\n * var result = md.render('# markdown-it rulezz!');\n *\n * // browser without AMD, added to \"window\" on script load\n * // Note, there are no dash.\n * var md = window.markdownit();\n * var result = md.render('# markdown-it rulezz!');\n * ```\n *\n * Single line rendering, without paragraph wrap:\n *\n * ```javascript\n * var md = require('markdown-it')();\n * var result = md.renderInline('__markdown-it__ rulezz!');\n * ```\n **/\n /**\n * new MarkdownIt([presetName, options])\n * - presetName (String): optional, `commonmark` / `zero`\n * - options (Object)\n *\n * Creates parser instanse with given config. Can be called without `new`.\n *\n * ##### presetName\n *\n * MarkdownIt provides named presets as a convenience to quickly\n * enable/disable active syntax rules and options for common use cases.\n *\n * - [\"commonmark\"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/commonmark.mjs) -\n * configures parser to strict [CommonMark](http://commonmark.org/) mode.\n * - [default](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/default.mjs) -\n * similar to GFM, used when no preset name given. Enables all available rules,\n * but still without html, typographer & autolinker.\n * - [\"zero\"](https://github.com/markdown-it/markdown-it/blob/master/lib/presets/zero.mjs) -\n * all rules disabled. Useful to quickly setup your config via `.enable()`.\n * For example, when you need only `bold` and `italic` markup and nothing else.\n *\n * ##### options:\n *\n * - __html__ - `false`. Set `true` to enable HTML tags in source. Be careful!\n * That's not safe! You may need external sanitizer to protect output from XSS.\n * It's better to extend features via plugins, instead of enabling HTML.\n * - __xhtmlOut__ - `false`. Set `true` to add '/' when closing single tags\n * (`
`). This is needed only for full CommonMark compatibility. In real\n * world you will need HTML output.\n * - __breaks__ - `false`. Set `true` to convert `\\n` in paragraphs into `
`.\n * - __langPrefix__ - `language-`. CSS language class prefix for fenced blocks.\n * Can be useful for external highlighters.\n * - __linkify__ - `false`. Set `true` to autoconvert URL-like text to links.\n * - __typographer__ - `false`. Set `true` to enable [some language-neutral\n * replacement](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/replacements.mjs) +\n * quotes beautification (smartquotes).\n * - __quotes__ - `\u201C\u201D\u2018\u2019`, String or Array. Double + single quotes replacement\n * pairs, when typographer enabled and smartquotes on. For example, you can\n * use `'\u00AB\u00BB\u201E\u201C'` for Russian, `'\u201E\u201C\u201A\u2018'` for German, and\n * `['\u00AB\\xA0', '\\xA0\u00BB', '\u2039\\xA0', '\\xA0\u203A']` for French (including nbsp).\n * - __highlight__ - `null`. Highlighter function for fenced code blocks.\n * Highlighter `function (str, lang)` should return escaped HTML. It can also\n * return empty string if the source was not changed and should be escaped\n * externaly. If result starts with ` or ``):\n *\n * ```javascript\n * var hljs = require('highlight.js') // https://highlightjs.org/\n *\n * // Actual default values\n * var md = require('markdown-it')({\n * highlight: function (str, lang) {\n * if (lang && hljs.getLanguage(lang)) {\n * try {\n * return '
' +\n   *                hljs.highlight(str, { language: lang, ignoreIllegals: true }).value +\n   *                '
';\n * } catch (__) {}\n * }\n *\n * return '
' + md.utils.escapeHtml(str) + '
';\n * }\n * });\n * ```\n *\n **/ function MarkdownIt(presetName, options) {\n if (!(this instanceof MarkdownIt)) {\n return new MarkdownIt(presetName, options);\n }\n if (!options) {\n if (!isString$1(presetName)) {\n options = presetName || {};\n presetName = \"default\";\n }\n }\n /**\n * MarkdownIt#inline -> ParserInline\n *\n * Instance of [[ParserInline]]. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/ this.inline = new ParserInline;\n /**\n * MarkdownIt#block -> ParserBlock\n *\n * Instance of [[ParserBlock]]. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/ this.block = new ParserBlock;\n /**\n * MarkdownIt#core -> Core\n *\n * Instance of [[Core]] chain executor. You may need it to add new rules when\n * writing plugins. For simple rules control use [[MarkdownIt.disable]] and\n * [[MarkdownIt.enable]].\n **/ this.core = new Core;\n /**\n * MarkdownIt#renderer -> Renderer\n *\n * Instance of [[Renderer]]. Use it to modify output look. Or to add rendering\n * rules for new token types, generated by plugins.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')();\n *\n * function myToken(tokens, idx, options, env, self) {\n * //...\n * return result;\n * };\n *\n * md.renderer.rules['my_token'] = myToken\n * ```\n *\n * See [[Renderer]] docs and [source code](https://github.com/markdown-it/markdown-it/blob/master/lib/renderer.mjs).\n **/ this.renderer = new Renderer;\n /**\n * MarkdownIt#linkify -> LinkifyIt\n *\n * [linkify-it](https://github.com/markdown-it/linkify-it) instance.\n * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/lib/rules_core/linkify.mjs)\n * rule.\n **/ this.linkify = new LinkifyIt;\n /**\n * MarkdownIt#validateLink(url) -> Boolean\n *\n * Link validation function. CommonMark allows too much in links. By default\n * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas\n * except some embedded image types.\n *\n * You can change this behaviour:\n *\n * ```javascript\n * var md = require('markdown-it')();\n * // enable everything\n * md.validateLink = function () { return true; }\n * ```\n **/ this.validateLink = validateLink;\n /**\n * MarkdownIt#normalizeLink(url) -> String\n *\n * Function used to encode link url to a machine-readable format,\n * which includes url-encoding, punycode, etc.\n **/ this.normalizeLink = normalizeLink;\n /**\n * MarkdownIt#normalizeLinkText(url) -> String\n *\n * Function used to decode link url to a human-readable format`\n **/ this.normalizeLinkText = normalizeLinkText;\n // Expose utils & helpers for easy acces from plugins\n /**\n * MarkdownIt#utils -> utils\n *\n * Assorted utility functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/common/utils.mjs).\n **/ this.utils = utils;\n /**\n * MarkdownIt#helpers -> helpers\n *\n * Link components parser functions, useful to write plugins. See details\n * [here](https://github.com/markdown-it/markdown-it/blob/master/lib/helpers).\n **/ this.helpers = assign$1({}, helpers);\n this.options = {};\n this.configure(presetName);\n if (options) {\n this.set(options);\n }\n }\n /** chainable\n * MarkdownIt.set(options)\n *\n * Set parser options (in the same format as in constructor). Probably, you\n * will never need it, but you can change options after constructor call.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')()\n * .set({ html: true, breaks: true })\n * .set({ typographer, true });\n * ```\n *\n * __Note:__ To achieve the best possible performance, don't modify a\n * `markdown-it` instance options on the fly. If you need multiple configurations\n * it's best to create multiple instances and initialize each with separate\n * config.\n **/ MarkdownIt.prototype.set = function(options) {\n assign$1(this.options, options);\n return this;\n };\n /** chainable, internal\n * MarkdownIt.configure(presets)\n *\n * Batch load of all options and compenent settings. This is internal method,\n * and you probably will not need it. But if you will - see available presets\n * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/lib/presets)\n *\n * We strongly recommend to use presets instead of direct config loads. That\n * will give better compatibility with next versions.\n **/ MarkdownIt.prototype.configure = function(presets) {\n const self = this;\n if (isString$1(presets)) {\n const presetName = presets;\n presets = config[presetName];\n if (!presets) {\n throw new Error('Wrong `markdown-it` preset \"' + presetName + '\", check name');\n }\n }\n if (!presets) {\n throw new Error(\"Wrong `markdown-it` preset, can't be empty\");\n }\n if (presets.options) {\n self.set(presets.options);\n }\n if (presets.components) {\n Object.keys(presets.components).forEach(function(name) {\n if (presets.components[name].rules) {\n self[name].ruler.enableOnly(presets.components[name].rules);\n }\n if (presets.components[name].rules2) {\n self[name].ruler2.enableOnly(presets.components[name].rules2);\n }\n });\n }\n return this;\n };\n /** chainable\n * MarkdownIt.enable(list, ignoreInvalid)\n * - list (String|Array): rule name or list of rule names to enable\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * Enable list or rules. It will automatically find appropriate components,\n * containing rules with given names. If rule not found, and `ignoreInvalid`\n * not set - throws exception.\n *\n * ##### Example\n *\n * ```javascript\n * var md = require('markdown-it')()\n * .enable(['sub', 'sup'])\n * .disable('smartquotes');\n * ```\n **/ MarkdownIt.prototype.enable = function(list, ignoreInvalid) {\n let result = [];\n if (!Array.isArray(list)) {\n list = [ list ];\n }\n [ \"core\", \"block\", \"inline\" ].forEach(function(chain) {\n result = result.concat(this[chain].ruler.enable(list, true));\n }, this);\n result = result.concat(this.inline.ruler2.enable(list, true));\n const missed = list.filter(function(name) {\n return result.indexOf(name) < 0;\n });\n if (missed.length && !ignoreInvalid) {\n throw new Error(\"MarkdownIt. Failed to enable unknown rule(s): \" + missed);\n }\n return this;\n };\n /** chainable\n * MarkdownIt.disable(list, ignoreInvalid)\n * - list (String|Array): rule name or list of rule names to disable.\n * - ignoreInvalid (Boolean): set `true` to ignore errors when rule not found.\n *\n * The same as [[MarkdownIt.enable]], but turn specified rules off.\n **/ MarkdownIt.prototype.disable = function(list, ignoreInvalid) {\n let result = [];\n if (!Array.isArray(list)) {\n list = [ list ];\n }\n [ \"core\", \"block\", \"inline\" ].forEach(function(chain) {\n result = result.concat(this[chain].ruler.disable(list, true));\n }, this);\n result = result.concat(this.inline.ruler2.disable(list, true));\n const missed = list.filter(function(name) {\n return result.indexOf(name) < 0;\n });\n if (missed.length && !ignoreInvalid) {\n throw new Error(\"MarkdownIt. Failed to disable unknown rule(s): \" + missed);\n }\n return this;\n };\n /** chainable\n * MarkdownIt.use(plugin, params)\n *\n * Load specified plugin with given params into current parser instance.\n * It's just a sugar to call `plugin(md, params)` with curring.\n *\n * ##### Example\n *\n * ```javascript\n * var iterator = require('markdown-it-for-inline');\n * var md = require('markdown-it')()\n * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {\n * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar');\n * });\n * ```\n **/ MarkdownIt.prototype.use = function(plugin /*, params, ... */) {\n const args = [ this ].concat(Array.prototype.slice.call(arguments, 1));\n plugin.apply(plugin, args);\n return this;\n };\n /** internal\n * MarkdownIt.parse(src, env) -> Array\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Parse input string and return list of block tokens (special token type\n * \"inline\" will contain list of inline tokens). You should not call this\n * method directly, until you write custom renderer (for example, to produce\n * AST).\n *\n * `env` is used to pass data between \"distributed\" rules and return additional\n * metadata like reference info, needed for the renderer. It also can be used to\n * inject data in specific cases. Usually, you will be ok to pass `{}`,\n * and then pass updated object to renderer.\n **/ MarkdownIt.prototype.parse = function(src, env) {\n if (typeof src !== \"string\") {\n throw new Error(\"Input data should be a String\");\n }\n const state = new this.core.State(src, this, env);\n this.core.process(state);\n return state.tokens;\n };\n /**\n * MarkdownIt.render(src [, env]) -> String\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Render markdown string into html. It does all magic for you :).\n *\n * `env` can be used to inject additional metadata (`{}` by default).\n * But you will not need it with high probability. See also comment\n * in [[MarkdownIt.parse]].\n **/ MarkdownIt.prototype.render = function(src, env) {\n env = env || {};\n return this.renderer.render(this.parse(src, env), this.options, env);\n };\n /** internal\n * MarkdownIt.parseInline(src, env) -> Array\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * The same as [[MarkdownIt.parse]] but skip all block rules. It returns the\n * block tokens list with the single `inline` element, containing parsed inline\n * tokens in `children` property. Also updates `env` object.\n **/ MarkdownIt.prototype.parseInline = function(src, env) {\n const state = new this.core.State(src, this, env);\n state.inlineMode = true;\n this.core.process(state);\n return state.tokens;\n };\n /**\n * MarkdownIt.renderInline(src [, env]) -> String\n * - src (String): source string\n * - env (Object): environment sandbox\n *\n * Similar to [[MarkdownIt.render]] but for single paragraph content. Result\n * will NOT be wrapped into `

` tags.\n **/ MarkdownIt.prototype.renderInline = function(src, env) {\n env = env || {};\n return this.renderer.render(this.parseInline(src, env), this.options, env);\n };\n return MarkdownIt;\n});\n", "// This file is part of Stack - https://stack.maths.ed.ac.uk\n//\n// Stack is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// Stack is distributed in the hope that it will be useful,\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with Stack. If not, see .\n\n/**\n * This is part of the free text input/ ASCII display block.\n *\n * @package qtype_stack\n * @copyright 2026 University of Edinburgh\n * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later\n */\n\n// Markdown-it block rule plugin.\n//\n// Syntax:\n// Opening marker: a single backtick, optionally followed by spaces/tabs, at end of line.\n// Content: any lines until the closing marker.\n// Closing marker: any line whose first non-whitespace character is a backtick.\n//\n// A backtick followed by non-whitespace characters is left untouched so that\n// code_inline still fires for `inline code`.\n\n// UMD wrapper: works as a plain